- 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
I agree. I've never had any real need of those technical intricacies either, but I can't seem to actually get that stuff out of my head. I'd gladly replace it with something more interesting if I could; sometimes it's a shame that human brains don't work like hard drives.
Admin
This For-Case seems like a great idea... when paid by line. I'll have to remember it. ;)
Admin
This method needs to be packaged up as wtf.dll utility pack to be downloaded by users.
thedailywtf.com should start doing it for each of this super methods :)
Admin
I don't have .net. Last time I used VB was VB6. Is it still possible to concatenate strings with '+' and do mid(), left(), right() and format() still exist or have they been depreciated?
Admin
And you can verb the nouns, allowing you to redictionary any word you want!
Admin
One episode dealt with an aging uncle who had retired from professional boxing to become a butler for a rich white family. The two regulars kept teasing and insinuating about him being an "Uncle Tom", with terms like "massah" and "bowing and scraping", until he finally had his fill of it, and rose up to his full height of about 6'5" and said, "Why, you young punk, I used to put away three like you before breakfast."
Clearly meaning, "...and I still can."
Admin
\begin{quotation} % This is just to add geekiness For Loop Liberation Front. We're the Liberation Front for For Loops! For Loop Liberation Front...Cawk. \end{quotation}
Admin
[quote user="pscs"][quote user="ContraCorners"]Many languages don't have modal verbs, it's generally Germanic ones which do. Romantic languages change the verb form itself.[/quote]...into a valentine? :D
[quote user="Buddy"]Technically, English doesn't have infinitives, most tenses, or even a grammar in the sense of inflected languages like Latin and old Greek (from which grammar terms were derived).[/quote]That's a pretty limited sense of "grammar" though as the same can be said of most of the world's languages.
[quote user="Someone You Know"]For the record, and since no one seems to have objected to this one yet, "I used to be able to go" is the imperfect tense, not the past tense.[/quote]That's like saying "This code is not Visual Basic, it's VBA". "Imperfect tense" is the Latin term that makes little sense in English (or most other languages) because there's no 1:1 correspondence in their respective use. That's why this tense has been known as "past progressive" or "past continuous" for quite a while.
Captcha: dolor :D
Admin
So then this must be correct English as well. After all, they said it on the Jeffersons: "This here is the living area, where we does our living, and this is the dining area, where we does our dining, and this is the kitchen area..."
Admin
I blame the
union. Every job must be handled by one of the union members, or else.Admin
I'd like to say "WTF!!!!!!!!!" but have a major coffee-spat-over-keyboard problem to fix...
thanks! You owe me a new keyboard!!!
again!!
Admin
How about "I can tuna fish" vs. "I am able to tune a fish"?
Admin
Satire.
Admin
Well, I was going to stay out of this until now, but I have to comment on the discontinued use of "past perfect".
I am nearing 27 years old, so I was in elementary school not that long ago, and I have never heard it any other way than "past perfect".
Taking Latin in college finally cleared up the question that I never asked: what's so perfect about it? The Latin is the "per" prefix, roughly meaning "through", and "ficere", the verb meaning "to do or make". Hence, a past perfect verb is something that was done throughout, completely, and is not still happening. Likewise, a past imperfect verb would denote something that was started in the past, but was not done completely.
Granted "past progressive" is easier for us to understand, but "past perfect" is more fun to say, especially knowing the true meaning of it.
captcha: letatio
Admin
A for-case state machine is actually a legit way of designing a FSM using combinational logic and a counter; it leads to a pretty efficient chip count when using discrete logic components: http://en.wikipedia.org/wiki/Richard's_Controller
There are a lot of applications where it's exceptional to not just proceed to the next state. This isn't one of those cases because it isn't even exceptional for the logic to not progress, it's impossible.
Admin
Perl style:
for( 0 .. 3 ) { $out .= 'W' if( $_ == 0 ); $out .= 'T' if( $_ == 1 ); $out .= 'F' if( $_ == 2 ); $out .= '?' if( $_ == 3 ); } print $out;
Admin
It never fails to amaze me the horrendous measures taken by programmers (mostly Windows programmers) who've never been exposed to regular expressions.
Regular expressions should be a core competency for absolutely any programmer anywhere.
Admin
I'm using practically the same regex s/(\d{3})(\d{3})(\d{4})/\1-\2-\3/ to format numbers xxx-xxx-xxxx for a legacy dialer from a multitude of sources and styles (xxx)xxx-xxx, xxxxxxxx, xxxxxxxxxx, x(xxx)xxxxxxx, ect. Because my procedures run on several million lines housed in legacy flat files I can definitely attest that regex is the way to go.
Admin
#!/usr/bin/env perl
Regular expressions are the staple tool of any seasoned programmer
my $nicePhoneNumber = "";
Yucky phone number input
my $phoneNumber = "abc123abcd456iewjf7890";
Strip non-digit characters
$phoneNumber =~ s/[^\d]//og;
Format nicely
if ($phoneNumber =~ /(\d{3})(\d{3})(\d{4})/) { $nicePhoneNumber = "($1) $2-$3"; }
yields:
(123) 456-7890
print "$nicePhoneNumber\n"
Admin
Admin
Admin
[simple] past: I went past progressive: I was going (or: I used to go) past perfect: I had gone past perfect progressive: I had been going
Admin
Just sayin'.
Admin
[quote]Reminds me of the welcome speech from the Commandant of the Defense Language Institute. He said that once we got into our courses, some of us might start complaining about how hard the languages are to learn and how weird they are, but really, none of them are as hard to learn or as screwed up as English. As an example, he asked if anyone could give the past tense of "I can go"? Not one of the 300 or so people in the room, including me, could do it[/quote/
Now you have 2 options, as it is current - to go or not go, just because you can, doesn't mean you will...
so the past tense is I went, or I didn't go...
Admin
Admin
Erm, what's wrong with "I could go"?
Admin
TRWTF is that the unformatted phone number is a string. if it was an integer, cound just use phoneNumber.ToString("(###) ###-####");
Admin
How about a simpler question Do you want an Ice Cream ?
Past tense... as statments of what happend You had an Ice Cream You did not have an Ice Cream or as a question Did you have an Ice Cream ?
Admin
"I could go last week... is that soon enough?
Admin
He forgot to add 'on error resume next'
Admin
Clearly the result of management that is paying their developers based on the number of lines of code they write.
Admin
cleanPhoneNumber?!?! But what if I wanted a dirtyPhoneNumber?
Admin
I'd love to see this code handling variable-length area codes, like the ones used in Mexico, the UK or some other countries...
Admin
Well, I don't know about Case, but I think I can rescue poor For.
Admin
Yeah, I thought the same thing. The sarcasm started on the "at least".
Admin
Admin
I could have read more, but after that I was unable to remain awake.
Admin
Admin
Admin
The real WTF is whats not there...
Feed this sucker bad f00d and it will roll right over and return garbage. Then the app will barf all the way to the can.
There is no error checking visible, maybe it happens elsewhere, maybe not.
More likely not. /hurl!
Admin
I've never thought of using these two structures like this...it's a fine line
Admin
You're confusing two different notions here: whether you wanted the ice cream, and whether you got it.
I hold an ice cream in front of you. You want an ice cream. But I eat it instead. You WANTED an ice cream, but did not get one.
Now let's try this again: I hold an ice cream in front of you. You want an ice cream. I give you the ice cream. You WANTED an ice cream, and then you got one.
The same verb form applies regardless of whether you ate the ice cream or not. The question forms are analogous (do you want/did you want): they're about wanting, not about having.
Admin
If only it worked with the Windows TAPI!!
Admin
That number is south african... and close by...
Admin
Everything looks south african when you haven't had your coffee yet.
When I started programming for a job, I was 18 and never formally studied. What I knew were friends, books. No internet.
I wrote an application that generates a graph showing pressure inside a tunnel that's used for methane test explosions.
I would with pride submit the code here if I had it. For with case and with more for and so forth... one vb file that did everything. Was really really bad.
Anyways going to go on with my coffee and look at the wtf's over here
Admin
For a moment this had me tempted to reproduce it in assembly language.
Admin
Yeah, in binary it does.
Admin
How about
' I don't do VB, so excuse any errors Public Shared Function ApplyPhoneNumberFormatting(ByVal phoneNumber As String) As String Return phoneNumber End Function
Formatting phone numbers is evil. Just because you format your numbers in the US, doesn't mean the majority of the world do!
The only way to represent a phone number with international compliance is in a free form string.
Thank you, I'll get my coat.
Admin
Back in .NET 1 times, I was porting into C# something from a language that had a "yield" construct for creating iterators. While these days I could just write
"yield" wasn't in C# back then. The result instead was an enumerable class that had at its core (on first entry this._state==0):
(Yes, I'm painfully aware that what csc would crank out is much hairier. No, I haven't had my coffee yet.)
The Clayton's loop wouldn't be needed at all if "continue" did the obvious thing in switch statements to begin with.
Admin
State machines are best implemented in hardware, thank you.
module wtf(clk, rst, c); output [7:0] c; reg [7:0] c; input clk; input rst; reg [1:0] s;
always @ (posedge clk or posedge rst) begin if (rst) c <= 8'b0; else case (s) 2'd0 : c <= 8'd87; // 'W' 2'd1 : c <= 8'd84; // 'T'; 2'd2 : c <= 8'd70; // 'F'; 2'd3 : c <= 8'd33; // '!'; endcase end
always @ (posedge clk or posedge rst) begin if (rst) s <= 2'b0; else s <= s + 2'b01;
end
endmodule