Samstag, 6. Februar 2010

Sun Java on Fedora

Because icedtea seems to still have problems (some SWT apps cause VM crashes) I still need to install the original Sun Java on my Fedora Linux. Here is a short howto on this:

Node: I don't know if this is the correct way to do this, it's how I did it on my Fedora 12 x86_64 installation.

First you need to download the appropriate JDK, e.g. from here.

Install it by somethin like:
sudo sh jdk-6u18-linux-x64-rpm.bin
And then you need to setup the correct alternative Java installation by running this script:
#!/bin/sh

cat > /etc/profile.d/java.sh <<EOF
export JAVA_HOME=/usr/java/latest
export PATH=\$JAVA_HOME/bin:\$PATH
export MANPATH=\$JAVA_HOME/man:\`manpath\`
EOF

chmod a+x /etc/profile.d/java.sh

. /etc/profile.d/java.sh

# hack to fix linking problem:
sed -i 's/XINERAMA/FAKEEXTN/g' $JAVA_HOME/jre/lib/amd64/xawt/libmawt.so

# install the alternative
/usr/sbin/alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 1 \
	--slave /usr/bin/javaws      javaws      $JAVA_HOME/bin/javaws \
	--slave /usr/bin/rmiregistry rmiregistry $JAVA_HOME/bin/rmiregistry \
	--slave /usr/bin/keytool     keytool     $JAVA_HOME/bin/keytool \
	--slave /usr/bin/pack200     pack200     $JAVA_HOME/bin/pack200 \
	--slave /usr/bin/unpack200   unpack200   $JAVA_HOME/bin/unpack200 \
	--slave /usr/bin/orbd        orbd        $JAVA_HOME/bin/orbd \
	--slave /usr/bin/rmid        rmid        $JAVA_HOME/bin/rmid \
	--slave /usr/bin/servertool  servertool  $JAVA_HOME/bin/servertool

# choose the right alternative
/usr/sbin/alternatives --config java
See also: fedorasolved.org

Dienstag, 29. Dezember 2009

I hate Computers

Yesterday everything worked fine. Today I turn on the computer and the image is all green so you can't really read anything without getting eye cancer. Getting a graphics card refunded between Christmas and new year? You might encounter a "tiny" queue at the shop. But first I checked all connections: all ok. I opened the case: a lot of dust has gathered since I've bought the computer at Easter. I removed the dust and started it again: no change. I removed the graphics card (GeForce 8800) in order to install an old GeForce 4400 (or 4600? some 4). Only after I've removed the new card I realized that the new computer only has PCI-e and the old card is AGP. Well, crap. I installed the new card again. First I forgot to connect the extra power cable to the graphics card (it needs it I guess for the fan?) and I got a very loud howling noise when I hit the power button. Panic! Well, I figured what is was and connected the cable. Only now I had the idea to connect my monitor to the other output port of the graphics card (it has two) and it worked!

But using a half defective graphics card that got magically defective over night? Not a good feeling. I better get it replaced before it expires. But then, when I send it in for testing, what do I do in between?? Flip the bits on my HD with a magnet? I guess I will buy I new graphics card (even though my current one isn't that old) and when I get the replacement I sell it on ebay or something.

Non-existing-god, I hate computers. This year my monitor got defective as well. I bought a new much bigger one. I found a very good offer, an acer widescreen (1920x1080) for a very good price (all other monitors with equal properties where much more expensive). So at least there is an upside. Still, this is frustrating. To bad that developing software is exactly what I want to do for a living. Why must life be so contradictory?

Update:
Just out of curiosity I connected the monitor again to the other graphics port and now it all seems to work all right. Very strange. What does this mean? What is to blame? The graphics card? The cable? The Motherboard? Surly not the monitor, because the OSD menu always displayed correct colors.

Sonntag, 15. November 2009

Git and KDiff3

I wrote a small patch for yakuake. Yakuake still uses subversion (because KDE still uses SVN, but it will switch to git) I tried the SVN mercurial plugin. Well, for some reason it failed ("abort: None" wtf?) so I tried the git SVN plugin. Well, I like hg a bit more than git but whatever. There are both good DSCMs.

Because I like to use kdiff3 to view changes I googled how to use it with git. I found this message and extended the script:
#!/bin/sh -e

# Usage: git kdiff3 [commit1 [commit2]]

SUBDIRECTORY_OK=1
. "`git --exec-path`/git-sh-setup" || exit 1
cd_to_toplevel

O=".git-kdiff3-tmp-$$"
list=$O/.git-kdiff3-list
trap "rm -rf $O" 0
mkdir $O || exit 1

function diff_working_copy () {
	git diff --name-only -z "$1" > $list || exit 1
	xargs --arg-file=$list -0 git archive --prefix=a/ "$1" | tar xf - -C $O || exit 1
	{ cat $list; printf '\0'; } | while read -r -d '' fname; do
		if [ -e "$fname" ]; then
			dir=`dirname "$fname"`
			dest="$O/b/$dir"
			mkdir -p "$dest" || exit 1
			cp "$fname" "$dest" || exit 1
		fi
	done
}

case $# in
	2)
	git diff --name-only -z "$1" "$2" > $list || exit 1
	xargs --arg-file=$list -0 git archive --prefix=a/ "$1" | tar xf - -C $O || exit 1
	xargs --arg-file=$list -0 git archive --prefix=b/ "$2" | tar xf - -C $O || exit 1
	;;

	1)
	diff_working_copy "$1"
	;;

	0)
	branch=`git branch --no-color|grep '^*'|sed 's/[\* ]//g'`
	diff_working_copy "$branch"
	;;

	*)
	echo >&2 "error: illegal number of arguments"
	exit 1
	;;
esac

if [ -e $O/a -a -e $O/b ]; then
	kdiff3 $O/a $O/b
	exit $?
fi
When you copy it to `git --exec-path`/git-kdiff3 you can use it by issuing the command git kdiff3.

Dienstag, 10. November 2009

Things I hate about Eclipse

As a follow up to "Things I love about Eclipse" I think I really need to write this posting.

Uninstall Plugins

You simply can't. There is no built in mechanism to do that. You have to manually guess and delete the files.

Broken Copy/Cut+Paste

During application development you have often to restructure your code, copy some small parts, move things from one file to another etc. For this one selects the text (either with the mouse or the keyboard) hits Ctrl+C (or Ctrl+X) and then at the target position you hit Ctrl+V. Well, not with Eclipse. It is so freaking broken that it never understands right what you've selected. You have to select the text, wait at least two or three seconds, copy/cut, move cursor to target and then paste. This extremely slows you down! You would never thing an editor as advanced as Eclipse would suffer from such an behaviour. You forget that it does and so you often have to undo the wrongly inserted text, move back to the source and copy it again. I mean WTF? This is the 21st century. No other editor, as crappy or old you can imagine, suffers from such an problem. And the worst thing is, this issue seem to have got worse in recent Eclipse releases! Gaaaah! This bug actually makes me think about moving to NetBeans.

Search

It could be a lot more handy. The free floating window often obscures the text, only one occurrence of the search string is highlighted at a time and F3 doesn't do a "search again". I'm accustomed by almost every other advanced editor (well, not vim) that F3 means "search again".

Dienstag, 6. Oktober 2009

Things I love about Eclipse

In this posting I list a few things I really like about Eclipse. Most of these things (but not all) are currently not (or only very limited) supported by Qt Creator (1.2). I'd really like to see these features in Qt Creator, because I use almost all of them all the time when I write Java Code (only the last two I use less often). Note that NetBeans also supports these features in some way. There are differences between Eclipse and NetBeans that make me use either IDE for certain projects, but none of them concern the basic features I describe here.

All the Sub-Windows

I have a widescreen monitor and I really like how I can move and place all parts/tabs of eclipse to my liking so I fill the screen neatly. I also like how you can trace errors in the project tree. Also note the red mark beside the scrollbar. This marks the line containing the error. You can jump to the corresponding line by clicking the mark. Other marks supported by Eclipse are warnings and TODOs (in comments).

Highlight Symbols

When you place the cursor into a symbol all occurrences of it get highlighted. See also the gray markings beside the scroll bar.

Auto Completion

Camel Case Wildcards

(I think this is already supported by Qt Creator.) You can abbreviate names by only typing the uppercase letters (and the initial lowercase letter for members) to speed up autocompletion.

Overloaded Methods

Overloaded methods are listed like any other. In Qt Creator some kind of strange tool tip gets displayed (only method signature, no documentation). I think this is confusing. I don't expect a tool tip to capture my up/down key strokes. Also you have to go through all in order to look if there is a signature that fits your needs. The way Eclipse does it you see all (or as much as possible) signatures at once.

Granted, the way Eclipse does it pollutes the drop down menu. I think it depends on the preference of the programmer. This should be an option.

Advanced Tool Tips

Eclipse displays tool tips for classes, methods, fields etc. on mouse hover.

There are a lot of nice things about the tool tips in Eclipse. When you click them they get a bar with which you can resize and move them.

You can also navigate the documentation displayed in a tool tip.

Class Creation

Eclipse provides a neat class creation dialog. You can fill in generic types, enter the package name etc.

Auto Correction

For a lot of common errors Eclipse provides auto correction when you click the red x icon beside the line number. This comes really handy from time to time.

Code Generation

Eclipse provides means to generate common and simple code. This code is trivial and just cumbersome to write.

Refactoring Preview

Before you apply any refectoring step you can preview it in a nice diff view.

Visual Type Hierarchy

I think the images speak for them self.

Visual Call Hierarchy

Find References of Classes

logo

pub - panzi's uni blog

Archiv

Februar 2010
Mo
Di
Mi
Do
Fr
Sa
So
 1 
 2 
 3 
 4 
 5 
 7 
 8 
 9 
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
 

User Status

Du bist nicht angemeldet.

Suche

 

Aktuelle Beiträge

Sun Java on Fedora
Because icedtea seems to still have problems (some...
panzi - 6. Feb, 19:15
Alt+N
Hi, thank you very much for this little life saver!...
Jack (anonym) - 15. Jan, 16:58
Well this would only...
Well this would only work on a per site basis, because...
panzi - 13. Jan, 23:34
Thank you very much for...
Thank you very much for the response. It also would...
Gustronico - 13. Jan, 22:18
It's not possible with...
It's not possible with the current implementation but...
panzi - 12. Jan, 16:28

Status

Online seit 1742 Tagen
Zuletzt aktualisiert: 6. Feb, 19:15

Credits

twoday.org

based on antville powered by Helma


  • xml version of this page

(sci)fi
algodat
c
comic
dies und das
film & tv
gefahren des internet
graphik
iug1
java
k(r)ampf mit dem computer
literatur
mathe
musik
netzkultur
open source
... weitere
Profil
Abmelden
Weblog abonnieren