Archive

Archive for the ‘howto’ Category

How to control who follows you on Twitter

February 11th, 2009

You can control who is currently following you on Twitter without having to always have your updates protected. Here’s how:

  1. In Settings, turn on update protection (don’t worry, this is just temporary):
    image 
  2. Click Save, and then go to http://twitter.com/followers. You will be presented with a list of your followers. Browse through it and remove the people you don’t want to have following you.
  3. Turn off update protection.
  4. Done!

howto, software

How to choose a gift for someone

December 19th, 2008

Hi everyone,

I wrote the following guide for my own benefit, but maybe it’ll help you too — especially considering that it’s almost Christmas!

How to figure out what gift to buy for someone

There are four ways:

  1. Get something they asked for
    If the person has a wish list, get something off of that.

  2. Get something you think they’d enjoy or would make them happy
    People don’t put everything they’d enjoy on their wish list. Sometimes it’s obvious what a person would probably like.

    Be careful, though: Be certain you can actually picture someone enjoying what you’re giving them. Otherwise, they’ll be upset and they’ll also feel pressure to pretend they like the gift, for your benefit.

  3. Get something that would make their life easier/better/more magical
    For example, if someone you know has weak circulation, you could get them electric socks or foot-warmers for the winter months.

  4. Get something you can share together, like tickets to an event or a trip

It might be a good idea to pick and choose from each of these categories. For example, you could get two or three things on someone’s wish list, and then also get something that would make their lives better or easier. This way, the gifts are more surprising and exciting, and you really get an opportunity to show someone you care about them and thoughtfully bought gifts for them.

I would recommend, however, that you always get the person some things from their wish list.
Also, as an extra tip: Don’t hover over someone and express a lot of anticipation over them opening their presents. This may cause the person to feel pressured and scrutinized — and people should never have to feel that way when opening presents.

howto, real life ,

How to get themes working again in Windows XP SP3

April 30th, 2008

Windows XP SP3 - the service pack that was launched and then pulled almost immediately - makes it so that themes no longer work.

(By the way, if you want to download SP3, you still can, as of this morning, 4/30/08, at this Url.)

Anyway, you can get themes working again by following the instructions in this forum post, or you can follow the abridged instructions that worked for me right here:

  1. Download a patched version of Uxtheme.dll here (and un-Rar the DLL).
  2. Download and unpackReplacer.
  3. Open a Command Prompt and run Replacer.cmd.
  4. When Replacer asks you to, drag the file Uxtheme.dll from your Windows\System32 directory (usually c:\Windows\System32) onto the Command Prompt window.
  5. Hit enter.
  6. When Replacer asks you to, drag the new Uxtheme.dll that you un-Rared onto the Command Prompt Window.
  7. Hit enter.
  8. Confirm that Replacer should do this replacement, and wait for Replacer to finish.
  9. Reboot.
  10. Now your themes should work! Enjoy! (And might I recommend the wonderful theme HmmXP?)

howto, software

How to display temporary error messages in ASP.NET

October 11th, 2007

I was writing some code and wanted to display an error message to the user when something didn’t work right.

Naturally, I decided to use an <asp:Label/> control to do this, and just set its .Text property to something like “Oops!  you fudged up!”  However, I found out that if you do this, the error message persists across subsequent post-backs.  This is a problem because you don’t want the error message to just stick around forever; you just want it to display once and then go away when the user posts the page again.

The solution I’m using is to disable the ViewState for the <asp:Label/> control.  This tells ASP.NET not to remember anything about the particular control between post-backs; everything’s reset back to default on every page load.

Here’s how you disable the ViewState for a label:

<asp:Label runat=”server” ID=”MyErrorLabel” EnableViewState=”false” />

Blogged with Flock

Tags:

.net, howto, html

Howto: Make sure you get a 0 in Javascript, instead of a NaN

August 7th, 2007

When you’re pulling from an input field (or whatever) in Javascript, and want to make sure you get a 0 if the value entered isn’t a number, you can do this:

Before:
   parseInt(”hiya!”); // Yields NaN
   parseInt(”5″); // Yields 5


After:
   0 | parseInt(”hiya!”); // Yields 0
   0 | parseInt(”5″); // Yields 5

howto, javascript

Find files in .NET with regular expressions

July 11th, 2007

I wrote a quick class in VB.NET to allow you to find files with regular expressions.  Enjoy!

Use it this way:

FileInfo() files = RegexFileFinder.FindFiles(myDirInfo, New Regex(“\d\d-\d\w\w.txt”), RegexOptions.IgnoreCase))

… or, this way!:

String() files = RegexFileFinder.FindFilePaths(myDirInfo, New Regex(“\d\d\d\d.txt”), RegexOptions.IgnoreCase))

Download!

howto

How to fix your water-damaged Sidekick II

June 1st, 2007

If the buttons on your Sidekick II are acting all crazy after you’ve gotten it wet, I may be able to help you.

