Don’t use += loops on Strings for duke’s sake…!

Posted by Ktoso under coding, java, polish (1 Respond)

It’s always kinda shocking to see that such easy tasks, and what I’ve always thought to be “common knowledge“, are not that common among some students… One such thing is always using the += on strings in Java… C’mon, everybody knows that + and += are horribly slow. Yeah, I know that when used outside [...]

Tags: , ,

Terminal Heroes 8: Memory usage scripts

Posted by Ktoso under coding, terminal heroes (No Respond)

I have a low-memory VPS running online and thus always have to worry about what uses how much memory… Of course top and my favorite htop are very good tools to check this, but sometimes I just want to get a super simple report if I’m overusing memory or not yet. The bellow scripts (most [...]

Tags: , , , , , , ,

(Almost) Automatically convert files into PDF

Posted by Ktoso under coding, freedom, fun, terminal heroes (No Respond)

I’m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( http://www.icsr.agh.edu.pl/~mownit/mownit.html ). I was really happy to see some *.ps but some people from my fellow students started complaining that they’d rather have pdf’s and not ghostscript files (who knows why they’d do..?). [...]

Tags: , , , , , , , , , , , , , ,

Fixing Blender problems on IntelGMAX4500

Posted by Ktoso under coding, freedom, guide (No Respond)

I’ve recently bought a new laptop, a 15.6” HP Probook, that replaced my netbook Asus EEE 900 (needed some bigger hardware to work on “on the move”). One problem I encountered was blender not displaying correctly if I’d expand any dropdown menu etc. The fix is very simple yet powerfull, just set the following: LIBGL_ALWAYS_SOFTWARE=1 [...]

Tags: , , , , ,

Blender – 04 – Simple Present

Posted by Ktoso under coding, fun (No Respond)

With this simple box i’ve learned a little about the “wave” property in blender. This, a little subsurv and smooth subdivision can actually be quite OK for creating a simple ribbon like the one below:The final render looked like this:

Tags: , , , , , , ,

Vim Hacking – 1 – vis

Posted by Ktoso under coding, terminal heroes (No Respond)

Vim is a really amazing text editor (though I’d like to learn Emacs too soon… :-)) and it can be easily expanded to be even more useful. One super cool extension I found is: vis — it allows powerful sed-like line modification (you could use sed from inside vim, but that’s not really “handy”). Vis [...]

Tags: , , , , , , ,

Terminal Heroes – 6 – Track X events

Posted by Ktoso under coding, fun, terminal heroes (No Respond)

Another Command Line Fu oneliner I’ve sumbited today: #show X window events in chosen window $ xev -id `xwininfo | grep 'Window id' | awk '{print $4}'` EnterNotify event, serial 13, synthetic NO, window 0×6400053,     root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),     mode NotifyNormal, detail NotifyVirtual, same_screen YES,     [...]

Tags: , , , , , , , , ,

Terminal Heroes – 5 – List internet active apps

Posted by Ktoso under coding, fun, terminal heroes (No Respond)

A simple yet usefull command-line-fu I made up: #list all internet active apps $ netstat -lantp | grep -i establ | awk -F/ '{print $2}' | sort | uniq   firefox java pidgin thunderbird-b Lookup this command at CommandLineFu Thanks to HarimaKenji for fixing a little issue with this command. —update— CommandLineFu user submited a [...]

Tags: , , , , , , ,

Fedora: Installing single apps from Rawhide

Posted by Ktoso under coding, freedom (No Respond)

I really love the Exaile gnome music player, and not so long ago version 0.3.0 was released. First thing i did was of course wget && tar xzvf && make && su -c ‘make install’ ;-) but… I’d rather have a version from the repository, to update it easily. As no package for Fedora 11 [...]

Tags: , , , , , , ,

mencoder mastery – part 2

Posted by Ktoso under coding (No Respond)

Tym razem małe polecenie włączające zewnątrzny plik mp3 (z ogg zadziała tak samo): #poniższe polecenie bierze plik old.avi, i łącząc go z sound.mp3 (zachowując jego codec audio) tworzy plik new.avi mencoder old.avi -o new.avi -ovc copy -oac copy -audiofile sound.mp3 #analogicznie możemy wziąć plik audio w innym formacie i przetworzyć go np na mp3, wtedy [...]

Tags: , , , , ,