<?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>Maxoffsky</title>
	<atom:link href="http://maxoffsky.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxoffsky.com</link>
	<description>Maks Surguy on the web.</description>
	<lastBuildDate>Thu, 17 May 2012 22:24:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Ways for Facebook to make more money.</title>
		<link>http://maxoffsky.com/maxoffsky-blog/ways-for-facebook-to-make-more-money/</link>
		<comments>http://maxoffsky.com/maxoffsky-blog/ways-for-facebook-to-make-more-money/#comments</comments>
		<pubDate>Thu, 17 May 2012 21:03:01 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[advertizing]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[friendvertizing]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1058</guid>
		<description><![CDATA[How facebook can make more money by turning your friends into advertizers. ]]></description>
			<content:encoded><![CDATA[<p>I am not a financial advisor but I do have some investment experience. This post just documents some thoughts that I had about monetizing Facebook if I was in charge of doing that.</p>
<p>Tomorrow by presenting IPO Facebook will have to become a moneymaking machine. I think that Facebook&#8217;s current model of making money has bleak future and probably small returns for people that do pay. Being valued at 100 Billion dollars means that every active user on average should spend at least 111$ while on the network which I doubt is the case.</p>
<p>Majority of money comes from intrusive advertising (by definition advertising is intrusive). My idea is to turn intrusive advertising into smart way of what I call &#8220;friendvertizing&#8221;. The idea is to have  friends recommend products or services in a way that users would prefer. This would replace affiliate programs that are currently available all throughout the web. Every person buys something and eventually can and often does share with others about the products that they like very much. Everybody could recommend a product and I think they deserve to get more than just credit for doing that. Why not ask users to promote a product that they recently bought and pay the users for doing that? This would endorse the product and at the same time give the product more exposure while rewarding the people who provide that exposure.</p>
<p>If I worked at Facebook, I would try to make this happen and I strongly believe that future of affiliate marketing and advertising is through real regular people, connections that do matter in our lives.</p>
<p>Please share this post with others and let&#8217;s change the world one person at a time!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/maxoffsky-blog/ways-for-facebook-to-make-more-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Laravel applications to learn from</title>
		<link>http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/</link>
		<comments>http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 15:02:44 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel code]]></category>
		<category><![CDATA[laravel modules]]></category>
		<category><![CDATA[php framework]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1038</guid>
		<description><![CDATA[Couple days ago I posted about Laravel &#8211; a PHP framework that allows developers to quickly build applications. Today I will post links to a few source code repositories that you could learn from if you are developing in Laravel. Here are a few applications made in Laravel : Tiny Issue HelpDesk sort of thing : https://github.com/mikelbring/tinyissue Larevel Bootstrap &#8211; CMS with image uploads, article management and user roles https://github.com/davzie/Laravel-Bootstrap Kudos Markdown based blogging https://github.com/ianlandsman/Kudos Rebel CMS Simple CMS built on Laravel 2.0, uses Twitter Bootstrap and allows users to upload media. https://github.com/rebelnz/rebelcms ShopHub ShopHub aims to become the one ...]]></description>
			<content:encoded><![CDATA[<p>Couple days ago I posted about Laravel &#8211; a PHP framework that allows developers to quickly build applications.</p>
<p>Today I will post links to a few source code repositories that you could learn from if you are developing in Laravel.</p>
<p>Here are a few applications made in <a href="http://laravel.com" title="Laravel PHP framework" target="_blank">Laravel</a> :</p>
<hr />
Tiny Issue<br />
HelpDesk sort of thing :<br />
<a href="https://github.com/mikelbring/tinyissue" title="Tiny Issue Help desk in Laravel" target="_blank">https://github.com/mikelbring/tinyissue</a></p>
<hr />
<p>Larevel Bootstrap &#8211; CMS with image uploads, article management and user roles<br />
<a href="https://github.com/davzie/Laravel-Bootstrap" title="laravel and twitters bootstrap" target="_blank">https://github.com/davzie/Laravel-Bootstrap</a></p>
<hr />
Kudos<br />
Markdown based blogging<br />
<a href="https://github.com/ianlandsman/Kudos " title="Kudos blogging Laravel" target="_blank">https://github.com/ianlandsman/Kudos<br />
</a></p>
<hr />
<p>Rebel CMS<br />
Simple CMS built on Laravel 2.0, uses Twitter Bootstrap and allows users to upload media.<br />
<a href="https://github.com/rebelnz/rebelcms  " title="Laravel CMS" target="_blank">https://github.com/rebelnz/rebelcms</a></p>
<hr />
<p>ShopHub<br />
ShopHub aims to become the one stop shop for creating a webshop. Uses Twitter Bootstrap, Authority user access control, lots of bundles and custom code<br />
<a href="https://github.com/Vespakoen/ShopHub" title="ShopHub Laravel implementation" target="_blank">https://github.com/Vespakoen/ShopHub<br />
</a></p>
<hr />
<p>Laravel Bundles<br />
<a href="https://github.com/UserScape/Laravel-Bundles" title="Laravel bundles" target="_blank">https://github.com/UserScape/Laravel-Bundles</a></p>
<p>Helpful bits of code:</p>
<hr />
<p>Paypal integration in Laravel<br />
<a href="http://forums.laravel.com/viewtopic.php?id=788" title="Paypal in Laravel" target="_blank">http://forums.laravel.com/viewtopic.php?id=788</a></p>
<hr />
<p>Idea of how to organize your files:<br />
<a href="http://forums.laravel.com/viewtopic.php?id=728" title="folder structure in Laravel" target="_blank">http://forums.laravel.com/viewtopic.php?id=728</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Laravel framework extensions</title>
		<link>http://maxoffsky.com/code-blog/laravel-framework-extensions/</link>
		<comments>http://maxoffsky.com/code-blog/laravel-framework-extensions/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 15:33:57 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[laravel extensions]]></category>
		<category><![CDATA[laravel framework]]></category>
		<category><![CDATA[laravel modules]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1035</guid>
		<description><![CDATA[Yesterday I posted about Laravel &#8211; a PHP framework for developers that is quick to learn and implement. Today I will summarize a list of extensions for Laravel that might be helpful in development of a real-world applications. Laravel Markdown Sparkdown Bundle is simple bundle to provide Markdown and Markdown Extra functions.Details and download can be viewed here: https://github.com/sparksp/laravel-markdown Markitup bundle Markitup Bundle is a simple bundle to integrate markItUp! universal markup jQuery editorDetails and download can be viewed here: http://bundles.laravel.com/bundle/markitup Authority Authority is a Role Based Access Control bundle for Laravel http://vespakoen.github.com/authority-laravel/ Basset Basset is a Better Asset class ...]]></description>
			<content:encoded><![CDATA[<p>Yesterday I <a href="http://maxoffsky.com/code-blog/laravel-framework-for-web-artisans/" title="Laravel framework for Web Artisans." target="_blank">posted</a> about <a href="http://maxoffsky.com/code-blog/laravel-framework-for-web-artisans/" title="Laravel framework introduction" target="_blank">Laravel</a> &#8211; a PHP framework for developers that is quick to learn and implement.</p>
<p>Today I will summarize a list of extensions for <a href="http://laravel.com" title="laravel framework" target="_blank">Laravel</a> that might be helpful in development of a real-world applications.</p>
<div class="accordion">
<p><a href="#" class="trigger current">Laravel Markdown</a></p>
<div class="pane current">Sparkdown Bundle is simple bundle to provide Markdown and Markdown Extra functions.Details and download can be viewed here:<br />
<a href="https://github.com/sparksp/laravel-markdown" title="laravel markdown" target="_blank"> https://github.com/sparksp/laravel-markdown</a></div>
<p><a href="#" class="trigger">Markitup bundle</a></p>
<div class="pane">Markitup Bundle is a simple bundle to integrate markItUp! universal markup jQuery editorDetails and download can be viewed here:<br />
<a href="http://bundles.laravel.com/bundle/markitup" title="http://bundles.laravel.com/bundle/markitup" target="_blank">http://bundles.laravel.com/bundle/markitup</a></div>
<p><a href="#" class="trigger">Authority</a></p>
<div class="pane">Authority is a Role Based Access Control bundle for Laravel<br />
<a href="http://vespakoen.github.com/authority-laravel/" title="http://vespakoen.github.com/authority-laravel/" target="_blank">http://vespakoen.github.com/authority-laravel/</a></div>
<p><a href="#" class="trigger">Basset </a></p>
<div class="pane">Basset is a Better Asset class for the Laravel framework<br />
<a href="https://github.com/jasonlewis/basset" title="https://github.com/jasonlewis/basset" target="_blank">https://github.com/jasonlewis/basset</a></div>
<p><a href="#" class="trigger">Closure Compiler </a></p>
<div class="pane">Closure Compiler<br />
<a href="http://bundles.laravel.com/bundle/closure-compiler" title="http://bundles.laravel.com/bundle/closure-compiler" target="_blank">http://bundles.laravel.com/bundle/closure-compiler</a></div>
<p><a href="#" class="trigger">PHPMailer Bundle</a></p>
<div class="pane">PHPMailer Bundle, by Colin Viebrock<br />
A Laravel PHPMailer bundle, installable via the Artisan CLI:<br />
<a href="http://bundles.laravel.com/bundle/phpmailer" title="http://bundles.laravel.com/bundle/phpmailer" target="_blank">http://bundles.laravel.com/bundle/phpmailer</a></div>
<p><a href="#" class="trigger">Laravel WordPress</a></p>
<div class="pane">Laravel WordPress is a package for working w/ WordPress.<br />
<a href="https://github.com/swt83/laravel-wordpress" title="https://github.com/swt83/laravel-wordpress" target="_blank">https://github.com/swt83/laravel-wordpress</a></div>
<p><a href="#" class="trigger">PHPThumb Laravel Bundle</a></p>
<div class="pane">PHPThumb Laravel Bundle is an Image manipulation bundle based of PHPThumb<br />
<a href="https://github.com/javiervd/phpthumb-bundle" title="https://github.com/javiervd/phpthumb-bundle" target="_blank">https://github.com/javiervd/phpthumb-bundle</a></div>
<p><a href="#" class="trigger">Mailchimp for LaravelPHP</a></p>
<div class="pane">Mailchimp for LaravelPHP is a LaravelPHP package for working w/ Mailchimp.<br />
<a href="https://github.com/swt83/laravel-mailchimp" title="https://github.com/swt83/laravel-mailchimp" target="_blank">https://github.com/swt83/laravel-mailchimp</a></div>
<p><a href="#" class="trigger">Laravel Menu</a></p>
<div class="pane">Laravel menu is a Menu builder for Laravel<br />
<a href="https://github.com/Vespakoen/laravel-menu" title="https://github.com/Vespakoen/laravel-menu" target="_blank">https://github.com/Vespakoen/laravel-menu</a></div>
</div>
<div class="alert yellow">Update! : I&#8217;ve posted a list of real world projects done in Laravel, great way to learn from the source : <a href="http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/" title="Laravel real world applications" target="_blank">http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/</a></div>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/laravel-framework-extensions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Laravel framework for Web Artisans.</title>
		<link>http://maxoffsky.com/code-blog/laravel-framework-for-web-artisans/</link>
		<comments>http://maxoffsky.com/code-blog/laravel-framework-for-web-artisans/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 18:39:55 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[laravel framework]]></category>
		<category><![CDATA[laravel tutorials]]></category>
		<category><![CDATA[make a blog]]></category>
		<category><![CDATA[php code]]></category>
		<category><![CDATA[php framework]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1032</guid>
		<description><![CDATA[Recently I was faced with a task of choosing a best PHP framework that would work as infrastructure for a few of my personal projects and also for the startup I&#8217;m working for. I&#8217;ve got some experience with Ruby on Rails and loved the simplicity of making web apps with it. Ruby on Rails takes a special kind of dedication and patience to begin coding with and so it would be hard to find a collaborator in the long run. I&#8217;ve looked through a few dozen PHP frameworks that are out there, CakePHP, ZEND, CodeIgniter, new frameworks on Github and ...]]></description>
			<content:encoded><![CDATA[<p>Recently I was faced with a task of choosing a best PHP framework that would work as infrastructure for a few of my personal projects and also for the startup I&#8217;m working for.</p>
<p>I&#8217;ve got some experience with Ruby on Rails and loved the simplicity of making web apps with it. Ruby on Rails takes a special kind of dedication and patience to begin coding with and so it would be hard to find a collaborator in the long run.</p>
<p>I&#8217;ve looked through a few dozen PHP frameworks that are out there, CakePHP, ZEND, CodeIgniter, new frameworks on Github and other open source repositories. I am sure any of them could be a great fit for big and complex tasks that I want to accomplish, but I wanted something simple. Something that even a non-coder could learn quickly.</p>
<p>After downloading and testing lots and lots of frameworks, from 50Kb in size to dozen megabytes, from super simple flat-file XML to Mega-Giga database driven, I have arrived at something worth more of my attention.</p>
<p>I&#8217;ve stumbled upon <a href="http://laravel.com/" title="Laravel Framework" target="_blank">Laravel</a> framework. A super simple framework for people who want to get their web applications made quickly without sacrificing efficiency and speed.</p>
<p>Why I liked <a href="http://laravel.com/" title="laravel framework website" target="_blank">Laravel</a> right away? What&#8217;s so special about it that I fell in love with this framework? Here&#8217;s the beauty of it:</p>
<ul>
<li>MVC</li>
<li>RESTful controllers</li>
<li>It is extremely clean. No Spaghetti Code. Use only what your application needs</li>
<li>Amazing templating system (like Mustache)</li>
<li>Bundles (like plugins or extensions or like ruby gems)</li>
<li>Automatic pagination</li>
<li>Authentification out of the box! (CodeIgniter was behind on this one)</li>
<li>Artisan command line tool that simplifies lots of tasks like migrations, installing bundles, your own tasks, unit testing, etc.</li>
<li>Extremely detailed documentation (helpful for a noob like me!)</li>
</ul>
<p>To those who would like to start using Laravel, here is an outline on how to get you started :</p>
<ol>
<li>Install MAMP (on Mac OS) or WAMP (on Windows) &#8211; unless you already have Apache, MySQL and PHP installed</li>
<li>Check out the website and download the framework at laravel.com</li>
<li>Scan through documentation at <a href="http://laravel.com/docs" title="laravel documentation" target="_blank">http://laravel.com/docs</a></li>
<li>Visit the forums particularly these threads : <a href="http://forums.laravel.com/viewtopic.php?id=858" title="laravel getting started" target="_blank">http://forums.laravel.com/viewtopic.php?id=858</a> , <a href="http://forums.laravel.com/viewtopic.php?id=768" title="laravel tutorials" target="_blank">http://forums.laravel.com/viewtopic.php?id=768</a> , <a href="http://forums.laravel.com/viewtopic.php?id=728" title="Laravel app structure" target="_blank">http://forums.laravel.com/viewtopic.php?id=728 </a> , <a href="http://forums.laravel.com/viewtopic.php?id=859" title="More laravel tutorials" target="_blank">http://forums.laravel.com/viewtopic.php?id=859</a></li>
<li>Visit <a href="http://jasonlewis.me/blog/laravel-tutorials" title="Laravel tutorials" target="_blank">http://jasonlewis.me/blog/laravel-tutorials</a></li>
</ol>
<p>The most helpful for me was the series of tutorials by daylerees:</p>
<p><strong>1.</strong> <a href="http://daylerees.com/2012/03/25/laravel-getting-started/">Laravel: Getting Started</a><br />
<strong>2.</strong> <a href="http://daylerees.com/2012/03/26/laravel-project-structure/">Laravel: Project Structure</a><br />
<strong>3.</strong> <a href="http://daylerees.com/2012/03/27/laravel-using-controllers/">Laravel: Using Controllers</a><br />
<strong>4.</strong> <a href="http://daylerees.com/2012/03/28/laravel-routes-with-closures/">Laravel: Routes with Closures</a><br />
<strong>5.</strong> <a href="http://daylerees.com/2012/03/29/laravel-the-untold-story/">Laravel: The Untold Story</a><br />
<strong>6.</strong> <a href="http://daylerees.com/2012/04/01/laravel-migrations/">Laravel: Migrations</a><br />
<strong>7.</strong> <a href="http://daylerees.com/2012/04/02/laravel-buying-time/">Laravel: Buying Time</a><br />
<strong>8.</strong> <a href="http://daylerees.com/2012/04/04/laravel-fluent-query-builder/">Laravel: Fluent Query Builder</a><br />
<strong>9.</strong> <a href="http://daylerees.com/2012/04/04/laravel-eloquent-orm/">Laravel: Eloquent ORM</a><br />
<strong>10.</strong> <a href="http://daylerees.com/2012/04/06/laravel-events/">Laravel: Events</a><br />
<strong>11.</strong> <a href="http://daylerees.com/2012/04/07/laravel-blade/">Laravel: Blade</a><br />
<strong>12.</strong> <a href="http://daylerees.com/2012/04/07/laravel-authentication/">Laravel: Authentication</a><br />
<strong>13.</strong> <a href="http://daylerees.com/2012/04/09/laravel-the-blog-tutorial/">Laravel: The Blog Tutorial</a><br />
<strong>14.</strong> <a href="http://daylerees.com/2012/04/09/laravel-unit-testing/">Laravel: Unit Testing</a><br />
<strong>15.</strong> <a href="http://daylerees.com/2012/04/10/laravel-caching/">Laravel: Caching</a></p>
<div>It took me about an hour to go through The Blog Tutorial and have my own little blog engine (I started from that section and just got the pieces that I needed as I went along, so i didn&#8217;t go through all sections, just what I needed to complete the tutorial). It was such a breeze to work with Laravel, I will be building my own apps on it soon!</div>
<div></div>
<div>Which framework are you using and how do you think Laravel could leverage your production? Leave your response in the comments below, also follow me on Twitter at <a href="http://twitter.com/msurguy" title="Msurguy twitter" target="_blank">http://twitter.com/msurguy</a></div>
<div></div>
<div class="alert yellow">Update #1! I&#8217;ve posted a list of Laravel extensions here :<a href="http://maxoffsky.com/code-blog/laravel-framework-extensions/" title="Laravel extensions and bundles">http://maxoffsky.com/code-blog/laravel-framework-extensions/</a></div>
<div class="alert yellow">Update # 2 : I&#8217;ve posted a list of real world projects done in Laravel, great way to learn from the source : <a href="http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/" title="Laravel real world applications" target="_blank">http://maxoffsky.com/code-blog/laravel-applications-to-learn-from/</a></div>
<p>Stay tuned to get more info about Laravel framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/laravel-framework-for-web-artisans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create thumbnails in Python</title>
		<link>http://maxoffsky.com/code-blog/create-thumbnails-in-python/</link>
		<comments>http://maxoffsky.com/code-blog/create-thumbnails-in-python/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 21:50:32 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1024</guid>
		<description><![CDATA[I needed a script that would take a folder of pictures, resize the pictures, save them in a new folder and also make square thumbnails with the picture centered in the thumbnail. This Python script that I wrote does this very task quickly and produces lean images ( for example resulting thumbnails are 8 Kb comparing to Photoshop that for some reason was giving me images that are 5-8 times as heavy, 45 Kb for a 65&#215;65 image) The script also produces HTML code that you can just cut and paste into a responsive gallery like http://tympanus.net/codrops/2011/09/20/responsive-image-gallery/ You need to have ...]]></description>
			<content:encoded><![CDATA[<p>I needed a script that would take a folder of pictures, resize the pictures, save them in a new folder and also make square thumbnails with the picture centered in the thumbnail. This Python script that I wrote does this very task quickly and produces lean images ( for example resulting thumbnails are 8 Kb comparing to Photoshop that for some reason was giving me images that are 5-8 times as heavy, 45 Kb for a 65&#215;65 image)</p>
<p>The script also produces HTML code that you can just cut and paste into a responsive gallery like <a href="http://tympanus.net/codrops/2011/09/20/responsive-image-gallery/" title="Responsive image gallery" target="_blank">http://tympanus.net/codrops/2011/09/20/responsive-image-gallery/</a></p>
<p>You need to have <a href="http://www.pythonware.com/products/pil/" title="Python Imaging Library" target="_blank">PIL</a> and <a href="http://www.python.org/" title="Python programming Language" target="_blank">Python</a> installed to run this script.<br />
Here&#8217;s the script:</p>
<pre class="brush: python; title: ; notranslate">

#!/usr/bin/env python
# encoding: utf-8
&quot;&quot;&quot;
resizeImages.py

This script takes a folder named 'photos', creates two folders to store resized photos and thumbnails

Created by Maksim Surguy on 2012-04-09.

http://maxoffsky.com

&quot;&quot;&quot;

import os
from PIL import Image

def ensure_dir(f):
    d = os.path.dirname(f)
    if not os.path.exists(d):
        os.makedirs(d)

def main():

    # set max image dimensions
    max_width = 640
    max_height = 400

    # set thumbnail size
    thumb_size = (65, 65)

    # optional - set the folder names if different names needed
    photo_source_folder = &quot;photos&quot;
    output_big_folder = &quot;pics&quot;
    output_thumb_folder = &quot;thumbs&quot;

    # do not edit below this line
    htmlsource = &quot;&quot;
    thumb_box = (0,0)

    source_folder = os.getcwd() + &quot;/&quot; + photo_source_folder + &quot;/&quot;
    current_folder = os.getcwd()+ &quot;/&quot;
    ensure_dir(current_folder+ output_big_folder + &quot;/&quot;)
    ensure_dir(current_folder+ output_thumb_folder + &quot;/&quot;)

    dirList = [fname for fname in os.listdir(source_folder)
                     if fname.lower().endswith(&quot;.png&quot;) or fname.lower().endswith(&quot;.jpg&quot;)]
    for fname in dirList:
        print &quot;Resizing %s&quot; % fname
        htmlsource += '&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;%s/%s&quot; data-large=&quot;%s/%s&quot; alt=&quot;image&quot; data-description=&quot;&amp;nbsp;&quot; /&gt;&lt;/a&gt;&lt;/li&gt;n'%(output_thumb_folder,fname,output_big_folder, fname)

        image = Image.open(source_folder + fname)
        if image.size[0] &lt;= 640 and image.size[1] &lt;= 400:
            image.save(current_folder + output_big_folder + &quot;/&quot; + fname, &quot;JPEG&quot;, quality = 92)
        else:
            image_big = image.copy()
            image_big.thumbnail((max_width, max_height), Image.ANTIALIAS)
            image_big.save(current_folder + output_big_folder + &quot;/&quot; + fname, &quot;JPEG&quot;, quality = 92)

        image.thumbnail(thumb_size, Image.ANTIALIAS)
        thumb_box = ( thumb_size[0]/2 - image.size[0]/2 ,  thumb_size[1]/2 - image.size[1]/2)
        thumbnail = Image.new (&quot;RGB&quot;, thumb_size)
        thumbnail.paste(image, thumb_box)
        thumbnail.save(current_folder + output_thumb_folder + &quot;/&quot; + fname, &quot;JPEG&quot;, quality = 90)

    open(&quot;output.html&quot;, &quot;w&quot;).write(htmlsource)

if __name__ == '__main__':
    main()
</pre>
<p>You can download the script here:<br />
<a class="button yellow" href="http://maxoffsky.com/word/wp-content/uploads/2012/04/resizeImages.py_.zip">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/create-thumbnails-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build mobile apps faster with PhoneGap</title>
		<link>http://maxoffsky.com/code-blog/build-mobile-apps-faster-with-phonegap/</link>
		<comments>http://maxoffsky.com/code-blog/build-mobile-apps-faster-with-phonegap/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 17:46:14 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[mobile apps]]></category>
		<category><![CDATA[mobile programming]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1017</guid>
		<description><![CDATA[Native mobile apps within hours, not weeks?  How so, you say? For example you need to built a company directory, a calculator, a webapp that uses GPS, camera or accelerator, just like a native app would do. Yes, it is possible with PhoneGap, a native app living on your smartphone and running HTML, CSS and JS app you have in mind. The framework to do that is here : http://phonegap.com/ PhoneGap works with iOS, Android, WebOS, Windows Phone, Blackberry, Symbian and Bada. Adobe named PhoneGap as technology of the year! Here is a tutorial to get you started : http://mobile.tutsplus.com/tutorials/phonegap/phonegap-development/ ...]]></description>
			<content:encoded><![CDATA[<p>Native mobile apps within hours, not weeks?  How so, you say?</p>
<p>For example you need to built a company directory, a calculator, a webapp that uses GPS, camera or accelerator, just like a native app would do.</p>
<p>Yes, it is possible with PhoneGap, a native app living on your smartphone and running HTML, CSS and JS app you have in mind.</p>
<p>The framework to do that is here :<br />
<a href="http://phonegap.com/" target="_blank">http://phonegap.com/</a></p>
<p>PhoneGap works with iOS, Android, WebOS, Windows Phone, Blackberry, Symbian and Bada.</p>
<p>Adobe <a href="http://blogs.adobe.com/conversations/2012/01/adobe-phonegap-named-2012-technology-of-the-year-by-infoworld-test-center.html" title="adobe names phonegap as technology of the year" target="_blank">named</a> PhoneGap as technology of the year!</p>
<p>Here is a tutorial to get you started :<br />
<a href="http://mobile.tutsplus.com/tutorials/phonegap/phonegap-development/" target="_blank">http://mobile.tutsplus.com/tutorials/phonegap/phonegap-development/</a></p>
<p>OR this one: <a href="http://net.tutsplus.com/tutorials/html-css-techniques/the-easiest-way-to-build-your-first-iphone-app/" taget="_blank">http://net.tutsplus.com/tutorials/html-css-techniques/the-easiest-way-to-build-your-first-iphone-app/</a></p>
<p>And two more tutorials about real world apps built with PhoneGap:<br />
<a href="http://coenraets.org/blog/2012/02/sample-mobile-app-with-backbone-js-and-phonegap/" target="_blank">http://coenraets.org/blog/2012/02/sample-mobile-app-with-backbone-js-and-phonegap/</a></p>
<p><a href="http://www.incandescentsoftware.com/jquery-mobile-with-backbone-and-phonegap/" target="_blank">http://www.incandescentsoftware.com/jquery-mobile-with-backbone-and-phonegap/</a></p>
<p>Have you built something on PhoneGap? Share in the comments.<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/build-mobile-apps-faster-with-phonegap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootstrap 2.0 web framework</title>
		<link>http://maxoffsky.com/code-blog/bootstrap-2-0-web-framework/</link>
		<comments>http://maxoffsky.com/code-blog/bootstrap-2-0-web-framework/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 16:09:25 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=1013</guid>
		<description><![CDATA[Responsive update to popular webapp framework - Twitter Bootstrap 2.0]]></description>
			<content:encoded><![CDATA[<p>Recently I posted about <a href="http://maxoffsky.com/web-craft/develop-a-web-application-with-a-great-foundation-twitters-bootstrap/" title="Develop a web application with a great foundation – Twitter’s Bootstrap." target="_blank">Twitter&#8217;s Boostrap framework</a> and how it is easy to use in developing webapps. It is pretty amazing what you can build with it and how quickly you can prototype apps with it.</p>
<p>Twitter Bootstrap team has released 2.0 of its popular webapp framework.</p>
<p>The updates to the framework include :</p>
<ul>
<li>responsive layout</li>
<li>smaller code</li>
<li>wizard to build-your-own (select features that you like and download what you need to use)</li>
<li>using LESS framework to quickly generate custom CSS</li>
</ul>
<div>There is a free PSD Template for Twitter Bootstrap UI designed by Ben Peck (found on <a href="http://dribbble.com/shots/484573-Free-Bootstrap-2-0-Psd-Template" title="Dribbble Twitter Bootstrap PSD" target="_blank">Dribbble</a>):</div>
<div><a href="http://www.bentdesignstudio.com/v2/2012/03/twitter-bootstrap-2-photoshop-template-psd/" title="Twitter Bootstrap PSD template" target="_blank">http://www.bentdesignstudio.com/v2/2012/03/twitter-bootstrap-2-photoshop-template-psd/</a></div>
<p>Also, some noteworthy extensions of the framewok include:</p>
<p>Bootstrap-style Datepicker    -   <a href="http://www.eyecon.ro/bootstrap-datepicker/" title="Twitter Bootstrap Datepicker" target="_blank"> http://www.eyecon.ro/bootstrap-datepicker/</a></p>
<p>Bootswatch &#8211; Bootstrap Color Themes : <a href="http://bootswatch.com/" title="Twitter Bootstrap color themes" target="_blank">http://bootswatch.com/</a></p>
<p>Have you built anything with Bootstrap lately?</p>
<p>Let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/bootstrap-2-0-web-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Search records from file</title>
		<link>http://maxoffsky.com/code-blog/php-search-records-from-file/</link>
		<comments>http://maxoffsky.com/code-blog/php-search-records-from-file/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 20:19:16 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[file import]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=970</guid>
		<description><![CDATA[The task: Write a PHP script to do the following: Read the class list in a text file, Store the records in some data structure that allows the user to search the records by ID, first name, or last name. The script provides the user with three options to input either the ID, first name, or last name, and displays the records that match the input. The script performs exact match for the ID and last name. Since the first name and middle name are stored together, the script should allow partial match for the first name. The partial match ...]]></description>
			<content:encoded><![CDATA[<p>The task:<br />
Write a PHP script to do the following: Read the class list in a text file, Store the records in some data structure that allows the user to search the records by ID, first name, or last name. The script provides the user with three options to input either the ID, first name, or last name, and displays the records that match the input. The script performs exact match for the ID and last name. Since the first name and middle name are stored together, the script should allow partial match for the first name. The partial match starts from the beginning. For example, if the input is &#8220;Jo&#8221;, all first names start with &#8220;Jo&#8221; should be listed out. If more than one record match the input, the script lists all of them.</p>
<p>You can see the script in action here:</p>
<p><a target="_blank" title="PHP file import search" href="http://maxoffsky.com/dev/php/search/">Non-Instant version.</a></p>
<p><a target="_blank" title="PHP ajax search instant" href="http://maxoffsky.com/dev/php/searchajax">Ajax-ed instant search version.</a></p>
<p>Here&#8217;s my quick solution(not optimized):</p>
<hr />
<p>Non &#8211; Ajax version :<br />
<strong>index.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!--?php &lt;br ?--&gt;
// Read file and search items from the file. By Maksim Surguy 2011.

// make a variable that holds a selected option
if(isset($_POST['field'])) $selectedoption = $_POST['field'];
else $selectedoption = &quot;fname&quot;;

// searchID looks through the given $array and for each item that matches $value in the ID field it prints a table row of data, also returning a count of found items.
function searchID(Array $array, $value)
    {
    $count = 0;
        foreach ($array as $subarray)
        {
            if (isset($subarray[0]) &amp;&amp; strtolower($subarray[0]) == strtolower($value)){
                 $count++;
              echo &quot;
$subarray[0]$subarray[2]$subarray[1]
n&quot;;
              }
            }
            return $count;
    }

// searchFirstName looks through the given $array and for each item that matches(even partially) $value in the first name field it prints a table row of data, also returning a count of found items.
function searchFirstName(Array $array, $value)
    {
        $count = 0;
        foreach ($array as $subarray)
        {
            if (isset($subarray[2]) &amp;&amp; stristr($subarray[2],$value)){
                 $count++;
              echo &quot;
$subarray[0]$subarray[2]$subarray[1]
n&quot;;
              }
         }
              return $count;
    }

// searchLastName searchID looks through the given $array and for each item that matches $value in the last name field it prints a table row of data, also returning a count of found items.
function searchLastName(Array $array, $value)
    {
        $count = 0;
        foreach ($array as $subarray)
        {
            if (isset($subarray[1]) &amp;&amp; strtolower($subarray[1]) == strtolower($value)){
                $count++;
              echo &quot;
$subarray[0]$subarray[2]$subarray[1]
n&quot;;
              }
        }
              return $count;
    }

?&gt;

&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;PHP - Read file and Search for data. Assignment 2 by Maksim Surguy&lt;/title&gt;
	&lt;link href=&quot;style.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; title=&quot;www&quot; type=&quot;text/css&quot; /&gt;
&lt;div id=&quot;wrapper&quot;&gt;
&lt;h2&gt;Maksim Surguy - Assignment 2&lt;/h2&gt;
&lt;div&gt;This is a PHP script that reads the class list from a file. The script provides a user an option to find a student record from the data structure that holds the records. User has an option to search by first (partial match), last name or by ID(exact match). If multiple records are found, the script outputs all of them.&lt;/div&gt;
&lt;form name=&quot;search&quot; method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot;&gt;
 Seach for: &lt;input name=&quot;find&quot; type=&quot;text&quot; /&gt; in
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='fname')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;fname&quot;&gt;First Name&lt;/option&gt;&lt;/select&gt;
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='lname')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;lname&quot;&gt;Last Name&lt;/option&gt;&lt;/select&gt;
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='id')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;id&quot;&gt;ID&lt;/option&gt;&lt;/select&gt;

 &lt;input name=&quot;searching&quot; value=&quot;yes&quot; type=&quot;hidden&quot; /&gt;
 &lt;input name=&quot;search&quot; value=&quot;Search&quot; type=&quot;submit&quot; /&gt;&lt;/form&gt;
 &lt;!--?php &lt;br ?--&gt; // read the file
 $file = fopen(&quot;classlist.txt&quot;, &quot;r&quot;);
 $filestring = &quot;&quot;;
 while (!feof($file)) {
 $tempstring = fgets($file);
 $filestring .= $tempstring.&quot;
&quot;;
 $line_of_text .= $tempstring;
 }
 // populate $students array - line by line
 $students = explode(&quot;n&quot;, $line_of_text);
 fclose($file);

 // separate the ID, Last name and First name
 foreach ($students as $key=&gt;$value){
 $students[$key] = explode(&quot;,&quot;, $value);
 }

 // if the user is searching, show the results
 if ($_POST[&quot;searching&quot;] ==&quot;yes&quot;)
 {
 $searchterm = $_POST['find'];
 if ($searchterm == &quot;&quot;)
 {
 echo &quot;
Please put a search term&quot;;
 exit;
 } else {

 // need to distinguish between three different options selected in the drop down menu and act upon them.
 switch ($_POST['field']) {
 case &quot;fname&quot;:
 echo &quot;
&lt;h3&gt;Searching by firstname ($searchterm)&lt;/h3&gt;
&quot;;
 echo(&quot;
n&quot;); echo &quot;Found &quot;.searchFirstName($students, $searchterm).&quot; entry/ies&quot;; echo &quot;
&lt;table border=&quot;1&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;60&quot; /&gt; &lt;col width=&quot;300&quot; /&gt; &lt;col width=&quot;240&quot; /&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;CWID&lt;/th&gt;
&lt;th&gt;First Name Middle Name&lt;/th&gt;
&lt;th&gt;Last Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&quot;;
 break;
 case &quot;lname&quot;:
 echo &quot;
&lt;h3&gt;Searching by last name ($searchterm)&lt;/h3&gt;
&quot;;
 echo(&quot;
n&quot;); echo &quot;Found &quot;.searchLastName($students, $searchterm).&quot; entry/ies&quot;; echo &quot;
&lt;table border=&quot;1&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;60&quot; /&gt; &lt;col width=&quot;300&quot; /&gt; &lt;col width=&quot;240&quot; /&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;CWID&lt;/th&gt;
&lt;th&gt;First Name Middle Name&lt;/th&gt;
&lt;th&gt;Last Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&quot;;
 break;
 case &quot;id&quot;:
 echo &quot;
&lt;h3&gt;Searching by ID ($searchterm)&lt;/h3&gt;
&quot;;
 echo(&quot;
n&quot;); echo &quot;Found &quot;.searchID($students, $searchterm).&quot; entry/ies&quot;; echo &quot;
&lt;table border=&quot;1&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;60&quot; /&gt; &lt;col width=&quot;300&quot; /&gt; &lt;col width=&quot;240&quot; /&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;CWID&lt;/th&gt;
&lt;th&gt;First Name Middle Name&lt;/th&gt;
&lt;th&gt;Last Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&quot;;
 break;
 }
 }

 }
 ?&gt;
&lt;div&gt;&lt;strong&gt;Data from the file&lt;/strong&gt;:
&lt;!--?php echo $filestring; ?--&gt;&lt;/div&gt;
&lt;h3&gt;CPSC431 - Database and Applications. 9/13/2011&lt;/h3&gt;
&lt;/div&gt;
</pre>
<hr />
<p>jQuery Version of instant search :<br />
<strong>index.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!--?php // make a variable that holds a selected option if(isset($_POST['field'])) $selectedoption = $_POST['field']; else $selectedoption = &quot;fname&quot;; ?--&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[

$(document).ready(function(){
$(&quot;#search_results&quot;).slideUp();
    $(&quot;#search_button&quot;).click(function(e){
        e.preventDefault();
        ajax_search();
    });
    $(&quot;#search_term&quot;).keyup(function(e){
        e.preventDefault();
        ajax_search();
    });

});
function ajax_search(){
  $(&quot;#search_results&quot;).show();
  var search_val=$(&quot;#search_term&quot;).val();
  var search_type=$(&quot;#searchtype&quot;).val();
  $.post(&quot;./find.php&quot;, {search_term : search_val, field : search_type}, function(data){
   if (data.length&gt;0){
     $(&quot;#search_results&quot;).html(data);
   }
  })
}
// ]]&gt;&lt;/script&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;PHP - Read file and Search for data - AJAX version. Assignment 2 by Maksim Surguy&lt;/title&gt;
	&lt;link href=&quot;style.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; title=&quot;www&quot; type=&quot;text/css&quot; /&gt;

&lt;div id=&quot;wrapper&quot;&gt;
&lt;h2&gt;Maksim Surguy - Assignment 2 - AJAX Version&lt;/h2&gt;
&lt;div&gt;This is a PHP script that reads the class list from a file. The script provides a user an option to find a student record from the data structure that holds the records. User has an option to search by first (partial match), last name or by ID(exact match). If multiple records are found, the script outputs all of them. AJAX version shows results on the fly.&lt;/div&gt;
&lt;form name=&quot;search&quot; id=&quot;searchform&quot; method=&quot;post&quot;&gt;
&lt;div&gt;Seach for: &lt;input name=&quot;search_term&quot; id=&quot;search_term&quot; type=&quot;text&quot; /&gt; in
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='fname')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;fname&quot;&gt;First Name&lt;/option&gt;&lt;/select&gt;
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='lname')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;lname&quot;&gt;Last Name&lt;/option&gt;&lt;/select&gt;
&lt;select name=&quot;field&quot;&gt; &lt;option php=&quot;&quot; if=&quot;&quot; selectedoption=&quot;='id')&quot; echo=&quot;&quot; selected=&quot;selected&quot;&gt;VALUE=&quot;id&quot;&gt;ID&lt;/option&gt;&lt;/select&gt;

 &lt;input name=&quot;searching&quot; value=&quot;yes&quot; type=&quot;hidden&quot; /&gt;
 &lt;input id=&quot;search_button&quot; name=&quot;search&quot; value=&quot;search&quot; type=&quot;submit&quot; /&gt;&lt;/div&gt;
&lt;/form&gt;

&lt;hr /&gt;

&lt;div id=&quot;search_results&quot;&gt;&lt;/div&gt;
&lt;h3&gt;CPSC431 - Database and Applications. 9/13/2011&lt;/h3&gt;
The jQuery and PHP integration was inspired by : &lt;a href=&quot;http://www.ibm.com/developerworks/opensource/library/os-php-jquery-ajax/&quot;&gt;IBM OpenSource&lt;/a&gt;&lt;/div&gt;
</pre>
<p>find.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--?php &lt;br ?--&gt;
function searchID(Array $array, $value)
    {
        $idresult = &quot;&quot;;
        foreach ($array as $subarray){
            if (isset($subarray[0]) &amp;&amp; (substr($subarray[0], 0, strlen($value)) == $value) &amp;&amp; $value!=&quot;&quot;)
            { $idresult .= $subarray[0].&quot; &quot;.$subarray[2].&quot; &quot;.$subarray[1].&quot;
&quot;;   }

            }
            return $idresult;
    }

// searchFirstName looks through the given $array and for each item that matches(even partially)
// $value in the first name field it prints a table row of data, also returning a count of found items.
function searchFirstName(Array $array, $value)
    {
        $firstresult = &quot;&quot;;
        foreach ($array as $subarray)
        {
            if (isset($subarray[2]) &amp;&amp; stristr($subarray[2],$value) &amp;&amp; $value!=&quot;&quot;){
              $firstresult .= $subarray[0].&quot; &quot;.$subarray[2].&quot; &quot;.$subarray[1].&quot;
&quot;;
              }
         }
              return $firstresult;
    }

function searchLastName(Array $array, $value){
        $lastresult = '';
        foreach ($array as $subarray){
            if (isset($subarray[1]) &amp;&amp; stristr($subarray[1],$value) &amp;&amp; $value!=&quot;&quot;) { $lastresult .= $subarray[0].&quot; &quot;.$subarray[2].&quot; &quot;.$subarray[1].&quot;
&quot;;}
              } return $lastresult;
}

$file = fopen(&quot;classlist.txt&quot;, &quot;r&quot;);
$filestring = &quot;&quot;;
while (!feof($file)) {
    $tempstring = fgets($file);
    $filestring .= $tempstring.&quot;
&quot;;
    $line_of_text .= $tempstring;
}
// populate $students array - line by line
$students = explode(&quot;n&quot;, $line_of_text);
fclose($file);

// separate the ID, Last name and First name
foreach ($students as $key=&gt;$value){
    $students[$key] = explode(&quot;,&quot;, $value);
}

$term = strip_tags(substr($_POST['search_term'],0, 100));

$string = '';
if ($term != &quot;&quot; &amp;&amp; $term != &quot; &quot;){
switch ($_POST['field']) {
                case &quot;fname&quot;:
                       $string .= searchFirstName($students, $term);
                    break;
                case &quot;lname&quot;:
                    $string .= searchLastName($students, $term);
                    break;
                   case &quot;id&quot;:
                    $string .= searchID($students, $term);
                    break;
            }
}
if ($string != &quot;&quot;) echo $string;
else echo '&lt;div&gt;No results found&lt;/div&gt;';

?&gt;
</pre>
<p>You can download complete source code below:</p>
<p><a class="button yellow" href="http://maxoffsky.com/word/wp-content/uploads/2012/03/search.zip">Download Non-Ajax version</a></p>
<p><a class="button yellow" href="http://maxoffsky.com/word/wp-content/uploads/2012/03/searchajax.zip">Download Ajax version</a></p>
<p>See my other PHP code tutorials here :<br />
<a class="button green" href="http://maxoffsky.com/tag/php/">All posts tagged with &#8220;PHP&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/php-search-records-from-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 ways to get paid on the spot</title>
		<link>http://maxoffsky.com/maxoffsky-blog/2-ways-to-get-paid-on-the-spot/</link>
		<comments>http://maxoffsky.com/maxoffsky-blog/2-ways-to-get-paid-on-the-spot/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 16:58:49 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[cash]]></category>
		<category><![CDATA[credit cards]]></category>
		<category><![CDATA[finance]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[payments]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[square]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=902</guid>
		<description><![CDATA[Are you a photographer, performer, musician, or someone who provides paid services? Would you like to take payments on the spot? This services are for you.]]></description>
			<content:encoded><![CDATA[<h2>Are you a photographer, performer, musician, or someone who provides paid services? How do you take payments from customers?</h2>
<p>Today anyone with a smartphone can take payments on the spot.</p>
<p>There are two major companies that provide you with a free card reader and an app to take various payments: all major credit cards or even checks.</p>
<p>This service is available from <a target="_blank" href="http://squareup.com">Square</a> and <a target="_blank" href="https://www.paypal.com/webapps/mpp/credit-card-reader">Paypal</a>.</p>
<p>I provide a small comparison chart for you so you know the difference between the two, but overall they are very similar in functionality and features:</p>
<p><a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/vs.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/vs.jpg" alt="" title="vs" class="aligncenter size-full wp-image-906" height="194" width="620" /></a></p>
<div class="one-half">
<p>A solution from Square:</p>
<ul>
<li>Accepts : Visa, MasterCard, American Express, Discover.</li>
<li>Rates: 2.75% off each transaction</li>
<li>Funds deposited next day</li>
<li>Free Card Reader.</li>
<li>Works with iOS and Android</li>
<li>Where to get it: <a target="_blank" title="Square accept payments anywhere" href="https://squareup.com/">http://squareup.com</a></li>
</ul>
</div>
<div class="one-half column-last">
<p>A solution from Paypal:</p>
<ul>
<li>Accepts: Visa, MasterCard, American Express, Discover<br />
<span style="text-decoration: underline;">Also accepts checks!</span></li>
<li>Rates: 2.7% off each transaction, free for taking checks and issuing invoices</li>
<li>Funds get deposited same day</li>
<li>Free Card Reader.</li>
<li>Works with iOS only (Android App in the making)</li>
<li>Where to get it :<br />
<a target="_blank" title="Paypal mobile payments" href="https://www.paypal.com/webapps/mpp/credit-card-reader">https://www.paypal.com/webapps/mpp/credit-card-reader</a></li>
</ul>
</div>
<p>Like this post ? Share it with your friends by using the share buttons below!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/maxoffsky-blog/2-ways-to-get-paid-on-the-spot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS App Icon Photoshop template</title>
		<link>http://maxoffsky.com/code-blog/ios-app-icon-photoshop-template/</link>
		<comments>http://maxoffsky.com/code-blog/ios-app-icon-photoshop-template/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 07:45:34 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[bubble scramble]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=871</guid>
		<description><![CDATA[As you might know, I&#8217;ve recently released a game for iOS, it is called &#8220;Bubble Scramble Lite&#8221;  and I&#8217;ve learned quite a bit while developing the game for iPhone / iPod. One of the things that I found incredibly useful and necessary was a way to create icons for my application quickly and efficiently. Otherwise it becomes a pain to create the different size icons manually. According to Apple&#8217;s guidelines there are many different sizes of icons needed for your application: Description Size for iPhone and iPod touch (in pixels) Size for high-resolution iPhone and iPod touch (in pixels) Size for ...]]></description>
			<content:encoded><![CDATA[<p>As you might know, I&#8217;ve recently released a game for iOS, it is called <a href="http://itunes.apple.com/us/app/bubble-scramble-lite/id505358065?mt=8" title="Bubble Scramble Lite" target="_blank">&#8220;Bubble Scramble Lite&#8221; </a> and I&#8217;ve learned quite a bit while developing the game for iPhone / iPod.</p>
<p>One of the things that I found incredibly useful and necessary was a way to create icons for my application quickly and efficiently. Otherwise it becomes a pain to create the different size icons manually.</p>
<p>According to Apple&#8217;s guidelines there are many different sizes of icons needed for your application:</p>
<table border="0" cellpadding="2" cellspacing="0">
<tbody>
<tr>
<th scope="col">Description</th>
<th scope="col">Size for iPhone and iPod touch (in pixels)</th>
<th scope="col">Size for high-resolution iPhone and iPod touch (in pixels)</th>
<th scope="col">Size for iPad (in pixels)</th>
<th scope="col">Size for high-resolution iPad (in pixels)</th>
</tr>
<tr>
<td scope="row">Application icon (<strong>required</strong> for all apps)</td>
<td>57&#215;57</td>
<td>114&#215;114</td>
<td>72&#215;72</td>
<td>144&#215;144</td>
</tr>
<tr>
<td scope="row">App icon for the App Store (<strong>required</strong> for all apps)</td>
<td>512&#215;512</td>
<td>1024&#215;1024</td>
<td>512&#215;512</td>
<td>1024&#215;1024</td>
</tr>
</tbody>
</table>
<div></div>
<p>I&#8217;ve found a .psd template (on <a href="http://nfarina.com/post/1185879730/ios-icon-template-for-perfectionists" title="App template" target="_blank">Nick Farina&#8217;s blog</a>) and modified it to suit the needs of creating all application icons quickly in Adobe Photoshop.</p>
<p>If you are familiar with working in Adobe Photoshop, feel free to:</p>
<p><a class="button yellow" href="http://maxoffsky.com/word/wp-content/uploads/2012/03/iOS-icon-template-by-Maxoffsky.zip">Download the template here</a></p>
<p>Otherwise please follow the instructions below:</p>
<p>The process of making the icons with this template is quite simple, open it up, modify the smart object, save the modified file and go back to your template seeing the changes taking place, then export the document for Web/Devices, save and see how it creates the files automatically.</p>
<p>The template has to be worked the following way:</p>
<p>1) Open up the template in Adobe Photoshop</p>
<p style="text-align: center;"><a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/iOS-icon-template.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/iOS-icon-template-300x251.jpg" title="iOS icon template" class="size-medium wp-image-880 aligncenter" height="251" width="300" /></a></p>
<p>2) Change the artwork (smart object) by double clicking on the Artwork under &#8220;512 Pixels&#8221; folder.<a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/ChangeImage.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/ChangeImage-159x300.jpg" alt="" title="Change Smart Object" class="aligncenter size-medium wp-image-872" height="300" width="159" /></a></p>
<p>3) Draw whatever you want your icon to be, then save the file by pressing File -&gt; Save. Close this file and you will see the changes in your template document.<a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/draw.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/draw-294x300.jpg" alt="" title="draw" class="aligncenter size-medium wp-image-875" height="300" width="294" /></a></p>
<p>4) The template has been changed by changing just one object.<a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/templateChanged.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/templateChanged-300x233.jpg" alt="" title="templateChanged" class="aligncenter size-medium wp-image-879" height="233" width="300" /></a></p>
<p>5) Now if you like how it looks, you are ready to export all necessary icons into your App. Go to File -&gt; Save for Web and Devices.<a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/Save.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/Save-237x300.jpg" alt="" title="Save" class="aligncenter size-medium wp-image-878" height="300" width="237" /></a></p>
<p>6) In the opened window click Save, then Save again.</p>
<p>7) Now if you go to the folder where you saved your export files, you will see this structure:</p>
<p>Icon-72.png<br />
Icon-Small@2x.png<br />
Icon_iPadHD.png<br />
Icon-Small-50.png<br />
Icon.png<br />
ItunesArtworkHD.png<br />
iTunesArtwork.png<br />
Icon-Small.png<br />
Icon@2x.png</p>
<p>9) You will have the files all with proper sizes ready to be imported into your xCode project.<a href="http://maxoffsky.com/word/wp-content/uploads/2012/03/done.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/03/done.jpg" alt="" title="done" class="aligncenter size-full wp-image-874" height="145" width="184" /></a></p>
<hr />
<p>The PSD template is available for download:<br />
<a class="button yellow" href="http://maxoffsky.com/word/wp-content/uploads/2012/03/iOS-icon-template-by-Maxoffsky.zip">Download the template here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/ios-app-icon-photoshop-template/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Valentine&#8217;s wallpaper 2012 : I am my beloved&#8217;s</title>
		<link>http://maxoffsky.com/design-blog/valentines-wallpaper-2012-i-am-my-beloveds/</link>
		<comments>http://maxoffsky.com/design-blog/valentines-wallpaper-2012-i-am-my-beloveds/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 23:00:48 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Design Blog]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[valentine]]></category>
		<category><![CDATA[Wallpaper]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=756</guid>
		<description><![CDATA[For those who love.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres. Love never fails. (The Bible, 1 Cor 13:4-8)</p></blockquote>
<p>What is love? Is it a feeling or a choice? Is it selfish or selfless? What are the boldest examples of love that you know?</p>
<p>I am releasing this wallpaper to everyone to share with their love or to put it up as a reminder about the loved one. Treasure your love and make it last.</p>
<p>You can download it in different resolutions below:</p>
<div class="tabber">
<ul class="tabs">
<li><a href="#">Light</a></li>
<li><a href="#">Dark</a></li>
</ul>
<div class="panes">
<div class="pane"><a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1024x768.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1024x768-150x150.jpg" alt="" title="iammybelovedsWhite1024x768" width="150" height="150" class="alignleft size-thumbnail wp-image-759" /></a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1024x768.jpg">Download 1024&#215;768 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1280x768.jpg">Download 1280&#215;768 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1280x800.jpg">Download 1280&#215;800 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1440x900.jpg">Download 1440&#215;900 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1600x1200.jpg">Download 1600&#215;1200 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhite1920x1200.jpg">Download 1920&#215;1200 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsWhiteIPhone4.jpg">Download iPhone 4 Resolution</a></div>
<div class="pane"><a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1024x768.jpg"><img src="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1024x768-150x150.jpg" alt="" title="iammybelovedsBlack1024x768" width="150" height="150" class="alignleft size-thumbnail wp-image-767" /></a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1024x768.jpg">Download 1024&#215;768 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1280x768.jpg">Download 1280&#215;768 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1280x800.jpg">Download 1280&#215;800 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1440x900.jpg">Download 1440&#215;900 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1600x1200.jpg">Download 1600&#215;1200 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlack1920x1200.jpg">Download 1920&#215;1200 Resolution</a><br />
<a href="http://maxoffsky.com/word/wp-content/uploads/2012/02/iammybelovedsBlackIPhone4.jpg">Download iPhone 4 Resolution</a></div>
</div>
</div>
<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 /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/StillImage" property="dct:title" rel="dct:type">I am my beloved&#39;s</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="maxoffsky.com" property="cc:attributionName" rel="cc:attributionURL">Maksim Surguy</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="http://maxoffsky.com/design-blog/valentines-wallpaper-2012-i-am-my-beloveds/" rel="dct:source">maxoffsky.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/design-blog/valentines-wallpaper-2012-i-am-my-beloveds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SkillShare</title>
		<link>http://maxoffsky.com/link-box/skillshare/</link>
		<comments>http://maxoffsky.com/link-box/skillshare/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 00:24:36 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Link box]]></category>
		<category><![CDATA[get paid]]></category>
		<category><![CDATA[share skills]]></category>
		<category><![CDATA[talent]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=726</guid>
		<description><![CDATA[Share skills by providing real world classes http://www.skillshare.com/ &#160;]]></description>
			<content:encoded><![CDATA[<p>Share skills by providing real world classes</p>
<p><a href="http://www.skillshare.com/" target="_blank">http://www.skillshare.com/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/link-box/skillshare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Develop a web application with a great foundation &#8211; Twitter&#8217;s Bootstrap.</title>
		<link>http://maxoffsky.com/web-craft/develop-a-web-application-with-a-great-foundation-twitters-bootstrap/</link>
		<comments>http://maxoffsky.com/web-craft/develop-a-web-application-with-a-great-foundation-twitters-bootstrap/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 01:27:25 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Web Craft]]></category>
		<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[Foundation]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Webapp]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=699</guid>
		<description><![CDATA[Learn about a great Web development framework - Twitter's Bootstrap.]]></description>
			<content:encoded><![CDATA[<hr />
<p>What is <a href="http://twitter.github.com/bootstrap/" title="Twitter's bootstrap" target="_blank">Bootstrap</a>?</p>
<p><a href="http://twitter.github.com/bootstrap/" title="Twitter's bootstrap" target="_blank">Bootstrap</a> is a toolkit from Twitter designed to kickstart development of webapps and sites.<br />
It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.</p>
<p><a href="http://twitter.github.com/bootstrap/" title="Twitter's bootstrap" target="_blank">Bootstrap</a> is <a href="http://twitter.github.com/bootstrap/#less" title="Read about using Bootstrap with Less">built with Less</a> and was designed to work out of the gate with modern browsers in mind.</p>
<p><a href="http://twitter.github.com/bootstrap/" title="Twitter's bootstrap" target="_blank">Bootstrap</a> provides and makes available to use commonly used elements of Web Design such as :</p>
<ul>
<li>Forms</li>
<li>Buttons</li>
<li>Grid layout</li>
<li>Buttons</li>
<li>Tables</li>
<li>Navigation</li>
<li>Typography</li>
</ul>
<p>and lots of other useful pieces that you might need while developing a web application.</p>
<p>You can take a look at Bootstrap and what elements it provides here :<br />
<a href="http://twitter.github.com/bootstrap/" title="Twitter's bootstrap" target="_blank">http://twitter.github.com/bootstrap</a></p>
<p>Bootstrap is also on GitHub and please be sure to read their FAQ and <a href="https://github.com/twitter/bootstrap/wiki/Roadmap" title="Bootstrap Roadmap - responsive is coming in 2.0" target="_blank">Roadmap</a>.</p>
<p>One of the upcoming features that excite me the most &#8211; responsive HTML 5 layout.</p>
<p>Tools that are helpful when creating with Twitter&#8217;s Bootstrap:</p>
<p><a href="http://www.martinbean.co.uk/bootstrap-generator/" target="_blank">http://www.martinbean.co.uk/<wbr>bootstrap-generator/</wbr></a></p>
<p><a href="http://makeusabrew.github.com/bootbox/demo/">http://makeusabrew.github.com/bootbox/demo/</a></p>
<p>There are also WordPress Themes that use Bootstrap as a base and also plugins that provide some of the Bootstrap&#8217;s functionality.</p>
<p>Here&#8217;s a plugin for wordpress that implements Bootstrap CSS :</p>
<p><a href="http://wordpress.org/extend/plugins/wordpress-bootstrap-css/" target="_blank">http://wordpress.org/extend/plugins/wordpress-bootstrap-css/</a></p>
<hr />
<p>Websites that use Bootstrap Framework :</p>
<p>Code Nasa &#8211; open source Nasa code for software engineers:<br />
<a target="_blank" title="Code Nasa Open Source" href="http://code.nasa.gov/">http://code.nasa.gov/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/web-craft/develop-a-web-application-with-a-great-foundation-twitters-bootstrap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is a Windows 7 handset worth it?</title>
		<link>http://maxoffsky.com/tech-blog/is-a-windows-7-handset-worth-it/</link>
		<comments>http://maxoffsky.com/tech-blog/is-a-windows-7-handset-worth-it/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 16:02:12 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Tech Blog]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=549</guid>
		<description><![CDATA[A lot of people took to the Windows 7 phone market when it initially launched, but nowhere near the amount who leapt onto the iPhone bandwagon, laughing at other platforms as iOS became the most popular destination for applications on the market. However, there are remains a dedicated userbase, so let&#8217;s take a look at the statistics. Gartner research states that in Q3 2009, 7.9% of smartphone users were using a Microsoft operating system on their smartphone. However, that number dropped to 2.8% in 2010, and 1.5% in 2011. That&#8217;s a pretty large drop in user numbers. But it&#8217;s worth ...]]></description>
			<content:encoded><![CDATA[<p>A lot of people took to the Windows 7 phone market when it initially launched, but nowhere near the amount who leapt onto the iPhone bandwagon, laughing at other platforms as iOS became the most popular destination for applications on the market. However, there are remains a dedicated userbase, so let&#8217;s take a look at the statistics.</p>
<p><span id="more-549"></span></p>
<p>Gartner research states that in Q3 2009, 7.9% of smartphone users were using a Microsoft operating system on their smartphone. However, that number dropped to 2.8% in 2010, and 1.5% in 2011. That&#8217;s a pretty large drop in user numbers.</p>
<p>But it&#8217;s worth bearing in mind that 2010 was the launch year of the Windows 7 Phone. But despite that, it&#8217;s still a good 5% drop or more to a market share of almost nothing. So what are Windows doing wrong?</p>
<p>Nothing much, is the answer &#8211; it&#8217;s just gone up against two operating systems who are dominant for different reasons With Android, it&#8217;s on your phone whether you&#8217;ve got a brand new Samsung from <a href="http://www.o2.co.uk/">O2</a> or a hand-me-down Motorola. It&#8217;s everywhere.</p>
<p>iOS on the other hand has the Apple style going for it. Ever since the iPod, Apple products have been the geek fashionista&#8217;s hardware of choice, and that will be the case for many years to come. Add to that iOS&#8217; dominance of mobile gaming, and its&#8217; difficult to figure out where your platform is going to fit in.</p>
<p>It&#8217;s a shame, because Windows 7 phones are actually very clever beasts. With a sound GUI, nice apps and often, powerful hardware behind it, Windows 7 handsets are great phones for people who want something a little different. But whether they&#8217;ll still be on the market in another five years is debatable, and the same goes for RIM and Blackberry handsets &#8211; the world is hunting for the best and the brightest, and those failing to shine out of the starting gate or keeping up with newer platforms are swiftly going to fall.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/tech-blog/is-a-windows-7-handset-worth-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP script create thumbnails for images</title>
		<link>http://maxoffsky.com/code-blog/php-script-create-thumbnails-for-images/</link>
		<comments>http://maxoffsky.com/code-blog/php-script-create-thumbnails-for-images/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 21:36:48 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[image resize]]></category>
		<category><![CDATA[image resize script]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=985</guid>
		<description><![CDATA[The task: Write a PHP script to get images from database (database table &#8220;PHOTOS&#8221;), resize them and output them in the browser. Here&#8217;s my quick solution(not optimized): &#60;hr /&#62; thumb.php &#60;hr /&#62; functions.php]]></description>
			<content:encoded><![CDATA[<p>The task:<br />
Write a PHP script to get images from database (database table &#8220;PHOTOS&#8221;), resize them and output them in the browser.</p>
<p>Here&#8217;s my quick solution(not optimized):</p>
<p>&lt;hr /&gt;<br />
<strong>thumb.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require_once('dbconfig.php'); // file that stores our database connection variables
require_once('functions.php'); // resize script
try {
if (!isset($_GET['id'])) {
throw new Exception('ID not specified');
}
$id = (int) $_GET['id'];
if ($id &lt;= 0) {
throw new Exception('Invalid ID specified');
}

$query  = sprintf('select * from PHOTOS where id = %d', $id);
$result = mysql_query($query, $db);
if (mysql_num_rows($result) == 0) {
throw new Exception('Image with specified ID not found');
}
$image = mysql_fetch_array($result);
}
catch (Exception $ex) {
header('HTTP/1.0 404 Not Found');
exit;
}
header('Content-type: ' . $image['mime_type']);

$width = 140;
$height = 140;

$folder = 'scripts';
$conflen=strlen($folder);

$B=substr(__FILE__,0,strrpos(__FILE__,'/'));
$A=substr($_SERVER['DOCUMENT_ROOT'], strrpos($_SERVER['DOCUMENT_ROOT'], $_SERVER['PHP_SELF']));
$C=substr($B,strlen($A));
$posconf=strlen($C)-$conflen-1;
$D=substr($C,1,$posconf);
if($_SERVER['SERVER_PORT'] == &quot;8888&quot;){
$host='http://'.$_SERVER['SERVER_NAME'].':8888/'.$D;}
else {
$host='http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];}

// Get new dimensions
list($width_orig, $height_orig) = getimagesize($host.$folder.&quot;/view.php?id=$id&quot;);

$ratio_orig = $width_orig/$height_orig;

if ($width/$height &gt; $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromstring($image['photodata']);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
mysql_free_result($result);
?&gt;
</pre>
<p>&lt;hr /&gt;</p>
<p><strong>functions.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function make_thumb($src,$desired_width)
{
/* read the source image */
$source_image = imagecreatefromstring($src);
$width = imagesx($source_image);
$height = imagesy($source_image);

/* find the &quot;desired height&quot; of this thumbnail, relative to the desired width  */
$desired_height = floor($height*($desired_width/$width));

/* create a new, &quot;virtual&quot; image */
$virtual_image = imagecreatetruecolor($desired_width,$desired_height);

/* copy source image at a resized size */
imagecopyresized($virtual_image,$source_image,0,0,0,0,$desired_width,$desired_height,$width,$height);
//header('Content-Type: image/jpeg');
imagejpeg($virtual_image, NULL, 100);
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/php-script-create-thumbnails-for-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 Free Photoshop Alternatives</title>
		<link>http://maxoffsky.com/maxoffsky-blog/4-free-photoshop-alternatives/</link>
		<comments>http://maxoffsky.com/maxoffsky-blog/4-free-photoshop-alternatives/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 18:51:53 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[alternative]]></category>
		<category><![CDATA[graphics editor]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=529</guid>
		<description><![CDATA[Need to create or edit images ? These 4 free Photoshop alternatives will help you.]]></description>
			<content:encoded><![CDATA[<p>People often ask me if there is a free alternative for Adobe Photoshop to edit or create images. My answer is that there are quite a few.</p>
<p>Well, here I list my four picks for Photoshop alternative, all free and all still powerful for editing images:</p>
<p><strong>For Mac OS :</strong></p>
<p>GIMP - <a title="GIMP" href="http://www.gimp.org/" target="_blank">http://www.gimp.org/</a></p>
<div id="attachment_534" class="wp-caption alignleft" style="width: 160px"><a href="http://maxoffsky.com/word/wp-content/uploads/2011/12/Gimp_screenshot.png"><img class="size-thumbnail wp-image-534" title="Gimp screenshot" src="http://maxoffsky.com/word/wp-content/uploads/2011/12/Gimp_screenshot-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">GIMP</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>For Windows:</strong></p>
<p>Paint.NET   - <a title="Paint.NET" href="http://www.getpaint.net/index.html" target="_blank">http://www.getpaint.net/index.html</a></p>
<div id="attachment_533" class="wp-caption alignleft" style="width: 160px"><a href="http://maxoffsky.com/word/wp-content/uploads/2011/12/paintNet.jpg"><img class="size-thumbnail wp-image-533" title="paint.Net" src="http://maxoffsky.com/word/wp-content/uploads/2011/12/paintNet-150x150.jpg" alt="Paint.NET" width="150" height="150" /></a><p class="wp-caption-text">Paint.NET</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Web Based (work on Mac or Windows):</strong></p>
<p>Aviary  has two editors :</p>
<p>Feather - <a title="Aviary Feather" href="http://www.aviary.com/tools/feather" target="_blank">http://www.aviary.com/tools/feather</a></p>
<p>Advanced Image Editor &#8211; Phoenix &#8211; <a title="Aviary Phoenix" href="http://www.aviary.com/tools/image-editor" target="_blank">http://www.aviary.com/tools/image-editor</a></p>
<div id="attachment_532" class="wp-caption alignleft" style="width: 160px"><a href="http://maxoffsky.com/word/wp-content/uploads/2011/12/phoenix.jpg"><img class="size-thumbnail wp-image-532" title="Aviary phoenix" src="http://maxoffsky.com/word/wp-content/uploads/2011/12/phoenix-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Aviary Phoenix</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Picnik - <a title="Picnik" href="http://www.picnik.com" target="_blank">http://www.picnik.com</a><a href="http://maxoffsky.com/word/wp-content/uploads/2011/12/picnick.jpg"><img class="alignleft size-thumbnail wp-image-531" title="picnick" src="http://maxoffsky.com/word/wp-content/uploads/2011/12/picnick-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/maxoffsky-blog/4-free-photoshop-alternatives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thanksgiving week &#8211; 2011</title>
		<link>http://maxoffsky.com/belief-blog/thanksgiving-week-2011/</link>
		<comments>http://maxoffsky.com/belief-blog/thanksgiving-week-2011/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 04:56:02 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Belief blog]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[prayer]]></category>
		<category><![CDATA[thanks]]></category>
		<category><![CDATA[thanksgiving]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=512</guid>
		<description><![CDATA[Thanksgiving prayer - 2011]]></description>
			<content:encoded><![CDATA[<p data-ft="{&quot;type&quot;:1}">Hope you would join me in this prayer this week (Comment with &#8220;Amen&#8221; if you do):</p>
<p data-ft="{&quot;type&quot;:1}">
Thank You Lord! Thank You for all the people in our lives, all of them are neccessary for us to shape us into who we are.<br />
Thank You for so many blessings that You graciously provide for us, please forgive us when we forget how much we have in You.<br />
Thank You for Your precious Son that reconciled us with You, oh Holy God!<br />
Thank You for Your Truth and Your Wisdom that propagates through every fiber of the Universe.<br />
Thank You for creating this beautiful world that we are able to sense and stand in awe seeing Your design.<br />
Thank You for letting us know You, thank You for accepting us no matter the race, color of skin and our past.<br />
Thank You for giving us a mind that is able to wonder, to be creative and to be impressed by You God.<br />
Thank You for allowing us to love others, and thank you for Your Love that is selfless and perfect.<br />
Thank You for not forcing us to believe in You but rather have a choice, thank You for always being there willing to take us in no matter how far we walk away from you at some point in our life.<br />
Thank You for being a God of the Universe, Creator of all, and Our Father!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/belief-blog/thanksgiving-week-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fearfully and wonderfully made</title>
		<link>http://maxoffsky.com/maxoffsky-blog/fearfully-and-wonderfully-made/</link>
		<comments>http://maxoffsky.com/maxoffsky-blog/fearfully-and-wonderfully-made/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 03:27:49 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[embryo]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=500</guid>
		<description><![CDATA[This is too fascinating! Wow! A video that captured development of human embryo following from conception to birth. http://www.ted.com/talks/alexander_tsiaras_conception_to_birth_visualized.html Psalm 139:14 &#8220;I praise you because I am fearfully and wonderfully made; your works are wonderful, I know that full well.&#8221;]]></description>
			<content:encoded><![CDATA[<p>This is too fascinating! Wow!</p>
<p>A video that captured development of human embryo following from conception to birth.</p>
<div>
<div></div>
<div><a href="http://www.ted.com/talks/alexander_tsiaras_conception_to_birth_visualized.html" target="_blank">http://www.ted.com/talks/<wbr>alexander_tsiaras_conception_<wbr>to_birth_visualized.html</wbr></wbr></a></div>
<div>
<div><em>Psalm 139:14 &#8220;I praise you because I am fearfully and wonderfully made;</em><em> your works are wonderful, </em><em>I know that full well.&#8221;</em></div>
</div>
</div>
<p><object width="526" height="374" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="bgColor" value="#ffffff" /><param name="flashvars" value="vu=http://video.ted.com/talk/stream/2010P/Blank/AlexanderTsiaras_2010P-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/AlexanderTsiaras_2010P-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1270&amp;lang=eng&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=alexander_tsiaras_conception_to_birth_visualized;year=2010;theme=tales_of_invention;theme=medicine_without_borders;theme=art_unusual;event=INK+Conference;tag=Design;tag=Science;tag=medical+research;tag=visualizations;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><param name="src" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" /><param name="pluginspace" value="http://www.macromedia.com/go/getflashplayer" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="526" height="374" type="application/x-shockwave-flash" src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" bgColor="#ffffff" flashvars="vu=http://video.ted.com/talk/stream/2010P/Blank/AlexanderTsiaras_2010P-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/AlexanderTsiaras_2010P-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1270&amp;lang=eng&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=alexander_tsiaras_conception_to_birth_visualized;year=2010;theme=tales_of_invention;theme=medicine_without_borders;theme=art_unusual;event=INK+Conference;tag=Design;tag=Science;tag=medical+research;tag=visualizations;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" pluginspace="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" allowscriptaccess="always" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/maxoffsky-blog/fearfully-and-wonderfully-made/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming tutorials</title>
		<link>http://maxoffsky.com/code-blog/programming-tutorials/</link>
		<comments>http://maxoffsky.com/code-blog/programming-tutorials/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 03:21:52 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Code Blog]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=467</guid>
		<description><![CDATA[Anybody can learn programming ! This guy does an amazing job teaching most popular programming languages, all for free! Check this out:]]></description>
			<content:encoded><![CDATA[<p>Anybody can learn programming !</p>
<p>This guy does an amazing job teaching most popular programming languages, all for free!</p>
<p>Check this out:</p>
<p><iframe src="http://www.youtube.com/embed/k3dJKtQmyd0" frameborder="0" width="460" height="300"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/code-blog/programming-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google flight search is awesome!</title>
		<link>http://maxoffsky.com/link-box/google-flight-search-is-awesome/</link>
		<comments>http://maxoffsky.com/link-box/google-flight-search-is-awesome/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 01:10:00 +0000</pubDate>
		<dc:creator>maxoffsky</dc:creator>
				<category><![CDATA[Link box]]></category>
		<category><![CDATA[flight]]></category>
		<category><![CDATA[flight search]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[itasoftware]]></category>

		<guid isPermaLink="false">http://maxoffsky.com/?p=456</guid>
		<description><![CDATA[Google Flight Search is a tool to shop for flights and fares at a speed of thought.]]></description>
			<content:encoded><![CDATA[<p>Google Flight Search is a tool to shop for flights and fares at a speed of thought.</p>
<p><span id="more-456"></span></p>
<p>I remember a couple years ago I was recommending all my friends a flight search on a small website called itasoftware.com. It would quickly output the best prices for fares even when you select many options and I used that service to book tickets to a few places. Who knew that two years later, the small company would be acquired by Google for 700 million dollars! (<a title="ita press release" href="http://www.google.com/press/ita/" target="_blank">http://www.google.com/press/ita/</a>)</p>
<p>I guess it was expected from Google to make use of this new acquisition so Google now has an amazing Flight search engine available for anyone to use when searching for US flights.</p>
<p>Check out the flight search that just flies !<br />
<a title="google flights" href="http://google.com/flights" target="_blank"> google.com/flights</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxoffsky.com/link-box/google-flight-search-is-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced

Served from: maxoffsky.com @ 2012-05-19 05:51:39 -->
