<?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>Victor Stanciu &#187; Development</title>
	<atom:link href="http://www.victorstanciu.ro/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.victorstanciu.ro</link>
	<description>Web Developer, Geek</description>
	<lastBuildDate>Sat, 10 Jul 2010 07:39:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Trying out The Pomodoro Technique</title>
		<link>http://www.victorstanciu.ro/trying-out-the-pomodoro-technique/</link>
		<comments>http://www.victorstanciu.ro/trying-out-the-pomodoro-technique/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 17:56:51 +0000</pubDate>
		<dc:creator>Victor Stanciu</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Lifehacks]]></category>
		<category><![CDATA[pomodoro]]></category>
		<category><![CDATA[procrastination]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.victorstanciu.ro/?p=513</guid>
		<description><![CDATA[In the raging, aeon-spanning battle against procrastination, I am constantly on the lookout (while procrastinating, of course) for ways to improve my productivity and help me work more efficiently. This is how I stumbled on The Pomodoro Technique, and gave it a try. The rundown At it&#8217;s core, the technique consists of splitting your work [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a class="fullimg" href="http://www.victorstanciu.ro/trying-out-the-pomodoro-technique/" title="Trying out The Pomodoro Technique"><img src="http://www.victorstanciu.ro/wp-content/uploads/2010/06/pomodoro.png" alt="The Pomodoro Technique" title="The Pomodoro Technique" width="474" height="160" class="alignnone size-full wp-image-553" /></a></p>
<p>In the raging, aeon-spanning battle against procrastination, I am constantly on the lookout (while procrastinating, of course) for ways to improve my productivity and help me work more efficiently. This is how I stumbled on <a href="http://www.pomodorotechnique.com/">The Pomodoro Technique</a>, and gave it a try.</p>
<h2>The rundown</h2>
<p>At it&#8217;s core, the technique consists of splitting your work in <strong>25 minute</strong> intervals, with a <strong>5 minute</strong> break between each interval, and a longer break (15-30 minutes) after <strong>3-4</strong> such intervals (pomodoros). </p>
<p>In theory, it should help you stay focused and productive, by timeboxing your tasks into <strong>undividable</strong> chunks and then help you analyze and measure your productivity in uninterrupted pomodoros.</p>
<p>The trick is, if you somehow get distracted during a pomodoro (either by other people or by yourself), that pomodoro <strong>no longer counts</strong>. Even if you happen to take &#8220;just a peek&#8221; at reddit&#8217;s homepage in the 23rd minute (although you and me both know there is no such thing as &#8220;just a peek&#8221; when it comes to reddit.com). </p>
<p>After the first few days with just a few finished pomodoros per day, you <strong>will</strong> do your best to avoid interruptions.</p>
<h2>Will it help me avoid said interruptions?</h2>
<p>No, it will not. It will only make the measure in which these interruptions affect you crystal clear, by showing you just how little actual uninterrupted work you do each day. <a href="http://www.pomodorotechnique.com/resources.html">The book</a> does have an entire chapter dedicated to interruptions and how to handle them, and it&#8217;s a short read.</p>
<h2>Is it worth it?</h2>
<p>First of all, it&#8217;s not a silver bullet. <a href="http://www.peterkretzman.com/2009/12/16/no-silver-bullets-really/">There are no silver bullets</a>. It all boils down to your own resolve in sticking to a pattern and work in a less chaotic manner. I find it worthwhile and plan to keep using it for now, for the following reasons:</p>
<ul>
<li>Two pomodoros make an ideal work hour (hour of actual continuous work), which is just the right unit to use as a Story Point to measure <a href="http://www.agilemodeling.com/artifacts/userStory.htm">User Stories</a> in.</li>
<li>It helps with estimating and breaking down tasks, because it makes you split longer tasks into smaller, more specific and manageable units (more about this in the book).</li>
<li>It delivers what it promises: a mechanism to keep you focused and avoid &#8230; temptations.</li>
</ul>
<p>So go ahead, give it a try, but keep in mind, it will be hard at first; it will hurt your feelings, and like with all things that shine a light on existing problems, you will be tempted to give it up pretty soon.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.victorstanciu.ro/trying-out-the-pomodoro-technique/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why testing doesn&#8217;t really happen until after D-Day</title>
		<link>http://www.victorstanciu.ro/why-testing-doesnt-really-happen-until-after-d-day/</link>
		<comments>http://www.victorstanciu.ro/why-testing-doesnt-really-happen-until-after-d-day/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 22:27:13 +0000</pubDate>
		<dc:creator>Victor Stanciu</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://www.victorstanciu.ro/?p=475</guid>
		<description><![CDATA[It happened to all of you. You work on a project and keep delivering features at a steady pace. You test your own work, and get constant confirmation from your project managers that each feature has been tested, and you have a green light to move on from the customer. The release date is closing [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>It happened to all of you. You work on a project and keep delivering features at a steady pace. You test your own work, and get constant confirmation from your project managers that each feature has been <strong>tested</strong>, and you have a green light to move on from the customer.</p>
<p>The release date is closing in, you manage to wrap everything up, and <strong>launch</strong>. You lean back in your chair and think to yourself &#8220;ahh, another job well done&#8221;.</p>
<p>Then, out of nowhere, after just a few hours in, your task list / inbox gets filled with things like <em>&#8220;How can I do X?&#8221;</em>, <em>&#8220;We have an issue with Y&#8221; </em>and the dreaded <em>&#8220;Z isn&#8217;t working&#8221;</em>. You open the list, scan the first few items, and it hits you:</p>
<p><em>&#8220;Wait a minute, we&#8217;ve been over these, this is the way this feature was </em><strong><em>supposed</em></strong><em> to work, it&#8217;s been </em><strong><em>tested</em></strong><em>.&#8221;.</em></p>
<p>Ahh, but you see, it <strong>wasn&#8217;t</strong>.</p>
<h2>But how could this happen?</h2>
<p>Here&#8217;s the thing: your customers don&#8217;t <strong>really</strong> test. Your project managers don&#8217;t really test. You don&#8217;t really test. Not until the lauch date that is. That&#8217;s when everyone <strong>really</strong> starts testing.</p>
<p><em>&#8220;But, we had at least 6 people involved in this project at all times. Surely between them they tested everything&#8221;.</em></p>
<p>Well, not really, no. You see, every person involved in your project has a certain way of  looking at it.</p>
<p><strong>You</strong> have a list of features that needs implemented. While you churn out feature after feature, you only tend to test the specific behavior you built into each one. &#8220;Right, so the user clicks this, fills out this form, and ends up here.&#8221;.</p>
<p>You don&#8217;t really try to break your own application, so you only interact with it in the way it&#8217;s meant to work. And of course, it works &#8230; &#8220;on your machine&#8221;.</p>
<p>Your <strong>project managers</strong> don&#8217;t test because they don&#8217;t have the time for it, because they have that meeting about that other project with that other client in 10 minutes, just pop them an email and they&#8217;ll look it up later &#8230; They won&#8217;t. They&#8217;ll be too busy.<br />
They&#8217;ll rephrase parts of your email (because really, you suck at writing to corporate clients), and forward it to the customer. And they will not get a chance to test it again &#8230; until after the lauch date, when &#8230;</p>
<p>&#8230; the<strong> </strong><strong>customer</strong> will start testing. The customer, the person you build the entire project for, doesn&#8217;t even remotely start testing until after the project has set sail. Why? Because until then, to them, the project is not real yet. It&#8217;s &#8220;under construction&#8221;.</p>
<p>They will open it up, have a peek, and unless something is downright wrong, they will not notice it. They will not follow the individual interaction flows, they will not start using the project like they will use it for real. <em>&#8220;Oh, I can see some products, that probably means the entire administering, checkout and billing processes must be working.&#8221;</em>.</p>
<p>Most of the problems that will rise from the customer&#8217;s lack of testing are those when he expects a feature to work a certain way, but he described it to your project manager at first in a totally different way. And she described it to you in yet another way. And you developed it &#8220;your way&#8221;.</p>
<h2>Who&#8217;s fault is it?</h2>
<p>No one&#8217;s really. All of yours.</p>
<ul>
<li>The client is thinking <em>&#8220;I pay these people a lot of money, and the product is full of problems, I wanted something else.&#8221;</em>.</li>
<li>The project manager is thinking <em>&#8220;It&#8217;s that arrogant developer&#8217;s fault, I distinctly remember giving him precise instructions on how this should work&#8221;</em>.</li>
<li>We all know what you&#8217;re thinking &#8230; <em>&#8220;These damn mortals better let me get back to reddit.com&#8221;</em>.</li>
</ul>
<h2>Who should test?</h2>
<p>First of all, nothing beats professional testing. Ideally, you should have dedicated testers, but odds are you will have to make do with what you have available.</p>
<p>So there is good news, and bad news:</p>
<p>The <strong>good</strong> news is that, when searching for bugs, it&#8217;s easy! Grab a few members of your team that don&#8217;t work on this particular project. Best to do this with all types of colleagues: other developers, account managers, even the office secretary.</p>
<p>Sit down with them, and politely ask them if they can spare any amount of time to test your product. Then assign them some user roles, and let them loose.</p>
<p>The <strong>bad</strong> news is that application bugs are the easiest to find and fix. The biggest issues come from what I said earlier: <strong>miscommunication</strong>.</p>
<ul>
<li>The customer is not skilled in describing his needs. Most of the time he doesn&#8217;t even know his needs, and this is absolutely normal.</li>
<li>Your project managers don&#8217;t have enough experience in the customer&#8217;s business field, or not enough technical skills. So they interpret the customer&#8217;s requests, and relay them to you wrongly.</li>
<li>In-house problems. Trust issues and other problems can seriously affect the way people work together and communicate (more on this soon).</li>
</ul>
<p>My bet is that shorter release cycles, more customer involvement (the project managers really have to step up here), and enhanced communication can at least lessen the impact of these problems on the typical project. Also, the <a title="User Stories" href="http://www.extremeprogramming.org/rules/userstories.html">User Stories</a> and <a title="Acceptance Tests" href="http://www.extremeprogramming.org/rules/functionaltests.html">Acceptance Tests</a> agile development concepts fit perfectly.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.victorstanciu.ro/why-testing-doesnt-really-happen-until-after-d-day/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Redirect all requests (including POST) from one Apache server to another</title>
		<link>http://www.victorstanciu.ro/redirect-all-requests-including-post-from-one-apache-server-to-another/</link>
		<comments>http://www.victorstanciu.ro/redirect-all-requests-including-post-from-one-apache-server-to-another/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 14:04:36 +0000</pubDate>
		<dc:creator>Victor Stanciu</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.victorstanciu.ro/?p=461</guid>
		<description><![CDATA[In order to test POST callbacks made by a payment gateway without having to work via FTP on a publicly-accessible server, I needed a simple solution to redirect all requests from said server to my workstation, that is on the same network as the server, but is not accessible from outside. The easiest thing to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>In order to test POST callbacks made by a payment gateway without having to work via FTP on a publicly-accessible server, I needed a simple solution to redirect all requests from said server to my workstation, that is on the same network as the server, but is not accessible from outside.</p>
<p>The easiest thing to do was to use the <strong>mod_rewrite</strong>, <strong>mod_proxy</strong> and <strong>mod_proxy_http</strong> Apache modules. You can easily activate all of them in Ubuntu with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">sudo a2enmod rewrite proxy proxy_http</pre></td></tr></table></div>

<p>I created an empty folder on the server and placed a <strong>.htaccess</strong> file with the following lines in it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">RewriteEngine On
RewriteRule ^(.*)$ http://10.4.2.155/$1 [NC,P]</pre></td></tr></table></div>

<p>The <strong>[P]</strong> at the end of the RewriteRule specifies that the request should be handled by the proxy module so all GET and POST data are preserved. Therefore, all requests made in that directory will be automatically forwarded to my machine.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.victorstanciu.ro/redirect-all-requests-including-post-from-one-apache-server-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closure: Extend ui.DatePicker to highlight events</title>
		<link>http://www.victorstanciu.ro/closure-extend-ui-datepicker-to-highlight-events/</link>
		<comments>http://www.victorstanciu.ro/closure-extend-ui-datepicker-to-highlight-events/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 16:49:24 +0000</pubDate>
		<dc:creator>Victor Stanciu</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Closure]]></category>
		<category><![CDATA[DatePicker]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.victorstanciu.ro/?p=378</guid>
		<description><![CDATA[I got a change to play with the new Google Closure Library a bit, and since the DatePicker component is pretty nice, i figured i could enhance it a bit to suit a need i had some time ago: overlay data from a database, highlight the dates that correspond to events, and jump to the event&#8217;s page [...]


<b>Related posts</b>:<ol><li><a href='http://www.victorstanciu.ro/update-carousel/' rel='bookmark' title='Permanent Link: Update Carousel'>Update Carousel</a></li><li><a href='http://www.victorstanciu.ro/ajaj-autocompleter/' rel='bookmark' title='Permanent Link: AJAJ Autocompleter'>AJAJ Autocompleter</a></li><li><a href='http://www.victorstanciu.ro/sizzle-prototype/' rel='bookmark' title='Permanent Link: Sizzle si Prototype'>Sizzle si Prototype</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I got a change to play with the new <a href="http://code.google.com/closure/library/">Google Closure Library</a> a bit, and since the <a href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/class_goog_ui_DatePicker.html">DatePicker</a> component is pretty nice, i figured i could enhance it a bit to suit a need i had some time ago: overlay data from a database, highlight the dates that correspond to events, and jump to the event&#8217;s page when clicking on a highlighted cell.</p>
<p><a href="http://dev.victorstanciu.ro/google-closure/examples/events-date-picker/"><strong>Example page</strong></a><br />
<a href="http://dev.victorstanciu.ro/google-closure/examples/events-date-picker/eventsdatepicker.js"><strong>Example script</strong></a></p>
<h2>Step 1: provide the JSON events in HTML:</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> events <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #009900;">&#123;</span>date<span style="color: #339933;">:</span> <span style="color: #3366CC;">'2009-11-05'</span><span style="color: #339933;">,</span> url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://www.example.com'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>date<span style="color: #339933;">:</span> <span style="color: #3366CC;">'2009-11-07'</span><span style="color: #339933;">,</span> url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://www.example.com'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>date<span style="color: #339933;">:</span> <span style="color: #3366CC;">'2009-11-10'</span><span style="color: #339933;">,</span> url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://www.example.com'</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h2>Step 2: extend goog.ui.DatePicker:</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">goog.<span style="color: #660066;">provide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'goog.ui.EventsDatePicker'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
goog.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'goog.ui.DatePicker'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>opt_events<span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">events</span> <span style="color: #339933;">=</span> opt_events<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
goog.<span style="color: #660066;">inherits</span><span style="color: #009900;">&#40;</span>goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span><span style="color: #339933;">,</span> goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Notice how inheritance is handled with Closure. Even though we call <b>goog.inherits()</b>, we <b>must</b> also call the superclass constructor for it to work.</p>
<h2>Step 3: highlight events:</h2>
<p>goog.ui.DatePicker has a <b>setDecorator()</b> method, that accepts a function as it&#8217;s parameter. The function should take a Date object and return a CSS class name to decorate the corresponding cell with.</p>
<p>It&#8217;s basically called once for every cell in the picker, and we are going to use this by checking whether an event exists for the date and return &#8220;goog-date-picker-event&#8221; if so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>opt_events<span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">events</span> <span style="color: #339933;">=</span> opt_events<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// new line:</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setDecorator</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">eventDecorator</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
goog.<span style="color: #660066;">inherits</span><span style="color: #009900;">&#40;</span>goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span><span style="color: #339933;">,</span> goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Searches the events array and returns the event corresponding to passed date
 */</span>
goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">findEventByDate</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> dateString <span style="color: #339933;">=</span> date.<span style="color: #660066;">toIsoString</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> event      <span style="color: #339933;">=</span> goog.<span style="color: #660066;">array</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">events</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> event.<span style="color: #660066;">date</span> <span style="color: #339933;">==</span> dateString<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> event<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Returns a CSS class name to use for cells that have events
 */</span>
goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">eventDecorator</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> event <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">findEventByDate</span><span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event <span style="color: #339933;">!==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'goog-date-picker-event'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Notice the use of <a href="http://closure-library.googlecode.com/svn/trunk/closure/goog/docs/closure_goog_array_array.js.html">goog.array.find()</a> to find the event that matches the date.</p>
<h2>Step 4: click events:</h2>
<p>We will use the findEventByDate function defined above and DatePicker&#8217;s SELECT event to jump to an event&#8217;s URL when clicking on it&#8217;s date:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>opt_events<span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> opt_date<span style="color: #339933;">,</span> opt_dateTimeSymbols<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">events</span> <span style="color: #339933;">=</span> opt_events<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setDecorator</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">eventDecorator</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// new line:</span>
    goog.<span style="color: #660066;">events</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">DatePicker</span>.<span style="color: #660066;">Events</span>.<span style="color: #660066;">SELECT</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dateClicked</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">/**
 * Checks if an event cell was clicked, and jumps to the event's URL if true
 */</span>
goog.<span style="color: #660066;">ui</span>.<span style="color: #660066;">EventsDatePicker</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">dateClicked</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> date  <span style="color: #339933;">=</span> event.<span style="color: #660066;">date</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> event <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">findEventByDate</span><span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event <span style="color: #339933;">!==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> event.<span style="color: #660066;">url</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        document.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span> <span style="color: #339933;">=</span> event.<span style="color: #660066;">url</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it :). It&#8217;s a short example, but it covers some of the basic aspects of inheritance, event listeners, and some of the utility methods. Closure looks nice :)</p>
<p><a href="http://dev.victorstanciu.ro/google-closure/examples/events-date-picker/"><strong>Example page</strong></a><br />
<a href="http://dev.victorstanciu.ro/google-closure/examples/events-date-picker/eventsdatepicker.js"><strong>Example script</strong></a></p>


<p><b>Related posts</b>:<ol><li><a href='http://www.victorstanciu.ro/update-carousel/' rel='bookmark' title='Permanent Link: Update Carousel'>Update Carousel</a></li><li><a href='http://www.victorstanciu.ro/ajaj-autocompleter/' rel='bookmark' title='Permanent Link: AJAJ Autocompleter'>AJAJ Autocompleter</a></li><li><a href='http://www.victorstanciu.ro/sizzle-prototype/' rel='bookmark' title='Permanent Link: Sizzle si Prototype'>Sizzle si Prototype</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.victorstanciu.ro/closure-extend-ui-datepicker-to-highlight-events/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Synchronizing tasks between Trac and Netbeans</title>
		<link>http://www.victorstanciu.ro/synchronizing-tasks-between-trac-and-netbeans/</link>
		<comments>http://www.victorstanciu.ro/synchronizing-tasks-between-trac-and-netbeans/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 21:24:54 +0000</pubDate>
		<dc:creator>Victor Stanciu</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[cubeon]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://www.victorstanciu.ro/?p=349</guid>
		<description><![CDATA[Cube°n is a NetBeans plugin that integrates and synchronizes the IDEs tasks with some of the most common issue-tracking systems, including Trac. It has some very nice features, including support for multiple Trac repositories, custom ticket filtering based on Trac queries, and many more. To install and start using Cube°n you will need to: Install [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a title="Cube°n" href="http://code.google.com/p/cubeon/">Cube°n</a> is a <a href="http://www.netbeans.org/">NetBeans</a> plugin that integrates and synchronizes the IDEs tasks with some of the most common issue-tracking systems, including <a title="Trac" href="http://trac.edgewall.org/">Trac</a>.</p>
<p>It has some very nice features, including support for multiple Trac repositories, custom ticket filtering based on <a href="http://trac.edgewall.org/wiki/TracQuery">Trac queries</a>, and many more.</p>
<p>To install and start using Cube°n you will need to:</p>
<ul>
<li>Install the plugin, either by manually <a title="Download Cube°n" href="http://code.google.com/p/cubeon/downloads/list">downloading</a> the files or by adding the update center to NetBeans (Tools -&gt; Plugins -&gt; Settings -&gt; Add -&gt; <a href="http://cubeon.googlecode.com/svn/updates/latest.xml">http://cubeon.googlecode.com/svn/updates/latest.xml</a>) and selecting it from the plugin &#8220;Available plugins&#8221; list</li>
<li>Install the patched XML-RPC plugin for Trac:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">wget http://cubeon.googlecode.com/files/TracXMLRPC-1.6.6-py2.6.egg
easy_install TracXMLRPC-1.6.6-py2.6.egg</pre></div></div>

<ul>
<li>Make sure you enable the new XML-RPC plugin and the HTTP authentication plugin by adding the following in your trac.ini file:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[components]
tracrpc.* = enabled
httpauth.* = enabled
&nbsp;
[httpauth]
paths = /login, /login/xmlrpc</pre></div></div>

<p>That&#8217;s it. You can now use the plugin (Window -&gt; Cube°n -&gt; Task Repositories and Task Explorer), and start adding Trac repositories and adding / synchronizing tasks.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.victorstanciu.ro/synchronizing-tasks-between-trac-and-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
