Tuesday, December 1, 2009

How do you change DOS windows' command prompt in Windows 7?

Get help file:

C:\Users\Jay>prompt /?


Changes the cmd.exe command prompt.

PROMPT [text]
text Specifies a new command prompt.
Prompt can be made up of normal characters and the following special codes:
$A & (Ampersand)
$B (pipe)
$C ( (Left parenthesis)
$D Current date
$E Escape code (ASCII code 27)
$F ) (Right parenthesis)
$G > (greater-than sign)
$H Backspace (erases previous character)
$L < (less-than sign)
$N Current drive
$P Current drive and path
$Q = (equal sign)
$S (space)
$T Current time
$V Windows version number
$_ Carriage return and linefeed
$$ $ (dollar sign)



If Command Extensions are enabled the PROMPT command supports the following additional formatting characters:
$+ zero or more plus sign (+) characters depending upon the depth of the PUSHD directory stack, one character for each level pushed.

$M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network

Example: Changing from "C:\" to "%"
-------------------------------------

C:\Users\Jay>prompt %--->Changes to %
%
%Prompt C:\ ------------->Changes back to C:\
C:\
C:\

Thursday, November 26, 2009

How do I connect to a SQL Server Compact Database from SQL Server 2008 R2 Nov_CTP?

The database is present in the installation directory but you need to enable permissions.

Click Connect SQL Server Compact... in MS SQL Server Management Studio.

















In the Connect to Server window click on the drop-down handle as shown.













Click on the drop-down item "Browse for more...". Expand the C:\node as shown














Click OK. The Connect to Server gets updated.
You may not be able to connect to the database as permissions are needed.






You can modify the permissions on the sample database. The database gets dispalyed in the Management Studio after you click OK on the Connect to Server window after modifying the premissions.

Wednesday, October 21, 2009

What is the difference between Title and WindowTitle properties in a Xaml Browser application?


In a Xaml browser application (XBAP) as a page's properties you can set a TITLE as well as a WindowTitle property.
----------------------------------------
The Page.Title property is defined as in the following:
----------------------------------------------------------------
public string Title { set; get; }
    Member of System.Windows.Controls.Page

Summary:
Gets or sets the title of the System.Windows.Controls.Page. This is a dependency property.

Returns:
The title of the System.Windows.Controls.Page.

---------------------------------------------
Whereas the WindowTitle is defined as in the following:
-------------------------------------------
public string WindowTitle { set; get; }
 Member of System.Windows.Controls.Page

Summary:
Gets or sets the title of the host System.Windows.Window or System.Windows.Navigation.NavigationWindow of a System.Windows.Controls.Page.

Returns:
The title of a window that directly hosts the System.Windows.Controls.Page.
==================
What is observed when you bring up  this page shown here is
-----------

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Title="Pagex"
      Background="Azure"
      WindowTitle="What is this?"
      >
  
Hello, XAML Browser App

-----------------------
displayed here.














As you can see Title property is not displayed where as the Window that gets displayed, the browser window shows this title. If you remove the WindowTitle property what is displayed is shown here,


Monday, July 27, 2009

What is MD5?

OK. I will share my notes on MD5.



  • MD5  is a 128 bit message digest algoritm. 
  • RF1321 describes the MD5
  • MD4 and MD5 are replacements for legacy programs that checked transmission errors of digital data such as CRC.
  • MD5 supercedes MD4 and happens to be more secure albeit somewhat slower.  This was deliberate to make the code more secure. 
  • MD5 is available for both Windows and UNIX platforms.
  • You can download MD5 from http://www.fourmilab.ch/md5/
  • In windows you can just click md5.exe from its download location to install


After downloading I verified the version and usage using the following:











I verified one of the items from the test suite. For testing the program I created a
text file in Notepad with just these two words "message digest" and used it as the input file. Here follows the
result (matches the one in suggested suite).


C:\Documents and Settings\Jayaram Krishnaswamy\Desktop\HodentekHelp>MD5 "C:\Md5test.txt"
F96B697D7CB7938D525A2F31AAF161D0  C:\Md5test.txt

Thursday, June 18, 2009

How do I create a simple table in a database on SQL Server 2008 and populate it?

Let us say you want to create a table such as the one shown in this example (PrincetonTemp2) and populate it with some values. There is more than one way to create a table in SQL Server 2008.This one uses Create Table query to create a table. You then edit the table to insert the values. Values can also be inserted using code. In here, the query creates the table and you then manually insert the data.

Step 1: Create table using the query
In SQL Server 2008 right click the database in which you want to create a table and choose New Query






