Archive for March, 2011


At Google, HTTPS is the New HTTP


Security is of paramount importance in applications. APIs are the cornerstone of most applications today and ensuring that the data flowing through the API calls is secure cannot be overemphasized. Secure Sockets Layer (SSL) has been available to us for years now and Google has made the first moves in using SSL across its suite of products with a plan to rolling out SSL for most of its developer APIs in the latter part of the year.

Adam Feldman from the Developer Team announced the incorporation of SSL into Google Products and gave a roadmap on which products/APIs of Google are next on incorporating SSL support. Several products like Gmail and Google Docs have already made the transition to mandating SSL. Even Google Maps API is offering SSL to all developers. Several Developer APIs are next and that newer versions of APIs or completely new APIs will be SSL only.

The blog further states that “Beginning September 15, 2011, Google will require that all users of Google Documents List API, Google Spreadsheets API, and Google Sites API use SSL connections for all API requests.” Plain HTTP calls with be disallowed and will result in a 400 Bad Request response. So this is something that developers should note immediately and plan out. The good news is that it should be transparent if you are using the Google Data Client libraries or move to a newer version of the client API that supports SSL. If not, you will need to scan your code for all usages of “http:” and replace them with the http(s) scheme.

Another related post worth reading from Google is Best Practices for User Authentication to ensure that you understand the options available for authenticating any Google user account. This is important so that you understand the 3 forms of authentication available to all Google APIs and the impact that it could have if you are doing programmatic account access in your application that uses the Google APIs.

Going the SSL route has its plus points for sure. But a good question to ask is that if SSL is widely acknowledged as the solution to a lot of data security then why are we all not on SSL yet? Scott Gilberson at wired.com covers a balancing viewpoint in his aptly titled piece HTTPS is more secure, so why isn’t the Web using it?

ASP.NET COUNTDOWN TIMER . .


Paste the following code in header  . .

<div id=”timelabel”></div>

<script type=”text/javascript”>

var leave = <%=seconds %>;
CounterTimer();

var interv=setInterval(CounterTimer,1000);
function CounterTimer()

{

var day = Math.floor(leave / ( 60 * 60 * 24))

var hour = Math.floor(leave / 3600) – (day * 24)

var minute = Math.floor(leave / 60) – (day * 24 *60) – (hour * 60)

var second = Math.floor(leave) – (day * 24 *60*60) – (hour * 60 * 60) – (minute*60)
hour=hour<10 ? “0″ + hour : hour;

minute=minute<10 ? “0″ + minute : minute;

second=second<10 ? “0″ + second : second;
var remain=day + ” days   “+hour + “:”+minute+”:”+second;

leave=leave-1;
document.getElementById(“timelabel”).innerText=remain;
}

</script>

</body>

</html>

————————

Code Behind . . .

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.IO;
namespace tests{
public partial class _Default : System.Web.UI.Page

{

public double seconds;

protected void Page_Load(object sender, EventArgs e)

{

seconds = (GetEndTime() – GetStartTime()).TotalSeconds;

}

private DateTime GetStartTime()

{            return DateTime.Now;        }

private DateTime GetEndTime()        {            return new DateTime(2011, 8, 23, 8, 10, 0);        }

}

}

Thank you . .


Boy oh boy! This is one tablet that I am dying to try my hands on, especially after the entire buzz it created at the Consumer Electronics Show, Las Vegas. From the title of the post you might have already guessed that I am talking about Motorola Xoom.The online retailer Infibeam has mentioned that it is releasing the tablet on May 10, 2011 at a pre-order price of Rs. 35000.

As the market continues to get inundated with all new range of tablets, the launch of any new tablet has now become a routine affair. But there is something special about Motorola Xoom that makes its release worth a wait. Touted as the most worthy competitor to Apple IPad (and IPad2), Xoom happens to be Google’s inaugural Honeycomb tablet- and the device that the Honeycomb team actually used to test the software. In that manner, Xoom imbibes in itself the true essence of Android Honeycomb platform, the platform that is specifically designed for tablets.

The specifications look equally impressive. Powered by a dual-core 1GHz Nvidia Tegra SoC processor and 1GB DDR2 RAM, the 10.1-inch (display) tablet clear beats the first generation IPads in certain respects. The device also houses a 2 megapixel front facing camera, a 5 megapixel camera at back panel with 720p HD video record feature, Wi-Fi, gyroscope, accelerometer, barometer and an e-Compass. The battery is powerful enough to support 10 hours of video (and up to 75 hours of music) and the company has also promised a software update that will enable Flash support for the device, something that misses from the entire IPad series.

The Big question: should you buy it?

Motorola Xoom, no doubt is an exciting device. Having said that, there are some points that you should keep in mind before actually buying it.

1) The IPad2 factor: Remember, Motorola Xoom was conceptualized before Apple IPad2 was announced. Xoom, as I mentioned earlier, beats the first generation IPad in certain aspects but not the new IPad2, the one with modified looks, refurbished features and a more powerful processor. However, the availability of IPad2 in India is still not clear and there has been no official word on it so far. So if you don’t want to wait too long, Xoom is the way to go.

