- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Pretty amazing considering QBASIC had to run within the 640k that DOS could use!
Admin
No Nagesh is right (or rather, if you believe such matters are subjective, I agree with Nagesh), programming in low level languages opens the door to a whole slew of novel WTFs that can be avoided by programming in eg Java or C# or even VB.Net, mainly to do with memory management.
Admin
I assume these prefixes were made up by the same type of twits who are Wikipedia "editors". TRWTF is in believing that Wikipedia is authoritative.
Admin
QBasic almost hit the limit then. 64 dimensions are enough for anyone. Not even a resonance cascade requires more than that.
Admin
As for the masses? Who cares, they don't understand either set of prefixes.
Admin
63, in fact.
VBA still lets you to do just that. Or at least try.
Today I was looking at a chunk of code that would take that 63-dimensional array and tell you how many elements there were.
I mean, it might be needed some day. Y2K, neva forgit!
Admin
1,152,921,504,606,846,976 bytes * 2 * 2 * 2.
Admin
Admin
And don't forget the mighty 1.44MB floppy, which was 1.44 kilokibibytes (KKiB) (2880 = 2.88 decimal kilo of 0.5 binary kilobyte sectors). This is a different prefix to that found on the telecoms kibikilobit (KiKB).
Bah.
Admin
And anyway, TRWTF is that someone agreed with Nagesh.
Admin
Admin
It's not the size that matters, 640k ought to be enough for anybody....
Admin
Admin
Funny that... I seem to recall my 128 megabyte, 256 megabyte, and 512 megabyte hard drives all using those numbers... not 120/130, 250/260, or 510.
Really the whole "10s" bit didn't come about until the gigabyte stage.
And I personally never understood the issue.... byte is (currently) an octal number, not decimal. So why in the heck would anyone try to make decimal math rules apply?
Admin
Also, you can have a successful marriage even if you're "micro" and "soft"...
P.S: Captcha: vulputate sounds really dirty but apparently not even a real word according to my online search...
Admin
ERROR! Not enough memory to display the
Admin
Is it me or the more the involved WTF is simple in code terms the more the comments are prone to some neverending loop of stupid/pointless arguments on the little bits of it?
TRWTF is that neither Schrödinger's Cat nor nazis are involved yet... I read mostly nothing of it, so I may be wrong.
Admin
Linux uses optimistic memory allocation by default. This shouldn't take up a full 64MB unless you access several pages of that array.
If the device's CPU doesn't support this, it probably doesn't have a memory management unit (MMU). If this is the case, how is it even running Linux?
Admin
Alternatively, you think like an IT engineer and realize that various signal encoding schemes make counting by bits stupidly vague (unless you truly enjoy looking up the encoding efficiency of every protocol), and use Megabytes instead if you have real work to do.
Admin
Admin
The low-level languages are the first and second generation programming languages. C is a third generation programming language, described by the standard in the context of an abstract machine. C isn't a low-level language.
Consider that, at the truest low level, memory isn't contiguous. You might have a stick of 2GB of RAM and a stick of 4GB of RAM, but you can't rely upon these two sticks providing 6GB of contiguous storage. As an OS author on an Intel x86 platform, you have to write a bootloader that fits into 512 bytes of memory. The bootloader operates in real mode. Before you can address any storage requirements beyond 64KB, you need to operate in protected mode. This is low level programming, and standard C has none of it.
Consider that, when you pass an array to a function, it is implicitly converted to a pointer to the first element. The same conversion occurs when you use the array[index] operator, because that operator is in reality a pointer[index] operator. Arrays can't provide any access to memory. The only operators they have is the &address-of operator (which results in a pointer) and the sizeof operator (which results in an integer size_t). The only way to access memory that an array contains is to convert the array to a pointer (silently) and use one of the pointer operations to choose which element to operate on.
In C99, variable length arrays were introduced. Variable length arrays are arrays with sizes that are determined at runtime. They're automatically destroyed when the function they're created in returns.
None of this comes natively, at the low level end. It comes from the compiler, which translates C source code into low(er) level machine code, or in some cases an interpreter, which translates C source code into behaviour (in which case, the memory especially can't be directly operated upon, because there's an interpreter between the processor and the program). It's the machine code, if present, that's low-level, not the C code. While I agree that the representation chosen to store the data in this article is a WTF, I think the true WTF is describing anything C-related with the term "low-level", especially when the description came from someone working with freestanding implementations as opposed to hosted implementations. You ought to know better!
Admin
Nope. 1 km^2 = 1,000,000,000,000 mm^2. Note the ^2.
Thus, Texas is 696,200,000,000,000,000 mm^2.
Admin
Admin
I can't believe there are two pages of comments and they're all about kibi/kilo terminology, transmission rates, and disk sizes, instead of the clever and provocative title to the article.
What a bunch of nerds. (Well, I guess we know that.) Come on, try harder! Faster!
Admin
Every pointless argument thread simultaneously contains a discussion of Schrodinger's cat and the Nazis. This superposition exists until the reader actually reads the thread far enough, at which time the pointless thread wave function collapses, and one state is observed.
Admin
I think he meant eight Megaword
Admin
Admin
Admin
Admin
Not if it stayed in the asteroid belt.
Admin
Admin
Admin
The real WTF here is that only two posts have mentioned virtual memory, and the rest of you are arguing about Mi vs M
Admin
Doesn't Linux, by default, only overcommit memory by 150%? If you ask for an allocation (or to put on the stack) twice the size of your ram the allocation should fail. That would be an -ENOMEM.
Admin
"And there is a slow process on the way convincing the very last retards that when you copy data at a speed of 2 Megabit per second for eight seconds, you'll have copied eight Megabyte."
Uh, yeah, better check your own math before you call other people retards, friend.
There are 8 bits in a byte, yes? This is not a matter of debate. So...if you copy 2Mb/s for 8 seconds, you've copied 16Mb (8 * 2), or 2MB (16 / 8).
This happens regardless of how you define Mb and MB.
Admin
There are no variables in C that have "global" scope. Variables declared at file scope (that is, outside of any functions) have static storage duration. Their scope is valid from the end of the declaration to the end of the translation unit. The term "global" comes from other languages that describe variables which can be used anywhere. For example, in javascript:
bar is modified prior to it's point of declaration. In addition, other scripts would be able to use and modify this variable; It's scope also extends beyond the boundary described in C as a translation unit.
I think you meant "two megabytes", not "eight Megabyte". Perhaps your maths is a little off, too. Everyone makes mistakes. In C, a byte is CHAR_BIT bits in width, so in the context of the article, a megabyte would be a multiple of whatever value that is (most commonly 8, but could be greater). Would you believe a byte used to be 7 bits? Which side does this fact favour in the discussion at hand?
I think you mean "he/she is more likely to be a productive programmer, or less likely to produce code riddled with premature optimisations that would be performed by the compiler anyway, could render the code unportable and will most likely hamper the internal documentation of the code". A more productive programmer will produce a program that solves a useful problem, and profile it to find the most significant bottleneck. That bottleneck will ideally be optimised by introducing more suitable data structures and/or algorithms for the operations performed. It's unlikely that a low-level optimisation will be required. Besides, those optimisations belongs in the compiler. That way, they can be automatically performed by any other projects compiled with the same compiler. Perhaps you should learn more about your compiler. If there can be a smart program, they'll probably fit the description.
It's a pleasure to be of service...
Admin
Your point about virtual memory is spot one, and one I was going to make unless I saw a comment about it.
I don't understand what in the world this has to do with linux.
Admin
No... but it is a matter of architecture. On some systems, a byte is either 6 or (sometimes) 9 bits, because the addressing resolution is in words, and the words are 36 bits. (Or 12, 18, etc).
Admin
Hitler.
I win.
Admin
I'm aware of "mebibytes" and "gibibytes" and so on. They're hard for me to take seriously. They sound like baby babble! The one time I pronounced these aloud to some fellow engineers who hadn't heard of them they reminded me it wasn't April 1st. I had to assure them I wasn't joking, and they replied that those names are just incredibly stupid sounding.
Admin
Linux considers RAM + swap to be its total VM size, not RAM only.
Admin
Now where was that asteroid we wanted to land on?
Admin
Admin
Admin
Admin
Admin
Admin
True, but somehow I don't think he was referring to an obscure, and probably outdated architecture. I'm not aware of any current systems where 8 bits != 1 byte. That being said, they're probably out there, but I think I would be safe in saying that the vast majority of architecture is either Intel, or Intel clones.
However, your point is a good reason to always use CHAR_BIT instead of assuming that 1 bit == 8 bytes.
Admin