2009-08-06

Solaris 10 on Vmware - failed attempts

Its official. After 2 days of messing around with various version of VMware (server as well workstation) and Solaris (9 and 10), I've given up trying to install Solaris 10 on VMware.

The problem started when I couldn't get VMware tools installed on my Solaris 10 image, since it couldn't find "svcprop" binary. A system-wide search didn't reveal anything either. Google didn't help much.

So, I upped and d/l a fresh copy of Solaris 10, restarted the process, and this time, I'd get stuck at Grub loader menu. At the time I was using VMware workstation 6, and it was suggested that I upgrade to VMware server, which I did.

Next attempt, same thing:


After fair bit of Googling, I thought, I gotta encourage GRUB to find the kernel, but alas, to no avail:

So I've given up on this, but if anyone finds a solution - please do let me know!



2009-08-05

Citation Management tools

When I started writing out my thesis last time around, I ended up experimenting with various tools, open source as well as commercial:

  1. JSTOR - allows you to export citations to bibliographic software
  2. EndNote - probably the best commercial software in the category.


However, I didn't quite get to grips with working in a RTF file that EndNote wanted and then trying to manage my citations that way. I wanted a utility that could store my bibliography database, and produce a list of references that I had actually referenced.

Enter, Zotero. Probably the best tool in the category, and what's more, its open source! It has a fire-fox add-on, as well as MS Word plugin. You can create a bibliography database while browsing (using Firefox), export your database and import it into the Word plugin, and merrily produce your work. As you reference actual items, it keeps track of all references, and you can produce a Reference list, in the style of your choice!

However, I now hear this feature is available in Word 2007 as well, however, I haven't had a chance to play with it yet.


2009-08-04

Proliferation of passwords

We all have passwords for something or the other; more so in today's world. Currently, I have the following passwords:

  • Gmail and hotmail accounts, and for Yahoo Flickr account
  • The AT&T VPN client to login to the corporate work network
  • Lotus notes passwords to log into ..well Notes, to view email
  • Corporate Intranet
  • SameTime for corporate instant messaging (which is thankfully the same as the Corporate Intranet password)
  • Online banking
  • Login to my backup NAS drive at home
  • Login to the corporate backup systems
  • Login to my blackberry
Typically, different systems tend to make you remember arcane bits of information. For example, online banking systems typically want you to remember a 4 digit code (which no sane person keeps the same as their PIN)

Additionally, all systems have different password expiration policy - my corporate systems have an 8 digit password, which should contain numbers and letters in lower and uppercase, expire every 2 months, and the password cannot be same as last 3 passwords. No kidding! Compared to that, the online systems are faily forgiving - you can have the same password all your life for say, hotmail, and it won't complain!

I haven't tried any password management systems yet, but I'm happy to take recommendations. My current mechanism is to "memorize" all passwords :-)

Developing an intelligent framework to play finite-information board games

Computer or video games employ artificial intelligence to provide more interesting and challenging experience. Most AI is achieved by pre-scripted routines. However, designing programs that can play real-life games with human-like ability are a growing area of interest, since the better we become at designing such programs, the more we can learn to apply learning tactics in machines.

The meta-game framework developed by Barney Pell eliminates human bias in learning by generalizing the input it accepts to the rules of a game with a pre-defined class, and designing programs to play them.

Barney Pell uses the concept of “Advisors” – first used by Susan Epstein in HOYLE[1], a key component of his metagame framework derived from extensive human analysis of the class of games, as well as well as expert knowledge. Advisors are resource-limited hierarchical procedures which attempt to compute a decision based on correct knowledge, shallow search and inference.

Although the meta-game framework does a very good job of removing bias, it is limited in its capabilities to search efficiently in a reasonable amount of time to truly demonstrate the use of AI in game-play, because:

1. Manually assigned “weights” to Advisors - In his design of the metagame framework, Pell assigned the weights manually to advisors, via deduction or analysis of the type of game advisor. Even though these advisors are developed for a class of games, there is some potential of bias or human influence creeping in, since the weights assigned to each advisor is potentially the importance the observer places on a certain strategy. For example, “capturing a piece” may be rated higher than “move pawn to convert to King”, in the game of chess.
2. Static Advisors – Both the metagame framework and Hoyle employ pre-determined, “static” advisors, developed with careful human analysis. Such advisors will offer meaningful advice only to games already known, or those that have been used to test the model.

