<?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>OfertaWeb&#039;s Blog</title>
	<atom:link href="http://blog.ofertaweb.ro/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.ofertaweb.ro</link>
	<description>“Everything should be made as simple as possible, but no simpler.” Einstein</description>
	<lastBuildDate>Tue, 17 Jan 2012 15:13:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Best Android Apps of 2012 &#8211; Shameless Self-Promotion</title>
		<link>http://blog.ofertaweb.ro/?p=164</link>
		<comments>http://blog.ofertaweb.ro/?p=164#comments</comments>
		<pubDate>Tue, 17 Jan 2012 15:13:25 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[best android apps]]></category>
		<category><![CDATA[android apps 2012]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=164</guid>
		<description><![CDATA[Yes, they are all made by us. We really hope you enjoy them as much as we do. &#160; 1. Mood Lamp PRO &#160; Expensive lamps which glow with changing colors ? This app has the same effect! Transform you android device intro a easy-to-implement, easy-to-use mood changing lamp. Why buy expensive lamps which glow [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, they are all made by us. We really hope you enjoy them as much as we do.</p>
<p>&nbsp;</p>
<p><strong>1. <a title="mood lamp pro" href="https://market.android.com/details?id=com.advlp.moodlamppro" target="_blank">Mood Lamp PRO</a></strong></p>
<p>&nbsp;</p>
<p style="text-align: center;"><a><img src="https://lh6.ggpht.com/KY__csWUv__Pt0LG9aSeRM4SihrDOv8OR35ksiVHQLrPROKJkeCmouipk9AxaHBr6So" alt="mood lamp" /></a></p>
<p><span style="color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff;">Expensive lamps which glow with changing colors ? This app has the same effect!</span></p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Transform you android device intro a easy-to-implement, easy-to-use mood changing lamp.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Why buy expensive lamps which glow with changing colors ? This app has the same effect!</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Try it with transparent paper (like a napkin), or inside a white flower vase, or build from paper a geometric form like a pyramid Your imagination is the limit!</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Features:</p>
<ul>
<li>* adjustable time between colors</li>
<li>* select a preferred color</li>
<li>* select shutdown time (is this version is limited to max. 15 minutes)</li>
</ul>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Some colors info:</p>
<ul>
<li>* Red was used to stimulate the body and mind and to increase circulation.</li>
<li>* Yellow was thought to stimulate the nerves and purify the body.</li>
<li>* Orange was used to heal the lungs and to increase energy levels.</li>
<li>* Blue was believed to soothe illnesses and treat pain.</li>
<li>* Indigo shades were thought to alleviate skin problems.</li>
</ul>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Link for download:  <a title="mood lamp pro" href="https://market.android.com/details?id=com.advlp.moodlamppro" target="_blank">Mood Lamp PRO</a></p>
<p><img class="aligncenter" src="https://lh5.ggpht.com/pGN1FoNCYU6b9loVJX8de8hzT1IS5s6ZBNe5bSKBQfH2iU8lXye-avynvjrq_3fkYA" alt="&quot;mood" /></p>
<p>&nbsp;</p>
<p><strong>2. <a title="fast sleep music" href="https://market.android.com/details?id=com.advlp.fastsleepsounds" target="_blank">Fast Sleep Music (Nature Sounds)</a></strong></p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left;">This Application will make you fall asleep faster.</span></p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Fast Sleep Sounds.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">This Application will make you fall asleep faster.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">A great collection to Relax Your Mind</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">you need an internet connection for this app to run.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">NEW! Sleep Well Tips &amp; Tricks in the help section.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Fast Sleep Sounds is a music application based on nature sounds. Sounds of waves will relax your mind, assisting you to sleep better.<br />
We provide group of relaxing natural sounds for you to choose.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Listening to this music, our neurons are relaxed</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Features:</p>
<ul>
<li>- lots rain/ocean/birds sounds</li>
<li>- countdown timer to finish playing at your choice</li>
<li>- Increase sleep quality and relaxed state</li>
</ul>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Please test the free version of this application before you buy this one.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">The free version is almost identical but has some limitations.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">You can download it here (DEMO VERSION) <a href="https://market.android.com/details?id=com.advl.relaxlovesleepsounds" target="_blank">https://market.android.com/details?id=com.advl.relaxlovesleepsounds</a></p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Link for download:  <a title="fast sleep music" href="https://market.android.com/details?id=com.advlp.fastsleepsounds" target="_blank">Fast Sleep Music (Nature Sounds)</a></p>
<p><img class="aligncenter" src="https://lh4.ggpht.com/FG6tiOU2b3T4onyAdranJqLtq2B-NGe7ZknpQ4XHpL_4L9S35vTZ7f8f4P6tuYfherQ" alt="fast sleep sounds" /></p>
<p>&nbsp;</p>
<p><strong>3. <span style="background-color: #ffffff; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left;"><a title="quotes" href="https://market.android.com/details?id=com.advl.quoteslovelife" target="_blank">Quotes about Life and Love</a></span></strong></p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left;">a great collection of favorite quotes and sayings &#8211; inspirational,</span></p>
<p><span style="color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff;">funny &amp; more</span></p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">9542 superb quotes from famous people.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">a great collection of favorite quotes and sayings &#8211; inspirational, funny, motivational, famous.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">This free, searchable app is used by writers, speakers, students, &amp; word seekers worldwide!</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Find good ideas for newsletters, speeches, greeting cards, essays, journals, tag-lines, witty email signatures, cool one-liners for blogs, and clever things to say.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">* This is a free version<br />
* Please do not report any problems in the comments section. Please send me an email instead. *</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Features:</p>
<ol>
<li> fling/swipe navigation. just use your finger to browse them</li>
<li> quote author picture will load if you have access to the internet.</li>
<li> search function (search quotes and authors)</li>
<li> Add quotes to favorites</li>
<li> Bookmark quotes</li>
</ol>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Quotes about Life and Love are the most dominant, but you&#8217;ll find also quotes about Age, Art, Beauty, Business, Education and many more.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Download link:  <strong><span><a title="quotes" href="https://market.android.com/details?id=com.advl.quoteslovelife" target="_blank">Quotes about Life and Love</a></span></strong></p>
<p><img class="aligncenter" src="https://lh5.ggpht.com/Ty6zbNa8iPTfLCkxWrrnBD2h5aqfj6qYfpg8QTwDDNxzNCnFrBZJu2pWaG7UvcmJaK0" alt="quotes app" /></p>
<p>&nbsp;</p>
<p><strong>4.  <a title="learn the colors game" href="https://market.android.com/details?id=com.advl.colorgame" target="_blank">Learn the Colors GAME (for kids 1-3 years)</a></strong></p>
<p><span style="color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff;">Teach your kid to recognize the colors (English), over 30 different colors</span></p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">A beautiful app designed to help kids learn to recognize the basic colors through a very nice and simple game.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">You can choose up to 30 colors for more advanced usage.<br />
For example after they learn the basic ones, you can include more exotic colors like &#8220;magenta&#8221;, &#8220;purple&#8221;, &#8220;teal&#8221; etc.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Rewards them if they guessed correctly with a baby animal animation. Also show the correct color if he presses the wrong one.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">- There are no ads in this app.<br />
- You don&#8217;t even have to be connected to the internet. The only permission requested is the vibration one.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Features:</p>
<ul>
<li>* a reward system that shows a cute animal when the correct color is touched</li>
<li>* you can customize which colors to show in the settings (30 colors)</li>
<li>* you can set the time between each game</li>
<li>* kids protection system, you can leave them the phone without having to worry about exiting the app.</li>
<li>also useful if you can also use this to learn the English basic colors.</li>
</ul>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">all icons are by Martin Berube <a style="color: #3d3d3d; text-decoration: none;" href="http://www.google.com/url?q=http://www.graphics-and-desktop-icons.com/&amp;usg=AFQjCNE9vu4f3FmDc_Y_pZJI7t3ZX_cEXg" target="_blank">http://www.graphics-and-desktop-icons.com/</a> and we thank him for creating such awesome graphics for kids.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Download link:  <a title="learn the colors game" href="https://market.android.com/details?id=com.advl.colorgame" target="_blank">Learn the Colors GAME (for kids 1-3 years)</a></p>
<p><img class="aligncenter" src="https://lh6.ggpht.com/GWvHxLtay0pyIVFxpzfsDiQVxtsm7WC6foNnVu9Gb6vXw2tmxnzRng6WJCSSn3kUdoCt" alt="learn the colors app" /></p>
<p>&nbsp;</p>
<p><strong>5. <a title="ultimate ringtones" href="https://market.android.com/details?id=com.advl.ultimateringtones" target="_blank">Ultimate Ringtones</a></strong></p>
<p>&nbsp;</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Huge selection of ringtones for mobile phones shared by millions of users world-wide.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">★ High quality mobile ringtones, fast and easy, free download.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Features:</p>
<ul>
<li>* search by name</li>
<li>* sort by length</li>
<li>* set them as ringtones, alarm ringtone or notification sound</li>
<li>* very easy to use</li>
</ul>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">- ring-tones will be saved on your external storage! You can find them in the ringtonesADVL folder after you set them for later usage or sharing with other phones etc.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 1em; padding-left: 0px; border-image: initial; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; text-align: left; background-color: #ffffff; margin: 0px; border: 0px initial initial;">Download link: 5. <a title="ultimate ringtones" href="https://market.android.com/details?id=com.advl.ultimateringtones" target="_blank">Ultimate Ringtones</a></p>
<p><img class="aligncenter" src="https://lh6.ggpht.com/s51QYzszDK20xAyAZ3AjIZSk3oWFbBMlCvdSlmgmPeDbMcOn0NcKqC-U1lT1Q9EjjA" alt="ultimate ringtones" /></p>
<p>&nbsp;</p>
<p>Also if you&#8217;re interested in learning how to program android apps yourself we have <a title="android training course" href="http://m.ofertaweb.ro/training.php">a training course</a>.<br />
Thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=164</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Wake Lock Tutorial &#8211; How to correctly use and release a wave lock</title>
		<link>http://blog.ofertaweb.ro/?p=157</link>
		<comments>http://blog.ofertaweb.ro/?p=157#comments</comments>
		<pubDate>Thu, 12 Jan 2012 11:36:36 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android stay screen on]]></category>
		<category><![CDATA[android wakelock]]></category>
		<category><![CDATA[wake lock]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=157</guid>
		<description><![CDATA[So I&#8217;ve spend a couple of hours in debugging a strage wake lock behavior on android. I had an app that requires the screen to stay on (and bright) all the time the app is used. I wanted the wave lock to be released when the user click the back and HOME button. &#160; however, [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve spend a couple of hours in debugging a strage wake lock behavior on android.</p>
<ul>
<li>I had an app that requires the screen to stay on (and bright) all the time the app is used.</li>
<li>I wanted the wave lock to be <strong>released when the user click the back and HOME button.</strong></li>
</ul>
<p>&nbsp;</p>
<p>however, if you are thinking in doing something like this:</p>
<pre>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

<code lang="java">if (keyCode == KeyEvent.KEYCODE_BACK) {
try {
Log.v("back button pressed", "back button pressed");</code>

<code lang="java">wl.release();
}catch(Exception ex){
Log.e("Exception in on back", "exception on back");
}</code></pre>
<p><code lang="java"><code lang="java">}</code></code></p>
<p><code lang="java"><code lang="java">if (keyCode == KeyEvent.KEYCODE_HOME) {<br />
try {<br />
Log.v("menu button pressed", "menu button pressed");</code></code></p>
<p><code lang="java"><code lang="java">wl.release();<br />
}catch(Exception ex){<br />
Log.e("Exception in on menu", "exception on menu");<br />
}<br />
}<br />
</code><br />
<code lang="java"> return super.onKeyDown(keyCode, event);<br />
}<br />
</code><br />
<strong>it will fail big time.</strong></p>
<p><strong><br />
</strong></p>
<h2>So here's the complete solution I found. Feel free to copy paste in your project.</h2>
<p>&nbsp;</p>
<p><code lang="java"><br />
<strong>add this at the begining</strong></code></p>
<p>&nbsp;</p>
<p><strong>private PowerManager.WakeLock wl;</strong></p>
<p><strong>private PowerManager pm;</strong></p>
<p>&nbsp;</p>
<p><code lang="java">// ---------- do not dim screen</code></p>
<p><code lang="java">try {<br />
pm = (PowerManager) getSystemService(Main.POWER_SERVICE);<br />
wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,<br />
"yourprojectname");<br />
wl.acquire();<br />
} catch (Exception ex) {<br />
Log.e("exception", "here 1");</code></p>
<p><code lang="java">}</code></p>
<p><code lang="java">// -----------------------------</code></p>
<p><code lang="java">add this at the end</code></p>
<p><code lang="java">@Override<br />
protected void onResume() {</p>
<p>try {<br />
Log.v("On resume called","------ wl aquire next!");<br />
wl.acquire();</p>
<p>}catch(Exception ex){</p>
<p>}</p>
<p>super.onResume();<br />
}</p>
<p>@Override<br />
protected void onPause() {</p>
<p>try {<br />
Log.v("on pause called", "on pause called");</p>
<p>wl.release();</p>
<p>}catch(Exception ex){<br />
Log.e("Exception in on menu", "exception on menu");<br />
}</p>
<p>super.onPause();<br />
}</p>
<p>@Override<br />
<strong> protected void onUserLeaveHint() {</strong></p>
<p><strong>try {<br />
Log.v("on user leave hint pressed", "on userlevve hint pressesd");<br />
</strong><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong></p>
<p style="display: inline !important;">&nbsp;</p>
<p style="display: inline !important;">wl.release();</p>
<p></strong><strong> </strong><strong> </strong><strong> </strong></p>
<p><strong>}catch(Exception ex){<br />
Log.e("Exception in on menu", "exception on menu");<br />
}</strong></p>
<p></code><code lang="java"><strong> </strong></code><code lang="java"><strong> </strong></code></p>
<p><code lang="java"><strong> </strong></code></p>
<p><code lang="java"><strong>super.onUserLeaveHint();<br />
}<br />
</strong><br />
</code><br />
Of course, if you have ANY suggestion on how to improve it, please feel free to comment. I'll update the post with a better solution, if found.</p>
<p></code></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=157</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python RegExp Tutorial &#8211; Parse a webpage in Python 3.2</title>
		<link>http://blog.ofertaweb.ro/?p=145</link>
		<comments>http://blog.ofertaweb.ro/?p=145#comments</comments>
		<pubDate>Thu, 17 Nov 2011 11:28:55 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[parse webpage in python]]></category>
		<category><![CDATA[python 3.2 regex tutorial]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=145</guid>
		<description><![CDATA[Here is the source code: Be careful at spaces, indentations as python uses those to make magic work import urllib.request import reimport string url_to_download = "http://cleanergy.blogspot.com/2011/08/top-100-green-companies-goinggreen.html" req = urllib.request.Request(url_to_download) &#160; page_source_raw = urllib.request.urlopen(req) page_source = page_source_raw.read().decode('utf-8') regex = re.compile("&#60;\/a&#62;&#60;br \/&#62;&#60;br \/&#62;(.*?)&#60;br \/&#62;(.*?)&#60;br \/&#62;&#60;a href=\"(.*?)\"&#62;http:\/\/") raw_content = regex.findall(page_source) locs = list() for match in raw_content: location = match[1] [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the source code:</p>
<p>Be careful at spaces, indentations as python uses those to make magic work</p>
<pre name="code" class="java">

<em>import urllib.request</em>

<em>import reimport string</em>

<em>url_to_download = "http://cleanergy.blogspot.com/2011/08/top-100-green-companies-goinggreen.html"</em>
<em>req = urllib.request.Request(url_to_download)</em>

&nbsp;

<em>page_source_raw = urllib.request.urlopen(req)</em>

<em>page_source = page_source_raw.read().decode('utf-8')</em>

<em>regex = re.compile("&lt;\/a&gt;&lt;br \/&gt;&lt;br \/&gt;(.*?)&lt;br \/&gt;(.*?)&lt;br \/&gt;&lt;a href=\"(.*?)\"&gt;http:\/\/")</em>
<em> </em>

<em>raw_content = regex.findall(page_source)</em>
<em> </em>

<em>locs = list()</em>
<em></em>

<em>for match in raw_content: </em>

<em> location = match[1] </em>

<em> location = location.replace("&lt;br /&gt;", "") </em>

<em> locs.append(location) </em>

<em></em><em>for location in locs: </em>

<em> print(location, sep="")</em>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=145</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travian AutoSpy Tool &#8211; Fully Automated Program + Source Code</title>
		<link>http://blog.ofertaweb.ro/?p=142</link>
		<comments>http://blog.ofertaweb.ro/?p=142#comments</comments>
		<pubDate>Mon, 18 Jul 2011 08:22:00 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=142</guid>
		<description><![CDATA[Because it&#8217;s boring and hard to use the gettertools search innactives to send 20-30-100 spies I wrote a small autoit program that does that for you. Below it&#8217;s the source code of the program. You can also download it here. &#160; WHAT YOU MUST DO 1. Download and install AutoIt (full installation) from here 2. [...]]]></description>
			<content:encoded><![CDATA[<p>Because it&#8217;s boring and hard to use the <a href="http://www.gettertools.com/ts1.travian.com/42-Search-inactives">gettertools</a> search innactives to send 20-30-100 spies I wrote a small autoit program that does that for you.</p>
<p>Below it&#8217;s the source code of the program. You can also <a title="download" href="http://blog.ofertaweb.ro/download/autospy.au3">download it here.</a></p>
<p>&nbsp;</p>
<p>WHAT YOU MUST DO</p>
<p>1. <a title="download autoit" href="http://www.autoitscript.com/site/autoit/downloads/">Download and install AutoIt (full installation) from here</a></p>
<p>2. Copy paste this script in a new autoit file (save it).</p>
<p><strong>2. Replace the links (server, village) and coordinates with your own!</strong></p>
<p>3. Replace the <strong>Screen Coordinates</strong> with your own (hard part)</p>
<p>4. Test it with F4, Pause&#8230;ESC.</p>
<p>5. Go to point 2 and point 3 untill you are good</p>
<p><strong>6. Grab a beer and enjoy 100 scouts send automated in 10 min instead of &#8230;1h <img src='http://blog.ofertaweb.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em>You might want to blacklist the villages of the owners who were banned or are &#8216;friends&#8217; when the script is stuck, because at this version, the script blocks at that point.</em></p>
<p>&nbsp;</p>
<p><a href="http://blog.ofertaweb.ro/download/autospy.au3">Click here to view it in plain text</a></p>
<p><code>#comments-start<br />
~~~~~~~~~~~~ TRAVIAN HELPER SPY SCRIPT version 1 ~~~~~~~~~~~~~~~~~~<br />
When you don't want to loose 30 min every day for scouting</code></p>
<p><code> </code></p>
<p><code>============= THIS IS AN AUTOMATION TOOL ================</code></p>
<p><code>#######****** BESIDES THE GREASEMONKEY queue TOOL this might be the best thing that happened for you in the travian game *********###########</code></p>
<p><code>This script grabs the content of the innactive pages of http://www.gettertools.com [replace ts1.travian.us with your server...]<br />
It parses it and sends 1 scout to each village location</p>
<p>************* WHAT YOU MUST MODIFY ***************</p>
<p>1. Modify server name of the $LINK_SEARCH_INACTIVES variable.<br />
2. Set the $LIMIT variable with the nr. of your spies.. more the better<br />
3. (OPTIONAL) Set up some not_to_scout coordonates pos_x|pos_y pos_x|pos_y  the separator is " " [SPACE] between villages<br />
4. [HARD] MouseClick("left",727,367,1) ;------- The screen position for scouts for GAULS ... ajust it according to your scren resolution....<br />
The 727 367 are my screen resolution coordonates for clicking the input box of the scouts for GAULS!  YOU MUST MODIFY IT to match your screen and your tribe...<br />
5. [HARD] The MouseClick("left",801,492,1) ;------ back to send troops screen<br />
The 801 492 are my screen resolution for clicking on the Send Troops link. Modify it to match your location.<br />
6. [EASY] The id 1234 is my village ID. Modify it with your id!<br />
7. Edit your x,y location in the code where it sais YOU VILLAGE X and Y<br />
7. You can also modify the path D:\travian_dump.htm to whatever.. remember to modify everywhere.<br />
8. Remember to quit the script simply press ESC or Pause to pause it!!<br />
9. I assume all have firefox installed.. <img src='http://blog.ofertaweb.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Copyright 2011 Dan http://ofertaweb.ro<br />
#comments-end</p>
<p>#include</p>
<p>Dim Const $LINK_SEND_TROOPS = "http://ts6.travian.ro/a2b.php?newdid=1234"; -- click the Send Troops Button from your rally points then just click your village name from the left menu (click second village than first village...for example). Only The newid nr. is diffrent<br />
Dim Const $LINK_SEARCH_INACTIVES = "http://www.gettertools.com/ts6.travian.ro/42-Search-inactives";<br />
Dim Const $LIMIT = 20;<br />
Dim Const $not_to_scout = "-2|64 73|16 60|-52 63|68 -16|60"; ;-------- x|y space next_village_x|next_village_y etc...<br />
Dim Const $your_village_x = x; ; &lt;--- replace me<br />
Dim Const $your_village_y = y; <code>&lt;--- replace me</code></p>
<p>Global $Paused<br />
HotKeySet("{PAUSE}", "TogglePause") ;--------- PRESS PAUSE TO PAUSE THE SCRIPT<br />
HotKeySet("{ESC}", "Terminate")  ;---------- PRESS ESC TO EXIT THE SCRIPT</p>
<p>$rc = _RunDos("start firefox.exe  " &amp; $LINK_SEARCH_INACTIVES)</p>
<p>Sleep(6000);</p>
<p>;      ---------- CENTER VILLAGE COORDINATES ------------<br />
Send("{TAB}");<br />
Send($your_village_x); ;-------- YOU VILLAGE X<br />
Sleep(100);<br />
Send("{TAB}");<br />
Send($your_village_y); ; ------- YOU VILLAGE Y<br />
Sleep(100);<br />
Send("{TAB}");<br />
Sleep(100);<br />
Send("{TAB}");<br />
Sleep(100);<br />
Send(10); -------- min population change in the last week (10 is good ?)<br />
Sleep(100);<br />
Send("{TAB}");<br />
Sleep(100);<br />
Send("{TAB}");<br />
Sleep(100);<br />
Sleep(100);<br />
Send("{TAB}");<br />
Send("50"); -------- min population (50 is good ?)</p>
<p>Send("{ENTER}");<br />
Sleep(3000);<br />
Send("^s"); ; -------- ATTENTION --- make sure you got save as webpage complete (firefox) as the option and not other..like txt file etc<br />
Sleep(1000);<br />
Send("d:\travian_dump_romans.htm"); ------ you can change it but remember to change it in the python script as well.<br />
Send("{ENTER}");<br />
Send("y"); ; overwrite<br />
#comments-end<br />
$file = FileOpen("d:\travian_dump_romans.htm", 0)<br />
If $file = -1 Then<br />
MsgBox(0, "Error", "Unable to open file d:\travian_dump_romans.htm")<br />
Exit<br />
EndIf</p>
<p>$travian_dump = FileRead($file);</p>
<p>$array = StringRegExp($travian_dump, '<br />
(.*?) | (.*?)</p>
<p>', 3)</p>
<p>Dim $x_array[100]<br />
Dim $y_array[100]</p>
<p>$k = 0;<br />
$ix = 0;<br />
$iy = 0;</p>
<p>for $i = 0 to UBound($array) - 1<br />
if $array[$i] &lt;&gt; "" Then<br />
if mod($k,2) = 0 Then<br />
$x_array[$ix] = $array[$i];<br />
$ix = $ix + 1;<br />
Else<br />
$y_array[$iy] = $array[$i];<br />
$iy = $iy + 1;<br />
EndIf<br />
$k = $k + 1<br />
EndIf<br />
Next</p>
<p>$rc = _RunDos("start firefox.exe " &amp; $LINK_SEND_TROOPS)<br />
Sleep(6000);<br />
$i=0;<br />
$spy_nr = 1;<br />
While $i &lt;=	$LIMIT</p>
<p>$pos = StringInStr($not_to_scout,$x_array[$i] &amp; "|" &amp; $y_array[$i]);</p>
<p>if $pos == 0 Then</p>
<p>TrayTip("Spying", "Sending spy nr " &amp; $spy_nr  &amp; "/" &amp; $LIMIT, 5, 1);<br />
$spy_nr = $spy_nr + 1;<br />
Sleep(800);<br />
;MouseClick("left",727,367,1) ;------- The screen position for scouts for GAULS ... ajust it according to your scren resolution....(mine is 1920x1200)<br />
MouseClick("left",864,299,1) ;------- The screen position for scouts for ROMANS ... ajust it according to your scren resolution....(mine is 1920x1200)<br />
Send("1") ;------ 1 spy<br />
Sleep(300);<br />
MouseClick("left",768,484,1)<br />
Sleep(300);<br />
Send($x_array[$i]);<br />
Sleep(300);<br />
SEND("{TAB}");<br />
Send($y_array[$i]);<br />
Sleep(300);<br />
SEND("{TAB}");<br />
SEND("{DOWN}{DOWN}");<br />
SEND("{TAB}");<br />
SEND("{ENTER}");<br />
Sleep(3000);<br />
MouseClick("left",728,535,1)<br />
SEND("{ENTER}");<br />
Sleep(3000);<br />
MouseClick("left",801,492,1) ;------ back to send troops screen<br />
Sleep(3000);</p>
<p>EndIf</p>
<p>$i = $i + 1;</p>
<p>WEnd</p>
<p>;      ---------- CENTER VILLAGE COORDINATES ------------<br />
#comments-end</p>
<p>Func TogglePause()<br />
$Paused = NOT $Paused<br />
While $Paused<br />
sleep(100)<br />
ToolTip('Script is "Paused"',0,0)<br />
WEnd<br />
ToolTip("")<br />
EndFunc</p>
<p></code></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><code>Func Terminate()<br />
Exit 0<br />
EndFunc<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>new brand/domain name generator tool</title>
		<link>http://blog.ofertaweb.ro/?p=122</link>
		<comments>http://blog.ofertaweb.ro/?p=122#comments</comments>
		<pubDate>Mon, 02 May 2011 20:23:48 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[find domain names]]></category>
		<category><![CDATA[generate brand names]]></category>
		<category><![CDATA[generator domain names]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=122</guid>
		<description><![CDATA[this is one of the best tools you&#8217;ll find online namezilla Try it to generate brand names, domain names and interesting combinations. Also feedback is welcome.]]></description>
			<content:encoded><![CDATA[<p>this is one of the best tools you&#8217;ll find online</p>
<p><a href="http://namezilla.appspot.com/"><strong>namezilla</strong></a></p>
<p>Try it to generate brand names, domain names and interesting combinations.<br />
Also feedback is welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=122</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>copy paste this into your centos fresh install</title>
		<link>http://blog.ofertaweb.ro/?p=108</link>
		<comments>http://blog.ofertaweb.ro/?p=108#comments</comments>
		<pubDate>Sun, 01 May 2011 20:14:05 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[copy - paste to get started]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fresh install scripts]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=108</guid>
		<description><![CDATA[for x86_64 servers&#8230;. Simple Server with some basic tools rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txtt;wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;yum -y update; yum -y upgrade; yum -y install nano wget screen mlocate zip unzip openssh mc htop tcptrack;updatedb;chkconfig sshd on; LAMP Linux (operating system), Apache HTTP Server, MySQL Server rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt;wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;yum -y update; yum -y upgrade; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>for x86_64 servers&#8230;.</strong></p>
<p><strong>Simple Server with some basic tools</strong></p>
<p><code><br />
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txtt;wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;yum -y update; yum -y upgrade; yum -y install nano wget screen mlocate zip unzip openssh mc htop tcptrack;updatedb;chkconfig sshd on;<br />
</code></p>
<p><strong>LAMP Linux (operating system), Apache HTTP Server, MySQL Server</strong></p>
<p><code><br />
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt;wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;yum -y update; yum -y upgrade; yum -y install nano wget screen mlocate zip unzip openssh mc php httpd mysql mysql-server htop;updatedb;chkconfig mysqld on;chkconfig httpd on;<br />
</code></p>
<p><strong>Centos 5.6 x86_64 with lots of stuff for webhosting</strong></p>
<p><code><br />
yum groupinstall -y 'Development Tools';yum groupinstall -y 'Development Libraries';rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt;wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm;<br />
yum install -y ntp httpd mlocate mysql-server php php-mysql php-mbstring php-mcrypt phpmyadmin;yum remove -y postfix;yum install -y postfix;yum install -y getmail php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-mbstring php-mcrypt php-mhash php-mssql php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-devel httpd-devel ruby ruby-devel pure-ftpd bind-chroot fail2ban rkhunter squirrelmail;updatedb;chkconfig mysqld on;chkconfig httpd on;<br />
</code></p>
<p>TO BE UPDATED&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=108</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my google&#8217;s proxy server &#8211; powered by google apps</title>
		<link>http://blog.ofertaweb.ro/?p=109</link>
		<comments>http://blog.ofertaweb.ro/?p=109#comments</comments>
		<pubDate>Sat, 30 Apr 2011 10:43:55 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google appengine]]></category>
		<category><![CDATA[how to make a proxy server in python]]></category>
		<category><![CDATA[proxy server]]></category>
		<category><![CDATA[python google apps]]></category>
		<category><![CDATA[python proxy]]></category>

		<guid isPermaLink="false">http://blog.ofertaweb.ro/?p=109</guid>
		<description><![CDATA[Here is a proxy server powered by Google apps &#38; Python http://proxzilla.appspot.com/ The python code is made by Brett Slatkin &#160; main.html Dan's Proxy Server Dan's Ultra Fast Proxy Server     Instructions: Just type the URL of any web page in the input box above (e.g. thebit.ro) and hit Enter.   thebit.ro - based [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a proxy server powered by Google apps &amp; Python</p>
<p><strong><a title="google apps proxy server" href="http://proxzilla.appspot.com/" target="_blank">http://proxzilla.appspot.com/</a></strong></p>
<p>
The python code is made by  Brett Slatkin</p>
<p>&nbsp;</p>
<p>main.html</p>
<pre class="html:collapse">

Dan's Proxy Server
<!--
body {
	background-color:#202020;
	color:#EEE;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
}
.box {
	width:500px;
	margin: 10px auto;
	text-align: center;
	padding: 20px;
	border-top: 1px solid #CCCCCC;
	border-right: 2px solid #CCCCCC;
	border-bottom: 2px solid #CCCCCC;
	border-left: 1px solid #CCCCCC;
}
h1 {
	color: #FFF;
	margin: 5px 5px 20px;
	padding: 10px;
	border-right: 0px solid #ddd;
	border-bottom: 2px solid #FF0000;
	border-left: 0px solid #ddd;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 1.2em;
	font-style: normal;
	font-weight: bold;
	font-variant: normal;
}
.footer {
	font: .9em Verdana, Arial, sans-serif;
	margin: 8px;
	padding: 12px 8px 8px;
	text-align: left;
}
.credit {
	font: .8em Verdana, Arial, sans-serif;
	margin: 8px;
	padding: 8px;
	text-align: left;
}
input.txt {
	border:1px solid #999999;
	font-size:1.2em;
	color:#000;
	padding:4px;
	width:250px;
}
a{
	color:#FFF;
}
input.btn {
	font-size:0.9em;
	font-family: Arial, sans-serif;
	width: 100px;
	margin: 2px 0;
	padding: 4px;
}
-->
<div class="box">
<h1>Dan's Ultra Fast Proxy Server</h1>

 
<form accept-charset="utf-8" method="get">
<input id="input" class="txt" name="url" type="text" value="type url here.." />
<input class="btn" type="submit" value="Go" />
    </form>

 

Instructions: Just type the URL of any web page in the input box above (<em>e.g. thebit.ro</em>)  and hit Enter.

 

 <a href="http://thebit.ro">thebit.ro</a> - based on the <a href="http://mirrorrr.appspot.com/">Mirrorrr</a> project.

 
</div>

 
</pre>
<p><strong>mirror.py</strong></p>
<pre class="python:collapse">
#!/usr/bin/env python
# Copyright 2008 Brett Slatkin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

__author__ = "Brett Slatkin

import datetime
import hashlib
import logging
import pickle
import re
import time
import urllib
import wsgiref.handlers

from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.runtime import apiproxy_errors

import transform_content

################################################################################

DEBUG = False
EXPIRATION_DELTA_SECONDS = 3600
EXPIRATION_RECENT_URLS_SECONDS = 90

## DEBUG = True
## EXPIRATION_DELTA_SECONDS = 10
## EXPIRATION_RECENT_URLS_SECONDS = 1

HTTP_PREFIX = "http://"
HTTPS_PREFIX = "http://"

IGNORE_HEADERS = frozenset([
  'set-cookie',
  'expires',
  'cache-control',

  # Ignore hop-by-hop headers
  'connection',
  'keep-alive',
  'proxy-authenticate',
  'proxy-authorization',
  'te',
  'trailers',
  'transfer-encoding',
  'upgrade',
])

TRANSFORMED_CONTENT_TYPES = frozenset([
  "text/html",
  "text/css",
])

MIRROR_HOSTS = frozenset([
  'mirrorr.com',
  'mirrorrr.com',
  'www.mirrorr.com',
  'www.mirrorrr.com',
  'www1.mirrorrr.com',
  'www2.mirrorrr.com',
  'www3.mirrorrr.com',
])

MAX_CONTENT_SIZE = 10 ** 6

MAX_URL_DISPLAY_LENGTH = 50

################################################################################

def get_url_key_name(url):
  url_hash = hashlib.sha256()
  url_hash.update(url)
  return "hash_" + url_hash.hexdigest()

################################################################################

class EntryPoint(db.Model):
  translated_address = db.TextProperty(required=True)
  last_updated = db.DateTimeProperty(auto_now=True)
  display_address = db.TextProperty()

class MirroredContent(object):
  def __init__(self, original_address, translated_address,
               status, headers, data, base_url):
    self.original_address = original_address
    self.translated_address = translated_address
    self.status = status
    self.headers = headers
    self.data = data
    self.base_url = base_url

  @staticmethod
  def get_by_key_name(key_name):
    return memcache.get(key_name)

  @staticmethod
  def fetch_and_store(key_name, base_url, translated_address, mirrored_url):
    """Fetch and cache a page.

    Args:
      key_name: Hash to use to store the cached page.
      base_url: The hostname of the page that's being mirrored.
      translated_address: The URL of the mirrored page on this site.
      mirrored_url: The URL of the original page. Hostname should match
        the base_url.

    Returns:
      A new MirroredContent object, if the page was successfully retrieved.
      None if any errors occurred or the content could not be retrieved.
    """
    # Check for the X-Mirrorrr header to ignore potential loops.
    if base_url in MIRROR_HOSTS:
      logging.warning('Encountered recursive request for "%s"; ignoring',
                      mirrored_url)
      return None

    logging.debug("Fetching '%s'", mirrored_url)
    try:
      response = urlfetch.fetch(mirrored_url)
    except (urlfetch.Error, apiproxy_errors.Error):
      logging.exception("Could not fetch URL")
      return None

    adjusted_headers = {}
    for key, value in response.headers.iteritems():
      adjusted_key = key.lower()
      if adjusted_key not in IGNORE_HEADERS:
        adjusted_headers[adjusted_key] = value

    content = response.content
    page_content_type = adjusted_headers.get("content-type", "")
    for content_type in TRANSFORMED_CONTENT_TYPES:
      # Startswith() because there could be a 'charset=UTF-8' in the header.
      if page_content_type.startswith(content_type):
        content = transform_content.TransformContent(base_url, mirrored_url,
                                                     content)
        break

    # If the transformed content is over 1MB, truncate it (yikes!)
    if len(content) &gt; MAX_CONTENT_SIZE:
      logging.warning('Content is over 1MB; truncating')
      content = content[:MAX_CONTENT_SIZE]

    new_content = MirroredContent(
      base_url=base_url,
      original_address=mirrored_url,
      translated_address=translated_address,
      status=response.status_code,
      headers=adjusted_headers,
      data=content)
    if not memcache.add(key_name, new_content, time=EXPIRATION_DELTA_SECONDS):
      logging.error('memcache.add failed: key_name = "%s", '
                    'original_url = "%s"', key_name, mirrored_url)

    return new_content

################################################################################

class BaseHandler(webapp.RequestHandler):
  def get_relative_url(self):
    slash = self.request.url.find("/", len(self.request.scheme + "://"))
    if slash == -1:
      return "/"
    return self.request.url[slash:]

class HomeHandler(BaseHandler):
  def get(self):
    # Handle the input form to redirect the user to a relative url
    form_url = self.request.get("url")
    if form_url:
      # Accept URLs that still have a leading 'http://'
      inputted_url = urllib.unquote(form_url)
      if inputted_url.startswith(HTTP_PREFIX):
        inputted_url = inputted_url[len(HTTP_PREFIX):]
      return self.redirect("/" + inputted_url)

    latest_urls = memcache.get('latest_urls')
    if latest_urls is None:
      latest_urls = EntryPoint.gql("ORDER BY last_updated DESC").fetch(25)

      # Generate a display address that truncates the URL, adds an ellipsis.
      # This is never actually saved in the Datastore.
      for entry_point in latest_urls:
        entry_point.display_address = \
          entry_point.translated_address[:MAX_URL_DISPLAY_LENGTH]
        if len(entry_point.display_address) == MAX_URL_DISPLAY_LENGTH:
          entry_point.display_address += '...'

      if not memcache.add('latest_urls', latest_urls,
                          time=EXPIRATION_RECENT_URLS_SECONDS):
        logging.error('memcache.add failed: latest_urls')

    # Do this dictionary construction here, to decouple presentation from
    # how we store data.
    secure_url = None
    if self.request.scheme == "http":
      secure_url = "https://mirrorrr.appspot.com"
    context = {
      "latest_urls": latest_urls,
      "secure_url": secure_url,
    }
    self.response.out.write(template.render("main.html", context))

class MirrorHandler(BaseHandler):
  def get(self, base_url):
    assert base_url

    # Log the user-agent and referrer, to see who is linking to us.
    logging.debug('User-Agent = "%s", Referrer = "%s"',
                  self.request.user_agent,
                  self.request.referer)
    logging.debug('Base_url = "%s", url = "%s"', base_url, self.request.url)

    translated_address = self.get_relative_url()[1:]  # remove leading /
    mirrored_url = HTTP_PREFIX + translated_address

    # Use sha256 hash instead of mirrored url for the key name, since key
    # names can only be 500 bytes in length; URLs may be up to 2KB.
    key_name = get_url_key_name(mirrored_url)
    logging.info("Handling request for '%s' = '%s'", mirrored_url, key_name)

    content = MirroredContent.get_by_key_name(key_name)
    cache_miss = False
    if content is None:
      logging.debug("Cache miss")
      cache_miss = True
      content = MirroredContent.fetch_and_store(key_name, base_url,
                                                translated_address,
                                                mirrored_url)
    if content is None:
      return self.error(404)

    # Store the entry point down here, once we know the request is good and
    # there has been a cache miss (i.e., the page expired). If the referrer
    # wasn't local, or it was '/', then this is an entry point.
    if (cache_miss and
        'Googlebot' not in self.request.user_agent and
        'Slurp' not in self.request.user_agent and
        (not self.request.referer.startswith(self.request.host_url) or
         self.request.referer == self.request.host_url + "/")):
      # Ignore favicons as entry points; they're a common browser fetch on
      # every request for a new site that we need to special case them here.
      if not self.request.url.endswith("favicon.ico"):
        logging.info("Inserting new entry point")
        entry_point = EntryPoint(
          key_name=key_name,
          translated_address=translated_address)
        try:
          entry_point.put()
        except (db.Error, apiproxy_errors.Error):
          logging.exception("Could not insert EntryPoint")

    for key, value in content.headers.iteritems():
      self.response.headers[key] = value
    if not DEBUG:
      self.response.headers['cache-control'] = \
        'max-age=%d' % EXPIRATION_DELTA_SECONDS

    self.response.out.write(content.data)

app = webapp.WSGIApplication([
  (r"/", HomeHandler),
  (r"/main", HomeHandler),
  (r"/([^/]+).*", MirrorHandler)
], debug=DEBUG)

def main():
  wsgiref.handlers.CGIHandler().run(app)

if __name__ == "__main__":
  main()</pre>
<p><strong>transform_content.py</strong></p>
<pre class="python:collapse">#!/usr/bin/env python
# Copyright 2008 Brett Slatkin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

__author__ = "Brett Slatkin

import os
import re
import urlparse

################################################################################

# URLs that have absolute addresses
ABSOLUTE_URL_REGEX = r"(http(s?):)?//(?P[^\"'&gt; \t\)]+)"

# URLs that are relative to the base of the current hostname.
BASE_RELATIVE_URL_REGEX = r"/(?!(/)|(http(s?)://)|(url\())(?P[^\"'&gt; \t\)]*)"

# URLs that have '../' or './' to start off their paths.
TRAVERSAL_URL_REGEX = r"(?P\.(\.)?)/(?!(/)|(http(s?)://)|(url\())(?P[^\"'&gt; \t\)]*)"

# URLs that are in the same directory as the requested URL.
SAME_DIR_URL_REGEX = r"(?!(/)|(http(s?)://)|(url\())(?P[^\"'&gt; \t\)]+)"

# URL matches the root directory.
ROOT_DIR_URL_REGEX = r"(?!//(?!&gt;))/(?P)(?=[ \t\n]*[\"'\)&gt;/])"

# Start of a tag using 'src' or 'href'
TAG_START = r"(?i)\b(?Psrc|href|action|url|background)(?P[\t ]*=[\t ]*)(?P[\"']?)"

# Start of a CSS import
CSS_IMPORT_START = r"(?i)@import(?P[\t ]+)(?P[\"']?)"

# CSS url() call
CSS_URL_START = r"(?i)\burl\((?P[\"']?)"

REPLACEMENT_REGEXES = [
  (TAG_START + SAME_DIR_URL_REGEX,
     "\g\g\g%(accessed_dir)s\g"),

  (TAG_START + TRAVERSAL_URL_REGEX,
     "\g\g\g%(accessed_dir)s/\g/\g"),

  (TAG_START + BASE_RELATIVE_URL_REGEX,
     "\g\g\g/%(base)s/\g"),

  (TAG_START + ROOT_DIR_URL_REGEX,
     "\g\g\g/%(base)s/"),

  # Need this because HTML tags could end with '/&gt;', which confuses the
  # tag-matching regex above, since that's the end-of-match signal.
  (TAG_START + ABSOLUTE_URL_REGEX,
     "\g\g\g/\g"),

  (CSS_IMPORT_START + SAME_DIR_URL_REGEX,
     "@import\g\g%(accessed_dir)s\g"),

  (CSS_IMPORT_START + TRAVERSAL_URL_REGEX,
     "@import\g\g%(accessed_dir)s/\g/\g"),

  (CSS_IMPORT_START + BASE_RELATIVE_URL_REGEX,
     "@import\g\g/%(base)s/\g"),

  (CSS_IMPORT_START + ABSOLUTE_URL_REGEX,
     "@import\g\g/\g"),

  (CSS_URL_START + SAME_DIR_URL_REGEX,
     "url(\g%(accessed_dir)s\g"),

  (CSS_URL_START + TRAVERSAL_URL_REGEX,
      "url(\g%(accessed_dir)s/\g/\g"),

  (CSS_URL_START + BASE_RELATIVE_URL_REGEX,
      "url(\g/%(base)s/\g"),

  (CSS_URL_START + ABSOLUTE_URL_REGEX,
      "url(\g/\g"),
]

################################################################################

def TransformContent(base_url, accessed_url, content):
  url_obj = urlparse.urlparse(accessed_url)
  accessed_dir = os.path.dirname(url_obj.path)
  if not accessed_dir.endswith("/"):
    accessed_dir += "/"

  for pattern, replacement in REPLACEMENT_REGEXES:
    fixed_replacement = replacement % {
      "base": base_url,
      "accessed_dir": accessed_dir,
    }
    content = re.sub(pattern, fixed_replacement, content)
  return content</pre>
<p>also the standard <strong>app.yaml</strong></p>
<p>application: proxzilla<br />
version: secureable <strong><--- replace here with your app name!</strong><br />
runtime: python<br />
api_version: 1</p>
<p>handlers:</p>
<p>- url: /.*<br />
  script: mirror.py<br />
  secure: optional</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=109</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mysql databases diffrence calculator &#8211; show diffrences between tables structures</title>
		<link>http://blog.ofertaweb.ro/?p=100</link>
		<comments>http://blog.ofertaweb.ro/?p=100#comments</comments>
		<pubDate>Wed, 05 Jan 2011 17:44:22 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mysq]]></category>

		<guid isPermaLink="false">http://ofertaweb.ro/blog/?p=100</guid>
		<description><![CDATA[Here is some php functions that allows you to see the differences between two databases. it&#8217;s useful for new versions of databases with lots of tables. config.php &#60;?php $host = "host ip"; $user = "user"; $pass = "password"; $database_1 = "database_1"; //usually the newer one let's say trinity_world_new $database_2 = "database_2"; // let's say trinity_world_old [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some php functions that allows you to see the differences between two databases.</p>
<p>it&#8217;s useful for new versions of databases with lots of tables.</p>
<p><strong>config.php</strong></p>
<pre>&lt;?php
$host = "host ip";
$user = "user";
$pass = "password";

$database_1 = "database_1"; //usually the newer one let's say trinity_world_new
$database_2 = "database_2"; // let's say trinity_world_old
?&gt;

<strong>functions.php</strong>
<pre>&lt;?php
function connection($host,$user,$pass){
       
        $link = mysql_connect($host,$user,$pass);
        if(!$link) die("Can't connect to the database");
       
        return $link;
} 

function table_exists($tablename, $database = false) {

    if(!$database) {
        $res = mysql_query("SELECT DATABASE()");
        $database = mysql_result($res, 0);
    }

    $res = mysql_query("
        SELECT COUNT(*) AS count
        FROM information_schema.tables
        WHERE table_schema = '$database'
        AND table_name = '$tablename'
    ");

    return mysql_result($res, 0) == 1;

}

?&gt;</pre>
<p><strong>index.php</strong></p>
<pre>&lt;?php
error_reporting(E_ALL);
ini_set("display_errors","1");

require_once("config.php");
require_once("functions.php");

$link = connection($host,$user,$pass);

echo "&lt;center&gt;&lt;h1&gt;$database_1 vs $database_2&lt;/h2&gt;&lt;/center&gt;";

$tables_array_1 = array();
$tables_array_2 = array();
$tables_array_diff = array();

$array_1 = array();
$array_2 = array();
$array_diff = array();

$sql = "SHOW TABLES FROM $database_1";
$result = mysql_query($sql);
if (!$result) die(mysql_error());
while ($row = mysql_fetch_row($result)) {
    array_push($tables_array_1, $row[0]);
}

$sql = "SHOW TABLES FROM $database_2";
$result = mysql_query($sql);
if (!$result) die(mysql_error());
while ($row = mysql_fetch_row($result)) {
    array_push($tables_array_2, $row[0]);
}

echo "&lt;br /&gt;&lt;h2&gt;Tables +- comparison&lt;/h2&gt;&lt;br /&gt;";

$tables_array_diff = array_diff($tables_array_1, $tables_array_2);
echo "&lt;br /&gt;$database_1 has this tables added: ";
if(count($tables_array_diff)==0) echo "-";else {
echo "&lt;span style='color:red;font-weight:bold'&gt;";
foreach($tables_array_diff as $added_tables) echo $added_tables." | ";
echo "&lt;/span&gt;";
}

$tables_array_diff = array_diff($tables_array_2, $tables_array_1);
echo "&lt;br /&gt;$database_2 has this tables added: ";
if(count($tables_array_diff)==0) echo "-";else{
echo "&lt;span style='color:red;font-weight:bold'&gt;";
foreach($tables_array_diff as $added_tables) echo $added_tables." | ";
echo "&lt;/span&gt;";
}

echo "&lt;br /&gt;&lt;h2&gt;Tables columns comparison&lt;/h2&gt;";

foreach($tables_array_1 as $table){

        echo "&lt;br /&gt;";
       
$array_1 = array();
$array_2 = array();
$array_diff = array();

$skip = 0;
if(!table_exists($table,$database_1)) {
   echo "&lt;h2&gt;&lt;span style='color:red'&gt;Table $table doesn't exist in $database_1!&lt;/span&gt;&lt;/h2&gt;";
   $skip = 1;
}
if(!table_exists($table,$database_2)) {
   echo "&lt;h2&gt;&lt;span style='color:red'&gt;Table $table doesn't exist in $database_2!&lt;/span&gt;&lt;/h2&gt;";
   $skip = 1;
}
        

if($skip==0){

mysql_select_db($database_1) or die("can't select the database");

$result1 = mysql_query("SHOW FIELDS FROM $table");

while($row = mysql_fetch_array($result1)){
        array_push($array_1,$row[0]." &lt;span style='color:blue'&gt;".$row[1]."&lt;/span&gt; ".$row[2]." ".$row[3]." ".$row[4]." ".$row[5]);
}

mysql_select_db($database_2) or die("can't select the database");

$result2 = mysql_query("SHOW FIELDS FROM $table");
while($row = mysql_fetch_array($result2)){
        array_push($array_2,$row[0]." &lt;span style='color:blue'&gt;".$row[1]."&lt;/span&gt; ".$row[2]." ".$row[3]." ".$row[4]." ".$row[5]);
}

$match = 1;

$array_diff = array();
$array_diff = array_diff($array_1, $array_2);

if(count($array_diff)!=0) {
        $match = 0;
        echo "&lt;span style='color:red;font-weight:bold'&gt;Table $table are diffrent &lt;br /&gt;";
        foreach($array_diff as $added_col) echo $added_col." | ";
        echo "&lt;/span&gt;";
        }
       
$array_diff = array();
$array_diff = array_diff($array_2, $array_1);

if(count($array_diff)!=0) {
        $match = 0;
        echo "&lt;span style='color:red;font-weight:bold'&gt;Table $table are diffrent &lt;br /&gt;";
        foreach($array_diff as $added_col) echo $added_col." | ";
        echo "&lt;/span&gt;";
        }
       
if($match) echo "&lt;span style='color:green;font-weight:bold;'&gt;$table are matched&lt;/span&gt;&lt;br /&gt;";else

        if(!$match)
        {
        $count_1 = count($array_1);
        $count_2 = count($array_2);
       
        if($count_1 &gt; $count_2) $count=$count_1;else $count=$count_2;
        

        echo "&lt;table border='1' cellpadding='4'&gt;";
       
        echo "&lt;tr&gt;";
        echo "&lt;th&gt;$database_1 $table&lt;/th&gt;";
        echo "&lt;th&gt;$database_2 $table&lt;/th&gt;";
        echo "&lt;th&gt;Difference&lt;/th&gt;";
        echo "&lt;/tr&gt;";
       
        for($i=0;$i&lt;$count;$i++){
                echo "&lt;tr&gt;";
                if(isset($array_1[$i])) echo "&lt;td&gt;".$array_1[$i]."&lt;/td&gt;";else echo "&lt;td&gt;-&lt;/td&gt;";
                if(isset($array_2[$i])) echo "&lt;td&gt;".$array_2[$i]."&lt;/td&gt;";else echo "&lt;td&gt;-&lt;/td&gt;";
                if(isset($array_2[$i])&amp;&amp;isset($array_2[$i])){
                if($array_1[$i]==$array_2[$i]) echo "&lt;td&gt;-&lt;/td&gt;";else echo "&lt;td&gt;&lt;span style='color:red;font-weight:bold;'&gt;YES!&lt;/td&gt;";
                }else echo "&lt;td&gt;&lt;span style='color:red;font-weight:bold;'&gt;YES!&lt;/td&gt;";
                echo "&lt;/tr&gt;";
               
        }
       
        echo "&lt;/table&gt;";
        }
}
}

mysql_close($link);
?&gt;</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>minify your webpages</title>
		<link>http://blog.ofertaweb.ro/?p=80</link>
		<comments>http://blog.ofertaweb.ro/?p=80#comments</comments>
		<pubDate>Sun, 31 Oct 2010 10:22:58 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
		
		<guid isPermaLink="false">http://ofertaweb.ro/blog/?p=80</guid>
		<description><![CDATA[What is Page Speed? Page Speed is an open-source Firefox/Firebug Add-on. Webmasters and web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them. When you profile a web page with Page Speed, it evaluates the page&#8217;s conformance to a number of different rules.  [...]]]></description>
			<content:encoded><![CDATA[<h2>What is Page Speed?</h2>
<p>Page Speed is an open-source Firefox/Firebug Add-on. Webmasters and web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them.</p>
<p>When you profile a web page with Page Speed, it evaluates the page&#8217;s conformance to a number of different <em>rules</em>.  One of this rules is:</p>
<ul>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html">Minimizing payload size</a> — reducing the size of responses, downloads, and cached pages</li>
</ul>
<p>like -&gt;</p>
<ol>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression">Enable compression</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#RemoveUnusedCSS">Remove unused CSS</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#MinifyJS">Minify JavaScript</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#MinifyCSS">Minify CSS</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#MinifyHTML">Minify HTML</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#DeferLoadingJS">Defer loading of JavaScript</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#CompressImages">Optimize images</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#ScaleImages">Serve scaled images</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/payload.html#duplicate_resources">Serve resources from a consistent URL</a></li>
</ol>
<p>We created a tool that minify your js, css and html files.</p>
<p>new tool made by us.</p>
<p><a title="minify webpages script" href="http://minify.ofertaweb.ro" target="_blank">http://minify.ofertaweb.ro</a></p>
<p>if you are using  joomla you may want to try <a href="http://extensions.joomla.org/extensions/site-management/site-performance/7350" target="_blank">this tool</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=80</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Starcraft 2 automatic program</title>
		<link>http://blog.ofertaweb.ro/?p=66</link>
		<comments>http://blog.ofertaweb.ro/?p=66#comments</comments>
		<pubDate>Sat, 25 Sep 2010 00:34:17 +0000</pubDate>
		<dc:creator>ofertaweb's admin</dc:creator>
		
		<guid isPermaLink="false">http://ofertaweb.ro/blog/?p=66</guid>
		<description><![CDATA[I&#8217;ve just finished working on a starcraft 2 automaton . What works so far: setting an unit to patrol the hole map (large area): F5 (pressing SHITFT down + P + clicking the 4 corners of the minimap) setting an unit to patrol the center of the map: F6 (pressing SHITFT down + P + [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished working on a starcraft 2 automaton <img src='http://blog.ofertaweb.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>What works so far:</p>
<ul>
<li> setting an unit to patrol the hole map (large area): F5 (pressing SHITFT down + P + clicking the 4 corners of the minimap)</li>
<li>setting an unit to patrol the center of the map: F6 (pressing SHITFT down + P + clicking the 4 corners of the CENTER of the minimap)</li>
<li>auto-make a SCV (you have to hotkey a base and put the waypoint on the crystals) (Just pressing 1 + key &#8220;s&#8221;)</li>
</ul>
<p>How it works:</p>
<p>Load it, press F5,F6 or TAB for the automated actions.</p>
<p>ToDO:</p>
<p>Maybe you have some suggestions.</p>
<p>Here is the source code (you have to compile it with autoit)</p>
<p><a href="http://www.autoitscript.com/autoit3/index.shtml" target="_blank">http://www.autoitscript.com/autoit3/index.shtml</a></p>
<p>;Copyright 2010 by Dan<br />
; Press Esc to terminate script, Pause/Break to &#8220;pause&#8221;</p>
<p>Global $Paused<br />
HotKeySet(&#8220;{PAUSE}&#8221;, &#8220;TogglePause&#8221;)<br />
HotKeySet(&#8220;{ESC}&#8221;, &#8220;Terminate&#8221;)<br />
HotKeySet(&#8220;{F5}&#8221;, &#8220;Patrol_Large&#8221;)<br />
HotKeySet(&#8220;{F6}&#8221;, &#8220;Patrol_Small&#8221;)<br />
HotKeySet(&#8220;{TAB}&#8221;, &#8220;Minerals&#8221;)</p>
<p>;;;; Body of program would go here ;;;;<br />
While 1<br />
Sleep(100)<br />
WEnd<br />
;;;;;;;;</p>
<p>Func Minerals()<br />
Send(&#8220;1s&#8221;);<br />
EndFunc</p>
<p>Func Patrol_Large()<br />
Send(&#8220;{SHIFTDOWN}p&#8221;)<br />
MouseClick(&#8220;left&#8221;,67,924,1)<br />
MouseClick(&#8220;left&#8221;,291,929,1)<br />
MouseClick(&#8220;left&#8221;,291,1158,1)<br />
MouseClick(&#8220;left&#8221;,60,1150,1)<br />
Send(&#8220;{SHIFTUP}&#8221;)<br />
EndFunc</p>
<p>Func Patrol_Small()<br />
Send(&#8220;{SHIFTDOWN}p&#8221;)<br />
MouseClick(&#8220;left&#8221;,136,999,1)<br />
MouseClick(&#8220;left&#8221;,218,997,1)<br />
MouseClick(&#8220;left&#8221;,216,1061,1)<br />
MouseClick(&#8220;left&#8221;,138,1061,1)<br />
MouseClick(&#8220;left&#8221;,141,1000,1)<br />
Send(&#8220;{SHIFTUP}&#8221;)<br />
EndFunc</p>
<p>Func TogglePause()<br />
$Paused = NOT $Paused<br />
While $Paused<br />
sleep(100)</p>
<p>WEnd</p>
<p>EndFunc</p>
<p>Func Terminate()<br />
Exit 0<br />
EndFunc</p>
<p>and here is the program fully compiled. (you can scan it with any anti virus you want)</p>
<p><a rel="attachment wp-att-67" href="http://ofertaweb.ro/blog/?attachment_id=67"></a><a href="http://ofertaweb.ro/blog/wp-content/uploads/2010/09/starcraft2.zip">starcraft2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ofertaweb.ro/?feed=rss2&#038;p=66</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