2) The price factor: Xoom is available at a price of Rs. 35000. We are expecting 2011 to be the year of tablets and that could mean a flurry of lower-priced alternative, but equally good tablets in the market. So the question is whether you are willing to wait for an unknown amount of time so as to save few hundred bucks. Anyhow, it’s more of a personal judgment.

3) The Android Honeycomb factor: Motorola Xoom was launched in the US markets on 24 Feb 2011 with a very high expectation. But the expectations were not fully met and the sales were weak despite the initial buzz amongst the users. And quite contrary to the expectations, some analysts announced Android 3.0 Honeycomb to be the weakest link. According to them, Honeycomb is “extremely complicated and confusing” and not suitable for mass adoption. The reviews might seem to be little extreme but it is enough to create some doubt in the mind of a potential buyer.

Anyway, I think that it is always better to get the feel of the device first before actually buying it and since the device will now be available in India, you might get a chance to explore it.

So what do you think about the prospects of Motorola Xoom in India? What strategy are you going to adopt- buy it immediately or stick to wait-and-see approach? Both ways, do let us know your reviews in the comments.

DateTime Formats . . (.NET)


DateTime.Now; 3/14/2011 12:45:24 AM
DateTime.Now.ToString(); 3/14/2011 12:45:24 AM
DateTime.Now.ToShortTimeString() 12:45 AM
DateTime.Now.ToShortDateString() 3/14/2011
DateTime.Now.ToLongTimeString() 12:45:24 AM
DateTime.Now.ToLongDateString() Monday, March 14, 2011

DateTime.Now.ToString(“d”) 3/14/2011
DateTime.Now.ToString(“D”) Monday, March 14, 2011
DateTime.Now.ToString(“f”) Monday, March 14, 2011 12:45 AM
DateTime.Now.ToString(“F”) Monday, March 14, 2011 12:45:24 AM
DateTime.Now.ToString(“g”) 3/14/2011 12:45 AM
DateTime.Now.ToString(“G”) 3/14/2011 12:45:24 AM
DateTime.Now.ToString(“m”) March 14
DateTime.Now.ToString(“r”) Mon, 14 Mar 2011 00:45:24 GMT
DateTime.Now.ToString(“s”) 2011-03-14T00:45:24
DateTime.Now.ToString(“t”) 12:45 AM
DateTime.Now.ToString(“T”) 12:45:24 AM
DateTime.Now.ToString(“u”) 2011-03-14 00:45:24Z
DateTime.Now.ToString(“U”) Monday, March 14, 2011 5:45:24 AM
DateTime.Now.ToString(“y”) March, 2011
DateTime.Now.ToString(“dddd, MMMM dd yyyy”) Monday, March 14 2011
DateTime.Now.ToString(“ddd, MMM d “‘”yy”) Mon, Mar 14 ’11
DateTime.Now.ToString(“dddd, MMMM dd”) Monday, March 14
DateTime.Now.ToString(“M/yy”) 3/11
DateTime.Now.ToString(“dd-MM-yy”) 14-03-11

Thank you . .


You might have seen floating content of web sites which is always visible on the page even if you scroll it. This is easy achieve thing by using just CSS. However there is also JavaScript alternative for this but the CSS one is smoother and faster as this doesn’t includes any run time calculation. The below step by step process will guide to how to add a always visible div on web page.

<style type=”text/css”>

<!–.visibleDiv

{    position: fixed;}

//–>

</style>
<style type=”text/css”>

<!–/*For top left*/

.visibleDiv

{    top: 10px;    left: 10px;}
/*For top right*/

.visibleDiv{    top: 10px;    right: 10px;}
/*For bottom left*/

.visibleDiv{    left: 10px;    bottom: 10px;}
/*For bottom right*/

.visibleDiv

{    bottom: 10px;

right: 10px;

}

//–>

</style>

 

Thank you . .


1. The only things that you can pass between web sites are string values.

2. The other web site has to give you the names of the values that they will accept.

3. This passes values to PayPal.
1. Add each hidden variable needed as follows:

<input type=”hidden” id=”OrderID” runat=”server”>
2. The button that will submit values to the external site:

<input type=”button” onclick=”javascript: submitToPayPal(‘http://www.paypal.com/cgi-bin/webscr’);” value=”Submit to PayPal” >
3. Add the necessary JavaScript to the page:

<script type=”text/javascript”><!–function submitToPayPal(formAction){ var formElementsArray = document.getElementsByTagName(‘FORM’);   if ( formElementsArray != null )  {   var formElement = formElementsArray[0];
document.getElementById(‘__EVENTTARGET’).value = ‘ ‘;  document.getElementById(‘__EVENTARGUMENT’).value = ‘ ‘;  document.getElementById(‘__VIEWSTATE’).name = ‘NOVIEWSTATE’;
formElement.action = formAction;  formElement.submit();  }}// –>

 

</script>

Warm regards. .

Sameer

 

%d bloggers like this: