Category: LifeHacks

Desktop

Jeff Atwood in one of his recent posts stated:

If you’re really using your computer, your desktop should almost never be visible.

I think this is an overstatement. If you’re really using your computer, your desktop should be your command center. I agree with Jeff, that stuffing your desktop with lots of icons, shortcuts, documents etc is not basically a good idea. It makes your desktop a mess, and its hard to command if you have a mess in your command center.

myDesktopSmallI try, as a rule of thumb, to not exceed the number of 10 files on my desktop. Thanks to this I always have just the most important files slash documents, I currently work on. On the one hand, it helps me quickly see what I have going on, what reports I have to write etc. On the other hand, having more files, is a good indicator, that I probably try to do too many things at a time, and that I should do something about it.

Second thing (where I agree with Jeff) is using minimalistic, non-distracting wallpaper. It’s more a matter of personal preference than general rule, but I just want my desktop to be clean, and not to draw my attention while I want to focus on other things. Some (like Jeff) go that far, that they use plain desktop instead of some graphics, I on the other hand have this really cute, peaceful tree found somewhere on deviantART, which matches very well my custom Windows theme. I’ve been using both (wallpaper and theme) for years, which is also a non-distracting factor, since I got so used to them that I barely even notice them.

I also could not live without two small utilities called Rainlendar and Rainmeter. You can see them both in enclosed screenshot (click it to see it full-size). Rainlendar is on-desktop calendar with list of forthcoming events and to do list. Rainmeter can provide you with weather information, system info (CPU/memory utilization network traffic/disk information and more, all depending on the skin you’re using.

Thanks to them I can check my schedule straight from the desktop, check the weather without running any website, open any of my drives in Total Commander in one click, straight from my desktop, see the time without bringing taskbar on and even when I’m not close enough to read those small letters in tray. It makes me much more productive.

One more utility visible in the screenshot, is Launchy application launcher. That’s not basically a part of my desktop, but thanks to it, I don’t have to search through menu start to run an application.

Getting back the the main topic – desktop is the starting point of your work, so make it work for you as good as it can. There is no one-size-fits-all-solution for this, but try to find something that fits your needs. Not only those aesthetical, but functional as well.

Technorati Tags: , ,

How do You regionerate your code?

I’ve been using Regionerate for some time, and I’m addicted to it. Literally when I have to write some code on a computer that doesn’t have Regionerate installed I feel odd. This tool is simply pure honey and nuts. Only thing I would change is it’s default keyboard mapping (ctrl+R for running it), because it collides with Visual Studio/ReSharpers “Refactor” shortcut. So every time I install it I have to go to VS settings and change it to something else (alt+3 at the moment).

Main reason for this post however is not to praise Rauchy and his tool, but to talk a little bit about it’s customization capabilities. Regionerate is Xml driven, that is, its regioneration (strange word, huh?) settings are kept in a xml file. It comes with xsd so when you edit it in VS you’ll get intellisence, which is pretty sweat and will save you a lot of time.

The simplest possible  Regionerate settings file would look like this:

<CodeLayout xmlns="http://regionerate.net/schemas/0.6.3.8/CodeLayout.xsd">
    <ForEachClass>
        <CreateRegion>
            <PutFields>
            </PutFields>
        </CreateRegion>
    </ForEachClass>
</CodeLayout>

It creates a region and puts all fields into it, like below:

namespace Xtoff.Tmx.Helpers
{
    public class TmxLanguage
    {
        
        #region [rgn] Unnamed Region (1)
 
        private readonly string _value;
 
        #endregion [rgn]
 
        public TmxLanguage(string value)
        {
            _value = value;
        }
        public string Value
        {
            get { return _value; }
        }
    }
}

All fields were put in a single region, and all other members were left below. Hooray!. However I guess very few would be satisfied at this point.

Before we move on, however, there are a few facts to note.

First of all, regions name: [rgn] Unnamed Region (1)

[rgn] is a standard prefix for regionerate to mark it’s regions. It was introduced because without some kind of differentiator regionerate would break your manually created regions when regionerating your file. Thanks to this, it will only look into parts of your class that are not inside any region, or are inside a Regionerate-created region. You can change this prefix, or remove it. Keep in mind however, that then every region will be treated as a Regionerate-created region.

Next thing is region’s name. We didn’t set it, so Regionerate set it to default. I don’t have to tell you that you DO want to name your regions :).

And finally (1) indication how many elements is in a region. VERY useful when dealing with large files.

Next step would then probably be setting a name, and looking at other options we have.

If you go back to CreateRegion, hit space and wait for intellisence to come up you’ll be presented with 4 options:

Separating lines: Allows you to specify how many free lines you want Regionerate to leave between members in a regions.

ShowCount: Flag allowing you to turn of showing count of members inside of a region, defaults to true, and I don’t recommend changing it.

 

Style: this is one of the best and little known features.

Three valid options are Visible, Comment and Invisible. Visible is the default option, and it will wrap your code with a region like seen above

