ownCloud News Firefox OS application

In continuing to contribute to ownCloud project new version of ownCloud News application for Firefox OS is out. Current version is 0.2.0.

Considering that main ownCloud News application has operations like adding RSS feeds and folders, Firefox OS version is still very immature. Since Firefox OS is not very mature and not in spread use, this application has been ported to Android OS using PhoneGap. After getting over some installing catches, Android version was build and installed on devices. I had two devices to test Android version on:

  • Huawei Ascend Y300 (Android 4.1, 4 inch) and
  • Prestigio Multipad 10.1 Ultimate (Android 4.1, 10.1 inch).

First is gallery of screenshots made on Huawei:

Second gallery are screenshots made on Prestigio tablet:

Things to notice are changes when screen is wider on Huawei. This was easily accomplished by using Twitter Bootstrap framework.

As neat as it is, this application needs a lot of improvements. That is why it needs contribution. That is why I’m inviting every frontend developer and coder who are willing to learn to contribute. It is a great way to learn something new and participate in great project as ownCloud. There are other participants who are willing to give feedback on work.

Anyway, if you are using ownCloud stay tuned for more improvements. If you are not using it, this is a right time to start 🙂


Young programmers rubbish

Hey hey, its been a while.

Hell, its been a while since I logged at my blog as admin. I almost forgot that it even exists 🙂 This is my effort to bring it back from the forgotten.

There isn’t any particular thing I’d like to talk about. There are couple of thing I’ve been doing lately, which might be interesting… to finish 😀

First, its socket programming in C. More precisely, I’m making some coding examples, while learning about sockets in C, and while learning I’m trying to implement very very simple application protocol. It might be a good starting point for newbies. Real usefulness of this protocol would exist, if there was need for it. And there isn’t. Doing it for fun, learning and enthusiasm.

Second, since I’m at last year of my studies, I have a finishing project. At finishing year as a bachelor, students have some practical, every day, problem to solve. As a student of master studies, students have more scientific approach, so problem is little bit more science oriented. For example, my work is based on fortran90 MPI parallelization. While I’m at this one, I’d like to point to one funny site. Its about hacker names for your business card. So, related to that, I’d be something between multicore general and parallelista B-) Nice! Now, back to the science. For now, its all about computing positions of gas particles in cylindrical chamber, and one processor is doing calculation for one particle at the time. Nothing very special. Next is doing statistical based model parallelization, which should be more interesting.

Aaaand, in the mean time, while trying to take some time to rest, I’m reading books. Sci-fi ones 🙂 Last book that I’ve finished is Revelation Space, by Alastair Reynolds. Really nice one. The book I started to read recently is Ready Player One, by Ernest Cline. This one is really cool, and I’m not even at one third of the book 🙂 Guys who like games, would like this one.

So, thats it. Have a good time gaming, reading, programming, listening… Bye!

Using python and pygame

Have you ever heard about Jaql and Jackal Queenston? Very nice electronic music 🙂 Here’s one:

Anyway, now that you are listening and maybe enjoying, we can continue. Reason why I have started to make game in python using pygame module is because some homework. More precisely, I gave a introductory lecture on pygame module at one of my faculty subjects. It is about computer simulations. Final goal, is, I guess, to make some nice computer simulation using python with numpy module. Of course making it visually attractive by drawing it with pygame module. Viewing from the physics point of view, I think the simplest and attractive is simulation of a trajectory of a projectile. That is what I took and made this pocket tanks clone in python/pygame. I won’t go in physics about calculating positions of a projectile, you can read about it on http://en.wikipedia.org/wiki/Trajectory_of_a_projectile. The thing I’m about to speak, is how to make functional, or fairly functional game by your hands.

Now, lets get techy 😎

You will have to make sprites using pygame.sprite module. Sprites have update method and be added in sprites group, but we won’t do that, because it is not necessary. Simple sprite will be just fine.

