hate these ads?, log in or register to hide them
Page 129 of 129 FirstFirst ... 2979119126127128129
Results 2,561 to 2,577 of 2577

Thread: <xml><thread isTerrible="true" isUnderstandable="false" /></xml> - Coding help thread

  1. #2561

    Join Date
    April 13, 2011
    Posts
    7,737
    There's no titleCase(..) method in PS?

  2. #2562

    Join Date
    May 31, 2011
    Posts
    5,117
    Well, both methods don't work reliably with the typical suspects like McDonald, van Helsing, D'Acosta anyway. So I'm not sure of how much use it is in real world applications.

  3. #2563

    Join Date
    May 30, 2011
    Location
    asleep
    Posts
    6,914
    I'm importing 600 mail users and about 2/3 of them are all NAMED IN UPPER CASE and it's fucking annoying
    there does seem to be an approximation of Titlecase now you mention it:
    Code:
    $info = (get-culture).textinfo
    $input = read-host "Input string" 
    $info.titlecase($input.tolower())
    a bit neater thanks
    Please don't teach me what to do with my pc.

  4. #2564

    Join Date
    May 31, 2011
    Posts
    5,117
    Quote Originally Posted by Itiken View Post
    I'm importing 600 mail users and about 2/3 of them are all NAMED IN UPPER CASE and it's fucking annoying
    Most likely because THEY ARE IMPORTANT!!! ;-)

    But I feel your pain. There are admins that when dealing with a new system for the first time look around how things have been done and follow those standards. They might or might not agree with it, but they try to follow what's already there.

    And then there are those who do like they please. Not even following their personal conventions, because they have none. Today it was all lower case, today it's proper casing, tomorrow it'll be upper case. I shudder and cringe when coming across such inconsistencies. It buggers me to no end.

  5. #2565

    Join Date
    May 31, 2011
    Posts
    5,117
    Here's a question to which I haven't found a satisfying answer yet.

    Suppose a method for deleting a file in an assembly. What's considered to be best practice for such a case?

    Return a method result indicating a problem/failure.
    Code:
    Enum IOResult
    	Success = 0
    	FileNotFound
    	AccessDenied
    	OtherUnknown = 255
    End Enum
    
    Function DeleteFile(ByVal theFile As String) As IOResult
    	If Not File.Exists(theFile) Then
    	   Return IOResult.FileNotFound
    	End If
    End Function
    Throw an exception
    Code:
    Sub DeleteFile(ByVal theFile As String)
    	If Not File.Exists(theFile) Then
               Throw New ArgumentException("File not found: " & theFile)
    	End If
    End Sub

  6. #2566
    Daneel Trevize's Avatar
    Join Date
    April 10, 2011
    Location
    T L A
    Posts
    12,693
    In theory? If that Enum result is type-safe as per the (JIT) compiler, and it can be made public/final without future refactoring concerns, that should be faster and cleaner than exception handling.
    Quote Originally Posted by QuackBot View Post
    Idk about that, and i'm fucking stupid.

  7. #2567

    Join Date
    May 31, 2011
    Posts
    5,117
    Can someone recommend a decent Python 3 beginner's tutorial for someone like me with a programming background?

    Ofc, there's this list at python.org and also (too) many search results. The crux for a beginner is to tell the good ones apart from the bad ones.

    Usage will be devops-related, so I guess tutorials involving/focusing around e.g. GUI widgets/desktop application/web development (Django)/data analysis aren't of much help there.

  8. #2568

  9. #2569

    Join Date
    May 31, 2011
    Posts
    5,117
    Can any of you guys recommend a reliable free/open geolocation API service, which gets at least the country right from the IP address (assuming the IP reflects the actual location of the device and isn't messed with by e.g. a proxy) most of the time?

  10. #2570
    Cosmin's Avatar
    Join Date
    March 14, 2012
    Location
    UK
    Posts
    6,962
    Quote Originally Posted by elmicker View Post
    This is an amazing resource.
    Guns make the news, science doesn't.

  11. #2571
    Movember 2012 I Legionnaire's Avatar
    Join Date
    April 9, 2011
    Posts
    1,999
    Software development, not even once.




  12. #2572
    NoirAvlaa's Avatar
    Join Date
    April 12, 2011
    Location
    Liverpool, laaaa
    Posts
    5,433
    Gonna get back into android Dev, last time I was doing native android everything was on java and mvp... Any good resources for kotlin mvvm android that anyone knows about?

    Sent from my Potato using my fingers

  13. #2573
    NoirAvlaa's Avatar
    Join Date
    April 12, 2011
    Location
    Liverpool, laaaa
    Posts
    5,433
    Any nerds here proficient in kotlin, livedata and coroutines?

    Sent from my Potato using my fingers

  14. #2574
    Movember 2011Movember 2012 Nordstern's Avatar
    Join Date
    April 10, 2011
    Posts
    11,478
    "Holy shit, I ask you to stop being autistic and you debate what autistic is." - spasm
    Quote Originally Posted by Larkonis Trassler View Post
    WTF I hate white people now...
    Johns Hopkins CSSE COVID-19 Dashboard

  15. #2575
    Donor Aea's Avatar
    Join Date
    April 13, 2011
    Location
    Colorado
    Posts
    14,516
    I love how there's almost certainly an error on line 1, assuming it is actually returning xml.

  16. #2576
    Donor erichkknaar's Avatar
    Join Date
    April 9, 2011
    Posts
    14,766
    Quote Originally Posted by Aea View Post
    I love how there's almost certainly an error on line 1, assuming it is actually returning xml.
    From reading the comment I'd say it's transforming a generated XML document live into html using XSLT and then line feeding that into the response.
    meh

  17. #2577
    Donor Aea's Avatar
    Join Date
    April 13, 2011
    Location
    Colorado
    Posts
    14,516
    Quote Originally Posted by erichkknaar View Post
    Quote Originally Posted by Aea View Post
    I love how there's almost certainly an error on line 1, assuming it is actually returning xml.
    From reading the comment I'd say it's transforming a generated XML document live into html using XSLT and then line feeding that into the response.
    Yeah but is `<?xml version...`a valid HTML doctype?

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •