Roy Triesscheijn’s Weblog

My programming world

Archive for March, 2011

REST Echo Service

Posted by Roy Triesscheijn on 23rd March 2011

Today I was working on a JAVA program that had to send GET requests to a RESTFul webservice. For debugging purposes I wanted to make sure that my program send the key-value pairs in such a way that PHP (and other web scripts) would understand it. Of course I could c/p the output URL and check it by hand, but errors can creep up easily that way.

The script (really 3 lines of PHP and a few lines of HTML) echos all the GET key-value pairs so that you can easily check if everything is alright (for example check if the URLEncoding worked) .

To use the scrip just navigate your program to http://roy-t.nl/services/RESTEcho.php.

In your application you should see output like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 <title>REST GET echo service</title>
</head>
<body>
<p>
This simple PHP script will output all the get variables which where sent in the last HTTP request.
</p>
<p>
GET variables received: <br/>
</p>
Array
(
    [MyKey] => MyValue
)
</body>
</html>

Of course you can also try it from your browser.

Anyway, have fun with it, it’s just tiny debugging tool that saves you the 5 minute trouble of firing up your own host and typing three lines of PHP.

Tags: , , , , , , , ,
Posted in Blog, General Coding, Webdesign | No Comments »

OpenGL Slides

Posted by Roy Triesscheijn on 20th March 2011

Sorry that I haven’t been posting much lately! I’ve been working my ass of at the first (finally) computer graphics class at my University. Had to wait until my 3rd year but I’m going all out now.
(too bad though that it isn’t directX or XNA even, but hey, can’t have everything ;) ).

Anyway for this class I’ve made a quite a few slides about OpenGL. Most of it doesn’t make sense if you haven’t followed the exact same course and did the assignments but a few topcis (input buffer, fps-style camera movement and DOF using shaders) where separate enough so that I could put them up here as slides, I hope they benefit some people! (All the thumbnails are clickable)

input buffering

Input buffering in OpenGL:

FPS style camera

FPS style camera's in OpenGL

OpenGL: DOF 1

OpenGL: DOF 1

OpenGL: DOF 2

OpenGL: DOF 2

OpenGL: DOF 3

OpenGL: DOF 3

Tags: , , , , , , ,
Posted in Blog, General Coding, General Gamedesign, OpenGL, Tips | 1 Comment »