Events. Pygame has a couple of ways to give you access to events. One way is through pygame.events.get() which returns a list of events. If you put that in a for in loop, you can access one and each event, and scan for mouse button down, key down etc. Of course, scanning for events has to be in engine loop, which can be simulated with a while true loop. Now, making a really simple graphics will do just fine with all introductory python/pygame tutorials. Initializing pygame module, setting up screen size, objects (sprites), while true loop for events scanning and making all visible. But, if your game needs something like modes, where you will be drawing different things according to the current mode, you will either put all that in while loop and make it very, very bad looking, or you can divide modes (scenarios) in methods. I did the second. Game has start, play and pause mode.

Start mode draws welcome text and there is not much in it.

Play mode is where you get all the fun. Drawing stats, rotating cannons, cannonball and terrain line, and above all scanning for events. Yep, the Q is now, how did I scan events, right? Or maybe not… 😐 But I’ll tell you anyway. I did scanning in while true loop and then call method for play mode with events list as it argument. Something like this:

while True:

events = pygame.events.get()
if mode == ‘play’:

I did try to make for in loop for event scanning in the each of mode functions, but it kind of bugged. Really bugged and very unstable. So I did as I showed you.

This may not be the smartest way, though, because some events can be lost while interpreting all that code in play_mode function, for example. Luck with this game is that it is not very intense in user input and this way of event scanning is doing the job. I guess some user input intense game, like collaborative shooting for 2 player will really need better way of getting all input events.

As I said, it is manageable to do it by your bare hands, but I did use some already programmed functions for collisions for example. There is one fine written class for animated sprite, which I used for all sprites, cannon and cannonball.

The links are:

I think you’ll find them very helpful, if you are new to pygame.

That’s it, I wish you to enjoy making games in python/pygame 🙂 Bye!

Parallel programing with MPI and OpenMP

Hey hey ppl!

In past couple of hours I have been writing some seminar about parallel programing. It would be correct to say dozen of hours, but I don’t know if that is grammatically correct? 😐 To be precise, I have been working on source codes couple of days, and it was very strong impression. Unforgettable! How could I forget it when I had just a little sleep 🙂 I’m afraid I’m getting hyperactive and very tired at the same time, so don’t mind if I write nonsense every now and then. Yey 😀 Let’s get to business, or sort of business :S

I wont bug you with the history of parallel programming… It’s just a yatty yatty bla bla big companies having a lot of money to spend on distributed computing research… And so, bla bla they developed tools for making programs execute at the same time on more than one processor… Yatty yatty there were a lot of different implementations with the almost same idea, and they had a deal to make some standards. MPI and OpenMP are well known. Boom, you think we are starting real job now! Wouw! Anyway, different tech for different purposes. MPI is Message Passing Interface. Programmers use it for parallel computing on distributed multicomputers. Distributed multicomputers!!! Now, I’m a smart guy? No, it is just a techy name for… lets say cluster! Wtf is cluster man? 🙂 Ok, lets say you have couple of computers and very fast interconnection between them. At that point you are on good way to have a cluster! All you need is right OSes, and very powerful processors on those computers. Yeah, not to forget a lot of RAM, if you are going to run some serious computations which are RAM expensive. On the other side, there is OpenMP. It is Open Multi Processing. Programmers use it to parallelize program codes on centralized processing machines. SMP if you like it! With it you have the power to fully utilize both processors of your computer, or how many you have them. Cool, I’ll try and run it on GPU. Not! I’m afraid you wont be able, coz OpenMP doesn’t run on GPU processors. Either way, you can make a practical use of it. I just can’t remember any right now. These examples which I’ll talk about are some of use, but not very practical. Hey, who needs to calculate list of prime numbers using Eratosthenes sieve on daily basis?? Not me! Lets explain ideas behind those examples.

So, I did some research on Eratosthenes sieve and sequential program codes, and I’m not nuclear physicist, but I did found some really useless things in some implementations found on net. Gosh, today everyone with Internet connection can write something and publish! Haha, me too! 😀 Tell me I’m goood. Pleaseee??!! Ah, forget it. Back to the subject. I did some research on OpenMP and I decided to try and parallelize Eratosthenes sieve with OpenMP, having already parallelized code with MPI. It was good thing to let programs calculate list and compare needed times for both of them. Since I’m going to give you link to archive containing all source code, I’m not going to get all dirty explaining code. Buuut! I’m going to share with you the results of testing. Those are:

OMP v1 and OMP v2 are two versions of OpenMP parallelized code. Word ukupno means time needed for whole program to finish. As you can see, OpenMP is little bit better in compare to MPI. Of course, MPI has some implicit barriers in collective communications and that is what is keeping it from working as fast as OpenMP.

Anyway, you can download source here, and you will find instructions for running programs.

Have a nice day! Bye!

Gnome terminal scroll doesn’t work

Hey hey, it’s me and I’m here to get you few hints on this problem.
So let us begin.
As serious Linux user, I always use terminal. Since I’m Gnome user, I use default terminal called gnome-terminal. Using it for administration and programming, makes me want to change it’s profile, to make it look relaxing for my eyes. So I did some changes and also removed scroll function from terminal when I’m in vim or viewing man pages. That was big mistake, and I did not realize what I’ve done that moment. So after a while, I was stuck in vim or man pages using keyboard up and down keys. Pain in the aaaday 🙂 I tried to find some answers on google knowing that someone was also having the same problem. But I guess not. Or I did not have patience to look for it long enough.
Then I realized I have to do some searching through options in gconf-editor. Handy little thing. After searching scroll, mouse, terminal I have found that Gnome keeps the default profile of terminal with a lot of options, and profiles that you make has few options. First of them is alternate screen scroll. That is our problem. If it is unchecked, then you can’t scroll when you are in VIM or viewing MAN pages. After you check it, you will be able to do that.
Now I can relax in chair scrolling up and down through my code in C never bothering to do up down navigation by keyboard. Yey!

PHP Symfony Editor ?

Hey hey! Fresh stuff again! 🙂 This time it is symfony again!

Lets cut the chatting and get straight to the point!

What IDE are you using? Is it fast, is it comfortable, does it have plugins for Symfony?

You are saying, yeess, NetBeans has it, though it is not very fast 😦 All that Java is eating my memory…

If you have it a lot, that that is not a prob, but what if you are short with that resource??? Lets say you have, oh I don’t know, a virtual machine, which you use for developing. You don’t want all that projects, files and junk to be in your sweet home and to look it every day in your spare time :D. So you make virtual machine and use it to do all the work, then shut it down, and the nightmare is forgotten. YEY! But in case you do not have a resource monster computer, or some kinda super computer, virtual machine will have less RAM than host on which you are running it. That is the main part, where you might have the problems with NetBeans or Eclipse. They are sooo sloow on virtual machines… Or I am not well informed, and I do not know some hints to make them faster. If you do, please inform me below 🙂


I went some googling about php editor which has support for symfony. There were NetBeans (newest version), Eclipse (with its plugins), PHPEdit (which is shareware, and being a student, I don’t have too much money to spare on software), Komodo IDE (shareware), but WAIT! Komodo Editor!?

That is free, as in speech, dynamic languages editor. Mmmm nice? PHP, Python, Shell, Perl etc. Mmm nice!!! Built in C++!? Weeell, it is based on Mozzila Framework, which among all includes C++ libraries. Faster than NetBeans or Eclipse, which are Java based… Has some plugins for symfony… WOW! You must be dying from wish to try it! 🙂

Here you go http://www.openkomodo.com/ Komodo Edit

So you download it, and what? How, to use if for developing Symfony projects??? That is the right question! And, since this post took me some time, I’ll describe basic project generation in this post.

I’d be very interested in reading your comments, because I see some interest in symfony… Bye 🙂