How to fix the Logitech K400 keyword on Raspberry Pi

Recently I bought a Raspberry Pi Model B to be honest, more from curiosity + a Logitech K400r keyboard.

Even though I read some forums before regarding the problems between the rpi and the k400r keyboard, I decided to buy them saying, oh well, I can be on the lucky side. I wasn’t.

Or at least that’s what I thought :)

So, what to do first with the little thing? A media center of course. So I installed Raspbmc (latest stable release) at work with a wired keyboard. All good. Everything went smooth, without problems. Once I got home where I have the K400r wireless keyboard, I realised that the Raspberry Pi is not responding to any keyboard presses. So next thing to do was to search over the internet for fixes, some of them like: Kernel Rebuilding, some configuration files editing, installation of drivers, changing the receiver and so on. NONE OF THEM WORKED. I lost many hours trying to fix this issue before dropping Raspbmc.

Next: I installed Openelec. Same thing. Nothing worked.

After extending the searches, I found a solution on a forum and I said, no way it’s too easy. But, IT WORKED.

The thing is that before I put the keyboard on Raspberry PI, I put in on my laptop and after I finished testing the keyboard, I unpaired the receiver and the keyboard. That was the problem. That thing made me lose so many hours.

So, if you have a Raspberry Pi and Logitech K400R wireless keyboard, make sure the small receiver and the keyboard are paired first, and only after that, if it’s still not working, try the other stuff.

How to focus a popup with javascript without reloading it

Recently I’ve been challenged to focus a popup when clicking on the same link that opened the popup. After some research on google and stackoverflow, I decided to compile the findings into one small tutorial about this issue.

1. I will make a link example that opens a popup:

<a href="javascript:void(0);" onclick="'page_example.html', 'popupexample', 'width=450, height:450');">Open Popup</a>

The problem here is that whenever you click on this link the popup will refresh if already exists. If it doesn’t exist, we all know that it will be created.

Next step is to make a function that will be called when you click on this link.

2. Let’s create the function that opens the popup:

function popupOpen(target_url, window_name){, window_name, 'width=450, height=450');


As you can see, this function receives 2(two) params that will help you open flexible popups in the future:

  1. target_url: which, in our example is ‘page_example.html’
  2. window_name: which, in our example is popupexample. Be very careful with the window name, because the Internet Explorer doesn’t accept spaces in it.

3. Now, let’s modify the link to use the function above:

<a href="javascript:void(0);" onclick="popupOpen('page_example.html', 'popupexample');">Open Popup</a>

So now, we have the link the uses the function which creates the popup.

We need to make the function know if the popup already exists so when called, will focus the popup if it does. In order to do this, we will we create an object that will hold every opened popup.

4. Create the object that will hold all the popups and modify the function to insert the popups in it and the focus them:

var popups_holder = new Object();
function popupOpen(target_url, window_name){

    if(typeof(popups_holder[window_name]) == undefined || typeof(popups_holder[window_name]) == 'undefined'){
         var w =, window_name, 'width=450, height=450');
         popups_holder[window_name] = w;


Now when you click on the link, if the popup exists in the popups created object, it will be focused without refreshing the content. Otherwise it will be created and added to the popups object.

Basically that’s it. No rocket science, no special effects.

Later on, I will create a page where you can test the code and I will take the tutorial even further, with page reload and other failure points.

50mm photograpy

wild fire
Wild Fire

Starting this week, a new section appeared: 50mm photography.

Here I will post photos shot by me, from day to day life as we don’t really see it (or we do, but we ignore it).

Most of the pictures will be presented as shot. Some will be good, some bad, I don’t care. They are as they are.

The pictures are taken with a Nikon D80 Body and a Nikkor 1:1.4D Lens.

Starting next week, I will introduce a category called Urban Life In Romania.

I hope you’ll gonna like it.



MySQL backup PHP helper

My job requires a lot of manually database backups. And believe me, it slowly becomes a nightmare.

So, I started looking for an easy way to backup the database. In my Google searches I found this article:, which is very good.

You can add this code in a page, paste your database credentials, setup a cron job and that’s it, you have the database backups.

My question is: What if you want to backup your MySQL database manually from time to time?

Continue reading MySQL backup PHP helper

Javascript charts for your web application

If you are looking for a good charts tool for your web application or web site, you might want to consider using JS Charts:

Basically it’s a Javascript Library. I’ve used it in several applications so far, and I can tell you this thing is great. Is easy to use and configure, flexible, cross-platform and highly customizable.

For start you can use the free version, but a watermark will appear on every generated chart.

Happy 2012!

2012 has come. Some say that this is the last year. Is it? I hope not, because I have big plans for this year.

Currently I’m involved in more projects: AVChat IM, which was detailed in a previous article (but between us, the IM gets better and better and the version presented in that article looks so far away now) and some company websites.

As you can see, I changed the website again.  I did it because it reflects me and my work progress better. In my opinion it looks more mature. But I can be wrong. So, any feedback would be highly appreciated.

I don’t know what else to say. I’m not that good at words (this is reflected also in my writing frequency). I will do my best to write more.

P.S. : I somehow don’t believe in New Year’s Resolutions, but this year I want to double my portfolio and triple the provided quality. Fingers crossed.

The new AVChat IM

Lately I somehow ignored all the projects I started because of the new AVChat IM version.

What is AVChat IM?

Well, it’s an instant messenger (obvious :) ) incredibly fast for websites. The greatest thing about it is that you, as webmaster or site owner you don’t need any server-side setup. You just need to insert into your website some few lines of code and we take care of the rest. More than that, if you have a website based on Joomla! (1.5, 1.6 or 1.7) with JomSocial or Community Builder, Social Engine (3 or 4), vldPersonals (2.x) or phpFox (2.x) it’s even easier. We have prepared plugins  for each of these platforms that require just few clicks to install.

Want to know what AVChat IM can do?

Continue reading The new AVChat IM

New blog design

I’m sure you noticed that I made some design changes and I truly hope that you like it more now.
In the near future, some new sections will appear, such as:
  • My Portfolio
  • Hobby(ies)
  • What I’m currently working on

Also if you have any content suggestions , I’m open :)