Posted by & filed under article.

From the first time I started to play with OpenGL (which was with this Android application) I found it quite time consuming. Modeling objects from vectors and coordinates in 3D space means that not only do you need to figure out how you would draw the part, but also its points and position in space. On the bright side it can be quite satisfying when drawing, as you gain full control of how the lines and drawn and shapes are created.

Luckely for me, I am still a student where I am currently taking a course in computer graphics. In my first assignment I created a helicopter. I cant say that this is fully developed as it is missing a lot of essential parts, however its a foundation and it got rotors!


During the development of the helicopter I put some effort in making the blades adjusting according to the speed. This means that when the rotor is standing still, the wings will be slightly tilted. When the rotors start the blades will be slightly straighten out and as the speed increases to its max speed where the blades will be fully straightened out.

The helicopter class and example can be downloaded here OpenGL Helicopter. Feel free to test it or use it in your project. The helicopter as a speed ranging from 0 to 10 and its ajusted by increasing or decreasing its value with .setSpeed().

Helicopter hc = new Helicopter();

Also remember that the helicopter is updated in the display method where the GL object is passed onto the draw method of the helicopter.


If you extend or use this helicopter it would be nice to see your results. Happy coding!

Posted by & filed under article.

During an implementation of vSlider for my wordpress, I discovered later on that it disables the insert new media button when trying to insert a image into a blog post. While it works perfectly to open the add media and upload and browse images, it is not possible to insert the selected image  into the article.

During debugging of the vSlider plugin I discovered where things went wrong. In the file custome.js located in includes/js/custom.js

On the proximate line 210, there is a function assignment to window.send_to_editor that assigns a new callback function. Now this overrides the send_to_editor function that is already assigned when the vSlider plugin is loaded.

