Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Get ready for a new wave of poorly coded softwa (Score 1) 133

For as much as anecdote != data, I took a recent (installed it Thanksgiving 2010) OCZ MLC SSD (30G) SSD, and gave it a database workload wherein a commit was made every 5 seconds. Wore it out in a year. Replaced it in August.

Relevant SMART data (cleaned up so /. doesn't hate on it)
205 Max_PE_Count_Spec       0x0000   -   -   -    Old_age   Offline      -       10000
206 Min_Erase_Count         0x0000   -   -   -    Old_age   Offline      -       8948
207 Max_Erase_Count         0x0000   -   -   -    Old_age   Offline      -       9930
208 Average_Erase_Count     0x0000   -   -   -    Old_age   Offline      -       9655
209 Remaining_Lifetime_Perc 0x0000   -   -   -    Old_age   Offline      -       4

You can't tell me it can't be done with modern SSDs. It merely isn't the case for MOST consumers. But when has Slashdot been made up of MOST consumers?

Comment Re:register starvation (Score 1) 594

It seems that the intent there is to make C into something a lot like C++/STL. Once you've done it once, nothing to prevent Complex types and others being builtins... but this seems to bring C further from its "portable ASM" status.

Not that I'm entirely sure this would be bad... and the struct could be just a typedef. Now all we need is operator overloading, which is also a C++ism. Maybe a C++ minus the type-strictness, and minus all of the automatic copying. and the templates.

Comment Re:register starvation (Score 1) 594

I've seen this done in serialization formats, but never seen it actually done in a program.

So you're saying you want native-size-word (int) followed by the string chars, so you'd malloc(strlen+4) for the dynamic string, and then in the reader read the first 4 bytes and set the ptr to stringPtr=basePtr+(void *)(sizeof(size_t)). It just doesn't feel natural in C as we know it. But then again, I'm sure they could have defined it to be natural. it would be an implied struct.

Comment Re:register starvation (Score 1) 594

I meant that if you were to actually pass the struct as not a structptr, but as the 2 values themselves. After all, you could optimize for fewer regs, or fewer memory accesses. Pointer indirection used to be considered a problem. Albeit not anymore.

Yes, that would be an ABI change, but this was back when they could choose the ABI as they wished... so we can throw many current assumptions of ABI out the window.

Comment Re:register starvation (Score 1) 594

I'll admit to not being an assembly programmer, but for one, I was referring more to what they would have done back then... when register renaming wasn't available. Nowadays many programmers don't care about cycle counting... I know I haven't had to. Writing in perl or C++/STL leaves me too far away from the metal to even know how many cycles I'm wasting.

But since the question is one of yesteryear, lack of regs could be a question. And I was under the impression you weren't supposed to use esi and edi as tmp stores or as the output of an expr. They're ptrs into stack and data-area, respectively.

Comment register starvation (Score 1) 594

The real problem with the addr+len approach is that now every string becomes a struct, or a structptr.

This means that when passing a string to a function, either the string takes up two register/stack slots, or you're passing around a const-ptr (but the contents of the struct are not const), which means one more memory access due to pointer indirection.

x86 and the PDP-11 are register-starved. the x86 has 8 registers, with 4 or 5 available as general-purpose registers.
The PDP-11 was similar with 8 registers total as well.

Comment Re:Labels and Pop Culture (Score 1) 134

There's also various cities that have passed regulations about grey-water, that then means you can't clean your car in the driveway anymore.

Apartment complexes that strictly disallow you to do car-repairs in the parking-lot.

Office buildings and strip-malls that do the same thing (even if there is an AutoZone/whatever in that mall).

I've been accosted before for taking 5 minutes to change out a burned headlight bulb... b/c I was doing it at an office park waiting for my flatmate to get out of work.

Comment Re:XML? that's so 1990 (Score 1) 51

Notepad, which is so often used by the technically non-clueful. Of which, I seem to work with a few.

Of course, you should use a real editor. This somehow doesn't prevent people from using notepad b/c they don't know better, or using vim but not knowing HOW to use vim and still we lose all indenting.

and I never said you needed a special editor for XML. Not even that you need one for JSON or YAML.

Pretty printing isn't MANDATORY for XML... which is really the point. With it NOT necessary, means you can fuck up the whitespace and NOT break the data. That's what I need.

Comment Re:XML? that's so 1990 (Score 1) 51

I use JSON (and occasionally YAML), but only for data interchange formats where I don't expect a human to need to modify it.

Yes, I am aware that JSON and YAML are largely related. And I a few times tried to write up files in JSON, just as a mockup of my intended data structure. Yes, I used a real editor with proper tab indenting. It still got to be pretty unreadable. I use Data::Dumper whenever I want the data format to be as explict as possible, but only for debugging.

But it's so much worse than that. XML doesn't NEED the indenting, so if some tard uses wordpad or notepad or something equally stupid to modify the file, he CANNOT mess it up.

Yes, you want to assume that only Real Programmers will be modifying your data. I had to unlearn that theory, and I'm working for a very well known internet company (I'd rather not say, albeit I may have left clues [or even spilt the beans] in other comments).

In particular, I had used XML for a human writable/readable data file (the same project I had tried to use JSON for), and was told a month ago that I had to write a GUI editor for it, or it just wouldn't get used. That and I've watched a few QA contractors and simply how little actual programming they know.

XML also gets a lot of flack b/c it is typically 'too hard to parse' whereas YAML and JSON are intended to be trivially parsed into a natural tree format... On the other hand, I found a perl module (XML::TreePP) that makes XML just as simple to manipulate.

Comment Re:XML? that's so 1990 (Score 0) 51

Great for human readability. Terrible (due to some python-like indent rules) for humans to add content to.

Meanwhile, XML might not be quite as nice as YAML for reading, but it is easier to figure out where you made a mistake, assuming you're pretty printing it (but the best thing is that pretty printing it is unnecessary).

Slashdot Top Deals

FORTUNE'S FUN FACTS TO KNOW AND TELL: A giant panda bear is really a member of the racoon family.

Working...