If your LCD is busted, or there’s something physically wrong with it, this probably won’t help you.

So, I’m on my second Sidekick II. The first one got water damage (apparently), and now when I press some of the number keys, the enter key gets pressed as well. And the longer I use it, the worse and more widespread the problem gets. So after going through a Nokia 8890 (hot phone, I’ve always loved that model, but it was unlocked and, I’m suspicious, therefore tainted, and it broke), and a hot pink Razr (I am not impressed with Motorola’s phone interfaces), I got another Sidekick II. Then last night, it rained again, and some must have gotten into the phone, even though I put it into my backpack (it was a downpour).

*Anyway*, so my new Sidekick II started experiencing the same crazy button behaviour (I spell behaviour with a “u” now, possibly because of Behaviour.js, even though I don’t use it; I use the awesome and fun jQuery). I was not about to accept that.

So, I’ve saved phones from wetness before: Once upon a time I had a Nokia [model number forgotten], and it went through the washing machine twice, and all I had to do was disassemble it and wait for it to dry out. So that’s what I decided to do with the Sidekick II.

I searched for “disassemble hiptop 2″ and found this page (saved in PDF form locally, here). God bless the internet!

Now, I don’t have a T9 Torx wrench (see the article/PDF), so I didn’t disassemble my Sidekick II completely; I just took off my buttons and bumpers, and blew into them and used some canned air, in order to get rid of any water.

And it worked! My buttons were all messed up - enter didn’t work, and all sorts of buttons triggered other buttons - and now they work fine.

I recommend doing this as quickly as possible after your phone gets wet.

If your keys are still messed up after doing this, I recommend opening your phone completely and drying it all off. And remember to make sure your phone is off first! :-)

Take care, and good luck!

howto

Remapping keys for easier, more enjoyable programming

November 7th, 2006

On my Windows machine at work, I have my right ALT key remapped to the “_” character. This helps when writing Ruby (and Rails) code, Python code, SQL code, and in many other situations. If you’d like to do this, here’s how:

  • Download AutoHotkey and install it.
  • Run AutoHotkey
  • Double click on the AutoHotkey tray icon to bring up its main window.
  • Click on File->Edit Script
  • Go to the bottom of the file and enter this line:

    
    RAlt::_
    
    

… And that’s it! Here’s my full AutoHotkey.ini file, so you can see the whole thing at once:


; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script is a .INI file because it is a special script that is
; automatically launched when you run the program directly. By contrast,
; text files that end in .ahk are associated with the program, which
; means that they can be launched simply by double-clicking them.
; You can have as many .ahk files as you want, located in any folder.
; You can also run more than one .ahk file simultaneously and each will
; get its own tray icon.

; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks.  It also explains how to use hotkeys.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.

#z::Run www.autohotkey.com

^!n::
IfWinExist Untitled - Notepad
	WinActivate
else
	Run Notepad
return

; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded.  So feel free to customize it to suit your needs.

RAlt::_

Of course, you can remap whatever you want. AutoHotkey looks to be a very powerful program. To learn more about reassigning keys, check out this page on the AutoHotkey site.

Also, check out more of what AutoHotkey can do by going through the Tutorials.

howto

Get Google Talk to show music information from foobar2000

November 6th, 2006

I love the foobar2000 music player. It’s small (as in simple and a small footprint) and fast. It also has an interesting, compelling, and fun interface. Here’s a screenshot:

foobar2000

Google Talk is another fun, small program that I love. It’s a great, compelling, fresh Instant Messaging program. And one of its features is really cool: Google Talk will display whatever music you’re currently listening to as your “status” — a line of text that displays below your name in other peoples’ buddy lists. It works for WinAmp, Windows Media Player, and iTunes. But it doesn’t work with foobar2000. Until now!

I searched around the net for a solution to this problem, and sure enough, someone had solved it. Here’s what you need to get foobar2000 and Google Talk to, er, talk!:

Here’s how to get it working:

  1. Install Google Talk and foobar2000.
  2. Extract foo_winamp_spam.dll to your foobar2000\components directory (from here forward, I will assume it is c:\Program Files\foobar2000\components).
  3. Create an empty file in your foobar2000 directory (e.g. c:\Program Files\foobar2000) called winamp.m3u.
  4. Apply this registry file by double-clicking on it and selecting Yes. (Note: If you installed foobar2000 to a directory other than c:\Program Files\foobar2000, you will have to open this .reg file and edit the path within to point to your foobar2000 installation directory.)
  5. Start up Google Talk and foobar2000.
  6. In Google Talk, select “Show current music track” in the Status menu.
  7. Start playing some music in foobar2000!

Et voila! After a second, you should see Google Talk change your status to whatever music you’re playing. Here’s an “After” screenshot I took, to prove that it works:

Much thanks to those in the foobar2000 3rd Party Plugins forum! Without them, I wouldn’t have known how to do this :-)

howto