I’ve been a KDE user for a long time now, and I love all the new changes (except the Aero snap thing, you can turn that off though). One thing I love is Kate. I usually have two or three Kate sessions open at once, borrowing code across projects or changing things in different modules.
My problem is that Kate now defaults to only one instance, so if I call Kate from the command line with a file name, it gets added to a running instance, not a new one. If I use the KRunner to start a session, it loads in place of the current session in a running instance. I understand the reasoning here, but I want to use it the way I always have.
Easy fix! Just always make sure it is called with kate -n
You can do this with a BASH alias,
alias kate='/usr/bin/kate -n'
or more thoroughly with a wrapper script like this one from a forum post:
/usr/bin/kate -n $@ &> /dev/null &
I’ve been firing up my old copies of Sim Tower and Yoot Tower to, um, research for pyTower. It’s been a while since I used wine, so when Yoot Tower borked because of a missing dll ( MFC420.DLL, natch ) I hit the Google and found this great little ditty: winetricks. It’s a little script that will install all kinds of DLL’s on demand from all over the net.
It even has a GUI!
It did the trick really fast, so I’d recommend it net time you get stuck.
Okay, so you can’t send extra arguments through a slot when you connect it in pyQt4. What I mean by that is if you are connecting to a button’s clicked() signal it has zero arguments, so you don’t get to send anything to your slot.
This was a really big annoyance, I wanted to send arbitrary arguments defined at connect time. So I looked, and I looked and eventually, I found this treasure. Awesome.
# this creates a class that allows currying of functions
#keep a reference to all curried instances·
#or they are immediately garbage collected
instances = 
def __init__(self, func, *args, **kwargs):
self.func = func
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self, *args, **kwargs):
kw = self.kwargs
funcArgs = self.pending + args
#sometimes we want to limit the number of arguments that get passed,
#calling the constructor with the option __max_args__ = n will limit
#the function call args to the first n items
maxArgs = kw.get("__max_args__", -1)
if maxArgs != -1:
funcArgs = funcArgs[:maxArgs]
return self.func(*funcArgs, **kw)
And for usage…
button_1 = QtGui.QPushButton( "Button One" )
QtCore.QObject.connect( button_1, QtCore.SIGNAL( "clicked()" ), Curry( self.myslot, 'Hey, button one!' ) )
button_2 = QtGui.QPushButton( "Button One" )
QtCore.QObject.connect( button_2, QtCore.SIGNAL( "clicked()" ), Curry( self.myslot, 'Word, button two!' ) )
It’s just what I needed, this is going into my stash of helpful hints.
Although I am personally switching over to git for my projects, we still use Subversion here at work.
Something I’ve noticed recently is that SVN now stores my passwords in gnome-keyring. This appears to be a feature in version 1.6 and I am running 1.6.5. It seems from that article that it can also use KDE’s Wallet system.
However, I do not use Gnome, and I don’t like KDE wallet. Plus, sometimes it seemed that gnome-keyring would stick on me during a transaction. The only way to fix it was to run another transaction (svn update usually) in another shell.
I finally got sick of it today and Google’d around. Here is the fix I found, edit ~/.subversion/config and add one key.
Easy enough, and once I did everything was a-okay. Hope this helps someone else!
jmhobbs@katya:/var/www/experimental/source$ svn commit -m "SOME MESSAGE"
Password for 'default' GNOME keyring:
Sending SOME FILE
Transmitting file data ...
Committed revision 448.
jmhobbs@katya:/var/www/experimental/source$ vim /home/jmhobbs/.subversion/config
jmhobbs@katya:/var/www/experimental/source$ svn update
Authentication realm: <http://svn.REDACTED.com:80> Private SVN
Password for 'jmhobbs':
ATTENTION! Your password for authentication realm:
<http://svn.REDACTED.com:80> Private SVN
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
Store password unencrypted (yes/no)? yes
At revision 448.
I found a handy trick for making sure things are lining up. You can zoom in on the screen by holding the super key (windows key) and scrolling in/out with your mouse. It gets a little fuzzy, but you can get a good view of about how many pixels off your layout is, then fix it up.
Likewise, windows has an accesibility tool that zooms nicely. It’s a lot crisper, pixelated view, but you have to open a seperate app for it.