Today my point is about Google maps Navigation in Android phones.

Its the same thing like OVI maps for Nokia. But the Google Maps Navigation wont work in India. It works only in US. So currently its a useless piece of program whose output is just an alert “Google Maps Navigation is not yet available in your location”.

But now we have got an alternative. A BRUT way..

xda-developers are providing brut google maps which will allow people from India also to use Google Navigation.

  • worldwide navigation using Google Maps Directions
  • map tiles caching on SD card
  • force-enable MT. If you’re on Eclair or some custom Donut and don’t have multitouch zooming, then maybe this will enable it.
  • force-enable Buzz feature
  • fix for map shift issue in China
  • option to hide zoom buttons
  • installable on non-rooted devices
  • could be installed beside original app

Want to try??? http://forum.xda-developers.com/showthread.php?t=630887

But always use the renamed one. As when we try to reinstall google navigation it will pop up an error. Its in a read only state.

Its working for me :)

Recently I ran into an issue in MS SQL when ever I tried to run an sp. I was getting an error message like ‘Cannot resolve collation conflict for equal to operation’. Anyways I got the solution. So thought of including a quick note on the issue.

This issue can occur in the following areas.
Collation can affect following areas:

While using tempdb
Join statements
UDF (My issue was in here)
Where portions in queries

This issue occurs when the collation of the column that are being compared like in ‘=’ or ‘<’ or ‘>’ or ‘like’ are different. So if we change the collation of one of the column to that of the other we can remove this issue.
Like:
where table1.[column] collate SQL_Latin1_General_Cp437_CI_AI = table2.[column]

Here we changed the collation of the table.column to that of table2.column.

The best way to remove this kind of error is to set the collation of the columns that are being used to the database default. This can be done by using like below

WHERE table1.[column] COLLATE DATABASE_DEFAULT
= table2.[column] COLLATE DATABASE_DEFAULT

In case of this issue while using temporary tables, it can be because the db is in another collation with that of the temp db. So while using tempdb in where clause or joins, we just have to change the collation of the temp db to the database default.

So,

If this error msg pops up better use COLLATE DATABASE_DEFAULT

Cheers…

All you Ferrari Lovers, Acer launched new Andriod phone in India..

Specifications:

Qualcomm Snapdragon mobile processor

512 MB RAM

5MP camera capable of recording high-definition video

3.5 inch touchscreen

108 MB onboard memory :(

2.1 Andriod

The handset will be costing around 30000.

Check this out!!

http://onlygizmos.com/acer-ferrari-android-phone-arrives-in-india-with-expected-stiff-price-tag/2010/09/

 

Chris Blackwell developed a cool add on for firefox which can be used along with modelglue gesture.

Check this out:

http://groups.google.com/group/model-glue/browse_thread/thread/256ac11d7ff05a0f

 

Are you a lover of firebug and would like to get it in other browsers?

Check this out..

http://getfirebug.com/firebuglite

OK. Here I’ll explain with a scenario. I wanted to execute a javascript function after a cfwindow completes its loading. Here I am changing the state of a radio group according to some calculations. The problem here was that the javascript function was called even before the page completes its loading and the script was not getting the radio input control.

The rescuer:

ajaxonload

Ajaxonload will be called just below the radio control. By this when the page is loading the javascript will be called only after the controls are generated.

<cfset ajaxonload(‘changeSelection’)>

By the way it may be so simple. But it took a hell lot of time in my development. ;) … So thought to share..

Normally we create Excel files in coldfusion by the simple cfoutput with table structure and assigning it to a file with extension xls. But by this method we can find that sometimes the excel sheet is having special characters filled up. So here comes a old “NEW” method for the rescue. ie Excel File Creation using POI. Now this method is used as this is more efficient than the normal way of excel creation.

An example code for Excel File Creation

//creating the workbook using poi
<cfset workBook = createObject(“java”,”org.apache.poi.hssf.usermodel.HSSFWorkbook”).init()/>

//assigning style to the cells in the excel sheet
<cfset cellstyle = workbook.createCellStyle()>
//assigning font weight
<cfset fontface = workbook.createFont()>
<cfset fontface.setBoldweight(fontface.BOLDWEIGHT_BOLD)>
<cfset cellstyle.setFont(fontface)>

//this is the sheet counter for the excel work book. for our example it is 3.
<cfset sheetcounter = 0>

<cfloop from=”1″ to=”3″ index=”sheetcounter”>
<cfset newSheet = workBook.createSheet()/>
<cfset row = newSheet.createRow(0)/>

//this is the student list. We will create sheets for these students
<cfset studentlist = “balu,pinky,deepu”/>
<cfset subjectlist = “science,maths,english,computer”/>