Comment will clean up your code but instead of enclosing it within a region it will only put a comment on top of all fields, like this:

        // [rgn] Unnamed Region (1)
 
        private readonly string _value;

Invisible, will clean up your code, but it woun’t put any regions not comments.

Title: sets the title for region 🙂

Going down the Xml tree, we can define what we want to put in out region. In our example we chose fields, but you can put basically every class member (field, property, method, event and so on), or inner region. You can do multiple Put* into a region.

Now we’re getting into really interesting stuff, that is defining filters for specific elements we want to put in a region. In the example above we chose to keep all fields in this region, but we could have come up with something much more sophisticated, like region for non serialized public fields with names meetings certain regular expression.

I won’t explain every single option in detail because there are so many that it would take too long. There are also diferences between types of elements (for example for Properties you can filter by accessors). In 9 cases out of 10 you will be able to create rules you want. You can’t create rules like “Region for methods that subscribed to some events” unles you have a naming convention for those, because it would require analysis on a higher level of abstraction, but nonetheless it’s pretty sweat.

And for those interested, I attach my Regionerate settings file.

Technorati Tags: , ,

How to prevent your Windows XP from restarting after automatic update

I came to work today, only to see that my PC was restarted, when I left it running with some files open (thankfully saved). I learned from little nice green shield in my tray that it downloaded some updates and needed to restart so… it did.

Automatic update is a great feature, as long as it works as I expect it to, and I expect it to never restart my PC without my explicit permission! I found it kind of odd, that my PC at work restarted automatically, while my home PC never does it.

I did some digging and here’s what I found out:

Your PC will restart if in Automatic Update configuration you have selected “Automatically download recommended updates for my computer and install them on a schedule.”, that happens to be default value. That was the reason why my work PC restarted, and my home PC never does it – at home I have changed this option so that it notifies me when updates are available, and then I explicitly permit it to download then, and then I explicitly permit it do install them. And then if it needs to restart it politely asks me for my permission.

So one solution is to change this option (start –> Control Panel –> Automatic Updates).

If you can’t or don’t want to change default behavior you still can have your PC updated automatically and not restarting. To do this however you need to do a little bit of registry tuning.

Under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU create DWORD registry value NoAutoRebootWithLoggedOnUsers and set its value to 1 to disable automatic reboot and 0 to enable it.alert

You also can disable nagging screen that appears after an update requiring system to reboot has been installed, that reappears every 20 minutes or so when you select ‘Restart later’. To do this, you need to create another DWORD value (under the same registry key) RebootRelaunchTimeoutEnabled and set its value to 0 to disable it.

Firefox Extensions I can’t live without #2

Well, maybe it’s not the best title since I’m going to write not only about extensions I’ve been using for long long time, but new (for me) as well.

Grab and Drag is one of the latter, I’ve been using it for only several hours and I simply loved it. It does basically what it’s name says – enables you to scroll web pages how you would scroll PDF documents in Acrobat Reader. It doesn’t block links, you can set hot key for temporary disabling this feature, you can make it switch between ‘hand drag’ and ‘normal’ mode after double click and several more things. Actually it does all I would expect it to do, and more.

 

One of extensions I TRULY can’t imagine surfing without is Tab Mix Plus. It’s one of most powerful customizable extensions, and one of the most useful. Let me say that it’s option window alone, has 6 tabs (many of which have subtabs). It fixes many of shortcomings of standard Firefox. For example? dbclick open tab to clone it (with it’s history), center clink empty space on tab bar, to bring back last closed tab, see loading progress on every tab, better session management, and many many more. You can have in ff2 ‘close active tab’ button on the left side of tab bar (like in ff1.5).

Firefox extensions I can’t live without (part 1)

One thing I LOVE about Firefox the most is tons of great extensions. I try to stay on top of things and once a while I dive into Mozilla’s extensions repository to see if there have been some good additions. I test those that look promising, and during those few years since I started using Firefox I collected some that I can not imagine surfing without (alphabetic order).

Adblock Plus – a must-have for everyone. With addition of Filters it’s my first line of defense against ads. It enables you to filter links, adds, flash and ActiveX from websites using blacklists and whitelists (you can use wildcards, for example *banner* will block everything with banner in name). I absolutely couldn’t live without it.

Aging Tabs – very nice little extension that you won’t appreciate until you use it for some time. Basically if you have open several tabs it will change color of every tab with time, or every time you switch active tab (that’s the mode I use). You can set start color to white and end color to dark gray and you will be able to at one glimpse to see that you opened a tab and didn’t look into it for long time. (Which may mean that you didn’t look into it at all, or just simply forgot to close it).

CuteMenu – adds icons to menus, witch greatly improves readability.

Down them all – download manager with ability to pause, resume, download file faster in several parts. It has this nice option down them all, that opens a window with all links in active site, you can then set a mask, and get many files in one go.

Link Alert – when you mouse over a link it adds little icon next to the arrow, indicating, type of link target (is it a site that will open in other window/tab, is it secured/unsecured site, image, video, torrent, and many more). Very nice.