If anyone ever manages to find a working copy of Pell's code, please contact me. This is something I'd be very keen on, however, my search for the code hasn't had much success!

References:
  1. HOYLE
  2. A Strategic Metagame Player for General Chess-Like Games
  3. Entertainment Software Association – Sales & Research Data
  4. Game theory
  5. The metagame project
  6. SAL
  7. A comparison of human and computer game playing
  8. Barney Pell papers FTP site
  9. Nici Schraudolph's go networks
  10. Towards an ideal trainer

2009-04-16

Perl one liner for dos2unix

So we have all come across the situation: you copy a bunch of files from DOS/Windows to Unix and the newline characters are all messed up (in other words, you see a "^M" at the end of each line). So the scripts you wrote lovingly, are all messed up now.

There are two choices:

Use dos2unix - this will change the newline characters one file at a time. Trouble is, that dos2unix writes to stdout, so you'd have to pipe the output to a temporary file and move it back to your script...

Use the following perl one-liner:

perl -pi -e 's/\r\n/\n/g' *

You guessed it - Windows/DOS uses "\r\n" for newline, while Unix uses only "\n"

Back again

Wow, it's been a while that I've been here... there's just been way too much travel..

I'm currently in Romania, after surviving a near death experience in a local taxi (which of all things, was about to hit a Police car, or maybe it was the other way around)... no one was hurt, though I was shaken... a lot!

I'm going to try to be more regular here now.

2008-09-21

Sunshine, you are my sunshine!

I am really proud of this shot! It took me a long time to compose it just the way I wanted it, with a nice clear subject, and a blurry background, and I wanted perfectly clear fleurs.

Hope you like it too!

2008-08-29

Nigella damascena, White

Found in my neighbour's garden, one windy London afternoon.

I had no idea what this was, but one of my friends on Flickr (jacilluch) pointed out very kindly that it was Nigella damascena. Quick googling revealed its also called devil-in-the-bush, presumably because of its beauty! :-)

2008-08-25

Look at me! Look at me!


Self Portrait
Originally uploaded by Manav Gupta
So, I venture out on a typical wet & blustry morning, and I remember to take my camera with me... my neighbours invite me to go through their shrubs, and voila! I find this lil fella going "look at me, look me!"...

He allowed me to get in pretty close, and if you view this in the large version, he seems to be enjoying the attention :-) And while I'm at it, this was one of the most difficult pictures I've ever taken (bugs all around me, the fear of upsetting this guy and spilling the raindrops, high winds)... I captured about 19 shots, and am uploading what I think is the best

And if you look closely, you can see my silhouette in two of the water droplets!

2008-08-24

Freeze Action!


Freeze Action!
Originally uploaded by Manav Gupta
I went to the Bushy Park in Hampton with my parents yesterday. The weather was great, and the geese were more than happy to have us, especially for food. One of them even snatched an apple off my mom's hands

2008-08-22

Hmm...maybe there's some nectar left in there...

One of my most recent shots. I bought a canon 60mm macro lens for my camera a few days ago, and off I went with my mom in two, looking for some ripe subjects. Of course, as usual my mom knew better places than me.

So I found myself outside this house, with wonderful flowers in the garden, and a low-low fence, so I could shoot them.

Of course I started clicking away, and then a woman came out of the house and she was startled! :-) I quickly had to explain what I was doing (while she instead thought we were taking pictures of the house, which she had just bought!)..close call :-) ..but here's the effort.

2008-02-22

Word Tables and cells with VBA

I cannot believe how hard this was (took me 3 to 4 hours) - working with Word tables and cells, and here's a synopsis of what I had to go through.

Objective:

INPUT FILE

Header text to be copied on every output file

Second line of header text to be copied on every output file (if having more than one line screws things up I can have just one)

Column Heading 1

Column Heading 2

Column Heading 3

Column Heading 4

Column Heading 5

Column Heading 6

Column Heading 7

Column Heading 8

98000

John

data

data

data

data

data

data

98000

Cyndee

data

data

data

data

data

data

98001

