Entries Tagged 'Tech Tips' ↓

Disable Netbeans start page

Netbeans, the open source and free Integrated Development Environment (IDE) from Sun is developing into a great piece of software with each release. They are also trying to be the new Eclipse and seem to have done a good job at that. One of the things that could send a developer away towards Eclipse is the rich set of plugins that Eclipse already has but Netbeans has the Java advantage. Its a complete platform for Java development. But every piece of software has some basic thing done wrong, could be because of neglecting it or because they didn’t feel it mattered or there was a conflict in how it should be implemented or anything else. One of such things in Netbeans in the option to disable the start page. I had to browse through all the tabs in the preferences window before I found it at the bottom of the start page itself, which is not such a good place for it to be. People with larger screens may easily notice it, but still they should have it integereated into the preferences page.

NetbeansSo in one line, to disable the start page in Netbeans 6 scroll to the bottom of the page and uncheck the option that says Show On Startup.

Netbeans

Update: In case you feel like you are missing the start page and wondering how to get it back, here is the procedure

Click on the Help Menu for Netbeans

You will see a menu item Start Page, click on it and now you will see the start page, now make sure you check the Show on Statup option so that Netbeans shows you the start page from the next time.

Thanks to jav for asking this intriguing question in the comments

How to install Ruby on Rails on a windows PC

Note: Tutorial targeted at n00bs and is for a purely developer environemnt not suitable for a production environment (can be used as one but not recommended).

Ruby on Rails or just Rails is a framework for building web applications and is quite famous among the developers, first of all for the use of the wonderful language Ruby and next Rails itself is a wonderful piece of software in itself. Ruby is so english like and has a smooth learning curve especially for those new to programming than those who are used to some other language. Ofcourse when you are used to some language every other language seems to be strange.

Install Guide:

First of all you need to Download a few packages

Ruby Windows Installer – http://rubyforge.org/frs/?group_id=167
MySQL – http://dev.mysql.com/downloads/mysql/5.0.html#win32

The next thing you need depends on weather you have internet access on your developer machine or not, incase you have internet access, just use the following commandafter you have installed Ruby
gem install rails –include-dependencies

Incase you have problem installing using this command because you are currently on the plane or in the desert waging war against terror or may be worse behind a restrictive corporate proxy server, you need to download the gem files and install them individually.

First of all download the latest Rails gem from

http://rubyforge.org/frs/?group_id=307

donwload the file with the .gem extension and then run this command

gem install gem-name-x.x.x –local

example – gem install rails-1.2.3 –local

The gem file should be in the path or else change to the directory where you put the file and then run the command else you are going to get gem file not found error

When you enter the above command it gives an error message saying rail-1.2.3 needs some-other-gem-1.x.x , these are called dependencies, you need these installed before you install rails, so you need to download these gem packages too, so search for the gem file missing at the rubyforge site
I have made a list of dependecnies for the latest version of rails – rails-1.2.3

rake (>= 0.7.2)

http://rubyforge.org/projects/rake/
activesupport (= 1.4.2)

http://rubyforge.org/frs/?group_id=570&release_id=10359
activerecord (= 1.15.3)

http://rubyforge.org/frs/?group_id=182&release_id=10363
actionpack (= 1.13.3)

http://rubyforge.org/frs/?group_id=249&release_id=10360
actionmailer (= 1.3.3)

http://rubyforge.org/frs/?group_id=361&release_id=10365
actionwebservice (= 1.2.3)

http://rubyforge.org/frs/?group_id=567&release_id=10366

grab the latest release of gem files at these project pages and install them using the common command

gem install gemname-1.x.x –local

Once you get rails installed, you can be sure that is has succesfully installed along with all the dependencies. You might wonder, dont these things need a web server like Apache? The answer is yes and no, its actually not necessary but sure is an optio. Ruby has a build in web server WEBrick, which lets you get started and running with just one command, no install needed!

Now that you have a developer Rails environemnt setup, you can go whip a new rails application in minutes with this tutorial at IBM Developer Works

How to change Filename Extensions in Windows XP

If you are a Windows XP user and if you are required to change the extension of a file, then your chances of succeding are very low unless you have some tech knowledge

Extension is the 3 letter term used after the dot in a filename like .exe for executable files .txt for text files .doc for office documents .xls for spread sheets, it may sometimes be just two letters long like .pl for Perl language files. By default windows doesnot show you the extension of a file, only those files which it are not yet associated with any program are shown along with their extensions. Rest of the common file types dont have extensions displayed, when you try to change a file’s extension when its extension is not displayed you will just end up adding the new extension to the filename and not to the extension part of it, like you have a spreadsheet named accounts which is actually accounts.xls and you want to change it to a text file called accounts.txt when you just rename it you will end up renaming it to accounts.txt.xls where accounts.txt is the filename part and .xls is the extension part. So the solution for this is to make windows display the extensions of all files, to do this open Windows Explorer or commonly known as the My Computer and go to the Tools Menu (Alt + t) and then click Folder Options, in the dialog box change to the View tab and look for Hide extensions for known files and uncheck it and click OK.

