<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Apprenticecoder&#039;s Blog</title>
	<atom:link href="http://apprenticecoder.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://apprenticecoder.wordpress.com</link>
	<description>This is an attempt to share my growth as a computer programmer</description>
	<lastBuildDate>Sun, 15 Jul 2012 10:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='apprenticecoder.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Apprenticecoder&#039;s Blog</title>
		<link>http://apprenticecoder.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://apprenticecoder.wordpress.com/osd.xml" title="Apprenticecoder&#039;s Blog" />
	<atom:link rel='hub' href='http://apprenticecoder.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Better communication through introversion and solitude</title>
		<link>http://apprenticecoder.wordpress.com/2012/07/15/better-communication-through-introversion-and-solitude/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/07/15/better-communication-through-introversion-and-solitude/#comments</comments>
		<pubDate>Sun, 15 Jul 2012 10:44:23 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[learn-from-mistakes]]></category>
		<category><![CDATA[learn-to-learn]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[introversion]]></category>
		<category><![CDATA[motivational]]></category>
		<category><![CDATA[solitude]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1512</guid>
		<description><![CDATA[I&#8217;m back. Sort of. I&#8217;ve been busy rediscovering introversion, silence and solitude. Some activities require them, like learning, coding, learning to code. I&#8217;m not going to discuss the paradox of coding as both a solitary and team/community activity, or get &#8230; <a href="http://apprenticecoder.wordpress.com/2012/07/15/better-communication-through-introversion-and-solitude/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1512&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m back. Sort of.</p>
<p>I&#8217;ve been busy rediscovering <strong>introversion, silence and solitude</strong>. Some activities require them, like learning, coding, learning to code.</p>
<p>I&#8217;m not going to discuss the paradox of coding as both a <strong>solitary and team/community activity</strong>, or get into the topics of communication, documentation, teamwork, that is for later.</p>
<p>I was inspired, among other influences, by a <a title="TED Talk about the power of introverts" href="http://www.youtube.com/watch?v=c0KYU2j0TM4" target="_blank"><strong>TED Talk by Susan Cain entitled &#8220;The power of introverts&#8221;</strong></a>  which is short and very interesting.</p>
<p><strong>.</strong>This world we live in is very concentrated on <strong>appearances and clustering and peer pressure</strong> an that can <strong>dumb you down and disperse your energies</strong>. But that is also <strong>part of being human</strong>, since us humans have traveled a long way since we have discovered the advantage of hunting in &#8220;teams&#8221; for our survival. We have been tribes, guilds, nations, and lately even target groups divided by taste and purchase habits.</p>
<p>We, as humans, need to &#8220;hunt in packs&#8221; but we also need to <strong>move away from the tribe sometimes</strong> and invent something useful for everyone. Or even simply have fun playing with our Lego or Code.</p>
<p>Plus I need to <strong>rediscover what I need</strong>. And right now part of that is to read, learn and code.</p>
<p>I&#8217;m coming up with a way to keep using this <strong>blog</strong> or some other blog as a tool <strong>compatible with introversion</strong> and all of that.</p>
<p><strong>For instance, the more code I write and more things I learn by myself, the more interesting my blog posts and tweets and other communications will be. I will have deeper and more concrete words to share.</strong></p>
<p>So, see you later.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1512&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/07/15/better-communication-through-introversion-and-solitude/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Behind the questionmark in a diamond &#8211; what I learned today about character encodings</title>
		<link>http://apprenticecoder.wordpress.com/2012/03/12/behind-the-questionmark-in-a-diamond-what-i-learned-today-about-character-encodings/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/03/12/behind-the-questionmark-in-a-diamond-what-i-learned-today-about-character-encodings/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 23:03:15 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[learn-from-mistakes]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[character encoding]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[right single quote]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1498</guid>
		<description><![CDATA[I used to dread the days when I ran into a question mark, in a black diamond shape or not, in a middle of some text on a website or elsewhere, but now I find it fun. I feel like &#8230; <a href="http://apprenticecoder.wordpress.com/2012/03/12/behind-the-questionmark-in-a-diamond-what-i-learned-today-about-character-encodings/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1498&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>I used to dread the days when I ran into a question mark, in a black diamond shape or not, in a middle of some text on a website or elsewhere, but now I find it fun.</strong> I feel like I&#8217;m finally getting the grip on the character encodings question, and I also like the idea of looking <strong>behind the scenes</strong> into what is really going on inside a file, or a program, or a process, or a database, a website, or anything else. Well, one tiny little baby step at a time, of course.</p>
<p>Today I found a <strong>question mark in a pdf</strong>, and wanted to know why. I went into the database to look at the text that was being printed in pdf, and just intuitively copied the text to then paste it into the shell and do a <strong>hexdump</strong> on it. I didn&#8217;t know if the copy-paste would modify it in some way, but I thought I&#8217;d give it a shot and see what happens.</p>
<p>I pretty much did this:</p>
<p>$ echo &#8220;Example of a possible phrase: single right quote’s problem&#8221; | hexdump -C</p>
<p>00000000  45 78 61 6d 70 6c 65 20  6f 66 20 61 20 70 6f 73  |Example of a pos|<br />
00000010  73 69 62 6c 65 20 70 68  72 61 73 65 3a 20 73 69  |sible phrase: si|<br />
00000020  6e 67 6c 65 20 72 69 67  68 74 20 71 75 6f 74 65  |ngle right quote|<br />
<strong>00000030  <span style="color:#ff0000;">e2 80 99</span> 73 20 70 72 6f  62 6c 65 6d 0a           |&#8230;s problem.|</strong></p>
<p style="text-align:left;">That is <strong>UTF-8 Unicode</strong> for you. It is <strong>backwards compatible with ASCII</strong>, so where it can it uses just one byte for character. And this one<strong> strange character took 3 bytes.</strong> To make the long story short, when we were passing (the choice of coders other then us) this nice UTF-8 to the php function utf8_decode() it was turning it into single-byte ISO-8859-1. And losing the right single quote. <strong>Because as I was told today, if you translate something complex into something simpler, rich into poor encoding, you lose something.</strong> And I was losing the right single quote.</p>
<p style="text-align:left;">Why is this so entertaining?</p>
<p style="text-align:left;">Because it&#8217;s everywhere, and because often what we think is going on is not what really is going on, and sometimes this can create problems. <strong>Haven&#8217;t you noticed how tricky it is to just copy and paste simple ASCII text these days without carrying markup and what not along with it?</strong> That alone requires a blog post. And if you paste a non printing character into a website database or a website file, that can create strange problems. The non-printable character is not seen and yet it breaks the layout, since the browser tries to work around it, closes the tag, and makes what it can of the mess.</p>
<p style="text-align:left;">Character encodings are everywhere. Web sites have them (check out View-&gt;character encoding in Firefox or Wrench menu-&gt;Tools-&gt;Encoding in Chrome). Databases have collations. Web applications too. And all these have to be aligned and also made to work well for different users. We have to keep track of encodings when moving between programs and operating systems. We need to know how much can we trust our text editors to not create problems. Etc.</p>
<p style="text-align:left;"><strong>A phrase is made of bytes, which are numbers.</strong> We see letters, digits, symbols, ideograms, and what not, but underneath it&#8217;s numbers, and encodings give them meaning. When we need to print or read letters and numbers and symbols, <strong>computer programs translate them into numbers and back again</strong>.</p>
<p style="text-align:left;">If it was simple <strong><a title="ASCII character encoding" href="http://en.wikipedia.org/wiki/ASCII">ASCII</a></strong>, every character would just be represented by one <strong>7-bit byte</strong>. This means that there are 128 (0-127) ASCII characters, printable and not, and the 128th character, decimal 127, has a binary value of <strong>1111111</strong>. You are probably thinking that I miscalculated the bits, since they are 7, not 8 like in the byte we are used to. No, seven they are. Someone told me that in the teleprinter old days the 8th bit was used for parity, as a <strong>sort of a checksum</strong>, so you could check if the rest of it came through plausibly right. The idea was kept through the modem days, apparently (see<a title="XMODEM protocol" href="http://en.wikipedia.org/wiki/XMODEM"> XMODEM</a> and <a title="ZMODEM protocol" href="http://en.wikipedia.org/wiki/ZMODEM">ZMODEM</a> file transfer protocols). But don&#8217;t worry, there is the <strong>extended ASCII</strong> (or <strong>high ASCII</strong>) that goes into the higher numbers and describes 8-bit or larger character encodings. Letters with accents are in the extended part, and some old school computer fanatics still refuse to have anything to do with them in e-mail and such and stick to the basics:) Oh yeah, there&#8217;s also the <a href="http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign">ASCII Ribbon Campaign</a> against HTML in e-mails which makes more sense every day in this world of malicious Javascript code passed in img tags and such. Oh well.</p>
<p style="text-align:left;">And now go see some <a title="ASCII art" href="http://en.wikipedia.org/wiki/ASCII_art">ASCII art</a> to relax. A bit. Ha ha. Not funny <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align:left;">So, I found the <strong>weird 3 bytes</strong> (&#8220;<strong>e2 80 99</strong>&#8220;) in my string and Googled them. It turned out to be some Microsoft specific right single quote, that takes well <strong>3 bytes to be represented</strong> in Unicode. <strong><a title="UTF-8 character encoding" href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a></strong> Unicode encoding uses different numbers of bytes to represent characters &#8211; sometimes 1, sometimes 2, sometimes more. <strong>UCS-2</strong> is fixed length, <strong><a href="http://en.wikipedia.org/wiki/UTF-16">UTF-16</a> </strong>uses 1 or 2 bytes for a character, and so on. <a title="International Organization for Standardization" href="http://en.wikipedia.org/wiki/International_Organization_for_Standardization">ISO</a> and <a title="International Electrotechnical Commission" href="http://en.wikipedia.org/wiki/International_Electrotechnical_Commission">IEC</a> have their series of standards for 8-bit <a title="Character encoding" href="http://en.wikipedia.org/wiki/Character_encoding">character encodings</a>. <a href="http://en.wikipedia.org/wiki/Code_page#Windows_.28ANSI.29_code_pages">Microsoft has their own character sets</a>.</p>
<p style="text-align:left;">In the Wikipedia page you can check out the web resources, including the <a href="http://en.wikipedia.org/wiki/Character_encoding">character encoding Wikipedia page</a>.</p>
<p style="text-align:left;">I could go on, but I&#8217;ll just admit I have to study much more yet, and some day maybe put together a tutorial on the subject.</p>
<p style="text-align:left;">In the meantime I&#8217;d like to remind you to learn something new every day, big or small makes no difference, and keep a diary of what you learn. It will help you see the day in a new light. <strong>Oh, BTW don&#8217;t compare yourself to others. Mostly they have a lot to learn, but hide it well.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1498/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1498/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1498&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/03/12/behind-the-questionmark-in-a-diamond-what-i-learned-today-about-character-encodings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Model Thinking &#8211; models as the new Lingua Franca &#8211; notes from new online course by Scott E. Page</title>
		<link>http://apprenticecoder.wordpress.com/2012/03/04/model-thinking-models-as-the-new-lingua-franca-notes-from-new-online-course-by-scott-e-page/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/03/04/model-thinking-models-as-the-new-lingua-franca-notes-from-new-online-course-by-scott-e-page/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 17:45:02 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[e-learning]]></category>
		<category><![CDATA[Model Thinking]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[model thinking]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[Schneier]]></category>
		<category><![CDATA[Scott E. Page]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1489</guid>
		<description><![CDATA[I&#8217;ve brought up the concept of models before. From the MIT online courses, I learned that programming is about mapping the world into something computational. I&#8217;ve had to do with models as part of the model-view-controller pattern in programming, and &#8230; <a href="http://apprenticecoder.wordpress.com/2012/03/04/model-thinking-models-as-the-new-lingua-franca-notes-from-new-online-course-by-scott-e-page/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1489&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve brought up the concept of models before. From the MIT online courses, I learned that programming is about <strong><a title="Mapping the world into something computational" href="http://apprenticecoder.wordpress.com/2011/02/15/mit-600-part-1-mapping-world-to-something-computational/">mapping the world into something computational</a></strong>. I&#8217;ve had to do with models as part of the <strong>model-view-controller</strong> pattern in programming, and when modeling databases into objects. I&#8217;ve <a title="Bruce Schneier" href="apprenticecoder.wordpress.com/2011/05/24/computational-models-as-life-skill-the-bruce-schneier-perspective/">blogged about</a> <strong>Bruce Schneier</strong> and the importance he gives to models, explaining how feelings are our interpretations based on intuitions, and models are based on reasoning, be it our own, or inherited. Models are important, and determine us a great deal, and it all influences our predictions, our decision making, our lives, presents and futures. <strong>Models influence both how we perceive our lives and feel while living them, and what actually happens to us based on the decisions we make and things we do.</strong></p>
<p>Clearly I am very happy to be following a whole <a href="https://www.coursera.org/modelthinking/auth/welcome">online course in model thinking</a> and see where this serendipitous intuition can lead me and what it can teach me. I have discovered it when new Stanford free courses were announced, and it is taught by Scott E. Page.</p>
<p><strong>I have a background both in computers and in social sciences, and models kind of fill the gap between them, linking them in a way I always felt was there</strong>. I like computers for computers&#8217; sake, but playing with them and not going beyond that has never been enough for me. At the same time, when I would study something from other fields, I would find myself applying methods that programming has made a part of me. <strong>Model thinking helps me make sense of that, maybe. <a title="Scott E. Page on Wikipedia" href="http://en.wikipedia.org/wiki/Scott_E._Page">Scott E.Page</a> </strong>himself is not a Computer Scientist, but a Professor of Complex Systems, Political Science, and Economics at the University of Michigan.</p>
<p>Clearly, the map is not the territory. And in the first two video lectures of the Model Thinking course Scott E. Page shares this quote with us:</p>
<blockquote><p>&#8220;Essentially, all models are wrong, but some are useful.&#8221;<br />
<a title="George E. P. Box on Wikipedia" href="http://en.wikipedia.org/wiki/George_E.P._Box">George E.P. Box</a></p></blockquote>
<p>Click &#8220;Continue reading&#8221; to learn something about what the models are good for.</p>
<p><span id="more-1489"></span>So, what are models good for? They are &#8220;abstractions, simplifications, but they are going to be useful to us.&#8221; My intuition about models has been that they help us use our pattern recognition capabilities better and look behind the surface of things. They help us find similarities in things, and also differences, and patterns, and understand where things are going. <strong>When we make a model of something, we can play with it, change the variables, and get unexpected results.</strong> I hope this will make us less slaves of ideas and appearances, and more<strong> able to use ideas as tools and read behind appearances. </strong>I always hope the world might change for the better, and that people can think and feel and act in a more intelligent way. Maybe models will be a part of that, maybe not. &#8220;Most of human knowledge didn&#8217;t have models in them. Models are a relatively recent phenomenon.&#8221; &#8220;Models just make you a better thinker. The reason is that they just weed out a lot of logical inconsistencies.&#8221;</p>
<p>&#8220;</p>
<p>We are ever more immersed in a world of data. Scott E. Page&#8217;s Computer Scientist friends call it a &#8220;hairball of data&#8221;, and he suggests that <strong>models help to take that data, structure in information and turn it into knowledge (maybe in the end some wisdom)</strong>. Since the 90s and the rise of Internet and Wired and stuff, I&#8217;ve been thinking about the famous T.S. Elliot quote <strong>&#8220;Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?&#8221;</strong> that I&#8217;ve read in those days when a lot of people wondered about such things and e-theory was fashionable. Who knows, maybe Model Thinking or something like that can help us take take that data, structure in information and turn it into knowledge (maybe in the end some wisdom), as Scott E. Page suggests.</p>
<p>The arguments that are going to be discussed in this course are such as:</p>
<p>* Collective Action<br />
* Tipping Points<br />
* Colonel Blotto<br />
* Lyapunov Models<br />
* Learning Models<br />
* Wisdom of Crowds<br />
* Markov Processes<br />
* Spatial Voting<br />
* Decision Theory<br />
* Linear Models<br />
* Economic Growth</p>
<p>Models are used in fields like:</p>
<p>* Business<br />
* Politics<br />
* Non-profit world<br />
* (biology) video2<br />
* (linguistics) video2</p>
<p>Models are becoming the <strong>new Lingua Franca</strong> of Academy, Business, Politics, Non-profit etc. and is used in fields like, biology, linguistics, etc. The Game Theory has models for all sorts of things.</p>
<p>Studies about predictions people make show that the worst ones are done by those who use only one model or no real model at all (called hedgehogs), decent ones by those who use many but in a loose way (foxes) and best ones by those who use formal models and many of them. This is from a book by <a title="Philip E. Tetlock on Wikipedia" href="http://en.wikipedia.org/wiki/Philip_E._Tetlock">Philip E. Tetlock</a>.</p>
<p>Models also make us humble, &#8220;often as we construct models we get really different predictions than what we thought before.&#8221; They don&#8217;t make our decisions for us, but offer guidance and a bunch of different ways of looking at the world.</p>
<p>So, happy modeling then, and have fun learning.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1489/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1489/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1489&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/03/04/model-thinking-models-as-the-new-lingua-franca-notes-from-new-online-course-by-scott-e-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Living inside Moodle e-learning platform, source code and db structure</title>
		<link>http://apprenticecoder.wordpress.com/2012/02/19/living-inside-moodle-e-learning-platform-source-code-and-db-structure/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/02/19/living-inside-moodle-e-learning-platform-source-code-and-db-structure/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 21:49:39 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[e-learning]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[learn-to-learn]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[lms]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1476</guid>
		<description><![CDATA[I&#8217;ve spent the last months of workdays inside the source code and db structure of Moodle, an interesting e-learning platform. My first impression was confusion. Some of the code is procedural, some is object-oriented, some global variables are used, and &#8230; <a href="http://apprenticecoder.wordpress.com/2012/02/19/living-inside-moodle-e-learning-platform-source-code-and-db-structure/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1476&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve spent the last months of workdays inside the source code and db structure of <a title="Moodle e-learning platform" href="http://www.moodle.org">Moodle</a>, an interesting e-learning platform. My first impression was confusion. Some of the code is procedural, some is object-oriented, some global variables are used, and the database is a forrest of related tables.  The illustration below gives an idea of that. But it is a worthwile experience. <strong>I&#8217;ve learned to read and write Moodle</strong>, to modify it and expand it with custom plugins, to debug it and figure out what is going on even when the log files aren&#8217;t helping at all.</p>
<div id="attachment_1477" class="wp-caption aligncenter" style="width: 650px"><a href="http://apprenticecoder.files.wordpress.com/2012/02/moodle_01_bymartinlanghoff.png"><img class="size-full wp-image-1477" title="moodle_01_byMartinLanghoff" src="http://apprenticecoder.files.wordpress.com/2012/02/moodle_01_bymartinlanghoff.png?w=640&#038;h=640" alt="Moodle database representation" width="640" height="640" /></a><p class="wp-caption-text">By Martin Langhoff from <a href="http://moodle.org/mod/forum/discuss.php?d=3935" rel="nofollow">http://moodle.org/mod/forum/discuss.php?d=3935</a></p></div>
<p><strong>MESS VIEW CONTROLLER <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p>Moodle has its upsides and downsides. Coming to it after the Model-View-Controller world of CodeIgniter based portals was a shock. <strong>It isn&#8217;t Model-View-Controller at all!</strong> I thought OMG everything is just all over the place. The logic was being mixed with presentation in ways that for me were absurd. I even searched the forums to understand more and found out that the Moodle coders don&#8217;t see changing this as a priority and aren&#8217;t interested in aggressive criticisms on this account (not that it ever came from me). So I just got used to it and moved on.<strong> Sometimes I still get irritated when I see how functions and classes and libraries seam put together to fit the purpose of the moment and not planned out for possible future uses.</strong> But I can&#8217;t be too harsh. Moodle was written for teachers, not for programmers, and it has made many valuable online courses possible and enriched learning experiences of so many people, and keeps to do so. <strong>So I humbly keep exploring it and being inspired by it, and hope to be able to contribute to it some day too. Probably soon.</strong></p>
<p>In Moodle things happen in three basic places: the source code, the database and the moodledata folder. The database plays a huge role: it keeps it all together, &#8220;knows&#8221; all about the plugins and logs and users and their activities. The source code is complex and lego-like. The moodledata folder keeps files.</p>
<p><strong></strong>Click &#8220;Continue reading&#8221; for some detail.</p>
<p><span id="more-1476"></span></p>
<p><strong>THE SOURCE CODE</strong></p>
<p>As with all web frameworks and platforms and CMS&#8217;s, the first thing to do is to download the source code. Then you create an empty database with a user that has privileges on it, an empty moodledata directory, and run the installation script which creates a config.php file.</p>
<p><strong>Personalizing Moodle is a bit like playing with lego</strong>, or adding new pieces to a puzzle as you are composing it. If you want to make a change, the first thing is to figure out how Moodle already handles that type of activity you want to deal with. Then you decide what to do &#8211; write an enrol or auth plugin, ad a question type or a custom user profile field type, extend a class and override a function, or something else. Writing a plugin or extending a class is clearly, as always, favourable to editing the core files. If you want to add a new way of enrolling users to courses, you&#8217;ll write an enrol plugin similar to the ones provided by default and Moodle will make it available in the same way it does with other enrolment plugins.</p>
<p><strong>The basic directory structure is somewhat complex, this is the listing for the 2.2 version:</strong></p>
<p>admin &#8211; various procedures used by the administrator<br />
auth &#8211; authentication plugins<br />
backup<br />
blocks &#8211; blocks you can add to the layouts to present data to users<br />
blog<br />
brokenfile.php<br />
calendar<br />
cohort &#8211; a type of user group<br />
comment<br />
config-dist.php<br />
COPYING.txt<br />
<strong>course &#8211; all the course related stuff, like organizing course contents on a page</strong><br />
draftfile.php<br />
<strong>enrol &#8211; enrolment to courses plugins</strong><br />
error<br />
file.php<br />
files<br />
filter<br />
githash.php<br />
grade<br />
group<br />
help.php<br />
index.php<br />
install<br />
install.php<br />
iplookup<br />
lang<br />
<strong>lib &#8211; all kinds of libraries, fundamental</strong><br />
<strong>local &#8211; place to put your plugins if there isn&#8217;t a better place for them (enrol, block or auth)</strong><br />
login<br />
message<br />
mnet<br />
<strong>mod &#8211; all kinds of modules</strong><br />
my<br />
notes<br />
pix<br />
plagiarism<br />
pluginfile.php<br />
portfolio<br />
question<br />
rating<br />
README.txt<br />
report<br />
repository<br />
rss<br />
tag<br />
tags<br />
tags.txt<br />
<strong>theme &#8211; place where you customize the look and feel</strong><br />
TRADEMARK.txt<br />
<strong>user &#8211; user related stuff like profiles and custom fields</strong><br />
userpix<br />
version.php<br />
webservice</p>
<p><strong>THE ROLE OF THE DATABASE</strong></p>
<p>But knowing the code is not enough to work with Moodle, the database is fundamental. <strong>The db doesn&#8217;t only hold the contents such as the students and the course descriptions and such, but it also holds logs, traces of student activities, access control configurations, informations about plugins etc.</strong> It ties together the user and course activities and events, but also the platform system itself &#8211; the plugins and blocks and bits and pieces and roles and contexts. In fact when adding code for new plugins you have to also go to the admin home page so it gets installed and registered into the database so it can work properly.  In order to work with the code you need to learn how the tables are related and which ids are foreign keys to other ids. <strong>You&#8217;ll need to figure out what needs to be modified to consider a course completed, or a user enroled, or a certificate released or deleted.</strong></p>
<p>For example, the courses are found in mdl_course. Users in mdl_user. Modules are composed of modules (resources, activities, etc.) and these can be found in mdl_course_modules. Modules can be &#8216;completed&#8217; like when a user successfully finishes a quiz, and this is kept in mdl_course_modules_completion. Each entry relates to a user, and to a course module, and keeps track of the completion state and modification time. There is a separate table that keeps track of users finishing whole courses, mdl_course_completion. And you also have to distinguish from modules in the abstract sense, in mdl_modules, and instances of modules for courses in mdl_course_modules. <strong>A lot of how Moodle works is based on this concept of instances. Things that happen in Moodle create &#8220;instances&#8221;, which are basically rows in database tables.</strong> I&#8217;ll likely get into more detail about this in future posts. You can also read more about it in <a href="http://docs.moodle.org/dev/Database_schema_introduction">Moodle documentation</a>.</p>
<p>If some aspects of this interest you in particular, I would be very interested to read and answer your questions. Happy learning!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1476&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/02/19/living-inside-moodle-e-learning-platform-source-code-and-db-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>

		<media:content url="http://apprenticecoder.files.wordpress.com/2012/02/moodle_01_bymartinlanghoff.png" medium="image">
			<media:title type="html">moodle_01_byMartinLanghoff</media:title>
		</media:content>
	</item>
		<item>
		<title>The Code is your Tutor, RTFSC</title>
		<link>http://apprenticecoder.wordpress.com/2012/02/14/the-code-is-your-tutor-rtfsc/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/02/14/the-code-is-your-tutor-rtfsc/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 22:18:28 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[learn-to-learn]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1458</guid>
		<description><![CDATA[In a perfect world every apprentice would have a perfect tutor.  All the time. An apprentice would always be able to learn from great masters and journeymen under favorable conditions, they would have time and communicate well and learn from &#8230; <a href="http://apprenticecoder.wordpress.com/2012/02/14/the-code-is-your-tutor-rtfsc/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1458&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p class="mceTemp mceIEcenter" style="text-align:left;"><strong>In a perfect world every apprentice would have a perfect tutor.  All the time.</strong> An apprentice would always be able to learn from great masters and journeymen under favorable conditions, they would have time and communicate well and learn from one another. The apprentice would offer enthusiasm and freshness, and the teachers would bring perspective and knowledge and best practices and even wisdom.</p>
<p class="mceTemp mceIEcenter" style="text-align:left;"><strong>In the real world it&#8217;s much more chaotic.</strong> Our paths sometimes cross, sometimes they don&#8217;t, sometimes we have time, sometimes just issues and deadlines, but we always have the code.</p>
<p class="mceTemp mceIEcenter" style="text-align:left;"><strong>We always have the code, and the code will guide us.</strong></p>
<div id="attachment_1461" class="wp-caption aligncenter" style="width: 650px"><a href="http://apprenticecoder.files.wordpress.com/2012/02/abstrusegoose_otherpeoplescode1.jpg"><img class="size-full wp-image-1461" title="abstrusegoose_otherpeoplescode" src="http://apprenticecoder.files.wordpress.com/2012/02/abstrusegoose_otherpeoplescode1.jpg?w=640&#038;h=158" alt="http://abstrusegoose.com/strips/you_down_wit_OPC-yeah_you_know_me.png" width="640" height="158" /></a><p class="wp-caption-text"><a href="http://abstrusegoose.com/strips/you_down_wit_OPC-yeah_you_know_me.png" rel="nofollow">http://abstrusegoose.com/strips/you_down_wit_OPC-yeah_you_know_me.png</a></p></div>
<p>The code has always taught me something. Bad code lets me learn from its errors, good code from its elegance and efficiency. I travel through its lines, explore its streets, squares, cities, towns. <strong>It sometimes feels like living inside the code, I can really see it all around me.</strong> When I started programming, I thought that reading other people&#8217;s source code would be the hard part, but it wasn&#8217;t. When it comes to full immersion, you just do it, and don&#8217;t look back. You just learn. You just swim. Not always perfectly, mistakes are inevitable, but you do.</p>
<p><strong>And I have only just started to explore.</strong> I have many more open source projects to take part in, functions and methods to invoke, classes to create and subclass. I wish I had used Google Code Search more before<a title="Google Code Search closed" href="http://googleblog.blogspot.com/2011/10/fall-sweep.html"> they closed it</a> (anyone know of anything similar?).</p>
<p><strong>No matter what the future brings, one thing is certain : I will keep learning.</strong> And knowledge is something no one can take away from you.</p>
<p>Does this mean it is OK to treat people with a &#8220;Read The F* Source Code&#8221; and &#8220;It&#8217;s all in the code, don&#8217;t ask questions&#8221; attitude? No it&#8217;s not OK. Reading the code is no substitute for communication, commenting or documentation.</p>
<p>But at least I know I will always have a great teacher, with an infinity of things to teach me, and that is the source code of all the free and open software out there. <strong>Thank you all for sharing.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1458/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1458&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/02/14/the-code-is-your-tutor-rtfsc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>

		<media:content url="http://apprenticecoder.files.wordpress.com/2012/02/abstrusegoose_otherpeoplescode1.jpg" medium="image">
			<media:title type="html">abstrusegoose_otherpeoplescode</media:title>
		</media:content>
	</item>
		<item>
		<title>[LINUX NOTES] Take your shell with you everywhere &#8211; we all SCREEN for I SCREEN</title>
		<link>http://apprenticecoder.wordpress.com/2012/01/19/linux-notes-take-your-shell-with-you-everywhere-we-all-screen-for-i-screen/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/01/19/linux-notes-take-your-shell-with-you-everywhere-we-all-screen-for-i-screen/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 22:10:34 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1110</guid>
		<description><![CDATA[This week I&#8217;ll improve my usage of screen and look up byobu too. Here are some reasons why. TABS IN THE COMMAND LINE Modern browsers have used us to the concept of tabs. Interactive web sites are full of tabs. &#8230; <a href="http://apprenticecoder.wordpress.com/2012/01/19/linux-notes-take-your-shell-with-you-everywhere-we-all-screen-for-i-screen/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1110&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This week I&#8217;ll improve my usage of screen and look up byobu too. Here are some reasons why.</p>
<p><strong>TABS IN THE COMMAND LINE</strong></p>
<p>Modern browsers have used us to the concept of tabs. Interactive web sites are full of tabs. Why not have them also in the shell? With screen and byobu you can.</p>
<p><strong>BETTER SCRIPTING PRODUCTIVITY WITH TABS</strong></p>
<p>You can write your script in one tab and execute it in another after every modification! And in tab 0, for example, you can keep the tail -f of the apache error log when you are developing web applications. You can keep different logs in different tabs and monitor stuff all over the place, even on other machines, as you go on.</p>
<p><strong>MEMORIZE FEW COMMANDS OR CREATE YOUR OWN</strong></p>
<p>There aren&#8217;t that many command to learn, and you can also bind your own keystrokes to actions in the screenrc configuration file.</p>
<p><strong>SHELL THAT DOESN&#8217;T CHEAT, IT KEEPS WORKING EVEN IF YOU&#8217;RE NOT LOOKING</strong></p>
<p>So, the shell continues working for you even if you&#8217;re not looking. You can dettach the screen on any remote machine as you leave the office and come back home, reconnect to the machine, and continue working from where you left off. You can leave a <strong>tail -f</strong> that scrolls files you want to keep track on. Or use <strong>watch</strong> (-d for colors that indicate changes, -n or &#8211;interval for interval).</p>
<p><strong>IF YOUR HAVING CONNECTIVITY PROBLEMS</strong></p>
<p>If you are having connectivity problems, broken pipes, ssh shells freezing on you, you certainly need screen, along with other measures. BTW look up <strong>nohup</strong> as well <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>ADVANCED MONITORING</strong></p>
<blockquote><p>&#8220;Just wanted to mention to other cool tricks you can do with screen. Screen can monitor a window for activity or lack thereof. This is great if you are downloading large files, compiling, or watching for output. If you are downloading something or compiling, you can watch for silence. To start the monitor, go to the screen you want to monitor and use “Ctrl-A” “M” to look for activity or “Ctrl-A” “_” to monitor for silence. Then open or switch to a new window. When the monitor detects activity or silence, you will get an alert at the bottom with the window number. To quickly go to that window, use “Ctrl-A” “ (thats a quote mark, ctrl-a then a “). After you do this, just type in the number of the window and enter. To stop monitoring, go to that window and undo the monitor with the same command. For example, to stop monitoring for activity you would use “Ctrl-A” “M” again.&#8221;</p>
<p><a id="tinymce" class="mceContentBody  wp-editor" style="overflow:hidden;clear:both;">http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/</a></p></blockquote>
<p><strong>INVITE USERS INTO A SCREEN SESSION</strong></p>
<p>An interesting teaching tool if you want to show someone how something is done in the command line. I still have to try that!</p>
<p><strong>SCROLLING AND SEARCHING</strong></p>
<p>You can&#8217;t do the usual shift and page up to scroll like in a normal shell, when in screen. But you can</p>
<p><a href="http://www.samsarin.com/blog/2007/03/11/gnu-screen-working-with-the-scrollback-buffer/">http://www.samsarin.com/blog/2007/03/11/gnu-screen-working-with-the-scrollback-buffer/</a></p>
<p><strong>CUSTOMIZE SCREEN WITH SCREENRC</strong></p>
<blockquote><p>&#8220;A typical application of this tidbit of knowledge is to launch a predefined set of windows at screen startup. Below is a sample screenrc that will do so:</p>
<pre># read in your normal screenrc
# before anything else
source $HOME/.screenrc
# now start opening windows
screen top
# it's possible to set the window title with
# the -t option
screen -t irc epic
# you can also specify the window number
# to launch in
screen -t mail 8 mutt
screen -t daemon 9 tail -f /var/log/daemon.log</pre>
<p>If you save this to $HOME/.screenrc.multiwin you can tell screen to use it instead of your normal .screenrc by running <strong>screen -c $HOME/.screenrc.multiwin</strong>&#8220;</p>
<p><a href="http://www.linuxjournal.com/article/6340?page=0,1">http://www.linuxjournal.com/article/6340?page=0,1</a></p></blockquote>
<p>I&#8217;ll write a separate post on that some day <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>More links:</strong></p>
<p>- <a href="http://www.kuro5hin.org/story/2004/3/9/16838/14935">http://www.kuro5hin.org/story/2004/3/9/16838/14935</a></p>
<p>- <a href="http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html">http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html</a></p>
<p>- <a href="http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml">http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1110&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/01/19/linux-notes-take-your-shell-with-you-everywhere-we-all-screen-for-i-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Happy Mondays, or why we need to reboot regularly</title>
		<link>http://apprenticecoder.wordpress.com/2012/01/03/happy-mondays-or-why-we-need-to-reboot-regularly/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/01/03/happy-mondays-or-why-we-need-to-reboot-regularly/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 21:50:38 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[motivational]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[apprentice]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[junior]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[work life balance]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/2012/01/03/happy-mondays-or-why-we-need-to-reboot-regularly/</guid>
		<description><![CDATA[I&#8217;ve had some long weekends and holidays lately and had to start over on Monday, or Tuesday which is not all that different, like today. I was surprised to find out that it is not as bad as I thought. &#8230; <a href="http://apprenticecoder.wordpress.com/2012/01/03/happy-mondays-or-why-we-need-to-reboot-regularly/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1106&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve had some long weekends and holidays lately and had to start over on Monday, or Tuesday which is not all that different, like today. I was surprised to find out that it is not as bad as I thought. I&#8217;d go to sleep Sunday worrying about the shock awaiting me the next day, thinking I&#8217;d fall asleep at the computer, or have a hard time getting the hang of things. Fortunately, it was much easier. As I got on the train for my daily commute I was already changing my mood, and as I entered the office and turned on the PC, <strong>it was truly a new day and it felt like one</strong>. I saw things in a new light and had a new energy to deal with them. Fresh ideas came to me, and I was better at switching points of view and being creative. And relaxed. And focused.</p>
<p><strong>But not all Mondays are like that.</strong> Maybe I need to rest enough on weekends to have a Monday like that? Who knows. I sure have to figure out the trick of it.</p>
<p>The New Year is also a big mega Monday. I&#8217;m starting to get all these New Year resolution ideas and have to remind myself not to exaggerate with expectations of myself. <strong>This is going to be a year of balance, then!</strong> No more torturing myself with perfectionism. I&#8217;ll learn to allow myself to see myself and the world from my own point of view, and live my life as such &#8211; mine.</p>
<p>Click for more musings on the subject <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and have a great New Year full of Great Happy Mondays!<span id="more-1106"></span>I don&#8217;t party much on the New Years&#8217; Eve. I usually don&#8217;t happen to have good occasions or ideas for celebrating on that day and I don&#8217;t care for having fun on demand. But it does have a meaning for me. I try not to over think it, worrying about the passing of time and such, after all, <strong>time passes every second, not only on midnight of December 31th</strong>. But there is a sense of closure. One can draw conclusions and also draw plans. <strong>One can let go of weights and loops and dispersions, and gain new energy from it.</strong> It&#8217;s one huge Happy Mega Monday.</p>
<p>Yet the important thing to remember is that life, work and coding are a marathon and not a sprint. Whatever happens, on good days or on bad days, try not to let anyone waste your energy with guilt and manipulation and stress. It would be too unhealthy. And unproductive.</p>
<p>So, do I love mondays? Sometimes. I love new energy. I love feeling concentrated and fresh. But I also have to<strong> find the balance and learn to love it</strong>, too. I need to really <strong>discover living in the present and rebooting my moods</strong> frequently.</p>
<p>And I wish the same to you too!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1106&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/01/03/happy-mondays-or-why-we-need-to-reboot-regularly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>2011 in review, happy 2012 to all!</title>
		<link>http://apprenticecoder.wordpress.com/2012/01/02/2011-in-review-happy-2012-to-all/</link>
		<comments>http://apprenticecoder.wordpress.com/2012/01/02/2011-in-review-happy-2012-to-all/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 16:50:30 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[musings]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=1008</guid>
		<description><![CDATA[What a year! I&#8217;ve returned to programming, learned so much and found a new job! I entered the world of e-learning platforms both as student and as coder, I&#8217;ve meet Drupal and deepened my knowledge of Code Igniter,  I extended &#8230; <a href="http://apprenticecoder.wordpress.com/2012/01/02/2011-in-review-happy-2012-to-all/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1008&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>What a year! I&#8217;ve returned to programming, learned so much and found a new job! I entered the world of e-learning platforms both as student and as coder, I&#8217;ve meet Drupal and deepened my knowledge of Code Igniter,  I extended my object oriented construction and patterns skills, practiced some SQL, even tried taking courses in machine learning and AI!</p>
<p>I&#8217;ve figured out a lot about what to do and what not to do, about managing my energies and nerves, preserving my enthusiasm through it all &#8211; after all, this is a marathon, not a sprint!</p>
<p>Now a new year starts, and I&#8217;m a Junior Developer. Let&#8217;s hope it all goes well. I&#8217;ll keep you posted. Yes, I haven&#8217;t blogged lately, but that&#8217;s about to change.</p>
<p>Happy 2012 to you all!</p>
<p>BTW, the WordPress.com stats helper monkeys prepared a 2011 annual report for my blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>A New York City subway train holds 1,200 people. This blog was viewed about <strong>7,200</strong> times in 2011. If it were a NYC subway train, it would take about 6 trips to carry that many people.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/1008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/1008/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=1008&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2012/01/02/2011-in-review-happy-2012-to-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Beyond good enough, the more you study for the easy parts the better you&#8217;ll be at what&#8217;s difficult</title>
		<link>http://apprenticecoder.wordpress.com/2011/11/13/beyond-good-enough-the-more-you-study-for-the-easy-parts-the-better-you-are/</link>
		<comments>http://apprenticecoder.wordpress.com/2011/11/13/beyond-good-enough-the-more-you-study-for-the-easy-parts-the-better-you-are/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 18:32:54 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[learn-from-mistakes]]></category>
		<category><![CDATA[learn-to-learn]]></category>
		<category><![CDATA[motivational]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[learn to learn]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[life long learning]]></category>
		<category><![CDATA[studying]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=995</guid>
		<description><![CDATA[Ok, I&#8217;m back. It&#8217;s been a busy few months, and I&#8217;ll likely explain why in another post. I&#8217;m a busy PHP Junior Developer now, and I&#8217;m also taking 3 online courses (offered in partnership with the Stanford University), as you&#8217;ve &#8230; <a href="http://apprenticecoder.wordpress.com/2011/11/13/beyond-good-enough-the-more-you-study-for-the-easy-parts-the-better-you-are/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=995&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Ok, I&#8217;m back. It&#8217;s been a busy few months, and I&#8217;ll likely explain why in another post. I&#8217;m a <strong>busy PHP Junior Developer</strong> now, and I&#8217;m also <strong>taking 3 online courses</strong> (offered in partnership with the<strong> Stanford</strong> University), as you&#8217;ve read in the previous posts. I&#8217;m following Introduction to <strong>Databases</strong>, <strong>Machine Learning</strong>, <strong>Artificial Intelligence</strong>. And, obviously, I&#8217;m having a hard time balancing it all: especially the time, the energy and the motivation. I&#8217;ve just taken my DB midterm quiz, and am not too happy with the results. I&#8217;m ok with the AI homework, if I manage to submit the one that is due tomorrow. And I&#8217;m behind with the Machine Learning programming exercises.</p>
<p>I&#8217;m not starring the courses. But that&#8217;s ok, this is just a test anyway, to see if I can both work and study.<strong> I must learn some of the topics, but mostly I must learn from my mistakes and learn how to learn.</strong></p>
<p>I have, clearly, made mistakes. But the important part is, what have I learned from them? Here&#8217;s a top 5 that answers that. Click &#8220;Continue reading&#8221; for the details.</p>
<p>5) Plan ahead. Plan the rest days as well. Then live each day to the fullest.</p>
<p>4) Add some aesthetics and some fun. Take great notes. Detailed great notes.</p>
<p>3) Don&#8217;t consider a course easy if a part of it is easy, or difficult if a part of it is difficult.</p>
<p>2) 80% of the work may be done with 20% effort, but A students do more than that.</p>
<p>1) The more effort you put into the easy stuff, the better you will be on the trickier parts.</p>
<p><span id="more-995"></span></p>
<p><strong>5) Plan ahead. Plan the rest days as well. Then live each day to the fullest.</strong></p>
<p>Like I mentioned before, <strong>separate planning for doing</strong>. Before the new week starts, divide all your studying into neat little sections, copy the videos and the pdfs onto your laptop or smartphone or whatever to study during the commute or the lunch break, decide exactly what you want to study for each of the evenings. Plan the rest days too, you&#8217;ll need them. If you can&#8217;t fit them in, reconsider. Or maybe not, I still haven&#8217;t decided how much to push myself, either,</p>
<p><strong>4) Add some aesthetics and some fun. Take great notes. Detailed great notes.</strong></p>
<p>Notes are crucial, both for organizing the material and your thoughts, and for saving the knowledge for later. But they can also <strong>make the studying more fun and more personal</strong>, so use colors, drawings, shapes. Write everything down, even if it looks unimportant, you want to create a complete picture, <strong>something that will make sense tomorrow and ten years from now</strong>, not just right now.</p>
<p><strong>3) Don&#8217;t consider a course easy if a part of it is easy, or difficult if a part of it is difficult.</strong></p>
<p>All courses like all life experiences have the <strong>ups and downs</strong>. <strong>Don&#8217;t be fooled by either</strong>. I&#8217;ve made a mistake, for example, of taking the DB course too lightly, since it didn&#8217;t appear as advanced as the other two, but that means that I&#8217;ve achieved much worse results if what I could have been good at, since I can&#8217;t blame the lack of prerequisites like with ML and AI.</p>
<p><strong>2) 80% of the work may be done with 20% effort, but A students do more than that.</strong></p>
<p>I&#8217;ve just figured out why I have never been a perfect A student at school. What looks like a small difference &#8211; say 1 question on a quiz, makes a huge difference in the studying habits. <strong>To get that last question right on the quiz you need to study until everything is clear to you, until you make the material completely yours.</strong> If you just kind of understand more or less all, there will always be at least <strong>that one question that you don&#8217;t get right</strong>. And the gap accumulates as you go along, the gap that separates you from being the A student, that is. So start being thorough from the beginning, from the easier stuff, and keep it going.</p>
<p><strong>1) The more effort you put into the easy stuff, the better you will be on the trickier parts.</strong></p>
<p>This is kind of connected to the previous point. Don&#8217;t just go through the motions to get the lecture or the quiz done and over with. It will cost you later. You are building up for later, the stronger the foundations the stronger the whole learning experience will be.</p>
<p><strong>That being said, we all make mistakes. At least life-long learning lets us learn from them and not repeat them in the future.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/995/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=995&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2011/11/13/beyond-good-enough-the-more-you-study-for-the-easy-parts-the-better-you-are/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
		<item>
		<title>First steps in Machine Learning</title>
		<link>http://apprenticecoder.wordpress.com/2011/10/09/first-steps-in-machine-learning/</link>
		<comments>http://apprenticecoder.wordpress.com/2011/10/09/first-steps-in-machine-learning/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 21:53:59 +0000</pubDate>
		<dc:creator>apprenticecoder</dc:creator>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[online courses]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[Stanford]]></category>

		<guid isPermaLink="false">http://apprenticecoder.wordpress.com/?p=980</guid>
		<description><![CDATA[My e-learning has started, a week before the official start of the Stanford online classes. They have already made available some videos and quizzes, and us students have started strong. The Machine Learning class Twitter account announces some interesting numbers, &#8230; <a href="http://apprenticecoder.wordpress.com/2011/10/09/first-steps-in-machine-learning/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=980&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>My e-learning has started, a week before the official start of the Stanford online classes.</strong> They have already made available some videos and quizzes, and us students have started strong. The <a href="http://twitter.com/#!/ml_class/">Machine Learning class Twitter account</a> announces some interesting numbers, talking about tens of thousands of students enrolled and quizzes attempted.</p>
<p>I have already started learning the basics of <a title="Machine Learning Stanford online class" href="http://www.ml-class.org" target="_blank">Machine Learning,</a> which starts with the <strong>definition of Machine Learning</strong> itself. At a certain point, it has been noted that there are some problems for which it is better to let the computer learn by itself, instead of programming it explicitly. That&#8217;s what the <strong>1959</strong> definition by <a title="Arthur Samuel Wikipedia page" href="http://en.wikipedia.org/wiki/Arthur_Samuel" target="_blank"><strong>Arthur Samuel</strong></a> is about: it states that ML is the field of study that gives <strong>computers the ability to learn without being explicitly programmed</strong>. This may sound strange, since we know that computers can&#8217;t really do anything that we haven&#8217;t programmed them to do, or some variation of that. But think about this: Arthur Samuel was not a great checkers player, but he managed to teach the computer to play and improve with every time, until the <strong>computer became better at checkers than he was</strong>. Also when scientists wanted to teach a helicopter to fly autonomously, they found that the best thing was to let it learn on its own. But how does that happen?</p>
<p>The same way that we do, computers sometimes learn from experience. They repeat and learn, repeat and learn. That brings us to the second definition of Machine Learning: <strong>it allows computers to improve its performance over time on a specific task, from experience</strong>. It was coined by <a title="Tom M. Mitchell Wikipedia page" href="http://en.wikipedia.org/wiki/Tom_M._Mitchell" target="_blank"><strong>Tom Mitchell</strong></a> in <strong>1998</strong> and the complete phrasing is that a computer is said to <em>learn</em> from experience <strong>E</strong> with respect to some task <strong>T</strong> and some performance measure <strong>P</strong> if its performance on T, as measured by P, improves with experience E.</p>
<p>What does that mean concretely? One way is that basically we can give a computer a <strong>training set</strong> of data as input, and it can try to find a function which fits the data reducing the amount of errors, it can basically <strong>infer a function</strong> to  use to predict further similar results (like apartment prices given a set of variables). And I&#8217;ve already taken a sneak peek at the mathematics behind that.</p>
<p>Which is obviously extremely exciting and I would like to thank Stanford, <strong>Prof. Andrew Ng</strong> and the whole ml-class.org team for this opportunity.</p>
<p>Click &#8220;Continue reading&#8221; for more details.</p>
<p>[EDIT] You can find some Machine Learning video lectures by Andrew Ng at<a href="http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=MachineLearning"> http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=MachineLearning</a></p>
<p><span id="more-980"></span>Machine Learning is divided into <strong><a title="Machine learning, supervised" href="http://en.wikipedia.org/wiki/Supervised_learning" target="_blank">supervised</a> and unsupervised</strong>. From what I have understood, we use supervised learning when we already know what we are looking for, say we are trying to classify something, for example decide if tomorrow&#8217;s weather is going to be cold, warm or hot, or if we are looking for an exact numeric value of something, like apartment prices<strong>. Which means that supervised learning is divided into classification and regression problems (looking for the numeric value).</strong></p>
<p>Wikipedia puts it like this (retrieved 2011-01-09):</p>
<blockquote><p>&#8220;<strong>Supervised learning</strong> is the <a title="Machine learning" href="http://en.wikipedia.org/wiki/Machine_learning">machine learning</a> task of inferring a function from <em>supervised</em> training data. The <a title="Training set" href="http://en.wikipedia.org/wiki/Training_set">training data</a> consist of a set of <em>training examples</em>. In supervised learning, each example is a <em>pair</em> consisting of an input object (typically a vector) and a desired output value (also called the <em>supervisory signal</em>). A supervised learning algorithm analyzes the training data and produces an inferred function, which is called a <em>classifier</em> (if the output is discrete, see <a title="Statistical classification" href="http://en.wikipedia.org/wiki/Statistical_classification">classification</a>) or a <em>regression function</em> (if the output is continuous, see <a title="Regression analysis" href="http://en.wikipedia.org/wiki/Regression_analysis">regression</a>). The inferred function should predict the correct output value for any valid input object. This requires the learning algorithm to generalize from the training data to unseen situations in a &#8220;reasonable&#8221; way (see <a title="Inductive bias" href="http://en.wikipedia.org/wiki/Inductive_bias">inductive bias</a>).&#8221;</p></blockquote>
<p>A simple example would be this: we try to predict apartment prices based on the distance from the town center. So we have a training set of many x&#8217;s and y&#8217;s where x is the distance and y is the price. We put these on a graph, and try to find a function which fits as many of these dots as possible. It doesn&#8217;t have to fit all of them, we are just trying to minimize the error. So let&#8217;s say the function we are trying to find is linear, like θ0 + θ1*x. That leads to a second function, the cost function, which depends on the two thetas and is J(θ0, θ1) and is the one we have to minimize to find the way to make as little mistakes as possible. We can do this by brute force &#8211; trying different values and seeing what happens, or by more advanced algorithms. So far I&#8217;ve used the brute force approach with the help of a gradient descent algorithm which finds the lowest point(s) of the cost function bowl/u-shape. Basically, it does what we would do if trying to go downhill on a mountain &#8211; take little steps lower and lower, and using the steepness &#8211; the derivative, to calculate that.</p>
<p>That&#8217;s linear regression. With one variable. Just to get started.</p>
<p><strong>Unsupervised learning</strong> sounds interesting &#8211; it lets us find <strong>patterns that we didn&#8217;t define</strong> ahead of time, like when looking for clusters on social networks, or when Google groups together its news. I haven&#8217;t learned much about that yet, but I&#8217;ll keep you posted.</p>
<p>Have fun, and learn something new every day.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/apprenticecoder.wordpress.com/980/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/apprenticecoder.wordpress.com/980/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=apprenticecoder.wordpress.com&#038;blog=15015778&#038;post=980&#038;subd=apprenticecoder&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://apprenticecoder.wordpress.com/2011/10/09/first-steps-in-machine-learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b5b7f41fdf91e73c9ca71843a57d5dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">apprenticecoder</media:title>
		</media:content>
	</item>
	</channel>
</rss>
