Monday, November 28, 2011

Mint may decrease testesterone levels - Men should avoid!

Reading about, I found the following information about mint:

Peppermint has the strongest estrogenic increasing and testosterone decreasing activity.
“Among them, the extract of peppermint tea exhibited the highest estrogenic activity.”
http://www.springerlink.com/content/12l57414p3035173/

“After five days, the women’s levels of free testosterone (the biologically active form) declined, although their total testosterone level stayed the same. Women’s levels of luteinizing hormone, follicle stimulating hormone, and estrogen rose, while their triglyceride levels dropped significantly…The researchers found a significant decrease in free (active) testosterone in the blood and an increase in several female hormones including follicle-stimulating hormone.”
http://news.bbc.co.uk/1/hi/health/6376599.stm
(Note: this doesn’t mean the above study would necessarily have the same effect in men)

“After treatment with spearmint teas, there was a significant decrease in free testosterone and increase in luteinizing hormone, follicle-stimulating hormone and estradiol.”
http://www.ncbi.nlm.nih.gov/pubmed/17310494?dopt=AbstractPlus


Food components that have peppermint:
  1. Peppermint tea
  2. Chocolates
  3. Mouth freshners
  4. Food preparations like chutneys (Indian cusine)

Thursday, November 17, 2011

dbm to mw conversion

dBm = log10 (mW)*10
mW =10^(dBm/10)