Now all your files have extensions displayed along with filenames so when you want to change a file extension you can just change the 3 letter part after the . (dot) in the filename. One thing you should take note of is when you want to just change the filename make sure you dont alter the part after the . in the filename. You have to change only the part before the . to change the filename.

If you feel strange having all the files with those 3 letter extensions you can change it back to normal by checking the Hide extensions for known files option in the Folder Options dialog box.

Netfirms WordPress and Pretty URLs (Date and Name)

Update: Great news. The WordPress pretty URLs problem has been fixed by the guys at Netfirms. One of the employees from Netfirms has posted a comment that they have fixed the issue and one of my friends who is on Netfirms confirmed it. Good job guys.

I have been with Netfirms for the past 7 months and i never had a problem with them, but last week i upgraded my WordPress to 2.1.2 and now my blog is broken, any link on my blog brings me back to the homepage which is really frustating becasue even the comment link doenst work. I started searching for possible solutions when i found too many frustated Netfrims users complaining about the problem and many others suggesting fixes and then they reply back with no success.

The problem as some say is Netfrims has not enabled the Allow Override option for .htaccess rules to be considered so adding a /index.php before the Date and Name structure does the job, even the Netfirms support page says that you should use this

/index.php/%year%/%monthnum%/%day%/%postname%/

instead of the regular

/%year%/%monthnum%/%day%/%postname%/

for Date and Name permalink structure. So what you get won’t be exactly the date and name structure but with an extra index.php.

The problem with this is every post and every page and worse every category (every internal link to be exact) on your blog will have the index.php string added in the URL. It would be like http://mydomain.com/blog/index.php/about instead of the pretty http://mydomain.com/blog/about For me the situation was worse, Date and Name structure worked for me earlier but now it doesnt so all backlinks i got for individual posts now redirect to the homepage so the visitor doesnot see what he was expecting to see.

I went through a few WordPress support topics, some of them very old to be considered as useful anymore. I even found a frustated Netfirms user who went as far as switching to another provider, ofcourse Permalinks was not the only reason for the switch but it was one of the main reasons. She really took off her anger by writing a lot about how bad netfrims was. That was just one persons case but most of us are having a good time with Netfrims arent we?

Now getting to what i have done to get my Date and Name permalinks back, i tried the workaround provided by Joel, who is another frustated Netfrims-Wordpress user. And the result is it didnt work. But i suggest you go try Joel’s workaround and the comments, he is really quick in giving you any kind of feedback if you tried his method to fix your permalinks.

I tried a part of what Joel did and it worked. Here is exactly what i did

Changed the permission for .htaccess file in my wordpress directory or the blog directory to 666 and then applied the Date and Name permalink structure through the Admin panel and then edited my .htaccess to this

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index.php
RewriteRule (.*) index.php/$1 [L]
</IfModule>

# END WordPress

where blog is the directory in which i installed wordpress and finally changed the permission of .htaccess file to 444.

Some more WordPress specific rules i leant during this operation are

  • What ever may be the permalink structure you use, .htaccess content doenot change
  • Prepending /index.php to your structure should work irrespective of the contenets of .htaccess
  • Change your .htaccess after you apply a new permalink structure because when ever you choose a new structure, wordpress replaces the #WordPress section of the .htaccess file with the default content which is

# BEGIN WordPress<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php
</IfModule>
# END WordPress

  • Incase you edit the WordPress part of the .htaccess file, you should lock it down with 444 permission so that wordpress doesnot replace it with the default contents. (Thanks Joel)

Now finally what exactly my settings look like

Permalink structure set to Date and Name

/%year%/%monthnum%/%day%/%postname%/

Contenets of .htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index.php
RewriteRule (.*) index.php/$1 [L]
</IfModule>

# END WordPress

PHP 4

WordPress 2.1.2

.htaccess Enabled in NetFirms Control Panel

Restore Active Desktop Not Working ?

If you use a Windows XP machine then there is very little chance that you have never seen the phrase “Restore Active Desktop” inplace of your wallpaper. This usually happens due to improper shutdowns (like power failure or some device failure that may cause the computer to shutdown) or when some application or windows itself gets confused and triggers the BSOD (Blue Screen of Death).

Active Desktop

Many a times when this happens it is most likely that the instructions given dont answer your current situation, like Your answer to all these is no i never did any of these

Did you recently change your background to a web page?

Did you recently add a new item to your Active Desktop?

Do you want to turn off your Active Desktop?

but you might have done this

Did your browser stop working, or did you restart your computer without shutting it down first?

There are situations where none of the cases match and worse the Restore my Active Desktop button doesnot work!! It just tells you that a script error has occured. How do you loose this ugly instruction screen and get back your wallpaper now??

One way is to open some image and set it as a wallpaper or if you dont want to spend time looking for a new picture as a wallpaper and want your previous wallpaper to comeback follow the setps below:

  1. Right-click anywhere on the Desktop and click Properties
  2. In Display Properties change to the Desktop tab, where you will see a monitor image with your wallpaper and the list of images below it
  3. Choose any other image in the list than the one currently selected and then select the original image used as wallpaper and click Ok, your wallpaper is back! ( To make this step simpler just selct the image above or below the currently selected one and then select the original image then click Ok )

You are done. You should now see your wallpaper instead of the Restore my Desktop instructions.