• Da ne zaboravim _\\//

    Da ne zaboravim _\\//

    craptop
    [2009-03-04 19:08] installed filesystem (2009.01-1)
    [2009-03-04 20:35] synchronizing package lists
    [11.09.2012] R.I.P. (3y6m7d / 1287 days)

    kanta
    [2009-03-07 20:18] installed filesystem (2009.01-1)
    [2009-03-07 21:15] synchronizing package lists

    Long live Arch.

  • How to fix Ctrl-Tab behavior in Kate?

    Kate has tabs turned off by default (at least that’s what you get with vanilla Kate package from Arch Linux repositories) and even when you turn them on, they act kinda funky because Kate switches between tabs by name order, rather than by opening order so what happens is that Ctrl-Tab starts jumping between your tabs instead of going from one to another, from left to right. That was quite confusing to me, and I wanted to change that behavior to what I’m already used to in browsers, GEdit, Pidgin, whatever… Finding a solution (a very well camouflaged one for that matter, thank you) to this situation was rather… unexpected.

    To turn tabs on (if they’re not turned on by default in your distro) you will first have to go to Settings -> Configure Kate -> Plugins and turn on either “Tab Bar” or “Multiline Tab Bar”. Try both and then decide which one suits you better. After that you will have to set up the shortcut for switching between tabs. To do that, go to Settings -> Configure Shortcuts and set the shortcut for Forward to Ctrl-Tab. You could as well set up alternate shortcuts: Alt+1 for Back and Alt+2 for Forward. You will be able to toggle tabs in both directions then easily.

    To fix the tab switching behavior (ordering), open the Documents column from the File System Browser (if you have it turned off, turn it on under plugins), right-click on it and choose Opening Order from Sort By in the drop-down menu.

    That’s it, enjoy!

  • How to add a YouTube channel feed to Google Reader?

    rss

    Before they rehauled Google Reader for G+ you could import a YouTube channel feeds into your Google Reader just by copying and pasting channels link into Google Reader, no problem. A link that looks like this used to work:

    http://www.youtube.com/user/CHANNEL_NAME

    But, now it doesn’t work any more (I wonder why they broke it and why isn’t it fixed?).. Fortunately I was left with some of the older YT feeds that still worked so I looked at how their links look now. What you can now do to import channels into Google Reader is to use this link form:

    http://gdata.youtube.com/feeds/base/users/CHANNEL_NAME/uploads?alt=rss&v=2&orderby=published&amp

    Make sure to replace CHANNEL_NAME with your desired channel name and there you have it.

  • Swarm Intelligence in HTML5 Canvas

    Swarm Intelligence in HTML5 Canvas

    Swarm Intelligence – I wanted to visualize different ways of particles following each other for some time now but have never really gotten to the point of doing it until one day, I was browsing through lots of amazing things people have made using HTML5 Canvas. One of these things was Daniel Puhes Liquid Particles canvas thingy which immediately reminded me of my idea and I thought – why not try and do it using HTML5 canvas? I wanted to try canvas out a little bit anyway. So, I asked Daniel for permission to use his code as an “engine” for my idea and he was ok with that. Thanks Daniel! He also made some more pretty cool stuff so go and check that out if you want.

    So I took his code, refactored it a fair bit, made it so that particles follow each other instead of following the mouse and that’s how Swarm Intelligence was born. I do know that this is not real AI but I don’t care, I just like to call it that way anyways. :)

    At the moment there are three different algorithms that make particles follow each other:

    • swarm – each particle targets a random particle from the swarm and follows it for next 5000-10000 canvas refresh cycles. after that, it randomly finds a new one and follows it for next 5000-10000 refresh cycles and so on
    • tail – each particle targets a different random particle on each canvas refresh cycle and follows it for a single refresh cycle after which it targets a new random particle and then follows than one for a single refresh cycle and so on
    • lead – all particles follow the same (single) particle which moves randomly inside the canvas a bit faster than all the other particles

    Algorithms change randomly over time but can also be changed manually by clicking  the left mouse button somewhere inside the canvas. I also introduced some chaos into the system so it wouldn’t stabilize itself over time. For example, every now and then some particles get randomly blown away from the swarm a little bit. Also, after some time all the particles will get blown away at the same time. I plan to add two or three more following algorithms when I get the time. One of them will be following the nearest particle but I will have to come up with one bad-ass algorithm to not kill the performance. Soon I guess. Or not. :D

    Algorithm indicator in the top left corner of the canvas introduced some performance problems. Apparently, drawing text inside canvas is very, very poorly implemented in all browsers except Chromium. The problem I had was that I would redraw a line of text inside canvas on each refresh cycle (every 70ms) which slowed it down a fair bit if you tried to run it in anything else except Chromium. Redrawing the text on each cycle wasn’t really necessary since the text stays the same most of the time so what I did was – on top of the old canvas frame I added a new one which redraws text only when the following algorithm gets changed. That turned out to be a pretty good solution.

    Nothing more to say about this small experiment I guess.. except – enjoy it! :)

  • Making sound files for REminiscence (Flashback) work

    As REminiscence README indicates (“To hear background music during polygonal cutscenes with the PC version, you’ll need to copy the .mod files of the Amiga version”), you will have to copy Flashback sound files into the DATA directory within your REminiscence directory. They can be obtained here. After you have downloaded and extracted the files, you will rename them as follows:

    ascenseur -----> mod.flashback-ascenseur
    ceinture ------> mod.flashback-ceinturea
    chute ---------> mod.flashback-chute
    debut ---------> mod.flashback-jungle
    desinteg ------> mod.flashback-desintegr
    donneobj ------> mod.flashback-donneobjt
    fin -----------> mod.flashback-fin
    game_over -----> mod.flashback-game_over
    holocube ------> mod.flashback-holocube
    intro ---------> mod.flashback-introb
    journal -------> mod.flashback-options1
    level4 --------> mod.flashback-teleporta
    logo ----------> mod.flashback-logo
    memoire -------> mod.flashback-memoire
    missions ------> mod.flashback-missionca
    missions2 -----> mod.flashback-fin2
    options -------> mod.flashback-options2
    planetexplo ---> mod.flashback-teleport2
    reunion -------> mod.flashback-reunion
    taxi ----------> mod.flashback-taxi
    voyage --------> mod.flashback-voyage

    If you did everything properly, you should hear this beautiful music after you launch REminiscence (and all the other music clips throughout the game of course).. Voila!

  • My first open-source code contribution – spilp

    My first open-source code contribution – spilp

    Spilp is a simple Python script that takes IIS logs, parses them and creates statistical reports which can be used to discover unusual IP activity more easily.”

    ‘Been working on this one for some time now and finally everything I wanted to implement is in place. The whole thing is released under GNU GPL v3 license for everybody to enjoy. You can download the script here. Below is a list of spilp features with links to sample reports.

    Features

    • extracts a list of IP addresses with number of hits they made sorted by number of hits
    • extracts a list of “close” IP addresses that made a certain number of hits
    • extracts a list of user agents sorted by number of hits
    • extracts a list of cs-method hits (GET method excluded)
    • extracts a list of file hits sorted by number of hits
    • extracts extended information for document and web file hits
      • includes timestamps, client IP addresses, methods, ports, user agent details and http status codes
    • extracts a list of “unusual” http status code hits sorted by number of hits
      • client IP address list
      • a list of files hit by an IP and number of hits for that file
    • filtering results (include or exclude filtering – works in “either-or” way)
      • ability to auto-generate an IP range list as a filter
    • reverse DNS country lookup using MaxMinds? GeoIP country downloadable database
      • additional info in certain reports
      • filtering results by country of origin (as a separate filtering option using spilpconf.py file)
    • ability to process large amount of IIS log files
    • CONFIG file for performance and output tweaking
    Rejoice!
Back to top