Wednesday, December 31, 2008

Debugging ColdFusion

ColdFusion provides detailed debugging information to help you resolve problems with your application. Debugging can be done in two ways:

1.By specifying the DEBUG attribute in tag.
2.By enabling server side debugging in ColdFusion Administrator panel.

For instance,

SELECT Distributor.Distributor_ID,
Distributor.Distributor_Name FROM Distributor ORDER BY Distributor.Distributor_ID
Returns, q_GetDist (Records=9, Time=421ms) SQL= SELECT Distributor.Distributor_ID, Distributor.Distributor_Name FROM Distributor ORDER BY Distributor.Distributor_ID

Tuesday, December 30, 2008

Hide Quick Navigation Bar

Customization of SharePoint pages, that is hiding the quick navigation, recycle bin, view all the site content from the left navigation. Here is a real quick way to achieve it.



Copy the above code lines and add a content editor webpart to any of the webpart Zone and past the copied above lines, you also make visible false of the webpart.

Monday, December 29, 2008

C# Brainteasers

Here's some code using the anonymous method feature of C# .
What does it do?

using System;
using System.Collections.Generic;
class Test{

delegate void Printer();
static void Main() {
List printers = new List();
for (int i=0; i <>
{
printers.Add(delegate { Console.WriteLine(i); } );
}
foreach (Printer printer in printers)
{
printer();
}
}
}

Saturday, December 27, 2008

Cellphone Hazards

Fact: Malignant brain tumors are the second leading cause of death in children and young adults in the United States, and this epidemic is largely caused by radiation from a cellphones which penetrate the heads of users. If you always use your cellphones for calls and has experienced ear pain, headaches, dizziness, insomnia, irritability, stress, memory loss, high blood pressure and ringing in the ears, you better start limiting yourself from using that mobile phone, or at least pave way to a number of safety options.Studies show that there is a correlation between cell phone emissions and a slightly higher incidence of human brain tumors, cell growth in human blood micronuclei, and DNA breakages. Other studies show that electromagnetic signals from cellular phones reduce the ability to concentrate, calculate and coordinate complicated activities such as driving a car. Using a cell phone is also responsible for impairing of memory and reaction times. Even the so called hands-free mobile speaker-phones do more as they emit 10-times more brainwave interference than handheld units. Sixty percent of the radiation emitted by a typical cell phone is absorbed by the user’s head, and the radiation that is coming out from the ear piece is four times out of the antenna, and a similar amount of radiation comes from the keypad and mouthpiece as well. It should be noted also that different brands and models of cellphones have widely different levels of emissions.

Four times the radiation is leaked into the side of the head than is actually being used to transmit a signal. Highest emission comes from the antenna region. The reason for the leakage is that manufacturers tend to lower down the production cost, in exchange of lessening down the radiation that would escape into the user’s head and lowering down possible risks, thus the source of leakage: poorly matched transmitters, feeds and antennas. It must also be blamed to the lack of shielding in the phone case.

It is important that mobile phone manufacturers should be alarmed with this scenario and start designing cell phones that will not endanger the health of users. Make sure that all cellphones are sold with head sets or earphones. In this way, the user will have the option of not using the cellphone close to his head. The truth is, the essential key to safety lies to the manufacturers themselves, by designing safety features that will help protect and reassure their customers.

This information is from Sciencetips.com

Tuesday, December 23, 2008

Resolving the newfolder.exe virus

Two days back my PC got affected by this virus very badly as it eat up all my empty hard disk space of around 700 MB.

This virus is know popularly as regsvr.exe virus, or as new folder.exe virus and most people identify this one by seeing autorun.inf file on their pen drives. It is spreading mostly using pen drives as the medium.

So I will tell you that how to remove this virus manually.

I prefer manual process simply because it gives me option to learn new things in the process.
  • Search for autorun.inf file. It is a read only file so you will have to change it to normal by right clicking the file , selecting the properties and un-check the read only option.
  • Open the file in notepad and delete everything and save the file.
  • Now change the file status back to read only mode so that the virus could not get access again.
  • Click start->run and type msconfig and click ok
  • Go to startup tab look for regsvr and uncheck the option click OK.
  • Click on Exit without Restart.
  • Now go to control panel -> scheduled tasks, and delete the At1 task.
  • Click on start -> run and type gpedit.msc and click Ok.
  • Go to users configuration->Administrative templates->system Find “prevent access to registry editing tools” and change the option to disable.
  • Once you do this you have registry access back.
  • Click on start->run and type regedit and click ok
  • Go to edit->find and start the search for regsvr.exe,
  • Delete all the occurrence of regsvr.exe; remember to take a backup before deleting.
  • Don't delete the regsvr32.exe.
  • Delete regsvr.exe occurrences only.
  • At one or two places you will find it after explorer.exe in theses cases only delete the regsvr.exe part and not the whole part. E.g. Shell = “Explorer.exe regsvr.exe” the just delete the regsvr.exe and leave the explorer.exe
  • Click on start->search->for files and folders. Their click all files and folders Type “*.exe” as filename to search for
  • Click on ‘when was it modified ‘ option and select the specify date option Type from date as 10/16/2008 and also type To date as 10/16/2008
  • Now hit search and wait for all the exe’s to show up.
  • Once search is over select all the exe files and shift+delete the files, caution must be taken so that you don’t delete the legitimate exe file.
  • Also find and delete regsvr.exe, svchost .exe
Now reboot your PC.


Source for this post:
http://amiworks.co.in/talk/how-to-remove-new-folderexe-or-regsvrexr-or-autoruninf-virus/

Saturday, December 20, 2008

Search a User By name & get his ID on Unix

#! /usr/bin/sh
echo "Enter User Name to be Searched"
read USERNAME
NAMES=`who awk {'print $1'} sort -u`

for NAME in $NAMES
do
USER=`finger $NAMEgrep $USERNAME awk {'print $7,$8'}`
if [ "$USER" != "" ]
then
echo $USER ——- $NAME
fi
done

Wednesday, December 17, 2008

Searching lines before & After in Unix

#! /usr/bin/sh
#———————————————–
#Program used to search a seed in a program
#———————————————–

SEED=$1
LINE=$2
FILE1=$3


for X in `awk '/'"$SEED"'/{ print NR }' $FILE1 `
do
echo ———————– $SEED ————————————–
NOB=`expr $X - $LINE`
NOA=`expr $X + $LINE`

if [ $NOB -lt 1 ]; then NOB=1
fi
for J in `awk 'NR == '"$NOB"',NR == '"$NOA"'
{
if(NF!=0) print; else print "\n"
}' $FILE1 `

do
echo $J
done
echo ——————————————————————-
done

Monday, December 15, 2008

Deploying J2EE applications on JBOSS Application Server

Step 1: Go /server//log
Step2 : Bring down the JBOSS Application server, Copy J2EE files like WAR/JAR/EAR/SAR/ZIP/RAR/JSE or xxx-ds.xml (data source) under the deploy directory
Step3:
Bring up the JBOSS Application service after deployment, follow the steps in 6.1.2
Go to /server//log

Open console.log and check whether J2EE files are deployed successfully

Note: Application stop/start is not required if it is a Hot deployment.

Saturday, December 13, 2008

ROUND() function in sql

Syntax:
ROUND ( numeric_expression , length [ ,function ] )

numeric_expression Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.
length Is the precision to which numeric_expression is to be rounded. length must be an expression of type tinyint, smallint, or int. When length is a positive number, numeric_expression is rounded to the number of decimal positions specified by length. When length is a negative number, numeric_expression is rounded on the left side of the decimal point, as specified by length.
function Is the type of operation to perform. function must be tinyint, smallint, or int. When function is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is specified, numeric_expression is truncated.

SELECT ROUND(column_name,decimals) FROM table_name

Parameter Description column_name Required. The field to round. decimals Required. Specifies the number of decimals to be returned.
1. SELECT ROUND(10.09 ,1) = 10.1
2. SELECT ROUND(10.09 ,-1) = 10

Thursday, December 11, 2008

Want to make money with the iPhone SDK ?

There are success stories of people making close to $ 250,000 by writing apps for iPhone. Recently, Apple dropped an NDA that prevented developers from sharing their knowledge on the iPhone with others. A flood of tutorials and reviews on the iPhone SDK opened up.

Here is one tutorial on writing an iPhone app:

http://www.cimgf.com/2008/10/01/cocoa-touch-tutorial-iphone-application-example/

So,if you want to start a ‘small scale IT business’ .This is one way now

Tuesday, December 09, 2008

SQL: Joins

The SQL JOIN clause is used whenever we have to select data from 2 or more tables. To be able to use SQL JOIN clause to extract data from 2 (or more) tables, we need a relationship between certain columns in these tables.

Inner Join (simple join)Chances are, you've already written an SQL statement that uses an inner join. It is the most common type of join. Inner joins return all rows from multiple tables where the join condition is met.

Outer JoinAnother type of join is called an outer join. This type of join returns all rows from one table and only those rows from a secondary table where the joined fields are equal (join condition is met).

Sunday, December 07, 2008

Undraggable alert

Yesday i was seeing an undraggable alert in flex ..its quite simple just set the property "isPopUp" to "flase" to not dgraggable and "true" for drggable.
Here is a code..you can try it


Script:
private function showAlert():void
{
title ="Undraggable Alert";
myAlert = Alert.show("HI Cognizant!!",title);

myAlert.isPopUp = false;
myAlert.status = Capabilities.version;
}




Friday, December 05, 2008

Difference Between URL and URI

The first difference, which is a hint for the different meaning,is what it stands for:
URI - Uniform Resource Identifier
URL - Uniform Resource Locator

A URI _identifies_ a resource by meta-information of any kind.
A URL _locates_ a resource on the net, which means if you havea URL and the appropriate protocol you can retrieve the resource.


There are many different URI, e.g.:-

URL - Uniform Resource Locator

URC - Uniform Resource Characteristics

URN - Uniform Resource Names
One characteristic of a URI is, that it gives information aboutexactly one resource. Another is there can be more than one URIdescribing the same resource.


That was the theory, here is an example:
URI: <http://www.w3.org/>

URI: <http://www.w3.org/>

URL: http://www.w3.org/pub/WWW/>
All lines describing the same resource (the URL describes the location).

Wednesday, December 03, 2008

Levels in (service) Quality!

No..I am not talking about CMMI Levels. Recently came across these in a book by Ron Kaufman
Level 1 - Criminal
Level 2 - Basic
Level 3 - Expected
Level 4 - Desired
Level 5 - Surprising
Level 6- Unbelievable!
(Think about it as how your client perceives the quality you deliver..the products you deliver..the services you deliver)

Monday, December 01, 2008

New iPod Touch faster than iPhone 3G

The second-generation iPod Touch uses a slightly faster processor than the iPhone 3G.
Apple appears to have upped the processing speed of the iPod Touch in order to help it go after the portable-game market.

Touch Arcade reports that the applications processor inside the second-generation iPod Touch unveiled in September is actually running faster than the processor inside the iPhone 3G, which runs at the same speed that the original iPhone and iPod Touch used. The new iPod Touch's ARM-based processor is running at 532MHz, while the iPhone 3G's processor runs at 412MHz.

A game developer interviewed by Touch Arcade noticed a huge difference in 3D-rendering speed as a result of the speed bump. As we remember fondly from our "megahertz madness" days of the Intel-AMD competition in the PC, processor speed is not the only measure of performance, but it is an important one.

With the arrival of the App Store, Apple has been marketing the latest iPod Touch as a gaming device in its latest round of commercials, almost completely ignoring the fact that it's a music and video player as well.

It seems that Apple has room to boost the clock speed of the processor to 620MHz, according to ARM's specifications, but that requires striking a balance between performance and battery life.
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory