- 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
It was even more fun in FORTRAN 77; no pointers, no record types, no dynamic memory, but at least you could fake recursion with the ASSIGN statement.
Admin
Argh, if it wasn't bad enough hearing people complain about having to do ridiculous things like actually writing their own data structures, now people are ragging on Haskell. You do realise that so-called 'cool' features in modern languages (like list comprehensions in python, for instance) come directly from Haskell? You do realise that all the wonderful new stuff Microsoft is adding to C# in versions 2 and 3, like anonymous delegates, type inference, closures, coroutines, lambda expressions etc have been available in functional languages such as Haskell for YEARS?
I got my grounding in Haskell in 1998; with any luck, by 2008 the mainstream languages will have caught up. I'm just grateful I wasn't a lisp programmer in the 70s - seeing all these 'new features' being heralded when I'd been using them for 30 years might just be too much to take.
Admin
Wow, matlab? Do you really mean like "matlab"? A program used to calculate stuff, as used with simulink? The one which succeeds in crashing almost any computer?
Why don't people use a python interpreter instead?
I think it would be faster. And the thing would actually do what you programmed it for, without numerous bugs because you had filled in your variable gain in the block instead of in the mainscreen.
I'm sorry, just a little stressed out on my last system-dynamics-classes.
Just please don't tell me you're proud of using "mechanical desktop" as well?
You are probably one of those guys we meet in our safety-courses with their "hands-on"-technology
Do whatever you please, just don't try to fix MY machines.
Ok, maybe you may change the lightbulb in the hallway, ... oh no, that would mean you would be touching my switchboard to turn off the electricity.
Just forget it.
Admin
I'm pretty sure you don't really mean any other language that actually supports pointers. Not all languages that actually support pointers even support arrays (try most assembly languages), and not all languages that support arrays use contiguous addressing to implement them (try bash).
In the real mode addressing scheme on x86 platforms, there are two types of pointers--near and far. Far pointers have two parts--a segment, and an offset. The segment is 16 bits, as is the offset, but the total addressing scheme is far short of 32-bits. Instead, the segment refers to one of a series of overlapping base addresses, to which the offset is added in order to address a particular byte in memory.
As for the near pointers--they are nothing but an offset, and they must be applied to the proper base address (segment) in order to be used properly.
Admin
good lord. i am a cs major and i can't see myself rubbing it into other people's faces.
stressed out from your last class? booo, booo, <sniff>
grow up, get down from your high horse and stop crying.
no more self-righteous diatribes, please. and git some comm skills. also, socialize -- you'll realize cs majors are not demigods. we sleep and poop, too!
Admin
OLE? Not COM?
So what you're implying is loading Excel, stuffing your data in a worksheet, sort, and read the data back out?
Man, that's beatiful.
Enterprisey!
Admin
Memorizing how to do sorts is hardly useless. There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.
Admin
One-word answer to that: no.
Admin
KITTY: "Alright, alright, now you listen up. I have had an extremely stressful day. And I am not proud of what I'm about to say, but someone give me a cigarette. Now!" ERIC: "But mom, we don't smoke..." KITTY: "Cut the crap, Eric! I am a nurse. I know that one in five teenagers smoke. (Pointing at them) One, two, three, four, five! Now, I am going to close my eyes, and when I open them there had better be a cigarette between these two fingers!"
Admin
It's unclear what you mean by this. Are you saying that you can never optimize better than a generic sort, that you don't have to optimize, or that there aren't really plenty of times when this applies?
Admin
Man, don't badmouth matlab, as a lot of Comp Eng/EE programs use it these days for signal processing. In fact, pretty much anything to do with ANY kind of signal processing for EE (and I'm talking about vision systems, detection and aquisition, echo detection, etc) as well as control systems will be modelled in matlab. Virtually all Masters and PhD thesis' on those topics use matlab extensively. For any matrix/vector data, development on matlab is fast. Real fast...
I can see why DeVry would teach it, as a marketing ploy for their EET students to put on their resumes. However, doesn't actually mean said graduates actually understand the theory... they just know how to use matlab, yay.
Admin
As in "oooooh, lookie! Aspects! What a new and marvelous idea! and Advice! Wowza! That's spiffzifferous!"
Uh... that's old school, dude. Cross-cutting concern? Like, say, file access in an editor? How long has ange-ftp or something similar been in emacs, anyway? It's enough to make you cry that these babies have no clue about That Which Went Before(TM).
Admin
At my current job, we are supporting an app (C#) that actually uses ListView controls as a data structure. Any time you find a function that looks like:
function doSomething(System.Windows.Form.ListView data)
{
// does something
}
it's time to run away screaming. It's better than another app I have to support: the "architect" of the system decided to roll his own DataTable, implementing it as an array of custom-written DataRow objects. The problem? Each DataRow object contains an array of type object, with each element representing a field value from the original SQL Server table. Unfortunately, each row also contains an array of strings, which each element representing the name of the field. So, for 1000 rows you have the field names duplicated 1000 times.
And of course the performance problems are blamed on the PDA hardware we're using.
Admin
Well said, dude (or chick, as the case may be).
Admin
I was about to type "but what if more than one permutation is sorted?", but then my brain turned back on.
Admin
Another permutation is sorted. It's called "ascending order" and "descending order" ;)
Admin
This is way too convoluted a solution. Just use the Easy button.
Admin
Did I ever say I was a cs major?!
Yep, my last class in system-dynamics which was scrapped the year after I got my credits for the subject.
It had a very hands-on approach with very little theoretic background (We were supposed to already have that theoretic background).
Basically a cookery-book; measure this, measure that, model a block-scheme, simulate, make nyquist-diagram, adapt constants, ..., trial and error 'till thing is stable.
Then write 20 pages on which controller you used and why, and which parameters and why, and which not and why. Then spend most of your time in getting diagrams from mathlab and doing the layout in your picture-editor of choice, before you can post them in your report.
And yeah, I am aware that it is easily doable to add titles and stuff to your graphs in mathlab, only a few lines of code, and the grid and axis and stuff are just easy commands, but the thing more or less does as it pleases. And if you want it to show more than 500 seconds of simulation, on a decent resolution, you can plot out 20 graphs I guess? Paste them together in coreldraw or something?
And don't forget to write your own trace-function, you wouldn't want to miss your poles would you?
Matlab and Simulink are obviously the best, everyone uses them, as do most people use MS office, and autocad, also very handy, and very expensive, so it has to be good, ... and it can't use filetypes from other programs, as most free and open-source software can (for which you cs-majors and amateurs keeping yourselves busy with that should earn more credit, data-interchange isn't easy to implement and to keep up to date).
I last saw an add promoting inventor over other programs, not because of its capabilities, but because "it can handle dwg-files without problems". If a manufacturer can't even handle his own file-types ...
I don't know nothing about devry, and I've never been near it, but saying they are good because they have PLC's and oscilloscopes and matlab just seems a bit over the top. Is there a place where they DON'T have PLC's and oscilloscopes and try to teach you that stuff? Now THAT would be WTF university.
CAPTCHA : perfection
Admin
How about:
while (std::next_permutation(begin, end));
since next_permutation returns true until it goes over the top and generates the lexicographally-smallest permutation (a.k.a. the list in sorted order), when it returns false. Hooray for a disgusting one-line solution rather than a disgusting two-line solution!
Admin
The last: it's rarely the case that a hand-optimized sort would be significantly (rather than a few percent) faster than a generic one, and even a significant speedup (like a factor of 2) is rarely worth the time spent implementing it. Unless your program really spends 50% or more of its time sorting, it won't be a noticeable difference.
Admin
Now after reading few posts here I really understand why there are so few C++ WTFs here, I don't mean to offend anyone but ...err const char VB[] ="Crappy language" ?
Admin
Still baffled about how and why "indices" turned into "indexes". A total WTF on its own.
Admin
You read the answer.
No.
'nuff said.
Admin
Arrest that terrorist!
Admin
Hate to rain on anyone's WTF parade, and I'm not a big VB supporter or anything, but the list box method was actually a best practice in VB6. Since the list box is an inherent Window control, this form of sorting was way, way faster than any VB6 (i.e. 3GL) programming sort. I personally would (and should) berate newbie programmers for creating their own sort routines from scratch in any 3GL...in fact I think I even once used this as an interview question for developer candidates to weed out certain types...you know who you are. ;-)
Admin
Reminds me unfortunately of my recent experience with entrance exams to Master courses at University of Economics, Prague. There were two exams there - Economics and IT. Having studied IT for some time, I prepared mostly for Economics - and the exam proved simple enough. But the IT requirements I did not pass. Sample questions (let me remind you again that this is Masters course):
1) Divide computers
2) What is a database system
3) Describe localization and customization
Rest of the questions were from Software Engineering field - UML, ER etc. Not my thing, but at least the questions were normal.
Admin
Actually, a distribution counting sort (or a radix sort), which are O(n), are almost always much faster than any generic sort for large numbers of elements. It is true that this won't matter much if your program doesn't spend much time sorting, but then that is a general rule of optimization, not specific to sorting.
Admin
Haskell, or any other functional-paradigm language is on the contrary a very competent language, for example very well suited for data structures and algorithms.
The fact that some who would call themself programmers cannot adapt to any other paradigm than imperative programming is just sad.
Admin
Okay, I know I'm months late to this, but it was linked recently, and this is a real WTF.
As a trained lifeguard, lifeguards ARE trained to first yell "Hey, that person is drowning! Someone help!" (except more concisely, as in "HELP!" + pointing. Further, they are trained to dial 911 (when exactly they do that depends on the situation). A person who is drowning has a fairly high chance of needing a paramedic, and, long-term, a doctor. You especially have to do this if they need CPR.
CPR is exhausting and lasts longer than in the movies. Your call for help may help recruit people to call 911 for you, or to take over for you in CPR, under your watch and guidance.
This is an utterly horrible analogy. Maybe I can salvage it: it's more like training doctors to call a lifeguard when their patient stops breathing.
Admin
If you are sorting objects, of course you can get more than one sorted permutation, if you want to be capable of distinguish between distincts objects at the 'same' position.
The real WTF is people that still comment on this article....
Admin
Big WTF that everybody seems to have missed: VB's ListBox doesn't sort properly when visual styles are enabled. Look it up in the KB - Microsoft knows that the problem exists but apparently isn't going to fix it. Instead they tell you to implement your own listbox sorter.
Admin
Isn't that Turing's "Halting Problem"?
Admin
WTF is the only University for me!
And I am NOT a robot!
Admin
How is it possible that people attending DeVry and/or the U of Phoenix could be thought of as less than magnificently intelligent?
Incidentally, isn't it pronounced Po Henix?
Admin
I think WTF is the greatest U I have ever attended, and I have attended (and graduated from) three.