December 15th, 2009
Freshly installed Far Manager looks um… small:

Here’s how to make its window bigger:
- Right-click on the window title, select Properties
- Switch to Font tab
- Select a bigger font. I prefer raster font 10 x 18.
- (optional) Switch to Layout tab and change window size there. I leave it as 80 x 25.
Posted in Software | Tags: far-manager | No Comments »
December 10th, 2009
Sometimes I need to do something with file that Far Manager can’t help me with. Good example is changing file permissions. In these cases Windows Explorer context menu comes handy:

If you want context menu in Far Manager you need EMenu plugin. Fortunately, it is included with Far by default. Here’s how to set it up:
- Execute [C:\Program Files\Far\Plugins\EMenu\Hotkey.reg]
- Restart Far Manager
- Open Options menu, then Plugins configuration. Select EMenu in the list.
- Uncheck “Show message after execution”.
Now Menu key should invoke context menu. Nice trick is to select Send To – Mail Recipient to quickly open new email with the file attached.
Posted in Software | Tags: far-manager | No Comments »
December 9th, 2009
Have you ever encountered this error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=”true”/> in configuration or <%@ Page EnableEventValidation=”true” %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
That’s pretty long error message. I get this exception if I add items to drop-down control from JavaScript. The question is how to use ClientScriptManager.RegisterForEventValidation method?
First, let’s reproduce the problem. Create a new website and copy/paste this code:
<asp:DropDownList ID="dd" runat="server">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="Test" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function()
{
$("#<%= dd.ClientID %>").append($("<option />")
.val(3)
.text("Three!"));
});
</script>
If you select option “Three” sure enough, exception is thrown. To prevent it you need to supply all possible values for drop-down control:
protected override void Render(HtmlTextWriter writer)
{
Page.ClientScript.RegisterForEventValidation(dd.UniqueID, "3");
Page.ClientScript.RegisterForEventValidation(dd.UniqueID, "4");
Page.ClientScript.RegisterForEventValidation(dd.UniqueID, "11");
// and so on
base.Render(writer);
}
The exception is fixed but server variable for drop-down control is useless – it has no idea that you’ve added new item so dd.SelectedValue will give One, not 3. You need to read POST variable directly instead, like this:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
Response.Write(Request.Form[dd.UniqueID]);
}
Posted in Develop | No Comments »
September 16th, 2009
Here’s how you can view whitespaces in Emacs:
M-x whitespace-mode RET
By default, Emacs uses bright colours to highlight whitespaces that are in wrong place (in Emacs’ opinion):

To disable colouring add the following to your .emacs file:
; disable colours in whitespace-mode
(setq whitespace-style '(space-mark tab-mark))
Now it’s much better:

I assign showing white spaces to Ctrl+Shift+8 to mimick Visual Studio behaviour:
(global-set-key (kbd "C-*") 'whitespace-mode)
Posted in Develop | No Comments »
August 5th, 2009
Let’s say you use Far Manager and want to launch PowerShell script. With default installation pressing Enter on PowerShell script in Far Manager will open the script in Notepad. Not very helpful.

Here’s how to configure Far Manager to launch PowerShell script by pressing Enter key:
- Open Commands menu, select File associations.
- Press Ins key to add new association.
- Enter *.ps1 as file mask.
- Enter the following as execute command:
powershell.exe "&'.\!.!'"

Bonus: how to change colour of PowerShell scripts to green:
- Open Options menu, select Files highlighting.
- Locate *.exe,*.com,*.bat entry, press Enter to edit.
- Add *.ps1 to the list, select Ok to save.

See also: Running Windows PowerShell Scripts
Update: there is an enhancement that allows passing arguments to the script and launch script in a separate window.
Posted in Software | Tags: far-manager, powershell | Comments Off
August 4th, 2009
Hi, my name is Pavel and I want to quit my day job.
Where am I now
At the moment I’m working full time as software developer.
Where do I want to go
I have had an idea of starting my own business for quite some time. I decided to build my business on the side. I’m going to work on it part-time. My goal is to grow my business to the level where it could support me and my family. At that stage I’ll be able to quit my day job.
I have a lot of distance to cover. I need at least $5,000 per month to quit my day job:
- $1,900 – home mortgage
- $2,000 – living expenses (food, electricity, gas etc)
- $1,000 – just in case (buffer)
Fortunately we don’t have any credit card debt.
I definitely don’t want to take any investments. I want to bootstrap my way up. My business should pay for itself.
I will post updates about my actions here, on this blog. Hopefully this will prevent somebody from making the same stupid mistakes as I do.
With this blog I’ll try to answer this question: “Is it possible to start home-based business on the side, without quitting day job?”.
Onward!
Posted in Business | Comments Off
March 27th, 2008
When I work with WiX source code I need to create lots of GUIDs. In my Visual Studio 2005 editor all I need to do is to press Alt+G and new GUID magically appears at the cursor. Achieving this is very easy:
- Open Macros IDE by selecting Tools | Macros | Macros IDE.
- Create new macro:
Public Sub InsertGuid()
DTE.ActiveDocument.Selection.Text = Guid.NewGuid().ToString()
End Sub
- Bind new macro to Alt+G keyboard shortcut. Open Options dialog, select Environment, then Keyboard on the left. Type “InsertGuid” to locate the macro you just created. Assign Alt+G to it.

Fortunately, no standard command is assigned to Alt+G by default.
Posted in Develop | Comments Off
March 17th, 2008
I use classic Windows Messenger. The latest Windows Live Messenger (version 2008) is way too fancy for me. Compare:

I don’t like anything moving on the screen and I don’t like screen space to be wasted.
The only problem with classic Windows Messenger 5.1 (you can download it here) is that links are non-clickable. They are blue, when you type them (http://www.google.com) but they become black in the main chat window:

To fix this problem, open regedit and create HKLM\Software\Policies\Microsoft\Messenger\Client key (it might be already there). Create DWORD value EnableURL under that key. Set it to 1. Restart Windows Messenger.
Posted in Software | Comments Off
March 14th, 2008
Sometimes I need find address on Melway site. Most of the time, I already have address in electronic form. I don’t need to type, just copy and paste.
The problem is I need to enter address parts separately on Melways site: street number, street name and suburb:

For example, if I have 235 Russell St Melbourne I need to copy and paste 235 first (click-Ctrl+C-switch-click-Ctrl+V), then Russell St (switch-click-Ctrl+C-switch-click-Ctrl+V) and finally Melbourne (switch-click-Ctrl+C-switch-click-Ctrl+V-down-down-Enter).
If I can save 30 seconds of my time why not to do it? Introducing:
Melway address lookup
It has just one field for address. Now all I need to do is to copy address (click-Ctrl+C), paste it (switch-click-Ctrl+V) and press Ctrl+Enter. Done.
Posted in General | No Comments »
March 6th, 2008
I can’t bear having something moving on a web page. It just distracts my attention while I’m reading. Here’s how to disable most of animations in Firefox:
- Open about:config page, set image.animation_mode to none. This will disable gif animation.
- Disable blinking. On about:config page, set browser.blink_allowed to false. Now <blink> tag doesn’t blink anymore.
- Disable Flash but not completely. Flash animations seldom carry useful information but most often are used for ads. I installed Adblock and added .swf to filter list. If some site doesn’t work without Flash I add it to white list.
- Some sites use JavaScript to display animation. For example: xe.com. In these cases NoScript extension might help but more and more sites now rely heavily on Ajax and hence on JavaScript so it’s too much trouble to white-list sites as you surf the Web.
Posted in Software | No Comments »