<cfloop list = “#studentlist#” index=”student”>
<cfset workBook.setSheetName(#sheetcounter#, “#student#”)/>
//this is for creating headings for each sheet.. ie the subject names science,maths,english,computer
<cfset counter = 0>
<cfloop list=”#subjectlist#” index=”header”>
<cfset cell = row.createCell(counter)/>

<cfset cell.setCellStyle(cellstyle)/>
<cfset cell.setCellValue(#header#)/>
<cfset counter = counter+1>
</cfloop>

<cfset sheetcounter = sheetcounter+1>
</cfloop>
</cfloop>

//the resultset name is studentdetails. We are looping through the query in order to assign the values to the cells of the excel sheet.

<cfloop from = “1″ to = “#listlen(studentlist)#” index = “datacounter”>

<cfset currentsheet = workBook.getSheetAt((datacounter-1)>
<cfset row = currentsheet.createRow(1)/>
<cfset datasheetcounter = 1/>

//getting data from the table student

<cfquery name=”studentdetails” datasource=”studentdb”>

select * from studentdetails where studentname = ‘#datacounter#’
</cfquery>

<cfif studentdetails.recordcount>

//looping through the student details
<cfloop query=”studentdetails”>

<cfset row = currentsheet.createRow(datasheetcounter)/>

<cfset cell = row.createCell(0)/>
<cfset cell.setCellValue(studentdetails.science)/>

<cfset cell = row.createCell(1)/>
<cfset cell.setCellValue(studentdetails.maths)/>

<cfset cell = row.createCell(2)/>
<cfset cell.setCellValue(studentdetails.english)/>

<cfset cell = row.createCell(3)/>
<cfset cell.setCellValue(studentdetails.computer)/>

<cfset datasheetcounter = datasheetcounter + 1>

</cfloop>
</cfif>

</cfloop>

//this is the directory where we are going to save the excel file
<cfset directorypath = “d:\studentdetails”/>

<cfif NOT DirectoryExists(directorypath)>
//creating the directory if the directory is not there in the server
<cfdirectory action=”create” directory=”#directorypath#” >

</cfif>

<cfset fullpath= “d:\studentdetails\studentdetails.xls”/>
//if the file is there in the directory we are deleting that file
<cfif FileExists(fullpath)>
<cffile action=”delete” file=”#fullpath#”>
</cfif>

//writing the file
<cfset fileOutStream = createObject(“java”,”java.io.FileOutputStream”).init(#fullpath#)/>
<cfset workBook.write(fileOutStream)/>
<cfset fileOutStream.close()/>

Sometimes we may have to write codes for different browser. We can make that possible by using CGI. We can do that by using the HTTP_USER_AGENT.

Here is how we do that

<cfif CGI.HTTP_USER_AGENT contains “MSIE”>

<!— This is IE —>

<cfif CGI.HTTP_USER_AGENT contains “MSIE 8.0″>

<!— This is IE 8—>

<cfelse>
<!— This is IE all other versions—>
</cfif>

<cfelseif CGI.HTTP_USER_AGENT contains “Opera”>

<!— This is Opera—>

<cfelseif CGI.HTTP_USER_AGENT contains “Safari”>

<cfif CGI.HTTP_USER_AGENT contains “Chrome”>

<!— This is chrome—>

<cfelse>

<!— This is safari—>

</cfif>

<cfelseif CGI.HTTP_USER_AGENT contains “Firefox”>

<!— This is firefox—>

<cfelse>

<!— All other browsers—>

</cfif>

<!— This is to verify the dsn —>

<!— this is the dsn —>
<cfset var dsn = “mydsn”>
<cftry>
<!— this is to create the object of the service factory —>
<cfobject action=”create” type=”java” name=”servicefac” class=”coldfusion.server.ServiceFactory”>
<!— getting the data source service —>
<cfset datasourcesrvce =servicefac.getdatasourceservice()>
<!— checking whether the dsn exists —>
<cfset existdsn = datasourcesrvce.verifydatasource(dsn)>
<!— dsn exists if not going to catch —>
<cfcatch type=”any”>
<!— dsn dont exist —>
<cfset existdsn=”false”>
</cfcatch>
</cftry>

This is how we can use cfscripts

Setting a normal variable

<cfscript>

myvariable = “balu”;

</cfscript>

Do / While Loop

<cfscript>

myvariable = 1;

do {

myvariable  = myvariable + 1;

WriteOutput(myvariable);

} while (myvariable LTE 0);

</cfscript>

While Loop

<cfscript>

myvariable = 0;
while (myvariable LT 10) {
myvariable = myvariable + 1;
WriteOutput(myvariable);
}
</cfscript>

Try / Catch Statements

<cfscript>

try {
x = 10 / 0;
}
catch(Any e) {
WriteOutput(“Error occured ” & e.message);
}
</cfscript>

Single Line Comments

<cfscript>

a = a + 10; //This is a single line comment
</cfscript>

Multi-Line Comments

<cfscript>

/* This is a multi line comment
that can written in
multiple lines
*/
</cfscript>

FOR Loop

<cfscript>

for (i=1;i LTE ArrayLen(array);i=i+1)
{
WriteOutput(array[i]);
}
</cfscript>

Switch Case

<cfscript>

switch(myvalue) {
case “1″:
WriteOutput(“1 is the value”);
break;
case “2″:
WriteOutput(“2 is the value”);
break;
default:
WriteOutput(“default value”);
}
</cfscript>

If… else….

<cfscript>

if (myvariable EQ 1) {
WriteOutput(“1 is the value”);
}
else if (myvariable EQ 2) {
WriteOutput(“2 is the value”);
}
else {
WriteOutput(“default value”);
}
</cfscript>

CFQuery in CFScript

Normally we use like
<cfquery name=”getstudents” datasource=”dsnstudents”>
select stuname,stuage,stuclass from students where stuid > 1
</cfquery>

In CFscript

<cfscript>

objFactory = CreateObject(”java”,”coldfusion.server.ServiceFactory”);
objDataService = objFactory.DataSourceService;
objDataSource = objDataService.GetDataSource(”dsnstudents”);
objConnection = objDataSource.GetConnection(Enter the username and password here);
objstatementstring = “select stuname,stuage,stuclass from students where stuid > 1?;
objStatement = objConnection.PrepareStatement(objstatementstring);
objResults = CreateObject(”java”,”coldfusion.sql.QueryTable”).Init( objStatement.ExecuteQuery() );
objConnection.Close();
</cfscript>