Tech NovoGeek

...Technology Simplified

Monday, March 12, 2012

Remove the hyperlink from the whole document

No comments :

If you want to remove the hyperlink from the whole document then do this.

  • Select the entire document (CTRL+A or Edit->Select All).
  • Press CTRL+SHIFT+F9
This will change all hyper link to normal text.
Hope that helps.

Enter key considered as Button click in Classic asp

No comments :
Code to allow enter key to submit the page or to consider enter key as button click in Classic ASP
<input name="username"
onkeypress="if(event.keyCode == 13) this.form.btnSubmit.click()"/>

Friday, March 9, 2012

Remove vertical scrollbar in syntaxhighlighter

No comments :
An annoying bug in the new version of SyntaxHighlighter 3 shows vertical scrollbar on every code snippet.

To fix this, change the code under syntaxhighlighter/syntaxhighlighter3/styles/shCore.css and replace overflow: auto !important; with the code below:

.syntaxhighlighter
{...
overflow-x: auto !important;
overflow-y: hidden !important;
...
}

to:
.syntaxhighlighter {
...
overflow: hidden !important;
...
}

An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON.

No comments :

If you run into the following error message:
An explicit value for the identity column in table ‘<TABLE_NAME>’ can only be specified when a column list is used and IDENTITY_INSERT is ON.
It can mean two things.
One you’ve not enabled identity insert on your table, meaning SQL Server will not let you insert into the Identity column.
This can be rectified with the following statement:


SET IDENTITY_INSERT table_name ON

And then turn it off again when done
SET IDENTITY_INSERT table_name OFF
However it can also mean that you are using for example INSERT INTO, in which cause the message tells you to specify the column names. This means using the following syntax:

INSERT INTO target_table_name (column_name1, column_name2…. column_nameN)
SELECT YOUR_SELECT_LIST_WHICH_MATCHES_COLUMN_LIST
FROM source_table_name

Thursday, March 8, 2012

Adding a new primary key column

No comments :
In SQL SERVER, I'm working with a table, I want to write something that will create an ID column if it doesn't exist and populate it with the next highest ID.
Query ::

IF NOT EXISTS
(
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'SampleProduct'
AND COLUMN_NAME = 'SampleProductId'
)
BEGIN
ALTER TABLE SampleProduct
ADD SampleProductId INT IDENTITY(1,1) NOT NULL
END


This will assign identity values for all existing rows, and then provide new numbers as new rows are inserted.

Wednesday, March 7, 2012

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

No comments :

While I was hosting ASP website in iis7 I got the following error message. These are the steps I followed to solve the error

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

You just open control panel as shown below:

clip_image002
In the control panel you open “Turn windows features on or off” section as below:

clip_image003

Just refresh the page after finishing the above steps.

Can I replace space with Enter Key in Notepad

No comments :

In Notepad, can i use the "replace" feature to place a new line / carriage return in a document?

Many of us must have come across such situation
Can i use the replace feature in notepad to replace some character(in this case 4 spaces) with enter key / carriage return character?

You can't do it in Notepad, but very much easily in Word.

1. Select: Edit/Find then go to the Replace tab. On that screen, you may have to press the button that says "More"

2. Click onto the Find What field, then click the "Special" Button at the bottom of the Window. Select "White Space."

3. Click onto the Replace with field, then click "Special" Button again. This time, select "Manual Line Break."

4. Click the "Replace All" Button. That's it.

Tuesday, March 6, 2012

Sample HTML 5 Canvas program

No comments :

<!--<!doctype html>
<html lang="en">
<head>
<title>Title of This Web Page</title>
<meta name="description" content="Description of the content of this web page." />
<script type="text/javascript">
window.onload = draw;
function draw()
{
var canvas = document.getElementById("example");
var context = canvas.getContext('2d');
context.translate(canvas.width / 2, canvas.height / 2);
context.scale(1, 0.2);
context.fillStyle = 'blue';
context.fillRect(-75, -75, 50, 50);
// var img = canvas.toDataURL("image/png");
// document.write('<img src="' + img + '"/>');
}
</script>
</head>
<body>
<p>
My first web page.
</p>
<canvas id="example" width="500px" height="500px">This text is displayed if your browser
does not support HTML5 Canvas.</canvas>
</body>
</html>-->
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Canvas Test</title>
</head>
<body>
<header> </header>
<nav> </nav>
<section>
<div>
<canvas id="canvas" width="320" height="500">
This text is displayed if your browser
does not support HTML5 Canvas.
</canvas>
</div>
<script type="text/javascript">
var canvas;
var ctx;
function init() {
canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d");
draw();
}
function draw() {
ctx.fillStyle = '#FA6900';
ctx.shadowOffsetX = 5;
ctx.shadowOffsetY = 5;
ctx.shadowBlur = 4;
ctx.shadowColor = 'rgba(204, 204, 204, 0.5)';
ctx.fillRect(0, 0, 15, 150);
ctx.save();
ctx.fillStyle = '#E0E4CD';
ctx.shadowOffsetX = 10;
ctx.shadowOffsetY = 10;
ctx.shadowBlur = 4;
ctx.shadowColor = 'rgba(204, 204, 204, 0.5)';
ctx.fillRect(30, 0, 30, 150);
ctx.save();
ctx.fillStyle = '#A7DBD7';
ctx.shadowOffsetX = 15;
ctx.shadowOffsetY = 15;
ctx.shadowBlur = 4;
ctx.shadowColor = 'rgba(204, 204, 204, 0.5)';
ctx.fillRect(90, 0, 45, 150);
ctx.save();
ctx.restore();
ctx.beginPath();
ctx.arc(185, 75, 22, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.restore();
ctx.beginPath();
ctx.arc(260, 75, 15, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.restore();
ctx.beginPath();
ctx.arc(305, 75, 8, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.strokeStyle = '#330077';
ctx.strokeRect(0, 250, 150, 50);
}
init();
</script>

Friday, March 2, 2012

Strikethrough Shortcut Key in Word

No comments :

I tried finding many websites to find shortcut for strike through.

Instead I found it much easier to assign keyboard shortcuts for strike through or any operation you need a shortcut.

Steps to Follow:

  1. Press Ctrl+D [Choose Font from Format Menu].
  2. Hold down Ctrl+Alt+plus sign from Numeric keypad.Then mouse turns to Clover symbol. []
  3. Click on Strike through checkbox in Font dialog box.
  4. Word displays customize keyboard dialog box enter new short cut key.
  5. Select any key combination which is currently [UNASSIGNED]. you can prefer Alt+Shift+S or Ctrl+Alt+S.

image

  1. Click assign , so that the shortcut key is used for strikethrough.
  2. Click close and click OK .

Select the word and use shortcut to apply strikethrough.