window.send_to_editor = function(html) {
  imgurl = jQuery('img',html).attr('src');
  jQuery('#image_path'+id).val(imgurl); /*assign the value to the input*/

Since this JavaScript is loaded for all the admin-pages, the quick solution would be to restrict the JavaScript to only be loaded when required.

The solution to this, is to locate the register.php in plugins/vslider/includes/. Edit register.php and look for the original line

add_action( ‘admin_footer’, ‘enqueue_vslider_admin_scripts’ );

This function adds all JavaScript functions that vSlider requires on every admin page. Now as mentioned, these files are added to the admin_footer, which is located on every admin page. So when the script custome.js is loaded, it will not work as it is overwritten.

By changing the add_action( ‘admin_footer’, ‘enqueue_vslider_admin_scripts’ ); to add_action( ‘admin_enqueue_scripts’, ‘enqueue_vslider_admin_scripts‘ ); and adding a if statement in top of the function, checking for the plugin page to be vSlider (see code below) we can tell WordPress to only load the vSlider files, when actually needed in WordPress.

function enqueue_vslider_admin_scripts($hook) {
    if( 'toplevel_page_vslider' != $hook )
	wp_enqueue_script( 'prettyPhoto-js', VSLIDER_URL.'/includes/js/jquery.prettyPhoto.js', array('jquery'));
	wp_enqueue_script( 'flexslider', VSLIDER_URL.'/js/jquery.flexslider-min.js', array('jquery'));
	global $vslider_script;
	echo '<script type="text/javascript">'.$vslider_script.'</script>';
	wp_enqueue_script( 'ajax-script', VSLIDER_URL.'/includes/js/custom.js', array('jquery'));
add_action( 'admin_enqueue_scripts', 'enqueue_vslider_admin_scripts' );

Hope they make an update for this soon, as vSlider is a great plugin for WordPress.

Posted by & filed under article.

In my latest discovery of web-sockets and its potential I started playing with different ideas build on the Amazon AWS cloud. The resulting idea is to make a quiz where you need to supply the answers in QR fashionable way. You open the quiz on your phone by scanning a QR code taking you to the webpage with the quiz. Once the quiz is loaded, a web-socket connection is established. Continuing to the quiz overview you are allowed to select the first question before you can continue. This question needs to be solved before one can continue. While opening the question you are presented with the question and a text field to make your answer. Once pressing the button to answer your answer is converted to a QR code. This QR code is encoded with a identifying token, the number representing which question you are replying as well as the answer it self. In order to continue the quiz, you will need to scan your QR code in the camera to the hosts machine or the quiz master machine. The QR image is decoded and the answer is checked. The hosts machine will then message the client browser and depending on your answer if it was right or wrong, the browser will then automatically navigate to a response page.


This kind of loop makes it possible for the user to search for the question from anywhere, but in order to check its correctness the user is required to bring the phone back to the hosts machine and get the answer validated. The solution might not be politically correct as the user are allowed to use any form of help to reach the question and it serves more as a playful approach to the way quizzes are held.


Above is a screenshot from the desktop machine also known as the quiz master. The webcam feed is shown in the upper left corner to help the users to navigate the QR code accordingly to the webcam. To indicate that the QR code is valid and converted, a green box pops up to give a visual feedback that it has successfully got the content from the QR.


Posted by & filed under article.

Yeah, seems like we finally got here. Joomla have lost the battle against WordPress, most due to its inconvenient user interface and customization and not to forget the users perspective of whats expected usage. “No need to bring an army to a battle of chess”.

As updates are done and wildly experimenting with rerouting and reorganizing my stuff will show that none of the “casual” links will work any more. The temporary image service has been relocated here: Enjoy!

For whats to come, my current development evolves C# development in Unity 3D with ReacTIVision integrated user interface. This is extremely exiting and I will make sure to make an update asap!

Posted by & filed under article.

It seems like the user is more willing to click on a link presented on Facebook by “trusted” friends and acquaintances. The tolerance bar is lowered and the level of acceptance for approving and checking out user posted links, seems extremely low. It still baffles me the way some links screams out; “See what this collage student did this summer break”, where it also screams out; “Do not click this, probably a scam”. Although not all people see these warning signs and live in good faith that a friend wont post anything that might harm or abuse your account. I have already mentioned how linked titles may drag people towards clicking them. Further I would like to introduce a second way of deception and make you aware of such challenges you may face when browsing the friends feed.

Back in October I faced a bogus friend request on Facebook. At first it was ignored as the user account had just been created and I did not know this person. Later that month I did recall from one of my classes that certain people with evil intentions would use Facebook to gain personal access. At that point I assumed the unknown Facebook person was a classmate that would like to have fun and prank fellow students. At the end of the month the unknown account had added my school as a network and soon we had 32 friends in common.

In order to figure out who this person was, I would first require their IP address to determine where it was located. At first I made a simple PHP script that extracts location and browser information. I gathered all information segments from $_SERVER. If your interested in what information it contains, just use print_r($_SERVER) to list every thing.

I now had a way of acquire the information that’s easy to extract. However I would need to get the user to access this unique link and I needed an approach that would make it irresistible for the user to access the link. Then I got the idea! Why not use an image? When you add a link to Facebook or include it in a message, Facebook will automatically bring a thumbnail of the image inside with the message. I engineered the file image.php that will output the image itself and extract the location and browser information and serve this information to my mail inbox. Now just linking the full link of my website and image.php might throw the unknown user off and result in a failed attempt, I had to make it more reliable.

Creating a .htaccess document was the solution. By enable the rewrite engine on my server directory I could make fake.jpg point at the file image.php. This will mean that when someone accesses the fake.jpg they will see an image and they will see the file extension .jpg although what the server is presenting is image.php. At this point I am good to go, however I would like to give the user a feedback of, “lol I got you”. To acquire this I decided to figure out what happened when Facebook generates the thumbnail. I quickly learned that by looking for “facebookexternalhit” in the variable $_SERVER[“HTTP_USER_AGENT”] I could know that this is Facebook servers accessing my image. Therefor I decided to present the deceptive image as a thumbnail and when the user actually accesses the image I would present a new image of a troll.

The logic for this is created as follow:

header('Content-Type: image/jpeg');
if(preg_match("/facebookexternalhit/i", $_SERVER["HTTP_USER_AGENT"], $matches)) {
} else {


Finally its time to create the message to go with the image. The final message was saying: “Hey, Is this you from my town?” and the linked image. A screen shot from the original post is seen below.


After the user clicks the link, it will present the following image:


Feel free to check out the final result for yourself with this link: Disclaimer: I have removed the data extraction of browser information and emailing.

As you might have observed on the image of the Facebook message, the message was viewed one day later. Not surprisingly the user clicked the link where I achieved the IP address and browser information. After checking the IP address with I could determine that this actually was a user from New York. The browser information slightly confirmed that the the browser used was configured to en-US language and that this probably is a deep cover for identity lurking or some one exploring for the sake of fun.

Posted by & filed under android.


Some people need challenges to do stuff, I am one of them. From the Enigma Android challenge of the month I tested out the sensor technique to act out as an extension of the hand. This month challenge was to make a rock, paper, scissors application. It was quite fun to play with and the implementation was straight forward, tho I do recommend following a tutorial for the initial setup.

From whats worth taking away, the sensor is very sensitive and even if the phone is just flat out on the table it will still compute some very low numbers. You might have to find out what boundaries to act on in your own case. Also the sensor uses a loot of power when its in use, so wort turning it off when application enters onPause etc..

The app it self is uploaded to Google Play and can be accessed here: