One Small Thought

Dinesh Bhat's Blog

Tuesday, June 24, 2008

What the ......?


I dragged a folder from one machine to the other and out popped this dialog. My mind has been frozen for that last 30 minutes. If I click yes,will it move the files or just copy them? If I choose no, will it cancel the operation, hopefully!! If this is a prank it is a scary. It can tie knots in one's brain. I am too scared to touch the mouse anymore.
I clearly dragged the folder from one explorer window to the other and as I was performing this operation across different workstations, I expected a move. How can one explain this prompt? What were they thinking?
Let me go to apple.com, look at a Mac and get my sanity back.

Friday, June 13, 2008

Subversion: Generating a sortable list of changes made to a branch

I needed to generate a sortable list of all the changes made to a branch in subversion. svn log dumps a list, but is very difficult to sort, based on users, time, etc. I wrote a script based on a ruby script to dump the data in a comma separated format, that can then me loaded in Excel to analyze. Here is the script



# This script allows the svn log to be dumped as a comma separated list so that the data can be analyzed in excel
#!/usr/bin/ruby
require 'rubygems'
require 'hpricot'

username = ARGV[1]
svnUrl = ARGV[0]

#puts "Requesting SVN log, this may take a bit."

doc = IO.popen("svn log --xml -v --stop-on-copy " + svnUrl) do |f|
Hpricot.XML(f)
end

entries = doc.search("logentry").find_all do |entry|
if(username != nil)
(entry/"author").innerHTML == username
else
true
end
end

puts "Revision,Author,Date,Action,Path,Message"
entries.each do |entry|
revision = entry.attributes["revision"]
author = (entry/"author").innerHTML
date = (entry/"date").innerHTML
msg = (entry/"msg").innerHTML
paths = (entry/"paths").search("/path")
paths.each do |path|
action = path.attributes["action"]
puts "#{revision},#{author},#{date}, #{action}, #{ path.innerHTML}, #{msg.gsub("\n", " ")}"
end

end

Creating a shortcut to a schema using synonyms

I needed to access data from a live database, add some views and procedures, but I did not want to touch the schema. I wrote a script to create synonyms for all the remote schema object using a database link. There could be other uses for such shortcuts, for e.g providing more restrictive access, among others. Here is the script.



-- parameter 1: db link name
-- parameter 2: remote username
-- parameter 3: remote user password
-- parameter 4: remote hostname/sid
-- usage: mydblink user password remote_host/database_sid
-- NOTE: Tested on 10g
-- grant CREATE DATABASE LINK privilege to the user
-- DISCLAIMER: Use at your own risk

set serveroutput on
drop database link &1;
--create database link
create database link &1 connect to &2 identified by &3 using '&4';

--link all the database objects
DECLARE
l_count NUMBER;
BEGIN

FOR rec IN
(SELECT object_name FROM user_objects@&1 WHERE object_type in
('SEQUENCE', 'TABLE', 'VIEW', 'PACKAGE', 'PACKAGE BODY', 'FUNCTION',
'SYNONYM', 'PROCEDURE', 'TYPE')
)
LOOP
dbms_output.put_line('Creating ' || rec.object_name);

SELECT COUNT(*) into l_count FROM user_synonyms where synonym_name = rec.object_name;
IF l_count > 0 THEN
EXECUTE IMMEDIATE 'DROP SYNONYM ' || rec.object_name;
END IF;
EXECUTE IMMEDIATE 'CREATE SYNONYM ' || rec.object_name
|| ' FOR ' || rec.object_name || '@&1';
END LOOP;
end;
/

Thursday, June 12, 2008

Gas is $4 and IPhone is almost FREE!

IPhone 3G is priced at $199, which means it probably will be available for free with certain plans. What chance do other devices have? BlackBerrry Bold will also have to be priced appropriately. One can look forward to a huge price drop for other phones.
This summer it would be cheaper to download and play games on the IPhone than travel to the beach.

Thursday, June 5, 2008

Review of Free GPS Software on my Blackberry 8820

With travel season in full swing, I got down to evaluating free GPS software for my 8820. I have recently installed 4.5, so was left with no choice but to install telenav. That was the only backdoor I had to unlocking the GPS on my device. AT&T Maps Trial version got installed instead.
AT&T Maps
It seemed promising. I got down to plotting my course and clicked on Drive To and entered my destination. I then got to select the origin. Could not find an option to select My Current Location anywhere. This was strange. Searched through all the menus, but could not figure out how to specify my current GPS location. Went outside, just in case GPS was not available, but no luck. The only location specific information provided was the weather. I can look outside the window and figure that out. I needed to upgrade to Telenav GPS Navigator.
I gave up in A&T Maps.
There is of course Google Maps and Yahoo Maps. Both are pretty good, but lack speech based directions. Yahoo Maps on 4.5 is missing menus, hence navigating through the software using keys is a hit or a miss. Yahoo Maps can recalculate a route, while Google Maps cannot.
I then installed the Co-Pilot 6 month free trial software. It is a decent application, though the UI needs a little finishing. It has voice turn-by-turn directions (without street names). It recalculates routes in a decent time. Sometimes it takes a long time for it to determine GPS coordinates and occasionally get the "No Response from server" error.
I then tried Nav4All. I was not sure about this free software, but on download, I really amazed at the amount of functionality packed in. The user interface at first glance does not look appealing, but is amazingly functional.
The address input could be more efficient, without having to provide the country every time, but it has so many features not even available in most standalone GPS Navigation systems.
Routing is pretty good and is based on the 9 driving styles (shortest rout, no highways,etc). It recalculates in good time and has voice turn-by-turn directions (without street names). The directions also include the lane assists and speed alerts.
One can flag (tag) locations and there is an option to mark your parking spot, a handy tool in big unfamiliar parking spaces and especially if the car you drive is also driven by million others.
The UI has a day and night mode for better readability which it automatically determines . It defaults to the safety view, with big arrows and text to be easily viewable while driving. Its plan route is awesome, where it allows one to plan ahead, by viewing all alternatives and demoing through the route.
It's speed limit alerts would also be very useful, especially on unfamiliar roads. There are few other options that make this a really great application.
One issue I had, (it may be any issue with the processing power of my blackberry) was that when I was also listening to podcast, there was a delay in catching up on my current location and recalculating the routes, which resulted in me sightseeing places that I had never been to.
All these apps have poor POI's, but having Google and Google Maps on the blackberry makes up for it.
I have also noticed that Yahoo Maps are more current than others, but unfortunately is difficult to use.

Thursday, March 6, 2008

iPhone in Enterprise

Now that Apple has announced iPhone support for the enterprise, RIM has no choice but bring BlackBerry Connect to iPhone as soon as possible. Small enterprises have a viable choice even with Windows Mobile and executives are going to drive their IT staff to make iPhones work for them. Professional consumers have a lot of choices with iPhone and Windows Mobile Devices and would like to use the same device inside the enterprise.
RIM cannot afford influential users in enterprises connecting directly to their Exchange. There will come a tipping point when the enterprises will decide to switch over. RIM will have to tackle it both by bringing better devices, which I believe is happening and enhancing the BlackBerry Connect experience to prevent users from switching over.
Until now, the server side technology controlled device adoption. The tables have turned. Once the enterprise starts trusting Exchange Active Sync, it will be the device that matters. RIM did a good job with Pearl as a consumer device, but with so much competition, RIM will have to raise its game several notches.
Exchange Server Active Sync is old news and most of the enterprises are aware of its features, but it did not seem a major threat to RIM based on Microsoft's release history. It typically takes some time for Microsoft to get it right. So why is should RIM worry about today's news? The answer is that by adopting it, Apple has given the Active Sync solution voice and credibility. Large Enterprises may not bat an eyelid, but small enterprises will take notice.

Tuesday, February 19, 2008

Hands Free Cellular on my 1995 Corolla!! (Almost)

I have been using my Blackberry 8820 as an MP3 player, but it is not convenient while driving as the ear bud keeps falling off and answering a phone call involves a lot of fumbling (by me) and cursing (by the other drivers). With an hour's drive to work one way I was desperate for a solution when I came across this audio adapter from Seido, after I had unsuccessfully tried all kinds of adapters from Radio Shack. I ordered it online and made a major mistake.
I had no problems with the online retailer, but I set it up to be delivered on Feb 14th to my house. My wife received the package got excited, saw the contents and flung the package into the trash can. My wife reported this a couple of days later, after I accumulated a few credits.
I did not want to digress, but even if one person reads this and avoids this tragedy, it will be worth it.
I tried the audio adapter with my home theater system and it sounded good (let me warn you that I am not an audiophile), a much better experience than the generic adapters I bought from radio shack.
The real test was when I plugged the audio adapter into my old and trusted my car cassette adapter. I was able to hear pod casts clearly. 30 minutes into my drive, when my wife, as usual called in to describe my 18 month old angel's current playful (in my view only) activities, I was able to press the mic button and hear her loud and clear on my car stereo and talk to her hands and wire free. She seemed to hear an intermittent echo, but overall it worked OK.
I need to test it further to see this usage is practical.

Update:
I switched to using a FM transmitter included with my car charger as the cassette adapter started crackling when exposed to sub-zero conditions. Regarding taking a call, Not everyone (my wife included) likes the echo. It works without a problem with the headset.