Export new and changed files only using TortoiseSVN
I was forced to do some work under Windows these days, and when it came time to deploy the files I changed to the FTP server, I had to figure out how to use TortoiseSVN in order to only export the files that have been created or updated since the last deployment. As it turns out, it’s pretty easy:
- First, bring up the TortoiseSVN menu by right clicking on your working copy.
- From the menu, choose “Show Log”.
- Holding down the CTRL key, select the two revisions you want to compare (like this).
- Right click on one of the two revisions and select the Compare revisions option.
- In the file list that appears, select all the entries (CTRL+A), right click on them and select the Export selection to… option. The files will be exported with the right directory structure, so all you have to do is upload them to the server.
Unfortunately, this method only works for new files or files that have been changed. The files that have been removed will have to be manually deleted from the server too.
There are, of course, tons of better tools to deploy files to FTP servers that can also handle removed files (Springloops is my current favorite), but this is quick and easy way to do it when you don’t have a better solution on hand.
Dynamically resizing the Shadowbox.js modal window
Shadowbox.js is an excellent modal window component capable of handling everything from iFrames to Flash videos to image galleries. However, and odd as it seems, the out-of-the-box solution doesn’t have a resize() method with which to resize the modal window via JavaScript. The reason you might want to manually resize the modal window is in case the content inside changes, for example in the case of IFrames. Fortunately, implementing such a method is quite easy.
First, download Shadowbox. As of this version, the downloaded files are automatically minified, so in order to be able to properly add the needed code you will have to prettify the code, using a tool such as http://jsbeautifier.org/.
After you have prettified the code, scroll down right after the onWindowResize method, which should look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | k.onWindowResize = function () { if (!P) { return } I(); var K = g.player, S = R(K.height, K.width); t(S.width, S.left); E(S.innerHeight, S.top); if (K.onWindowResize) { K.onWindowResize() } }; |
The reason I am including the onWindowResize method is because, the code being packed, the variable names might change in subsequent versions of Shadowbox, so you will have to take a look at an existing function. Now, right below the onWindowResize method, add the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | k.dynamicResize = function (w, h) { if (!P) { return } I(); g.player.width = w; g.player.height = h; var K = g.player, S = R(K.height, K.width); t(S.width, S.left); E(S.innerHeight, S.top); if (K.onWindowResize) { K.onWindowResize() } }; |
Notice that there are only three lines that differ between the two methods. After adding this method (and perhaps minifying the code again), you can easily resize the modal like this:
1 | Shadowbox.skin.dynamicResize(600, 400); |
Or, if you want to do it from inside the iframe loaded within the modal:
1 | window.parent.Shadowbox.skin.dynamicResize(600, 400); |
Note that this method does not resize the window beyond the viewport dimensions. It will still be scaled down if it exceeds the viewport’s width or height.
Trying out The Pomodoro Technique
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’s core, the technique consists of splitting your work in 25 minute intervals, with a 5 minute break between each interval, and a longer break (15-30 minutes) after 3-4 such intervals (pomodoros).
In theory, it should help you stay focused and productive, by timeboxing your tasks into undividable chunks and then help you analyze and measure your productivity in uninterrupted pomodoros.
The trick is, if you somehow get distracted during a pomodoro (either by other people or by yourself), that pomodoro no longer counts. Even if you happen to take “just a peek” at reddit’s homepage in the 23rd minute (although you and me both know there is no such thing as “just a peek” when it comes to reddit.com).
After the first few days with just a few finished pomodoros per day, you will do your best to avoid interruptions.
Will it help me avoid said interruptions?
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. The book does have an entire chapter dedicated to interruptions and how to handle them, and it’s a short read.
Is it worth it?
First of all, it’s not a silver bullet. There are no silver bullets. 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:
- 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 User Stories in.
- 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).
- It delivers what it promises: a mechanism to keep you focused and avoid … temptations.
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.
Why testing doesn’t really happen until after D-Day
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 in, you manage to wrap everything up, and launch. You lean back in your chair and think to yourself “ahh, another job well done”.
Then, out of nowhere, after just a few hours in, your task list / inbox gets filled with things like “How can I do X?”, “We have an issue with Y” and the dreaded “Z isn’t working”. You open the list, scan the first few items, and it hits you:
“Wait a minute, we’ve been over these, this is the way this feature was supposed to work, it’s been tested.”.
Ahh, but you see, it wasn’t.
But how could this happen?
Here’s the thing: your customers don’t really test. Your project managers don’t really test. You don’t really test. Not until the lauch date that is. That’s when everyone really starts testing.
“But, we had at least 6 people involved in this project at all times. Surely between them they tested everything”.
Well, not really, no. You see, every person involved in your project has a certain way of looking at it.
You 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. “Right, so the user clicks this, fills out this form, and ends up here.”.
You don’t really try to break your own application, so you only interact with it in the way it’s meant to work. And of course, it works … “on your machine”.
Your project managers don’t test because they don’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’ll look it up later … They won’t. They’ll be too busy.
They’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 … until after the lauch date, when …
… the customer will start testing. The customer, the person you build the entire project for, doesn’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’s “under construction”.
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. “Oh, I can see some products, that probably means the entire administering, checkout and billing processes must be working.”.
Most of the problems that will rise from the customer’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 “your way”.
Who’s fault is it?
No one’s really. All of yours.
- The client is thinking “I pay these people a lot of money, and the product is full of problems, I wanted something else.”.
- The project manager is thinking “It’s that arrogant developer’s fault, I distinctly remember giving him precise instructions on how this should work”.
- We all know what you’re thinking … “These damn mortals better let me get back to reddit.com”.
Who should test?
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.
So there is good news, and bad news:
The good news is that, when searching for bugs, it’s easy! Grab a few members of your team that don’t work on this particular project. Best to do this with all types of colleagues: other developers, account managers, even the office secretary.
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.
The bad news is that application bugs are the easiest to find and fix. The biggest issues come from what I said earlier: miscommunication.
- The customer is not skilled in describing his needs. Most of the time he doesn’t even know his needs, and this is absolutely normal.
- Your project managers don’t have enough experience in the customer’s business field, or not enough technical skills. So they interpret the customer’s requests, and relay them to you wrongly.
- In-house problems. Trust issues and other problems can seriously affect the way people work together and communicate (more on this soon).
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 User Stories and Acceptance Tests agile development concepts fit perfectly.
Redirect all requests (including POST) from one Apache server to another
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 do was to use the mod_rewrite, mod_proxy and mod_proxy_http Apache modules. You can easily activate all of them in Ubuntu with:
1 | sudo a2enmod rewrite proxy proxy_http |
I created an empty folder on the server and placed a .htaccess file with the following lines in it:
1 2 | RewriteEngine On RewriteRule ^(.*)$ http://10.4.2.155/$1 [NC,P] |
The [P] 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.

Sunt Victor Stanciu, web developer, si scriu despre dezvoltare, standarde, tehnici si tehnologii. (