Kevin

data

data

data

data

data

data

-----------------

OUTPUT FILE 1 (i.e. has all data where the first column’s data = 98000)

Header text to be copied on every output file

Second line of header text to be copied on every output file (if having more than one line screws things up I can have just one)

Column Heading 2

Column Heading 3

Column Heading 4

Column Heading 5

Column Heading 6

Column Heading 7

Column Heading 8

John

data

data

data

data

data

data

Kevin

data

data

data

data

data

data

OUTPUT FILE 2 (i.e. has all data where the first column’s data = 98001)

Header text to be copied on every output file

Second line of header text to be copied on every output file (if having more than one line screws things up I can have just one)

Column Heading 2

Column Heading 3

Column Heading 4

Column Heading 5

Column Heading 6

Column Heading 7

Column Heading 8

Cyndee

data

data

data

data

data

data




---------------

  1. So, I got around to read the input word document, and wanted to then create an "array" of word documents, and thought I could use the entry in the first column (such as "98000"), as the key - especially with the examples I saw on the web. Alas, none of them worked, so I had to use a Scripting.Dictionary object.
  2. Second, I had trouble browsing or navigating a Word table, one row and one cell at a time.
  3. When I finally got around that, I then had to worry about ensuring the Font styles were copied across. Again, turns out there isn't a direct mechanism in VBA to do that.
  4. When I do copy the text across, the table's Autofit behaviour no longer remains the same - and has to be reapplied before saving.
  5. If that wasn't enough, the documents created for output were by default saved in "Outline" mode - one of the vagaries of word that I would never understand.

There were other problems faced, not worth mentioning here..but here's the key snippet of the code:

'Add rows to table as required
Private Sub PopulateAndExtendTable(tbl As Word.Table, aData As Word.Range)
Dim nrRows As Long, nrCols As Long
Dim oCell As Cell
Dim oRow As Row


'tbl.Range.FormattedText = aData.FormattedText
'tbl.Rows(tbl.Rows.Count).Range.FormattedText = aData.FormattedText
tbl.Rows(tbl.Rows.Count).Range.Font = aData.Font
tbl.Rows(tbl.Rows.Count).Range.Font.Bold = aData.Font.Bold
For Each oRow In aData.Rows
For Each oCell In oRow.Cells
'MsgBox "Hi" & oCell.Range.Text
tbl.Cell(oRow.Index, oCell.ColumnIndex).Range.Text = oCell.Range.Text
tbl.Cell(oRow.Index, oCell.ColumnIndex).Range.Font = oCell.Range.Font
Next
If aData.Rows.Count > tbl.Rows.Count Then tbl.Rows.Add
Next

tbl.Rows.Add

End Sub 'Populate existing rows





Finally, here are some useful links


2008-01-29

Installing Ubuntu from USB flash drive....

So, after countless failed attempts, here's another go.