Type in the Query window as shown in the next figure. Check the syntax of the query by clicking the icon at the far right of the figure. Execute the query by clicking the (!)Execute.








You will have created a table called PrincetonTemp2. You can see it in the Tables node after you refresh the database by right clicking the database node and choosing Refresh from the list.

Step 2: Populate the table by editing the table :
Right click the table in the Management Studio after expanding the database node.










From the drop-down click on Edit Top 200 Rows.
In the table that shows up fill in the data you want to insert. The data has to match the query you used to create the table. One line inserted is shown in the next figure.


Friday, May 15, 2009

What is Caret Browsing?

It is the new accessibility feature in IE 8.0. You can use less of the mouse and more of the keyboard to select portions of content in IE 8.0.

It is not turned on by default, but you may turn it on by pressing the key F7 when your cursor is placed on a web page opened in IE 8.0.

The first time you click F7 while you are on web page you will see the following message.


You can read more about it by clicking on the hyperlink in the message.









Here is a demo.

Caret Browsing turned off (default)
Click any where on a web page opened in IE8.0 and then try to use your Shift and the navigation keys (right,left, top, down) to highlight content. You will not be able to select text.

Caret Browsing turned  on
Click anywhere on the web page. Hit F7. Enable the Caret browsing.  Now with the Shift and navigation keys (right,left, top, down) you can select content just like you were able to do with your mouse.

The only problem is IE 8.0 is very slow!!

Wednesday, April 29, 2009

Can you chain remote desktop connections?

Yes you can.



You can link up multiple machines. Of course you will be using only one computer.

I have computer XPHTEK which I can access from my computer Hodentek.

I have a Laptop with WIFI wireless connected to the above two computers. I can access Hodentek as a remote connection from my laptop HODENTEK2 and from within the remote connection I can remote access XPHTEK. I have some word processing in a language other than English in each of these computers but I can work on them in my laptop and print it out to a shared printer on HODENTEK.

Wednesday, April 15, 2009

I installed MySQL, how do I know what version I have and how to start and stop it?

If you installed MySQL it is probably in the directory where it is installed. For example, I recently installed XMAPP which brings in a bundle of stuff like Apache, MySQL, PHP etc. In this case, it was installed in the Xampp directory in the C drive.

You have to see if you have an executable program called mysql.exe among many other executbles and confi files.

If you have mysql.exe you should try to connect to it as in the following
snippet:

C:\xampp\mysql\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.30-community MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Try the help and get everything you need

The control should now go over from C:\ to mysql>

The first thing to do is to verify the version you have on your computer.

For this, do this, do not forget the semi-colon:

mysql> Select version(),Current_Date;
+------------------+--------------+
| version()        | Current_Date |
+------------------+--------------+
| 5.1.30-community | 2009-04-13   |
+------------------+--------------+
1 row in set (0.05 sec)

I assume you have no start and stop shortcuts for the server. If you do have you can start and stop from the shortcuts or when you have a window with start and stop buttons for the server.

Thursday, April 9, 2009

What are 'breadcrumb' links?

This is a navigational aid in web pages. In Figure 1, I have gotten to the last page on a shopping site and the highlighted region is where you find the 'breadcrumbs'. One step back (which you can reach by clicking on that particular crumb[Brand:Acer Comuter]) will bring you back to the page pointing to that crumb, Figure 2.

Figure 1






Figure 2








Tuesday, March 24, 2009

How can I change the color of the DOS screen?

I am bored of the black color, how can I change it?

It's rather easy. You can configure the DOS window and change some of the things around. Color for one is easy to change.

Open a DOS Window from Start | Run

Right click the top of  DOS window inside the title bar. From the drop-down click on Defaults. This opens the following window.





















Now click on the Colors tab in the above window. I have changed both the Screen Background as well as the Screen Text. You can immediately see the changes you are making.


















The next time you open the DOS window you will see the changes provided you clicked OK to the above screen after the changes.

Sunday, March 1, 2009

What is Upsert?

Upsert provides the following SQL functionality:

If something does not exist in a table then insert it. If it exists then update it.

This is something like what happens when you move a file to a folder, if the file exists it will ask you whether you want to replace it with a new version or not. If the file does not exist it is inserted, no questions asked.

This is implemented by MERGE in SQL Server 2008

Tuesday, February 17, 2009

What is JSON?

 JSON stands for Javascript Object Notation. It is a special object notational construct and is a subset of JavaScript. It can be used wherever JavaScript can be used and you do not need to download anything. There is no need to worry about the version of JavaScript, It works with all JavaScript versions.



