Posts made by dhromed
-
RE: It sort of sorts...
Splendid!
Now let me show you our fine selection of invisible apples. They look great! -
RE: Vim vs. IDE (flame on)
@Stan Rogers said:
@dhromed said:
It is just as wrong as "fewer". If I were an English teacher, I'd
cross it with my big red pen. No such perversions in my class!
If you were an English teacher marking composition (as opposed to
expository), you would be wrong (although, as master of the class, you
would be fully within your rights to be wrong, provided that you
maintained consistency). Fowler does not apply in dialogue.
By the way, what do you have against "fewer"?
I would be inclined to accept "nowt" as a way of writing that word, but
only in specific cases. Dialects may happen. Spelling differences may
happen. e.g. China. I accept that one may shrug off "naught" as my
personal preference. That still gives me the right to unleash the red
pen if and when I see "nowt" in a submitted text.
As for the nonsense that is fewer:
There is a perfectly valid replacement of "fewer". It is "less".
Contrary to what a hapless linguist might think when investigating
American English, "less" applies to both a number of separate objects
(less keys, less trees, less things) and quantities of
materials/substances (less water, less metal, less code).
Consider (correct):
a few lines of code.
less lines of code.
more lines of code.
many lines of code
much code
lots of code
and (grammatical anomalies):
fewer lines of code
morer lines of code (you have more, but I have morer! yay!)
manyer lines of code
mucher code
lotser code
But interestingly (correct, though somewhat archaic):
lesser lines of code
Archaic, because in these times, one would actually say:
these lines of code suck
----
The suffix ER in "fewer" is entirely redundant. If one has few, you
already have few, and someone else can't have fewer. If that someone
does have less, than he has LESS, not FEWER.
In other words, "fewer" is grammatical bullshit.
-
RE: Vim vs. IDE (flame on)
@Stan Rogers said:
@dhromed said:
nowt
'naught'
Not necessarily -- "nowt" is a regionalism. Yes, they're the same word,
but the intent was (and is, in such cases) to convey the dialect as
well. It is not a spelling mistake. "Nowt" has a long and strong
tradition in print.
It is just as wrong as "fewer". If I were an English teacher, I'd
cross it with my big red pen. No such perversions in my class!
-
RE: Network cable WTF (not safe for 56K)
All the routers are now held up with strips of Velcro
Hail technology!
My router comes with hangup-holes in it. I drove two screws into the wooden wall and hung it up. It will survive an earthquake, provided the wall survives it.
My only concern is the cat.
-
RE: It sort of sorts...
@triso said:
Sorry, I am blind to sarcasm that is over one sentence long--a quick
comeback is all I know. I fell for the "uppercase lowercase space
in VB" thing this spring. I made a fool of myself in front of all
the volks at work. I was finally convinced that it was a gag when
someone showed me that the only hits for "uppercase space" were here on
thedailywtf.com.
This is the upprcase space:
This is the lower case space:
See?
-
RE: Is there a "I hate Lotus Notes club" - New to this Forum
@Mike R said:
@Savior said:
Hail to you,
While there isn't such a club (yet), there's the "I hate emptyset" club, and includes almost all members of the forum, except one.
Heh, which one is that? emptyset?
Interestingly, no, it isn't.
-
RE: Vim vs. IDE (flame on)
nowt
'naught'
I'm still on the view that if you need a program to tell you what's wrong with your code and auto-complete your method names, you don't
Auto-complet saves time. If you keep writing for loops by hand EVER SINGLE TIME, instead of some macro or what have you, then you're not 1337, you're just generating RSI. :)
But, I rarely use autocomplete. Why? Because it gets in the way. Go figure. I have a little app in my tray that allows me to store strings behind a short keyword. For example, I could type "/loop" and a standard counting for-loop appears. Also handy when inserting cheat codes into games. :D
-
RE: General Editors/IDE Discussion
I've fallen in love with Editplus, because of its direct-FTP, and
language-specific colouring: I've coloured PHP more blueish, Jscript
more black+green, funky languages like Python and Perl get a greyish
green scheme. HTML is dark blue and orange and red. :3
I've even added an SQL stx file, which I easily expand as I learn more about SQL.
A major drawback of Editplus so far is that the colours don't seem to
be saved in a file, meaning I have to set them up again if I upgrade
it. I hope I'm wrong. I can't live without proper colouring.
I've tried Editpad, but it's just clunky suck, and ASP in it defaults to VB colouring with no apparent way of changing that.
I may try Ultraedit, since I've seen it has expanded much.
JEdit may be good in some sense, but it's one of those editors with
global syntax colours, which I hate, and it's soooooo sloooooowwwwww.
An intern here uses Vim, and he's completely wild about it. He's a 1337 H4X0r.
I find it much easier to program when I don't have to reach for the mouse every few seconds.
Nobody does. And you don't have to. You can easily navigate text using control-combinations of cursor keys and pageup/down home/end, and setting up control keys for functions like duplicating a line is very useful.
It also helps if your client puts the cursor on the start of the statement when pressing Home, instead of the start of the line, seeing as how most statements have preceding tabs.
-
RE: Who needs input validation anyway
Possible forgotten leftover SQL bugzapping.
Hm.
Adjective Verbadjective Adjective Noun Gerund
It's a sentence.
Quite. -
RE: Test Thread
A test of the [ code ] BB tag.
[code]
if (elemById('splash_hidelinks'))
{
var editableLinks = elemsByTag('a',elemById('splash_hidelinks'));
var bollenLinks = elemsByTag('area');
for (var i = 0; i < editableLinks.length; i++)
{
bollenLinks[i].setAttribute('href', editableLinks[i].getAttribute('href'));
}
}
[/code] -
RE: Test Thread
A test of the PRE tag in the plain editor, no preview.
<pre>
if (elemById('splash_hidelinks'))
{
var editableLinks = elemsByTag('a',elemById('splash_hidelinks'));
var bollenLinks = elemsByTag('area');
for (var i = 0; i < editableLinks.length; i++)
{
bollenLinks[i].setAttribute('href', editableLinks[i].getAttribute('href'));
}
}
</pre>
-
RE: A poor HTML/CSS assumption
Why would anyone run their browser maximized if their monitor is more than 800x600. Waste of screen space, and harder to read because the eye works best on short line lengths. (Or at least so I've been told, and I personally find it true)
I run 1600*1200 at work, and always run maximised at all times.
- I have the sidebar with bookmarks open in Firefox, which eats away a cuple hundred pixels of screen space.
- in Firefox and Opera, you have a proper text- resp. screen-zoom that will allow you to make good use of the extra pixels, and make reading more comfortable. Sites like theDailyWTF benefit greatly.
I agree that it's not funny to run a maximised browser with IE. Because that silly browser lacks the option to enlarge fonts defined in pixels. But I still do it, unless I come across a bad site where the width hasn't been limited, and then I un-maximise the window. But I don't use IE privately, so it rarely happens.
I've alwasy been stunned at the inability of MacOS to maximise windows. It's a basic feature that reduces on-screen clutter -- which isn't debatable. I mean, a single window versus a small window + bits of other windows; which is less cluttered?
-
RE: Double Trouble?
@DrJames said:
@Manni said:
DrJames: The concept he's using with the random numbers is familiar to me. Check it out:
The random number he generates will be between 0 and 7 inclusive, because I don't think you'll ever get 8 with that calculation. If you have four choices you want randomly chosen, then you'd break it up into sections that are two numbers wide. If it's 0 or 1, choose one background. If it's 2 or 3, choose this one, and so on. All the I think he was going for something like this:
if (cur < 2)
backgr = backgr1;
elseif(cur < 4)
backgr = backgr2;
elseif(cur < 6)
backgr = backgr3;
else
backgr = backgr4;
But no matter how you look at it, he cocked it up. It's still just as many WTFs as you counted.
Correct me if I'm wrong but since Math.Round is not specified as ceiling or floor, I'm assuming its rounding to the "closest integer" which would mean that I was wrong in saying from 1-8, it's actually from 0-8.
I still don't get why you would break it into two number sections... just do Math.Floor(4*random) which will give you 0-3, then do
switch (randomnumber)
case 0: do this; break;
case 1: do that; break;etc.
Real men would put functions in an array, and do something like:
[code]actionsArray[Math.Floor(4*random)]()[/code]
No more comparing! Ever!
I also love this bit:
if(is.ns6) {
available_width = innerWidth;
available_height = innerHeight;
} else if(is.ie4 || is.ie5 || is.ie55 || is.ie6) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
}
In other words,
else {
//throw an error because of the undefined variables
}
-
RE: Moved: Offtopic Discussion w/Katja
@Stan Rogers said:
@asmodai said:
@CPound said:
Hey Katja,
You still chillin' in the Netherlands (or Dutch-land or whatever country you're from)?
Netherlands, please.
I have a hard enough time thwapping people for using Holland instead of
the Netherlands. (And yes, that includes my own dumb countrymen,
thankyouforasking.)
Not everyone in the Netherlands is in a place like Utrecht or Friesland, you know -- some are actually in Holland [:)]
But then you're specifially in the province of North- or South-Holland.
THERE IS NO HOLLAND. There used to be. Like, before the 80-year war. Things kind of changed form thee on.
I sometimes write Dutchland just to confuse the map-oblivious into
thinking I mean Deutschland, knowing full well that the English name
for Deutschland is Germany. Ha.
-
RE: A poor HTML/CSS assumption
I'm running 1280x[b]1024[/b]
Take [i]that[/i], you "webdevelopers" -
RE: Today's Target - Dumb Question
@endergt said:
Ok, next dumb question... how/why did my smiley end up with a link? [:S]
Pray to God for that answer.
-
RE: Today's Target - Dumb Question
@endergt said:
Excellent question, and thanks to all the answerers, and here's an even
dumber follow-up - how do you quote the message you're replying to?
Copying and pasting, or even highlighting and dragging, results in the text being present, but with no indication of quotation.
It's right next to the 'reply' button.
You may also manually use the [ quote ] BB-standard tags, the usage of which is illustrated by clicking a quote button.
-
RE: Ternary operators nightmare
@eagle said:
@dhromed said:
Are ternaries faster to compile or run than 'real' if/else?
Don't know about compile, and at run time the difference is minimal.
However ternaries in Java tend to produce longer code paths, hence they
should be slower.
Actually the code presented is obviously a manually optimized switch
statement. The Java-Compiler would create a tableswitch bytecode, that
would need an average of over two comparisons per call, while the
optimized version here is close to one comparison per call. But: a) it
is unreadable and b) it prevents JIT and HotSpot from further
optimizing the tableswitch when compiling to native code and last but
not least c) the performance improvement is almost not noticable and
certainly not worth the effort.
cu
I have no experience with compilers at all, but I'd sort of expect a
ternary to allow a compiler to optimize compling, since you can always
be sure that there is only 1 statement after the ? and 1 statement
after the :
Attempting to fit in more lines using {} would (in ECMAScript anyway)
create an unassigned instance of Object() containing obviously invalid
syntax. :)
Wouldn't really save seconds or minutes, I imagine.
But in the end it's always an if, and an if runs as fast as an if.
-
RE: Ternary operators nightmare
Are ternaries faster to compile or run than 'real' if/else?
-
RE: Interviews
"You do realize C# and VB.Net are nearly identical languages?"
Ok, which one of you wise guys decided to swap out the meaning of 'identical' and 'different' again?
-
RE: Yeah, not the anti not un-that one
The Suck about Firefox tabs is that when you have a number of tabs
open, and close one, the LAST TAB gets focus, instead of the naturally
PREVIOUSLY-VIEWED one. -
RE: Try without Catch
@masklinn said:
@Cyresse said:
Erm, if you wanted to handle the exception at a higher level,can VB do this?
(Python stz)try:
foo()
except:
raise
finally:
bob()
You cannot use both except and finally in a Python exception-handling structure.
You may use either try/except/else or try/finally (the finally will basically catch and re-raise any catched exception)
So the else: in Python does the same as finally {} in other languages?
Why have two syntaxes for a single construct?
-
RE: Interviews
My production code doesn't have bugs either.
It has 'functionality inhibitions'. -
RE: Argument of using boolean datatype...
@Drak said:
as long as you work on the premise that 'if it ain't filled in, it ain't on'.
One could disallow Nulls for that table column, so that no accidental NULLs get in the table.
-
RE: Language Translations
I doubt the message was hand crafted by a unique individual.
-
RE: The Daily MetaWTF
@Mike R said:
Alex, you're an awesome beta tester for this forum
software, given your readership is a bunch of critics [;-)]
This forum is in beta right now?
-
RE: Too much of a good thing?
If I need comments to understand the code, then you did it wrong, likely because you were trying way too hard.
No.
I understand and agree to the importance of self-documenting code, but inorder to understand code, one has to be focused. Often, you don't have time to be that focused, and you need a hand to quickly get to a suspect bit of code and start bugzapping, or quickly get to the code that needs finishing and start coding.
After all, how does reading the comments help if they say something completely (or subtly!) different from what the code does?
How can anyone in his/her right mind write a comment that does not summarize what the bit of code does?
I mean something like this:
[code]
//destroy user object, close DB connections
var philsSammich = new Sandwich(philsSpecialIngredients);
philsSammich.addExtra(genericExtras.ketchup,extrasQuantity.britishtablespoon(6));
deliveryList.push(philsSammich);
[/code]
That... doesn't happen.
And if it does, you call it a 'bad comment'. The way you're stating it it's like no such thing as a 'good comment' exists.
Comments are for decoration purposes, when something particularly tricky has to be done and can’t be written in any clearer fashion.
You contradict yourself somewhat here. You say comments are decoration and then explain it by saying comments are for clarification. Of course tricky code has to be clarified, but when you're starting work on code, and you're scanning it as opposed to concentratedly reading it char by char, virtually [i]all[/i] code is 'tricky'. Especially around 4pm and you haven't had your cup-a-soup yet.
That’s called documentation. Comments are entirely the wrong place for things like that.
I'm not privy to standard procedure in software development because I'm just a maggot webcoder, but does the documentation contain an explanation of the bit of code, plus the line on which it sits? But that would be exactly what a comment is for. It's why it's called a 'comment'. -
RE: The Brillant Wiki
Wikipedia:Votes for deletion was first hosted on this BSD powered toaster.
*snort*
-
RE: Savvysoft TurboExcel
It's because they're using a Word document as data transporter.
-
RE: Too much of a good thing?
You make a strong point.
I tried it on a javascript web-interface I wrote four months ago, and it looks like this:
///// Set up klanttypes /////
// Type globals
//easily limit selections to the right DIV
//preget maximum id to allow SQL-style auto-incrementing after deleting items
//collect id numbers to get largest.
// Set click event for displayed list items (both lists)
// Set click events for edit buttons (for both lists)
// What to do when a button is clicked
//actionRaw is a string of the format 'kt_update' or 'ln_add'
// 'klanttypes' or 'talen'
//add, update, delete
//'kt' or 'ln'
//get interface' editfield
//IE keeps adding dead spaces to the end. Drat!
// the action switch.
// return; statements exit the function so that no data is submitted on error.
//translate div ids into DB table names.
Seeing it like this, there's a comment or two missing near the actual end, and it may not be as super-clear as possible. -
RE: BLOCKED SCRIPT instr, even with ascii conversion yields random results
Weird, I had this once. Maybe it's case sensitive.
- javascript
- Javascript
- JavaScript
- javascript
-
RE: Ask a silly question?
@bugmenot said:
Okay, this is pretty simple. Remember the Star Trek episode
with Harry Mudd, not "Mudd's Women," but the other one, with all the
androids? Remember how they shut all the androids down by being
completely illogical? (Classic.) Well, that's what's
happening here. A bunch of morons who can't get real jobs while
the fully qualified people are in the way are trying to explode our
brains by using non-sensical language. Once we're out of the way,
they take our jobs. Don't try to figure them out, just ignore
them, perhaps they'll go away.
Is this Star trek Classic you're talking about? I don't remember any such multi-android episode of TNG.
-
RE: Thoughts on the New, New Format?
I vote for disabling the preview button.
We get to vote, right? -
RE: Is IsNothing() really a wtf in theory?
@murphyman said:
wrapping up code
in a function which is a 1-liner in the language itself - what
have you achieved?
That about sums it up.
If a function contains a single IF and returns an explicit TRUE or
FALSE, one should notice that something has been non-optimised.
I have been guilty of writing an IsTrue() function.
The function is now dead.
-
RE: Key a sex offender database on last name, what a great idea!
Erasing your criminal history by changing your name from Kirkeby to Kirk... that's like two birds with one stone.
Seriously, what kind of Über Moron keys by LAST NAME?
"Why, last names are unique, aren't they?" -
RE: Too much of a good thing?
@sadmac said:
I was taught explicitly several times to make a best effort to comment every line.
No.
Absolutely not.
No.
Your teachers are wrong. It's not bullshit to comment 'often' but it's
certainly bullshit to comment 'every line'. For functions in a library,
I often comment the in and out, just above the function definition.
Other than that, in complex routines, I comment to let people know what
a specific couple of lines do.
Comments are there to prevent people from asking 'wtf does this do?'
You don't comment for yourself, you comment for others and your future
self.
@sadmac said:Around 3am semi-colons get hard to read.
But you have to understand the code to add proper comments, so it's
like a catch-22. You want to add comments to better understand the code
at 3am, but to add comments you have to understand the code, which
makes adding comments redundant.
Around 3am, you'll write bad code anyway, so commenting [i]everything[/i] will only increase the kludge.
-
RE: Bytes suck!
@elnerdo said:
If only you had thought of making the topic title a play on words..
Bytes bite!
Byte me.