Main >

Viraptor's dev-log

Your mind-fluffer hopefully

Gtk# animation

on December 16th, 2007

Information for anyone, who is looking for solution to not-refreshing DrawingArea on google and is finding only questions about it :)

You shouldn’t touch DrawingArea from anything else than original gtk/glib thread. That means doing:

drawingArea.QueueDraw();
// or
drawingArea.GdkWindow.ProcessUpdates(...);
// and others

from System.Threading.Timer callback won’t do any good. Window may start updating in the first case after resizing of the window, and update only while resizing in second case, but that’s probably undefined random behaviour. Proper way to handle refreshing (as far as information from different mailing lists put together suggest) is:

uint animationTimer = GLib.Timeout.Add(
	milisecs,
	new GLib.TimeoutHandler(onAnimationTimer));
...
bool onAnimationTimer() {
  drawingArea.QueueDraw();
  return true;
}

Hope that helps if you were trying to achieve animation.

So long, and thanks for all the emails

on September 16th, 2007

Message to all the people, who protected their email by changing “@” to AT and “.” to DOT. Thank you for making it easier to find.

Typically large number of emails are hard to find through google / other search engines. Thanks to email “protection” it’s just fun now. Why? Searching for “@gmail.com” on google will be probably the same as searching for “gmail com”, because special characters are stripped. You would expect to get many pages containing gmail addresses, but instead you get lots of pages talking about gmail.

Now that you’ve protected your email and it looks like “abcd AT example DOT com”, I can just google “at example dot com” and get your precious address. It’s great, because I’m sure it’s not a trap - why would you protect a trap address? Posting “abcd-(At]-example={doT)com” won’t help you either, as google ignores special characters - remember?

Now some stats from google:

  • 2,100,000 for “at gmail dot com”
  • 2,650,000 for “at gmail com” (thanks to pipermail!)
  • 85,900 for +at “no spam” “dot com” and 255,000 for +at nospam “dot com” (you’d like to hide - wouldn’t you?)

These numbers are not very accurate of course. Some addresses will be duplicated across many pages and some pages will have multiple addresses included. Anyways - these are big numbers.

All modifications are of course easy to cancel - change at to “@”, dot to “.”, delete “no spam”, or “cut” written in any possible way, delete spaces and you’ve got a great email for spamming. Next time you try to protect your address (or even worse - my address) - please think what you’re doing. Thanks.

Mono-1.2.4 in feisty

on May 28th, 2007

Repo at www.viraptor.info/repo has been updated with backport of libgdiplus and mono-1.2.4 from gusty.

Enjoy!

Backports repository

on May 20th, 2007

As suggested before, I’ve created an Ubuntu Feisty backport repository for mono stuff. Monodevelop & deps from Gusty is already available. Line for your sources.list is:

deb http://www.viraptor.info/repo feisty-custombackports contrib

Have fun!
I hope that mono 1.2.4 will hit that repo soon also.

Correct link

on May 16th, 2007

For those coming from news site -> correct link is http://www.viraptor.info/dm.php5 - not the main site :)

Psi logs merging

on May 3rd, 2007

Did you ever change your jabber server?
Lost possibility to browse chat history?

(yes - that does sound like a bad commercial)

You can use PsiLogMerger, to resolve this. Specify translations -> for example -t msn.firsthost.com=msn.secondhost.com will update logs from secondhost only with all messages from firsthost, skipping duplicates.

Needs only ruby to run. Run with -h for usage help. Have fun.

Google indexing

on February 27th, 2007

Now, that I’ve added adwords and ggl search to DailyMotion, Veoh, etc. videos browser, google stopped indexing me. Seriously, what’s wrong with them? Index me, link’s there…

Maildirs merging

on January 10th, 2007

Lately, I’ve run into a problem after moving hosting server from one provider to another. There were some old mails in backed-up maildirs and some new mails in current maildirs. For some reason mailutil from pine package didn’t want to transfer old mails. New mails of course had to stay, and old boxes had to me merged with all attributes saved. For some other reason perl script I’ve found didn’t work also (based on Mail::Folder::Maildir).