RFC 4627 describes all aspects of JSON. JSON was designed to be brief (small), textual, and portable. The MIME Media Type is now registered as application/json. JSON can handle exchanging data in applications written in different programming languages such as C, C#, ColdFusion, Perl, Python, Ruby, and so forth.



On getting JSON data from SQL Server read this interesting artilce by William Brewer.

How do I display the currency rates of four countries on my site?

First of all you need to get hold of a web service that provides this information daily.

Then you need to write a client application to access the service.
You can do write the client application in Java, .NET, VB etc.

Monday, February 9, 2009

How can I turn folder pictures into a slide show?

I have many folders with pictures and only in some of them I can show pictures in a slide show( in Windows XP), how can I turn folder pictures into a slide show?




There is a default behavior that you can turn on for all folders. However for a single folder, the best way is to access the folder properties by right clicking the folder.
This opens the Properties window as shown. In here the folder name is SQLDeveloper. Presently I cannot bring up the slide show.




















Click on the Customize tab of this window. Then click on the drop-down handle as shown and choose Picture Album.



















Now when you open the folder you have Picture Tasks navigation on the left where you find the "View as a slide show".
















Now you are ready to show off.

Monday, January 19, 2009

How do I copy the text from a DOS screen?

You need to highlight the text in DOS screen, copy the text and paste it
into Notepad or Word.
Let us say you want to copy the text on this screen.












Step 1: Highlight the text as follows:
Right click anywhere on the title (blue strip at the top) and from the drop-down
menu choose Edit | Mark.












Step 2: Highlight the text now.
Mark the text by sweeping your mouse (held down) over the text you want to
mark as shown.












Step3: Go back to the title, right click and choose Edit| Copy. This copies the text
and now open Notepad from Start | Accessories |Notepad. With the Notepad open click on
Edit | Paste. The copied text is now pasted to the open Notepad as shown.






Thursday, January 15, 2009

What are Smart Tasks?

This is yet another design aid from Microsfot to make life easier for the
developer and to increase his/her productivity. There are property windows and Property pages for customizing the controls at design time. Smart Tasks makes it even easier by listing the tasks a designer has to configure for a given control  on a web page or a windows form.

Here is an example. This is a SQLDataSource control on a web page.







To see what tasks need to be completed for this control, click on the right  pointing arrow. This changes the control as shown in this figure. There is just one task- Configure Data Source...

When you click on Configure Data Source link the wizard wakes up and will take you through the process of the configuration.


How do I find the version of SQL Server I have?

Open SQL Server Management Studio and run the query shown.

The figure shows the query and query result for the SQL Server 2008
on my computer.

Monday, January 12, 2009

What is Dvorak style keyboard?

The ASDFGH or QWERTY board is the standard key board from the days of typewriters to this day. You are supposed to type with both hands to type fast. However the DVORAK style keyboard can be used for typing with one hand, either left or right or both. It is supposed to be faster than the QWERTY.

This is one of the accessibility options in Windows XP which you can access from
Control Panel | Regional Languages (window) | Languages to open




















Click on Details...to open




















Click on Add... to open Add Input Language window

















Place check mark for Keyboad layout/IME (Input Method Editor): and click on Handle


















Choose the style you prefer

You should be able to see this toolbar item added as shown






Review article in Wikipedia:
http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard

Thursday, January 8, 2009

How do I verify intellisense in SQL Server 2008?

It is quite easy. Assume you have a database and you are writing a query, a simple select satatement such as this one,

Select * from Customers in a sample Northwind database.

In earlier versions when you did not have intellisense you had to guess what you
need to do. Perhaps you looked up and verified what table to use, etc.

Now in SQL Server 2008 it is easy because "intellisense" shows what options you have. Intellisense is also called auto-completion.

I just typed Use and some letter(t) after a space and intellisense provided all the available databases that I can use. Even if you had typed z you would have gotten the list. This is great. Adds immensely to productivity.

















Here is another example,







The down side, from my point of view is that this drop-down can be huge and you may end up scrolling up and down reading the tool tips. Of course you must have a rough idea of what makes sense and what is meaningful.



Here is an auto-completion in the Google Search




Sunday, January 4, 2009

How do I set the fill color(background color) of a textbox in SQL Server Reporting Services?

You can use the built-in color picker of the Expression builder in Visual Studio.

For the text box that you have highlighted in the report, let us say you want to set the fill color. You invoke the expression builder from the Text Box's properties as shown






























Click on fx to open Expression window as shown






























Let us say you want to fill it with red. You pick the red color (3rd row, first column in pick color box)and click on it. The default color of a text box is Transparent which will be replaced by Red as shown.Click OK to close the Expression window which will take you back to the Text Box Properties window where you will see the RED in the Fill color: field.