One liners that make you giggle
-
Iterator tit = transactions.iterator();
-
parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.
parent.parent.parent.parent.parent.parent.parent.window.document.
getElementByID("hiddenCounter").value++;
-
Command-line one-liners:
man man
after aliasing the 'man' command to 'girl':
man girlif only there was a way to arrange this one...:
girl girl
-
if ((this.Something)&&(this._SomethingElse != null)&&(this._SomethingElse.Id != 0)&&(!this._SomethingElse.SomethingIsGoingOn)&&(!this._SomethingElse.SomethingHappened)&&(this._SomethingElse.HasStuff))
It's anonymized, but I swear to god that's in our framework. Yes, every single this-dot is unnecessary. I've found up to eight this-dots on one line.
-
@djork said:
if ((this.Something)&&(this._SomethingElse != null)&&(this._SomethingElse.Id != 0)&&(!this._SomethingElse.SomethingIsGoingOn)&&(!this._SomethingElse.SomethingHappened)&&(this._SomethingElse.HasStuff))
It's anonymized, but I swear to god that's in our framework. Yes, every single this-dot is unnecessary. I've found up to eight this-dots on one line.
I get why some folks use "this." where it's not necessary; sometimes it's to clarify things in a file with a lot of MyClass.staticConstant's (I know it's not necessary, but sometimes, especially with deeply inherited classes, it makes things more obvious).
Two of my personal pet peeves:
class MyClass { protected int MY_CONSTANT = 1; }
if (MyClass.this.MY_CONSTANT==x) { ...}
and
[code]class A { protected int x=1;}
class B extends A { protected int x=2; }
class C extends B { protected int x=3; }[/code].which forces hard-coding stupidity like:
[code]void xxx() {
C c = new C();
System.out.println("c.x="+c.x);
System.out.println("b.x="+((B)c).x);
System.out.println("a.x="+((A)c).x);
}[/code]
-
#define barf cout
#define gorge cin
-
@djork said:
after aliasing the 'man' command to 'girl':
man girlYou've been to thailand recently, haven't you.
-
Can't find the offending code right now, but saw this once:
if(bUserInitialized){
// cout << "User is initialized";
}else{
// cout << "User is not initialized";
}
-
@djork said:
after aliasing the 'man' command to 'girl':
man girl
Surely you mean "girl man"?
Also, I suspect (but don't know for sure) that you could either rename or symlink the appropriate file (looks to be /usr/share/man/man1/man.1.gz on a RHEL box) to girl to make "girl girl" (or "man girl") work. Fnar.
-
Perl's scoping can make some interesting lines like:
my $line; #whose line is it, anyway?
our $house; #in the middle of the street
For no particular technical reason, object self-references use the variable $self, rather than the keyword 'this'. Unlike 'this', however, '$self' is not set in stone, and I think it is done just so that each method begins with:
my $self = shift();
Then there is the infamous Perl threat clause:
$object->method() or die();
There is a module that implements an enhanced exception handling ability.... its key method is called "die_trying()" and is used syntactically the same way, e.g.:
$object->method() or die_trying();
I have been known to define some error text in a variable $HORRIBLY, so as to be able to write:
$object->method() or die($HORRIBLY);
On another note, I think it would be funny to create a Makefile that has a "love" and "war" target defined (maybe just alias them to "all") so that you can:
$ make love
$ make war
Along that same line, you could also define appropriate targets to:$ make ammends
$ make peace
$ make over
$ make up
$ make the_rounds
$ make friends
$ make money
...etc.
-
@Critter said:
$ make love
My favorite was
$ make install --not war
(ok, whenever I saw that I assumed that '--not' would exclude a particular target, but it's not in the man pages. Am I reading something wrong, or did the guy I borrowed that from lie?)
-
I have also seen one on Slashdot in a sig file that went something like:
unzip strip grep finger fsck more yes
there may be more to it, that's about all I can remember of it.
-
@vt_mruhlin said:
(ok, whenever I saw that I assumed that '--not' would exclude a particular target, but it's not in the man pages. Am I reading something wrong, or did the guy I borrowed that from lie?)
Looks to me like there are no double-dash options for GNU make, but make is not 100% standardised, by a log shot. I would have expected maybe:
make install #not war...or something like that.
-
@Cloaked User said:
@djork said:
man girl
Surely you mean "girl man"?
Depends. Girl comes first, would make you more popular with the ladies. Man comes first, is more realistic.
-
This was already mentioned in some other thread:
[code]long fuck = 99;[/code]
-
how about --keep-going?
-
A favorite C library of mine that we had in an old project -- gstring :)
-
define("PC_LOAD_LETTER",99);
Which I placed in there to generate "PC_LOAD_LETTER? What the f**k is that???" from a co-worker when he went into that service.
-
if ($framework->authentication->login($users->get_field("auth_typ"),$str_user_name, $str_password) == AUTH_RC_LOGIN_SUCCESS) {
// Is great success. I like. High five.
-- snip --
return AUTH_KNOWN_USER;
}I love the comment. Especially if you say it like Borat.
-
@djork said:
Command-line one-liners:
man man
after aliasing the 'man' command to 'girl':
man girlif only there was a way to arrange this one...:
girl girlin ksh:
alias girl='echo giggity;';
$ girl girl
giggity
giggity
-
user@host:~$ touch beanbag_girls_tits
touch: cannot touch `beanbag_girls_tits': Permission denied
-
@djork said:
if ((this.Something)&&(this._SomethingElse != null)&&(this._SomethingElse.Id != 0)&&(!this._SomethingElse.SomethingIsGoingOn)&&(!this._SomethingElse.SomethingHappened)&&(this._SomethingElse.HasStuff))
It's anonymized, but I swear to god that's in our framework. Yes, every single this-dot is unnecessary. I've found up to eight this-dots on one line.
I'm not suprised to see stuff like this. After all, we have code completion.
Not really funny but lines like if(something == true) {...} makes me giggle every now and then
-
DoMagic();
#define ODD 1
-
@Critter said:
On another note, I think it would be funny to create a Makefile that has a "love" and "war" target defined (maybe just alias them to "all") so that you can:$ make love
$ make war
> make love
make: *** No rule to make target `love'. Stop.
I think I just got dissed.
-
@Critter : Seen that one too, it is : unzip;strip;touch;finger;mount;fsck;more;yes;unmount;sleep
-
@snoofle said:
@djork said:
if ((this.Something)&&(this._SomethingElse != null)&&(this._SomethingElse.Id != 0)&&(!this._SomethingElse.SomethingIsGoingOn)&&(!this._SomethingElse.SomethingHappened)&&(this._SomethingElse.HasStuff))
It's anonymized, but I swear to god that's in our framework. Yes, every single this-dot is unnecessary. I've found up to eight this-dots on one line.
I get why some folks use "this." where it's not necessary; sometimes it's to clarify things in a file with a lot of MyClass.staticConstant's (I know it's not necessary, but sometimes, especially with deeply inherited classes, it makes things more obvious).
[/code]Believe me, it's not making anything clearer. It's simply that every instance variable is preceded with "this." because it brings up intellisense.
-
$> mysql <FONT face="Courier New">--i-am-a-dummy</FONT>
-
<cfparam name="MAXIMUM_FUCKUPS" default="10">
---------------------------------------------------------------------------------
Don't ask...Its a dev version of a coldfusion app. This actually was written by a colleague of mine & I. It would have been deployed to production like this. However, the Project Manager had us switch it to MAXIMUM_ERRORS.
Although I don't remember why we used that name, but the Senior Programmers on the team passed it through the Reviewing process!
-
@Critter said:
For no particular technical reason, object self-references use the variable $self, rather than the keyword 'this'. Unlike 'this', however, '$self' is not set in stone, and I think it is done just so that each method begins with:
my $self = shift();
This is a convention, not a keyword. You could easily use $this instead. It just happens to be the first argument passed to the function when you call object->method().Sometimes, you will also have my $class = shift; instead (in the constructor for a class, when you're calling ClassName->new(...) or whatever you've called the constructor).
Then there is the infamous Perl threat clause:
$object->method() or die();
Ever see any Perl poetry?
-
When we were working on one of our software projects at Uni, we noticed that we were often mistyping:
make run
as:
make urn
So we added a task to the Makefile that echoed something like:
_____ \ / | | | | \ / \ / .:::.
-
@vt_mruhlin said:
Can't find the offending code right now, but saw this once:
if(bUserInitialized){
// cout << "User is initialized";
}else{
// cout << "User is not initialized";
}That's leftover debugging code, from the printf() school of debugging.
-
@djork said:
Command-line one-liners:
man man
after aliasing the 'man' command to 'girl':
man girlif only there was a way to arrange this one...:
girl girlWhat about...
man mount
-
Just after typing the following code line in perl I laughed, then added the comment - it was easier than renaming the variables everywhere else, besides it does make perfect sense...
Just try explaining it, in words - without stumbling over the word array (or what you're referring to)
[code]
$arrays[$array{'array'}]=%array;
# Probably better understood as:
# $raid_arrays[$this_raid_array{'raid_array_id'}] = %this_raid_array
# But that's no fun ;)
[/code]
-
The total contents of a certain ASP classic file:
<%
// Response.write("<p class=\"text_content\">Template under construction.</p>");
%>
-
@fennec said:
@Critter said:
my $self = shift();
This is a convention, not a keyword. You could easily use $this instead. It just happens to be the first argument passed to the function when you call object->method().
Exactly. Like I said, it is for no particular technical reason.
@fennec said:
Sometimes, you will also have my $class = shift; instead (in the constructor for a class, when you're calling ClassName->new(...) or whatever you've called the constructor).
Right. In that particular case, $self wouldn't be an appropriate name, because it is not referring to an instance.
@fennec said:
Ever see any Perl poetry?
I had heard of it, but not really paid it much attention. I followed your link, though, and I think I'm going to have to look at it a bit more later. Thanks.
-
@Bob said:
Just after typing the following code line in perl I laughed, then added the comment - it was easier than renaming the variables everywhere else, besides it does make perfect sense...
Just try explaining it, in words - without stumbling over the word array (or what you're referring to)
[code]
$arrays[$array{'array'}]=\%array;
# Probably better understood as:
# $raid_arrays[$this_raid_array{'raid_array_id'}] = \%this_raid_array
# But that's no fun ;)
[/code]You are not expected to understand this
-
In C, when an infinite loop is legitimately needed:
#define EVER ;;
. . .
for(EVER)
{
. . . .
-
@Goldie said:
@Critter : Seen that one too, it is : unzip;strip;touch;finger;mount;fsck;more;yes;unmount;sleep
I think we could work "head" and "tail" in somewhere
-
Love this thread... made me join just to post some of my faves:
catch(RuleException rexTheKing)
Also:catch(Exception fit){ Logger.Log(fit) throw fit; }
This is from a friend who hated the MS UIP and MVC in general:
IAccountController extraCode = (IAccountController) this.Controller;
That controller might later call back to a manager class:IAccountManager stupid = ManagerFactory.CreateAccountManager();
Writing some XML Tranformation code late at night resulted in something like this:
XmlTransformer optimusPrime = new XmlTransformer(); XmlTransformer megatron = new XmlTransformer();
-
@badfrog said:
catch(Exception fit){
Logger.Log(fit)
throw fit;
}
Just a note, while 'throw fit' is funny, you generally want to do this instead:
catch(Exception fit){ Logger.Log(fit) throw; }
And, if you already know this, I'll shut up now.
-
in Java
catch (SomeExceptionType bone) {
// do some exception handling
throw bone;
}
-
@Carnildo said:
@vt_mruhlin said:
Can't find the offending code right now, but saw this once:
if(bUserInitialized){
// cout << "User is initialized";
}else{
// cout << "User is not initialized";
}That's leftover debugging code, from the printf() school of debugging.Yeah, but look where the comments are...
if(bool)
//Do nothing
else
//Do nothing here either!
-
While you're at it, integrate it into your program.
public class TemperTantrum : System.ApplicationException
{
public TemperTantrum() : base()
{}
public TemperTantrum(string message) : base(message)
{}
}
throw new TemperTantrum("AAARGH!!");
-
Part of a method *doc comment:
[code]* @return Boolean true or false[/code]
But what about FILE_NOT_FOUND?
-
@m0ffx said:
user@host:~$ touch beanbag_girls_tits
touch: cannot touch `beanbag_girls_tits': Permission deniedMore like--
[kirchhoff@img]$ grep -i nipple ~lickylindsay/tits
grep: /home/lickylindsay/tits: Permission denied.
-
From Programming Perl:
$crystal->$meth();
-
There's a few good ones in [url=http://perlmonks.org/?node_id=129726]this thread[/url]. Some highlights:
my $yea_verily_I_say_unto_thee_that_the_number_of_the_tr_tag_shall = $tr_start;
skip $Why, 2 unless Pigs->can('fly');
while (is_computer_on() && !is_computer_on_fire())
-
@badfrog said:
Love this thread... made me join just to post some of my faves:
catch(RuleException rexTheKing)
This is from a friend who hated the MS UIP and MVC in general:IAccountController extraCode = (IAccountController) this.Controller;
That controller might later call back to a manager class:IAccountManager stupid = ManagerFactory.CreateAccountManager();
Writing some XML Tranformation code late at night resulted in something like this:
XmlTransformer optimusPrime = new XmlTransformer();
XmlTransformer megatron = new XmlTransformer();Bahaha
-
Found last night in some old HTTP parsing code:
[code]//TODO: Handle unhandled versions... what?[/code]
-
found this one yesterday while working on an interface
float cum_log_lik_ratio;