Pages

Search Code Shode

Monday, October 31, 2011

How Many DAYS Old Are You?



It always been fun playing with numbers. And when these numbers are about your birth date, it becomes even more interesting. So I thought to write a post about having fun with your birth date.

Have you ever wondered, how many days old are you? When you will be 10,000 days old? or when will be your 11111st day on earth?

Now it become easier, put your birthday in the textbox and desired day in the other, you will know the details as you want.

Have fun!



Enter date of birth in format mm/dd/yyyy: 
You are days old today.
You will be days old on
                         Enter number                           


Wednesday, September 7, 2011

Panasonic Shows Off 3D Lumix Camera Prototype

Panasonic showed this prototype compact Lumix camera for shooting 3D photos and videos. The zoom lens runs from the equivalent of 25-100mm, with an aperture range of f3.9 to f5.7.
(Credit: Stephen Shankland/CNET)



BERLIN--Panasonic has offered high-end 3D videocameras as part of its effort to advance the premium technology, but now it's begun showing off a prototype for a 3D model from its Lumix line of still cameras.


"We are also developing a 3D compact camera for this winter," Takuya Sugita, vice president of Panasonic's AVC Networks Company, said here this week at a press conference at the IFA electronics show, which officially starts today. The company showed two prototypes under glass at the show.

The company has offered a couple tidbits about the coming 3D Lumix camera: it will have twin 4X zoom lenses with folding optics and optical image stabilization for both video and still images. It also will offer "simultaneous photo and video," Panasonic said.

The prototypes show a bit more, though not much in the way of surprises--check the 3D Lumix prototype slideshow for some detailed views. The zoom lens runs from the equivalent of 25-100mm, with an aperture range of f3.9 to f5.7.

On one side is an HDMI output, and on the top are stereo microphones. It also features a built-in flash and a red button for recording video. Underneath is a tripod mount and a slot for a battery and SDXC card.

It will apparently record video in AVCHD, Panasonic's favorite encoding technology also known by the name H.264. Presumably it will use the new 3D version of the technology.

The entire consumer electronics industry is moving to 3D technology, chiefly with TVs. The technology can offer a more immersive experience--and gives companies something new to sell now that the transition from CRTs to flat-panel TVs is no longer such a strong market.

Panasonic is among the companies that hope people will create 3D content as well. 3D cameras and videocameras also offer an opportunity to sell premium products that might have a better chance of standing out above the crowd.

Tuesday, September 6, 2011

Is mind control the future for TeleVisions?



China-based Haier is showcasing an interesting mind control technology for TVs at the ongoing IFA trade show in Berlin. The Brain Wave resembles a headset, with an extension placed peculiarly on the user's forehead to control a TV's volume and change channels with thoughts alone. The firm demonstrated its prototype with a game that involves blowing up barrels with your mind. Even if Haier gets the system to market for TVs, we're betting it won't be easy to convince most consumers to don the bulky headset in its present form.

Having said that, we would love to see the Brain Wave miniaturized and made more comfortable, or possibly integrated into regular 3D glasses. Until then, there are other, less intrusive alternatives to remote controls ranging from voice recognition to hand gestures.

(Source: Crave Asia via Engadget)

Canesta brings gesture control to TVs and more


The below video shows Canesta's new 3D gesture control system, which it's hoping to sell soon with help from Hitachi and GestureTek. The idea is to build the sensors into media devices such as game consoles or Apple TV-like gear to give your remote control a rest.

It's a pretty cool idea, and according to the accompanying press release, it should be a low-cost product. We're not sure when--if ever--this will make its way into living rooms, but the know-how is there. If this Canesta video and Microsoft's E3 announcements prove anything it's that the technology is ready, too.


Thursday, September 1, 2011

Add Copy to Clipboard Button using Javascript


<html>
<head>
</head>
<body>
    <textarea id='clipText'>
Enter Text And Click Button To Copy Text To ClipBoard</textarea><br />
    <input type="button" id='bt' onclick="clipboardData.setData('Text',document.getElementById('clipText').value);"
        value="Copy" />
    <input type="button" onclick="clipboardData.clearData('Text');" value="Clear" />
    <input type="button" onclick="alert(clipboardData.getData('Text'));" value="Paste" />
</body>

Tuesday, August 23, 2011

Enable/Disable DropDownList through Checkbox using jQuery - ASP.NET


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkEnable").click(function () {
                if (this.checked)
                    $('#ddlList').attr('disabled', 'disabled');
                else
                    $('#ddlList').removeAttr('disabled');
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:CheckBox ID="chkEnable" runat="server" Text="Enable/Disable" /><br />
        <asp:DropDownList ID="ddlList" runat="server">
            <asp:ListItem Text="Select" Value="-1" />
            <asp:ListItem Text="Option1" Value="1" />
            <asp:ListItem Text="Option2" Value="2" />
            <asp:ListItem Text="Option3" Value="3" />
        </asp:DropDownList>
    </div>
    </form>
