<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jocke &#187; java</title>
	<atom:link href="http://jocke.no/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://jocke.no</link>
	<description>kek lol wtf?</description>
	<lastBuildDate>Sun, 15 May 2011 01:11:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>Morro med programmering</title>
		<link>http://jocke.no/2009/06/15/morro-med-programmering/</link>
		<comments>http://jocke.no/2009/06/15/morro-med-programmering/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 06:41:18 +0000</pubDate>
		<dc:creator>jocke</dc:creator>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[Lek & Moro]]></category>
		<category><![CDATA[distro]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[makefile]]></category>
		<category><![CDATA[morro]]></category>
		<category><![CDATA[programmering]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[variabler]]></category>

		<guid isPermaLink="false">http://www.jocke.no/?p=358</guid>
		<description><![CDATA[Man kan finne på mye morro med variabelnavn når man programmerer :)

 byte me;
 long john_silver;
 char broiled;
 string vest;
 float valve;
 double jeopardy;
 struct by_lightning &#123; ... &#125;;
 Object strongly;
 class warfare &#123; ... &#125;;
 String cheese;
 Exception taken;
 Graphics ex; // XXX
 long walk&#40;short pier&#41; &#123; &#125; // from the MrBunny Java book
 [...]]]></description>
			<content:encoded><![CDATA[<p>Man kan finne på mye morro med variabelnavn når man programmerer :)</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #000066; font-weight: bold;">byte</span> me<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">long</span> john_silver<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">char</span> broiled<span style="color: #339933;">;</span>
 string vest<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">float</span> valve<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">double</span> jeopardy<span style="color: #339933;">;</span>
 struct by_lightning <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
 <span style="color: #003399;">Object</span> strongly<span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">class</span> warfare <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
 <span style="color: #003399;">String</span> cheese<span style="color: #339933;">;</span>
 <span style="color: #003399;">Exception</span> taken<span style="color: #339933;">;</span>
 <span style="color: #003399;">Graphics</span> ex<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// XXX</span>
 <span style="color: #000066; font-weight: bold;">long</span> walk<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">short</span> pier<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// from the MrBunny Java book</span>
 <span style="color: #000066; font-weight: bold;">int</span> elligence<span style="color: #339933;">;</span>
 bool me_over<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">short</span> circus<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">int</span> eger<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ...completing what the designers of the language left out</span>
 <span style="color: #000066; font-weight: bold;">char</span> acter<span style="color: #339933;">;</span>
 bool ean<span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">void</span><span style="color: #339933;">*</span> bowels<span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">class</span> Brick <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Throwable</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">class</span> Marathon <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Runnable</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">class</span> Novel <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Serializable</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">class</span> Human <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Cloneable</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
 Fun<span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span> <span style="color: #339933;">%%</span> funky<span style="color: #339933;">!</span>
 <span style="color: #000000; font-weight: bold;">public</span> MyTestCase<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> man<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>man<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #009900;">&#40;</span>fit <span style="color: #339933;">|</span> up <span style="color: #339933;">|</span> something<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>e_coyote<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></div></div>

<p>Og har du noensinne prøvd å skrive &#8216;make love&#8217; i terminalen på en *nix distro? Mange av dem har nemlig et artig tillegg i &#8216;makefile&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">love: /dev/null
       <span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">not</span> war?</pre></div></div>

 <img src="http://jocke.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=358" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jocke.no/2009/06/15/morro-med-programmering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Morsomheter fra kildekoder &amp; manualer</title>
		<link>http://jocke.no/2009/06/10/kildekoder-manualer/</link>
		<comments>http://jocke.no/2009/06/10/kildekoder-manualer/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 17:54:01 +0000</pubDate>
		<dc:creator>jocke</dc:creator>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[Lek & Moro]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[kildekode]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programmering]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.jocke.no/?p=323</guid>
		<description><![CDATA[Finnes mye morsomt i kildekoder og manualer. Her er et lite utdrag med de jeg synes er gode.

// Since this file is loaded on every page, and since
// I want the following function on every page, I'm going to
// cheat and include it here even though it has nothing to
// do with the other things [...]]]></description>
			<content:encoded><![CDATA[<p>Finnes mye morsomt i kildekoder og manualer. Her er et lite utdrag med de jeg synes er gode.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Since this file is loaded on every page, and since</span>
<span style="color: #666666; font-style: italic;">// I want the following function on every page, I'm going to</span>
<span style="color: #666666; font-style: italic;">// cheat and include it here even though it has nothing to</span>
<span style="color: #666666; font-style: italic;">// do with the other things in this file.</span>
<span style="color: #666666; font-style: italic;">// If you don't like it, bite me!</span></pre></div></div>

<hr />
Historiene skal ha det til at følgende er hentet fra en gammel IBM-manual</p>
<blockquote><p>* Single bit errors are detected and corrected<br />
* Double bit errors are detected<br />
* Undetected errors are ignored</p></blockquote>
<hr />
Før en ganske komplisert, og fullstendig ukommentert kode:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Abandon all hope, ye who enter here.</span></pre></div></div>

<hr />
<blockquote><p>The library routine names in the Playstation apparently were translated phonetically from Japanese to English. So it had documentation referring to a &#8220;clit index&#8221; instead of a CLUT index (Color LookUp Table index).</p></blockquote>
<p><span id="more-323"></span></p>
<hr />
En bedrift pleide å bruke en felles kommentar-merking, hvor &#8220;$&#8221; betydde &#8220;Beskjed/informasjon&#8221;, &#8220;$$&#8221; betydde &#8220;Adversel: Denne koden kan gjøres bedre&#8221;, og &#8220;$$$&#8221; betydde &#8220;Dette må bli fikset før lansering&#8221;. Slike merkinger er lette å søke etter i C, siden &#8220;$&#8221; nesten aldri brukes.</p>
<p>Følgende kode ble i etterkant funnet</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>x <span style="color: #339933;">==</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
x <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// $$$$$$$$$</span></pre></div></div>

<p>(Dette er selvsagt så man kan bruke det som et &#8216;breakpoint&#8217; ved en senere anledning)</p>
<hr />
En &#8216;nybegynner&#8217; i programmering, skulle skrive en VB-code som trengte å vite hvilken dag i uken det var. Han bestemte seg for å skrive sin egen kode, og ble seende slik ut:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #8D38C9; font-weight: bold;">if</span> (day = 1) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 8) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 15) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 22) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 29) <span style="color: #8D38C9; font-weight: bold;">then</span>
weekday = <span style="color: #800000;">&quot;Monday&quot;</span>
<span style="color: #8D38C9; font-weight: bold;">elseif</span> (day = 2) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 9) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 16) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 23) <span style="color: #8D38C9; font-weight: bold;">or</span> (day = 30) <span style="color: #8D38C9; font-weight: bold;">then</span>
weekday = <span style="color: #800000;">&quot;Tuesday&quot;</span>
...</pre></div></div>

<p>I forsøk på å lære han noe, fikk han spørsmål fra medprogrammerere om hans egen formening om koden han hadde skrevet. Han svarte ganske enkelt at han ville oppdatere koden hver måned.</p>
<hr />
Sitater fra dokumentasjonen til et ukjent, russisk system:</p>
<blockquote><p>For working with the system, it is recommended to use a multi-button mouse with two buttons.</p></blockquote>
<blockquote><p>The visible state should be understood as the state when an element is shown (displayed) on the screen and is not hidden (invisible).</p></blockquote>
<hr />
Sett i kode &#8211; og er fullt forståelig!</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>some long <span style="color: #b1b100;">and</span> messy code<span style="color: #009900;">&#93;</span> <span style="color: #666666; font-style: italic;"># too drubnk to make this workkkkj. debugg latter.</span></pre></div></div>

<hr />
Jeg så en kodesnutt i C, hvor programmereren trengte å flytte en peker 5 plasser i en character-array. Istedetfor å skrive:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">p <span style="color: #339933;">+=</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230;så skrev han:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
p<span style="color: #339933;">++;</span></pre></div></div>

<hr />
Et par artige kommentarer, observert i programmer:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Return a status block suitable for inclusion in the reply</span>
<span style="color: #666666; font-style: italic;">// buffer to Control.  Note: this code sucks.</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Project : XYZ (Please somebody shoot me!)
*
* File : $Id: defs.h,v 1.1 $
*
* Purpose : Create havoc rather than peace among many nations
*
* History : Back-ported changes that were not in CVS.  Please somebody,
*  shoot us and put us all out of our misery.
*/</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// --------------------------------------------</span>
<span style="color: #666666; font-style: italic;">// Ad Index scheming and plotting - Those with</span>
<span style="color: #666666; font-style: italic;">//	heart conditions are advised to not continue</span></pre></div></div>

<hr />
<blockquote><p>When the ON/OFF button is in the OFF position radio fails to operate.</p></blockquote>
<hr />
<blockquote><p>The following code was written by .<br />
Unless it doesn&#8217;t work, then I have no idea who wrote it.</p></blockquote>
<hr />
<blockquote><p>I once wrote this error dialog after the users annoyed me: &#8220;USER ERROR: Replace user and press a key to continue&#8221;</p></blockquote>
<hr />

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isDirty<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// why do you always go out and</span>
<span style="color: #000000; font-weight: bold;">return</span> dirty<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<hr />

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Do not change the following line.</span>
SmplCInputCue1<span style="color: #339933;">=</span>gwfreq<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// You better not have changed it!</span></pre></div></div>

<p>Mer artigheter finnes <a href="http://c2.com/cgi/wiki?BadCode" target="_blank">her</a>, <a href="http://c2.com/cgi/wiki?EvilCode" target="_blank">her</a> og <a href="http://c2.com/cgi/wiki?BadProgrammer" target="_blank">her</a>!</p>
 <img src="http://jocke.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=323" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jocke.no/2009/06/10/kildekoder-manualer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

