<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blawgg</title>
	<atom:link href="http://vikramdhunta.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://vikramdhunta.com/blog</link>
	<description>Tinkerer</description>
	<lastBuildDate>Sun, 07 Aug 2011 12:31:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>(My) Three reasons why Twitter works</title>
		<link>http://vikramdhunta.com/blog/2011/08/07/my-three-reasons-why-twitter-works/</link>
		<comments>http://vikramdhunta.com/blog/2011/08/07/my-three-reasons-why-twitter-works/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 12:31:31 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=179</guid>
		<description><![CDATA[Drafted this post a little over an year back when Twitter was really picking up steam.. only just published it. In a way it proves my bonus point #4 below. My Three Reasons why Twitter works - Re-tweeting = Word of Mouth. It&#8217;s not just passing on the message..it&#8217;s a stamp of approval. Feels like [...]]]></description>
			<content:encoded><![CDATA[<p>Drafted this post a little over an year back when Twitter was really picking up steam.. only just published it. In a way it proves my bonus point #4 below. <img src='http://vikramdhunta.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><strong>My Three Reasons why Twitter works -</strong></p>
<ol>
<li>Re-tweeting = Word of Mouth. It&#8217;s not just passing on the message..it&#8217;s a stamp of approval.</li>
<li>Feels like sitting next to friends and chitchatting.</li>
<li>Instant relay leads to instant feedback &#8211; pushing you to improve the quality or your tweets, or the timelines (respond faster/stay updated)</li>
<p><strong> Bonus reason:</strong></p>
<li>Low expectations from our stressed out mental capacity &#8211; &#8220;I just need to utter 140 chars or less&#8221; vs. &#8220;I need to write a few paragraphs for my blog post&#8221;. To a blogger/writer, every Twitter post is a small win!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2011/08/07/my-three-reasons-why-twitter-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatting MS Word 2003 Documents for Kindle publishing: MS Word VBA Macro</title>
		<link>http://vikramdhunta.com/blog/2011/06/12/formatting-ms-word-2003-documents-for-kindle-publishing/</link>
		<comments>http://vikramdhunta.com/blog/2011/06/12/formatting-ms-word-2003-documents-for-kindle-publishing/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 04:53:36 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[ms word]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=201</guid>
		<description><![CDATA[The Kindle Direct Publishing program is a great way for authors to self-publish their books for Kindle users. There are several limitations however when it comes to readying your book for the Kindle since Kindle only supports very basic HTML. You have to abandon any fancy formatting you may have done in recent word processors [...]]]></description>
			<content:encoded><![CDATA[<p>The Kindle Direct Publishing program is a great way for authors to self-publish their books for Kindle users. There are several limitations however when it comes to readying your book for the Kindle since Kindle only supports very basic HTML. You have to abandon any fancy formatting you may have done in recent word processors and give your book a &#8217;1999 Netscape Navigator 3.0 compatible website&#8217; look.</p>
<p>I recently decided to move one of my Dad&#8217;s books into this channel. The book was written in MS-word and formatted to properly print on both sides of a page. Additionally there were many non-standard formatting techniques &#8211; eg different Header styles applied to different chapter headings. Properly formatting the book for Kindle would have taken a lot of effort, so I decided to accomplish at least part of that effort, using VBA for MS-word.</p>
<p>The VBA Macro I developed is below with instructions for use. This macro Kindle-readies a word document by:<br />
1 &#8211; Transforming Page size to be 4.5&#8243;x5.5&#8243;, plus very small margins.<br />
2 &#8211; Justifies all paragraphs, and reduces their indents to a very small value<br />
3 &#8211; Merges all columns within Tables, so there are only tables with one column and as many rows as originally existed. I did this because the tables in my word documents were poorly formatted, and I decided to go with a 1-column table layout that the kindle could handle more easily.<br />
4 &#8211; Centers all tables and shapes on the page</p>
<p>This macro will also save the current document and save a copy as a HTML (Filtered) file in a specified subdirectory with a &#8220;KDP_&#8221; prefix. You can choose to switch off either option.</p>
<p>What this macro does not do -<br />
1 &#8211; Clean up headers/footers<br />
2 &#8211; Standardize formatting &#8211; e.g. the header styles for different sections<br />
3 &#8211; Clean up any font issues<br />
4 &#8211; Clean up the resulting HTML code  &#8211; I recommend running HTMLTidy within Notepad++ on the HTML files generated through this code. One specific problem that HTMLTidy resolved was long strings of space, newline or tab characters that create unnecessary whitespace on the Kindle. As this kind of whitespace may have specific purpose in your word document, I did not make this cleanup part of the code.<br />
5 &#8211; Reduce image size. Still need to figure this one out &#8211; does Kindle automatically reduce all images to viewable size?<br />
6 &#8211; a lot of other issues your word files may have!</p>
<p>Below are instructions on using the code and the code itself. <strong>Please note this was made for a very specific purpose, and there are absolutely no warranties of any kind. Use this at your own risk! And take a backup of all your files before proceeding</strong>. Also I will only make future updates to the code as required to suit my purpose. <strong>This macro was designed and tested on MS Office 2003</strong>.</p>
<p><strong>How to use this macro -</strong></p>
<ol>
<li> I run this Macro in the Normal.dot file. See these <a href="#AddMacrotoNormal">steps at the end</a> to know how to insert this code into the Normal.dot file</li>
<li>After the Macro has been inserted into the Normal.dot file, I created a toolbar button to run it. You could choose to run it from the Tools menu everytime.</li>
<li>If you would like to save resulting HTML files in a subdirectory of the folder where your word document is, then modify the KDPPATH variable in the macro.</li>
<li>This macro will save the current document (Doc) and also save a HTML version. To stop either option, you can comment out the corresponding line in the macro.</li>
<li>Open the word document that you need to convert.</li>
<li>Run the macro using the toolbar button or from the Tools menu.</li>
<li>Wait until you get a &#8216;Done&#8217; message box. Then your doc/html file should be ready. The MSWord window will show the HTML file after completion (unless you opted out of the HTML generation).</li>
<li>You may need to further work on the DOC file and address other issues before it is finally ready for Kindle formatting. If you do this, you will need to save it as an HTML from the File menu yourself.</li>
</ol>
<p><strong>Macro Code</strong></p>
<blockquote><p>Option Explicit<br />
Dim KDPPATH As String<br />
Dim INDENTVALUE As Single<br />
Public Sub PerformKindleFormatting()<br />
&#8216;if you have a subdirectory in the SAME folder as the DOC file where you want the KDP html files to be saved, then<br />
&#8216;put that subdirectory name in the KDPPATH variable below. Leave blank if you want html files to be in the same location as the DOC<br />
KDPPATH = &#8220;myKDP/&#8221;   &#8216; don&#8217;t remove the trailing backslash \ if you put a value here  !!!!!</p>
<p>INDENTVALUE = 1 / 72</p>
<p>&#8216;MsgBox &#8220;Starting &#8216;&#8221; &amp; ActiveDocument.Name &amp; &#8220;&#8216; You will receive another message when the process is done.&#8221;<br />
Step1DoPagesetup<br />
Step2FixAlignments<br />
&#8216; Step3<br />
&#8216;Step4SaveDocument   &#8216; comment out this line if you don&#8217;t want to save the modified DOC file itself<br />
Step5SaveAsWebpage  &#8216; comment out this line if you don&#8217;t want to save a copy in HTML (Filtered) format<br />
MsgBox &#8220;Done&#8221;<br />
End Sub</p>
<p>Sub Step1DoPagesetup()<br />
&#8216; MOST OF THE CODE HERE GENERATED BY RECORDING A MACRO..SOME TWEAKS AS COMMENTED BELOW<br />
With ActiveDocument.Styles(wdStyleNormal).Font<br />
If .NameFarEast = .NameAscii Then<br />
.NameAscii = &#8220;&#8221;<br />
End If<br />
.NameFarEast = &#8220;&#8221;<br />
End With<br />
With ActiveDocument.PageSetup<br />
.LineNumbering.Active = False<br />
.Orientation = wdOrientPortrait<br />
.TopMargin = InchesToPoints(INDENTVALUE)   &#8216;VERY SMALL MARGIN<br />
.BottomMargin = InchesToPoints(INDENTVALUE) &#8216;VERY SMALL MARGIN<br />
.LeftMargin = InchesToPoints(INDENTVALUE)  &#8216;VERY SMALL MARGIN<br />
.RightMargin = InchesToPoints(INDENTVALUE) &#8216;VERY SMALL MARGIN<br />
.Gutter = InchesToPoints(0)<br />
.HeaderDistance = InchesToPoints(0) &#8216;HEADER IS RIGHT ON TOP<br />
.FooterDistance = InchesToPoints(0) &#8216;FOOTER IS RIGHT AT BOTTOM<br />
.PageWidth = InchesToPoints(4.5)    &#8216;USING 4.5 INCHES TO SOMEWHAT ALIGN WITH KINDLE VIEWABLE SCREEN WIDTH<br />
.PageHeight = InchesToPoints(5.5)   &#8216;USING 5.5 INCHES TO SOMEWHAT ALIGN WITH KINDLE VIEWABLE SCREEN HEIGHT<br />
.FirstPageTray = wdPrinterDefaultBin<br />
.OtherPagesTray = wdPrinterDefaultBin<br />
.SectionStart = wdSectionContinuous &#8216; MODIFIED THIS TO CONTINOUS. TEST WITH NEWPAGE OPTION ALSO?<br />
.OddAndEvenPagesHeaderFooter = False<br />
.DifferentFirstPageHeaderFooter = False<br />
.VerticalAlignment = wdAlignVerticalTop<br />
.SuppressEndnotes = False<br />
.MirrorMargins = False<br />
.TwoPagesOnOne = False<br />
.BookFoldPrinting = False<br />
.BookFoldRevPrinting = False<br />
.BookFoldPrintingSheets = 1<br />
.GutterPos = wdGutterPosLeft<br />
End With<br />
If ActiveWindow.View.SplitSpecial &lt;&gt; wdPaneNone Then<br />
ActiveWindow.Panes(2).Close<br />
End If<br />
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow.ActivePane.View.Type = wdOutlineView Then<br />
ActiveWindow.ActivePane.View.Type = wdPrintView<br />
End If<br />
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument<br />
End Sub<br />
Public Sub Step2FixAlignments()<br />
Dim i As Long<br />
Dim j As Long<br />
With ActiveDocument<br />
For i = 1 To .Paragraphs.Count<br />
.Paragraphs(i).Alignment = wdAlignParagraphJustify  &#8216; JUSTIFY ALL TEXT<br />
.Paragraphs(i).FirstLineIndent = InchesToPoints(INDENTVALUE)    &#8216; SMALL INDENT TO FIRST LINE OF PARAS<br />
.Paragraphs(i).LeftIndent = InchesToPoints(INDENTVALUE) &#8216; SMALL INDENT TO PARA<br />
Next i<br />
For i = 1 To .Sections.Count<br />
&#8216;Sections(i).Range.Borders.InsideLineStyle = wdLineStyleThickThinLargeGap    &#8216;DOING NOTHIN TO SECTIONS<br />
Next i<br />
For i = .Tables.Count To 1 Step -1<br />
For j = 1 To .Tables(i).Rows.Count<br />
.Tables(i).Rows(j).Select<br />
Selection.Cells.Merge       &#8216; MERGE COLUMNS IN TABLES SO THERE ARE ONLY TABLES WITH SINGLE COLUMNS<br />
Next j<br />
.Tables(i).Rows.Alignment = wdAlignRowCenter    &#8216;CENTER TABLE<br />
.Tables(i).AutoFitBehavior (wdAutoFitWindow)    &#8216;MAKE TABLE AUTOFIT TO WINDOW<br />
Next i<br />
&#8216;For i = 1 To .InlineShapes.Count<br />
&#8216;   .InlineShapes(i).Borders.Enable = True<br />
&#8216;   .InlineShapes(i).Borders.OutsideLineWidth = wdLineWidth150pt<br />
&#8216;   .InlineShapes(i).Borders.OutsideColor = wdColorBrightGreen<br />
&#8216;   .InlineShapes(i).Borders.OutsideLineStyle = wdLineStyleDashLargeGap<br />
&#8216;Next i<br />
Dim oILShp As InlineShape<br />
For Each oILShp In ActiveDocument.InlineShapes<br />
oILShp.Select<br />
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter    &#8216; CAUSE INLINE SHAPES TO CENTER<br />
Next<br />
For i = 1 To .Shapes.Count<br />
.Shapes(i).Left = wdShapeCenter<br />
.Shapes(i).RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin  &#8216;CENTER SHAPES<br />
Next i<br />
End With<br />
End Sub<br />
Sub Step4SaveDocument()<br />
&#8216; Currently we just save the document AS-IS. We don&#8217;t save a copy. Because if we save a copy,<br />
&#8216; its the copy that&#8217;s open when the HTML file is being saved next, and that distorts the path/filenames<br />
ActiveDocument.Save</p>
<p>&#8216;Dim fn As String<br />
&#8216;fn = &#8220;KDP_&#8221; &amp; ActiveDocument.Name<br />
&#8216;Debug.Print &#8220;Saving as &#8221; &amp; ActiveDocument.Path &amp; fn<br />
&#8216;ActiveDocument.SaveAs FileName:=ActiveDocument.Path &amp; &#8220;\&#8221; &amp; KDPPATH &amp; fn, FileFormat:=wdFormatDocument</p>
<p>End Sub<br />
Sub Step5SaveAsWebpage()</p>
<p>With ActiveDocument.WebOptions<br />
.RelyOnCSS = False              &#8216; STILL RESULTS IN CSS .. MSWORD #FML<br />
.OptimizeForBrowser = True      &#8216; OK YA?<br />
.OrganizeInFolder = True<br />
.UseLongFileNames = True<br />
.RelyOnVML = False              &#8216; VML HA HA<br />
.AllowPNG = False               &#8216; I LIKE MY LAWSUITS IN GIF<br />
.ScreenSize = msoScreenSize640x480  &#8216; CLOSEST OPTION TO KINDLE?<br />
.PixelsPerInch = 72             &#8216; READ SOMEWHERE THAT KINDLE IS GOOD WITH 72 DPI?<br />
.Encoding = msoEncodingWestern<br />
End With<br />
With Application.DefaultWebOptions<br />
.UpdateLinksOnSave = True<br />
.CheckIfOfficeIsHTMLEditor = True<br />
.CheckIfWordIsDefaultHTMLEditor = True<br />
.AlwaysSaveInDefaultEncoding = False<br />
.SaveNewWebPagesAsWebArchives = False<br />
End With</p>
<p>&#8216; this part takes the file name, removes the DOC (or any) extension, and prepends KDP to form a new filename with extension html<br />
&#8216; it will save the new html file in the same location as the original DOC file.<br />
&#8216; If you put a value in the KDPPATH variable in the GLOBAL section on the top of this code,<br />
&#8216; the html file will be saved in the resulting KDPPATH subdirectory<br />
Dim fn As String<br />
fn = ActiveDocument.Name<br />
fn = &#8220;KDP_&#8221; &amp; Left(fn, InStr(fn, &#8220;.&#8221;) &#8211; 1)<br />
Debug.Print &#8220;Saving as &#8221; &amp; ActiveDocument.Path &amp; fn<br />
ActiveDocument.SaveAs FileName:=ActiveDocument.Path &amp; &#8220;\&#8221; &amp; KDPPATH &amp; fn, FileFormat:=wdFormatFilteredHTML<br />
End Sub</p></blockquote>
<p><strong>Other Useful links:</strong></p>
<ol>
<li><a href="http://johnaugust.com/2009/kindle-formatting-for-web-geeks">John August&#8217;s basics for Kindle formatting</a></li>
<li><a href="http://www.newselfpublishing.com/WordKindle.html">Aaron Shepard&#8217;s tutorial on word to Kindle formatting</a></li>
<li><a href="http://kindleformatting.com/faq.php">Kindle Formatting Faq</a></li>
<li><a href="http://kindleformatting.com/book/files/KindleHTMLtags.pdf">HTML tags compatible with Kindle</a></li>
<li><a href="http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=151">Understand Normal.dot</a></li>
</ol>
<p><strong><a name="AddMacrotoNormal">How to add a macro to your Normal.dot file</a></strong></p>
<p>1 &#8211; Open MS Word<br />
&#8212; Close any documents such as the &#8220;New blank document&#8221; that opens up.<br />
2 &#8211; Click on the menu Tools-&gt;Macros-&gt;Visual Basic Editor (Alternatively press Alt-F11)<br />
3 &#8211; If you don&#8217;t see a &#8220;Project&#8221; pane on the left hand side of the VB editor, click on the menu View-&gt;Project Explorer<br />
4 &#8211; In the project pane, you should be able to see a high level item called &#8220;Normal&#8221;, under which there will be a subitem called &#8220;Modules&#8221;.<br />
5 &#8211; If under &#8220;Modules&#8221;. you see a module called &#8220;NewMacros&#8221;, then double click on it to open it in the editor. If you don&#8217;t, then right click on &#8220;Modules&#8221;, and select the contextmenu item Insert-&gt;Module. Open the new module for editing.<br />
6 &#8211; Paste the macro into the module, in the editor window.<br />
7 &#8211; Save the file. Close word. Now the macro should be a permanent part of your MSWord and can be used on any word document you open in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2011/06/12/formatting-ms-word-2003-documents-for-kindle-publishing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ford Fiesta, Or &#8220;My mechanic&#8217;s early retirement plan&#8221;</title>
		<link>http://vikramdhunta.com/blog/2010/07/24/ford-fiesta-or-my-mechanics-early-retirement-plan/</link>
		<comments>http://vikramdhunta.com/blog/2010/07/24/ford-fiesta-or-my-mechanics-early-retirement-plan/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 16:18:26 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ford fiesta]]></category>
		<category><![CDATA[harpreet ford]]></category>
		<category><![CDATA[india]]></category>
		<category><![CDATA[issues]]></category>
		<category><![CDATA[trouble]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=156</guid>
		<description><![CDATA[Flashback &#8211; Aug 2006. One year into my post-MBA job, just married and can&#8217;t wait to buy my first car. The midrange options at the time are the long running Maruti Baleno, Swift, Hyundai Accent, Tata Indigo, Honda City and a couple of others. And the newly launched Ford Fiesta. The fiesta looks good, is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Flashback &#8211; Aug 2006. </strong>One year into my post-MBA job, just married and can&#8217;t wait to buy my first car. The midrange options at the time are the long running Maruti Baleno, Swift, Hyundai Accent, Tata Indigo, Honda City and a couple of others. And the newly launched Ford Fiesta. The fiesta looks good, is priced well and is the latest kid on the block.</p>
<p>So I buy it. The 1.6 Sxi from Harpreet Ford in Gurgaon. I go with the cherry color (Paprika red) that&#8217;s available immediately. I&#8217;m so excited about it that I don&#8217;t really haggle for any deals from the dealer at all (no car covers/extended warranty, discounts, lower interest rate  etc &#8211; hey, they did give my wife a rose bouquet after our purchase!). I love the car! After having had a Maruti 800 for 8 years, this is such a dream (power windows?? woooo!).</p>
<p><img class="aligncenter" src="http://images.cardekho.com/images/car-images/large/Ford/Fiesta/Fiesta-2.jpg" alt="" width="386" height="231" /></p>
<p>The car drives great, and my dad loves the surprise. We make sure we do all the regular servicing at .. who else.. Harpreet Ford!</p>
<p><strong>Cut forward 8 months to summer of 2007.</strong></p>
<p>I&#8217;m doing 70 kph or so in the Fiesta on the Dehradun highway. Just as we hit the &#8216;Mohand&#8217; forests, the AC conks out &#8211; so we need to open the windows in the searing afternoon heat. We&#8217;re still getting along when <strong>suddenly, the car begins to grind</strong>. I&#8217;m pressing the pedal and NOTHING&#8217;S happening (no engine roaring, no acceleration) and the car is hurtling forward on its own. I pull over to a side, wait 5 minutes and try re-starting the engine. It starts and we&#8217;re on our way again. Until 5 mins later when the same happens and we again need to stop and cool down. This goes on, until we drag our way through the mountain roads at 15 kph with no AC and finally make it to our destination.</p>
<p>It is at this point that I should insert this Ford one-liner -</p>
<p style="text-align: center;"><em><strong>How is a golf ball different from a Ford? You can drive a golf ball 200 yards!</strong></em></p>
<p style="text-align: left;">In Dehradun, we take the car to the local Ford workshop &#8211; the guy gives the car a look, gives us a look, decides we&#8217;re good for a couple of thousand bucks and lets us out after we&#8217;ve paid him the requisite amount and had our coolant changed (With official Ford coolant of course &#8211; no other coolant will do even if they&#8217;re from leading coolant manufacturers).</p>
<p style="text-align: left;">After we come back to Delhi, we get a servicing done at Harpreet Ford, who tell us nothing is wrong while ensuring our maintenance bill stays as close to the well rounded figure of 5000 as possible.</p>
<p style="text-align: left;">Summer of 2008 &#8211; the entire sequence is re-enacted on our way to Dehradun again. This time the entire family experiences it, and we&#8217;re forced to add a Castrol coolant because, well, there&#8217;s no Ford certified service center outside of the major towns.</p>
<p style="text-align: left;">Again back in Delhi, Harpreet Ford finds no major issue and has no clue of the root cause. Of course the problem is un-replicable at their premises so we can&#8217;t really prove it.</p>
<p style="text-align: left;">Summer of 2009 and 2010 &#8211; this happens again. Whether on the Jaipur highway, or in the city &#8211; the car just blanks out irrespective of the speed and needs to be pulled over. (A bit of googling will reveal that other customers have had the same issue with Ford cars &#8211; here&#8217;s <a href="http://duckcake.wordpress.com/2009/08/17/seriously-seriously-i-hate-you-ford/" target="_blank">one</a> link)</p>
<p style="text-align: left;"><strong>Go Fida with the Ford Service options, or Go Broke<br />
</strong></p>
<p style="text-align: left;">Not only is this a complex defect in the car that puts the passengers at extremely high risk, the service center is also either unequipped or in denial or just plain careless about trying to fix it at the root cause. There were (at least until 2009), only two places you could go to get your Ford repaired in Delhi &#8211; Harpreet Ford in Gurgaon and Moti Nagar, and another dealer in Noida (can&#8217;t remember the name &#8211; was it South City ford?). The alternatives are non-Ford-authorised service centers.</p>
<p style="text-align: left;">Also with the Ford you&#8217;re required to only use the Ford engine oil and other paraphernalia &#8211; which are costlier than the usual market options (average servicing costs Rs 4000 approx &#8211; I was shocked to learn that my friend with an SX4 got his servicing done in about Rs 800!). All this means you&#8217;re locked in to one dealer and his practices. At Harpreet Ford, that usually means getting a service quote with items you don&#8217;t understand, leaving your car with them for a couple of days and no opportunity to look at it while its being worked on, and then receiving your car with no one to explain what was done on it. Payment in advance, thank you very much.</p>
<p style="text-align: left;">Once, after we got our rear door repaired at Harpreet Ford after a small accident, they fixed it after we reminded them by tying up the old wire that connects the handle to the door latch. Which broke in a couple of days when we got back home. Worse, the front power windows button on the driver side, which had no issue at all, started behaving erratically.</p>
<p style="text-align: left;">On another occasion, our battery died overnight possibly because some lights were left on (we never found out why actually &#8211; because the internal electricals usually fade out after the car is locked up from outside). When we took our car to Harpreet Ford, we were told that the car computer (ECU) was damaged and needed to be replaced &#8211; setting us back by a cool Rs 40,000 approx!!! Worse, while the car was being inspected in the Harpreet Ford Moti Nagar lot, they got some scratches on the rear wheel rim and broke the pullout bonnet opener  &#8211; and wouldn&#8217;t take responsibility for it!</p>
<p style="text-align: left;"><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/ford-logo2.jpg" alt="" width="332" height="193" /></p>
<p style="text-align: left;">By this time we had had it with Harpreet Ford and stopped dealing with them &#8211; instead we now get our car serviced at Bosch Service Center Rajouri Garden &#8211; where we can at least see what&#8217;s being done to our car and get the full range of service by Bosch certified mechanics. Way more transparent and satisfactory.</p>
<p style="text-align: left;"><strong>No resale value</strong></p>
<p style="text-align: left;">Sorry I should re-do that headline. A Ford does not have zero resale value &#8211; it has a negative resale value. Since the last 2 years, any quote I got on this car did not even cover the outstanding on the loan. With the new models being priced even more aggressively by Ford and bundled with features like an MP3 player, it only means you&#8217;re forever stuck with the Ford.</p>
<p style="text-align: left;"><strong>The sorry tale continues&#8230;</strong></p>
<p style="text-align: left;">
<p style="text-align: left;">Apart from the issues above, many other defects have surfaced through the years -</p>
<p style="text-align: left;"><strong>2008</strong> &#8211; The  engine started <a href="http://www.aa1car.com/library/misfire.htm" target="_blank">misfiring</a> &#8211; needed a Rs 1000+ replacement (i think it was this sparkplug component)<br />
<strong>2009</strong> &#8211; The dashboard speedometer and odometer stopped working &#8211; the speedometer will simply die down and start working randomly.<br />
<strong>Every summer </strong>the AC needs the gas refuelled, or its tubing changed. In any case it works subpar compared to other cars</p>
<p style="text-align: left;"><strong>Wheelplates</strong> &#8211; Ford wheelplates are clamp-ons, not screwed in to the wheel &#8211; which means every year you lose a couple to burglars or if you hit a really bad pothole. The company sells sets of 4 at Rs 500 per wheelplate &#8211; outside you can buy a set of 4 at about Rs 700.<br />
<strong>2010</strong> &#8211; Two new problems for 2010! The front axle now makes a sound (like metal pipes falling over one other) while making turns or going over potholes in the road &#8211; it appears the axle connection to the wheel has gone out of sync, and requires the axle to be replaced at about Rs 20,000 from Ford. Second, the driver door key lock has stopped working &#8211; I can lock it but I can&#8217;t unlock from that side, so I need to unlock every time from the passenger side. I&#8217;m not even thinking of getting this repaired until I absolutely need to &#8211; because I vaguely remember the service center telling me that the locks are all computerised and I will need to change the whole set at a cost of roughly Rs 20,000!!<br />
<strong>In general</strong>, the car needs frequent servicing &#8211; best is every 3 months &#8211; if you top 5 months or so without servicing, it starts showing in the performance</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/ford-logo.jpg" alt="" width="351" height="204" /></p>
<p><strong>Ford</strong></p>
<p style="text-align: left;">The service network and most importantly, the fundamental flaws in the ford fiesta have all added up to a HUGE DISAPPOINTMENT for me and my family, and mean that not only will I never buy a Ford myself ever in the future, I will also recommend strongly to anyone I know that they avoid touching a Ford even with a 30 foot pole.</p>
<p style="text-align: left;">Unless of course, its my Ford they&#8217;re helping push.</p>
<p style="text-align: left;">
<p style="text-align: left;">&#8212;&#8211;</p>
<p style="text-align: left;">PS &#8211; Ford Jokes on the post are from <a href="http://www.angelfire.com/il2/antig24/antiford.html" target="_blank">this</a> page. Also to mention, the silver lining in the Ford Fiesta experience was the service I received from ICICI Lombard &#8211; with claims being handled quickly and with minimal hassles.</p>
<p style="text-align: left;">
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/07/24/ford-fiesta-or-my-mechanics-early-retirement-plan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How passionate can you be?</title>
		<link>http://vikramdhunta.com/blog/2010/07/17/how-passionate-can-you-be/</link>
		<comments>http://vikramdhunta.com/blog/2010/07/17/how-passionate-can-you-be/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 15:55:20 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=147</guid>
		<description><![CDATA[Remember how, as a kid, we used to go totally crazy with every little thing from a toy to a chocolate cake (yeah, back when we didn&#8217;t know what brownies were and could have only thought they were elves. ok, digressing right in the first line of the post!)&#8230;point is, we were simply incapable of [...]]]></description>
			<content:encoded><![CDATA[<p>Remember how, as a kid, we used to go totally crazy with every little thing from a toy to a chocolate cake (yeah, back when we didn&#8217;t know what brownies were and could have only thought they were elves. ok, digressing right in the first line of the post!)&#8230;point is, we were simply incapable of <strong>not</strong> putting our heart into things unabashedly.  Most of us, a good majority I&#8217;m sure, can&#8217;t say the same still holds.</p>
<p>And then this&#8230;checkout this video of a hiker totally flipping out when he witnesses a double rainbow in Yosemite, USA (the vids become really popular). Totally smitten by the view, he goes from &#8220;oohs&#8221; to hysterical sobbing in 3 minutes. And you can&#8217;t help but &#8216;feel&#8217; the scene with him.</p>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/OQSNhk5ICTI&amp;color1=0x5d1719&amp;color2=0xcd311b&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/OQSNhk5ICTI&amp;color1=0x5d1719&amp;color2=0xcd311b&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>When were you last as passionate as him about anything?</p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/07/17/how-passionate-can-you-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shanghai and the World Expo 2010</title>
		<link>http://vikramdhunta.com/blog/2010/07/02/shanghai-and-the-world-expo-2010/</link>
		<comments>http://vikramdhunta.com/blog/2010/07/02/shanghai-and-the-world-expo-2010/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 14:54:34 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[travel]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[india]]></category>
		<category><![CDATA[world expo 2010]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=107</guid>
		<description><![CDATA[Shanghai is hosting the World Exposition 2010 &#8211; a huge show where most countries setup a showcase pavilion that I&#8217;d never heard of before With 200 countries participating this year for the Expo that will run from May to October, 70 million visitors are expected &#8211; that&#8217;s about 400,000 visitors a day &#8211; with 22 [...]]]></description>
			<content:encoded><![CDATA[<p>Shanghai is hosting the World Exposition 2010 &#8211; a huge show where most countries setup a showcase pavilion that I&#8217;d never heard of before <img src='http://vikramdhunta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>With 200 countries participating this year for the Expo that will run from May to October, 70 million visitors are expected &#8211; that&#8217;s about 400,000 visitors a day &#8211; with 22 million having already visited to-date!</p>
<p>Consequently the queues are long &#8211; i.e. between 0.5 hrs (Morocco) to 7 hours (UAE). The Expo covers an area of 5 sq km so its a lot of walking too.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-line-150x150.jpg" alt="" width="219" height="219" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-haibao-haircut-150x150.jpg" alt="" width="218" height="218" /></p>
<p>As expected, this is another grand show from the Chinese &#8211; the infrastructure is tremendous: easy commute to/from the expo site that&#8217;s located about 30 mins by taxi from Shanghai city center, all kinds of amenities inside and pretty good crowd flow.</p>
<p>I reached the gates at 8 AM and was still behind thousands of people. After the 2 hr airport-like security scan, I found I couldn&#8217;t enter the Chinese pavilion since I didn&#8217;t receive the &#8220;First-come-first-serve Reservation&#8221; for that Pavilion &#8211; which was a disappointment as the Chinese pavilion looked great. (Reservations applied to Taiwan as well)</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-China-150x150.jpg" alt="" width="265" height="265" /></p>
<p>I then made my way to the next nearest one &#8211; Pakistan. The high point of the Paki pavilion was a &#8220;projected pseudo-holographic image&#8221; on a water-curtain &#8212; looked neat. The rest of the pavilion had mostly photos of the country &#8211; with a heavy emphasis on the Paki-China friendship &#8211; and ending with a kebab restaurant.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Pak-150x150.jpg" alt="" width="191" height="191" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Pak-hologram-1-150x150.jpg" alt="" width="189" height="189" /></p>
<p>The next one was India. A queue of 2.5 hours waited patiently to enter the pavilion whose external design was meant to depict a &#8216;tree of life&#8217; and had a facade with miniature carvings.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-outside-2-150x150.jpg" alt="" width="206" height="206" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-outside-3-150x150.jpg" alt="" width="207" height="207" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-outside-150x150.jpg" alt="" width="205" height="205" /></p>
<p><img src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-performance-150x150.jpg" alt="" width="205" height="205" /> <img src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-inside-1-150x150.jpg" alt="" width="206" height="206" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-inside-3-150x150.jpg" alt="" width="205" height="205" /></p>
<p>Encircling the stage were small handicraft shops with nothing more than the usual Dilli Haat stuff (ok it may not have been so &#8216;usual&#8217; for the local crowd).</p>
<p>With no general &#8220;flow&#8221; to follow, I roamed around and saw crowds moving to the left into a narrow passage. A 15 min wait later in a passage that probably violated most &#8216;emergency exit&#8217; guidelines, I finally realize it&#8217;s the entry to the &#8216;main&#8217; dome of the pavilion and I take that phew-there&#8217;s-still-some-hope-left breath. Inside the dome, the walls are lined up with photographs, artefacts, etc, with the Taj Mahal, Tagore and Lata Mangeshkar among others getting their regular wallspace. There is no description &#8211; only a few photos have names &#8211; and the crowds keep moving on without really understanding anything.</p>
<p>Quite unfortunately, but not entirely unexpectedly, the pavilion was a HUGE disappointment. For starters, once you enter, there&#8217;s a stage in front where performances happen. When I entered, there was a classical instrumental about to end (looked like Amjad Ali Khan&#8217;s kids &#8211; not sure though) &#8211; when it ended, the performer said thanks and quickly pointed out to everyone that his CDs were on sale that they could buy. :-/</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-inside-2-150x150.jpg" alt="" width="207" height="207" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-India-inside-4-150x150.jpg" alt="" width="205" height="205" /></p>
<p>Suddenly the lights begin dimming and the crowds start taking seats around a glass structure in the center. Then a AV presentation starts happening &#8211; one of those &#8216;pseudo-hologram projections on tilted glass&#8217;. The holograms show 3D line images (not real photos) of various things through Indian history with a narration in Chinese. The show ends in about 7 minutes with the audience not really getting the point of it all.</p>
<p>At the dome exit, I notice the high point for the crowds &#8211; a decorated Elephant head that everyone&#8217;s queuing up to take pictures with.</p>
<p>After a small Chicken Tikka at an exorbitant price at the Indian restaurant, I make my way out and pity the 2.5 hour queue to the pavilion which only looks longer!</p>
<p>Sadly, an opportunity for us to showcase our progress in the 21st century and to highlight our partnership with China to those it matters most &#8211; the Chinese people, falls prey to a (possibly) minimal budget and babu-style-execution. And equally unfortunately, most Indians back home are never going to know how we failed on the world stage given the lack of coverage.</p>
<p><a href="http://timesofindia.indiatimes.com/India/Indias-shoddy-samosa-shawl-show-at-Shanghai-World-Expo/articleshow/6080303.cms" target="_blank">This article</a> does complete justice to our shoddy show at the Expo.</p>
<p>I then visited Morocco &#8211; a pavilion looking like a typical white-desert-palace with a beautifully/lavishly done interior. There was a single flow of people in and out &#8211; mostly a photo+handicraft display again.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Morocco-150x150.jpg" alt="" width="191" height="191" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Morocco-cricket-150x150.jpg" alt="" width="189" height="189" /></p>
<p>Nepal was next &#8211; I wasn&#8217;t sure if I wanted to visit it &#8211; but the pavilion was setup as an exquisite monastery over quite a big area. There was even a Stupa in the center that you could walk up and around to &#8211; and get a good view of the Expo.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Nepal-150x150.jpg" alt="" width="187" height="187" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Expo-Nepal-3-150x150.jpg" alt="" width="185" height="185" /></p>
<p>During the walk up to the Stupa, you see this humongous dome appearing in the horizon &#8211; turns out to be the Cultural center. I think its the &#8220;largest&#8221; building I&#8217;ve ever seen!</p>
<p>I then walked over to the other zone to visit the USA pavilion &#8211; which is mostly about 2 AV presentations &#8211; but with some neat surprises. After 11 hours at the Expo, I had no time or energy left to go to visit any other countries.</p>
<p>In all, you can spend a whole week trying to cover the Expo. Be prepared for hours of queues and miles of walking. Food etc is easily available.  Another thing I noticed &#8211; all day I must have seen about 50 foreigners in the teeming millions of locals &#8211; was certainly expecting far more &#8211; but it says a lot about the Chinese taking interest in stuff their Govt invests in. (I mean &#8211; when did you last go see an Expo at Pragati Maidan, eh?)</p>
<p>In other stuff, most of the days in Shanghai were either rained out or smoggy &#8211; with about 2 days of sunshine. See gallery below for some photos &#8211; followed by one of the Meridien lighted up at night (like most Shanghai Skyscrapers are).</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Shanghai-2-150x150.jpg" alt="" width="224" height="224" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Shanghai-1-150x150.jpg" alt="" width="223" height="223" /></p>
<p>Later, Shanghai!</p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/07/02/shanghai-and-the-world-expo-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Comet in the sky</title>
		<link>http://vikramdhunta.com/blog/2010/06/15/new-comet-in-the-sky/</link>
		<comments>http://vikramdhunta.com/blog/2010/06/15/new-comet-in-the-sky/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 16:11:20 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[astro]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=101</guid>
		<description><![CDATA[Comet McNaught named after its discoverer R. H. McNaught, is now visible to the naked eye. It is currently reported to be at magnitude 3 but only 15 degrees over the Eastern horizon around 3 AM in the morning &#8211; in the Perseus constellation. Here is the path of the comet (in PDF too) Below [...]]]></description>
			<content:encoded><![CDATA[<p>Comet McNaught named after its discoverer R. H. McNaught, is now visible to the naked eye. It is currently reported to be at magnitude 3 but only 15 degrees over the Eastern horizon around 3 AM in the morning &#8211; in the Perseus constellation.</p>
<p>Here is the path of the comet (in <a href="http://media.skyandtelescope.com/documents/WEB_McNaught_Path.pdf">PDF</a> too)</p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 530px"><img class="size-full wp-image-102" title="Comet McNaught - path" src="http://vikramdhunta.com/blog/wp-content/uploads/2010/06/mcnaught.gif" alt="Comet McNaught - path" width="520" height="241" /><p class="wp-caption-text">Comet McNaught - path</p></div>
<p>Below is a picture from the <a title="Comet McNaught" href="http://cometography.com/lcomets/2009r1.html" target="_self">Cometography</a> site-</p>
<div class="wp-caption aligncenter" style="width: 470px"><img title="Comet McNaught - picture from http://cometography.com/lcomets/2009r1.html" src="http://cometography.com/lcomets/2009R1_20100608_fk.jpg" alt="Comet McNaught - From http://cometography.com/lcomets/2009r1.html" width="460" height="172" /><p class="wp-caption-text">Comet McNaught - From http://cometography.com/lcomets/2009r1.html</p></div>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/06/15/new-comet-in-the-sky/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chicago 2010</title>
		<link>http://vikramdhunta.com/blog/2010/06/13/chicago-2010/</link>
		<comments>http://vikramdhunta.com/blog/2010/06/13/chicago-2010/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 13:59:51 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=92</guid>
		<description><![CDATA[Made a trip to Itasca/Chicago in April.. beautiful city (whatever I got to see in half a day).. high point was the vie from the 96th floor of the John Hancock Tower lounge.]]></description>
			<content:encoded><![CDATA[<p>Made a trip to Itasca/Chicago in April.. beautiful city (whatever I got to see in half a day).. high point was the vie from the 96th floor of the John Hancock Tower lounge.</p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Hard-rock-cafe-guitar-150x150.jpg" alt="" width="184" height="184" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Hancock-tower-2-150x150.jpg" alt="" width="185" height="185" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Hancock-tower-150x150.jpg" alt="" width="183" height="183" /></p>
<p><img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Fire-station-150x150.jpg" alt="" width="182" height="182" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Buggies-150x150.jpg" alt="" width="185" height="185" /> <img class="alignnone" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/White-tulips-150x150.jpg" alt="" width="185" height="185" /></p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/06/13/chicago-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lansdowne May 2010</title>
		<link>http://vikramdhunta.com/blog/2010/06/13/lansdowne-may-2010/</link>
		<comments>http://vikramdhunta.com/blog/2010/06/13/lansdowne-may-2010/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 13:14:42 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=79</guid>
		<description><![CDATA[The scorching summer heat drives flatlanders like us Delhi-ites out to the hill stations every May/June. Unfortunately but expectedly, the usual spots are at this time way too crowded and congested.  There still are thankfully, some places that haven&#8217;t been trampled under scorpios and endeavours and/or littered by colored polybags yet. One of them is [...]]]></description>
			<content:encoded><![CDATA[<p>The scorching summer heat drives flatlanders like us Delhi-ites out to the hill stations every May/June. Unfortunately but expectedly, the usual spots are at this time way too crowded and congested.  There still are thankfully, some places that haven&#8217;t been trampled under scorpios and endeavours and/or littered by colored polybags yet. One of them is Lansdowne, about 230 kms north of Delhi, via Bijnor and Kotdwar.</p>
<p>The town is strictly under army control &#8211; hence the good roads, spotless town center and litter bins everywhere. There&#8217;s not a lot of touristy places, and there are only a handful of hotels. But there are tall Deodar forests, scenic hills and curving roads, and a couple of divine churches. The town center itself is a small junction with market lanes. The hotel recommendation is Fairydale resort &#8211; by far the best and well located (and owned by an XLer!) &#8211; there&#8217;s another call Blue Pines but it&#8217;s way lower than the main town.</p>
<p style="text-align: center;"><strong>Lansdowne</strong></p>
<p><strong><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Town-center-300x225.jpg" alt="" width="357" height="268" /></strong></p>
<p style="text-align: center;"><strong>The two Churches</strong></p>
<p style="text-align: center;"><strong><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/church-300x225.jpg" alt="" width="334" height="251" /></strong></p>
<p style="text-align: center;"><strong><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Church-2-300x225.jpg" alt="" width="335" height="251" /><br />
</strong></p>
<p style="text-align: center;"><strong>Tarkeshwar Temple &#8211; nestled in a Deodar valley &#8211; as divine as it gets</strong></p>
<p><strong><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Tarkeshwar-temple-2-300x225.jpg" alt="" width="340" height="254" /></strong></p>
<p style="text-align: center;"><strong>Rock formations &#8211; One of the many</strong></p>
<p style="text-align: center;"><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/Rock-formation-1-300x225.jpg" alt="" width="343" height="257" /></p>
<p style="text-align: center;"><strong>Boating Lake</strong></p>
<p style="text-align: center;"><img class="aligncenter" src="http://i10.photobucket.com/albums/a109/thearbitcouncil/lake-300x225.jpg" alt="" width="358" height="267" /></p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2010/06/13/lansdowne-may-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Golf swing</title>
		<link>http://vikramdhunta.com/blog/2009/12/09/golf-swing/</link>
		<comments>http://vikramdhunta.com/blog/2009/12/09/golf-swing/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 04:13:56 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[golf]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=75</guid>
		<description><![CDATA[A great video of Tiger Wood&#8217;s golf swing, that&#8217;s helped me get my swing back this weekend. Awesome tip:  Start the downswing with your left hip rotating outwards, and leading the rest of the body. (More like a reminder..sort of forgot that since I started). The torque generated this way is tremendous &#8211; far more [...]]]></description>
			<content:encoded><![CDATA[<p>A great video of Tiger Wood&#8217;s golf swing, that&#8217;s helped me get my swing back this weekend.</p>
<p>Awesome tip:  Start the downswing with your left hip rotating outwards, and leading the rest of the body. (More like a reminder..sort of forgot that since I started). The torque generated this way is tremendous &#8211; far more than by just hitting the ball with the hands. And it&#8217;s A-OK to let the left knee drop forward while you&#8217;re reaching for the backswing.</p>
<p>Also, great tip to get more power into your shot : maintain the 90 degrees between the left hand and the club from the top of the backswing, until you&#8217;re almost ready to hit the ball at downswing.</p>
<p>Another tip also evident in the video &#8211; is to keep the right hand loose and sort of swinging it &#8216;under&#8217; the ball. The right forearm and hand are almost facing straight (in the direction of your nose).</p>
<p>Apart from that..keep the ball positioned slightly ahead of the center of your feet (for a mid iron).</p>
<hr /><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="445" height="364" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/WkPpFPhhsr0&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="445" height="364" src="http://www.youtube.com/v/WkPpFPhhsr0&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2009/12/09/golf-swing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turning a webcam into a home security monitor while you&#8217;re away</title>
		<link>http://vikramdhunta.com/blog/2009/11/20/turning-a-webcam-into-a-home-security-monitor-while-youre-away/</link>
		<comments>http://vikramdhunta.com/blog/2009/11/20/turning-a-webcam-into-a-home-security-monitor-while-youre-away/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 04:06:34 +0000</pubDate>
		<dc:creator>vik</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[home security]]></category>
		<category><![CDATA[laptop health check]]></category>
		<category><![CDATA[security webcam]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://vikramdhunta.com/blog/?p=63</guid>
		<description><![CDATA[Due to security concerns in our vicinity last year, I needed a way to keep tabs on our home while the whole family was away on vacation. The idea was to be able to view images of your home, live over the internet from whereever we were. CCTV solutions weren&#8217;t an option as they were [...]]]></description>
			<content:encoded><![CDATA[<p>Due to security concerns in our vicinity last year, I needed a way to keep tabs on our home while the whole family was away on vacation. The idea was to be able to view images of your home, live over the internet from whereever we were. CCTV solutions weren&#8217;t an option as they were expensive and none seemed to have a remote viewing option. I believe now there are advanced Logitech webcams in the market that also pivot and stream images to the net, but again they come at a price, and don&#8217;t take care of a few things like problems with your internet connection or laptop power when you&#8217;re not available to take care of them.</p>
<p>However, there are freeware/shareware solutions on the internet that allow you to capture your webcam and stream it online, even at a particular schedule.The software that I used was a super little app called <a title="Active Webcam" href="http://www.pysoft.com/ActiveWebCamMainpage.htm" target="_blank">Active Webcam</a> from Pysoft.</p>
<p>Further, I needed a software that would take care of laptop restarts/windows crashes/net connection blips (and also auto logging into the net account if the login expires every 24 hrs) and that would automatically start Active Webcam every time the system started up &#8211; I decided to code that in VB.</p>
<p>Apart from the software I also needed my personal laptop, regular webcam and a DSL internet connection. I had gprs activated on my phone as well, in order to view the images uploaded.</p>
<p>First, i installed Active Webcam and set it up so it would stream images from the webcam to my website at a specific URL.  (Yes, you need a website host that offers FTP where the images will be uploaded to &#8211; possibly there are options to upload to photo services like flickr/photobucket too, or to send emails to you with attached images)</p>
<p>Second, compile the code below into an exe and include that exe in the Windows Startup so it runs at system startup.</p>
<p>When this program runs, it will<br />
- check for internet connection availability, and if not available will to restart the local modem<br />
- if the internet connection doesn&#8217;t come up after 3 modem restarts, it will restart Windows. It won&#8217;t restart windows more than once in 15 mins though.<br />
- log the laptop&#8217;s battery status<br />
- log everything to a remote php file so the logs can be viewed remotely too</p>
<p><a title="VB Security cam health checker.zip" href="http://www.vikramdhunta.com/blog/vikuploads/vb security cam healthchecker.zip" target="_self">Download the entire VB project</a>.</p>
<p>This VB project has :<br />
1. a form called frmMain<br />
2. a module called Module1.bas</p>
<p>The code for both is shown below &#8211; a lot of the sections came from various sources on the net, so no claims there and a big thanks to them. Also, it all seemed to work at the time. <img src='http://vikramdhunta.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Also there are certain urls &#8211; while most are simply used to check the internet connection, the &#8217;192.168.1.1&#8242; is my modem&#8217;s local admin page that you may need to change accordingly. (In order to restart the modem, I used the code here to login to the local admin at 192.168.1.1 and post my username/password etc to the appropriate file (<span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">restartmodem.htm))<br />
</span></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>frmMain.frm &#8211; code</strong></p>
<blockquote><p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;"> Private Declare Function InternetGetConnectedState Lib &#8220;wininet.dll&#8221; (ByRef dwFlags As Long, ByVal dwReserved As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Declare Function InternetCheckConnection Lib &#8220;wininet.dll&#8221; Alias &#8220;InternetCheckConnectionA&#8221; (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Declare Function SendMessage Lib &#8220;user32&#8243; Alias &#8220;SendMessageA&#8221; (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long<br />
Private Declare Function OpenProcess Lib &#8220;kernel32&#8243; (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long<br />
Private Declare Function WaitForSingleObject Lib &#8220;kernel32&#8243; (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long<br />
Private Declare Function CloseHandle Lib &#8220;kernel32&#8243; (ByVal hObject As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Declare Function GetExitCodeProcess Lib &#8220;kernel32&#8243; _<br />
(ByVal hProcess As Long, lpExitCode As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Declare Function TerminateProcess Lib &#8220;kernel32&#8243; _<br />
(ByVal hProcess As Long, ByVal uExitCode As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Const FLAG_ICC_FORCE_CONNECTION = &amp;H1</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Declare Function NetUserGetInfo Lib &#8220;netapi32&#8243; (lpServer As Any, lpUserName As Any, ByVal Level As Long, lpBuffer As Any) As Long<br />
Private Declare Function GetUserName Lib &#8220;advapi32.dll&#8221; Alias &#8220;GetUserNameA&#8221; (ByVal lpBuffer As String, nSize As Long) As Long<br />
Private Declare Function GetComputerName Lib &#8220;kernel32&#8243; Alias &#8220;GetComputerNameA&#8221; (ByVal lpBuffer As String, nSize As Long) As Long<br />
Private Declare Sub CopyMemory Lib &#8220;kernel32&#8243; Alias &#8220;RtlMoveMemory&#8221; (Destination As Any, Source As Any, ByVal Length As Long)</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Const UNLEN As Long = 256         &#8216; Maximum username length<br />
Private Const CNLEN As Long = 31          &#8216; Maximum computer name length<br />
Private Const NERR_Success As Long = 0&amp;</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Dim actcamShellID As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Dim nwErrorCounter As Integer<br />
Const nwErrorThreshold = 1</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Dim WinHttpReq As WinHttp.WinHttpRequest<br />
Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0<br />
Const HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Public Enum shutdownTypes</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Logoff = 0<br />
Shutdown = 1<br />
Reboot = 2<br />
Force = 4<br />
PowerOff = 8</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Enum</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Type LUID</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">UsedPart As Long<br />
IgnoredForNowHigh32BitPart As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Type</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Type TOKEN_PRIVILEGES</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">PrivilegeCount As Long<br />
TheLuid As LUID<br />
Attributes As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Type</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;<br />
&#8216;The function used to actually send the request to shutdown windows. Set the &#8216;shutdownTypes&#8217;<br />
&#8216;parameter to whether you want windows to &#8220;shutdown, reboot, logOff, ect&#8230;&#8221;<br />
Private Declare Function ExitWindowsEx Lib &#8220;user32&#8243; (ByVal shutdownType As Long, ByVal dwReserved As _<br />
Long) As Long<br />
&#8216;<br />
&#8216;Will get a handle to the process this function is called.<br />
Private Declare Function GetCurrentProcess Lib &#8220;kernel32&#8243; () As Long<br />
&#8216;<br />
&#8216;<br />
&#8216;The functions below are all used to give the application that the library is bound to the proper privilege so<br />
&#8216;the OS will allow the app to Shutdown Windows.<br />
&#8216;<br />
&#8216;<br />
Private Declare Function OpenProcessToken Lib &#8220;advapi32&#8243; (ByVal ProcessHandle As Long, ByVal _<br />
DesiredAccess As Long, ByRef TokenHandle As Long) As Long<br />
&#8216;<br />
Private Declare Function LookupPrivilegeValue Lib &#8220;advapi32&#8243; Alias &#8220;LookupPrivilegeValueA&#8221; (ByVal _<br />
lpSystemName As String, ByVal lpName As String, ByRef lpLuid As LUID) As Long<br />
&#8216;<br />
Private Declare Function AdjustTokenPrivileges Lib &#8220;advapi32&#8243; (ByVal TokenHandle As Long, ByVal _<br />
DisableAllPrivileges As Boolean, ByRef NewState As TOKEN_PRIVILEGES, ByVal BufferLength As _<br />
Long, ByRef PreviousState As TOKEN_PRIVILEGES, ByRef ReturnLength As Long) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub cmdStart_Click()<br />
&#8216; moved below  2 to formm load now<br />
&#8216;Log &#8220;Starting timer&#8230;&#8221;<br />
&#8216;Timer1.Enabled = True</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;In my case I started Active Webcam using the windows startup options &#8211; if you want this healthchecker to start the app, uncomment this line and also the one cmdStop_Click()<br />
&#8216;actcamShellID = Shell(&#8220;C:\Program Files\Active WebCam\WebCam.exe&#8221;, vbMinimizedNoFocus)<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub cmdStop_Click()<br />
Timer1.Enabled = False<br />
Log &#8220;Stopped timer.&#8221;</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;Debug.Print EndShelledProcess(actcamShellID)<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub Form_Load()<br />
Set WinHttpReq = New WinHttpRequest<br />
Log &#8220;Application started&#8230;&#8221;, 1</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Log &#8220;Starting timer&#8230;&#8221;<br />
Timer1.Enabled = True</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">nwErrorCounter = 0<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub Form_Terminate()<br />
Log &#8220;Application terminated.&#8221;, 1<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub Timer1_Timer()<br />
DoEvents<br />
Dim nwTrulyBad As Integer</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">If (nwErrorCounter &gt; nwErrorThreshold) Then<br />
&#8216; too many times nw error &#8211; just restart network<br />
Log &#8220;Timer off&#8230;&#8221;<br />
Timer1.Enabled = False<br />
Log &#8220;restarting network&#8221;</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">nwTrulyBad = 0<br />
While (nwTrulyBad &lt; 3)<br />
Log &#8220;&#8230; restart attempt &#8221; &amp; (nwTrulyBad + 1)<br />
restartModem<br />
If (InternetCheckConnection(&#8220;http://web1219.ixwebhosting.com&#8221;, FLAG_ICC_FORCE_CONNECTION, 0&amp;) &lt;&gt; 0) Then<br />
Log &#8220;&#8230; restart attempt succeeded &#8221;<br />
nwTrulyBad = 0<br />
&#8216;Exit Do<br />
Else<br />
nwTrulyBad = nwTrulyBad + 1<br />
Log &#8220;&#8230; restart attempt failed.&#8221;<br />
End If<br />
Wend</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">If (nwTrulyBad &gt;= 3) Then<br />
Log &#8220;&#8230; Modem restart failed. Need to restart system&#8221;<br />
&#8216; Network did nost cmoe up even after restarting modem 3 times. Should restart system now.<br />
&#8216; however do not restart if last system reboot time was less than 15 mins ago<br />
If ((Now &#8211; LastLogon2()) &gt; 0.0104) Then<br />
shutdownWindowsOS shutdownTypes.Reboot Or Force<br />
Log &#8220;PC RESTARTING&#8221;<br />
Else<br />
Log &#8220;TOO SOON TO RESTART&#8221;<br />
End If<br />
End If</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">nwErrorCounter = 0<br />
End If</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Timer1.Enabled = True</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">If InternetCheckConnection(&#8220;http://web1219.ixwebhosting.com&#8221;, FLAG_ICC_FORCE_CONNECTION, 0&amp;) = 0 Then<br />
nwErrorCounter = nwErrorCounter + 1<br />
Timer1.Interval = 15000<br />
Log &#8220;No internet connection detected&#8230;nw counter: &#8221; &amp; nwErrorCounter<br />
Else<br />
nwErrorCounter = 0<br />
Timer1.Interval = 10000<br />
Log &#8220;Internet connection detected&#8230;&#8221;<br />
End If</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Log &#8220;Battery status: &#8221; &amp; GetBatteryStatus()<br />
If (InStr(1, GetBatteryStatus(), &#8220;Low&#8221;)) Then<br />
Log &#8220;BatteryRed&#8221; &amp; GetBatteryStatus(), 1<br />
End If<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub restartModem()</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">DoEvents</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216; Assemble an HTTP request.s<br />
WinHttpReq.Open &#8220;POST&#8221;, &#8220;http://192.168.1.1/cgi-bin/webcm&#8221;, False</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216; Set the user name and password.<br />
WinHttpReq.SetCredentials &#8220;admin&#8221;, &#8220;admin&#8221;, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;Set Content-Type header<br />
WinHttpReq.SetRequestHeader &#8220;Content-Type&#8221;, &#8220;application/x-www-form-urlencoded&#8221;</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">On Error GoTo nextpt<br />
&#8216;Send the form data To URL As POST binary request<br />
WinHttpReq.Send &#8220;getpage=&#8221;"http://192.168.1.1/cgi-bin/html/tools/restartmodem.htm&#8221;"&amp;var:com=&#8221;"restart&#8221;"&amp;var:ip=&#8221;"&#8221;"&amp;var:restart=&#8221;"1&#8243;&#8221;&amp;logic:command/ppp_disconnect=&#8221;"&#8221;"&#8221;</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216; Display the status code and response headers.<br />
Debug.Print WinHttpReq.Status &amp; &#8221; &#8221; &amp; WinHttpReq.StatusText<br />
Debug.Print WinHttpReq.GetAllResponseHeaders &amp; &#8220;  &#8221; &amp; WinHttpReq.ResponseText</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">nextpt:<br />
End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Public Sub Log(txt As String, Optional priority As Integer)<br />
&#8216;txtLog.Text = txtLog.Text &amp; vbNewLine &amp; txt</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;Open &#8220;c:\hclog.txt&#8221; For Append As #2<br />
&#8216;Print #2, Now<br />
&#8216;Print #2, txt<br />
&#8216;Print #2, String(91, &#8220;*&#8221;)<br />
&#8216;Close #2</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">If (priority = 1) Then<br />
WinHttpReq.Open &#8220;GET&#8221;, &#8220;http://www.YOURSITE.com/log.php?txtlog=&#8221; &amp; Now &amp; &#8220;, &#8221; &amp; txt, True<br />
WinHttpReq.Send<br />
On Error Resume Next<br />
End If<br />
End Sub<br />
Public Function EndShelledProcess(ShellReturnValue As Long) _<br />
As Boolean</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;PURPOSE: End a process started with VB&#8217;s Shell Statement<br />
&#8216;INPUT: Task ID returned by Shell<br />
&#8216;RETURNS: True if succesful, false otherwise</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">On Error Resume Next</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Dim hInst As Long<br />
Dim hProcess As Long<br />
Dim lExitCode As Long<br />
Dim lRet As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">hInst = ShellReturnValue<br />
If hInst = 0 Then Exit Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216;Get handle to process<br />
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&amp;, hInst)<br />
If hProcess &lt;&gt; 0 Then<br />
&#8216;get exit code<br />
GetExitCodeProcess hProcess, lExitCode<br />
If lExitCode &lt;&gt; 0 Then<br />
&#8216;bye-bye<br />
lRet = TerminateProcess(hProcess, lExitCode)<br />
EndShelledProcess = lRet &gt; 0<br />
End If<br />
End If</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Sub AdjustToken()<br />
Const TOKEN_ADJUST_PRIVILEGES = &amp;H20<br />
Const TOKEN_QUERY = &amp;H8<br />
Const SE_PRIVILEGE_ENABLED = &amp;H2<br />
Dim hdlProcessHandle As Long<br />
Dim hdlTokenHandle As Long<br />
Dim tmpLuid As LUID<br />
Dim tkp As TOKEN_PRIVILEGES<br />
Dim tkpNewButIgnored As TOKEN_PRIVILEGES<br />
Dim lBufferNeeded As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">hdlProcessHandle = GetCurrentProcess()<br />
OpenProcessToken hdlProcessHandle, (TOKEN_ADJUST_PRIVILEGES Or _<br />
TOKEN_QUERY), hdlTokenHandle</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216; Get the LUID for shutdown privilege.<br />
LookupPrivilegeValue &#8220;&#8221;, &#8220;SeShutdownPrivilege&#8221;, tmpLuid</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">tkp.PrivilegeCount = 1    &#8216; One privilege to set<br />
tkp.TheLuid = tmpLuid<br />
tkp.Attributes = SE_PRIVILEGE_ENABLED</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">&#8216; Enable the shutdown privilege in the access token of this process.<br />
AdjustTokenPrivileges hdlTokenHandle, False, _<br />
tkp, Len(tkpNewButIgnored), tkpNewButIgnored, lBufferNeeded</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Sub</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Public Function LastLogon2() As Date<br />
Dim nRet As Long<br />
Dim Server As String<br />
Dim User As String<br />
Dim ui3(1 To 29) As Long<br />
Dim lpBuffer As Long<br />
Const evServer = &#8220;LOGONSERVER&#8221;<br />
&#8216; Retrieve current user and logon server names.<br />
User = CurrentUserName()<br />
Server = Environ$(evServer)<br />
If Len(Server) = 0 Then Server = CurrentMachineName()<br />
If InStr(Server, &#8220;\\&#8221;) &lt;&gt; 1 Then Server = &#8220;\\&#8221; &amp; Server<br />
&#8216; Retrieve Level3 information on current user.<br />
nRet = NetUserGetInfo(ByVal StrPtr(Server), ByVal StrPtr(User), 3, lpBuffer)<br />
If nRet = NERR_Success Then<br />
&#8216; Results are returned as a pointer to buffer.<br />
&#8216; Copy 29 dwords/pointers into array of Longs.<br />
CopyMemory ui3(1), ByVal lpBuffer, UBound(ui3) * 4&amp;<br />
&#8216; Return last logon date/time, which is 14th element.<br />
LastLogon2 = NetTimeToVbTime(ui3(14))<br />
End If<br />
End Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Function CurrentUserName() As String<br />
Dim Buffer As String<br />
Dim nLen As Long<br />
Const NameLength = UNLEN + 1<br />
&#8216; ANSI method.<br />
nLen = NameLength<br />
Buffer = Space$(nLen)<br />
Call GetUserName(Buffer, nLen)<br />
&#8216; Trim results and return.<br />
If nLen &gt; 1 Then CurrentUserName = Left$(Buffer, nLen &#8211; 1)<br />
End Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Function NetTimeToVbTime(NetDate As Long) As Double<br />
Const BaseDate# = 25569   &#8216;DateSerial(1970, 1, 1)<br />
Const SecsPerDay# = 86400<br />
NetTimeToVbTime = BaseDate + (CDbl(NetDate) / SecsPerDay)<br />
End Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Private Function CurrentMachineName() As String<br />
Dim Buffer As String<br />
Dim nLen As Long<br />
Const NameLength = CNLEN + 1<br />
&#8216; Fall back to the ANSI method.<br />
nLen = NameLength<br />
Buffer = Space$(nLen)<br />
Call GetComputerName(Buffer, nLen)<br />
&#8216; Trim results and return.<br />
If nLen &gt; 0 Then CurrentMachineName = Left$(Buffer, nLen)<br />
End Function</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Function shutdownWindowsOS(ByVal shutdownType As shutdownTypes) As Integer<br />
&#8216;<br />
&#8216;This function will call the ExitWindowsEx function to request the system to shutdown/reboot or<br />
&#8216;whatever is specified in the &#8220;shutdownType&#8221; parameter. It of course, will call the &#8220;AdjustToken&#8221;<br />
&#8216;sub to give your app the privilege to use that function first.<br />
&#8216;<br />
AdjustToken<br />
&#8216;<br />
&#8216;Calls the function to begin executing.<br />
shutdownWindowsOS = ExitWindowsEx(shutdownType, 0)</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End Function</span></p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Module1.bas</strong></p>
<blockquote><p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">ByRef lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Public Function GetBatteryStatus() As String &#8216; Get the status of the laptop&#8217;s battery<br />
Dim btFlag As Byte<br />
Dim SPS As SYSTEM_POWER_STATUS<br />
Dim lReturn As Long<br />
Dim sRet As String<br />
Dim lFlag As Long</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">lReturn = GetSystemPowerStatus(SPS)<br />
btFlag = SPS.BatteryFlag</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">lFlag = CLng(btFlag)</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">Select Case lFlag<br />
Case BATTERY_FLAG_CHARGING<br />
sRet = &#8220;Now Charging&#8230;&#8221;<br />
Case BATTERY_FLAG_CRITICAL<br />
sRet = &#8220;Critically Low !!&#8221;<br />
Case BATTERY_FLAG_HIGH<br />
sRet = &#8220;High Charged!&#8221;<br />
Case BATTERY_FLAG_LOW<br />
sRet = &#8220;Low Charged!&#8221;<br />
Case BATTERY_FLAG_NO_BATTERY<br />
sRet = &#8220;(No Battery)&#8221;<br />
Case BATTERY_FLAG_UNKNOWN<br />
sRet = &#8220;Unknown&#8221;<br />
End Select</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">If (SPS.ACLineStatus = 1) Then<br />
sRet = &#8220;[On AC] &#8221; &amp; sRet<br />
Else<br />
sRet = &#8220;[On Battery] &#8221; &amp; sRet</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">End If</span></p>
<p><span style="font-family: Courier New,Courier,mono,Tahoma,Arial;">GetBatteryStatus = sRet<br />
End Function</span></p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; </p>
]]></content:encoded>
			<wfw:commentRss>http://vikramdhunta.com/blog/2009/11/20/turning-a-webcam-into-a-home-security-monitor-while-youre-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