</body>
</html>

Friday, August 19, 2011

Dual OS Tablet : Windows and Android ViewPad 10Pro Tablet


Here finally is a tablet that can rid you of all the grouse that you may have had so far of tablet PCs running Window. That too without having to give up on Android. Welcome the new ViewPad 10Pro from ViewSonic that dual boots both Android and Windows. The 10 inch tablet with an Intel Atom Oak Trail processor was being showcased by ViewSonic since early this year and now it seems its finally ready to hit the streets.

One of the biggest pluses with the ViewPad 10Pro is its battery life that has gained a degree of respectability, which in turn can be attributed to the use of Intel Z670 Atom processor based on the Oak Trail platform with a clock speed of 1.5 GHz. Run-time is touted to be in the range of 8 hours on a single charge which is a couple of hours more than what Wintel tablets are generally known for.

Another big advantage of the ViewPad 10Pro is its ability to run both Android and Windows application.  Also, even though the tablet runs both the Windows and Android operating systems, yet the device is not a dual boot one in the truest sense since you won’t be required to reboot in order to switch between the two OSs. Instead, a tap on an icon is all that is needed to switch between the two. This since the base operating system is Windows with Android running over it as a virtualized layer over Windows. ViewSonic attributes this feature to the use of a software named BlueStacks.

As for its specs, the ViewPad 10Pro comes with a 1024 X 600 pixel 10.1 inch screen based on capacitive multitouch technology. The tablet includes a 2 GB RAM and can support up to 32 GB of max storage capacity. For output the tablet has HDMI out port and it can playback 1080p HD video. It also has support for 802.11b/g/n Wi-Fi and Bluetooth.

There are two version of the tablet — one which runs Windows 7 Home Premium and Android 2.3 and is priced at $599, while the other at $699 has a 32 GB SSD running Windows 7 Professional along with Android 2.3 Gingerbread.
However, the tablet still runs the risk of skitling out of public memory soon as the world has moved on since the tablet was first announced. Its Windows 8 that we are looking forward to and the new Windows version is making all the right noises so far. Android too has made steady progress so that its the tablet optimized Honeycomb version that is doing the rounds now and its Ice Cream Sandwich that is next in the pipeline. But who knows, the tablet might be upgradeable to both the new versions of Android and Windows.


Tuesday, August 16, 2011

Few Expectations from Windows 8



I hope Microsoft does more than give a pretty facelift to match its smartphone OS. Among the things that have unnecessarily bedeviled PC users since the days of '95 we may count:

- Plug & Play that doesn't. Few experiences are as frustrating as finding your new hardware isn't recognized properly by the system. If 8 can standardize minimum-spec code built in at the OS level to recognize the most commonly seen devices maybe we can finally kiss goodbye all those memories of unrecognized peripherals ruining your day.

- Thin is in. As slick as Win 7 is each new build brings with it unnecessary baggage. The inclusion of ancient bundled apps like Paint is, simply put, an embarrassment. In an age when a modern linux distro can fit on a modest USB Windows is straining to fit onto DVDs. Make the next OS boot up in ten seconds flat and load secondary system files later as needed.

- Easy networking and sharing. If I, a guy who's been in IT now for two decades, still get mortified when trying to interconnect computers how does that bode for grandma? Why is it that sharing my C drive is cloaked in umpteen security layers and then still cross-your-fingers and hope that it'll be useable on the other side?

- Why does Windows expect me to do things its way? Every time I want to download a file it insists, despite thousands of repeated redirections to my desktop, to stick it in some nested document folder I never use. Why is it that my desktop icons so often switch places for no good reason? A 21st OS should adapt from my patterns of usage.

- Stop being so greedy. Having a half dozen version of the same OS leads to confusion and ill-will. If you have to have multiple versions at all separate from consumer and server versions. That's it.

- Go cloud. The MS business model is too tied to physical media and pay-per-license. I ditched Outlook years ago for Gmail because there was no such thing as an online version of it. Google docs, free for all, is tempting me to ditch Office for the same reason. How about an online backup service built into the OS so I don't have to rely on a 3rd party? This is an essential mission of any OS.

