|
ehnus posted:Encountered today: If this were any other thread, I would say "check the version control logs".
|
# ¿ Apr 14, 2010 02:50 |
|
|
# ¿ Apr 24, 2024 17:24 |
|
qntm posted:Today I discovered that FTP has no capability to "get" a complete directory and all of its subdirectories. This isn't a horror at all. As others have pointed out, the protocol has everything you need to easily implement recursive transfers, and any decent ftp client - nsftp, lftp, filezilla, wget, etc - supports them. The real horror is that the plain 'ftp' command that most operating systems ship with hasn't been updated since the early 80s.
|
# ¿ Apr 16, 2010 20:38 |
|
qntm posted:Yeah, it's the ftp command that I'm complaining about, not the protocol itself. If it's so easy to implement clever recursive transfers on top of ftp, why hasn't it been done and incorporated into ftp? It kind of has.
|
# ¿ Apr 17, 2010 01:27 |
|
^ Typically you have some function for "convert this string to a number, and report failure in some way if the string cannot be parsed as a number". You might also have something like C's strtol() ("convert the leading portion of this string to a number, report both the resulting number (if any) and how much of the string is left afterwards"). In your case of "I have a string, there's a 100 in there somewhere, how do I get at" I see this as being either of the following: - input was meant to be a number, is actually a string. Input is invalid and bitching about it is the correct approach. - input is meant to be a string with a number in it somewhere. Use your favorite string processing tools (regexes, PEGs, parser combinators, etc) to extract the numeric portion from it and then feed that to the abovementioned function. (Or use your local strtol() equivalent, if you know the number is at the start.) Note that even in the case of a best-effort numeric parser like strtol(), this is an explicit "I want the contents of this string interpreted as a number", not "hey let's silently and automatically convert this string here". Coercion is the real horror.
|
# ¿ Sep 27, 2010 05:48 |
|
McGlockenshire posted:These are very good points. Why should the language do this automatically, though? Yeah, it should include tools for doing this, but I'd prefer not to have it try to guess what I meant, especially when this can hide type mismatches that are genuine bugs rather than just unclean input. Not to mention that even coercion doesn't save you from having to write error handling, unless "gently caress you not a number" coerces to 0 in a numeric context. I guess if I had to sum up my point here, it's that cleaning up bad input is a highly program-dependent process and thus should be handled by the programmer; trying to add language features to do this means the language will guess wrong sometimes, and furthermore, complicates parts of the program that have nothing to do with cleaning up input but which trigger these features anyways. Otto Skorzeny posted:4 == "4" See, I consider that "badly done coercion". (4 + "4" == 8) is acceptable, but 4 and "4" are different types, they should never compare equal unless you're doing an explicit conversion or redefining equality. Edit: McGlockenshire posted:Look, all I'm saying is that sometimes, being "sloppy" can be acceptable if the result of the sloppyness isn't harmful in the worst case. If all I need is an int, and I don't care what the user typed after it, I'm gonna cast it and spend my time fixing other problems instead. I'd rather not have my programming language make that decision for me. But with implicit coercion it is making that decision for you, and the decision is always "be sloppy". Without coercion, it's in your hands what it does - treat type mismatches as errors, convert strictly, or convert laxly (or do something else entirely I haven't thought of). And the fact that you're talking about casting it (which implies an explicit conversion) seems to indicate that you're thinking along similar lines. If your language lacks coercion, you can still get the desired sloppiness by using strtol() or tonumber() or whatever on your input before making use of it. But if it has coercion and you don't want it to be sloppy, you're hosed - or at least, you need a lot more extensive manual type checking and error handling. ToxicFrog fucked around with this message at 08:16 on Sep 27, 2010 |
# ¿ Sep 27, 2010 08:10 |
|
Otto Skorzeny posted:There's a semantic spat to be had here about whether scalar variables in Perl have types and whether perl's concept of SV's and PV's constitute datatypes, but I'll instead say that you probably also have a bone to pick with ANSI C's handling of equality between ints and floats: I'm not as mussed about it in statically typed languages, because then the type checker can ensure that (a) the coercion will never fail at runtime and (b) no information is lost - in the case of C, for example, short int == long int will upcast the lhs to a long int, int == float will upcast it to a float, and int == char * is an error (or at least a warning). In a dynamically typed language no such guarantees can be made, so the possibility exists for something that works most of the time, but fails on certain input as the coercion fails at runtime - or something that works all of the time even when it should fail and report invalid input. RankWeis posted:Yeah, unfortunately, I was posting from my iPad so google and a terminal were too complicated to actually test anything out. But I recall that languages that do this type of comparison usually have a 'strict' comparison to go along with it, and I thought python was one of them Most dynamically typed languages are nonetheless strongly typed and, consequently, tend not to pull this. It mostly seems to be a feature of weakly typed languages like Perl or TCL. It may come as no surprise that my preference is for strongly+statically typed languages.
|
# ¿ Sep 27, 2010 19:09 |
|
So wait, is it calling Number() on something that's already numeric? Or are they not only using systems hungarian, but lying about the type?
|
# ¿ Sep 27, 2010 19:22 |
|
Lysandus posted:RIMs bastard java they put on Blackberrys. That whole thing is a coding horror. My favorite part was probably finding out that in a multithreaded app, blocking the UI thread would block the entire application, including the background thread that pings the robot every 50ms to keep it from going into full reverse and destroying something. Although, to be fair, the robot was around 4-5 horrors on its own. That entire project was a clusterfuck.
|
# ¿ Sep 29, 2010 06:19 |
|
^^ I haven't run it, but from a cursory reading it looks like it should work; here's an annotated version.code:
code:
|
# ¿ Oct 14, 2010 01:04 |
|
Argue posted:Is this something that worked at some point in the past? Say, back in the day there was only one worker thread, and the socket pool was actually a queue, and then one day they decided to add more worker threads without paying attention to how sockets were matched up with requests? Or has it been broken since day one?
|
# ¿ Nov 10, 2010 01:13 |
|
^ Weird, it supports ! and everything in unicode I've thrown at it.
|
# ¿ Nov 11, 2010 23:25 |
|
E: hey new page let's get that quote tag in thereyaoi prophet posted:Tumblr lets users reblog/like posts they see on their dashboard. When you look at an individual post, it also shows you the last 50 or so 'notes' (reblogs, likes, and replies) on that post, not only by that user, but by all people who reblogged that post. Pretty interesting, right? Sounds like the sort of data you might want to visualize if you're into that sort of thing. ^^ At least you can use XHR rather than having to scrape the page and then extract the info you need from from only-mostly-valid HTML 4.something. I would kill for a stand-alone library that takes arbitrarily hosed up HTML as input and gives you its best guess at the DOM, rather than the current choice between "only support XHTML/XML" and "shoot yourself". evensevenone posted:Is there anyone in the world who upon seeing the words "ANSI C" would think "C99"? Personally, I'd reply with "do you mean ANSI C89 or ANSI C99" unless it was obvious from context.
|
# ¿ Jan 25, 2011 19:46 |
|
Zombywuf posted:libxml2, also you know, webkit and even mshtml. dark_panda posted:libtidy might help, too. Well, I've just been schooled. Tidy looks ideal, it's nice and lightweight (I don't need a full XML parser, let alone a rendering engine) and has bindings to both Scala and Lua. This'll definitely come in handy. Thanks. (HTMLAgilityPack looks nice too, but the .NET dependency is a problem.)
|
# ¿ Jan 26, 2011 06:19 |
|
Scaevolus posted:It looks like the Blackberry JVM is really bad Speaking as someone who's had the misfortune to do Blackberry development - yes, the Blackberry JVM and runtime libraries all belong in this thread. gently caress RIM, and gently caress the Blackberry. Ryouga Inverse posted:No. If blocks can have different behaviors based on their type then it's not really a horror to implement those behaviors in code. Where the code is stored isn't really of concern - if a game designer wanted to create a new block type with its own custom behaviors they'd have to write code no matter what. Implementing something that lets you write the code in a language other than Java is a ton of work for no gain. Untrue. If that were the case, languages like Lua wouldn't be showing up all over the place. Pulling this sort of game logic (as opposed to engine logic) into external scripts has a number of benefits, including making it a shitload easier to mod, and making development easier because you no longer have to recompile the entire game every time to change something - just "/reload" from in game and your changes are ready to be tested. This also means you can make your game crazy moddable without exposing the guts of the engine to everyone, although in Minecraft's case specifically the obfuscation used is so pitiful that it hardly matters. It's not "a ton of work" either; if you're using something like Lua, there are seamless or nearly-so Java APIs to it. It's trivial if the engine is designed with this in mind from day one, and even retrofitting it in isn't very hard.
|
# ¿ Feb 16, 2011 00:37 |
|
^^ I don't disagree, but where zootm's argument goes off the rails in the assumption that any use of external scripting or configuration falls into this category. The experience of Adobe, Blizzard, Gas Powered Games, Firaxis, and Relic directly contradicts this, and shows that such an architecture has very real benefits.
|
# ¿ Feb 16, 2011 21:06 |
|
Who the gently caress uses floats to store monetary amounts
|
# ¿ Feb 17, 2011 03:09 |
|
^^ Why is that? Shouldn't only one F be created, and thus, only one destroyed?
|
# ¿ Feb 21, 2011 03:36 |
|
BonzoESC posted:List appends aren't in place in python, are they? Depends on how you append. code:
The horror here, if there is one, is that + doesn't update the list in place but += does (as well as performing assignment). ToxicFrog fucked around with this message at 23:15 on Mar 28, 2011 |
# ¿ Mar 28, 2011 23:12 |
|
^^ Pretty much this.UraniumAnchor posted:Why *would* + update it in place? + shouldn't modify either of its operands. I agree. I was ambiguous there; I meant that given that + doesn't modify either operand (nor should it), it's surprising that += does (in addition to assigning).
|
# ¿ Mar 29, 2011 19:25 |
|
Lexical Unit posted:This wouldn't be a problem if you used SI to begin with like all right-thinking people do. Seriously though, I'm so sorry.
|
# ¿ Mar 31, 2011 15:55 |
|
Zombywuf posted:Yeah, it's not like I spend half my time trying to get program A to talk to program B using protocol C, which they both claim to support, but actually implement differently (and incorrectly) in both cases. Fixed that for you.
|
# ¿ Apr 2, 2011 20:02 |
|
Am I missing something, or could that whole thing be replaced with:code:
|
# ¿ Apr 11, 2011 18:48 |
|
GreatKesh posted:It's not actual code but rather a language and the fact I have to use it to pass this class Someone should educate them. (Comedy option: start them on Inform 7 so that they can complain it's not real programming because it doesn't use {} to delimit code blocks.) (Cruelty option: start them on C++ with OpenGL so that they no longer want to make games, learn how to program, or live.)
|
# ¿ May 15, 2011 20:38 |
|
Internet Janitor posted:ToxicFrog: I was very disappointed that none of those links involved Delphi. Apparently you can write games with it: http://delphigamedev.com/ I figured you probably could, but I don't know Delphi or any of its libraries, so I stuck to what I know.
|
# ¿ May 16, 2011 01:32 |
|
^^ Or should, anyways. Here we start students off on C because there's no money in the budget for the co-op and non-co-op students to take different courses in first year, and there's apparently no demand in the industry for anything but C and Java. I see a lot of students in second year who can program in C badly but who can't really program - they get so bogged down in the overhead of learning C that they don't really learn any of the underlying concepts. There were similar issues when they started with Java. A lot of the profs would rather move first year to Python, but it's never going to happen as long as the people running the co-op program have their heads up their arses. ToxicFrog fucked around with this message at 16:25 on May 20, 2011 |
# ¿ May 20, 2011 16:22 |
|
Zombywuf posted:The overhead of learning C, or the overhead of complex memory management that was taught to them before they were finished learning for loops? GrumpyDoctor beat me to it. C has a lot of up-front complexity compared to Scheme, Lua, or even Python, and is a lot harder to experiment with - even before you start talking about memory management. This is fine if you already have the fundamentals down, but if you're going into a first-year programming course, you probably don't. The result of this is that the language gets in the way of the learning; you end up with a lot of people who know how to cobble together a program in C by regurgitating individual fragments of code, but don't actually understand what they're doing because they had to spend the entire semester learning C rather than learning how to program.
|
# ¿ May 20, 2011 21:44 |
|
I'm fond of "exception thrown without stack frame" myself.
|
# ¿ May 28, 2011 16:48 |
|
This is compounded by the fact that most academics that aren't in CS or something closely related have little experience and no formal training in programming. So they learn just enough fortran/C/python to make something that works (or adapt existing code into something that works), get the results, and move on. In the parallel programming class that I TA, we often see researchers from other disciplines (physics and biology in particular) who are hoping to learn enough to parallelize their takes-days-to-run software and get some significant improvements. In most cases, they lack the fundamentals that are necessary to understand the course material; the rest often decide to just stick with what they have rather than completely redesigning the program (which is often what would be necessary).
|
# ¿ Jun 15, 2011 22:40 |
|
Room Temperature posted:Your way: This poo poo right here is why I use spaces everywhere, despite agreeing in principle with "indent with tabs, align with spaces"; I have never used an editor that doesn't gently caress up in this manner as soon as you start actually aligning things.
|
# ¿ Aug 5, 2011 22:21 |
|
Che Delilas posted:Never knew this (not that I ever used the language), but that quote is a pretty reasonable conclusion if you don't know, is it not? Especially if you don't speak Portuguese. I guess, except that in all of the documentation, websites that discuss it, etc it's written "Lua" and not "LUA".
|
# ¿ Sep 22, 2011 16:23 |
|
baquerd posted:I bet it's redrawing the entire image every frame but the GIF animation definition allows for frame difference updates so the actual file size is small enough to be an avatar but there are a ton more frames than most GIFs. That still doesn't explain why it would murder performance in IE9 when it works just fine in every other browser on earth, though.
|
# ¿ Sep 27, 2011 05:49 |
|
yaoi prophet posted:Have you ever wanted to fit your executable inside the ELF header? ELF origami. I love it.
|
# ¿ Oct 8, 2011 02:27 |
|
Jabor posted:It's like they deliberately took the worst parts of Javascript as well - automatic semicolon insertion? Seriously? Is there a significant difference between "automatic semicolon insertion" and "optional semicolons"? I can't see one, but the former seems to be reviled whereas most people seem to either not care about the latter or consider it a good thing.
|
# ¿ Oct 10, 2011 04:11 |
|
Oh. So "automatic semicolon insertion" is "a semicolon is inserted at each newline if one is not already present".
|
# ¿ Oct 10, 2011 04:46 |
|
Meanwhile, RIM (at least, according to a friend who works there) doesn't have test code at all, at least for BBOS. Instead, they have ~2000 QA workers tasked with testing each new build by manually going down a checklist and interacting with the blackberry. They estimate this gives them about 30% code coverage. Granted, "my friend who works at RIM" isn't exactly a citable source, but given what an incredible shitheap Blackberry Java is, I can believe it.
|
# ¿ Oct 17, 2011 02:10 |
|
SavageMessiah posted:It seems like the more someone is concerned about random people stealing their code, the shittier it is. Now that I think about it, that kind of makes sense. If you're good, you can write simple stuff like that easily, and you know that other good programmers can as well, which means there's no reason to keep it secret. If you aren't, it's a terrible ordeal to get it written and even once you're done it only just barely works. But since they think they're good, that means it must have been a really loving hard problem they just solved! Which means a solution for it must be valuable in some way, and they should protect it.
|
# ¿ Oct 18, 2011 00:40 |
|
SlightlyMadman posted:To make this better, be sure you call that function in other parts of the code to determine the units age for completely unrelated reasons, and then later end up changing the warranty eligibility to be based on something completely different, but retain the original function name. $5 says that's already happened and he just hasn't realized it yet.
|
# ¿ Oct 20, 2011 04:13 |
|
TasteMyHouse posted:e2: ah, GNU strchr always returns a char *, not a const char *. is this standard? Now I don't know who to trust POSIX and the C99 standard both specify that strchr has signature char * strchr(const char *, int). So GNU strchr is conformant in this case.
|
# ¿ Oct 20, 2011 22:40 |
|
Plorkyeran posted:Grading is awesome because you get to punish people for writing terrible code rather than having to just sigh and put up with it. Grading is terrible, because you realize that of the 20 people registered for the course, only 16 bothered to commit a solution at all. And of those 16, only one implemented the spec correctly. Over half, on the other hand, submitted something that does not actually run (except in the most charitable sense that "the OS successfully loads the executable"). And all of these are third-year students who have somehow passed several programming courses. (My favorite failure mode was the two programs that are somehow written in such a way that only absolute paths work on the command line. How is that even possible? It's harder to do it that way than to accept both absolute and relative paths! I say "was" because today it was superseded by the program that doesn't check how many nodes are available, and instead starts by assuming it can only create 1 process and then doing some math that results in it trying to create -1 processes and crashing.)
|
# ¿ Oct 27, 2011 22:05 |
|
|
# ¿ Apr 24, 2024 17:24 |
|
baquerd posted:This is only a problem when you have academic/political pressure to pass a certain percentage. We don't. And I didn't say it was a problem. It's just drat depressing. Are they that clueless? If so, how did they pass the previous courses? Do they just not care? If so, why did they sign up for this course?
|
# ¿ Oct 27, 2011 22:21 |