Fortunately fast simple hacked script using Mail::Box::Maildir worked with no problems. In case you’d like to do the same - run it with full path to source maildir in first arg and destination maildir in second:

#!/usr/bin/perl
use Mail::Box::Maildir;
use Mail::Box::Manager;
my $src = shift @ARGV;
my $dest = shift @ARGV;
my $mgr = new Mail::Box::Manager;

my $mb = $mgr->open(
folder => $src,
access => 'r',
type => 'Mail::Box::Maildir')
or die "error: $!";

my $nmb = $mgr->open(
folder => $dest,
access => 'rw',
create => 1,
type => 'Mail::Box::Maildir')
or die "error: $!";

$mb->copyTo($nmb, select => 'ALL',
subfolders => 'RECURSE');
$mgr->closeAllFolders();

C# shell

on December 21st, 2006

C-sharp shell? Great!

Although my friend, when asked whether he would like to have a shell with bindings to Java, replied “System.out.println(”NO”);”… I was playing around with different shells. Zoidberg (perl), psh (perl), zsh (almost normal), etc.

Power shell would be nice, if it didn’t try to export objects into some strange new shell language constructs (cmdlets). If the thing they wanted to achieve was similarity to shell, then normal stripping of “()” and “,”, that can be deduced from context would be enough… Of course making some namespace default for searching objects (Cssh.Something), would be appropriate. “Var” keyword from C# v.3 can also come handy.
I haven’t tried cssh yet, but I can’t wait to do it! Downloading as I write it.

Just downloaded… It’s probably NOT what you’d like to use - it’s just for files, but a good start anyway.

PowerShell port was already proposed, but author doesn’t respond to emails, so project was probably dropped. Still - it’s nice to see, that some people want to get the same things I do…

As most people shout “Yet another shell and object one? NOOOOOOOOOO!!!!!!!” while reading this, I’ll tell what I want in a real linux object shell and why I’d like it to be there:

  1. foreach(i in Interfaces) if(!i.IsAlias) echo Format(”interface {0}: {1}”, i.Name, i.Ip);
  2. echo Partitions[”/dev/hda”].Capacity
  3. echo new Ping(”10.1.1.29″).GetAverage(5)
  4. prcs = Processes.Get(”terminal-name”)
    foreach(prc in prcs) if(!Processes.Current.IsChildOf(prc)) Kill(prc);
  5. Iptables.Add(”Input”, new Iptables.SourceFilter(”127.0.0.1″), Iptables.ACCEPT)
    (even if that doesn’t seem that nice in this case - think about creating one SourceFilter (or some complex ‘pseudo-query’ object) from other sources (network monitoring?) and using it to create rules in real-time.
  6. Autocomplete objects through Reflection with tab button - easy

You know what processes are there - no need to grep ps. You get numbers you want - no need for awk. You know what was the problem, because of exceptions - no need to browse man for return code listings. You want to run commands - there are no problems with quotes in command / quotes in your command line / quotes in file arguments - there are only Strings.

PS1: I only found original post by google alerts - try it out :)
PS2: There was a c# shell - discontinued unfortunately :( But in case it disappears, I’ve got sources… in case…

Mono-1.2.2.1 is out for Ubuntu

on December 14th, 2006

Mono version 1.2.2.1 is already in source repos for feisty, so it’s time to upgrade it in edgy also.

As usual: get mono .deb packages. This time if you want sqlite*.0-cil, you’ll also need new libsqlite itself. It’s provided along with main packages.

For those suspicious - yes - 1.2.2.1 exists officially, but the main www.mono-project.org page is a bit laggy with updates lately. I told that to mono guys yesterday, so there may be some update in a short time.

Dependencies provided: sqlite (with lemon), libgdiplus, cli-common.
Additional stuff: prj2make-sharp.

I’ve noticed some search hits for ubuntu and mono from google, so I’ll probably keep the tradition of posting new debs ASAP (that means as soon as they’re in feisty and if I’m still stuck with edgy).