Wednesday, April 01, 2009

Counting in for loop in dos batch

This is the default behaviour of a FOR loop:



@echo off
setlocal
:: count to 5 storing the results in a variable
set _tst=0
FOR /l %%G in (1,1,5) Do (echo [%_tst%] & set /a _tst+=1)
echo Total = %_tst%
C:>demo_batch.cmd
[0]
[0]
[0]
[0]
[0]
Total = 5

Notice that when the FOR loop finishes we get the correct total, so the variable correctly increments, but during each iteration of the loop the variable is stuck at it's initial value of 0

The same script with EnableDelayedExpansion, gives the same final result but also displays the intermediate values:



@echo off
setlocal EnableDelayedExpansion
:: count to 5 storing the results in a variable
set _tst=0
FOR /l %%G in (1,1,5) Do (echo [!_tst!] & set /a _tst+=1)
echo Total = !_tst!
C:\>demo_batch.cmd
[0]
[1]
[2]
[3]
[4]
Total = 5

Notice that instead of %variable% we use !variable!


http://www.ss64.com/nt/setlocal.html

Thursday, February 26, 2009

The gate of death

http://www.thedailystar.net/newDesign/news-details.php?nid=77648

--
Sheetal

--A journey of a thousand mile begins with a single step --

vista "configuring updates step 3 of 3" continous loop solution

I stepped into this mess today and finally got out of it. what i did-

1. when you see the “Microsoft (C)” with the moving lines, hold the power button until it shuts down.

2. then start it again, you will find a window asking for "launch automatic repair". choose this option.

3. i didn't have to do anything else. if you are still stuck, follow these instructions.

Monday, January 12, 2009

Sunday, January 11, 2009

Download entire website using wget

wget-tircks-and-tips

If want you save the website exactly the same way a web-browser do, use the following command

wget --no-check-certificate -nd -pHEK -erobots=off  http://www.example.com
    


--
Sheetal

--A journey of a thousand mile begins with a single step --

Friday, November 21, 2008

Creating mozilla extension

http://www.borngeek.com/firefox/toolbar-tutorial/chapter-1/
http://ancaluca.blogspot.com/2007/10/java-firefox-extension.html
http://groups.google.com/group/mozilla.dev.tech.java/browse_thread/thread/41a2db6eb748e6f6

File i/o:
https://developer.mozilla.org/En/Code_snippets:File_I/O#Writing_to_a_file

Thursday, October 23, 2008

Art of mathematics or mathematics of art!



my friend sopan posted this awesome link on facebook. its about the art work, mathematical art actually, of Maurits Cornelis Escher who explored many cool mathematical ideas through his works.

Monday, September 29, 2008

Interesting CS project

These projects a really interesting.
1. swarm-bots project. watch the video. paper about swarm-bots
2. head tracking for VR displays using WiiRemote. watch the video.

Saturday, September 27, 2008

Wednesday, June 25, 2008

Happiness


Happiness, originally uploaded by medieval panda.

The art of being happy lies in the power of extracting happiness from common things.

~Henry Ward Beecher

Thursday, May 22, 2008

Grad Student Comic Strip

Your friend (sheetal) sent the following message to you:



(no image? copy and paste the link below)
http://www.phdcomics.com/comics/archive.php?comicid=562


signed by sheetal

'Piled Higher and Deeper' by Jorge Cham is the popular comic strip about life, or the lack thereof, in grad school. Check it out by going to www.phdcomics.com


drop all constraints

To drop all constraints on a table "sampleTable", use the following commands:


CREATE TABLE temp AS SELECT * FROM sampleTable;
DROP TABLE sampleTable;
CREATE TABLE sampleTable AS SELECT * FROM temp;
DROP TABLE temp;


source
reference

Thursday, April 17, 2008

osgi tutorial

Installation:
If you have eclipse 3.3, you don't need any extra plugin.

OSGi tutorial

after building your bundle do the following to make jar:

* Right click on your bundle and select Export. Choose “Plug-in Development->Deployable Plugins and Fragments”.
* Select destination folder (for example /home/pc/Desktop)
* Click “Finish”

complete your plug-in:

somedir/
configuration/
config.ini
eclipse.exe
plugins/
org.eclipse.equinox.common_3.3.0.jar
org.eclipse.equinox.launcher.win32.win32.x86_1.0.0/
eclipse_1017a.dll
[other launcher fragment content]
org.eclipse.equinox.launcher_1.0.0.jar
org.eclipse.osgi_3.3.0.jar
org.eclipse.update.configurator_3.2.100.jar
< your_bundle1 >.jar
< your_bundle2 >.jar

write config.ini->>

osgi.bundles=< your_bundle1 >.jar@start,< your_bundle2 >.jar@start
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start
eclipse.ignoreApp=true
osgi.noShutdown=true


for linux, set up is same, just change the eclipse.exe, org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32 with their linux version.

Now, execute the following command:


eclipse -console


A new console will appear.
do the following:
osgi>
osgi>ss


all the bundle will appear.

write

start < bundle id >

this will start your plugin.

example 1
example 2