<?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>blogg nr. 176 671 167</title>
	<atom:link href="http://3djegrad.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://3djegrad.net/blog</link>
	<description>verden sett fra mine snarveier</description>
	<lastBuildDate>Tue, 09 Nov 2010 13:58:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>LastPass &#8211; det siste passordet du behøver å huske</title>
		<link>http://3djegrad.net/blog/2010/11/lastpass-det-siste-passordet-du-beh%c3%b8ver-a-huske/</link>
		<comments>http://3djegrad.net/blog/2010/11/lastpass-det-siste-passordet-du-beh%c3%b8ver-a-huske/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 13:58:24 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[nor]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=443</guid>
		<description><![CDATA[Hvor mange passord har du til ulike nettsider? Enten har du massevis av passord som du husker i varierende grad, eller så har du vært litt lat, som meg, og brukt samme passord overalt. Du vil jo ikke glemme et passord! Jeg brukte det samme passordet i årevis, frem til det ble snappet opp og [...]]]></description>
			<content:encoded><![CDATA[<p>Hvor mange passord har du til ulike nettsider? Enten har du massevis av passord som du husker i varierende grad, eller så har du vært litt lat, som meg, og brukt samme passord overalt. Du vil jo ikke glemme et passord!</p>

<p>Jeg brukte det samme passordet i årevis, frem til det ble snappet opp og gmail-kontoen min ble åpnet av fremmede. Heldivis var det bare noen viagra-eposter som ble sendt ut, men siden jeg har alle kontakter og kalendere på gmail også, så kunne verre ting skjedd. Nå har jeg lært, men utrolig nok  bruker jeg fremdeles bare et passord!</p>

<p>LastPass er en nett-tjeneste som er satt opp for å huske alle passordene dine, lage sikre passord, og kan automagisk logge deg inn på nettsider, når du besøker de. Er du interessert i hvordan du kan slippe unna med bare ett passord? Da begynner du med å gå til lastpass.com og åpner en konto.</p>

<p>På lastpass.com får du enda et passord, men det er det siste passordet du noensinne behøver å huske! Etter du har logget deg på lastpass.com kan du laste ned utvidelser til alle nettlesere for OS X, Windows eller GNU/Linux som styrer passordene for deg. I tillegg har LastPass-folkene applikasjoner til BlackBerry, Windows Mobile, Symbian OS Android, og selvfølgelig iPhone. Applikasjonene for telefoner er en Premium-tjeneste som du må betale for, men det er bare $1 i måneden.</p>

<p>Så hva gjør disse utvidelsene og applikasjonene for deg? Det første de gjør, når du starter de er å be deg om passordet for pålogging til lastpass.com, slik at du blir logget inn og kan begynne å lagre passord. Etterhvert som du surfer på nettet vil LastPass spørre deg om den skal huske passord og etterhvert har du fått en god liste med passord i LastPass. Akkurat som før, sant?</p>

<p>Ikke helt; forskjellen fra den innebygde passordhåndtereren og LastPass er at sistnevnte krypterer alle passordene dine samt gjør de tilgjengelig for deg på nettet. Slik kan du installere LastPass på jobbmaskinen, hjemmePCen, telefonen og andre steder du surfer.</p>

<p>Jeg har i tillegg lagt LastPass på en minnepinne, som jeg kan bruke når jeg er på reise eller andre steder uten laptopen. På denne minnepinnen ligger en kopi av nettleseren Chrome, som er knyttet opp mot lastpass.com, slik at jeg alltid har med meg passordene mine.</p>

<p>På nettsiden lastpass.com er det en flott gjennomgang av alle de ulike funksjonene lastpass tilbyr, og en to-tre videoer som viser hvordan dette virker.</p>

<p>En annen funksjon LastPass gir deg, er å kunne generere passord for deg, når du registrerer deg på nye nettsider. Så hvordan skal dine nye passord være? Nå kan de være så komplekse du vil, siden du ikke trenger å huske de, og dermed er de vanskeligere å gjette. Jeg har stilt inn LastPass til å lage passord som er en kombinasjon av tall og store/små bokstaver. Et kjapt søk på wolframalpha.com sier at denne kombnasjonen gir deg &#8217;100 novembcillion&#8217; kombinasjoner. Det er et tall med 62 nuller bak seg, og er dermed umulig å gjette den riktige kombinasjonen. Det er ihvertfall mye mer sannsynlig at de som prøver skal vinne i Lotto, VikingLotto, Joker og Extra på en gang. Hver uke. Fra idag og for alltid.</p>

<p>Siden dette er snakk om dine passord, bør de være trygge. Og det skal jeg love deg de er hos LastPass. Som nevnt over er alle passordene dine kryptert, men de er kryptert i en tekstfil i nettleseren din, som bare du kan låse opp. Det som blir lagt på nettet og synkronisert er kun kryptert data som er kryptert med den kraftigste teknologien som er tilgjengelig idag.</p>

<p>For spesielt interesserte kan jeg tipse om podcasten Security Now, hvor de tar for seg sikkerheten i LastPass &#8211; http://twit.tv/sn256. Steve Gibson som er vert i programmet er verdensledende på datasikkerhet, og som han sier selv: &#8220;LastPass has solved it. This is not a problem anymore&#8221;.</p>

<p>Det er en ting du bør vite om LastPass, og det er betydningen av slagordet deres &#8216;The Last Password You&#8217;ll Have to Remember&#8217;. All data på LastPass sine servere er kryptert, i tillegg til å være kryptert i nettleseren din. Hovedpassordet ditt er også kryptert, men det er kryptert med noe som kalles en &#8216;hash&#8217;. En &#8216;hash&#8217; er en enveis kryptering, som ikke lar seg føre tilbake til lesbar tekst.</p>

<p>Hovedpassordet ditt MÅ du huske, siden LastPass ikke kan hente det ut for deg, siden det er kryptert som forklart over. Dermed er det virkelig det siste passordet du behøver å huske. Med trykk på &#8216;behøver&#8217;.</p>

<p>Velkommen til en tryggere hverdag på nettet.</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/11/lastpass-det-siste-passordet-du-beh%c3%b8ver-a-huske/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My files are number one. Mostly.</title>
		<link>http://3djegrad.net/blog/2010/09/benford-files/</link>
		<comments>http://3djegrad.net/blog/2010/09/benford-files/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 19:25:35 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=413</guid>
		<description><![CDATA[I&#8217;m neither a mathematician, or statistician, but these things fascinate me. For the remaining people still awake after that statement, I want to share the (insanely great) RadioLab podcast titled &#8216;Numbers&#8217;, where I first heard of a phenomenon called Benford&#8217;s Law ..and maybe a wallpaper, too. Benford&#8217;s Law says: in lists of numbers from many [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m neither a mathematician, or statistician, but these things fascinate me. For the remaining people still awake after that statement, I want to share the (insanely great) <a href="http://www.radiolab.org">RadioLab podcast</a> titled &#8216;Numbers&#8217;, where I first heard of a phenomenon called Benford&#8217;s Law ..and maybe a wallpaper, too.</p>

<p><a href="http://en.wikipedia.org/wiki/Benford%27s_law">Benford&#8217;s Law</a> says:</p>

<blockquote>
  <p>in lists of numbers from many (but not all) real-life sources of data, the leading digit is distributed in a specific, non-uniform way. According to this law, the first digit is 1 almost one third of the time, and larger digits occur as the leading digit with lower and lower frequency, to the point where 9 as a first digit occurs less than one time in twenty.</p>
</blockquote>

<p>What this means is numbers starting with 1 are more likely to crop up in large datasets, than numbers starting with the other eight digits.</p>

<p>As I am a sceptical geek I had to test this out for myself.</p>

<h2>Large sets of numbers, eh?</h2>

<p>I could go out and find data from data.gov, or statistics from web-servers, but why leave the comfort of my own chair, when a simple bash-command would gather large numbers for me?</p>

<p><code>sudo ls -A -o -R / &gt; benford.txt</code></p>

<p>That command runs through my entire harddrive, searching through each and every folder it finds and spitting out lines and lines of filenames and sizes into the aptly named file &#8216;benford.txt&#8217;. Actually it generated one million, thirty one thousand, three hundred and twenty two lines, equal to a whopping 68.2 MB of text and almost as large as an empty canvas in Illustrator :p</p>

<p>What now? The lines look like this:
<code>-rw-r--r--   1 root    150 Jul  3  2009 InfoPlist.strings</code></p>

<p>I&#8217;m guessing, not being a unix professional, that there are ways to make the ls command only print the filesize and the name, and saving me the time of editing one million, thirty one thousand, three hundred and twenty two lines to only have lines like these
<code>150    InfoPlist.strings</code></p>

<p>Here&#8217;s where <a href="http://regular-expressions.info/">regular expressions</a> make their appearance. And the excellent <a href="http://gskinner.com/RegExr/desktop/">RegExr Desktop</a> is a great tool for it! Seeing as I&#8217;m no RegEx pro, either, I want to test my expressions before they run amok on my dataset :)</p>

<p><img src="/blog/wp-content/uploads/regexr-test.png" alt="RegExr Desktop App" /></p>

<p>After testing my regular expressions in RegExr, I went into the great <a href="http://barebones.com/products/textwrangler/">TextWrangler</a> and started to find and replace. It went very well, as you can see :)</p>

<p><img src="/blog/wp-content/uploads/twregex.png" alt="Find and replace FTW!" /></p>

<p><img src="/blog/wp-content/uploads/twregex2.png" alt="find and replace ftw!" /></p>

<p>My filelist is now complete, and it&#8217;s also a tab-delimited textfile, which is great for filling into a [MySQL database][]. The great thing with having this data inside a database, is the ease of which you can pull data out, and I&#8217;m looking for the amount of lines starting with 1,2,3 etc. So I made a database-table with three columns: Id, filesize, name, and started to import my filelist into it. After all the find/replace in TextWrangler, the filesize had shrunk to 25.1 MB.</p>

<p><img src="/blog/wp-content/uploads/import-csv.png" alt="mysql database is populated" /></p>

<p>Now I can start datamining, to see if this all was for nothing, or if my computers files also adhered to Benford&#8217;s Law.</p>

<h2>Squeal or Sequel?</h2>

<p>I like to use <a href="http://www.sequelpro.com/">Sequel Pro</a> for all MySQL needs, and it&#8217;s open-source and free. It lets you manage the database easily in a GUI, and also makes it easy to type your own SQL-statements and run them against the server. Sequel Pro is a fork of the discontinued CocoaMySQL.</p>

<p>Running <code>select filesize from benford where filesize rlike '^[1-9]'</code> on the database yields ninehundred sixty thousand twohunded seventy three rows. This shows all lines and is equal to 100%. Now the calulations begin.</p>

<p><img src="/blog/wp-content/uploads/alldatabase.png" alt="It's all in my database" /></p>

<p>So what does the number s look like? It was fun to see that the numbers were distributed mostly like Benford&#8217;s Law dictated. Check it out. Benford percentage on the left, my numbers in the middle, and the total amount to the right :)</p>

<ol>
<li>30,10 / 35,14 / 337 445</li>
<li>17,60 / 17,04 / 163 654</li>
<li>12,50 / 12,03 / 115 551</li>
<li>9,70 / 10,47 / 100 493</li>
<li>7,90 / 7,29 / 70 044</li>
<li>6,70 / 5,92 / 56 815</li>
<li>5.80 / 4,70 / 45 114</li>
<li>5,10 / 4,10 / 39 363</li>
<li>4,60 / 3,31 / 31 795</li>
</ol>

<p>Mathematics and statistics can be fun, especially when they are this close to /home :p</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/09/benford-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Technos Incabloc</title>
		<link>http://3djegrad.net/blog/2010/08/technos-incabloc/</link>
		<comments>http://3djegrad.net/blog/2010/08/technos-incabloc/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 05:39:57 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=399</guid>
		<description><![CDATA[This is a render of my grandfathers old watch. It&#8217;s over 50 years old. The watch, not the render :) I use this watch everyday, and love it to death! I finally managed to render this out. It&#8217;s been an abandoned project, sadly, but now it&#8217;s here. Modelled and rendered in C4D, with manual lights [...]]]></description>
			<content:encoded><![CDATA[<p>This is a render of my grandfathers old watch. It&#8217;s over 50 years old. The watch, not the render :) I use this watch everyday, and love it to death! I finally managed to render this out. It&#8217;s been an abandoned project, sadly, but now it&#8217;s here.</p>

<p>Modelled and rendered in C4D, with manual lights set up for detailing and some GI as fill-lights.
Tried comping it in blender, but had to resort to Photoshop to get the lensblur correct :)</p>

<p>One of the things that bothers me, is the feeling I get that it&#8217;s not photoreal. I can&#8217;t put my finger on what it is, but you might. Leave a hint in the comments if you see something that could get fixed re: photorealism. Thanks!</p>

<p>Hope ya like it :)</p>

<ul>
<li>christian</li>
</ul>

<p><img src="http://3djegrad.net/blog/wp-content/uploads/klokke-render-comp.jpg" alt="" title="klokke-render-comp" width="820" height="1060" class="alignleft size-full wp-image-400" /></p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/08/technos-incabloc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>webdev on network without NAT-loopback</title>
		<link>http://3djegrad.net/blog/2010/05/webdev-on-network-without-nat-loopback/</link>
		<comments>http://3djegrad.net/blog/2010/05/webdev-on-network-without-nat-loopback/#comments</comments>
		<pubDate>Wed, 19 May 2010 21:07:31 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=368</guid>
		<description><![CDATA[I&#8217;ve been using WordPress for a while now, and I&#8217;m doing development on a local apacheserver. Since I&#8217;m used to not having NAT loopback on my network, I usually setup wordpress on the local dev-server and pass the blog URL as localhost:portnumber. When clients want to see progress, I upload to the www, and give [...]]]></description>
			<content:encoded><![CDATA[<h3>I&#8217;ve been using WordPress for a while now, and I&#8217;m doing development on a local apacheserver. Since I&#8217;m used to not having NAT loopback on my network, I usually setup wordpress on the local dev-server and pass the blog URL as localhost:portnumber. When clients want to see progress, I upload to the www, and give them the link.</h3>

<p>But I wanted the clients to be able to check out what I&#8217;m doing without uploading, so I had to find a way to enter the blog URL so it would work from outside too. If I put in localhost:portnumber, WordPress reroutes the visitor to that internal address which is not available from outside the LAN.</p>

<h3>Enter DynDNS!</h3>

<p><a href="http://www.dyndns.org">Dynamic DNS</a> was the solution: So I entered myurl.dyndns.org:portnumber. It works like a charm, but since I&#8217;m inside a network without NAT-loopback, when I try to go to myurl.dyndns.org:portnumber, it won&#8217;t resolve for me. Another thing to solve.</p>

<h3>Enter /etc/hosts!</h3>

<p>If I modify my hosts file on my developer-machine, I can reroute all traffic to the dynamic dns URL, to the internal one, which is localhost:portnumber. So I added this to my /etc/hosts file:</p>

<p><code>
//webdev locally on network without NAT-loopback<br />
//10.0.0.2 is my dev-server<br />
10.0.0.2    myurl.dyndns.org
</code></p>

<h3>Enter Terminal</h3>

<p><img src="http://3djegrad.net/blog/wp-content/uploads/terminal-img.png" alt="terminal-img" title="terminal-img" width="96" height="96" class="alignleft size-full wp-image-391" />
To use these hosts-settings without a reboot, enter terminal on macosx and type
<code>
sudo dscacheutil -flushcache
</code></p>

<p>So this is how I&#8217;ll do it going forward. Any tips and ideas can be put in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/05/webdev-on-network-without-nat-loopback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download complete</title>
		<link>http://3djegrad.net/blog/2010/05/download-complete/</link>
		<comments>http://3djegrad.net/blog/2010/05/download-complete/#comments</comments>
		<pubDate>Mon, 10 May 2010 08:52:33 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/2010/05/download-complete/</guid>
		<description><![CDATA[Our son arrived last night at 3:13am. Mother and child is fine and sleepy. Say hello :)]]></description>
			<content:encoded><![CDATA[<p>Our son arrived last night at 3:13am. Mother and child is fine and sleepy.</p>

<p>Say hello :)</p>

<p><a href="http://3djegrad.net/blog/wp-content/uploads/p_2048_1536_221D9E81-4FAA-4694-BFF3-6EE030D746A3.jpeg"><img src="http://3djegrad.net/blog/wp-content/uploads/p_2048_1536_221D9E81-4FAA-4694-BFF3-6EE030D746A3.jpeg" alt="" class="alignnone size-full" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/05/download-complete/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quicksilver: Klar.. Ferdig&#8230; Programmér!</title>
		<link>http://3djegrad.net/blog/2010/02/quicksilver/</link>
		<comments>http://3djegrad.net/blog/2010/02/quicksilver/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 19:13:36 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=117</guid>
		<description><![CDATA[Denne står også på mac1.no, skrevet av meg. Jeg legger den her også for flere. Mange filer, liten tid Når jeg holder på med et prosjekt er det endel mapper og filer som går igjen på nesten alle sites. Dette er en struktur på filene som jeg trives med. Eksempler på dette kan være: .htaccess [...]]]></description>
			<content:encoded><![CDATA[<p>Denne står også på <a href="http://mac1.no/artikkel/5868/quicksilver-klar-ferdig-programm%C3%A9r">mac1.no</a>, skrevet av meg.
Jeg legger den her også for flere.</p>

<p><strong>Mange filer, liten tid</strong>
Når jeg holder på med et prosjekt er det endel mapper og filer som går igjen på nesten alle sites. 
Dette er en struktur på filene som jeg trives med.</p>

<p>Eksempler på dette kan være: 
<strong>.htaccess</strong> &#8211; for å kontrollere apache-serveren</p>

<p><strong>&#8216;ilegg/&#8217;</strong> &#8211; mappe for php-includes</p>

<p><strong>&#8216;ilegg/start.php&#8217;</strong> &#8211; som er en php-fil med diverse variabler som skal inn i alle dokumenter på siten</p>

<p><strong>&#8216;grafikk/bilder&#8217;</strong> &#8211; mappe for bilder til siten</p>

<p><strong>&#8216;grafikk/logo&#8217;</strong> &#8211; mappe for logoer til siten (forskjellige størrelser til ulike formål)</p>

<p><strong>&#8216;grafikk/css&#8217;</strong> &#8211; mappe for bilder som blir brukt som bakgrunner ol. i css-filen</p>

<p><strong>&#8216;stilsett/&#8217;</strong> &#8211; mappe for css</p>

<p><strong>&#8216;stilsett/skjerm.css&#8217;</strong> &#8211; stilsett for skjermvisning</p>

<p><strong>&#8216;stilsett/print.css&#8217;</strong> &#8211; stilsett for utskrift</p>

<p><strong>&#8216;js/&#8217;</strong> &#8211; mappe for javascript</p>

<p><strong>&#8216;js/start.js&#8217;</strong> &#8211; kildefil for eksterne javascript</p>

<p><strong>&#8216;_arbeidsfiler/&#8217;</strong> &#8211; for arbeidsfiler (.psd, .ai og denslags).</p>

<p><strong>&#8216;index.php&#8217;</strong> &#8211; indexfilen som også er en malfil for resten av siten. Denne filen inneholder også include-kommando og javascript-kommandoer som henter inn de to startfilene ovenfor, samt style-tagg med attributt som henviser til de ulike css filene</p>

<p>Dette er jo en hel haug med filer som skal opprettes og kan fort gå litt tid dersom du skal opprette alt dette og skrive all koden for å hente inn de ulike stilsett, php-filer og javascript-kodefiler som skal henge med. Heldigvis kan QS gjøre dette nesten automatisk for meg.</p>

<p><strong>QuickSilver fikser.</strong>
Opprett alle disse filene i en mappe du kaller f.eks. <strong>&#8216;ny web&#8217;</strong>. I denne mappen setter du opp alle filene slik du ønsker å ha de, dvs. at index-filen kan ha doctype som validerer den mot xhtml-strict og inkludere start.php/start.js og begge stilsettene.</p>

<p>Stilsettene kan du sette opp slik at alle marger og luft rundt alle objekter er fjernet 
* { margin:0;padding:0; } og denslags. Du skjønner tegningen..?</p>

<p>Deretter kopierer du hele denne mappen inn i <strong>~/Library/Application Support/Quicksilver/Templates. </strong>Om ikke templates mappen er der, kan du opprette den.</p>

<p><img src='http://bildr.no/image/95975.jpeg' alt='' /></p>

<p><strong>Do or Do Not. There is no Try</strong>
Deretter er det enkelt i Quicksilver å opprette et nytt webprosjekt i mappen Kunder/Kundenavn ved å gjøre følgende:</p>

<p>Åpne Quicksilver (ctrl-space som standard), skriv <strong>&#8216;Kunder</strong>.
- QS gir deg da mappen kunder og du kan bla deg nedover til den kunden du skal opprette web for.
- Deretter tab&#8217;er du til neste og skriver <strong>&#8216;Make New&#8217;</strong> (eller bare <strong>&#8216;mn&#8217;</strong>).
- QS vil da gi deg en liste over alle filer som ligger i mappen Templates vi lagde tidligere. 
  Om du har flere maler i denne mappen, blar du deg nedover til du finner &#8216;Ny web&#8217;, og trykker &#8216;enter&#8217;.</p>

<p><img src='http://bildr.no/image/95977.jpeg' alt='' /></p>

<p>Nå har QS opprettet mappen <strong>&#8216;untitled.&#8217;</strong> i den mappen du valgte, og <strong>&#8216;untitled.&#8217;</strong> inneholder alle filene som er i <strong>&#8216;ny web&#8217;</strong>.
<strong>Merk: .htaccess er en skjult fil, ettersom den starter med &#8216;.&#8217;, men Quicksilver kopierer den likevel. I bildet over heter filen kun &#8216;htaccess&#8217; uten &#8216;.&#8217; fordi den skal vises på bildet.</strong></p>

<p><strong>Hva heter barnet..?</strong>
Det som er flott nå er at QS åpner seg selv igjen, med <strong>&#8216;untitled.&#8217;</strong> valgt som ikon og du kan enkelt tab&#8217;e bort til neste vindu i QS og skrive <strong>&#8216;rename&#8217;</strong> og døpe om &#8216;untitled.&#8217; til navnet på domenet du jobber med f.eks. <strong>3djegrad.net</strong>.</p>

<p><img src='http://bildr.no/image/95979.jpeg' alt='' /></p>

<p><strong>Programmér</strong>
Mappen 3djegrad.net er opprettet med alle filene du ønsket i mappen Kunder. Ferdig!</p>

<p><img src='http://bildr.no/image/95980.jpeg' /></p>

<p><strong>&#8211;Noen siste tanker&#8211;</strong>
Utvidelser av denne funksjonen kan være: 
<strong>&#8216;ny web mysql&#8217;</strong> &#8211; mappesett som inneholder php-filer med informasjon du trenger for å koble til databaser, 
og for innloggingssystem.
<strong>&#8216;ny web html&#8217;</strong> &#8211; mappesett som kun er et standard statisk nettsted med kun rene html filer
<strong>&#8216;ny web xhtml strict&#8217;</strong> &#8211; mappesett som kan være et utgangspunktet for et nettsted som validerer med korrekt Doctype mot XHTML 1.0 Strict
<strong>&#8216;ny web xhtml trans&#8217;</strong> &#8211; mappesett som kan være et utgangspunktet for et nettsted som validerer med korrekt Doctype mot XHTML 1.0 Transitional</p>

<p>Om filen du renamer til allerede finnes vil QuickSilver ikke gjøre noe, bortsett fra å gi deg en feilmelding neste gang du åpner QuickSilver. Men du skal jo ha såpass oversikt over hvilke sider du har laget tidligere, at du kaller evt nye versjoner av nettsder for v2 på slutten? :)</p>

<p>Jeg har også en egen QS Template som heter <strong>&#8216;ny kunde&#8217;</strong>, og den fungerer på akkurat samme måten som ovenfor, men lager en mappe i <strong>&#8216;Kunder&#8217;</strong>, som inneholder bl.a. mappene &#8216;<strong>_logoprofil/&#8217;</strong> og <strong>&#8216;prosjekter/&#8217;</strong>, som brukes til å lagre logomateriell for ny kunde og en egen undermappe for prosjekter. Da kan jeg, om det kommer en ny kunde som skal ha nettside, vha. QS lage en mappe for denne nye kunden med egen mappe for logoer og prosjekter. Ettersom QS viser det siste elementet du brukte, om du ikke venter for lenge, kan jeg dermed åpe QS engang til øyeblikkelig og navigere til <strong>&#8216;prosjekter/&#8217;</strong> og lage en <strong>&#8216;ny web&#8217;</strong> mappe.</p>

<p>Kjapt og gale. Dette tar ikke engang et minutt, og du er sikret lik struktur på alle jobber, og ikke minst. det er superlett å arkivere slike strukturer når du skal ta backup.</p>

<p><strong>Merk: .htaccess er en skjult fil, ettersom den starter med &#8216;.&#8217;, men Quicksilver kopierer den likevel.</strong></p>

<p><strong>Håper dette var til hjelp for noen. Det hjelper ihvertfall meg.</strong></p>

<p>Lykke til!</p>

<ul>
<li>christian</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2010/02/quicksilver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit and forget</title>
		<link>http://3djegrad.net/blog/2009/06/submit-and-forget/</link>
		<comments>http://3djegrad.net/blog/2009/06/submit-and-forget/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 12:08:01 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=261</guid>
		<description><![CDATA[How to make password reminders remember the password even though you use the Cleartext option on passwords. Jakob Nielsen made an alertbox entry about password fields, recently. The gist of what he said, is that it&#8217;s user-unfriendly to obscure the passwords, on websites, which presents a password field to their users. He proposes to just [...]]]></description>
			<content:encoded><![CDATA[<p>How to make password reminders remember the password even though you use the Cleartext option on passwords.</p>

<p>Jakob Nielsen made an alertbox entry <a href="useit.com/alertbox">about password fields</a>, recently.</p>

<p>The gist of what he said, is that it&#8217;s user-unfriendly to obscure the passwords, on websites, which presents a password field to their users. He proposes to just use cleartext and not bullets, in these fields, and also suggests a solution to the secrecy problem on public computers: Have an option to show and hide the password field, in case someone looks over your shoulder.</p>

<p>Jakob Nielsen propose that the password is cleartexted as default, but I, and <a href="http://www.wait-till-i.com/2009/06/26/on-password-fields-masking-and-jakob-nielsen/">others</a> disagree. Chris Heilmann shows a way to make a show / hide link on all password fields, on a page.</p>

<p>It looks like an elegant script. Kudos to him, for sharing it.</p>

<p>What about password reminders? They only trigger on password-fields.<br />
Password reminders, I believe, will remember passwords if input type=&#8217;password&#8217;, when you hit submit.<br />
There should be a script that checks to see if the field is text or password, and turns it into password on submit, so that password reminders can remember the passwords even though you use the cleartext method.</p>

<p>Thanks to <a href="http://www.wait-till-i.com/2009/06/26/on-password-fields-masking-and-jakob-nielsen/">Chris Heilmann</a> for making the script in the first place.
<br />
<br />
<br />
UPDATE:
And btw: I tried my hand at an icon for show/hide password link.
It&#8217;s of-course under Creative Commons.<br />
<div id="attachment_276" class="wp-caption alignleft" style="width: 710px"><a href="http://3djegrad.net/blog/wp-content/uploads/hidepassword.gif"><img src="http://3djegrad.net/blog/wp-content/uploads/hidepassword1.gif" alt="Hide/show password icon. With a Creative Commons license." title="hidepassword.gif" width="95" height="24" class="size-full wp-image-276" /></a><p class="wp-caption-text">Hide/show password icon. With a Creative Commons license.</p></div></p>

<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2009/06/submit-and-forget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You are here</title>
		<link>http://3djegrad.net/blog/2009/06/you-are-here/</link>
		<comments>http://3djegrad.net/blog/2009/06/you-are-here/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 20:20:32 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[BY-SA-NC]]></category>
		<category><![CDATA[cc]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[tipstriks]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=238</guid>
		<description><![CDATA[A friend,@BrokenPoly challenged me to create a realistic render of Earth. The first thing I did was to got to NASA, and their Earth Observatory and get real high resolution textures. I downloaded textures for day and nighttime, since I wanted to create a partialy lit planet, and a set of clouds to make it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://3djegrad.net/blog/2009/06/you-are-here/">
<img src="http://3djegrad.net/blog/wp-content/uploads/klode-final-720x405.jpg" alt="klode-final" title="klode-final" width="720" height="405" class="alignnone size-large wp-image-242" /></a></p>

<p>A friend,<a href="http://www.twitter.com/brokenpoly">@BrokenPoly</a> challenged me to create a realistic render of Earth.</p>

<p><span id="more-238"></span></p>

<p>The first thing I did was to got to NASA, and their <a href="http://earthobservatory.nasa.gov">Earth Observatory </a>and get real high resolution textures.</p>

<p>I downloaded textures for day and nighttime, since I wanted to create a partialy lit planet, and a set of clouds to make it more interesting.</p>

<p>I knew that the first thing I had to figure out, was a way to get the texture for the nightside to show up, when there was no light. Luckily Cinema 4D has a shader called &#8216;Proximal&#8217;, that creates a gradient-ramp whenever a selected object is within a certain range of the shader.<br />
The globe had two shaders.
1. The earth texture &#8211; standard diffuse / color
2. The nighttime lights &#8211; alpha channel with just the lights</p>

<p>For the effect to work, I needed a way to control the Proximal shader, and so I added a Null Object to the scene and set the Proximal-shader to react to it. Then I placed the Null Object over the globe and eyeballed where the nighttime was supposed to be.</p>

<p>This gave me nighttime texture, with overlayed lights. This is clearly wrong. :)<br />
<img src="http://3djegrad.net/blog/wp-content/uploads/bilde-4-720x511.png" alt="Proximal" title="Proximal" width="720" height="511" class="alignnone size-large wp-image-250" /></p>

<p>I had to use the proximal shader as the alpha channel for the daytime texture, and thereby showing the nighttime texture, where the sun didn&#8217;t shine ;)</p>

<div id="attachment_252" class="wp-caption alignnone" style="width: 593px"><img src="http://3djegrad.net/blog/wp-content/uploads/bilde-6.png" alt="Fusion Shader with proximal" title="fusion" width="583" height="590" class="size-full wp-image-252" /><p class="wp-caption-text">Fusion Shader with proximal</p></div>

<p>This resulted in a much better image :)</p>

<p><img src="http://3djegrad.net/blog/wp-content/uploads/klode-final-720x405.jpg" alt="klode-final" title="klode-final" width="720" height="405" class="alignnone size-large wp-image-242" /></p>

<p>But seeing as the null objects and the lights are codependant, I thought: 
&#8220;Why not make it so that I can rotate these things, and simulate a day?&#8221;</p>

<p>I grouped the Null Object that affected the Proximal-shader, the Sun light and the Moon-light to a Null and voila, I could now rotate the scene around, and the daytime and nighttime lights would align perfectly. Magic!</p>

<p><object width="640" height="368"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5123548&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5123548&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="368"></embed></object></p>

<p><a href="http://vimeo.com/5123548">Earth rotation</a> from <a href="http://vimeo.com/chrleon">chrleon</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>This looks great, I think, but there was something missing :) 
Space is not empty. The final video is below. With audio and downloadable from Vimeo.</p>

<p><object width="640" height="360"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5188942&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5188942&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="360"></embed></object></p>

<p><a href="http://vimeo.com/5188942">Rotating Earth &#8211; v2</a> from <a href="http://vimeo.com/chrleon">chrleon</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>Leave your feedback down below and enjoy it :)</p>

<p>Licensed with Creative Commons: By &#8211; Share-Alike &#8211; Non-Commercial</p>

<p>Other credits:<br />
Textures for Earth, Clouds and Nightlights from NASA &#8216;Blue Marble&#8217;
<a href="http://earthobservatory.nasa.gov">earthobservatory.nasa.gov</a></p>

<p>Audio from <a href="http://www.freesound.org">freesound.org</a><br />
<a href="http://www.freesound.org/samplesViewSingle.php?id=17470">Radio Interference</a><br />
by cognito perceptu</p>

<p><a href="http://www.freesound.org/samplesViewSingle.php?id=8132">Brown Noise</a><br />
by Bliss</p>

<p>Russian National Hymn from Wikipedia &#8211; http://en.wikipedia.org/wiki/National_Anthem_of_Russia -</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2009/06/you-are-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A moat against spammers</title>
		<link>http://3djegrad.net/blog/2009/05/a-moat-against-spammers/</link>
		<comments>http://3djegrad.net/blog/2009/05/a-moat-against-spammers/#comments</comments>
		<pubDate>Fri, 01 May 2009 11:10:04 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=218</guid>
		<description><![CDATA[If you&#8217;re like me, you probably have eliminated almost all of your daily spam email, by being very diligent. You, and I, read every privacy section on every beta we apply for, to feel secure that our email address won&#8217;t get in the Infernal Spam Database(TM). It pays to be diligent, and safeguarding your email [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you probably have eliminated almost all of your daily spam email, by being very diligent.</p>

<p>You, and I, read every privacy section on every beta we apply for, to feel secure that our email address won&#8217;t get in the Infernal Spam Database(TM). It pays to be diligent, and safeguarding your email address is a smart thing to do, and you should, but you can&#8217;t do it forever, you know.
<span id="more-218"></span></p>

<p>Some day, on some website, you need to use that precious email address, so People actually can contact you, and People generally like to do so, since that is what the internet is all about. These same People also don&#8217;t like to fill out forms, they like to click links, especially <a href="mailto:iluvspam@3djegrad.net">mailto: links</a> . This gives them a warm and fuzzy feeling, and also let&#8217;s them keep a copy in their Sent folder.</p>

<p>You and I have a strained relationship with mailto:links. So we have devised schemes (like mail-obfuscation) and voodoo-trickery to let People use mailto:links so long as they themselves use voodoo, in the form of JavaScript-enabled browsers. This leaves The Spammers in the dark. At least for now.</p>

<h3>The Spammer Never Sleeps</h3>

<p>Spammers don&#8217;t like to be in the dark, and so They strive for perfection in their spam-robots. Using all Their knowledge about searching text, and using a heap of <abbr title="Regular Expressions">regex</abbr> The Spammers usually manage to suck out all the email addresses They want. According to the report from <a href="http://www.cdt.org/speech/spam/030319spamreport.shtml">Centre for Democracy &amp; Technology</a>, published in 2003, e-mail obfuscation seems to work, but for how long? Probably only so long as it takes Them to make a regex converting obfuscated email addresses into correct email addresses. Considering 2009 &#8211; 2003 = 6 years They are probably on to Us.</p>

<p>The goal must be to hide that mailto-link and the email address with it, but still make it possible for the People to click links.</p>

<h3>For those about to be spammed, we salute you</h3>

<p>We have two requirements for our email-address:<br />
1. It has to be easy to type for an author / contributor. No large codes!<br />
2. We have to be able to use any email on whatever domain.</p>

<p>Seeing as every email-address under a domain is unique, we can simplify emails that belongs to the current domain to only the username.</p>

<p>I&#8217;ll be using the address &#8216;iluvspam@3djegrad.net&#8217; for this article. On the <a href="3djegrad.net/articles/moat/demo-site/" rel="nofollow" target="_blank">demo-site</a>, the link for this email-address will let People click it, open Their favourite email-app, send the email and continue on their Quest to find the End of the Internet.</p>

<p>To do this we&#8217;ll use Apache&#8217;s mod_rewrite capabilities, to rewrite URLs on the fly, and we will be able to write the email above as:</p>

<pre><code>&lt;a href="contact/iluvspam" rel="no-follow"&gt;iluvspam&lt;/a&gt;
</code></pre>

<p>Open up your favourite text-editor (notepad, or textedit will do fine though I prefer the excellent and gratis <a href="http://www.barebones.com">TextWrangler</a> from BareBones Software), and start a new file called &#8216;.htaccess&#8217;. Save this file in your root directory on the webserver.</p>

<p>If you have used mod_rewrite before, the already existing .htaccess will probably look something like this.</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
&lt;/IfModule&gt;
</code></pre>

<p>This enables the RewriteEngine in Apache and sets the RewriteBase to /, sort of like BASEHREF in HTML, but not exactly the same.</p>

<p>What we need to add is a RewriteRule which fires every time someone clicks the <a href="contact/iluvspam" rel="nofollow">iluvspam</a> link.</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /

#Email-harvest prevention for any domain
RewriteRule contact/([a-zA-Z0-9-_\.]+)/([a-zA-Z0-9-_\.]+) email.php?email=$1&amp;domain=$2  

# Email-harvest for this domain
RewriteRule contact/([a-zA-Z0-9-_\.]+) email.php?email=$1

&lt;/IfModule&gt;
</code></pre>

<p><a name="regex-start"></a></p>

<h3>Rewrite-email-to-the-what-now?</h3>

<p>Before we start, grab a box of concentration and open your head.</p>

<p>All those characters jumbled together like an imploded anthill, are regex. As I said earlier, regex are regular expressions which lets Spammers work with text. We can also use them for Good.</p>

<ul>
<li>^ (the caret sign) means &#8216;the start of the text&#8217;  </li>
<li>() parenthesis groups text together in a variable which can be used again.  </li>
<li>$ means the end of the string.  </li>
<li>[] groups together a string of letters to be handled later by another parameter, like &#8216;+&#8217; or &#8216;*&#8217;.  </li>
</ul>

<p>As an example:
- ^abc matches abcdef but not aabcdef, since the match doesn&#8217;t start with abc
- abc$ matches aabc, but not abcd, since the string &#8216;abcd&#8217; doesn&#8217;t end in abc
- ^abc$ only matches abc, seeing as we tell the regex-engine to look for a string that starts with abc and ends with abc.</p>

<p>Back to our .htaccess-file:</p>

<pre><code># Email-harvest for this domain
RewriteRule contact/([a-zA-Z0-9-_\.]+) email.php?email=$1
</code></pre>

<p>The RewriteRule above tells Apache to forward all links which refer to &#8216;contact/(something)&#8217; to the email.php script which parses the URL and returns the correct email to the (hopefully shiny and happy) People.</p>

<p>Phew! Take a deep breath before we dive back in &#8230; Ready? Let&#8217;s go!</p>

<p>The RewriteRule utilize <abbr title="Regular Expressions">regex</abbr> for pattern recognition. The pattern it looks for is &#8216;contact/&#8217; followed by  any letter between a-z in either lower- or UPPERCASE and/or any digits from 0-9 and/or the characters &#8216;-&#8217;, &#8216;_&#8217; and &#8216;.&#8217;.</p>

<p>This should cover all email-adresses. The plus sign at the end tells the Apache-server that we are looking for multiple characters. If you&#8217;re observant you might have noticed that the period-sign (.) has a backslash infront of it (&#46;), and a bracket encloses the text inside the parentheses. The backslash is an escape-character in regex, and tells the regex-engine that it should allow the literal character &#8216;.&#8217; (period), and not treat it like a wildcard, which is the default behavior for &#8216;.&#8217; in Regular Expressions. The bracket groups text together to be worked on by parameters later, like the &#8216;+&#8217;</p>

<pre><code># Email-harvest for this domain
RewriteRule contact/([a-zA-Z0-9-_\.]+) email.php?email=$1
</code></pre>

<p>The $1 in /email.php?email=$1 tells the regex-engine to use the found-text variable we grouped with parenthesis ([a-zA-Z0-9-_&#46;]+) and set the variable email to the found text, which in our case is iluvspam. The rewritten URL will then be: /email.php?email=iluvspam</p>

<p>So when People click &#8216;iluvspam&#8217; they send the variable &#8216;iluvspam&#8217; into email.php. email.php in turn is configured to append 3djegrad.net after all email variables, unless something else is defined.</p>

<p>As you&#8217;ve seen, we have two RewriteRules in our .htaccess-file and the other one let&#8217;s us type and send email to addresses on other domains, besides our own. That line looks like this.</p>

<pre><code>#Email-harvest prevention for any domain
RewriteRule contact/([a-zA-Z0-9-_\.]+)/([a-zA-Z0-9-_\.]+) email.php?epost=$1&amp;domene=$2
</code></pre>

<p>Using the knowledge you&#8217;ve gained above, you should be able to recognize that we now have two variables in the RewriteRule. The first variable is the email and the second is the domain. This RewriteRule let&#8217;s us write email-adresses to other domains like so:</p>

<pre><code>Contact him via&lt;a href="contact/chrleon/gmail.com" rel="no-follow"&gt;his email-adress&lt;/a&gt;
</code></pre>

<p>Just one thing. The more advanced RewriteRule has to be defined before the simpler ones, or the regex-engine will recognize the simpler form before the more advanced one and fire, never activating the more advanced one. So in this case the .htaccess looks like this:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /

#Email-harvest prevention for any domain
RewriteRule contact/([a-zA-Z0-9-_\.]+)/([a-zA-Z0-9-_\.]+) email.php?epost=$1&amp;domene=$2 

# Email-harvest for this domain
RewriteRule contact/([a-zA-Z0-9-_\.]+) email.php?epost=$1
&lt;/IfModule&gt;
</code></pre>

<p><a name="regex-links"></a>
You can learn more about Regular Expressions at <a href="http://www.reguar-expressions.info">regular-expressions.info</a> and at <a href="http://weblogtoolscollection.com/regex/regex.php?page=3"> weblogtoolscollection</a>. Or do you need to <a href="#regex-start">read it again?</a></p>

<p>.htaccess files are extra configuration-files for the Apache web-server. To learn more about them, got to the Apache documentation <a href="http://www.apache.org/docs/2.0/">website</a>.</p>

<h3>So, what does email.php look like?</h3>

<p>The file is relatively simple. All it conceptually does is to get the user-name from the email/iluvspam and append the domain address. Try to also check the email-variable for non-allowed characters, or better yet do a white-list check where you only allow the characters a-zA-Z0-9.-_. That way you guard against injection-attacks. Any comments on the security issues are most welcome.</p>

<p>Here is the code for email.php, with comments.</p>

<pre><code>//  set two variables to hold the generated email-adress
//  the $domain variable is used for email-addresses on THIS domain
//  if no domain is entered in the link like contact/abc123
//  then the email will be sent to 'abc123@3djegrad.net'
$recipient = " ";
$domain = "3djegrad.net";


//  The email-address is gathered from the GET-request
//  This GET-request is from the link you clicked
//  An if-statement checks to see that the email is set
if ($_GET['email']) {
$recipient = $_GET['email'];
}

//  The domain is gathered from the GET-request.
//  if it is set, we replace the $domain variable with the correct domain
if($_GET['domain']) {
$domain = $_GET['domain'];
}
</code></pre>

<p>This is the gist of it, but we still haven&#8217;t made any headway on opening uur Readers&#8217; email-application. That&#8217;s the next step.</p>

<p>We open the Readers&#8217; email.application with a header-change in php, like so:</p>

<pre><code>header("Location: mailto:$recipient@$domain");
</code></pre>

<p>This will open the mail-app with the correct email-address, already filled in. But there&#8217;s just a blank page in the browser.</p>

<p>All the People who want to contact you, don&#8217;t like to see blank pages. They&#8217;re a tough crowd.</p>

<p>For this to work we must rely on <abbr title="JavaScript"> voodoo-trickery</abbr>, since PHP won&#8217;t let us send two header(location)-commands to the browser. If we try to send two header(location), only the last one fires. Even with the PHP function <a href="http://no.php.net/ob_start">ob_start()</a>. This is for security-reasons.</p>

<pre><code>echo '&lt;script type="text/javascript"&gt;history.back()&lt;/script&gt;';

$explanation = file_get_contents("spamexplain.html");
echo '&lt;noscript&gt;';
echo $explanation;
echo '&lt;/noscript&gt;';
</code></pre>

<p>The code above does just that. The first line tells the browser to go back one page. The following lines prepare a page for those Readers who for some reason have Javascript turned off or there is no Javascript available to them. This is our graceful fail.</p>

<p>But we&#8217;re not in Kansas yet, Dorothy.</p>

<p><img src="http://3djegrad.net/blog/wp-content/uploads/pie-chart-cc.jpg" alt="pie-chart-cc" title="pie-chart-cc" width="600" height="183" class="alignnone size-full wp-image-221" /></p>

<h3>Oi! What about my statistics!?</h3>

<p>It seems that Firefox and Opera generates a hit when you use the back-button, and so does using the history.back() function. Safari is the only browser not doing this, as I can tell from my tests.</p>

<p>The solution for this is to set a $_SESSION-variable in the email.script and test for that variable on the article page. If the variable is set, then don&#8217;t load the counters. After that test is run, destroy the session-variable. Now the count won&#8217;t register.</p>

<p>For this example I just use a date and time-stamp in a textfile</p>

<pre><code>if (!isset($_SESSION['url'])) { 
$filename = fopen("counter.txt", a);
//  This could be Google Analytics or others
//  like so: include('google-analytics-script.php');

//  write the date and time in the logfile, followed by a newline 
$dateandtime = date("d-m-Y - H:i:s",time());

fwrite($filename, $dateandtime . "\n");

fclose($filename); // close the file

unset($_SESSION['url']); 
//  unset the session-variable so that the counting still works on 
//  the rest of the page. Remember, we only want to drop the count
//  on this one page, after People have clicked their happy 
//  mailto:links.

    } 
</code></pre>

<h3>Try it out</h3>

<p>Demo-site: <a href="http://www.3djegrad.net/moat">3djegrad.net/moat</a></p>

<p>So there you have it. Hopefully spamfree, and humanreadable email-addresses on the internet.<br />
The People will be glad they can click on mailto-links again. Wayhey!</p>

<p>Thanks for reading. Any comments? Submit them below.</p>

<p>Creative Commons photos by: 

http://www.flickr.com/photos/wheatfields/</p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2009/05/a-moat-against-spammers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modellering vs skulptur</title>
		<link>http://3djegrad.net/blog/2009/04/modellering-vs-skulptur/</link>
		<comments>http://3djegrad.net/blog/2009/04/modellering-vs-skulptur/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 15:06:44 +0000</pubDate>
		<dc:creator>chrleon</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[sculpting]]></category>

		<guid isPermaLink="false">http://3djegrad.net/blog/?p=209</guid>
		<description><![CDATA[Mudbox from Autodesk has just arrived, wearing it&#8217;s OS X outfit, and it&#8217;s magnificent fun! This is my result over lunch today. The basemesh was made yesterday during lunch :)]]></description>
			<content:encoded><![CDATA[<p>Mudbox from Autodesk has just arrived, wearing it&#8217;s OS X outfit, and it&#8217;s magnificent fun!</p>

<p>This is my result over lunch today. The basemesh was made yesterday during lunch :)</p>

<p><object width="600" height="344"><param name="movie" value="http://www.youtube.com/v/DQ-82qAXirA&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/DQ-82qAXirA&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://3djegrad.net/blog/2009/04/modellering-vs-skulptur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