- Innovation. I struggle to think of a single truly breakthrough Microsoft invention. Ok I take that back, let's give props for the Kinect. But in terms of OS for me to be wowed by Win 8 it has to have more substance than a gussied up GUI. I want to have a truly novel way of locating and organizing my files. I want to do what I want to do with speed and with the OS being invisible until I need it. I want more resiliency, not just stability, so that things don't stop working seemingly for the hell of it and, likewise, less dread thinking of what will go wrong when I plug in a new widget or install a new app. It'll be magic the day the whole thing just works without a too-long wait or too many nag screens or some other if and or but.

Remember MS, Windows is an OPERATING SYSTEM. It should perform three core functions: connect the machine with its various parts and peripherals, provide a platform for software and file management. The company should concentrate on optimizing that core experience and recognize that the bundled apps are at best gravy and at worst bloatware that gets in the way.


Thursday, July 28, 2011

Split CSV String into Table in SQL Server


We all have some time bogged down into such situations where we require to update table from Comma/Character Separated Values.

By default there is no function in SQL Server that can split comma separated string into Table (Rows). Following T-SQL is custom made function that can split CSV string into table.

Here is the function that will return table when passed CSV:

CREATE FUNCTION dbo.SplitCSV (@CSVString VARCHAR(8000), @Delimiter CHAR(1))
RETURNS @temptable TABLE (items VARCHAR(8000))
AS
BEGIN
      DECLARE @pos INT;
      DECLARE @slice VARCHAR(8000);

      SELECT @pos = 1;
      IF LEN(@CSVString) < 1 OR @CSVString IS NULL RETURN;

      WHILE @pos!= 0
      BEGIN
            SET @pos = CHARINDEX(@Delimiter,@CSVString);
            IF @pos != 0
                  SET @slice = LEFT(@CSVString, @pos - 1);
            ELSE
                  SET @slice = @CSVString;

            IF( LEN(@slice) > 0)
                  INSERT INTO @temptable(Items) VALUES (@slice);

            SET @CSVString = RIGHT(@CSVString, LEN(@CSVString) - @pos);
            IF LEN(@CSVString) = 0 BREAK;
      END
      RETURN
END
Usage:

SELECT * FROM dbo.SplitCSV ('Computer,Keyboard,Mouse,USB', ',');



Hope it helps!

What Do You Love from Google - Insight


Google has launched a new, mysterious service called What Do You Love. It’s a simple search box, similar to the one on Google’s homepage, but it returns results from more than 20 different Google services, including Google Translate, Trends, YouTube, Maps and Groups.
The results are presented in little boxes that can, in some cases, be expanded by clicking on the icon in the lower right corner. If you need even more results, you can always click the button in the upper right corner of the box and go directly to the chosen service.
The concept reminds us of iGoogle, a service that lets you add simple apps to your own personalized portal. What Do You Love, however, instantly creates a mini-portal about any term you choose, which makes it a nice option for users who don’t have the time to tinker with options and simply want to have access to Google’s many services on one page.
The service, located on the address www.wdyl.com and google.com/whatdoyoulove, bears Google’s copyright mark but very little explanation, and it hasn’t so far been announced on any of Google’s official blogs.

Tuesday, July 26, 2011

How to Email a Web Page As HTML in ASP.NET using C# VB.NET

This post explains How to Email a Web Page As HTML From Your Site or in fact any web page you want (though i would not recommend any with lots of scripts etc in it). It is very useful for email forms to customers etc from your site.

Personally I create an plainer version of the form just for email. I remove any menu functions and other things that are there as part of the website and are not useful in the email - but that is a personal preference.


I have already written a couple of posts regarding How to Send Email in ASP.NET. You can check them here:


Saturday, July 23, 2011

Format Source Code for Blogging Tool





So today here I am, coming up with a Source Code Formatting Tool for Blogging. Previously
I had a post regarding How To Format My Source Code for Blogging? which explained
the use of SyntaxHighlighter to format your source code for blogging. But now I feel it kinda slow down the blog to load a post. So I decided to create a tool that will provide me with Formatted HTML Code of my Source Code to post in a blog. There will be a series of such tools e.g.

  • Format HTML Source Code for Blogging
  • Format XML Source Code for Blogging
  • Format ASPX Source Code for Blogging
  • Format Javascript Source Code for Blogging
  • Format SQL Source Code for Blogging
  • Format C# Source Code for Blogging
  • Format VB.NET Source Code for Blogging
  • Format CSS Source Code for Blogging

and much more. Right now, I have this tool, which will format your HTML/XML/ASPX
source sode for blogging. What you need to do is Paste your Source Code in the given
Text Area and your formatted source code will be provided in the other Text Area.
Just copy it and paste it in your blog post or where ever you want.

Friday, July 22, 2011

