Tired of typing the same line of codes in Netbeans over and over again? Use Netbeans' code-template feature!
Usage example:
if you want to output a line using System.out.println(), you just need to type "sout", then immediately press 'TAB'. it will expand sout into System.out.println("");, and place the cursor inside the double-quotes.
You can get the list of default templates (and add new ones) in the option page as per screenshot above.
My Tips and Tricks Repository
Just some of the unimportant things that i've learnt throughout my life, which can actually be googled up. Put them together so that it can be passed down to anyone who reads it.
Thursday, 29 January 2015
Reduce program from running at startup
Greetings, Audience.
Are your PC getting slower lately? Need to wait several minutes on startup before you can start using the PC? No worries. Here's are some of the step that you can take to reduce the number of program that will run when you start your PC.
1. Check the list of program that will run on startup. the easiest way to do this is by running "msconfig" from your "run" window (default shortcut is windows + R).
If there is any unknown / unwanted program that appear in the list, it is best to disable it from running on startup. The lazy way to disable it is by unticking the checkbox on the left.
2. Remove the unwanted program.
Are your PC getting slower lately? Need to wait several minutes on startup before you can start using the PC? No worries. Here's are some of the step that you can take to reduce the number of program that will run when you start your PC.
1. Check the list of program that will run on startup. the easiest way to do this is by running "msconfig" from your "run" window (default shortcut is windows + R).
If there is any unknown / unwanted program that appear in the list, it is best to disable it from running on startup. The lazy way to disable it is by unticking the checkbox on the left.
2. Remove the unwanted program.
- The cleaner way to do this to go the specified location mentioned in 'MSCONFIG' above, and remove it there. Those that starts with 'HKLM/HKCU' usually means it is inside the registry, under HKEY_CURRENT_USER (HKCU) or HKEY_LOCAL_MACHINE (HKLM). If you're not familiar with registry, I recommend you not to use this step. :D
- The safer way (for non tech-savvy) is to use Trend-Micro's "HijackThis" application. Download and run the application (choose scan and save log file), and it will produce a 'log' file. You can analyze the logfile at http://www.hijackthis.de/ (copy the content of the log file into the text field in that site). From the result, you can decide whether or not to remove unwanted / potentially harmful application that run on your computer on startup. To remove those programs, just tick the checkbox in the HijackThis program (the list will be populated after you scan your system), and click the 'Fix' button. It will do the step in previous point above for you. Note that some of the warning from that site may be due to the difference in language (program file is standard US, programme in Denmark, etc).
Friday, 20 September 2013
Defragmenting Pagefile
Greetings, Audience.
Have you encountered the situation where you wanted to defragment your hard disk, but somehow the 'unmoveable' files have become so fragmented and it cause your defragmentation effort to have pretty much no effect?
No worries. There's a cure for that. However, you might need additional hard disk to make this happen.
Lets say, your disk fragment look something like this:
The unmoveable files, marked as green, are actually your pagefile. It is used as temporary storage to swap the information from your RAM. Those file are created on startup, and cannot be moved while the Operating System is on. When they become too fragmented (as in the image), it will be hard to properly defrag the rest of the file in that disk.
To prevent this from happening (or, say, fix it if it is already happened), i would recommend you to prepare an empty disk partition, with the size of twice of your RAM. Meaning, if your RAM is 8 Gigabyte, the empty partition should be 16 GB. This partition will be used as dedicate storage for pagefile.
Note that this guide will be based on Win XP. Newer OS should be quite similar to this.
To reassign the pagefile to the empty partition, go to the 'System Properties' (right click My Computer, and click properties).
In the Advanced tab, click the 'Performance' setting (1). It will pop the performance option. In that window, go to the Advanced tab, and click the 'Change' button under the virtual memory (2).
A new window will pop up. Here, you can set the size and location of your pagefile.
By default, the pagefile will be under your OS partition (usually C:). Select it and set to 'No paging file'. Then, select your empty partition, and set it to 'Custom size' or 'System managed size'.
If you chose to make it custom, set the initial size to the size of your RAM, and the maximum size to the size of that partition (at most twice the size of your RAM)..
Once you have done that, reboot the PC and you can see the difference. The image below shows the OS partition without the pagefile. Note that there is no more 'green' block.
And this image below show the new partition dedicate for the pagefile:
Take note that you should not save or put any file into this partition. That would beat the purpose of having a dedicated partition.
If you want to do this, make sure you do it properly. Try not to resize your existing partition since it might cause the data to corrupt. Best to have someone who can take action in case things go wrong on your side while you're doing this.
So, that's all for now. Cheers. ^.^
Have you encountered the situation where you wanted to defragment your hard disk, but somehow the 'unmoveable' files have become so fragmented and it cause your defragmentation effort to have pretty much no effect?
No worries. There's a cure for that. However, you might need additional hard disk to make this happen.
Lets say, your disk fragment look something like this:
The unmoveable files, marked as green, are actually your pagefile. It is used as temporary storage to swap the information from your RAM. Those file are created on startup, and cannot be moved while the Operating System is on. When they become too fragmented (as in the image), it will be hard to properly defrag the rest of the file in that disk.
To prevent this from happening (or, say, fix it if it is already happened), i would recommend you to prepare an empty disk partition, with the size of twice of your RAM. Meaning, if your RAM is 8 Gigabyte, the empty partition should be 16 GB. This partition will be used as dedicate storage for pagefile.
Note that this guide will be based on Win XP. Newer OS should be quite similar to this.
To reassign the pagefile to the empty partition, go to the 'System Properties' (right click My Computer, and click properties).
In the Advanced tab, click the 'Performance' setting (1). It will pop the performance option. In that window, go to the Advanced tab, and click the 'Change' button under the virtual memory (2).
A new window will pop up. Here, you can set the size and location of your pagefile.
By default, the pagefile will be under your OS partition (usually C:). Select it and set to 'No paging file'. Then, select your empty partition, and set it to 'Custom size' or 'System managed size'.
If you chose to make it custom, set the initial size to the size of your RAM, and the maximum size to the size of that partition (at most twice the size of your RAM)..
Once you have done that, reboot the PC and you can see the difference. The image below shows the OS partition without the pagefile. Note that there is no more 'green' block.
And this image below show the new partition dedicate for the pagefile:
Take note that you should not save or put any file into this partition. That would beat the purpose of having a dedicated partition.
If you want to do this, make sure you do it properly. Try not to resize your existing partition since it might cause the data to corrupt. Best to have someone who can take action in case things go wrong on your side while you're doing this.
So, that's all for now. Cheers. ^.^
Thursday, 19 September 2013
Warcraft 3 Hotkey
Greetings, Audience.
I'm pretty sure there are still a lot of you guys who still play War3 even though that game already at least a decade old.
Thanks to the vast number of custom map developer available, the number of interesting maps keep increasing, along with the game complexity where the need for micromanagement now also include the good timing in using the 'clickable' item in the inventory.
By default, the key for the unit's inventory are mapped to the keyboard's numpad (1,2, 4,5, 7 and 8). On normal keyboard, these keys are pretty far from our left hand (where mostly right hand will only be on the mouse). To make your gameplay easier, you can 'bind' these key to another key that is closer to 'WASD' region.
To do this, I prefer to use a software called Autohotkey. It is a lightweight program, and highly customize-able. For those who are familiar with programming, the learning cure is pretty simple.
To get back to the topic, below is the hotkey that I use to remap War3 intentory keys:
To use it, simply copy paste those 6 line of code into your favourite text editor, and save it with the extension of '.ahk'. Then run it to use it. Make sure you have the autohotkey software installed. You might need to run it as administrator on vista / 7, depending on your computer's setting.
In that code, I remapped numpad 1 to ALT + Z, numpad 2 to ALT + X, and so on.
Have fun trying it in game. ^.^
I'm pretty sure there are still a lot of you guys who still play War3 even though that game already at least a decade old.
Thanks to the vast number of custom map developer available, the number of interesting maps keep increasing, along with the game complexity where the need for micromanagement now also include the good timing in using the 'clickable' item in the inventory.
By default, the key for the unit's inventory are mapped to the keyboard's numpad (1,2, 4,5, 7 and 8). On normal keyboard, these keys are pretty far from our left hand (where mostly right hand will only be on the mouse). To make your gameplay easier, you can 'bind' these key to another key that is closer to 'WASD' region.
To do this, I prefer to use a software called Autohotkey. It is a lightweight program, and highly customize-able. For those who are familiar with programming, the learning cure is pretty simple.
To get back to the topic, below is the hotkey that I use to remap War3 intentory keys:
!z::send {Numpad1}
!x::send {Numpad2}
!a::send {Numpad4}
!s::send {Numpad5}
!q::send {Numpad7}
!w::send {Numpad8}
To use it, simply copy paste those 6 line of code into your favourite text editor, and save it with the extension of '.ahk'. Then run it to use it. Make sure you have the autohotkey software installed. You might need to run it as administrator on vista / 7, depending on your computer's setting.
In that code, I remapped numpad 1 to ALT + Z, numpad 2 to ALT + X, and so on.
Have fun trying it in game. ^.^
Utilizing SQL Developer autocomplete feature
Greetings, Audience.
Lets say, in your line of work (or maybe study) requires you to work with Oracle SQL, I would recommend that you use SQL Developer as the client IDE. It is quite lightweight, and currently maintained by Oracle itself.
Ok the point of this post is not to promote SQL Developer, but instead to show on how to utilize the autocomplete feature of SQL Developer. For this, I will show the example using a simple SELECT statement.
To begin, create the skeleton SELECT query from the desired table:
Be sure to follow the proper syntax so that the IDE won't complain (in which it might cause the auto-complete not to work). Use the indentation that best suit your style.
When you are typing the table name in the FROM clause, the auto-complete dropdown box will come out if you pause for several seconds. You can force this to come out by typing the first letter of the table name, and press CTRL + Space.
Next, build the WHERE clause. Link those tables and put restrictions. Here, the auto-complete box will come out when you type in the table name (or alias), followed by a dot '.'.
If somehow you accidentally do something that make the box disappear, you can force it to appear again by pressing CTRL + Space. Make sure that the typing caret is still nearby the 'dot'.
Once you've completed the WHERE portion, then only you come back to the SELECT part, and select the proper column that you want.
Similar to WHERE portion, the auto-complete will appear after any table and dots, and can be force to appear using CTRL + Space.
So.. Yeah.. That's pretty much about it. The main thing that you need to remember here is to always have the skeleton first. The auto-complete feature will appear based on the table that you choose.
Good luck, and have fun query-ing.
^.^
Lets say, in your line of work (or maybe study) requires you to work with Oracle SQL, I would recommend that you use SQL Developer as the client IDE. It is quite lightweight, and currently maintained by Oracle itself.
Ok the point of this post is not to promote SQL Developer, but instead to show on how to utilize the autocomplete feature of SQL Developer. For this, I will show the example using a simple SELECT statement.
To begin, create the skeleton SELECT query from the desired table:
When you are typing the table name in the FROM clause, the auto-complete dropdown box will come out if you pause for several seconds. You can force this to come out by typing the first letter of the table name, and press CTRL + Space.
Next, build the WHERE clause. Link those tables and put restrictions. Here, the auto-complete box will come out when you type in the table name (or alias), followed by a dot '.'.
If somehow you accidentally do something that make the box disappear, you can force it to appear again by pressing CTRL + Space. Make sure that the typing caret is still nearby the 'dot'.
Once you've completed the WHERE portion, then only you come back to the SELECT part, and select the proper column that you want.
Similar to WHERE portion, the auto-complete will appear after any table and dots, and can be force to appear using CTRL + Space.
So.. Yeah.. That's pretty much about it. The main thing that you need to remember here is to always have the skeleton first. The auto-complete feature will appear based on the table that you choose.
Good luck, and have fun query-ing.
^.^
Intro
Greetings, Audience.
Welcome to my, blog. This will be the place that I will store some tips and tricks, mostly related to the games that I played and maybe something on programmings.
Look forward for the future posts that I might make, and have fun.
^.^
Welcome to my, blog. This will be the place that I will store some tips and tricks, mostly related to the games that I played and maybe something on programmings.
Look forward for the future posts that I might make, and have fun.
^.^
Subscribe to:
Posts (Atom)