Jul 16 2010

ls full path

Published by michael under Unix/Linux

How do you get the Unix command ls to show you the full path? Unfortunately there’s no argument for ls that will do this directly.
However this will work fine and give you what you want.

ls -d $PWD/*

or

ls -ld $PWD/*

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Jul 07 2010

Window Stuck Under Toolbar in OS X

Published by michael under OS X / Apple OS

Sometimes a window can get stuck under the top toolbar in OS X. This often happens when I use Citrix in OS X to run Windows applications. When this happens it’s not possible to grab the window nor  to close it. A simple solution for this is to press [fn] [shift] [F2] which will move the application window a bit which allows you to grab it.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Apr 14 2010

fatal: git checkout: updating paths is incompatible with switching branches.

Published by michael under GIT

Using GIT I tried to pull down a new remote branch using:

git checkout --track -b my-branch-name origin/my-branch-name

When I did this I got this error message:

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/my-branch-name' which can not be resolved as commit?

This error message was a tad confusing. The solution in my case was simple though, apparently you can’t switch to a different remote branch if your local master is not up-to-date with the remote origin/master so performing:

git pull

resolved the issue and after this I was able to successfully pull down the remote branch.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Mar 04 2010

DbVisualizer auto commit problem

Published by michael under JDBC

I had some issues with DbVisualizer and auto commit. I wanted to be able to turn it off from the SQL commander. The official documentation states that you can do this using:

The Auto Commit setting is enabled by default and can be adjusted in the Connection Properties. You may also adjust the  auto commit state for the SQL editor you are using in the SQL Commander with the following command:

@set autocommit true/false

Unfortunately this didn’t work for  me in either 6.5.12 or 7.04 (I’m using OS X and Java 6) against an Oracle 10g database. I get an error alert stating “/application/set autocommit false (No such file or directory)”
I was finally able to figure out that you can get it to work using:

@set autocommit off/on

I’m not sure if this is a problem that only occur on OS X.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Feb 04 2010

GIT Fatal You Have not Concluded Your Merge MERGE_HEAD Exists

Published by michael under GIT

fatal: You have not concluded your merge. (MERGE_HEAD exists)

I got this message because when I performed a “git pull”. I searched for a solution for this problem on the Internet and it wasn’t until I found this post that I was able to resolve this issue. The problem was that I:

  1. Performed a “git pull” and the automatic merge failed and I ended up with merge conflicts
  2. I resolved the merge conflicts and added the resolved files back using “git add”
  3. Performed a new “git pull” and got the “Fatal You Have not Concluded Your Merge MERGE_HEAD Exists” error

Apparently step 3 overrides MERGE_HEAD, starting a new merge with a dirty index. According to the post this is a common mistake made by programmers that are used to version control systems where the user follows an “update” and “commit” work flow.

So how do we resolve this issue? What worked for me was to follow the instructions for how to “Undo a merge or pull inside a dirty work tree” found here.

  1. I used “git reset –merge ORIG_HEAD”
  2. I resolved the merge conflicts again and added the resolved files back using “git add”
  3. I was then finally able to “push” my changes!

According to the documentation if you run a “git reset –hard ORIG_HEAD” it will let you go back to where you were before you were trying to commit your changes, however you will lose local changes. Most likely not what you want to do. Using “git reset –merge” will let you keep your local changes. You will however have to re-resolve your conflicting merge files.

Some additional information on this topic can be found here.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

5 responses so far

Dec 04 2009

SQL*Loader-522: lfiopn failed for file (loader.log)

Published by michael under Oracle

I used the Oracle SQL Loader to push some data into a table and got the following error: SQL*Loader-522: lfiopn failed for file (loader.log)
This somewhat cryptic error message turned out to be that Oracle SQL Loader didn’t have write permissions in the work directory i.e. in the directory where I executed the sqlldr command. Once I fixed the directory permission everything worked just fine.

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Oct 08 2009

Java primitive data type sizes for byte, short, int, long, float, double and char

Published by michael under Java

A handy list for Java data types and sizes

Integer Data Types

Data Type Size Digits Min Max
byte 8-bit signed 3 -128 127
short 16-bit signed 5 -32,768 32,767
int 32-bit signed 10 -2,147,483,648 2,147,483,647
long 64-bit signed 19 -9,223,372,036,854,775,808 9,223,372,036,854,775,807

Floating Point Data Types

Data Type Size
float single-precision 32-bit IEEE 754 floating point
double double-precision 64-bit IEEE 754 floating point

Boolean Data Types

Data Type Values
boolean true or false

Character Data Types

Data Type Min Max
char \u0000 or 0 \uffff or 65,535

Default Values

Data Type Default Value
byte 0
short 0
int 0
long 0L
float 0.0f
double 0.0d
char ‘\u0000′
boolean false
Any Object(s) null

References:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Oct 07 2009

How to find project dependencies in a Maven project

Published by michael under Java, Maven

cog-wheels
It’s very useful to be able to see what is included in your class path especially when you’re trying to track down a troublesome dependency. Recently I had an issue with a JDOM dependency; however I had not defined a JDOM dependency in my pom.xml file and I couldn’t quite figure out why this dependency existed. This is where Maven’s excellent dependency plugin comes to the rescue.

In a project you may have dependencies on libraries like Log4J or Freemarker. These libraries in their turn may have dependencies on other libraries, this is also known as transitive dependencies.

Using the following Maven command we’ll be able to see a list of these dependencies:

mvn dependency:resolve

For a nice tree view of the same information use:

mvn dependency:tree

If you want to see a full dependency trail that also show you artifacts that were rejected due to conflicts or other reasons then run maven with the debug flag enabled:

mvn install -X

For more information about the Maven dependency plugin go here: http://maven.apache.org/plugins/maven-dependency-plugin/

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Sep 16 2009

How to control or throttle SCP file transfer speed

Published by michael under Unix/Linux

I wanted to control how fast SCP copy data between two Linux servers. On a Linux system this can easily be achieved using the “SCP -l” switch. In my case I had to make sure to not exceed 0.5 Mbit/s

Since the “-l” parameter uses Kbit/s the correct value in my case is 500

scp -l 500 big-file.tar someuser@someserver.com:backups/.
Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

2 responses so far

Sep 09 2009

How I fixed the problem and got my Logitech mouse working OS X 10.6 Snow Leopard

Published by michael under OS X / Apple OS

Logitech has yet to release updated keyboard and mice drivers for OS X 10.6 / Snow Leopard. I’m quite fond of my Logitech MX 510 mouse and wanted this problem fixed as soon as possible.

I used the instruction from the link below which tells you to download the “Logitech Control Center”, locate the “Logitech Control Center.mkpg” file inside the “Logitech Control Center Installer.app” and execute it. This will by-pass the OS X version check inside the Logitech installer.

I however wanted to use the installer for my mouse MX 510 which uses the “LCC Installer 2.app”. I followed the same instructions, located the “Logitech Control Center.mkpg” and executed it which successfully got the driver installed.

I found the solution to this problem here:
http://www.tuaw.com/2009/09/01/snow-leopard-get-your-logitech-mouse-and-keyboard-working-again/

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Next »