Instructions: Click on orbs arranged in a grid to make them all glow. Clicking on an orb changes its state from unlit to lit or lit to unlit along with the neighboring orbs. Turn on all the orbs to pass a level with as few moves as you can. There are 9 levels, each with more orbs than the previous one. Two difficulty modes. In the easy mode, all orbs are unlit in the beginning and in the hard mode, some orbs are already lit to make things difficult for the player. Author: MUKTO SOFTWARE LTD.
Tuesday, November 6, 2012
Make them all glow, can you?
Monday, November 5, 2012
Python - Coding with fun
How to reverse a string?
How to read from console in Python?
Want to read an integer?
Swap values in python:
My motivation to learn python is: life is short - you need Python
s = 'abcdef' s = s[::-1] print sExplanation: "::" is known as stride notation
s[::2] s[::-2]Returns "ace" and "fdb" respectively.
How to read from console in Python?
name = raw_input()
Want to read an integer?
num = raw_input() num = int(num) # raw_input returns string, so convert it to integer
Swap values in python:
a, b = b, a
My motivation to learn python is: life is short - you need Python
Saturday, October 13, 2012
Installing Apache Maven-Java tool
Download maven.
Windows OS:
- Unzip the distribution archive, i.e. apache-maven-3.0.4-bin.zip to the directory you wish to install Maven 3.0.4. These instructions assume you chose C:\Program Files\Apache Software Foundation. The subdirectory apache-maven-3.0.4 will be created from the archive.
- Add the M2_HOME environment variable. [almost similar as this]: adding the M2_HOME variable in the system variables with the value C:\Program Files\Apache Software Foundation\apache-maven-3.0.4. Be sure to omit any quotation marks around the path even if it contains spaces.
- In the same dialog, add the M2 environment variable in the system variables with the value %M2_HOME%\bin.
- In the same dialog, update/create the Path environment variable in the system variables and prepend the value %M2% to add Maven available in the command line.
- In the same dialog, make sure that JAVA_HOME exists in your system variables and it is set to the location of your JDK, e.g.C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
- Open a new command prompt and run mvn --version to verify that it is correctly installed.
Linux based/Ubuntu Operating Systems:
- Extract the distribution archive, to the directory you wish to install Maven 3.0.4. These instructions assume you chose /home/username/java/tools/maven.
- Open terminal and type: gedit ~/.bashrc
- Set environment variable by adding the following lines at the bottom of .bashrc :
- export M2_HOME=/home/username/java/tools/maven
- export M2=$M2_HOME/bin
- export PATH=$M2:$PATH
- export JAVA_HOME=/usr/lib/jvm/jdk-default #if JAVA_HOME not exist.
- Run mvn --version to verify that it is correctly installed.
Labels:
apache-maven,
DEVELOPMENT,
JAVA,
Linux,
maven,
Ubuntu,
Windows,
windows 7
Tuesday, October 9, 2012
Send and receive SMS using GSM modem or phone on Ubuntu | TechyTalk.info
Send and receive SMS using GSM modem or phone on Ubuntu | TechyTalk.info.
#go to terminal and give the msg as below
#sudo python sms.py 'CellNumber Msg you want to send'
import gammu
import sys
def main():
words = sys.argv[1].split(None, 1)
dest = words[0]
msg = words[1]
print msg + "-----" + dest
#return
sms = gammu.StateMachine()
sms.ReadConfig()
sms.Init()
message = {
'Text': msg,
'SMSC': {'Location': 1},
'Number': destinationNumber,
}
print sms.SendSMS(message)
if __name__ =='__main__':
main()
Thursday, September 20, 2012
How to create non-editable JTable:
Override the method "isCellEditable" and implement as needed, such as:
//instance table model
DefaultTableModel tableModel = new DefaultTableModel(){
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
//...other codes
table.setModel(tableModel);
Tuesday, September 18, 2012
System.getProperty(key) key list for JAVA:
java.version | Java Runtime Environment version |
java.vendor | Java Runtime Environment vendor |
java.vendor.url | Java vendor URL |
java.home | Java installation directory |
java.vm.specification.version | Java Virtual Machine specification version |
java.vm.specification.vendor | Java Virtual Machine specification vendor |
java.vm.specification.name | Java Virtual Machine specification name |
java.vm.version | Java Virtual Machine implementation version |
java.vm.vendor | Java Virtual Machine implementation vendor |
java.vm.name | Java Virtual Machine implementation name |
java.specification.version | Java Runtime Environment specification version |
java.specification.vendor | Java Runtime Environment specification vendor |
java.specification.name | Java Runtime Environment specification name |
java.class.version | Java class format version number |
java.class.path | Java class path |
java.library.path | List of paths to search when loading libraries |
java.io.tmpdir | Default temp file path |
java.compiler | Name of JIT compiler to use |
java.ext.dirs | Path of extension directory or directories |
os.name | Operating system name |
os.arch | Operating system architecture |
os.version | Operating system version |
file.separator | File separator ("/" on UNIX) |
path.separator | Path separator (":" on UNIX) |
line.separator | Line separator ("\n" on UNIX) |
user.name | User's account name |
user.home | User's home directory |
user.dir | User's current working directory |
Monday, September 17, 2012
Download video from youtube in Ubuntu terminal
First download and install the program youtube-dl from terminal:
After installation, you can download video from YouTube:
sudo apt-get install youtube-dl
After installation, you can download video from YouTube:
youtube-dl -o file_name.flv youtube-video-link
Monday, September 10, 2012
Sudoers - Community Ubuntu Documentation
Shutting Down From The Console Without A Password
Often people want to be able to shut their computers down without requiring a password to do so. This is particularly useful in media PCs where you want to be able to use the shutdown command in the media centre to shutdown the whole computer.
To do this you need to add some cmnd aliases as follows:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot
You also need to add a user specification (at the end of the file after the "%admin ALL = (ALL) ALL" line so it takes effect - see above for details):
ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
Obviously you need to replace "" with the username of the user who needs to be able to shutdown the pc without a password. You can use a user alias here as normal.
via Sudoers - Community Ubuntu Documentation.
Often people want to be able to shut their computers down without requiring a password to do so. This is particularly useful in media PCs where you want to be able to use the shutdown command in the media centre to shutdown the whole computer.
To do this you need to add some cmnd aliases as follows:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot
You also need to add a user specification (at the end of the file after the "%admin ALL = (ALL) ALL" line so it takes effect - see above for details):
ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
Obviously you need to replace "" with the username of the user who needs to be able to shutdown the pc without a password. You can use a user alias here as normal.
via Sudoers - Community Ubuntu Documentation.
Friday, September 7, 2012
Subscribe to:
Posts (Atom)