March 2007
Monthly Archive
Wed 28 Mar 2007
Posted by Frank Kim under
Java SENo Comments
When printing out an array if you simply do a toString on the array you will get a “fairly useless result such as [C@16f0472". Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array.” I used to use Arrays.asList followed by toString but Arrays.toString is definitely more efficient and is available as of JDK 1.5.0.
This method is useful when you want to report on the values of an JDK 1.5 enum since the values method returns an array.
The quote is from a FindBugs report.
Wed 21 Mar 2007
Posted by Frank Kim under
PerforceNo Comments
The Perforce Windows GUI has a few neat tricks.
- If you click on a folder/file in the depot view of the Perforce Windows GUI and do a copy (Ctrl+C), then if you do a paste in another application it will paste the complete depot path to that folder/file.
- If you copy the Windows path to a folder/file in your work space and then do a paste in the depot view the Perforce Windows GUI will reveal where in the depot the folder/file is located.
Wed 21 Mar 2007
Posted by Frank Kim under
PerforceNo Comments
A former colleague has a great Perforce FAQ and in it he writes a lot about how to do a merge.
If you are doing a simple merge one can do it on the code line like in this example.
> p4 integ //depot/foo/…@17,@17 //depot/bar/…
> p4 resolve -am
> p4 submit
You can also do a simple merge of a file like in this example.
> p4 integ //depot/foo/frank.java#7,#7 //depot/bar/frank.java
> p4 resolve -am
> p4 submit
Sometimes Perforce will not do the integration and say “all revision(s) already integrated.” In that case you can force the revision by using the -f flag.
> p4 integ -f //depot/foo/frank.java#7,#7 //depot/bar/frank.java
Wed 7 Mar 2007
Posted by Frank Kim under
Cygwin ,
WindowsNo Comments
As of bash 3.2.9-10, bash no longer executes DOS formatted scripts as detailed in this announcement. I understand the reasoning for this is that:
- cygwin is supposed to mimic Linux, not Windows
- it is faster to assume that the scripts are in UNIX format
To get around this restriction I did what was recommended in this bug report, i.e. I created a Windows user environment variable named “SHELLOPTS” with the value “igncr”.
Wed 7 Mar 2007
Posted by Frank Kim under
Cygwin ,
Windows1 Comment
After installing Cygwin when I tried to start the shell from a Windows command prompt by entering the “sh” command a window would pop up with this error.
The procedure entry point rl_getenv_hook could not be located in the dynamic link library cygreadline6.dll.
After seeing this error I would have to manually kill the sh process using the Windows Task Manager.
There was a thread about this on the Cygwin mailing list. I did what was suggested and discovered that bin/sh.exe and bin/bash.exe were exactly the same. Yet for some reason when I ran bash from the Windows command prompt I did not get this error.
I then tried rerunning the Cygwin installer. Even though nothing was installed that seemed to solve the problem, i.e. I was able to run sh from the Windows command prompt. This was possibly because the bash postinstall script was run correctly.
Update: After reboot I am experiencing the same problem again. Aargh! 