Turns out there are several people in the same rut as me, not to mention the countless on Ubuntu forums begging to know what to do once thrown to the BusyBox console (what's up with that name anyway?).

However, I did find a couple of new URLs:

  1. http://learn.clemsonlinux.org/wiki/Ubuntu:Install_from_USB_drive
  2. http://kmandla.wordpress.com/2006/12/11/install-ubuntu-from-usb/

So time now to experiment all over again.

This time I will format my USB drive in FAT16, instead of FAT32. I have downloaded another fresh image of Ubuntu 7.10 iso, and verified md5 checksum. So far, so good.

So,

  1. Create a virtual floppy drive using vfd
  2. Format and make bootable the virtual floppy using Windows
  3. Create bootable USB flash, with FAT16, using HP's utility, and supplying boot files from the virtual floppy.
  4. Install bootloader on USB using syslinux. Verified ldlinux.sys appeared in the root folder
  5. Copied over all 712,508 KB of Ubuntu distrib on to the freshly formatted USB drive. Boy, is FAT16 slow or what?
  6. The clemsonlinux.org page above insists that initrd.gz and vmlinuz must be downloaded from Ubuntu archives. Well, what the hey... and yes, that falls flat on its face.
  7. So back to the drawing board. This time, I followed instructions to the letter from here, and everything seems ok, until it just... "hung"... no messages on the screen...
  8. At this point I have no clue what to do..

2008-01-28

Booting from USB drive

I know its been a while since I came back to my blog. Things have been quite bad, but more on that later...

So then, I got a new Thinkpad t61p, with 2 GB RAM and 100 GB HDD pre-installed. Another 2 GB RAM was provided later, as well as a 200 GB HDD (wahey!). However, now that I have 300 GB HDD (I got rid of the DVD/RW drive), I wanted to install Ubuntu. So, off I went and downloaded all ~700 MB of Ubuntu distro.The problem of course is that, although the Ubuntu distro (*.iso) can be opened via WinRaR, the "start.exe" supplied with the distro, only fires up the Ubuntu browser, and wubi-cdboot.exe complains "Could not find any appropriate CD"... well fair enough.

But I do have USB pen drives available - so I should be able to boot from them right? Bad idea....

Quick googling gave me quite a few promising results, and I'm going to explore them all here one at a time.

  1. http://www.bootdisk.com/pendrive.htm - if you get past the tacky colour scheme, you find that it presents a number of options. Let's try and run through them all here
    • Option 1 - Using mkbt
      • You can pretty much disregard option 1, since it expects you to have a floppy drive in this day and age. Right (!). And it expects you to have created one using Windows....
    • Option 2 - using HP's utilities, a USB Disk format tool and another to probably copy the boot files off to USB key, but a 45 MB utility for that? No way am I using it.
    • Option 3 - Third party links 1 and 2 - While the first one wants you to have a bootable CD already, the second is merely a list of recommendations from MS when booting from USB Storage Devices...
    • Option 4 - Provides a way of copying over windows bootable files on Win98 (!). Another option was to use the Windows Enabler utility, which seemed promising, but it doesn't work for me either, since it won't startup on my PC. Further examination revealed that it won't start up since it cannot find a CD/DVD drive.
    • Option 5 - The last option provided was to create a virtual floppy drive, which is a neat idea (reminds me of my favourite utility deamontools). After a couple of attempts (and a reboot), it finally managed to create a virtual floppy drive, and assign it a drive letter.
  2. The rest of the websites have variations on these options.

I finally managed to work with two different options:

1. Use vfd to create a virtual floppy drive
2. Format and make this floppy drive DOS-bootable ,using Windows Explorer
3. Used rawrite to write binary image of this floppy on to the USB drive.
4. Boot from USB (after of course, suitable changes to BIOS startup config).

However, the drawback of this is the USB drive effectively becomes the size of the floppy disk (so, if vfd was used to create a 1.44 MB floppy disk, then writing that image on the USB disk renders it to 1.44 MB drive).


Lastly, I did resort to using HP's utility to create a bootable USB disk - and yes, that worked.

Next step, trying to get Ubuntu to intall, without sticking me at Busybox console!


By and by, I decided it would be a neat idea to be able to boot from my USB drive

2007-11-05

More Tulips...


More Tulips...
Originally uploaded by Manav Gupta
Here's another picture from the same set...

More Tulips...


More Tulips...
Originally uploaded by Manav Gupta
One of my very old pictures, from the "flowers" set on my flicker account (http://www.flickr.com/photos/14621919@N07/), I'm quite pleased with the sun on this photo.

I took over a dozen shots to finally get something useable.

2006-04-22

VOIP Network Elements

Service providers or enterprises can develop a Voice over IP architecture in one of three ways:
—By IP-enabling an existing telephony network
—By voice-enabling an existing IP or other packet network
—By building a pure IP telephony network from scratch

Regardless of a service provider gets to a Voice over IP architecture, the end result is the same. Whether the network is a pure IP network or uses other existing packet infrastructure, the architecture will have these elements in common:
  • Communication server—Also called a "call server" or "softswitch," this element is the brains of the network, providing call control, gateway control, service intelligence, and other centralized functions.
  • Signaling point—This element enables the Voice over IP network to communicate with the SS7 (Signaling System 7) network.
  • Line and trunk gateways—These elements provide connectivity to the public network (either the local line or long-haul trunking segments, respectively)
  • Core switches and routers—These elements keep traffic moving through the core of the IP network
  • Application server—This element provides voice, data, or multimedia services from a central location in the IP network.
  • 2006-03-09

    Telecom resources

    So, in my quest to read-up more (I will make a separate section on this sometime), here's more telecom resources:

    1. International Engineering Consortium, Tutotials
    2. Next generation networking
    3. Telecom resources
    4. Ericsson - Understanding telecommunications



    Note to self: Submit info on the following Wikipedia stub:

    http://en.wikipedia.org/wiki/Internet_traffic_engineering

    Latest books ordered

    While looking for some new material to read, I came across the following:

    1. Surely You're Joking, Mr.Feynman!: Adventures of a Curious Character - Richard Feynman
    2. Men of Mathematics - E T Bell

    While I've ordered these two, others that I'm contemplating are:
    The Art of Computer Programming: Vol 1-3 by Donald Knuth

    Though I've read at least the first volume, I didn't know the following:

    In addition to his writings on computer science, Knuth is also the author of 3:16 Bible Texts Illuminated (1991), ISBN 0895792524, in which he attempts to examine the Bible by a process of stratified random sampling, namely an analysis of chapter 3, verse 16 of each book. Each verse is accompanied by a rendering in calligraphic art, contributed by a group of calligraphers under the leadership of Hermann Zapf.

    Knuth published his first "scientific" article in a school magazine in 1957 under the title "Potrzebie System of Weights and Measures." In it, he defined the fundamental unit of length as the thickness of MAD magazine #26, and named the fundamental unit of force "whatmeworry". MAD magazine bought the article and published it in the June 1957 issue.

    - source Wikipedia

    Which of course makes me want to read the book even more!

    2. Prisoner's Dilemma: John Von Neumann, Game Theory and the Puzzle of the Bomb

    This one sounds even more interesting. Particularly, since I've forgotten everything every Game theory, and also because:

    The various games that are explained and, "played", for the reader actually utilize little in the way of math. Game Theory in practice is about the number of participants, the choices they have, how the games should rationally be played, and how there are played when people replace theory. The results of these games are applicable to daily life, whether it explains how a network will decide the placement of their commercials, why a person will stand in a line of unknown length, or pay more than the true value of an item (like a dollar bill). Peoples behavior often crosses from the irrational to the absurd, and many of these games will point out courses of action almost all readers will have taken at one time or another, when the rational decision was the opposite of what they chose to do.


    Even more intriguing. Guess I'll wait for once before filling up the stack again!

    Other interesting websites of note:
    1. http://foldoc.org/ - free online dictionary of computing
    2. http://xmlliterate.sourceforge.net/index.html - XML Literate documentation
    3. http://en.wikipedia.org/wiki/Category:FOLDOC_sourced_articles - Wikipedia FOLDOC sourced articles

    2006-02-26

    Quality of Service

    quality of service

    In the fields of packet-switched networks and computer networking, the traffic engineering term Quality of Service (QoS) refers to the probability of the telecommunication network meeting a given traffic contract, or in many cases is used informally to refer to the probability of a packet succeeding in passing between two points in the network.

    In the field of telephony, telephony quality of service refers to lack of noise and tones on the circuit, appropriate loudness levels etc., and includes grade of service.

    Problems

    When the Internet was first being created, there was no perceived need for a QoS application. So in fact the entire internet ran on a "best effort" system. There were four "type of service" bits and three "precedence" bits provided in each message, but they were largely unused. There are many things that can happen to packets as they travel from origin to destination and they result in the following problems, as seen from the point of view of the sender and receiver:

    • dropped packets - the routers might fail to deliver (drop) some packets if they arrive when their buffers are already full. Some, none, or all of the packets might be dropped, depending on the state of the network, and it is impossible to determine what happened in advance. The receiving application must ask for this information to be retransmitted, possibly causing severe delays in the overall transmission.
    • delay - it might take a long time for a packet to reach its destination, because it gets held up in long queues, or takes a less direct route to avoid congestion. Alternatively, it might follow a fast, direct route. Thus delay is very unpredictable.
    • Jitter - packets from source will reach the destination with different delays. This variation in delay is known as jitter and can seriously affect the quality of streaming audio and/or video.
    • out-of-order delivery - when a collection of related packets are routed through the Internet, different packets may take different routes, each resulting in a different delay. The result is that the packets arrive in a different order to the one with which they were sent. This problem necessitates special additional protocols responsible for rearranging out-of-order packets once they reach their destination.
    • error - sometimes packets are misdirected, or combined together, or corrupted, while en route. The receiver has to detect this and, just as if the packet was dropped, ask the sender to repeat itself.

    Applications requiring QoS

    A traffic contract (SLA, Service Level Agreement) specifies guarantees for the ability of a network/protocol to give guaranteed performance/throughput/latency bounds based on mutually agreed measures, usually by prioritising traffic. A defined Quality of Service may be required for certain types of network traffic, for example:

    • streaming multimedia may require guaranteed throughput
    • IP telephony may require strict limits on jitter and delay
    • dedicated link emulation requires both guaranteed throughput and imposes limits on maximum delay
    • a safety-critical application, such as remote surgery may require a guaranteed level of availability (this is also called hard QoS).

    These types of service are called inelastic, meaning that they require a certain level of bandwidth to function - any more than required is unused, and any less will render the service non-functioning. By contrast, elastic applications can take advantage of however much or little bandwidth is available.

    Obtaining QoS

    There are essentially two ways to provide QoS guarantees. The first is simply to provide lots of resources, enough to meet the expected peak demand with a substantial safety margin. This is nice and simple, but some people believe it to be expensive in practice, and can't cope if the peak demand increases faster than predicted: deploying the extra resources takes time.

    The second one is to require people to make reservations, and only accept the reservations if the routers are able to serve them reliably. Naturally, you can then charge people money for making reservations! There are two popular variations on this:

    DiffServ are typically used with:

    • weighted round robin, WRR.
    • RED, WRED - Lessens the possibility of port queue buffer tail-drops and this lowers the likelihood of TCP global synchronization.
    • Traffic shaping
    • A number of port queue buffers.
    • VLAN IEEE 802.1p and IEEE 802.1D.

    Network equipment, that supports DiffServ and perhaps IntServ, are called multilayer network equipment. A switch that supports DiffServ and perhaps IntServ is called a multilayer switch.

    However, the market has not yet favoured QoS services. Some people believe that this is because a "dumb" network that offers sufficient bandwidth for most applications, most of the time, is already economically stable, with little incentive to deploy non-standard stateful QoS-based applications.

    Internet peering arrangements are already complex, and there appears to be no enthusiasm among providers for supporting QoS across peering connections, or agreement about what policies should be supported in order to do so.

    QoS skeptics further point out that if you are dropping many packets on elastic low-QoS connections, you are already dangerously close to the point of congestion collapse on your inelastic high-QoS applications, without any way of further dropping traffic without violating traffic contracts.

    QoS problems with some technologies

    The following properties may only be used on end ports, but not on server, backbone or other ports that mediate many concurrent flows.

    • half duplex - link collisions make delay variations (jitter), because the packets are delayed with each collision by the backoff-time.
    • Port queue buffer IEEE 802.3x "flow"-control.

    IEEE 802.3x "flow"-control does not really specify a flow control protocol, but rather a kind of queue-control. An example of an IEEE 802.3x problem is "head of Line"-blocking. Many of today's switches have IEEE 802.3x on as default - even on uplink/backbone ports.

    Quote from Network World, 09/13/99, 'Flow control feedback': "...Hewlett-Packard points out that quality of service is a better way to handle potential congestion, and Cabletron and Nortel note that QoS features can't operate properly if a switch sends [IEEE 802.3x] pause frames...."

    This quote suggests that QoS and IEEE 802.3x are incompatible.

    An Ethernet connection with 100 Mbit/s full duplex instead of 100 Mbit/s half duplex increases the effective speed from ca. 60-100 Mbit/s half duplex to 200 Mbit/s (100 Mbit/s transmit + 100 Mbit/s receive).

    See also

    • ATM
    • Class of Service
    • Internet
    • Network congestion avoidance
    • Video quality
    • PSTN
    • Telephony quality of service
    • Traffic Shaping
    • 802.11e: Quality of Service enhancements for WiFi standard 802.11b
    • Wireless Multimedia Extensions (WME) also known as Wi-Fi Multimedia (WMM)
    • Broadband Remote Access Server

    Reference