tag:blogger.com,1999:blog-201243612024-03-07T03:08:14.678-05:00the gsm orbitalsomething new, something different and something exciting for everyoneGurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.comBlogger142125tag:blogger.com,1999:blog-20124361.post-420475109013597792013-02-14T08:18:00.001-05:002013-02-14T08:20:34.213-05:00Is it Really for Free?Recently, I read a very interesting quote: "If you are not paying, you are not the customer, but you are the product". This surely is true for all the "free" technology we use - be it Social Media websites like Facebook or Twitter; Search Engines like Google, Bing; or other SAAS based companies offering free services. It is all apparently free to use. But the idea here is that we are not actually using it, but instead they are using us to build their product.<br />
<br />
Let's start with the Social Media model for free to use. The websites like Facebook, Twitter etc. are free for it's users to interact with others. The data generated by users is actually becoming the medium for them to sell their product - which in this case is targeted advertising. So, the users here are the product which the companies are trying to sell to the advertisers.<br />
<br />
Another model which is popular among the Free Services is to have a free service with basic features and then a paid subscription for premium features. This strategy is better known as the "freemium" model. The principle here is to offer a service with limited features for free and as the customers get used to the product, offer them with paid premium features. Here, the free users act as a marketing tool for these companies who generate the positive feedback for the product.<br />
<br />
A unique example which uses the best of both the above strategies is LinkedIn. The leading professional network takes advantage of the user data they have to offer targeted advertising and also, efficiently use the freemium model to sell paid memberships which are targeted towards recruiters, job seekers and anyone interested in business development.<br />
<br />
Open source software companies are very famous for offering free software. But, they have a business model here which in some cases has generated far more revenue than the traditional software licensing model. Most open source software companies generate their revenue by providing support and customization solutions. The free users that use the software help in testing and creating new modules for it, thus helping the software creators to have a great product with free help from other developers. The user creates the product and the software creator sells the service for it.<br />
<br />
Then there are free applications, which once they get you addicted, they'll try to sell you stuff using "in-app purchases". Ever tried playing a Zynga game? You'll know what I'm talking about. Many apps like these will offer you to play free games and once the users are addicted they'll sell stuff which will help you advance in the game. An incongruous way to sell you what you wouldn't have otherwise bought (can you think of spending money for a virtual sword or virtual gold coins?).<br />
<br />
Yes, the free service business is a facade - it's not free after all, unless, you are the product or the means to sell the product! Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-43740931437686577772012-03-15T18:56:00.003-04:002012-03-15T19:44:34.872-04:00Volkswagen India – Worst Customer ServiceYou are in a lot of excitement when you buy a new car. Sometimes, things can go horribly wrong due to the cunningness of the salespeople or the company selling you the car. A similar experience happened with me during the purchase of my new car. Here’s what has happened till now and the way the customer service works for Volkswagen in India.<br /><br />I bought a Volkswagen Vento in January 2012, from <b>Bhasin Motors / Volkswagen Delhi South, South Extn., New Delhi</b>. At the time of selling the car, I was promised a December 2011 car. The invoice I got at delivery stated the car was manufactured in October 2011. I was quite unhappy about it but the dealership told me that it got to them in Nov and the plant does not manufacture cars in December. Trusting them in good faith, I reluctantly accepted the explanation and kept the car. Then there was a long wait for getting the registration receipt from them - it took them 18 days after delivery to get the car registered. When they gave me the registration and road tax receipt, the manufacturing date shown on it depicted April 2011. I asked the dealership guys for an explanation and they started coming up with baseless excuses. <br /><br />Next, I met with the AVP of Bhasin Motors, who was rude and said he did not have the time to talk to me as the issue I was taking up was not even a valid issue. I went to him with a letter with all my grievances regarding the purchase of the car, which he refused to accept, telling me that he does not has the time to read it. Only on insisting hard to accept the application, he accepted it. There were many instances during the conversation in which he spurted out things in a very insulting manner. This was the level of “professionalism” I got from the AVP of the dealership. <br /><br />The dealership clearly cheated me by misstating information in the invoice at the time of delivery. Then, I decided to complain about the dealership to Volkswagen itself, which was a pain too. Even after 4 phone calls, 3 emails and more than a week of wait, I did not hear anything from anyone at Volkswagen. All the person on the other side of the phone could tell me was that your complaint has been forwarded to the appropriate department and you’ll receive a response within 48 hours; the request was escalated on each subsequent call and no response was ever received. They had no more information whatsoever - no status update on the complaint, no contact details of the concerned department and also, no supervisor to speak to. Probably, after 7 or 8 days of the complaint, I received an email response from Bhasin Motors regarding the complaint. I was surprised that the complaint against the dealership went to the dealer itself, with no official response from Volkswagen.<br /><br />By this time, I started searching LinkedIn for contacts at VW. Thanks to my huge network, I was able to locate a few connections. I got email addresses of top executives at VW through some of my connections and emailing them again resulted in no response. Then, I found a couple of really responsive people in VW, who pointed me towards the right people to contact. I was finally able to get in touch with the Regional Sales Manager for the area, who “listened” to the concerns.<br /><br />So, I had to make my own efforts to get in touch with the people at VW as the customer service is completely useless. The stance of Volkswagen has been to side with the dealer and not to efficiently or quickly respond to the concerns. It has been more than 1 month since the first complaint with VW was made and I’m still to get a satisfactory response from them.<br /><br />I wanted to share this experience with everyone, so that people are aware the kind of service they should except when buying a Volkswagen. The experience with the dealership, “Bhasin Motors” has been a horrible one and the one with VW has been bad too. This is the kind of reputation Volkswagen is building for its brand in India with unprofessional and unethical dealers like Bhasin Motors. Also, their customer service seems to be a complete joke.<br /><br />P.S.: The above is a very concise description of the complete problem. If anyone is interested, I can forward you a three page letter I first wrote to the dealership, stating this and other issues faced at the time of delivery.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com7tag:blogger.com,1999:blog-20124361.post-20348480181681358842011-12-13T21:46:00.002-05:002011-12-13T21:46:00.242-05:00MySQL: Sort By Column ValuesIn MySQL, sorting the data using columns can easily be done by using the ORDER BY clause. Recently, I came across a requirement where I had to sort the data according to the specific values of a column. For example, if a column has the numbers written as words (one, two, three etc.), the values need to be sorted according to their numerical equivalent rather than the default alphabetical sorting.<br /><br />By default, the ORDER BY clause will sort data using alphanumeric sorting. But there is a trick by using the MySQL <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field" target="_blank">field(str,str1,str2,str3...)</a> function to give a different order to the values in the columns. The function finds the position of str in the list of strings str1, str2, str 3...<br /><br />Here is an example on how you can combine the field function with the ORDER BY clause:<br /><pre class="prettyprint">ORDER BY field(`column_name`, 'One', 'Two', 'Three', 'Four', 'Five')</pre>The above code will sort the data according to the column values One, Two, Three, Four, Five.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-63440701333246665362011-11-11T11:11:00.006-05:002011-12-12T21:59:17.414-05:00MySQL: Exporting Selective Columns to CSVThere are many to export large data sets from MySQL in CSV. If you need data for the complete database or a table in the database, the 'mysqldump' command is a great solution. But sometimes you might need to just export a subset of columns in the database, filtered by where clause. This can be achieved by using the SELECT ... INTO clause. It lets you specify the columns you need for your CSV and you can easily use aggregate functions (SUM, AVG etc.), WHERE clause, GROUP BY clause, ORDER BY clause etc. to get the appropriate data to be exported. Also, custom CSV delimiters can be specified to be used for the exported data. You would need to have filesystem access to the MySQL server to run this command.<br /> <br />Here is an example query:<br /><pre class="prettyprint">SELECT `column1`, `column2`, `column3` INTO OUTFILE 'c:\\data\\today.csv'<br /><br /> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'<br /><br /> LINES TERMINATED BY '\n'<br /><br />FROM `tablename`</pre><br />For more details and options please refer to the <a href="http://dev.mysql.com/doc/refman/5.0/en/select-into.html" target="_blank">MySQL reference</a> for the command. <br /><br />Another way to export data from MySQL is by using <a href="http://www.mysql.com/products/workbench/" target="_blank">MySQL Workbench</a>, which is a free tool to administer MySQL databases. Though, the above command is really helpful if you want to schedule export jobs.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-48920021655044506502011-09-05T17:23:00.004-04:002011-09-05T17:51:21.618-04:00C# Default Arguments [Optional Arguments]Coming from the C++ world, one of the things I missed in C# was the support for Default Arguments. Default arguments are used to create functions which could have a few optional arguments with default values. Thus, you could make overloaded calls to the method without creating different function prototypes if the purpose could by using a default value of one of the parameters. Many other common languages like PHP, VB.NET, JavaScript etc. also support this feature. It was surprising that C# did not support it.<br /><br />With C# 4.0 (2010), the support for this feature has been added to the language. The new Optional Arguments in C# 4.0 allows you to specify the default values of parameters in case there values are not provided from the function call. Here's a small example to illustrate the basics of Optional Arguments in C#:<br /><pre class="prettyprint">//C#<br /><br />// Function with optional arguments<br />void OptionalArgExample(int reqdField, string opt = "default value")<br />{<br /> // do something<br />}<br /><br />// Calling the method with just the required argument<br />OptionalArgExample(10);<br /><br />// Calling the method with both the arguments<br />OptionalArgExample(10, "some text");</pre><br />For more information, read the <a href="http://msdn.microsoft.com/en-us/library/dd264739.aspx" target="_blank">MSDN article on Named and Optional Arguments in C#</a>Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-4751464472525963692011-09-01T17:00:00.004-04:002011-09-05T17:26:25.221-04:00Troubleshooting Remote Desktop's Copy/PasteIf you use Window's RDP to remote into your computer or server regularly, you might have noticed that sometimes the Copy and Paste functionality stops working. This functionality is often needed when you work with remote systems as you would frequently want to copy paste text to search for some help; copy some documents which would be easier to read on your computer than on the slow VPN connection you are connected to or maybe if you want to copy something a backup. Usually, to fix this I have to turn off my session and create a new session, which is really cumbersome. But, recently I found a really easy method to fix this situation <a href="http://brennan.offwhite.net/blog/2007/01/18/fixing-copypaste-for-remote-desktop-sessions/" target="_blank">here</a>. Here's what you need to do to six the issue:<br /><ul><li>Open Task Manager (Ctrl+Shift+Esc) on the remote machine.</li><li>Find the "rdpclip" process and kill it.</li><li>Run "rdpclip" to start it again.</li></ul>Just follow the above steps and your Copy/Paste functionality will start working again between the remote and the host computer. This is a real time-saver when dealing with the issue.<br /><br />Another alternate is to use a internet clipboard site like <a href="http://cl1p.net/" target="_blank">cl1p.net</a>, which allows you to create a private clipboard which could be accessed from any computer. Also, I've sometimes used GMail to accomplish this by creating a new draft email and opening it from the other host. These methods are also useful if you want to copy data between different computers.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com2tag:blogger.com,1999:blog-20124361.post-82666058220923145572011-04-11T14:02:00.003-04:002011-04-11T14:14:57.970-04:00LINQ IEnumerable object to a DataTableLINQ is really a very powerful tool for working with complex entities and datasets. It provides you with an easy way to map data to Entity classes. But, sometimes it is very helpful to have the results returned by a LINQ query map into a DataTable. If your LINQ returns a collection of DataRow objects, you can do this using the inbuilt <a href="http://msdn.microsoft.com/en-us/library/system.data.datatableextensions.copytodatatable.aspx" target="_blank">DataTableExtensions.CopyToDataTable()</a> method. However, if your query returns a collection of a custom entity type, you would need to write a utility to do that.<br /><br />Below is a method that could be used to convert an IEnumerable entity object to a DataTable:<br /><br /><pre class="prettyprint">// C#<br />/// <summary><br />/// Convert a Linq IEnumerable object to a DataTable<br />/// </summary><br />/// <typeparam name="T">Entity Type</typeparam><br />/// <param name="enumberable">Linq Resultset</param><br />/// <returns>Datatable with results</returns><br />public static DataTable LinqToDataTable<T>(this IEnumerable<T> enumberable)<br />{<br /> DataTable dt = new DataTable();<br /><br /> T first = enumberable.FirstOrDefault();<br /> if (first == null) // return if the resultset is empty<br /> return dt;<br /><br /> Type t = first.GetType();<br /> PropertyInfo[] properties = t.GetProperties();<br /><br /> // Adding columns to the datatable from the property info<br /> foreach (PropertyInfo pi in properties)<br /> {<br /> Type pt = pi.PropertyType;<br /><br /> // Handling nullable properties in the resultset<br /> if (pt.IsGenericType && pt.GetGenericTypeDefinition() == typeof(Nullable<>))<br /> pt = Nullable.GetUnderlyingType(pt);<br /> <br /> dt.Columns.Add(pi.Name, pt);<br /> }<br /><br /> // Adding rows to the datatable from the enumerable resultset<br /> foreach (object obj in enumberable)<br /> {<br /> DataRow dr = dt.NewRow();<br /> foreach (PropertyInfo pi in properties)<br /> {<br /> object value = (pi.GetValue(obj, null) != null) ? pi.GetValue(obj, null) : DBNull.Value;<br /> dr[pi.Name] = value;<br /> }<br /> dt.Rows.Add(dr);<br /> }<br /><br /> return dt;<br />}</pre><pre class="prettyprint">' VB.Net<br />''' <summary><br />''' Convert a Linq IEnumerable object to a DataTable<br />''' </summary><br />''' <typeparam name="T">Entity Type</typeparam><br />''' <param name="enumberable">Linq Resultset</param><br />''' <returns>Datatable with results</returns><System.Runtime.CompilerServices.Extension> _<br />Public Shared Function LinqToDataTable(Of T)(enumberable As IEnumerable(Of T)) As DataTable<br /> Dim dt As New DataTable()<br /><br /> Dim first As T = enumberable.FirstOrDefault()<br /> If first Is Nothing Then<br /> ' return if the resultset is empty<br /> Return dt<br /> End If<br /><br /> Dim t As Type = first.[GetType]()<br /> Dim properties As PropertyInfo() = t.GetProperties()<br /><br /> ' Adding columns to the datatable from the property info<br /> For Each pi As PropertyInfo In properties<br /> Dim pt As Type = pi.PropertyType<br /><br /> ' Handling nullable properties in the resultset<br /> If pt.IsGenericType AndAlso pt.GetGenericTypeDefinition() = GetType(Nullable(Of )) Then<br /> pt = Nullable.GetUnderlyingType(pt)<br /> End If<br /><br /> dt.Columns.Add(pi.Name, pt)<br /> Next<br /><br /> ' Adding rows to the datatable from the enumerable resultset<br /> For Each obj As Object In enumberable<br /> Dim dr As DataRow = dt.NewRow()<br /> For Each pi As PropertyInfo In properties<br /> Dim value As Object = If((pi.GetValue(obj, Nothing) IsNot Nothing), pi.GetValue(obj, Nothing), DBNull.Value)<br /> dr(pi.Name) = value<br /> Next<br /> dt.Rows.Add(dr)<br /> Next<br /><br /> Return dt<br />End Function</pre>Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-64132320386517015092011-03-18T11:53:00.001-04:002011-04-12T16:55:11.557-04:00Using ASP.NET AJAX UpdatePanels and jQuery TogetherThere are instances when you would like to use ASP.NET AJAX UpdatePanels and jQuery together on the same page. ASP.NET AJAX’s UpdatePanel does not give you the best performance but the ease of use and direct integration with ASP.NET control often times makes it a very useful control to implement partial page loads on the ASP.NET pages. With the powerful controls of jQuery and the ease of use of the UpdatePanel sometimes it does makes sense to use these two in conjunction. Having said that, as far as possible, you should avoid using multiple JS libraries on the same page to prevent any conflicts between them.<br /><br />When you use the UpdatePanel and jQuery controls in the same page, often times the jQuery controls will only work before you do any postback for the UpdatePanel. As soon as the postback results get back to the page the jQuery controls stop working. There is an easy workaround to resolve the situation using the ASP.NET AJAX’s pageLoad() function. This function is similar to the Page_Load event for the ASP.NET page. So, your jQuery’s $(document).ready should be replaced by this method.<br /><br />For example, if your current jQuery looks like:<br /><pre class="prettyprint">$(document).ready(function() {<br /> // jQuery code<br /> });</pre><br />To make it not conflict with the UpdatePanel, change it to:<br /><pre class="prettyprint">function pageLoad() {<br /> // jQuery code<br />}</pre><br />Remember this pageLoad() function is part of the ASP.NET AJAX library.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com2tag:blogger.com,1999:blog-20124361.post-51015023540047055802010-11-30T19:34:00.002-05:002010-11-30T19:34:00.170-05:00ASP.NET GridView': Align Right Numerical Values from Code BehindWhile creating generic user controls having GridViews, its not easy to format columns based on data the columns will have. The type of the data a column will have is not always known until the data is bounded on to the grid. The data on the GridView looks a lot better, when numerical values, dollar/currency amounts, percentages etc. are aligned to the right of the cells. This could be easily accomplished using the RowDataBound event of the GridView and then matching the cell value to a regular expression to determine if it matches your criteria for alignment.<br /><br />Here is a sample implementation for a RowDataBound method for the GridView, which looks for cells having only numbers, comma (,) and a period(.) in the contents and if it finds a match, it aligns it to the right:<br /><br /><pre class="prettyprint">// C#<br />protected void gridViewt_RowDataBound(object sender, GridViewRowEventArgs e)<br />{<br /> if (e.Row.RowType == DataControlRowType.DataRow)<br /> {<br /> // Right align the column if its a numerical value<br /> for (int i = 0; i < e.Row.Cells.Count; i++)<br /> {<br /> if(Regex.IsMatch(e.Row.Cells[i].Text.Trim(), @"^[0-9,.]*$"))<br /> {<br /> e.Row.Cells[i].HorizontalAlign = HorizontalAlign.Right;<br /> }<br /> }<br /> }<br />}</pre>><pre class="prettyprint">' VB.Net<br />Protected Sub gridViewt_RowDataBound(sender As Object, e As GridViewRowEventArgs)<br /> If e.Row.RowType = DataControlRowType.DataRow Then<br /> ' Right align the column if its a numerical value<br /> For i As Integer = 0 To e.Row.Cells.Count - 1<br /> If Regex.IsMatch(e.Row.Cells(i).Text.Trim(), "^[0-9,.]*$") Then<br /> e.Row.Cells(i).HorizontalAlign = HorizontalAlign.Right<br /> End If<br /> Next<br /> End If<br />End Sub</pre><br />You can change the regular expression depending on what all do you you want to match to align the data to the right.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-55072431501867673962010-09-30T12:06:00.004-04:002010-09-30T19:33:57.057-04:00ASP.NET: Change GridView's Row Color onMouseOverGridView is a good control to display tabular data. Its easy to use GridView's standard built-in templates and have some good formatting with alternate row colrs and other settings. Also, when you have a lot of columns in your table its always handy if the row is highlighted when you put your mouse over to it. GridView does not has that feature built into it, but its really easy to add it by adding some code into the RowDataBound event of the GridView. Here is how the code will look like in the code behind:<br /><br /><pre class="prettyprint">// C#<br />protected void gridView_RowDataBound(object sender, GridViewRowEventArgs e)<br />{<br /> // Creating hover effects on mouseover event for each row<br /> if (e.Row.RowType == DataControlRowType.DataRow)<br /> {<br /> e.Row.Attributes["onmouseover"] = "this.style.background='#D1DDF1';";<br /><br /> if ((e.Row.RowIndex % 2) == 0) // if even row<br /> e.Row.Attributes["onmouseout"] = "this.style.background='#EFF3FB';";<br /> else // alternate row<br /> e.Row.Attributes["onmouseout"] = "this.style.background='White';";<br /> }<br />}</pre><pre class="prettyprint">' VB.Net<br />Protected Sub gridView_RowDataBound(sender As Object, e As GridViewRowEventArgs)<br /> ' Creating hover effects on mouseover event for each row<br /> If e.Row.RowType = DataControlRowType.DataRow Then<br /> e.Row.Attributes("onmouseover") = "this.style.background='#D1DDF1';"<br /><br /> If (e.Row.RowIndex Mod 2) Is 0 Then<br /> ' if even row<br /> e.Row.Attributes("onmouseout") = "this.style.background='#EFF3FB';"<br /> Else<br /> ' alternate row<br /> e.Row.Attributes("onmouseout") = "this.style.background='White';"<br /> End If<br /> End If<br />End Sub</pre><br />The code above, adds the 'onmouseover' and 'onmouseout' attributes to each of the table rows in GridView. Make sure you match the onmouseout colors to the colors in your original template. You can also use the '<b>onclick</b>' attribute instead of 'onmouseover' if you want to <b>change the color on clicking a row</b>.<br /><br />This feature could also be potentially implemented on client-side using jQuery and CSS. If you'd like to do it that way, use the 'onmouseover' or 'onclick' event of jQuery to change your row colors and then change them back in the 'onmouseout' event.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-80179453779623675232010-08-04T16:59:00.004-04:002010-08-04T17:16:22.725-04:00ASP.NET: Setup the Page Title from Web.SitemapASP.Net allows you to associate a sitemap file with your project. You can add this file as a Web.Sitemap in the web project. This file could be used with the ASP.Net navigation controls to create menu, tree view or a site map path on your website. One of the other things where this file comes handy is when you want to dynamically assign title to your pages. This is a fairly common requirement when you use master pages and don't want to modify additional parameters on individual pages. Here's the code you should add into your master page's .cs file:<br /><br /><pre class="prettyprint">// C#<br />protected override void OnInit(System.EventArgs e)<br />{<br /> base.OnInit(e);<br /><br /> // Setting Page Title from SiteMap<br /> SiteMapNode node = SiteMap.CurrentNode;<br /><br /> if (node != null && !string.IsNullOrEmpty(node.Title))<br /> {<br /> Page.Title = "App Name | " + node.Title;<br /> }<br />}</pre><pre class="prettyprint lang-vb">' VB.NET<br />Protected Overrides Sub OnInit(e As System.EventArgs)<br /> MyBase.OnInit(e)<br /><br /> ' Setting Page Title from SiteMap<br /> Dim node As SiteMapNode = SiteMap.CurrentNode<br /><br /> If node IsNot Nothing AndAlso Not String.IsNullOrEmpty(node.Title) Then<br /> Page.Title = "App Name | " + node.Title<br /> End If<br />End Sub<br /></pre><br />The above function adds the associated title associated with the url of the page.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-60929793808129756792010-03-18T14:07:00.005-04:002010-03-18T15:09:49.364-04:00this.blog was Hibernating, but @gsmodi was AwakeIt has been a long time since I last posted on this blog - the longest interval between any two consecutive posts on this blog. Posting long posts on the blog has suffered because of the convenience and ease of posting something in less than 140 characters on Twitter (<a href="http://twitter.com/gsmodi" target="_blank">@gsmodi</a>). The USP of Twitter is its simplicity. The fact that you can use it from multiple devices and applications still getting all the required functionality makes it stand out.<br /><br />This blog now goes into hibernation rather more frequently than anytime in the past. Its just not about me losing interest in blogging or having a busier schedule; its about the plethora of other social networks which take up the time I might have spend on blogging. Facebook and Twitter are the hot suites of this era. I am regular on both the network though seldom like to post on Facebook, but do tweet rather frequently. Still trying to decipher why I don't like to update my status on Facebook but can tweet about just anything (<a href="http://twitter.com/gsmodi/status/8657768279" target="_blank">related tweet</a>). I am sure there are many who share the same syndrome. Another network which I frequent is LinkedIn, which I believe is an excellent way for professional networking and getting updates about your contacts.<br /><br />The arena of social networks is perpetually being enhanced. If we try to look through the past few years, social networks have evolved marvelously. Everyone wants a share of this huge pie. While Facebook might be leading the race at this time (some people also talk about it as the next big thing after Google), these sites have a history of being overturned by competition. We all have seen the fate of MySpace, Orkut and the likes. Though each have been successful in their times in particular regions of the world, they tend to die out and are superseded by the competition. With Google coming up with Buzz, fresh networks like Tumblr gaining popularity and a plethora of other services which are launched everyday, this would be an interesting space to watch.<br /><br />OK, that was a bit about social networks - was not supposed to be in this post, could have written a complete post on that stuff. So, coming back to the main point, should I let this blog die out? I don't think so, I've been maintaining it for over 4 years now. I'll try to be more regular, maybe write shorter posts more frequently and cut down the time to do some research before posting about something. Lets see how that turns out. <br /><br />@gsmodi (Twitter) will hopefully still be awake and this.blog would try hard to wake up ;)Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-76418327105344779192009-12-27T21:46:00.005-05:002009-12-27T22:38:10.302-05:00Program to Compute Large Fibonacci Numbers in HexHere's a Java program that calculates the n'th Fibonacci number in hexadecimal format, where n could be infinitely long. For those who don't know, Fibonacci series is a series which is calculated by summing up the last two numbers of the series. It starts from 1, 1, 2, 3, 5, 8, 13, 21...<br /><br />Large Fibonacci numbers are particularly useful to calculate the Golden Ratio, which can be calculated by using the ratio of the last 2 infinitely large terms of the Fibonacci series. The approximation of the ratio improves as you progress farther in the series. For more interesting mathematical properties read the Wikipedia entry for <a href="http://en.wikipedia.org/wiki/Golden_ratio" target="_blank">Golden Ratio</a>.<br /><br />In this program, the hex values are stored in string because of the restrictions posed by the conventional data types. The series is calculated by summing up the last 2 numbers of the series using carry and adding digit by digit. Eg. 8 & 13 can be added by adding 8+3 and have one in unit's place and carry 1 to the ten's place, then adding 1+1 = 2; thus, the answer 21.<br /><pre class="prettyprint">public class FibonacciNumber {<br /><br /> public static void main(String[] args) {<br /><br /> String h1 = "1"; // First Fibonacci Number<br /> String h2 = "1"; // Second Fibonacci Number<br /> String h3 = ""; // Next Fibonacci Number<br /> String tempResult = "";<br /> int i1=0, i2=0, i3;<br /> Long ctr = new Long(0);<br /><br /> try {<br /> // Loop till maximum value of Long<br /> // Each run calculates the next number<br /> while (ctr < Long.MAX_VALUE) {<br /><br /> i3 = 0;<br /> h3 = "";<br /> ctr++;<br /><br /> // This loop calculates the sum of the previous numbers digit by digit<br /> for (int i = h1.length(), j = h2.length(); j > 0; i--, j--) {<br /><br /> if (i > 0) { // If a digit is left in i<br /> i1 = Integer.parseInt(h1.substring(i - 1, i), 16);<br /> i2 = Integer.parseInt(h2.substring(j - 1, j), 16);<br /> i3 += i1 + i2;<br /> } else if (h2.length() > h1.length()) {<br /> // When h1 is shorter than h2. Eg. h1=8 h2=11 <br /> i2 = Integer.parseInt(h2.substring(j - 1, j), 16);<br /> i3 += i2;<br /> }<br /><br /> tempResult = Integer.toHexString(i3);<br /><br /> if (tempResult.length() == 2) // Handling carry digit<br /> {<br /> i3 = Integer.parseInt(tempResult.substring(0,1), 16);<br /> h3 = tempResult.substring(1,2) + h3;<br /> }<br /> else // No carry digit<br /> {<br /> i3 = 0;<br /> h3 = tempResult.substring(0,1) + h3;<br /> }<br /> }<br /> if (i3 != 0)<br /> h3 = tempResult.substring(0,1) + h3;<br /><br /> System.out.println(ctr + ": " + h3);<br /><br /> h1 = h2;<br /> h2 = h3;<br /><br /> }<br /> } catch (Exception ex) {<br /><br /> System.out.println(ex.toString());<br /> }<br /><br /> }<br />}</pre><br /><br />The output of the program will look like:<br /><br /><pre class="prettyprint">1: 2<br />2: 3<br />3: 5<br />.<br />.<br />244: 3144535de4cae86ae251b1971896d58bf961e6b9d48<br />245: 4fb72becbf73267006f65a3aa504c57b1e9930e392d<br />246: 80fb7f4aa43e0edae9480bd1bd9b9b0717fb179d675<br />.<br />.<br />846: bc35110da32840cce42425afddfe8fde936030e7fda1d532615324be2a410804acef43394c0b512d5e34a2f5e77fbe0e82d80580f4fb592de0232add6f7e6f34127e8eb43165d008fe5<br />847: 130869a782cc70170bd47e47fb3034ecbbce810b2e7dce2a56c30baa1f3bc359eb13f26ed83e0f4357dbed6c374b79dfcf303e52c94a3996b1dfff19229baa1c0194727a75d25313cd62<br />.<br />.<br />Can go upto zillions of numbers.<br /></pre>Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com3tag:blogger.com,1999:blog-20124361.post-48036577935951676052009-11-29T16:59:00.004-05:002009-11-29T17:14:42.592-05:00What Do I Tweet About?From the past few months, I've been tweeting a lot (atleast reading a lot of them) and that's one of the reason I've been irregular on my blog. So, here's a cloud showing what I have been tweeting about.<br /><br /><a href="http://www.gsmodi.com/blog/images/2009/tweet-cloud.png"><img style="margin: 0px auto 10px; display: block; text-align: center; width: 458px; height: 625px;" src="http://www.gsmodi.com/blog/images/2009/tweet-cloud.png" alt="" border="0" /></a><br /><div style="text-align: right;">Generated using <a href="http://tweetcloud.icodeforlove.com/">Tweet Cloud</a>.</div>Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-25094284631964693572009-09-29T20:15:00.004-04:002009-09-29T20:23:41.418-04:00Lost Generation<center><object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/42E2fAWM6rA&hl=en&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/42E2fAWM6rA&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"></embed></object></center><br />A nice video depicting some of the characteristics which our generation is adopting.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com3tag:blogger.com,1999:blog-20124361.post-75529492083060652912009-08-28T18:18:00.002-04:002009-08-28T20:26:45.444-04:00What to Write and What Not?It has been quite some time since I last posted on my blog. I'm often in a dilemma when it comes to posting something on my blog, especially when posting non-tech stuff. In my previous posts, many a times I've talked about posting more personal stuff out here. Infact, in Jan 2008, I had a complete <a href="http://blog.gsmodi.com/2008/01/2008-blog-will-be-personal-again.html">post</a> on this. But alas, there is rarely anything personal on my blog. <br /><br />Most of my recent posts make this blog look like a technology blog. Most of these are code samples, tips and tricks, technology reviews etc. One of the reasons for this is that, I kind of use this space for my own reference by posting stuff I might need to use in future. Also, at times, these help others looking for similar stuff (and I get visitors from search engines). <br /><br />Coming back to the dilemma about writing blog posts - it’s hard to decide what I want to share on my blog. I can't figure out how to post on the public domain. Many a times, I think about posting some small events and happenings in life. But then I just don't want to write a complete post about it. These personal posts can sometimes take a lot of time as it requires a lot of thought process to put everything together. Most of the times I just feel its not worth the time.<br /><br />Some of these personal things just find another place on the web - my <a href="http://twitter.com/gsmodi" target="_blank">Twitter</a> account. It’s much easier to tweet stuff rather than writing a large post about it. This is one of the reasons that I post less on my blog. I tweet about a wide variety of stuff, some of which would have been on my blog if there was no Twitter.<br /><br />Talking about some social networking sites - there was a time, when I was very frequent on Facebook and Orkut but not any more. I do visit these occasionally, but hardly ever do things like changing my Facebook status. Previously, I've also been active on various forums where I've posted actively; but now a rare visitor to those forums too. For me these online habits evolve over time then go into long hibernation stretches and sometimes wake up for short spells of time.<br /><br />Hopefully, in future I'll continue posting more useful stuff on this blog and cut down on these crap posts. Thank you for bearing with me through this post, I know it wasn't a nice read.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-28163488742400429722009-07-13T19:31:00.004-04:002009-07-13T20:03:48.572-04:00ASP.NET: Format Phone Numbers using RegExIf you have a database having phone numbers in various formats, you would want to display them in a consistent format. A solution to display phone numbers in a standard format without worrying about the format in the database is to use regular expressions to format the phone numbers. <br /><br />For implementing this into ASP.NET pages create a class in the App_Code folder of your web application. Create a static(C#) or shared(VB.NET) method in this class which gets the value of the phone number field as object to handle null values of phone numbers in the database. The code for this function is given below:<br /><br /><pre class="prettyprint">// C#<br />public class CommonFunctions<br />{ <br /> public static string FormatPhone(object phoneNo)<br /> { <br /> string formattedPhone = phoneNo.ToString;<br /> // Extracting numbers from the string<br /> formattedPhone = Regex.Replace(formattedPhone, "[^0-9]", "");<br /> // The format is in third parameter of the replace function<br /> formattedPhone = Regex.Replace(formattedPhone, "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3");<br /> <br /> return formattedPhone;<br /> } <br />}</pre><pre class="prettyprint lang-vb">' VB.NET<br />Public Class CommonFunctions<br /><br /> Shared Function FormatPhone(ByVal phoneNo As Object) As String<br /> Dim formattedPhone As String = phoneNo.ToString<br /> ' Extracting numbers from the string<br /> formattedPhone = Regex.Replace(formattedPhone, "[^0-9]", "")<br /> ' The format is in third parameter of the replace function<br /> formattedPhone = Regex.Replace(formattedPhone, "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")<br /> Return formattedPhone<br /> End Function<br /><br />End Class</pre><br />The above function first abstracts all the digits from the phone number by using the "[^0-9]" regular expression; all characters which are not numbers are replaced by "". Then the phone numbers are broken into three groups using "(\d{3})(\d{3})(\d{4})" and the groups are then displayed as "($1) $2-$3". Thus, a phone number such as 123.456-7890 will first be converted into 1234567890 and then formatted as (123) 456-7890. You can modify the display format by changing the second replace function. <br /><br />You can use this method from any ASP.NET data bound field as follows:<br /><br /><pre class="prettyprint"><%# CommonFunctions.FormatPhone(Eval("Phone")) %></pre><br />Though this example shows the use of this function for ASP.NET pages, it can be used for any .NET based application.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com6tag:blogger.com,1999:blog-20124361.post-1545471257180688512009-07-09T12:05:00.011-04:002009-07-13T19:30:02.930-04:00Free Remote Login ToolsRemote login tools allow you to connect to your computer remotely. You get complete control over your desktop and you can work as if you were working on your own machine. The Windows standard "Remote Desktop Connection" tool is one of the best methods to connect to your computer remotely. But its difficult to use when your computer does not has a static IP address, is connected over a LAN or with a DSL modem which uses NAT.<br /><br />Here are some tools which I've used for remotely connecting to my computer and should be helpful for others:<br /><br /><a href="http://www.mesh.com/" target="_blank">Live Mesh</a>:<br />Live Mesh is one of the best free tools, I've come across. It has great remote desktop capabilities with features similar to the Remote Desktop connection. You would need the Mesh software to be installed on both machine and logged in with a live id. Live Mesh has many more capabilities apart from remote connection. It has a fabulous file synchronization service with 5GB of free storage space. I have been using it for the past 6 months and it has been really superb. Highly recommended if you work at multiple locations. (Also see an earlier post: <a href="http://blog.gsmodi.com/2008/04/mesh-up-your-data-on-live-mesh.html">Mesh up your Data on Live Mesh</a>.)<br /><br /><a href="http://www.teamviewer.com/" target="_blank">TeamViewer</a>:<br />TeamViewer is a simple tool which allows you to remotely connect to a computer and requires a combination of auto-generated id and passcode. You don't even need to install the tool, you can just run the program by selecting the appropriate option in the setup exe. Anyone having access to the id and passcode can run team viewer and remotely access the computer. This tool is good if you need a temporary access to a computer. I prefer this tool for troubleshooting someone's computer. It gives you the complete desktop access of the machine by sending snapshots of the workspace. It supports Windows and Mac.<br /><br />These free tools are great alternatives to the paid remote desktop softwares such as <a href="http://www.anrdoezrs.net/click-1887138-10273937?url=https%3A%2F%2Fwww.gotomypc.com%2Ftr%2Faffil%2F2007_Q1%2Fproduct%2Fg25af_stnddlp%3Ftarget%3Dmm%2Fg25af_stnddlp.tmpl+&cjsku=GoToMyPC" target="_blank">GoToMyPC</a><img src="http://www.ftjcfx.com/image-1887138-10273937" width="1" height="1" border="0"/> and other VPN based tools. There are many more free tools available, feel free to post a comment about them.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-66431916033544071132009-07-07T11:35:00.002-04:002009-07-07T12:03:51.988-04:00.NET: Convert Image Formats ProgrammaticallyUsing the .NET framework, you can easily convert images from one format to another with just a few lines of code. The <span style="font-style:italic;">System.Drawing</span> namespace has the functions which help you to load and then save the image in the desired format. The formats supported by the ImageFormat class are: Bmp, Emf, Exif, Gif, Guid, Icon, Jpeg, MemoryBmp, Png, Tiff, Wmf. You can convert an image to any of these formats.<br /><br />Here is a simple console application which reads all files in a given directory and converts them into .jpg images. It includes the <span style="font-style:italic;">System.IO</span> namespace to read the files in the directory and the <span style="font-style:italic;">System.Drawing</span> class for image functions. You would need to add a reference to System.Drawing class in the Console application. Also, make sure you only have images in the directory or specify a check in the code to read only image files.<br /><br /><pre class="prettyprint">// C#<br />using System.IO;<br />using System.Drawing;<br /><br />static class Module1<br />{ <br /> public static void Main()<br /> {<br /> DirectoryInfo dir = new DirectoryInfo("C:\\something");<br /> <br /> foreach (FileInfo img in dir.GetFiles) {<br /> Image _image = Image.FromFile("C:\\something\\" + img.Name);<br /> _image.Save(img.Name, Imaging.ImageFormat.Jpeg);<br /> }<br /> } <br />}</pre><pre class="prettyprint lang-vb">' VB.NET<br />Imports System.IO<br />Imports System.Drawing<br /><br />Module Module1<br /><br /> Sub Main()<br /> Dim dir As New DirectoryInfo("C:\something")<br /><br /> For Each img As FileInfo In dir.GetFiles<br /> Dim _image As Image = Image.FromFile("C:\something\" & img.Name)<br /> _image.Save(img.Name, Imaging.ImageFormat.Jpeg)<br /> Next<br /> End Sub<br /><br />End Module</pre><br />The output files would be written into your 'bin' directory if you execute this code from Visual Studio. If you need to change the output path, you can do so by adding a Path to the Save method.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-90374031982603363352009-06-22T22:15:00.009-04:002009-06-23T00:50:27.908-04:00ASP.NET: Changing Nested Controls on Repeater's ItemDataBoundASP.NET Repeater is a great control to display a series of data in a custom formatted style. It gives you independence to choose your data layout rather than going with the standard table layouts of the DataGrid. When using repeaters it may be sometimes useful to modify a display control inside a repeater depending on the value of a DataItem which is bound to the repeater.<br /><br />Here's a simple example on how to change value of a control in the repeater on ItemDataBound. The following code checks the value of the "id" column of the DataRow and checks if it matches with the one passed by query string. If that's the case it then updates a Label for that element.<br /><br /><pre class="prettyprint lang-vb">' VB.NET:<br />Protected Sub rptr_ItemDataBound(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptr.ItemDataBound<br /> If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem) Then<br /> If ((CType(e.Item.DataItem, System.Data.DataRowView)).Row("id").ToString() = Request.QueryString("id")) Then<br /> CType(e.Item.FindControl("lblBoolDisplat"), Label).Text = "This value is being requested."<br /> End If<br /> End If<br />End Sub</pre><pre class="prettyprint">// C#<br />protected void rptr_ItemDataBound(object source, System.Web.UI.WebControls.RepeaterItemEventArgs e)<br />{<br /> if ((e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem))<br /> {<br /> if ((((System.Data.DataRowView)e.Item.DataItem).Row("id").ToString() == Request.QueryString("id")))<br /> {<br /> ((Label)e.Item.FindControl("lblBoolDisplat")).Text = "This value is being requested.";<br /> }<br /> }<br />}</pre><br />For C#, also add: <pre class="prettyprint">OnDataItemBound="rptr_ItemDataBound"</pre> on the <asp:Repeater> tag in the ASP.NET page.<br /><br />Though this is a very simple example, it is very useful in handling complex data. A similar logic is applied when <span style="font-weight:bold;">nesting repeaters</span> in a repeater. A nested repeater could be accessed as a nested control in the same way the label is being accessed in the above code.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-55970251734366614832009-05-24T15:52:00.005-04:002009-05-24T16:05:41.987-04:00Facebook phishing Scams on the Way!I received a message today which had "wwww whiteflash be". Its a phishing scam to extract Facebook login information. Searched twitter and found out multiple domains being used for the scam. Beware of entering any information on the following sites:<br /><br />whiteflash.be<br />mymarket.be<br />vispace.be<br />goldbase.be<br />greenbuddy.be<br />silvertag.be<br />picoband.be<br /><br />Google and other anti-phising services are yet not updated with these URL's to warn users. In general beware of any links that end with .be. The pages look like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2S150AdxUeyR64ifKEyrxo_2Ak15k1z1XbpQ6heBfO-PAtLf8OBN7S7KKizyZD8yLQb-NqwXjyPyb0RWOjlgI_w0ezndQQG6yANfisHPoAQsU68ZIRHikq011zouu-5uLFO0OwA/s1600-h/facebook_scam.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 149px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2S150AdxUeyR64ifKEyrxo_2Ak15k1z1XbpQ6heBfO-PAtLf8OBN7S7KKizyZD8yLQb-NqwXjyPyb0RWOjlgI_w0ezndQQG6yANfisHPoAQsU68ZIRHikq011zouu-5uLFO0OwA/s320/facebook_scam.png" alt="" id="BLOGGER_PHOTO_ID_5339482444488955042" border="0" /></a><br /><br />These sites are hosted in China on IP: 211.95.78.98, with the following Whois record:<br /><br />Domain: picoband<br />Status: REGISTERED<br />Registered: Fri May 22 2009<br /><br />Licensee:<br /> Not shown, please visit www.dns.be for webbased whois.<br /><br />Agent:<br /> Name: 1API GmbH<br /> Website: www.1api.net<br /><br />Nameservers:<br /> ns1.everydns.net<br /> ns2.everydns.net<br /> ns3.everydns.net<br /> ns4.everydns.net<br /><br />If you have already entered your login information in any of these websites, I would suggest that you change your passwords immediately. Have a safe browsing experience!Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1tag:blogger.com,1999:blog-20124361.post-2504647228141683182009-05-20T00:12:00.003-04:002009-05-20T01:00:26.828-04:00Youtube's Background ImageI just saw the background image of YouTube and was amazed to discover that it has all the commonly used graphics on a single image. I don't know how many people have actually noticed that or used this technique, but it looks brilliant to me. Its superb to fit in so much in a png image which is less than 10KB and then using CSS to display the appropriate parts of the image for each div block.<br /><br />It is common to use such images for hover buttons, where you just change the position of the image for hover effects. This ensures that you don't have to wait for the hover image to be loaded to see the effect. But, I never ever thought of encompassing all my graphic objects in a single image file and then displace the image as required using the background-position property in CSS. It would definitely make the page load much faster than having to download a plethora of small images which are scattered all around. <br /><br />The YouTube background includes the header logo, the favorite rating stars, the button backgrounds, small buttons, gradients etc. Most of the images in this common background are used in all pages of the website and thus, its a good choice to group them all together as a single image and reduce the overall page load time. <br /><br />If you want to view the background image, right click on a static background area (the gray header near the search box is a good choice) and select (in Firefox) view background image or (in IE) save background image. I'm sure, you would be surprised to see the huge png image. Alternatively, you might just want to visit this <a href="http://s.ytimg.com/yt/img/master-vfl95681.png" target="_blank">link</a> to view the image.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com5tag:blogger.com,1999:blog-20124361.post-69356270420340253982009-05-10T14:38:00.003-04:002009-05-10T14:38:00.455-04:00Progress in Video AdvertisingWith the popularity of Youtube and other online video streaming sites, video advertising is increasingly becoming a domain people want to explore. Video advertising is increasingly becoming popular and adds a new dimension to the text and banner based internet advertising. Its a very promising new form of internet advertising.<br /><br />A lot of new methods are being developed for this new form of advertising. One of the most interesting ones is in-video advertising. Imagine advertising a product by placing it at an appropriate spot in the video and allow user to click on the product to view details and purchase it. Or just putting an advertisement on a building shown in the video. The video advertisement technologies are emerging to make all these things possible.<br /><br />Innovid is one such company which has come out with some great techniques for In-Video advertising creating a brand experience which had not been possible before. They allow you to create videos with user interaction which is super cool. They have one of the most innovative advertising techniques which allows the advertisements to be placed in a streaming video. Check out their <a href="http://www.innovid.com/gallery.php" target="_blank">gallery</a> for the ad methods they have developed.<br /><br />Another interesting technology is <a href="http://www.zunavision.com/" target="_blank">Zunavision</a>, which is developed by Stanford University and allows advertisers to dynamically add image or video in an already existing video. You just select a surface in the video to place your ad and it automatically adjusts the advertisements with the motion of the video. See the following video which describes how this technology works:<br /><div style="margin:0 auto;text-align:center;"><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/CR3tQmxrPo8&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CR3tQmxrPo8&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /></div><br />The future of video advertising seems great and can help monetize the video content people generate.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-39382545723090505912009-05-08T18:06:00.003-04:002009-05-08T18:28:42.445-04:00Micro-blogging on TwitterThe frequency of my posts on the blog have been decreasing over time. With all my buzy schedule, its difficult to update the blog regularly. I've recently started using twitter and have fallen in love with this concept of micro-blogging. Its so much easier to just write a line or two than writing a complete post on something you just saw. Its instant, its simple and its fun.<br /><br />I have had lots of things I thought to blog about but most of them never make it out here because I don't have had the time to post them. But now, whenever I see something interesting, I tweet about it. Its also interesting to get almost instant replies about it. I find it better than the Facebook status updates.<br /><br />Twitter has been there for a while and is gaining momentum. People have started using it for marketing, job search, networking and much more. There is a lot of spam out there too, but you have control over whom you want to follow and an option to control who should be following you. Your followers are the ones who can read your tweets and you get updates from people whom you are following.<br /><br />You can follow me on on twitter: <a href="http://twitter.com/gsmodi" target="_blank">@gsmodi</a>. Also, my twitter feed would now be posted on the right column of my blog.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com0tag:blogger.com,1999:blog-20124361.post-10549638224123438292009-04-01T15:03:00.008-04:002009-04-01T19:58:55.497-04:00YouTube and GMail on April Fool's DayToday, you might have noticed the flipped YouTube or New GMail! Autopilot on top of your gmail. You might have twisted your screen or head to watch the new YouTube or tried to activate the non-existent autopilot on your settings tab. That's Google making you April Fool. Google always comes up with these amazing things on April Fool's day. <br /><br />If you are a web developer, you might be wondering how did they code the flipped version. They would be using javascript to change the character's to a the charset of flipped characters. Here's a <a href="http://snipplr.com/view/4215/flip-your-text-with-charsets/" target="_blank">code</a> that shows you an example. <br /><br />Here's how a YouTube page looked today:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRElOkMeThMnzacfN9VbPjUyX_GuPq1spkJOYVfFsAfTszMuZSdwP7ebrNcriJ23TD-LB7XJtXGzgzp8s2q2BJuI1A70OvpIYKGg1ICOdy6E5bWpoCbxwHlsmPJDgllnfVuYa21A/s1600-h/aprilfool_youtube.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 231px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRElOkMeThMnzacfN9VbPjUyX_GuPq1spkJOYVfFsAfTszMuZSdwP7ebrNcriJ23TD-LB7XJtXGzgzp8s2q2BJuI1A70OvpIYKGg1ICOdy6E5bWpoCbxwHlsmPJDgllnfVuYa21A/s320/aprilfool_youtube.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5319875229022569602" /></a><br />The GMail notification:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggOrO54g5D6w65Rz4RQd2smA2BIIZtMnVA2yV4XfNJuDCywRi41AvUV5YAbhujFvG9M-SE5rFAZwA50KnK3N1lhBLYth9gP8lBWp68vrV08ZcHnq3KfA2Ejtdx0YwjtWonwXiVsg/s1600-h/aprilfool_gmailheader.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 34px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggOrO54g5D6w65Rz4RQd2smA2BIIZtMnVA2yV4XfNJuDCywRi41AvUV5YAbhujFvG9M-SE5rFAZwA50KnK3N1lhBLYth9gP8lBWp68vrV08ZcHnq3KfA2Ejtdx0YwjtWonwXiVsg/s320/aprilfool_gmailheader.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5319875528189899874" /></a><br />The description of AutoPilot:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguHpuSURpGaNHBC0peqtpcABN-yRn5w9PwtX5uneYrsOhlaH6pRlvObHxiOfagGBbQ-B2Eaa1-Xsut3uYJOF_bqMKAK-qeHpGaLihoWeQa4-V0w2MpmJ7DiT-hMBToXq74ISCFbQ/s1600-h/aprilfool_gmaildetail.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguHpuSURpGaNHBC0peqtpcABN-yRn5w9PwtX5uneYrsOhlaH6pRlvObHxiOfagGBbQ-B2Eaa1-Xsut3uYJOF_bqMKAK-qeHpGaLihoWeQa4-V0w2MpmJ7DiT-hMBToXq74ISCFbQ/s320/aprilfool_gmaildetail.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5319875645807828050" /></a><br />The April Fool's description of CADIE (used for GMail's autopilot) can be found <a href="http://www.google.com/intl/en/landing/cadie/index.html" target="_blank">here</a>.Gurpreet Singh Modihttp://www.blogger.com/profile/16786250333251640920noreply@blogger.com1