SQL Database Generate Password Function

Most of you might have come across need for creating a random password for the users. I prefer using passwords that are generated completely random, containing a-zA-Z0-9 and some special characters, making them tough to guess. However, thinking from the user's perspective those passwords are really hard to remember. So, if you want to leverage complexity of the passwords for making them easy to remember then here is what I have used.

The key concept behind my algorithm is, a set of letters (like Basheer) forming a meaningful name is easy to remember than a set of letters (like 6ZuK3s) that makes no sense. I compiled a table with Given Names pulled from sparkleware. To generate a random password, I pick a random given name and pull out only first 6 characters from it. Then I create a random set of special characters and set of random hex digits from NewID, UUID/GUID. The random given-name part, special chars part, hex digits part all together frame a random password. This is makes password not only easy to remember, compared to completely randomized text, but also somewhat tough to predict them as well.

Please note that this technique might generate passwords that can be predicted using dictionary attack, if considerable precautions were not taken. If your application’s password needs to highly secure then, I suggest you follow completely randomized text generation as detailed in here,


ALTER FUNCTION dbo.udf_generate_password(@newid VARCHAR(50), @rand REAL) RETURNS VARCHAR(100)
AS
BEGIN
--****************************************************
--   FUNCTION: DBO.UDF_GENERATE_PASSWOR
--   AUTHOR: SHYAM K. ARJARAPU
--   PARAMETER: @NEWID = NEWID() A UUID/GUID/NEWGUID
--      @RAND = RAND()
--   REASON: STUPID SQL SERVER DOES NOT ALLOW NON-
--      DETERMINISTIC FUNCTIONS RAND(), GETDATE(), NEWID()
--      INSIDE THE FUNCTIONS.
--  DESCRIPTION: THOUGH RANDOM PASSWORDS ARE SECURE, THEY
--     ARE HARD TO REMEMBER. USERS CAN EASILY REMEMBER
--     GROUP OF LETTERS FORMING A WORD. THE TABLE
--     DBO.TB_PASSWORD_DICTIONARY CONTAINS SET OF FIRST NAMES
--     FROM WHICH A RANDOM NAME IS SELECTED AND A SPECIAL
--     CHARACTER WITH RANDOM STRING IS APPENDED TO MAKE THE
--     PASSWORD NOT ONLY SECURE BUT ALSO ITS EASY TO REMEMBER
--  USAGE:
--     SELECT dbo.udf_generate_password(NEWID(), RAND())
--*****************************************************
 DECLARE @randPassword VARCHAR(100)
 DECLARE @randNewID VARCHAR(10)
 DECLARE @randFirstName VARCHAR(6)
 DECLARE @randSpecialChar VARCHAR(2)
 DECLARE @maxID INT
 DECLARE @CONST_FN_LEN TINYINT
 DECLARE @CONST_NID_LEN TINYINT
 DECLARE @CONST_SPL_LEN TINYINT
 DECLARE @CONST_SPL_CHARS VARCHAR(15)

 --DEFINE THE REQUIRED LENGTHS &amp; SPECIAL CHARS
 SET @CONST_FN_LEN = 6
 SET @CONST_NID_LEN = 4
 SET @CONST_SPL_LEN = 2
 SET @CONST_SPL_CHARS = '@#$^*;,._!'

 --FRAME THE RANDOM TEXT PART
 SELECT @randNewID = LEFT(@newid, @CONST_NID_LEN)

 SELECT @maxID = MAX([KEY_ID])
   FROM dbo.tb_password_dictionary -- Contains KEY_ID Identity(1,1), [Value] Varchar. All the given-names goes here

 --FRAME RANDOM FIRST NAME PART
 SELECT @randFirstName = LEFT([VALUE], @CONST_FN_LEN)
   FROM dbo.tb_password_dictionary
  WHERE [KEY_ID] = CONVERT(INT, @rand *@maxID) + 1

 SET @randSpecialChar = ''

 --FRAME THE SPECIAL CHARTS PART
 WHILE( @CONST_SPL_LEN &lt;&gt; 0)
 BEGIN
  SET @randSpecialChar = @randSpecialChar +
   SUBSTRING(@CONST_SPL_CHARS, CONVERT(INT, @rand * LEN(@CONST_SPL_CHARS)) + 1, 1)
  SET @rand = @rand * @rand
  SET @CONST_SPL_LEN = @CONST_SPL_LEN - 1
 END

 --FRAME THE PASSWORD ALTOGETHER
 SET @randPassword = @randFirstName + @randSpecialChar + @randNewID
 RETURN @randPassword
END


Courtesy: Shyam K. Arjarapu

اشتہارات