[Java] How To Check if a String is a Valid Number?

If you are someone new to Java and would like to check if a String is a valid number or not, this post will help you get answer to your question.

Below is the coded snippet with explanation for checking out if a string is a valid number. The below mentioned code is written in Java.

In the below mentioned code snippet, i declared an integer called isThisANumber , this integer will be used to save the parsed Integer. Static method parseInt( ) of the Integer class has been used to attempt to convert the string parameter into an Integer. In case if the string is not a valid integer and throws up parsing issues while converting, NumberFormatException is thrown.

int isThisANumber = 0;
try
{
isThisANumber = Integer.parseInt(someStringToTest); 
}
catch (NumberFormatException nfe)
{
System.out.println("This string is not a valid number."); //Oops..not a valid int
}

 

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

SweetHome 3D lets you design the interior of your House

Earlier i wrote about an interesting web based service called DesignMyRoom, which lets you design and do interiors for your room, today, in this post i will introduce you to a stand alone software called SweetHome 3D which is a free interior design application that helps you place your furniture on a house 2D plan, with a 3D preview.

SweetHome 3D is aimed at people who want to design their interior quickly, whether they are moving or they just want to redesign their existing home. Numerous visual guides help you draw the plan of your home and layout furniture. You may draw the walls of your rooms upon the image of an existing plan, and then, drag and drop furniture onto the plan from a catalog organized by categories. Each change in the 2D plan is simultaneously updated in the 3D view, to show you a realistic rendering of your layout.

Sweet Home 3D may be run on Windows, Mac OS X 10.4 / 10.5, Linux and Solaris, and is translated in 11 different languages.

Sweet Home 3D

Image: Sweet Home 3D

Depending on your system, use the following instructions to download Sweet Home 3D and install it:

Windows: Download http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-1.5-windows.exe (25 MB), run the downloaded installation program, and follow the instructions from the setup wizard.

Mac OS X: Download

http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-1.5-macosx.dmg (11 MB), double-click on the downloaded file and run Sweet Home 3D application found in the opened folder. To install Sweet Home 3D, drag and drop the application in the folder of your choice.

Linux: Download http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-1.5-linux-x86.tgz (40 MB), uncompress the downloaded file and run SweetHome3D application found in the uncompressed directory. To install Sweet Home 3D, move the uncompressed directory to one of your choice.

Some interesting features of SweetHome 3D worth mentioning

1.) You can import your home plan blueprint to get started faster with SweetHome 3D. 

2.) Based on the imported plan, create walls with a click of a button.

3.) Adjust the 3D view of the plan at any time.

4.) Enlarge Walls and also add, adjust and modify Windows and Doors to them. Wide variety of Doors and Windows are available in the catalog, all you need to do is select them from the catalog.

5.) Add Furniture, visit Home layout. 

In short, SweetHome 3D lets you become an architect of your house and lets you become an interior designer of your home.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

[Adsense] Prevent your Competitors Ads from Showing up in your Website

We often hear about scenarios wherein Ads of Competing businesses get shown up as part of the Adsense Ads showed on your website. This certainly is not the best way of growing your business, However, this can be prevented by adding specific setup rules in your Adsense account. This post describes a step by step process for setting up Competitive Ad Filter in Google Adsense.

If you are an Adsense Publisher and would like to prevent your competitor’s ads from being shown on your website as part of the Google Adsense Ads which are dynamically showed to your end users based on the keywords and other related terms, follow the steps below. (Click on the images for a detailed view).

1.) Login to your Adsense Account.

Adsense Setup Link enables you to setup Google Adsense for your site.

Adsense Setup Link enables you to setup Google Adsense for your site.

2.) Click on the tab which says Adsense Setup.

3.) Once inside Adsense Setup, click on the link which says Competitive Ad Filter. 

Setting up Adsense to prevent Competitor's ads from being shown in your site.

Setting up Adsense to prevent Competitor

The Competitive Ad Filter enables you to block specific ads, such as competitors’ ads, from appearing on your pages. Entering a more general URL will block a wider range of ads; entering a more specific URL will block a smaller range of ads. For example, by entering a top level domain such as “example.com”, you’ll also block all ads that link to any sub-directories of that domain, like “forums.example.com”. Review the examples below to learn how you can create filters that will block only the range of ads you want.

Enter the URLs of your comptetitor's website or business

Enter the URLs of your comptetitor

4.) Specify URL’s of your competitors website ( Ads pointing to these URL’s shall then be filtered before being shown to your site’s end visitors) for various Adsense services like Adsense for Content, Adsense for Search and Adsense for Feeds. Click on Save Changes once done. 

You have now setup your Adsense account to filter your competitors ads before being shown to your site visitors. 

Also, as a general tip, never click on the ads on your Own Website. Google definitely can figure out if you are clicking on your own Adsense Ads.

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

[How-To] Add Custom Watermark to your images with PicMarkr.

You already know about the various services from where you can get Free images for your Blog. However, if you are someone who wants to watermark his images for various reasons; PickMarkr is the service to go for.

PicMarkr is a free to use service which can be used to apply Watermark your images and download them for usage for free.

PicMarkr

PicMarkr

In order to watermark your images, follow the steps below

 

Steps for Watermarking Images

Steps for Watermarking Images

1.) Upload Photos you wish to Watermark.

2.) Choose the Watermark to be applied. You can choose from Text, Image or Tiled options.

3.) Get your Watermarked images. 

What are some interesting features about PicMarkr?

  • You can either upload your pictures or grab them from your Flickr account.
  • Apply Watermark and process multiple images in batches.
  • The best of all, you dont need to install or download anything. All you need to do is select your images, watermark option and apply the watermark for processing.

All in all, PickMarkr is a great service with ease of use, which lets you WaterMark your images for free. Do give PicMarkr a try.

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

[How-To] Make your USB Disks Perform Faster

This simple hack is particularly useful if you leave your USB Hard Disk permanently connected to your laptop or PC. If you are sure that the USB drive will always be connected, it can be configured to perform faster. 

Follow the steps below to configure your USB Drive to perform faster. 

1.) In Control Panel, click on System. Under System dialog, click on Hardware and then Device Manager. 

2.) Under Device Manager, expand the Disk Drives section. 

Optimizing USB Disks for Performance

Optimizing USB Disks for Performance

3.) Select your Drive and right click to open Properties.

Performance Tuning your USB Drive

Performance Tuning your USB Drive

4.) Under Policies, select Optimize for Performance. Click OK.

That is it. You are done. For a USB drie, when you enable Optimize for Performance, it is enabled for write caching which in turn leads to beter speed and therefore better performance.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

[How-To] Convert your Audio Tapes to MP3

If you are someone who has a huge collection of Audio Tapes or cassetes and wish to convert them to MP3 format so that you can play them over your music system or for that matter your computer, this is the post to read.

This post describes a step by step process of converting your Audio Tapes to MP3 Format Audio which can later be burned using a CD Burner.

Follow the steps below to convert your Audio Tapes or Cassettes to MP3

1.) First things first, you need to have your Cassette and the Tape Recorder. 

2.) You would also need a cable with double jacks for audio out from your recorder to audio in of your computer.

3.) Insert the cable to the Audio Out port of your Cassette player and insert the other end of the jack into the Mic input slot for Audio In.

4.) Download SuperMP3Recorder software to help you with the recording.

 

Set the bitrate to 192KBps.

Set the bitrate to 192KBps.

5.) Select atleast 192KBps bitrate from the MP3 Options under the Settings menu.

 

SuperRecorder

SuperRecorder

6.) Once you have configured the settings, press Record button on SuperMP3Recorder and then play the cassette tape on the player. 

7.) Your audio is now getting converted to MP3 format.

Do comment if you had any issues while converting your Audio Tapes to MP3. I will be happy to help.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

[How-To] Add Contact from an Email in Outlook

Often many people email me asking for simple stuff. This post is motivated from one such email. Usually people follow a cumbersome process to add contacts to their outlook contact list, instead they can just follow a simple process and them to their list while being at their inbox. This post describes that simple process.

If you are looking at adding a contact from an email into your Outlook Contacts, follow the steps below.

1.) Open the email message in Outlook from which you wish to add the contact in your Outlook Contacts.

2.) Once the email message is open, right click on the name of the contact you wish to add to your Outlook Contacts.

3.) Select Add to Outlook Contacts.

 

Add contacts in your Outlook Contacts from an Email.

Add contacts in your Outlook Contacts from an Email.

4.) Fill out necessary details. Save and Close.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

[How-To] Schedule Email Delivery of your Google Analytics Traffic Report

Google Analytics is a very powerful analytics tool for analyzing various traffic related information for your website.

Google Analytics also provides Email delivery of your traffic report. In order to setup an email delivery of your traffic report, follow the steps mentioned below.

1.) Login to your Google Analytics account.

2.) Once logged in, go to the dashboard for your particular website. 

Configuring Google Analytics Email delivery of reports.

Configuring Google Analytics Email delivery of reports.

3.) Click on the link which says “Dashboard”. Refer to the image above.

4.) You now have two options, either to send the report now itself, or to Schedule it for future deliveries.

5.) In this post we will concentrate on Scheduling Email delivery. For this, click on the tab “Schedule”.

6.) Enter key information like mail id’s to which you wish to send this report, Subject, Small description, Format ( choose pdf, preferrably) and time interval. I have the interval set to Weekly. 

 

Enter all the relevant information for scheduling Email delivery.

Enter all the relevant information for scheduling Email delivery.

7.) Click on Schedule once you are done with filling all the necessary information.

Now your Email Schedule is created. Based on the chosen time interval for delivery you will be receive Email delivery of the reports.

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav