<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Many Interests BLOG</title>
	
	<link>http://blog.darsain.net</link>
	<description>Too many things, too little time</description>
	<lastBuildDate>Mon, 08 Feb 2010 12:19:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ManyInterestsBlog" /><feedburner:info uri="manyinterestsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>MyGallery 1.2</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/RWZCQ4HFq_w/</link>
		<comments>http://blog.darsain.net/84/mygallery-1-2/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:48:57 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Freebies]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=84</guid>
		<description><![CDATA[The new version of MyGallery!
I&#8217;ve simplified this app a lot, with focus on efficiency and usability. As I&#8217;ve mentioned in the last update post, I was going for Deviantart portfolio-like thingy, because of efficiency of that layout, but of course with my own functionality.

Functionality
The core functionality is still same. You don&#8217;t need any database, everything [...]]]></description>
			<content:encoded><![CDATA[<p>The new version of MyGallery!</p>
<p>I&#8217;ve simplified this app a lot, with focus on efficiency and usability. As I&#8217;ve mentioned in the last update post, I was going for Deviantart portfolio-like thingy, because of efficiency of that layout, but of course with my own functionality.</p>
<p><span id="more-84"></span></p>
<h2>Functionality</h2>
<p>The core functionality is still same. You don&#8217;t need any database, everything is generated by the content of the main &#8220;galleries/&#8221; folder, so you don&#8217;t have to upload your images only through the web interface, if you don&#8217;t wan to (even though it is really comfortable with integrated <a href="http://www.uploadify.com/">Uploadify</a>).</p>
<h2>Screens</h2>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/02/mygallery-1-visitor-view.jpg" title="mygallery-1-visitor-view" rel="lightbox[84]"><img src="http://blog.darsain.net/wp-content/uploads/2010/02/mygallery-1-visitor-view-300x175.jpg" alt="" title="mygallery-1-visitor-view" width="260" class="alignleft size-medium wp-image-85" /></a></p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/02/mygallery-3-image-viewer.jpg" title="mygallery-3-image-viewer" rel="lightbox[84]"><img src="http://blog.darsain.net/wp-content/uploads/2010/02/mygallery-3-image-viewer-300x175.jpg" alt="" title="mygallery-3-image-viewer" width="260" class="alignleft size-medium wp-image-86" /></a></p>
<h2>New features</h2>
<p>The new things are:</p>
<ul>
<li>The new layout, with focus on efficiency of browsing. All galleries are listed on left side menu, which is always on the same position while you are scrolling, so you have always access to it (Except if the menu height is bigger than height of the window. Than it stays on the top of a page for obvious reasons.) Everything is black/dark, so only colors are those from the images, so the rest of site is not stealing your focus from the important content.</li>
<li>Everything is based on AJAX, which means that by clicking on any link, or option, there will be no page reload (exept login and logout).</li>
<li>Thumbnails are all stored in same thumbnails cache folder in the main system directory, so they will not pollute the original galleries folders.</li>
<li>The feature for changing backgrounds was removed, because that is just thing that you&#8217;ll do maybe once in the existence of gallery, so it was just useless code. You can still add your custom backgrounds though, just add
<pre class="brush: css;">body { background: url('path-to-background.jpg') no-repeat left top #111; }</pre>
<p>in style.css (&#8220;system/style/style.css&#8221;) and you are done. As menu and all UI components are transparent, it will work beautifully.
</li>
<li>Except background feature, many other useless things were removed to not bother visitor with something that he do not care about. I&#8217;m talking about info about picture size, resolution, name, bunch of useless buttons, everything is simplified, and hidden now.</li>
<li>How hidden you may ask? Well thats the another new feature.<br />
<strong>Keyboard shortcuts:</strong></p>
<ul>
<li>&#8220;<b>&laquo; &raquo;</b>&#8221; (keyboard arrows): Left and right navigation in image viewer.</li>
<li>&#8220;<b>A</b>&#8220;: Opens admin login if you are not logged, otherwise settings panel.</li>
<li>&#8220;<b>U</b>&#8220;: Upload box toggle.</li>
<li>&#8220;<b>D</b>&#8220;: Toggle of Click delete mode (if this is triggered, clicking on images will delete them).</li>
</ul>
</li>
</ul>
<h2>Compatibility</h2>
<p>Works 100% in: <b>FireFox</b>, <b>Chrome</b>, <b>Safari</b>, <b>IE 8</b></p>
<p>Works 110% in <b>Opera</b>, as there could be removed vertical scrollbar, which is disturbing element in simply application like this, when the screen is jumping for those few pixels while browsing through shorter and longer galleries.</p>
<h2>Demo and download</h2>
<a href="http://blog.darsain.net/?file_id=9" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span>1.09KB</span> <span>185x</span>
</a> <a href="http://blog.darsain.net/?file_id=17" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>MyGallery 1.2</h3>
  <span></span> <span>33x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/84/mygallery-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/84/mygallery-1-2/</feedburner:origLink></item>
		<item>
		<title>Realtime table rows search – jQuery plugin</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/7qN1xZU1VSs/</link>
		<comments>http://blog.darsain.net/83/realtime-table-rows-search-jquery-plugin/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 22:22:47 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=83</guid>
		<description><![CDATA[I&#8217;ve started to code a little table rows search snippet in jQuery, and it ended up being a plugin :) So, little snippet explanation, and plugin documentation waiting on you in full article.

Snippet
Functionality is straight forward. You&#8217;ll bind this snippet to input type=&#8221;text&#8221;, and after every keyup event, it&#8217;ll take the value of this input, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started to code a little table rows search snippet in jQuery, and it ended up being a plugin :) So, little snippet explanation, and plugin documentation waiting on you in full article.</p>
<p><span id="more-83"></span></p>
<h1>Snippet</h1>
<p>Functionality is straight forward. You&#8217;ll bind this snippet to input type=&#8221;text&#8221;, and after every keyup event, it&#8217;ll take the value of this input, and it&#8217;ll hide the table rows, so only the ones with this value/string in them will remain visible.</p>
<p>Here is the snippet with comments:</p>
<pre class="brush: jscript;">
// Bind the keyup event triggering our
// snippet to text input with class .selector
$(&quot;input:text.selector&quot;).keyup( function(){

    // define variables needed in snippet
    var keyWord = $(this).attr(&quot;value&quot;).toLowerCase(), // our text string we are searching for
        tableSelector = &quot;#target&quot;, // selector of target table (one/unique table)
        tempMesh = &quot;&quot;; // variable for storing temporary tr content to search in

    // at least 2 letters long string
    if( keyWord.length &gt; 1 ) {

        // cycle through all table rows to filter them
        $(tableID + &quot; tr&quot;).each( function(i,e){

            // select the td elements of each tr, as we can't
            // manipulate with visibility of tr
            var myChildren = $(this).children(&quot;td&quot;);

            // get the text of all td elements
            tempMesh = $(this).text().toLowerCase();

            // and search in them for our keyword
            if( tempMesh.indexOf(keyWord) == -1 ){

                // if there is no match, hide tr childrens
                myChildren.hide();

            }else{

                // if there is match, make sure they will be visible
                myChildren.show();

            }

        } );

    }else{

        // in case of less than 2 letters long keyword,
        // return the table into default state
        $(tableID + &quot; td&quot;).show();

    }

});
</pre>
<h1>Table search plugin</h1>
<p>Plugin is a little bit more complex with a few options and effects. Usage is simple:</p>
<pre class="brush: jscript;">
-
$(&quot;triggerSelector&quot;).tableSearch(&quot;tableSelector&quot;, {options});
-
</pre>
<p>Explanation:</p>
<ul>
<li><strong>triggerSelector</strong>: Could be any object, or array of the objects. According to the object type, it is bonded with the corresponding even type (text input = keyup, radio,checkbox = change, button = click).<br />
In case of inputs, selects, input buttons, or textareas, it is getting their value as a keyword. In case of custom buttons it is getting their text() (what is between tags = &lt;div class=&#8221;button&#8221;&gt;Keyword&lt;/div&gt;) as a keyword.</li>
<li><strong>tableSelector</strong>: Navigate plugin to which table you want filter.</li>
<li><strong>options</strong>: There are 3:
<ul>
<li><strong>effect</strong>: fade, slide, highlight (default = no effect, plain hiding and showing)</li>
<li><strong>speed</strong>: milliseconds (default: 200)</li>
<li><strong>fadeto</strong>: in case of Highlight, this is the opacity into which the not matching rows will fade to [0-1] (default: 0.2)</li>
</ul>
</li>
</ul>
<p>Example:</p>
<pre class="brush: jscript;">
-
var tsOptions = {
	'effect' : 'highlight',
	'speed' : 100,
	'fadeto' : 0.1
}
$(&quot;input:text.selector&quot;).tableSearch(&quot;#myTable&quot;, tsOptions);
-
</pre>
<p>Now just start typing in this input and it will filter the table as you are touching the keyboard :) Here is the demo and plugin download.</p>
<a href="http://blog.darsain.net/?file_id=14" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Live demo</h3>
  <span></span> <span>76x</span>
</a> <a href="http://blog.darsain.net/?file_id=15" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Plugin download</h3>
  <span>4.20KB</span> <span>43x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/83/realtime-table-rows-search-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<enclosure url="http://blog.darsain.net/?file_id=15" length="4308" type="application/javascript" /><feedburner:origLink>http://blog.darsain.net/83/realtime-table-rows-search-jquery-plugin/</feedburner:origLink></item>
		<item>
		<title>I hate you!</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/uZfLTWxINbA/</link>
		<comments>http://blog.darsain.net/81/i-hate-you-2/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 22:01:39 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Interwebz]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[advertisement]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=81</guid>
		<description><![CDATA[As I&#8217;m browsing through the interwebz, I&#8217;m too often stumbling upon an annoying, or just cheeky things on various websites. Many of them are completely useless, and websites without them would be much more user friendly, and nicer place. So here is some list I&#8217;ve put together. Enjoy, and try to avoid that in future [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m browsing through the interwebz, I&#8217;m too often stumbling upon an annoying, or just cheeky things on various websites. Many of them are completely useless, and websites without them would be much more user friendly, and nicer place. So here is some list I&#8217;ve put together. Enjoy, and try to avoid that in future :)</p>
<p><span id="more-81"></span></p>
<h1>Valid XHTML/HTML/CSS/LOLCAT/&#8230; badges</h1>
<p>You know what I&#8217;m talking about:<br />
<img src="http://blog.darsain.net/wp-content/uploads/2010/01/validation-badges.jpg" alt="" title="validation-badges" width="443" height="96" class="aligncenter size-full wp-image-82" /></p>
<p>Your visitors either don&#8217;t know what it is, they do not care, or &#8211; in my case &#8211; they are laughing for a first few years, and than it is just silly.<br />
It really was laughable to want a valid web from webdevelopers in time, where the most widely used browser was not supporting the web standards.<br />
And now, there is not much meaning in it either. 100% result in W3C validator does not mean the right usage of web standards. It does not mean, that your website will render exactly how you want, or even that it&#8217;ll render in every browser the same.<br />
For example, I can have a website with nice, clean code, working and looking exactly how I want in every major browser, with error-free JavaScript, but:</p>
<ul>
<li><b>I&#8217;ve used a custom HTML tag attribute for better comfort in JavaScript (as &#8220;data-&#8221; attribute is not supported yet):</b> BAM! Code is not valid.</li>
<li><b>I&#8217;ve declared a CSS opacity value, which is working in almost every browser by now, but it is not officially &#8220;out&#8221; yet:</b> BAM! Code is not valid.</li>
<li>etcetera&#8230;</li>
</ul>
<p>Validation badges are used only for e-penis enlargement, or ripping off the customers for &#8220;additional services&#8221; &#8211; yes, I&#8217;ve seen a webdesigners, that are persuading their clients that they NEEED that badge, so they can charge more.</p>
<p>And of course, they look awful, and they do not fit anywhere :)</p>
<h1>Horizontal scrollbars</h1>
<p>I have a 1920 pixels wide screen resolution. If I see a horizontal scrollbar, I get annoyed.</p>
<ul>
<li>badly coded JavaScript horizontal sliders</li>
<li>designers that think that horizontally based pages are cool (seriously, <a href="http://www.thehorizontalway.com/">this is not what &#8220;accessibility&#8221; means</a>)</li>
<li>bad cascading styles</li>
</ul>
<p>These are just few of the problems that causes this issue.</p>
<h1>Advertisements</h1>
<p>Oh, how much i hate them&#8230; ALL of them. There is not one ad on my personal webpages, and I&#8217;ll do whatever I could to preserve it that way. I hate when I have to scroll through 2 pages of ads to get to the content. I hate when blinking ads are trying to kill me with epileptic seizure. I hate when flash ads are moving, sliding, popping, animating, and stealing my focus from things that I want really read, or watch. I hate when flash ads are removing my cursor from screen.</p>
<p>In spite of my hatred against ads, I understand the business model based on them. So, people, if you like some website, you are grateful for services provided by it, click on the ads there. It doesn&#8217;t cost you anything, website will get some money, and the best part is: those bastards that created that awful blinking ads will pay for it :)</p>
<h1>Flash abbusing</h1>
<p>Already mentioned ads, flash menus, flash buttons, or other unnecessary flash components. Most of what I&#8217;m seeing in flash could be done with few lines of JavaScript. Things in flash are often not much accessible for users (copy&#038;paste of text), and I just hate when I have to click before activating flash controls. Not mentioning overlapping HTML elements, or whole flash blocks disappearing when coder is trying to prevent overlapping.</p>
<p>Yes, I&#8217;m not a huge fan of flash, but I&#8217;m not totally against it. I&#8217;m just marked by webdevelopers, that are doing Flash components on their website only because they know Flash, not because Flash is the good choice, and that is just fundamentally bad behavior. On the other hand, whole interactive websites completely done in flash are often looking really good (checkout <a href="http://www.thefwa.com/">this great list of awesome flash sites</a>), but such approach can not be used for other than purely presentational purposes (like main pages of movies, etc).<br />
Flash video players are another example of the right choice for Flash (even though SilverLight is better, presence of Flash plugin is more common).</p>
<h1>JavaScript abusing</h1>
<p>There are MANY ways how JavaScript is abused. For example:</p>
<ul>
<li>words replaced for advertisement links that pops up advert bubble on hover event</li>
<li>links that will show you the thumbnail of page they are referring to if you will hover them (what is the point of that!?)</li>
<li>share &#8220;supper&#8221; buttons</li>
<li>etcetera&#8230;</li>
</ul>
<p>These things are truly the plague of the websites. </p>
<h1>Java applets</h1>
<p>Seriously, websites are not the place for Java. Nuff said.</p>
<h1>Donate spam</h1>
<p>In every WordPress plugin, under every article post, on every tutorial demo presentation, there is some PayPal icon. Please, choose one place on your website, and leave it there. Make the user interface of your apps clean, and do not spam with that everywhere.</p>
<h1>Web 2.0 bullshit talk</h1>
<p>I can&#8217;t explain it better than <a href="http://www.andybudd.com/">Andy Budd</a> and <a href="http://adactio.com/">Jeremy Keith</a> on their <a href="http://www.viddler.com/explore/sandieman/videos/112/">How to Bluff Your Way In Web 2.0 presentation</a>. Must see!!</p>
<p><a href="http://blog.darsain.net/81/i-hate-you-2/"><em>Click here to view the embedded video.</em></a></p>
<h1>Register or GTFO</h1>
<p>You had to encounter that. Website is offering you some download, presentation, or tutorial, but only if you&#8217;ll register there. No fees, or other requirements, just register&#8230;&#8230;. <strong>WHY?!</strong> Why the holy fuck are you bothering people with registration, if you are offering that for free? Why do you need that useless account?</p>
<p>FireFox users, there is a big helper for you against fuckers like this. It is called the <a href="https://addons.mozilla.org/en-US/firefox/addon/6349">BugMeNot plugin</a>, and it&#8217;ll log you in on every website that is requiring useless registration.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/81/i-hate-you-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/81/i-hate-you-2/</feedburner:origLink></item>
		<item>
		<title>Math art</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/N9_Hf6MrluA/</link>
		<comments>http://blog.darsain.net/74/math-art/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 20:55:42 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Apophysis]]></category>
		<category><![CDATA[ContextFree]]></category>
		<category><![CDATA[fractals]]></category>
		<category><![CDATA[math art]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=74</guid>
		<description><![CDATA[Behold math &#038; algorithm nerds! You can create an eye candies too :) There are few not much known desktop applications on creating various fractals and vector like graphics with just few right lines of code. This article is a quick introduction to two of them: Apohysis &#038; ContextFree.

Apophysis
Website: Apophysis.org
Documentation: Apophysis@wikispaces
Download: Sourceforge.net
Apophysis is a freeware [...]]]></description>
			<content:encoded><![CDATA[<p>Behold math &#038; algorithm nerds! You can create an eye candies too :) There are few not much known desktop applications on creating various fractals and vector like graphics with just few right lines of code. This article is a quick introduction to two of them: <b>Apohysis</b> &#038; <b>ContextFree</b>.</p>
<p><span id="more-74"></span></p>
<h1>Apophysis</h1>
<p><b>Website:</b> <a href="http://apophysis.org/">Apophysis.org</a><br />
<b>Documentation:</b> <a href="http://apophysis.wikispaces.com/">Apophysis@wikispaces</a><br />
<b>Download:</b> <a href="http://sourceforge.net/projects/apophysis/">Sourceforge.net</a></p>
<p>Apophysis is a freeware Windows program for designing and rendering fractal flames . It was created by Mark Townsend and has since been improved and updated by Peter Sdobnov, Piotr Borys and Ronald Hordijk.</p>
<p>Apophysis UI &#038; few renders:</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/Apophysis.jpg" title="Apophysis" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/Apophysis-300x252.jpg" alt="" title="Apophysis" width="300" height="252" class="alignleft size-medium wp-image-75" /></a></p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/LandingPlatform_by_love1008.jpg" title="LandingPlatform_by_love1008" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/LandingPlatform_by_love1008-150x150.jpg" alt="" title="LandingPlatform_by_love1008" height="120" class="alignleft wp-image-76" /></a></p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/Apophysis_Eye_by_peach.jpg" title="Apophysis_Eye_by_peach" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/Apophysis_Eye_by_peach-150x150.jpg" alt="" title="Apophysis_Eye_by_peach" height="120" class="alignleft wp-image-77" /></a></p>
<h1>ContextFree</h1>
<p><b>Website:</b> <a href="http://www.contextfreeart.org/">ContextFreeArt.org</a><br />
<b>Documentation:</b> <a href="http://www.contextfreeart.org/mediawiki/index.php/CFDG_HOWTO">ContextFree HOWTO</a><br />
<b>Download:</b> <a href="http://www.contextfreeart.org/mediawiki/index.php/Download_page">ContextFree download page</a></p>
<p>Context Free is a program that generates vector like images from written instructions called a grammar. The program follows the instructions in a few seconds to create images that can contain millions of shapes.</p>
<p>ContextFree UI &#038; few renders:</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/ContextFree.jpg" title="ContextFree" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/ContextFree-300x233.jpg" alt="" title="ContextFree" width="300" height="233" class="alignleft size-medium wp-image-78" /></a></p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/mtree.jpg" title="mtree" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/mtree-150x150.jpg" alt="" title="mtree" height="120" class="alignleft wp-image-79" /></a></p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/funky_flower.jpg" title="funky_flower" rel="lightbox[74]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/funky_flower-150x150.jpg" alt="" title="funky_flower" height="120" class="alignleft wp-image-80" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/74/math-art/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/74/math-art/</feedburner:origLink></item>
		<item>
		<title>Password generator [UPDATE]</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/XPTmFZuuTSU/</link>
		<comments>http://blog.darsain.net/71/password-generator/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 22:29:04 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Interwebz]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=71</guid>
		<description><![CDATA[Recently, many websites has fall due to lack of security, and many of them stored users passwords in pain text (rather no comment here), pretty useless md5, or unsalted sha1.
In every of those cases it is highly dangerous for users, since lack of security in here can cause the new owner of their private data [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, <a href="http://igigi.baywords.com/">many websites has fall</a> due to lack of security, and many of them stored users passwords in pain text (rather no comment here), <a href="http://www.md5decrypter.com/">pretty</a> <a href="http://www.md5encryption.com/">useless</a> <a href="http://www.md5decrypter.co.uk/">md5</a>, or unsalted sha1.</p>
<p>In every of those cases it is highly dangerous for users, since lack of security in here can cause the new owner of their private data to crack their passwords, thus be able to steal their identity on other places of teh interwebz. Good, strong, and different passwords for any website could solve this problem, but who would be able to memorize that&#8230; That&#8217;s why I have created this little web app, called <b>Password generator</b>.</p>
<p><span id="more-71"></span></p>
<p>Application can be found on this permanent URL: <a href="http://password.darsain.net">password.darsain.net</a></p>
<h2>What problem is this solving</h2>
<p>The functionality is simple. You need only one master password, and the domain name of a website you want to get your new password for, and it will generate you a 64 letters long unbreakable hash, which you can use as a password (for funny webs with max password length requirements, there are 40, and 16 letters long versions). If password like this will be again hashed into random website database, it is not important if they are salting or not, hash from such password can not be broken (I reserve 10 years long expiration date for this statement :P ).</p>
<p>Of course, when hacker have already got the access to database, you can&#8217;t do anything about protecting your account from being hacked on this hypothetical website. But you can minimize the damage from such event. Imagine, that he would get to your password you are using on every place on the Internet. Pretty awesome situation, isn&#8217;t it? :) And exactly the damage out of the boundaries of this hypothetical website is the issue that this Password generator is solving.</p>
<h2>How is it working</h2>
<p><a href="http://blog.darsain.net/wp-content/uploads/2010/01/password-generator.jpg" title="password-generator" rel="lightbox[71]"><img src="http://blog.darsain.net/wp-content/uploads/2010/01/password-generator-300x216.jpg" alt="" title="password-generator" width="300" height="216" class="alignright size-medium wp-image-72" /></a></p>
<p>I would like to think, that the UI of this little application is self explanatory :) The background, however, is not.</p>
<p>That is why you should always beware such websites, as they are pretty often used for <a href="http://en.wikipedia.org/wiki/Phishing">phishing</a>. To ensure the security, the whole generation and algorithms are done in your browser by JavaScript. No data whatsoever are send to any server, or simply everywhere else except your monitor screen.</p>
<p>The only disadvantage is, that &#8211; from some reason &#8211; I could shut this web application down, and you will be unable to regenerate your passwords. For issue like this, as everything is done with JavaScript and HTML (+ a little bit of unimportant flash), you can just simply save the whole website to your hard drive and run it from there without any problems. Well, there is one little issue with flash player permissions when running on localhost, so Copy to clipboard button may not work, unless you&#8217;ll set <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html">this flash player setting</a> to <b>Always allow</b>.</p>
<p>If you don&#8217;t know hot to save whole website so it will be actually working, here are the downloads for you.</p>
<a href="http://blog.darsain.net/?file_id=12" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Single mht file for Opera and IE</h3>
  <span>255.77KB</span> <span>77x</span>
</a> <a href="http://blog.darsain.net/?file_id=13" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Archive with all application files</h3>
  <span>121.28KB</span> <span>81x</span>
</a>
<h2>Update:</h2>
<p>Guys, do not use this. This password system idea is great, convenient, but in real world highly counter-productive, even useless. The security of websites on the internets is so bad, that they will simply not let you to have secure passwords like this. Almost every website out there have some restrictions, like having short passwords (max 16~ chars long), consisting only from alphanumeric characters, etcetera&#8230; From everywhere I&#8217;ve tried this, the only place where it worked was Google!</p>
<p>The best thing to do right now, is not to have any account anywhere at all&#8230; if a website is forcing you to register to download or view something they are offering for free, than just flip the finger, and either close the tab, register with some one time account, or in case of Firefox users -> download the spectacular <a href="https://addons.mozilla.org/en-US/firefox/addon/6349"><b>BugMeNot</b></a> plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/71/password-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<enclosure url="http://blog.darsain.net/?file_id=13" length="124194" type="application/rar" /><feedburner:origLink>http://blog.darsain.net/71/password-generator/</feedburner:origLink></item>
		<item>
		<title>Help saving MySQL</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/uXIqyekdYn0/</link>
		<comments>http://blog.darsain.net/70/help-saving-mysql/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 12:25:08 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Interwebz]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Sun]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=70</guid>
		<description><![CDATA[Oracle is trying to buy Sun, which is the owner of MySQL project. The problem is, that without MySQL, Oracle would make a lot more money, thus there is a big issue about MySQL project safety. Please, read this message from Michael Widenius, the creator of MySQL, and decide if you want to help saving [...]]]></description>
			<content:encoded><![CDATA[<p>Oracle is trying to buy Sun, which is the owner of MySQL project. The problem is, that without MySQL, Oracle would make a lot more money, thus there is a big issue about MySQL project safety. Please, read this message from Michael Widenius, the creator of MySQL, and decide if you want to help saving MySQL.</p>
<p><span id="more-70"></span><br />
- &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - </p>
<p>I, Michael &#8220;Monty&#8221; Widenius, the creator of MySQL, is asking you urgently to help save MySQL from Oracle&#8217;s clutches. Without your immediate help Oracle might get to own MySQL any day now. By writing to the European Commission (EC) you can support this cause and help secure the future development of the product MySQL as an Open Source project.</p>
<p>What this text is about:<br />
- Summary of what is happening<br />
- What Oracle has not promised<br />
- Oracles past behavior with Open Source<br />
- Help spread this information (Jump to &#8216;What I want to ask you to do&#8217;)<br />
- Example of email to send to the commission (Jump to &#8217;send this to:&#8217;)</p>
<p>I have spent the last 27 years creating and working on MySQL and I hope, together with my team of MySQL core developers, to work on it for many more years.</p>
<p>Oracle is trying to buy Sun, and since Sun bought MySQL last year, Oracle would then own MySQL. With your support, there is a good chance that the EC (from which Oracle needs approval) could prevent this from happening or demand Oracle to change the terms for MySQL or give other guarantees to the users. Without your support, it might not. The EC is our last big hope now because the US government approved the deal while Europe is still worried about the effects.</p>
<p>Instead of just working out this with the EC and agree on appropriate remedies to correct the situation, Oracle has instead contacted hundreds of their big customers and asked them to write to the EC and require unconditional acceptance of the deal. According to what I been told, Oracle has promised to the customers, among other things, that &#8220;they will put more money into MySQL development than what Sun did&#8221; and that &#8220;if they would ever abandon MYSQL, a fork will appear and take care of things&#8221;.</p>
<p>However just putting money into development is not proof that anything useful will ever be delivered or that MySQL will continue to be a competitive force in the market as it&#8217;s now.</p>
<p>As I already blogged before, a fork is not enough to keep MySQL alive for all future, if Oracle, as the copyright holder of MySQL, would at any point decide that they should kill MySQL or make parts of MySQL closed source.</p>
<p>Oracle claims that it would take good care of MySQL but let&#8217;s face the facts: Unlike ten years ago, when MySQL was mostly just used for the web, it has become very functional, scalable and credible. Now it&#8217;s used in many of the world&#8217;s largest companies and they use it for an increasing number of purposes. This not only scares but actually hurts Oracle every day. Oracle have to lower prices all the time to compete with MySQL when companies start new projects. Some companies even migrate existing projects from Oracle to MySQL to save money. Of course Oracle has a lot more features, but MySQL can already do a lot of things for which Oracle is often used and helps people save a lot of money. Over time MySQL can do to Oracle what the originally belittled Linux did to commercial Unix (roughly speaking).</p>
<p>So I just don&#8217;t buy it that Oracle will be a good home for MySQL. A weak MySQL is worth about one billion dollars per year to Oracle, maybe more. A strong MySQL could never generate enough income for Oracle that they would want to cannibalize their real cash cow. I don&#8217;t think any company has ever done anything like that. That&#8217;s why the EC is skeptic and formalized its objections about a month ago.</p>
<p>Richard Stallman agrees that it&#8217;s very important which company owns MySQL, that Oracle should not be allowed to buy it under present terms and that it can&#8217;t just be taken care of by a community of volunteers. http://keionline.org/ec-mysql</p>
<p>Oracle has NOT promised (as far as I know and certainly not in a legally binding manner):</p>
<p>- To keep (all of) MySQL under an open source license<br />
- Not to add closed source parts, modules or required tools.<br />
- To not raise MySQL license or MySQL support prices<br />
- To release new MySQL versions in a regular and timely manner.<br />
- To continue with dual licensing and always provide affordable commercial licenses to MySQL to those who needs them (to storage vendors and application vendors) or provide MySQL under a more permissive license<br />
- To develop MySQL as an Open Source project<br />
- To actively work with the community<br />
- Apply submitted patches in a timely manner<br />
- To not discriminate patches that make MySQL compete more with Oracles other products<br />
- To ensure that MySQL is improved also in manners that make it compete even more with Oracles&#8217; main offering.</p>
<p>From looking at how Oracle handled the InnoDB acquisition, I don&#8217;t have high hopes that Oracle will do the above right if not required to do so:</p>
<p>For InnoDB:<br />
- Bug fixes where done (but this was done under a contractual obligation)<br />
- New features, like compression that was announced before acquisition, took 3 years to implement<br />
- No time tables or insight into development<br />
- The community where not allowed to participate in development<br />
- Patches from users (like Google) that would have increased performance was not implemented/released until after Oracle announced it was acquiring Sun.<br />
- Oracle started working on InnoDB+, a better &#8216;closed source&#8217; version of InnoDB<br />
- In the end Sun had to fork InnoDB, just to be able to improve performance.</p>
<p>It&#8217;s true that development did continue, but this was more to be able to continue using InnoDB as a pressure on MySQL Ab.</p>
<p>Note that Oracle&#8217;s development on the Linux kernel is not comparable with MySQL, because:<br />
- Oracle is using Linux as the main platform for their primary database product (and thus a better Linux makes Oracles platform better)<br />
- The GPL code in the kernel is not affecting what is running on top on it (because of an exception in Linux).</p>
<p>Because we don&#8217;t have access to a database of MySQL customers and users the only way we can get the word out is to use the MySQL and Open Source community. I would never have resorted to this if Oracle would not have broken the established rules in anticompetitive merger cases and try to influence the EC by actively mobilising the customers.</p>
<p>This is very critical to this AS SOON AS POSSIBLE as EC, depending on what Oracle is doing, needs to make a decision either on Monday (2009-12-14) or within two weeks. Becasue of the strict deadline, every email counts!</p>
<p>What I want to ask you to do (until 2009-12-19):</p>
<p>- Forward this email to everyone that you know is using MySQL or Open Source/free software and to all email list where you know there are people present that use or care about MySQL and open source (please check first that this email hasn&#8217;t been sent there before)<br />
- Alternatively send emails with information about this and tell them to read http://monty-says.blogspot.com/2009/12/help-saving-mysql.html<br />
- Add links on your web site to http://monty-says.blogspot.com/2009/12/help-saving-mysql.html with the text &#8220;We are using MySQL, help save it&#8221;, for the duration of the next two week.<br />
- Blog about this (feel free to include this text or just link to my blog)<br />
- Call by phone (don&#8217;t contact by email, this is urgent) your boss or VP and ask him to read this email and send a letter to the EC commission ASAP!<br />
- If you don&#8217;t have anyone to contact above, send an email to the EC!</p>
<p>As we want the EC to get a correct picture of the situation, we want you to first fill in the upper part and then choose one of the proposed texts belowe that best matches your view of the situation. Feel free to supply your own text and additional information if you think this will help the EC to reach a better understanding of how MySQL is used.</p>
<p>Send this to: comp-merger-registry@ec.europa.eu</p>
<p>If you have extra time to help, fill in the following, if not, just skip to the main text.</p>
<p>Name:<br />
Title:<br />
Company:<br />
Size of company:<br />
How many MySQL installations:<br />
Total data stored in MySQL (megabyte):<br />
For what type of applications is MySQL used:<br />
Should this email be kept confidential by EC: Yes/No</p>
<p>Copy or use one of the below texts as a base for your answer:</p>
<p>a)<br />
I don&#8217;t trust that Oracle will take good care of MySQL and MySQL should be divested to another company or foundation that have everything to gain by developing and promoting MySQL. One should also in the future be able to combine MySQL with closed source application (either by exceptions, a more permissive license or be able to dual license MySQL under favourable terms)</p>
<p>b)</p>
<p>I think that Oracle could be a good steward of MySQL, but I would need EC to have legally binding guarantees from Oracle that:<br />
- All of MySQL will continue to be fully Open Source/free software in the future (no closed source modules).<br />
- Open Source version and dual-licensed version of MySQL should have same source (like today).<br />
- That development will be done in community friendly way.<br />
- The manual should be released under a permissive license (so that one can fork it, the same way one can fork the server)<br />
- That MySQL should be released under a more permissive license to ensure that forks can truly compete with Oracle if Oracle is not a good steward after all.<br />
Alternatively:<br />
- One should be able to always buy low priced commercial licenses for MySQL.<br />
- All of the above should be perpetual and irrevocable.</p>
<p>There should also be mechanism so that if Oracle is not doing what is expected of it, forks should be able to compete with Oracle</p>
<p>c)<br />
I trust Oracle and I suggest that EC will approve the deal unconditionally.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Let us prove to Oracle and EC that the Open Source community is a true force and we take good care of our citizens and we prefer to work with companies that does the same!</p>
<p>The future of MySQL is in your hands!</p>
<p>Thanks for the help!<br />
Michael Widenius<br />
Creator of MySQL</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>For more informations about this issue, please visit the <a href="http://monty-says.blogspot.com/">Monty says blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/70/help-saving-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/70/help-saving-mysql/</feedburner:origLink></item>
		<item>
		<title>Fix YouTube player in Opera</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/VF32rB8bVrQ/</link>
		<comments>http://blog.darsain.net/67/fix-youtube-player-in-opera/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 18:02:09 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Interwebz]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=67</guid>
		<description><![CDATA[Some time ago, YouTube has introduced an HQ &#038; HD streaming. Wider player was next logical step, but their implementation was a bit weird (triggering was somehow random o.O). After a few chaotic steps &#8211; for a while &#8211; there was nice, friendly player, wide and high as it could be, and everything was fine. [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, YouTube has introduced an HQ &#038; HD streaming. Wider player was next logical step, but their implementation was a bit weird (triggering was somehow random o.O). After a few chaotic steps &#8211; for a while &#8211; there was nice, friendly player, wide and high as it could be, and everything was fine. And than, they have decided to fucked it up with pointless padding on sides, creating a black bar on each side, which was driving me crazy. Instead of returning it back, they&#8217;ve tried to make it look better, so the rounded corners were added O.O</p>
<p><span id="more-67"></span></p>
<p>I know that Google webdesigners suck, and I&#8217;ve learned to live with that, but this is too much. Lucky me, I&#8217;m using Opera as a primary browser, and one of the really useful features Opera have, is using my own style sheets for any domain I want. This is a really great thing, as I&#8217;m tweaking with it many website I&#8217;m often surfing on :)</p>
<p>So, I&#8217;ve created this little .css file consisting of 1 line of simple css, and it is fixing exactly that issue I&#8217;m bitching about in first section.</p>
<pre class="brush: css;">
#watch-player-div embed {
  width: 100% !important;
  height: 565px !important;
  margin: 0 !important;
}
</pre>
<p>Here is the result:</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/12/youtube-player-fix.jpg" title="youtube-player-fix" rel="lightbox[67]"><img src="http://blog.darsain.net/wp-content/uploads/2009/12/youtube-player-fix-559x266.jpg" alt="youtube-player-fix" title="youtube-player-fix" width="559" height="266" class="size-large wp-image-68" /></a></p>
<p>If you want this clean YouTube experience too, the Installation is pretty simple. Here are the steps:</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/12/youtube-opera-site-preferences.jpg" title="youtube-opera-site-preferences" rel="lightbox[67]"><img src="http://blog.darsain.net/wp-content/uploads/2009/12/youtube-opera-site-preferences-300x247.jpg" alt="youtube-opera-site-preferences" title="youtube-opera-site-preferences" width="200" class="alignright size-medium wp-image-69" /></a></p>
<ul>
<li>download the <a href="http://blog.darsain.net/?file_id=11">youtube-player-fix.css</a> file</li>
<li>be a person who is using <a href="http://www.opera.com/">Opera</a> as a web browser</li>
<li>open <a href="http://www.youtube.com">YouTube</a></li>
<li>right click on some non-active background, and choose &#8220;Edit Site Preferences&#8230;&#8221;</li>
<li>under the Display tab, you have a &#8220;My style sheet&#8221; option, where you can load the <strong>youtube-player-fix.css</strong> file</li>
<li>click OK, and you are done</li>
</ul>
<p>From now on, every page hosted on domain youtube.com will render with this additional css.</p>
<a href="http://blog.darsain.net/?file_id=11" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>CSS file</h3>
  <span>99B</span> <span>128x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/67/fix-youtube-player-in-opera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<enclosure url="http://www.opera.com/" length="-1" type="application/xml" /><feedburner:origLink>http://blog.darsain.net/67/fix-youtube-player-in-opera/</feedburner:origLink></item>
		<item>
		<title>New Motion Graphics gallery</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/mkaZccLUutQ/</link>
		<comments>http://blog.darsain.net/66/new-motion-graphics-gallery/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 22:35:54 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Darsain network]]></category>
		<category><![CDATA[Darsain.net]]></category>
		<category><![CDATA[Motion Graphics]]></category>
		<category><![CDATA[special FX]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=66</guid>
		<description><![CDATA[Well, another one of my interests will have its own gallery on Darsain.net :) You can find there various videos of special FX, animated graphics, and related &#8220;moving&#8221; stuff created by my&#8230;
tl;dr: checkout the Motion graphics gallery.
Just one thing concerns me, and that is the download speed limit of my provider, which may not be [...]]]></description>
			<content:encoded><![CDATA[<p>Well, another one of my interests will have its own gallery on Darsain.net :) You can find there various videos of special FX, animated graphics, and related &#8220;moving&#8221; stuff created by my&#8230;</p>
<p>tl;dr: checkout the <a href="http://www.darsain.net/index.php?act=browse&#038;section=1&#038;gallery=17">Motion graphics</a> gallery.</p>
<p>Just one thing concerns me, and that is the download speed limit of my provider, which may not be enough for smooth streaming without loading. But it have to be enough for a while, till I&#8217;ll make some time (and mood) for hosting provider change, which is on my to do list at least for a few months by now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/66/new-motion-graphics-gallery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/66/new-motion-graphics-gallery/</feedburner:origLink></item>
		<item>
		<title>MyGallery 1.1 update</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/EJWH1PKMlHQ/</link>
		<comments>http://blog.darsain.net/64/mygallery-1-1-update/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:30:14 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[MyGallery]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=64</guid>
		<description><![CDATA[As I&#8217;ve found some bugs in it, and I didn&#8217;t consider files uploading enough comfortable, I&#8217;ve decided to update this little thingy. New version is creating less mess on FTP (js &#038; style folders were moved into system), few bugs are fixed, few functionality clearance, but most important thing is new file uploader. I&#8217;ve implemented [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve found some bugs in it, and I didn&#8217;t consider files uploading enough comfortable, I&#8217;ve decided to update this little thingy. New version is creating less mess on FTP (js &#038; style folders were moved into system), few bugs are fixed, few functionality clearance, but most important thing is new file uploader. I&#8217;ve implemented the GREAT <a href="http://www.uploadify.com/">jQuery Uploadify</a> plugin, which is creating THE most comfortable file uploading experience EVAR! :)</p>
<p><span id="more-64"></span></p>
<h3>New upload feature preview</h3>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/mygallery-uploadify.jpg" title="mygallery-uploadify" rel="lightbox[64]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/mygallery-uploadify-560x387.jpg" alt="mygallery-uploadify" title="mygallery-uploadify" width="560" height="387" class="alignleft size-large wp-image-65" /></a><br />
By calling files selection by flash, you can choose multiple files at once (or whole folder with Ctrl+a), which is not possible only with HTML~JS. That means, that you do not have to select all files one by one, and smash your head on keyboard after 101st image. All files are than inserted into an upload queue, which is triggered by the &#8220;Upload files&#8221; button. Everything is take care of by AJAX, so there is no need for site reloading, and you can see how you gallery is filling with images :)</p>
<a href="http://blog.darsain.net/?file_id=9" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span>1.09KB</span> <span>185x</span>
</a> <a href="http://blog.darsain.net/?file_id=10" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Application files</h3>
  <span>7.64KB</span> <span>129x</span>
</a>
<h3>Bugs &#038; suggestions</h3>
<p>Report all bugs here as comments (or as comments on main MyGallery page on www.darsain.net).</p>
<p>If you have some suggestion, or feature requests &#8230; same way as with bugs :) just write them down here.</p>
<h3>Future plans</h3>
<p>In the next update I would like to jump straight to version 2.0, because I want to redesign the whole thing, and change app structure. I would love to recreate it to looks and function more like Deviantart Portfolio application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/64/mygallery-1-1-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.darsain.net/64/mygallery-1-1-update/</feedburner:origLink></item>
		<item>
		<title>Thumbnail generation functions in PHP</title>
		<link>http://feedproxy.google.com/~r/ManyInterestsBlog/~3/m5t-C5Adp10/</link>
		<comments>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 20:06:00 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=61</guid>
		<description><![CDATA[First, lets take a look on what problem will this tutorial solve, so you can decide if you want to read more :)
We will write 2 functions for creating thumbnails from random image (png, jpg, gif). First function will take thumbnail width and height set by you, and cut the &#8220;most important&#8221; part from the [...]]]></description>
			<content:encoded><![CDATA[<p>First, lets take a look on what problem will this tutorial solve, so you can decide if you want to read more :)</p>
<p>We will write 2 functions for creating thumbnails from random image (png, jpg, gif). First function will take thumbnail width and height set by you, and cut the &#8220;most important&#8221; part from the image (I&#8217;m assuming, that you are creating thumbnails of websites, so center top is the area I&#8217;m talking about) according to thumbnail ratio, and resize it into your thumbnail in exact size that you&#8217;ve set. Second function will take max thumbnail width and height set by you, and resize the image so it will fit your max values, but with preserving its original resolution ratio.</p>
<p><span id="more-61"></span></p>
<h1>1.) Generate thumbnail of exact size</h1>
<p>This function will cut the biggest possible top center of image, so it can be resized into width and height you need without deforming it. The advantage of this method is, taht all thumbnails have same resolution, therefore they can be easily styled on website, and it just looks better. Disadvantage is, that sometimes, it could cut the important part of image.<br />
For better understanding, click on the image below.</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-cut-explanation.jpg" title="thumb-cut-explanation" rel="lightbox[61]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-cut-explanation-560x253.jpg" alt="thumb-cut-explanation" title="thumb-cut-explanation" width="560" height="253" class="alignleft size-large wp-image-62" /></a></p>
<p>Lets define the function:</p>
<p><strong>create_thumb( string <em>$source_path</em>, string <em>$destination_path</em>, int <em>$thumb_width</em>, int <em>$thumb_height</em> [, int <em>$quality</em> [, int <em>$overwrite</em>]] )</strong></p>
<h3>Parameters:</h3>
<ul>
<li><strong>$source_path</strong>: Path to source image (jpg, jpeg, png, gif).</li>
<li><strong>$destination_path</strong>: Thumbnail destination path. It has to have *.jpg extension, as all thumbnails will be generated in jpg.</li>
<li><strong>$thumb_width</strong>: Final thumbnail width.</li>
<li><strong>$thumb_height</strong>: Final thumbnail height.</li>
<li><strong>$quality</strong>: JPG compression quality (bigger: better quality,larger file). Range 0-100 (optimal 85).</li>
<li><strong>$overwrite</strong>: Set as true if you wan this function to overwrite thumbnail if it already exists.</li>
</ul>
<p>Lets start with code. I&#8217;m lazy to comment every line, so I&#8217;ll just paste the whole function with comments in code :) Also, I was asked about cut size and coordinates calculation, but I don&#8217;t know what is there to explain. If you suck in math,  than just copy paste it and live your miserable life :)</p>
<pre class="brush: php;">
function create_thumb( $source_path, $destination_path, $thumb_width, $thumb_height, $quality=85, $overwrite=true ) {

    // If overwrite is set to FALSE and destination file allready exists, than return FALSE and quit execution
    if( file_exists( $destination_path ) &amp;&amp; is_file( $destination_path ) &amp;&amp; $overwrite == false ) return false;

    // Needed definitions
    $allowed_extensions = array( 'jpg', 'jpeg', 'png', 'gif' );

    $pathinfo = pathinfo( $source_path );

    // Check if source file exists, and is in array of allowed extensions.
    // Otherwise return FALSE
    if( file_exists( $source_path ) &amp;&amp; in_array( strtolower( $pathinfo['extension'] ), $allowed_extensions ) )
    {

      // Get needed data about source image
      list( $original_width, $original_height, $type, $attr ) = getimagesize( $source_path );

      // Calculate cut size and coordinates
      $thumb_ratio = $thumb_width / $thumb_height;
      $original_ratio = $original_width / $original_height;

      if( $thumb_ratio &gt; $original_ratio )
      {

          $cut_width  = $original_width;
          $cut_height = ( $original_width * $thumb_height ) / $thumb_width;

          $cut_x = 0;
          $cut_y = 0;

      }
      elseif( $thumb_ratio &lt; $original_ratio )
      {

          $cut_width  = ( $original_height * $thumb_width ) / $thumb_height;
          $cut_height = $original_height;

          $cut_x = ( $original_width - $cut_width ) / 2;
          $cut_y = 0;

      }
      else
      {

          $cut_width  = $original_width;
          $cut_height = $original_height;

          $cut_x = 0;
          $cut_y = 0;

      }

      // Create final image layout
      $final_image = imagecreatetruecolor( $thumb_width, $thumb_height );

      // Is gif
      if( $pathinfo['extension'] == 'gif' )
      {
      	$source_image = imagecreatefromgif( $source_path );
      }
      // Is png
      elseif( $pathinfo['extension'] == 'png' )
      {
      	$source_image = imagecreatefrompng( $source_path );
      }
      // Is jpg, jpeg
      else
      {
      	$source_image = imagecreatefromjpeg( $source_path );
      }

      // Cut, resize source, and create final image
      imagecopyresampled( $final_image, $source_image, 0, 0, $cut_x, $cut_y, $thumb_width, $thumb_height, $cut_width, $cut_height );

      // Return TRUE if the thumbnail was created. Otherwise FALSE
      if ( imagejpeg( $final_image, $destination_path, $quality ) )
      {
        return true;
      }
      else
      {
        return false;
      }

    }
    else
    {
      return false;
    }

}
</pre>
<p>As you may notice, this function will always create a .jpg image. You can easily modify that to generate the same image type as source, but .jpg is simply the best choice for thumbnail, and it is not creating such mess on ftp as various image types. (If you are uploading animated gif, the first frame will be your thumbnail)</p>
<h1>1.) Generate thumbnail by original image resolution ratio</h1>
<p>This function will generate a thumbnail, which will fit into max thumbnail width and max height set by you, but also it will preserve the resolution image ratio of original, so it will be not deformed. Advantages and disadvantages of this method are exact opposite of previous one. Whole image is preserve in minified version, but on website, it could looks awful. Depends on how and where you are planning to use these thumbnails.<br />
For better understanding, click on the image below.</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-ratio-cut-explanation.jpg" title="thumb-ratio-cut-explanation" rel="lightbox[61]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-ratio-cut-explanation-560x253.jpg" alt="thumb-ratio-cut-explanation" title="thumb-ratio-cut-explanation" width="560" height="253" class="alignleft size-large wp-image-63" /></a></p>
<p>Definition and parameters are exactly same, just function is called <strong>create_ratio_thumb</strong>. Differences are highlighted.</p>
<pre class="brush: php; highlight: [19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,46,65];">
function create_ratio_thumb( $source_path, $destination_path, $thumb_width, $thumb_height, $quality=85, $overwrite=true ) {

    // If overwrite is set to FALSE and destination file allready exists, than return FALSE and quit execution
    if( file_exists( $destination_path ) &amp;&amp; is_file( $destination_path ) &amp;&amp; $overwrite == false ) return false;

    // Needed definitions
    $allowed_extensions = array( 'jpg', 'jpeg', 'png', 'gif' );

    $pathinfo = pathinfo( $source_path );

    // Check if source file exists, and is in array of allowed extensions.
    // Otherwise return FALSE
    if( file_exists( $source_path ) &amp;&amp; in_array( strtolower( $pathinfo['extension'] ), $allowed_extensions ) )
    {

      // Get needed data about source image
      list( $original_width, $original_height, $type, $attr ) = getimagesize( $source_path );

      // Calculate final thumbnail resolution
      $thumb_ratio = $thumb_width / $thumb_height;
      $original_ratio = $original_width / $original_height;

      if( $thumb_ratio &gt; $original_ratio )
      {

          $final_width  = round( ( $thumb_height * $original_width) / $original_height );
          $final_height = $thumb_height;

      }
      elseif( $thumb_ratio &lt; $original_ratio )
      {

          $final_width  = $thumb_width;
          $final_height = round( ( $thumb_width * $original_height ) / $original_width );

      }
      else
      {

          $final_width  = $thumb_width;
          $final_height = $thumb_height;

      }

      // Create final image layout
  		$final_image = imagecreatetruecolor( $final_width, $final_height );

  		// Is gif
  		if( $pathinfo['extension'] == 'gif' )
  		{
  			$source_image = imagecreatefromgif( $source_path );
  		}
  		// Is png
  		elseif( $pathinfo['extension'] == 'png' )
  		{
  			$source_image = imagecreatefrompng( $source_path );
  		}
  		// Is jpg, jpeg
  		else
  		{
  			$source_image = imagecreatefromjpeg( $source_path );
  		}

  		// Resize source, and create the final image
  		imagecopyresampled( $final_image, $source_image, 0, 0, 0, 0, $final_width, $final_height, $original_width, $original_height );

      // Return TRUE if the thumbnail was created. Otherwise FALSE
      if ( imagejpeg( $final_image, $destination_path, $quality ) )
      {
        return true;
      }
      else
      {
        return false;
      }

    }
    else
    {
      return false;
    }

}
</pre>
<p>And that would be our tutorial on creating thumbnails :) Check out the demo, where you can try to generate thumbnail from your own image, or download the tutorial files. (and don&#8217;t forget to set chmod 0777 to destination folder)</p>
<a href="http://blog.darsain.net/?file_id=7" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span></span> <span>196x</span>
</a> <a href="http://blog.darsain.net/?file_id=8" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Tutorial files</h3>
  <span>10.30KB</span> <span>126x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<enclosure url="http://blog.darsain.net/?file_id=8" length="10554" type="application/rar" /><feedburner:origLink>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/</feedburner:origLink></item>
	</channel>
</rss>
