<?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>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; web</title>
	<atom:link href="http://blog.mfabrik.com/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Disabling cross-domain security check for AJAX development in Google Chrome</title>
		<link>http://blog.mfabrik.com/2010/11/29/disabling-cross-domain-security-check-for-ajax-development-in-google-chrome/</link>
		<comments>http://blog.mfabrik.com/2010/11/29/disabling-cross-domain-security-check-for-ajax-development-in-google-chrome/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 11:39:54 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[chrome]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[cross browser]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=839</guid>
		<description><![CDATA[This tip is for those who need to test Javascript / HTML5 web application functionality against a production server from their local HTML and Javascript files (not localhost). Start Google Chrome with no security from command lin, OSX: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security Start Google Chrome from command line, Ubuntu/Linux: chromium-browser --disable-web-security After this cross-domain AJAX [...]]]></description>
			<content:encoded><![CDATA[<p>This tip is for those who need to test Javascript / HTML5 web application functionality against a production server from their local HTML and Javascript files (not localhost).</p>
<p>Start Google Chrome with no security from command lin, OSX:</p>
<pre>
<div id="_mcePaste">/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security</div>
</pre>
<p>Start Google Chrome from command line, Ubuntu/Linux:</p>
<pre>chromium-browser --disable-web-security</pre>
<div>After this cross-domain AJAX requests work.</div>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/11/29/disabling-cross-domain-security-check-for-ajax-development-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MooTools setOptions() nullifies object references</title>
		<link>http://blog.mfabrik.com/2008/08/19/mootools-setoptions-nullifies-object-references/</link>
		<comments>http://blog.mfabrik.com/2008/08/19/mootools-setoptions-nullifies-object-references/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 00:21:08 +0000</pubDate>
		<dc:creator>Tuukka Mustonen</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[addressing]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[setOptions]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=64</guid>
		<description><![CDATA[I bumped up into a problem where the object references where resolved as object copies when I passed them to class instances. That might sound easy to resolve, but unfortunately I was already deep in code and it was difficult to see this. Therefore, here&#8217;s a little explanation for those who are facing the same [...]]]></description>
			<content:encoded><![CDATA[<p>I bumped up into a problem where the object references where resolved as object copies when I passed them to class instances. That might sound easy to resolve, but unfortunately I was already deep in code and it was difficult to see this. Therefore, here&#8217;s a little explanation for those who are facing the same frustrating issue.</p>
<p>Say, you have variable &#8216;a&#8217; and you want to pass it to a MooTools class B instance during creation. In the easiest case you&#8217;d use new B({ myReference: a}) and trust on MooTools&#8217; Class.setOptions() to minify the need of code lines. This is what you should do&#8230; well at least that&#8217;s what I did and in this case it was a mistake.</p>
<p>It turns out that Class.setOptions() merges it&#8217;s arguments to this.options and then takes copy of them via $merge(). That means that any variable references you pass to setOptions() will get copied to this.options and.. well, that&#8217;s it. See lines 1170-1173 in uncompressed version of MooTools 1.2:</p>
<pre>var Options = new Class({
    setOptions: function(){
        this.options = $merge.run([this.options].extend(arguments));</pre>
<p>That effectively nullifies the benefits of Class.setOptions() if you want to pass in variable references..</p>
<p>Here&#8217;s a longer example to clarify (use Firebug):</p>
<pre>  // The most basic MooTools class that implements options
  // ref is a variable meant for pointing at given object
  // (won't do that, however)
  var B = new Class({
    Implements: Options,
    options: {
      ref: null
    },
    initialize: function(options) {
      this.setOptions(options);
    }
  });

  // Ok let's create an instance that we can pass to B
  // It's similar with all sorts of variables
  var A = new Class({
    initialize: function() {
      this.somevar = 'untouched';
    }
  });
  var a = new A();

  // Create an instance of B and give it somevar as reference
  var b = new B({ ref: a });

  // prints out "untouched" as should
  console.log(b.options.ref.somevar);

  // Let's change the variable (direct access, bad)
  a.somevar = "changed";

  // b's reference should still point to a, right?
  // In that case the following should print "changed",
  // but because our reference object was copied instead
  // of retaining reference to it, we just get "untouched"
  console.log(b.options.ref.somevar);</pre>
<p>I don&#8217;t know why MooTools wants to make a copy of arguments in setOptions() &#8211; propably for performance reasons.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/08/19/mootools-setoptions-nullifies-object-references/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Viivi &amp; Wagner strip scraper</title>
		<link>http://blog.mfabrik.com/2008/05/07/viivi-wagner-strip-scaper/</link>
		<comments>http://blog.mfabrik.com/2008/05/07/viivi-wagner-strip-scaper/#comments</comments>
		<pubDate>Tue, 06 May 2008 22:33:22 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[beuatifulsoap]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[comic]]></category>
		<category><![CDATA[downloader]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[scaper]]></category>
		<category><![CDATA[spider]]></category>
		<category><![CDATA[strip]]></category>
		<category><![CDATA[viivi ja wagner]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=40</guid>
		<description><![CDATA[I wrote this little script as a mental exercise and to prove the power of Python programming language. If anyone accepts the challenge, I&#8217;d like to see submissions in other programming langauges For the foreigners: this is the best comic in Finland, so I hope you&#8217;ll get translations soon! It tells about the relationship of [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this little script as a mental exercise and to prove the power of Python programming language. If anyone accepts the challenge, I&#8217;d like to see submissions in other programming langauges <img src='http://blog.mfabrik.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>For the foreigners: this is the best comic in Finland, so I hope you&#8217;ll get translations soon! It tells about the relationship of a woman and a pig (sic) reflecting the deepest shadows of Finnish social life.</p>
<pre>"""
	Creats local mirror from Viivi &amp; Wagner strips by fetching all of them from hs.fi.

	Will create downloaded strips as
		2004/1.1.2004.gif
		2004/2.1.2004.gif
		...
		until today

	Try this in C++!

	Motivation: No one has build Viivi &amp; Wagner search engine with speech bubble OCR support
	and I desperately wanted to find "Kottarainen lentaa korvaan" strip for my gf.

	Time to complete: 20 min.

"""

__docformat__ = "epytext"
__author__ = "Mikko Ohtamaa"
__license__ = "BSD"
__copyright__ = "2008 Mikko Ohtamaa"

import os
import re
import urllib
from BeautifulSoup import BeautifulSoup

# 1.1.2004 start page
url = "http://www.hs.fi/viivijawagner/1073386660690"

# Loop until there is no longer next link
while True:
	stream = urllib.urlopen(url)
	html = stream.read()
	stream.close()
	soup = BeautifulSoup(html)

	# Parse strip date from contents
	date = None

	# Find strip date, which is next to a title
	h1 = soup.findAll(text="Viivi ja Wagner")
	# Should be present always
	date = h1[0].parent.parent.p.string

	print "Fetching " + date

	# Scrape strip
	strip = soup.findAll("div" , { "class" : "strip" })
	img = strip[0].img

	stream = urllib.urlopen(img["src"])
	data = stream.read()
	stream.close()

	# For each year, give a new folder to avoid file system stress
	# (lotsa files in a folder kill poor Gnome)
	day, month, year = date.split(".")
	folder = year

	if not os.path.exists(folder):
		os.mkdir(folder)	

	# Store contents
	fname = os.path.join(folder, date + ".gif")
	f = open(fname, "wb")
	f.write(data)
	f.close()

	# Find next url, it is a containing one img tag
	img = soup.findAll(alt="seuraava")
        if len(img) == 0:
             break
	a = img[0].parent
	url = a["href"]
</pre>
<h2>See preview</h2>
<p><a href="http://blog.redinnovation.com/wp-content/uploads/2008/05/screenshot-2004-file-browser1.png"><img class="alignnone size-thumbnail wp-image-42" title="screenshot-2004-file-browser1" src="http://blog.redinnovation.com/wp-content/uploads/2008/05/screenshot-2004-file-browser1-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog.redinnovation.com/wp-content/uploads/2008/05/screenshot-2004-file-browser.png"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/05/07/viivi-wagner-strip-scaper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