40 dBm 10.00 watts  
36 dBm 4.00 watts { Maximum ERP allowed by FCC in U.S.
30 dBm 1.00 watts  
27 dBm 500 milliwatts  
26 dBm 400 milliwatts  
25 dBm 320 milliwatts  
24 dBm 250 milliwatts  
23 dBm 200 milliwatts { Typical output from WLAN devices at 915MHz
22 dBm 160 milliwatts  
21 dBm 130 milliwatts  
20 dBm 100 milliwatts { Maximum ERP allowed by E.T.S.I. In Europe
15 dBm 32 milliwatts  
10 dBm 10 milliwatts  
5 dBm 3.2 milliwatts  
4 dBm 2.5 milliwatts  
3 dBm 2.0 milliwatts  
2 dBm 1.6 milliwatts  
1 dBm 1.3 milliwatts  
0 dBm 1.0 milliwatts  
1- dBm 0.79 milliwatts  
5- dBm 0.32 milliwatts  
10- dBm 0.1 milliwatts  
20- dBm 0.01 milliwatts  
30- dBm 0.001 milliwatts  
40- dBm 0.0001 milliwatts  
50- dBm 0.00001 milliwatts  
60- dBm 0.000001 milliwatts  
70- dBm 0.0000001 milliwatts  
80- dBm 0.00000001 milliwatts {Receive threshold for most WLAN devices

Saturday, November 12, 2011

Difference between Steiner tree and Spanning tree in Networks

Based on the description below it is clear why Steiner trees are used for multicasting and why Spanning trees are used for configuring interfaces on bridges. Steiner trees ensure smallest common path by enforcing or adding Steiner points while spanning trees are just used to remove broadcast loops.

Some additional info from Wiki:
The Steiner tree problem is superficially similar to the minimum spanning tree problem: given a set V of points (vertices), interconnect them by a network (graph) of shortest length, where the length is the sum of the lengths of all edges. The difference between the Steiner tree problem and the minimum spanning tree problem is that, in the Steiner tree problem, extra intermediate vertices and edges may be added to the graph in order to reduce the length of the spanning tree. These new vertices introduced to decrease the total length of connection are known as Steiner points or Steiner vertices. It has been proved that the resulting connection is a tree, known as the Steiner tree. There may be several Steiner trees for a given set of initial vertices.

Saturday, November 5, 2011

Vectorizing: duplicating and deleting rows and columns in Octave

%1-1, To delete every other row(only the 1st, 3rd, 5th, ... left)
result=a(1:2:end,:)

%1-2, To delete every other row(only the 2nd, 4th, 6th, ... left)
result=a(2:2:end,:)


%1-3, To delete every other col(only the 1st, 3rd, 5th, ... left)
result=a(:,1:2:end)


%1-4, To delete every other row(only the 2nd, 4th, 6th, ... left)
result=a(:,2:2:end)

%2-1, To duplicate every other row(duplicate 1st, 3rd, 5th, ...)
result=kron(a(1:2:end,:),[1;1])



%2-2, To duplicate every other col(duplicate 1st, 3rd, 5th, ...)
result=kron(a(:,1:2:end),[1,1])

Monday, October 10, 2011

Running a ping test on linux machines

A couple of things are required:
  1. Only kernels newer than 1.X something work. So if you have 2.x or greater you are fine.
  2. You need to enable this flag is disabled:  
    echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
     Ping 224.0.0.1 ==> All machines supporting multicast are supposed to respond to that request.

TCPDump shows lot of SSH packets

The effect of positive feedback:

New packet --> screen refresh --> more ssh display packets back and forth ---> this causes more screen refresh --> infinite loop until you stop it.

Friday, October 7, 2011

p4 integrate says must refer to client

This can happen with other p4 commands such as changes. It happens because the path you used in your command is outside of your clientspec.

To fix this problem, check the path used in your command. It should match with one of the paths that you see in your clientspec shown by the p4 client command.

Solution: E567: no cscope connections

If you are getting this error:
E567: no cscope connections

It could be because of multiple reasons. A couple of things to check are:

1. In your .vimrc file check if you are pointing the csprg variable to the correct location of cscope.
In mine, I had to point it to /usr/bin/cscope. You can find this location by running the command
which cscope.

2. If the editor could find cscope, then you need to also ensure that it is able to access the cscope.out files which form the cscope database. If you are invoking vim from a directory that does not contain this file then you will still see the no connections error. One alternative is to start the vi editor from the place where you have the cscope.out file. Note that the cscope.out file is generated when you run the cscope -R command at least once - this is used to build the csope database. To remedy this solution, export the variable export CSCOPE_DB="/path/to/cscope.
out" in your .bashrc file. You will need to reload the .bashrc by running the command source .bashrc from your home directory.

These two things did the trick for me. I hope it works for you too, since cscope is awesome!

Monday, October 3, 2011

Convert eps to jpeg or jpg to eps on Linux (jpg to eps)

Simple technique, use the convert utility:
convert filename.jpg filename.eps

If you wish to convert from eps to jpeg use ghostscript:
gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -dBATCH -dSAFER -r300 -sOutputFile=filename.jpg filename.eps
If your console says gs command not found, install ghostscript. On ubuntu/debain systems, this can be easily done by saying something like apt-get install ghostscript, or whatever is the name returned by searching for apt-cache search ghostscript.

This basic conversion can result in large file sizes though, so to have a smaller file, use any utility like mogrify to resize the image. Example:
mogrify -trim -resize 1280x1024 filename.jpg
Note that this command will change the size of the image and could possibly result in changing the aspect ratio.

== Update: jpg to eps ==

There is also another simpler way to change jpg to eps. Install the adobe postscript printer on your machine. Print using that postscript printer (while selecting options that allow you to optimize for eps). Finally, manually adjust the bounding box to make it a proper eps.

Sunday, October 2, 2011

Latex block comment

Introduce this one line at the beginning of the file:
\newcommand{\eat}[1]{}
Use the \eat tag around any block you want to comment out.
E.g. to comment out the following lines

\eat{
asda
adsada
ads
 }

will do it.

How to remove vi or vim line numbers

Sequence of keys: esc followed by:
 :set nonumber

The ":" is a part of the command.

Vim 'modifiable' is off

The error seen on screen is that when the file is opened, 
E21: Cannot make changes, 'modifiable' is off
You could use the -M argument to setup Vim to work in a viewer mode.  This is

only voluntary though, since these commands will remove the protection:

 :set modifiable
 :set write

Saturday, October 1, 2011

Mood fluctuations based on twitter

Results from a study showing the global mood fluctuations based on twitter. Moods are at a low at the beginning of the week, and best at the end of the week. Also during the day, the mood improves as the end of the day approaches.

SVN URL is not WebDAV enabled

You get this error from SVN checkout when you are using the wrong URL to check out stuff from svn.

This typically happens when you use the URL used to browse through the repository and not the actual URL at which the repository is running.

Wednesday, September 7, 2011

How to split bash window or bash shell a small tutorial

The answer to all these problems is using the dynamic virtual terminal manager or the DVTM. This utility can be installed on ubuntu or debian using:
sudo apt-get install dvtm
This can be invoked by using the command:
dvtm
To create a new window in the same shell, use ctrl-g followed by c for create.
To move between windows use ctrl-g followed by j or k.
To arrange them in a grid, use ctrl-g followed by g.

Another tool that can be used for this purpose is byobu. You can apt-get this tool in the same way as the dvtm tool.  Screen tool can also be used for this same purpose. dvtm and byobu are supported by ubuntu and are good alternatives to the screen utility.

Tuesday, August 30, 2011

A nice example of max-min fairness in networks

An example on max-min fairness taken from here:

Compute the max-min fair allocation for a set of four sources with demands 2, 2.6, 4, 5 when the resource has a capacity of 10.

Solution: We compute the fair share in several rounds of computation. In the first round, we tentatively divide the resource into four portions of size 2.5. Since this is larger than source 1's demand, this leaves 0.5 left over for the remaining three sources, which we divide evenly among the rest, giving them 2.66... each. This is larger than what source 2 wants, so we have an excess of 0.066..., which we divide evenly among the remaining two sources, giving them 2.5 + 0.66... + 0.033... = 2.7 each. Thus, the fair allocation is: source 1 gets 2, source 2 gets 2.6, sources 3 and 4 get 2.7 each. 

Another example on weighted, max-min fairness:

Compute the max-min fair allocation for a set of four sources with demands 4, 2, 10, 4 and weights 2.5, 4, 0.5, 1 when the resource has a capacity of 16.

Solution:The first step is to normalize the weights so that the smallest weight is 1. This gives us the set of weights as 5, 8, 1, 2. We can now pretend that the number of sources, instead of being 4, is 5 + 8 + 1 + 2 = 16. We therefore divide the resource into 16 shares. In each round of resource allocation, we give a source a share proportional to its weight. Thus, in the first round, we compute C/n as 16/16 = 1. In this round, the sources receive 5, 8, 1, 2 units of the resource, respectively. Source 1 gets 5, and only needs 4, so we have 1 unit extra. Similarly, source 2 has 6 units extra. Sources 3 and 4 are backlogged, since their share is less than their demand. We now have 7 units of resources which have to be distributed to sources 3 and 4. Their weights are 1 and 2, and the smallest weight is 1, so there is no need to normalize weights. We give source 3 an additional 7 × 2/3 units (since its weight is 1), and source 4 an additional 7 × 2/3 units (since its weight is 2). This increases source 4's share to 2 + 7 × 2/3 = 6.666 units, which is more than it needs. So we give the excess 2.666 units to source 3, which finally gets 1 + 7/3 + 2.666 = 6 units. The final shares are, therefore, 4, 2, 6, 4. This is the max-min weighted fair share allocation.

Saturday, August 27, 2011

Why is water stored below a shuttle launch pad

Water is not stored, but rather sprayed below a shuttle launch pad because, the water mist consists of tiny water molecules floating through the air that are capable of absorbing the tremendous sound energy caused at the shuttle take off. By absorbing the energy the mist prevents reflection of any of it back on to the shuttle and hence prevents damage. Quite a bit of it also evaporates into steam which is seen during take off, but the primary purpose is not cooling, but rather absorption of the sound.

Wednesday, August 24, 2011

Testing a TV remote with a cellphone

To test a remote, put your cell phone in camera  mode and face the remote towards the phone and push a button.Cell phones can see light outside of the visible spectrum and if the remote works you will see the light flash on your camera screen.
 

Sunday, July 17, 2011

Using binary copy in Windows for hiding a rar file within a jpg image file.

A command as:

copy /b img.jpg + src.rar img.jpg
can be used to hide src with the image file. This command results in a binary copy of the image and the src. rar file (which can contain your data which is to be hidden) into the img.jpg.


While opening, you can just rename the  image file with winrar and things will work out fine.

Neat trick to bypass blocked websites

Is a particular website blocked at your school or workplace. Try this. Type the ip of that website in the browser and lo and behold it works. IP can be usually discovered by pinging the website. 

Now what if the command prompt is blocked?
First, to get a new command prompt, open Notepad and type: command.com. Then, save as “cmd.bat”. You now have a command prompt. Now, open the command prompt and type “ping http://www.website.com/” to find the IP address of that website. Enter the website into the browser and you will officially have impressed all your friends.
Now what if ping is blocked on your network? How do you get the IP then?
- Try nslookup. See the example below:

 C:\Users\audiophile81>nslookup
Default Server:  vdns1.srv.prnynj.cv.net
Address:  167.206.245.129

> google.com
Server:  vdns1.srv.prnynj.cv.net
Address:  167.206.245.129

Non-authoritative answer:
Name:    google.com
Addresses:  74.YY.YY.YY
          74.XX.XX.XX         
> exit
 Cheers! Use this IP for browsing.

Saturday, July 16, 2011

Paranoid of keyloggers? A preventive approach to using public computers

Against hardware key loggers:  The simplest approach is to check if a key logger is connected. Check the picture below, where the key logger in the right hand side pic is circled. You might want to check that such a device is not connected when you connect to the internet with someone else's machine.
 

                                                                                                               
Presence of a keylogger connected to the desktop.         









Against software key loggers: A simple approach against software keyloggers (except ones which also track mouse movement) is as follows. If you are entering a password, say "pass123", type in say 3 random letters "ksd", then select all of these with the mouse and overwrite them with "pas", followed by 4 more random letters "rete", which are again overwritten by selecting the four characters with the mouse and actually typing in the remaining password: "s123". Hence the keylogger will actually see: "ksdpasretes123" instead of the original "pass123" making it harder to break your password.

Other alternatives if you are allowed on a public computer:
* Use a liveCD to boot and connect to the internet
* Check system tray and task bar for processes running (if the keylogger is not running in stealth mode).