pouët.net

Random source code comment thread

category: general [glöplog]
string ipAsString = ipAddress.ToString();
bool bHasExactly3Periods = ipAsString.Count(c => c == '.') == 3;
bool hasNoFuckingLettersThankYouVeryMuchWindows7 = !ipAsString.Any(c => char.IsLetter(c));
return bHasExactly3Periods && hasNoFuckingLettersThankYouVeryMuchWindows7;
added on the 2010-03-01 21:40:26 by SheaAllan SheaAllan
if(lastMousePosition.Equals(MousePosition))
{
// The mouse didn't actually move. So let's get the fuck out of this method.
return;
}
added on the 2010-03-01 21:42:39 by SheaAllan SheaAllan
public class WTF_Exception : Exception
{
public WTF_Exception() : base("wtf!?")
{
}

public WTF_Exception(string message) : base(message)
{
}
}
added on the 2010-03-01 22:04:53 by SheaAllan SheaAllan
// Better than light-speed serialization.
static public class LudicrousSpeedSerialization
added on the 2010-03-01 22:05:56 by SheaAllan SheaAllan
Code: if (reader == null) { LFEventLogger.LogError("Why is the reader fucking null??"); }
added on the 2010-03-01 22:07:24 by SheaAllan SheaAllan
[code]public void Test_Combo_Box_PLC_Type_Gets_Set_Properly()
{
// fuck that.
}
[/code
added on the 2010-03-01 22:09:14 by SheaAllan SheaAllan
Code:public void Test_Combo_Box_PLC_Type_Gets_Set_Properly() { // fuck that. }
added on the 2010-03-01 22:09:32 by SheaAllan SheaAllan
Bra andpantsoff ;old Dual 4mat gag in every demo. Funny when you're 17 and pissed :)

added on the 2010-03-01 22:11:33 by Gmitts Gmitts
Code: // At this point, I'd like to take a moment to speak to you about the Adobe PSD format. // PSD is not a good format. PSD is not even a bad format. Calling it such would be an // insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having // worked on this code for several weeks now, my hate for PSD has grown to a raging fire // that burns with the fierce passion of a million suns. // If there are two different ways of doing something, PSD will do both, in different // places. It will then make up three more ways no sane human would think of, and do those // too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide // that *these* particular chunks should be aligned to four bytes, and that this alignement // should *not* be included in the size? Other chunks in other places are either unaligned, // or aligned with the alignment included in the size. Here, though, it is not included. // Either one of these three behaviours would be fine. A sane format would pick one. PSD, // of course, uses all three, and more. // Trying to get data out of a PSD file is like trying to find something in the attic of // your eccentric old uncle who died in a freak freshwater shark attack on his 58th // birthday. That last detail may not be important for the purposes of the simile, but // at this point I am spending a lot of time imagining amusing fates for the people // responsible for this Rube Goldberg of a file format. // Earlier, I tried to get a hold of the latest specs for the PSD file format. To do this, // I had to apply to them for permission to apply to them to have them consider sending // me this sacred tome. This would have involved faxing them a copy of some document or // other, probably signed in blood. I can only imagine that they make this process so // difficult because they are intensely ashamed of having created this abomination. I // was naturally not gullible enough to go through with this procedure, but if I had done // so, I would have printed out every single page of the spec, and set them all on fire. // Were it within my power, I would gather every single copy of those specs, and launch // them on a spaceship directly into the sun. // // PSD is not my favourite file format.
added on the 2010-03-01 22:20:55 by LiraNuna LiraNuna
Code:/* Now, some fun code begins: This will determine if a specific row in a pattern (orderlist item) has been visited before. This way, we can tell when the module starts to loop, i.e. when we have determined the song length (or found out that a given point of the module cannot be reached). The concept is actually very simple: Store a boolean value for every row for every possible orderlist item. To save some memory, I have decided to actually store 8 row flags in one uint8 item, to save some space. Hence, there's some funky bit-shifting here and there. As the modplug engine already deals with pattern loops sufficiently, there's no problem with (infinite) pattern loops in this code. However, if you're going to use this idea somewhere else, bare in mind that rows inside pattern loops should only be evaluated once, or else the algorithm will cancel too early! */
Code: if (pBlock->m_pNext != NULL && pBlock->m_pNext->m_isFree) { Block *pNextBlock = pBlock->m_pNext; // I'm not fooled by the blocks that you've got -- I'm still, I'm still next on the block. pBlock->m_size += pNextBlock->m_size; // Used to have a little, now I have a lot! pBlock->m_pNext = pNextBlock->m_pNext;


r&b novelty rap stays with me.
added on the 2010-03-01 22:50:18 by superplek superplek
plek, your notation sucks and it's inconsistent :)

I came across this "nice" condition in the code of a rather "outspoken" apprentice in the company
I work for as a "hired gun". Once I had the "privilege" to have been forced to walz through his code and
find some strange bugs. Although it's not exactly a bug, I couldn't help myself and did some comments on it.
Code: //$size = null; // you gotta be kiddin' me! /* if($size = sizeof($this->arrDATA['products'])){ $products = $this->arrDATA['products']; unset( $this->arrDATA['products'] ); foreach ($products as $product){ $tmpPrd[] = $product; } } */ // WTF was this copy loop for ?? // The content of $tmpPrd is IDENTICAL to this.arrDATA[products] // after this stupid loop with an entry condition that ALWAYS will // return TRUE ... look at it FFS! // Thus, the following lines do the same thing as long as there is no // other condition or sorting necessary ... $tmpPrd = $this->arrDATA['products']; // copy $this->arrDATA['products'] = array(); // re-initialize empty array

added on the 2010-03-02 10:36:46 by d0DgE d0DgE
Code:// very space opera.
added on the 2010-03-02 11:08:46 by ryg ryg
Code://<rewbs> what the hell is this?! :)
Looks like OpenMPT dev is fun!
added on the 2010-03-02 22:00:44 by xTr1m xTr1m
it sure is!
Code: (*--------------------------------------------------------------------------- Procedure: IsTrue Author: jed Date: 26-Aug-2003 Description: useful for determining the boolean result of an expression ---------------------------------------------------------------------------:*) function IsTrue(Expression: TExpression): Boolean; var ResultHasBeenSet: Boolean; begin Result:=(Random(2)=0)=True; ResultHasBeenSet:=False; // if the expression is true then the result will be true, otherwise (since the // expression couldn't be true) the result will be false. There are no other // mathematical possibilities begin if (Expression=True) then begin Result:=True; ResultHasBeenSet:=True; end; if (Expression=False) then begin Result:=False; ResultHasBeenSet:=True; end; end; // need to set the result if it hasn't been set yet, we'll randomly decide true or false // because there should be no bias. if IsTrue(ResultHasBeenSet)=IsTrue(0=1) then Result:=((Random(2)=Random(2))=True) else Result:=(Result=True); // P.S. // This function could also be adapted to tell you if some expression is false // by prefixing the expression (or the result) with the 'not' operator. You can // find out more about the 'not' operator in the online help. end;
added on the 2010-03-02 22:40:50 by flure flure
Code: // Returns the next character from the file, taking care of counting lines, // skipping illegal characters and C style bloc comments. // Warning: Having a file that contains stuff like //****** will fail badly. // I need to handle C++ like comments in this function... crap

added on the 2010-03-02 23:02:26 by Dbug Dbug
// nonsense... we saved the file without a memory card. Well... whatever, we did it.
added on the 2010-03-03 02:01:17 by pan pan
macaw: at least I know how to spin more than a few cubes around, horse-loving son of a bitch ;)
(nej, jeg elsker dig rasmus!)
added on the 2010-03-03 03:41:22 by superplek superplek
// This code is flawed for a number of reasons:
// 1. If the center of the blob is outside of a grid, a page fault occurs immediately.
// 2. If a blob isn't fully within the grid, chances are it is not rendered, because
// the edge walked towards is only in 1 single direction (++gX).
// Now as long as the precondition that all blobs must be fully within the grid perseveres,
// this is not a problem. But in reality this old piece of shit needs a rewrite.

still these are the blobs that made everyone look ever since 2002 :) and they still do nowadays. sse power.
added on the 2010-03-03 03:43:03 by superplek superplek

login