|
MEAT TREAT posted:
I am a relatively new developer and this is the first time I've heard about these control characters being used. Do you have anything that explains their usage? Wikipedia doesn't go into too much depth. The only article I've found has said that the characters' meanings have to be defined on a per-application basis, but I'm looking for a best practice type document.
|
# ? May 18, 2012 17:18 |
|
|
# ? Jun 3, 2024 22:45 |
|
RFC 20 does briefly mention them:RFC 20 posted:FS (File Separator), GS (Group Separator), RS (Record Separator),
|
# ? May 18, 2012 17:24 |
|
Jonnty posted:If everyone's using Excel why are you using csvs in the first place? How do you write excel files using an 8bit uC data logger? Actually, if someone has done it I don't want to know.
|
# ? May 18, 2012 17:25 |
|
Zorro KingOfEngland posted:I am a relatively new developer and this is the first time I've heard about these control characters being used. Do you have anything that explains their usage? Wikipedia doesn't go into too much depth. The only article I've found has said that the characters' meanings have to be defined on a per-application basis, but I'm looking for a best practice type document.
|
# ? May 18, 2012 23:14 |
|
Although really in that case you should focus on teaching them Quicksort and thus becoming a messiah figure.
|
# ? May 18, 2012 23:30 |
|
Or be declared a russian spy.
|
# ? May 19, 2012 00:26 |
|
Internet Janitor posted:Although really in that case you should focus on teaching them Quicksort and thus becoming a messiah figure. "Hey you guys ever hear of Napoleon"
|
# ? May 19, 2012 16:23 |
|
nielsm posted:At least OpenOffice asks you what format that CSV is actually in before opening, and gives you a preview. (But otherwise it's more annoying than Excel to use.) Text to Columns is Excel's most powerful tool
|
# ? May 19, 2012 16:47 |
|
I didn't know this was a thing until today. http://nodephp.org/ REACT IN THE INDUSTRY posted:It's like, so amazing, man. I know everyone in this thread loves node.js and PHP, so why not leave the two of them alone in a room together to see what happens?
|
# ? May 21, 2012 16:52 |
|
I've been idling in the IRC channel of that for a few days. It's outstanding.pre:12:33:30 < igorw> hm, is there no way to create a raw stream socket? 12:33:47 < igorw> raw as in SOCKET_RAW, below the transport layer 12:33:58 < igorw> allowing to write an ICMP/ping client 12:34:24 < igorw> sockets allow this by using 12:34:24 < igorw> $conn = socket_create(AF_INET, SOCK_RAW, 1); 12:34:34 < igorw> but I wasn't able to find this for stream sockets
|
# ? May 21, 2012 17:37 |
|
Mogomra posted:I know everyone in this thread loves node.js and PHP, so why not leave the two of them alone in a room together to see what happens? Harmony Framework - PHP is now in your browser! (Inactive since 2009 thankfully, but it's only a matter of time.)
|
# ? May 21, 2012 20:51 |
|
Gazpacho posted:As the internet creates a fetish subculture for everything, so does project hosting create... php:<? $Text4fba9fe079c2a->setText('Hello world'); $HBox4fba9fe079af5->addChild($Text4fba9fe079c2a); $input4fba9fe079cca = new Harmony_Toolkit_Element('input');?>
|
# ? May 21, 2012 21:05 |
|
Oh lordy, so we hired out someone to make something simple; a page that displayed snippets of text from a database, with the ability to embed a picture. Anything over the first paragraph would be hidden via Javascript and a "More" button. Standard stuff. The page it shows up on is three-column format. Easy, right? Table "entries", with "text", "imageurl", "column", and an auto-incrementing "entryid" (for editing later). Just use a simple explode('\n',2) to break it up if you have a long entry. Oh, no. That would be too simple. This guy made 3 tables, with the following ingenious layout (actual names): code:
I get the feeling this person was paid much more than I make in a week to crap this out in about 15 minutes. A lot of the code looks like it was cribbed from somewhere else but I couldn't find where in a few minutes of looking. I need a raise. And a vacation. Edit: code:
Zamujasa fucked around with this message at 01:15 on May 22, 2012 |
# ? May 22, 2012 00:22 |
|
From redditquote:Javascript thinks that 64.99 * 100 is 6498.999999... Go ahead, try it any way you like. If someone can explain this, I'll be eternally grateful. Nope, just floating point. And this is pointed out: quote:I don't think you understand how floats are stored in memory. Click on any of the links posted and read up on it. But then, redditor collin_ph posted:I'm wondering who's bright idea it was to do this. It's funny after programming for nearly 30 years, I run into this TODAY. Makes me feel kind of dumb-- however, I wonder how people avoid this type of thing with MONEY. Uhhh...
|
# ? May 22, 2012 01:18 |
|
Factor Mystic posted:From reddit This post makes me so depressed.
|
# ? May 22, 2012 01:27 |
|
Good grief, he somehow doesn't know what floats are, then assumes it was a design decision?
|
# ? May 22, 2012 01:31 |
|
My favorite is the guy who thinks that your memory has the capacity to repeat to infinity.
|
# ? May 22, 2012 01:49 |
|
Suspicious Dish posted:My favorite is the guy who thinks that your memory has the capacity to repeat to infinity. It's lazily generating the list of 9s, duh.
|
# ? May 22, 2012 02:13 |
|
Suspicious Dish posted:My favorite is the guy who thinks that your memory has the capacity to repeat to infinity. Ummm, his name is base2op. I think he knows what he's talking about....
|
# ? May 22, 2012 02:35 |
|
It's trying to lazily generate the list of 9s, but IEEE limits the precision as an optimization so that the implementation can use less memory. Let me unpack that a bit. A real computer has to do arithmetic in fixed chunks of bits, so you have to think of a number as an infinite stream of these chunks of bits. If you've ever done stream programming, you know that it's more efficient to work with streams with buffering on. Since you're constantly finishing with some chunks and needing more, this has to be a circle buffer to keep the GPU up with the memory bus, and you've got a second buffer which is taking the result, which is called double-buffering. It's the size of these buffers that's different when you have a float or a double, got it? So where does this 8 come from? First thing you've got to understand is that, like that dude said on reedit, an integer is really equal to a repeating bunch of nines. Now, in the first version of floating-point numbers, there was this bug when you had a bunch of nines like that, and a couple nines from somewhere else, and you were multiplying them together, and the multiplier would do one multiply and put a chunk into the result buffer, and it would forget that it needed to do a carry on that chunk, so you got 9 * 9 == 81 and it would put down 81 in the buffer and then it would overwrite that 1 with the next 9 which it correctly carried from the next multiplication, see, 99 * 9 == 810 + 81 == 891. If this doesn't make sense, just remember, it's was a bug, right? But they didn't notice right away, because there weren't enough DBAs looking at the problem, so it just stayed in for awhile, and ever since they've had to emulate that bug perfectly because IEEE is a standard and it's supposed to be portable. And the reason the 8's all the way back is because, remember, it's 9s all the way down on the integral side, and you have to multiply them all by the two 9s on the other side, so you've got plenty of places where this bug can show up. Anyway, that's why I do all my currency calculations with regexps, and if you've got a problem with that, just remember, optimization is the way the devil gets ya.
|
# ? May 22, 2012 02:48 |
|
Factor Mystic posted:From reddit I feel like this has to be a subtle troll since 64.99*100 is equal to 6499 which is equal to 6498.9... arguments around which usually lead to huge amounts of drama anyway.
|
# ? May 22, 2012 04:02 |
|
ohgodwhat posted:I feel like this has to be a subtle troll since 64.99*100 is equal to 6499 which is equal to 6498.9... arguments around which usually lead to huge amounts of drama anyway. Does Javascript handle infinite decimals, though? If not it eventually comes to a last digit, which is false precision.
|
# ? May 22, 2012 04:51 |
|
Please look at that guy's post history. He's a troll. Although a quite elaborate one. Also, stop reading reddit. e: Golbez posted:Does Javascript handle infinite decimals, though? If not it eventually comes to a last digit, which is false precision.
|
# ? May 22, 2012 04:53 |
|
rjmccall posted:It's trying to lazily generate the list of 9s, but IEEE limits the precision as an optimization so that the implementation can use less memory. Let me unpack that a bit. A real computer has to do arithmetic in fixed chunks of bits, so you have to think of a number as an infinite stream of these chunks of bits. If you've ever done stream programming, you know that it's more efficient to work with streams with buffering on. Since you're constantly finishing with some chunks and needing more, this has to be a circle buffer to keep the GPU up with the memory bus, and you've got a second buffer which is taking the result, which is called double-buffering. It's the size of these buffers that's different when you have a float or a double, got it? So where does this 8 come from? First thing you've got to understand is that, like that dude said on reedit, an integer is really equal to a repeating bunch of nines. Now, in the first version of floating-point numbers, there was this bug when you had a bunch of nines like that, and a couple nines from somewhere else, and you were multiplying them together, and the multiplier would do one multiply and put a chunk into the result buffer, and it would forget that it needed to do a carry on that chunk, so you got 9 * 9 == 81 and it would put down 81 in the buffer and then it would overwrite that 1 with the next 9 which it correctly carried from the next multiplication, see, 99 * 9 == 810 + 81 == 891. If this doesn't make sense, just remember, it's was a bug, right? But they didn't notice right away, because there weren't enough DBAs looking at the problem, so it just stayed in for awhile, and ever since they've had to emulate that bug perfectly because IEEE is a standard and it's supposed to be portable. And the reason the 8's all the way back is because, remember, it's 9s all the way down on the integral side, and you have to multiply them all by the two 9s on the other side, so you've got plenty of places where this bug can show up. Anyway, that's why I do all my currency calculations with regexps, and if you've got a problem with that, just remember, optimization is the way the devil gets ya. This reads a lot like TimeCube
|
# ? May 22, 2012 07:22 |
|
rjmccall posted:It's trying to lazily generate the list of 9s, but IEEE limits the precision as an optimization so that the implementation can use less memory. Let me unpack that a bit. A real computer has to do arithmetic in fixed chunks of bits, so you have to think of a number as an infinite stream of these chunks of bits. If you've ever done stream programming, you know that it's more efficient to work with streams with buffering on. Since you're constantly finishing with some chunks and needing more, this has to be a circle buffer to keep the GPU up with the memory bus, and you've got a second buffer which is taking the result, which is called double-buffering. It's the size of these buffers that's different when you have a float or a double, got it? So where does this 8 come from? First thing you've got to understand is that, like that dude said on reedit, an integer is really equal to a repeating bunch of nines. Now, in the first version of floating-point numbers, there was this bug when you had a bunch of nines like that, and a couple nines from somewhere else, and you were multiplying them together, and the multiplier would do one multiply and put a chunk into the result buffer, and it would forget that it needed to do a carry on that chunk, so you got 9 * 9 == 81 and it would put down 81 in the buffer and then it would overwrite that 1 with the next 9 which it correctly carried from the next multiplication, see, 99 * 9 == 810 + 81 == 891. If this doesn't make sense, just remember, it's was a bug, right? But they didn't notice right away, because there weren't enough DBAs looking at the problem, so it just stayed in for awhile, and ever since they've had to emulate that bug perfectly because IEEE is a standard and it's supposed to be portable. And the reason the 8's all the way back is because, remember, it's 9s all the way down on the integral side, and you have to multiply them all by the two 9s on the other side, so you've got plenty of places where this bug can show up. Anyway, that's why I do all my currency calculations with regexps, and if you've got a problem with that, just remember, optimization is the way the devil gets ya. How did I miss this post? This is amazing!
|
# ? May 22, 2012 08:22 |
|
The line about not enough DBAs looking at the problem cracks me up. I'm not 100% on this but I'm pretty sure IEEE-754 predates DBAs.
|
# ? May 22, 2012 08:29 |
|
rjmccall posted:It's trying to lazily generate the list of 9s, but [...]. Anyway, that's why I do all my currency calculations with regexps, and if you've got a problem with that, just remember, optimization is the way the devil gets ya. For a bit there, I think you channeled the LoseThos guy. Well done.
|
# ? May 22, 2012 08:33 |
|
xf86enodev posted:Dude! Sorry. Instead of fighting, let's bask in the insane glory of rjmccall's post.
|
# ? May 22, 2012 14:39 |
|
It is truly the best kind of troll. Just enough crazy to keep you guessing. Bravo sir, bravo.
|
# ? May 22, 2012 22:05 |
|
KaneTW posted:Don't even get me started about MAPLE. The only thing I've ever found maple good for was to pull up the command line version whenever I needed to do some integral I didn't want to integrate by hand. ToxicFrog posted:If I had to guess, I'd guess it's just a matter of less to compare it to and fewer people to do the comparison - Python was relatively new, most scientists were using MATLAB or Fortran and the proportion of scientists who were also programmers was smaller. MATLAB was originally meant to be a kinder, gentler interface to Fortran numeric computation libraries; its flaws are a lot less obvious when you're coming to it from Fortran '77 rather than SciPy or R. It's really hard to overstate just how much better trying to do scientific computing is nowadays compared to 15 years ago. Not only has c++ become a serious option, but you've got the modern fortrans (when I was doing my phd, fortran 90 was out but I didn't know a single person who used anything but f77), numpy/scipy, sage, ATLAS, FFTW, and R. (AND GMP! I forgot GMP) ETA: I'm not trying to be some sort of grumpy greybeard here, but god drat! things today are great. The next thing on my list to check out is ggplot2....
|
# ? May 23, 2012 01:14 |
|
Golbez posted:Good grief, he somehow doesn't know what floats are, then assumes it was a design decision? it WAS a design decision. there are instruction set architectures which have supported fixed-point and packed decimal arithmetic for longer than x86 has existed - much financial software on mainframes is still written this way.
|
# ? May 23, 2012 03:33 |
|
robbob posted:I use a program called OoberViewer for looking through large email logs at work. It doesn't open the whole file at once so it is pretty quick to view a log. Not too sure where to download it at as it was already on this machine, but I could probably get it to you if you would like to try it. This is from a while back but I'd like to grab this app. Google turns up seven results for me - one is a link to http://files.redefiningweird.com/files/utilities/ which apparently has the file, does that seem to be the version you have? The other 6 results are people talking about the app, a link to that post, and three unrelated pages.
|
# ? May 23, 2012 12:42 |
|
The application I develop for uses a non-SQL hierarchical DB, upon which we've added the abstraction of records with fields. The indexing capabilities built into the DB don't cover everything we'd want to index--we have to build separate index structures ourselves to handle these cases. We have standard APIs for setting fields in a record. Do these APIs update the index? Nope! Instead, you have to update the field, then call a separate API to manually update the index. If you forget to do this in any place that happens to be writing to data that could be indexed, you now have a data integrity error. The reason? "Performance." One guess as to how often reports built on these indexes are mysteriously missing data.
|
# ? May 23, 2012 14:20 |
|
More from the Russian Wonder™. The articles on our site are a little backwards. New ones we try to add show up at the bottom instead of the top, and the system is pretty Jenga-ish as it is. ("Add a sort column", you say. Sure, that'd be easier if he referred to the columns like an associative array instead of numerically. Oops, suddenly $column1[1] isn't the header any more! better update all the instances of that everywhere) His solution was to make the id column the one we sort by. Makes sense, except that at some points it would be valuable to be able to insert new items in between others. So, because we're starting to ORDER BY `id` DESC, we need to basically rotate the numbers in the database. This is easy, right? php:<?php /********** Start Alter column1 **********/ $request="ALTER TABLE column1 MODIFY id INT"; if(mysql_query($request,$db_connection)) { echo "\n" . "Column id is INT<br />"; $a=1; while($a<=25){ $b=30+$a; $request="UPDATE column1 SET id='" . $b . "' WHERE id='" . $a . "'"; if(mysql_query($request,$db_connection)){ echo "\n" . "id " . $a . " is " . $b . "<br />"; } else{ echo "\n" . "id " . $a . " is not " . $b . "<br />"; echo "\n" . "Error " . mysql_errno($db_connection) . ": " . mysql_error($db_connection) . "<br />"; } $a=$a+1; } $a=1; $c=25; while($a<=25){ $b=30+$a; $request="UPDATE column1 SET id='" . $c . "' WHERE id='" . $b . "'"; if(mysql_query($request,$db_connection)){ echo "\n" . "id " . $b . " is " . $c . "<br />"; } else{ echo "\n" . "id " . $b . " is not " . $c . "<br />"; echo "\n" . "Error " . mysql_errno($db_connection) . ": " . mysql_error($db_connection) . "<br />"; } $a=$a+1; $c=$c-1; } $request="ALTER TABLE column1 MODIFY id INT NOT NULL AUTO_INCREMENT"; if(mysql_query($request,$db_connection)){ echo "\n" . "Column id is AUTO_INCREMENT<br />"; } else{ echo "\n" . "Column id is not AUTO_INCREMENT<br />"; echo "\n" . "Error " . mysql_errno($db_connection) . ": " . mysql_error($db_connection) . "<br />"; } } else{ echo "\n" . "Column id is not INT<br />"; echo "\n" . "Error " . mysql_errno($db_connection) . ": " . mysql_error($db_connection) . "<br />"; } /********** End Alter column1 **********/ // Snipped: two repeats of the above code but with column1 switched with column2/3 and the hardcoded digits changed // code:
And we paid this guy money for this code. Actual money. (*: You'll still have to remove the PRIMARY index from it first, of course.) Zamujasa fucked around with this message at 16:46 on May 23, 2012 |
# ? May 23, 2012 16:44 |
|
BP posted:The application I develop for uses a non-SQL hierarchical DB, upon which we've added the abstraction of records with fields. Aaaaaaaaaaaaaaa. aaaaaa.
|
# ? May 23, 2012 17:05 |
|
tef posted:Aaaaaaaaaaaaaaa. Yeah, honestly everything following that sentence was pretty much redundant.
|
# ? May 23, 2012 18:17 |
|
This isn't code, but it's related, and my face almost imploded when I read this. http://us.battle.net/d3/en/forum/topic/5152409863?page=1 For those too lazy: quote:I am able to log into D3 even if I change the case on some of the letters in my password. This should be fixed. From Blizzard Quality Assurance: quote:This is actually consistent with all of our Blizzard games. Try it in WoW and SC2
|
# ? May 23, 2012 18:25 |
|
They also (apparently) limit the effective password to only the first 16 characters. But that's okay, because Apache only uses the first 9 when using htpasswd-based authentication. Who needs internet security, right?
|
# ? May 23, 2012 18:33 |
|
tef posted:Aaaaaaaaaaaaaaa. (I'm guessing BP and I share the same employer, though we have apparently have pretty different perspectives on it) It's more or less a precursor to the modern "NoSQL" document databases. It's not really that much of a horror. I mean, there are plenty of horrors in there, but that's unavoidable when you've got a 25+ year old codebase.
|
# ? May 23, 2012 18:43 |
|
|
# ? Jun 3, 2024 22:45 |
|
LordKaT posted:This isn't code, but it's related, and my face almost imploded when I read this. Christ almighty. Check out the post where the mod closes the thread: quote:Please leave discussions like this to the General Discussion forums. I'm not going to keep posting on threads if my answer to someone's bug report is a huge discussion about something that isn't a bug. Argggggggggh you people are so dumb. Yes it is a bug and you should loving fix it! Edit: Yup, works in SC2. I don't need to capitalize my password quiggy fucked around with this message at 18:51 on May 23, 2012 |
# ? May 23, 2012 18:49 |