[{"content":"   Generate currency conversion tables\n Planning to travel? Simply print out, screenshot or memorise milestone amounts making it easy to estimate conversions abroad.\nLive Demo     \nSource:   cianmce/currency-tables\n","date":"4 September 2016","permalink":"/posts/currency_tables/","section":"Posts","summary":"\u003cspan class=\"preview\"\u003e\n\u003cp\u003e\n\n\n\n  \n  \n    \n  \n  \n    \u003cfigure\u003e\n      \u003cimg\n        class=\"my-0 rounded-md\"\n        srcset=\"\n          /img/currency_tables_selection_hu64c18edb824e54cb279b8481839938f6_30029_330x0_resize_box_3.png 330w,\n          /img/currency_tables_selection_hu64c18edb824e54cb279b8481839938f6_30029_660x0_resize_box_3.png 660w,\n          /img/currency_tables_selection_hu64c18edb824e54cb279b8481839938f6_30029_1024x0_resize_box_3.png 1024w,\n          /img/currency_tables_selection_hu64c18edb824e54cb279b8481839938f6_30029_1320x0_resize_box_3.png 2x\"\n        src=\"/img/currency_tables_selection_hu64c18edb824e54cb279b8481839938f6_30029_660x0_resize_box_3.png\"\n        alt=\"Currency Tables example\"\n      /\u003e\n      \n    \u003c/figure\u003e\n  \n\n\u003c/p\u003e\n\u003cp\u003eGenerate currency conversion tables\u003c/p\u003e\n\u003c/span\u003e","title":"Currency Tables ¥€$"},{"content":"   Crowd sensing road quality for optimal bicycle routing\n Interactive Demo      Smooth Route is a crowd-sensing solution to automatically analyse road quality and provide routing capabilities to cyclists. The Smooth Route sensing device is equipped with a 3-axis accelerometer capable of recording at 800Hz, a Nordic nRF51822 BLE SoC, an Ultra-Bright RGB LED and a Micro-USB rechargeable 100mAh Lithium ion polymer battery provides up to 3 weeks of battery life.\n   The sensor connects over Bluetooth Low Energy to mobile application that stores, processes and uploads ride information.\n   A custom 3D printed case is used to attach it to a bike. This can be seen and downloaded from Thingiverse.\nThis device can be easily used by simply tapping any NFC enabled smartphone off the device.\nA beta program was run over 6 months using 10 participants to gather information. The data collected is processed and analysed in real-time to create an interactive map seen here. This included 520 roads, 300 rides and 2500km of cycling.\nSmart-GH, which is based on the open source routing library GraphHopper, has been adapted to provide routing capabilities based on the smoothest route.\n   In the above example routing by “least bumpy” results in a slightly longer but smoother route. In reality, with this example, the speed gained by going on the smoother road would result in that route being quicker.\nIn addition to sensing road quality the Smooth Route device acts to mirror your mobile notifications in a similar way to the LED found on most Android phones. When you get a call or message while cycling the ultra-bright LED flashes different colors meaning you’ll never miss an important call or text while cycling.\n   Potholes and other road anomalies are located and grouped. Below is an example of a hole across the full cycle lane. This particular hole is difficult to avoid due to alongside traffic and the placement of a traffic island forcing cars particularly close.\nThe bottom right image below shows the estimated location of the hole by Smooth Route represented by the red marker. The photograph reveals how close this is to the true location.\nThe green markers relate to individual readings of that bump, the green color shows that these are all travelling east indicating the side of the road.\nThe top left image shows the raw data recorded for one reading of that bump.\nThe bottom left image points to the location of the pothole on the interactive map.\n   ","date":"6 June 2016","permalink":"/posts/smooth-route/","section":"Posts","summary":"\u003cspan class=\"preview\"\u003e\n\u003cp\u003e\n\n\n\n  \n  \n    \n  \n  \n    \u003cfigure\u003e\n      \u003cimg\n        class=\"my-0 rounded-md\"\n        srcset=\"\n          /img/smooth_route_preview_hudb020be383835577351e901d233a7d42_72263_330x0_resize_q75_box.jpg 330w,\n          /img/smooth_route_preview_hudb020be383835577351e901d233a7d42_72263_660x0_resize_q75_box.jpg 660w,\n          /img/smooth_route_preview_hudb020be383835577351e901d233a7d42_72263_1024x0_resize_q75_box.jpg 1024w,\n          /img/smooth_route_preview_hudb020be383835577351e901d233a7d42_72263_1320x0_resize_q75_box.jpg 2x\"\n        src=\"/img/smooth_route_preview_hudb020be383835577351e901d233a7d42_72263_660x0_resize_q75_box.jpg\"\n        alt=\"Smooth Route\"\n      /\u003e\n      \n    \u003c/figure\u003e\n  \n\n\u003c/p\u003e\n\u003cp\u003eCrowd sensing road quality for optimal bicycle routing\u003c/p\u003e\n\u003c/span\u003e","title":"Smooth Route"},{"content":"   Crowd sensing road quality for optimal bicycle routing\n Interactive Demo      Each particle has its own: #  Color Size Mass Density Elasticity (Coefficient of Restitution) Surface Area Lifespan  Collisions were modelled for: #  Walls and the roof(if On) With other particles All collisions took the radial distance from the particle center taking it’s individual Coefficient of Restitution and mass into account.  Two main forces were accounted for: #  Gravity for various Planets, F = M*G Friction with various mediums (Drag), F = 0.5*C*p*A*V2  Controls: #  Clicking places a “Launcher” Draging changes particles initial velocity SpaceBar, ‘M’ or Menu Button key shows/hides menu ‘P’ pauses the movement of the particles  Ctrl/CMD to toggle grabbing mode (or clicking \u0026ldquo;Grab Off/On\u0026rdquo; if on mobile) Click and Hold on particle to grab it Drag to move it and collide it with other particles Release to throw    Sound: #  Popping sound when particles die Bouncing sound when particles have a collision with volume proportional to magnitude of collision  Github Source: # github.com/cianmce/particles\n","date":"4 February 2015","permalink":"/posts/particles/","section":"Posts","summary":"\u003cspan class=\"preview\"\u003e\n\u003cp\u003e\n\n\n\n  \n  \n    \n  \n  \n    \u003cfigure\u003e\n      \u003cimg\n        class=\"my-0 rounded-md\"\n        srcset=\"\n          /img/particles_hud0b6d37ef1f39de7abad2a086cc0dad6_786178_330x0_resize_box_3.png 330w,\n          /img/particles_hud0b6d37ef1f39de7abad2a086cc0dad6_786178_660x0_resize_box_3.png 660w,\n          /img/particles_hud0b6d37ef1f39de7abad2a086cc0dad6_786178_1024x0_resize_box_3.png 1024w,\n          /img/particles_hud0b6d37ef1f39de7abad2a086cc0dad6_786178_1320x0_resize_box_3.png 2x\"\n        src=\"/img/particles_hud0b6d37ef1f39de7abad2a086cc0dad6_786178_660x0_resize_box_3.png\"\n        alt=\"Particles\"\n      /\u003e\n      \n    \u003c/figure\u003e\n  \n\n\u003c/p\u003e\n\u003cp\u003eCrowd sensing road quality for optimal bicycle routing\u003c/p\u003e\n\u003c/span\u003e","title":"Particles"},{"content":"   Interesting short FizzBuzz solution\n FizzBuzz is a group word game for children to teach them about division. Players take turns to count, replacing any number divisible by three with the word “fizz”, and any number divisible by five with the word “buzz”.\nAdults may play FizzBuzz as a drinking game, where making a mistake leads to the player having to make a drinking-related forfeit.\nHere’s a slightly different FizzBuzz function:\nfunction fizzbuzz(n) { for (var i = 1; i \u0026lt;= n; i++) console.log([i, \u0026#34;Fizz\u0026#34;, \u0026#34;Buzz\u0026#34;, \u0026#34;FizzBuzz\u0026#34;][(i%3==0) + 2*(i%5==0)]); } This approach can be easily expanded to work with any size, e.g. 3, 5 \u0026amp; 7:\nfunction fizzbuzz(n) { for (var i = 1; i \u0026lt;= n; i++) { var text = [i, \u0026#34;Fizz\u0026#34;, \u0026#34;Buzz\u0026#34;, \u0026#34;FizzBuzz\u0026#34;, \u0026#34;Bang\u0026#34;, \u0026#34;FizzBang\u0026#34;, \u0026#34;BuzzBang\u0026#34;, \u0026#34;FizzBuzzBang\u0026#34;]; console.log(text[(i%3==0) + 2*(i%5==0) + 4*(i%7==0)]); } } Demo #    Enter number: Fizz Every: Buzz Every:        Output:        function fizzbuzz(n, f, b) { var arr = []; for (var i = 1; i ","date":"3 February 2015","permalink":"/posts/fizzbuzz/","section":"Posts","summary":"\u003cspan class=\"preview\"\u003e\n\u003cp\u003e\n\n\n\n  \n  \n    \n  \n  \n    \u003cfigure\u003e\n      \u003cimg\n        class=\"my-0 rounded-md\"\n        srcset=\"\n          /img/fizzbuzz_hu48c6b2abc5d6cdc1adcfc4a944cfba56_100470_330x0_resize_box_3.png 330w,\n          /img/fizzbuzz_hu48c6b2abc5d6cdc1adcfc4a944cfba56_100470_660x0_resize_box_3.png 660w,\n          /img/fizzbuzz_hu48c6b2abc5d6cdc1adcfc4a944cfba56_100470_1024x0_resize_box_3.png 1024w,\n          /img/fizzbuzz_hu48c6b2abc5d6cdc1adcfc4a944cfba56_100470_1320x0_resize_box_3.png 2x\"\n        src=\"/img/fizzbuzz_hu48c6b2abc5d6cdc1adcfc4a944cfba56_100470_660x0_resize_box_3.png\"\n        alt=\"FizxBuzz\"\n      /\u003e\n      \n    \u003c/figure\u003e\n  \n\n\u003c/p\u003e\n\u003cp\u003eInteresting short FizzBuzz solution\u003c/p\u003e\n\u003c/span\u003e","title":"FizzBuzz"},{"content":"   Slaze in a Survival horror single player game modeled on the story of Slender Man, a tall, thin, faceless man who follows you at a distance but is never seen moving\n    Overview # Slaze in a Survival horror single player game modeled on the story of Slender Man, a tall, thin, faceless man who follows you at a distance but is never seen moving.\nThe game involves navigating through a randomly generated 3D maze while avoiding being caught by Slender and completing the levels tasks. All code for the game was with in C++ with OpenGL and GLSL for the Graphics Shaders using my own games engine over the course of 4 days.\n  Game mechanics # Quaternion navigation was used with WASD and the Arrow Keys.\nThe equation of motion was used with gravity to model jumping with a small spring was added before takeoff and after landing to simulate legs. A bobbing up and down was added to give the effect of walking on an uneven surface.\nLighting # Phong Lighting was used to give a realistic effect when light hit surfaces. A spotlight effect was used to simulate a flashlight. This light slowly ran out of battery making it dimmer and decreasing its radius. These were both implemented in the fragment shaders.\nThe amount of fog was increased as you progress through the game.\nJust before getting caught by Slender there would be distortion in both the audio and video of the camera. I wanted to make random white noise appear on screan using a shader.\nShaders are unable to produce true randomness, so a pseudo-random number generator was created that produces a number from 0 to 1.\n\\n = (43758.5 * sin(12.9898x + 78.233y + 1.532t)) \\mod 1\\)\n   Wolfram Alpha rendering  Using the above formula, a screen coordinate (x \u0026amp; y) and current time (t) was used to generate a random number. This was then used to create the illusion of camera white noise which can be seen below.\n   For audio distortion I created high pitch scream noises using Audacity.\nMaze # Every time the game is played a random maze is produced for a given Size, Complexity and Density depending on the level. Complexity being essentially how long each wall is as a maze with shorted walls is not very complex whereas one with long walls and only one or two paths through is much more complex. And Density being how much of blank space is filled. 4 randomly generated mazes are shown below.\n   Ensuring the maze was solvable and every point was reachable was obviously important. To ensure this I placed a random cell wall then expanded in a random direction checking that 2 ahead was free. This ensured that there was always corridors and no closed loops.\nVarious different textures were randomly used for the walls, some plain and some with either blood, rust or graffiti on it.\nCollisions # Collisions were used to detect if you collided with a wall, lever, ending door or Slender.\nWhen randomly moving Slender collisions were also checked.\nTexture \u0026amp; Models # All textures and models were created with Gimp and Blender.\nMost models had a diffuse, ambient, specular and emission textures which were used in the fragment shader.\nLevels # Slaze can easily customized to have N levels. It was found the 4 levels was a good number with a full game play lasting 10-20mins. Each level becomes more difficult than the one before.\nThe 4 levels were:\n Little fog. Small maze. You, Slender, End, Lever \u0026amp; Walls on map More fog. Bigger maze. You, End \u0026amp; Walls on map More fog. Bigger maze. End \u0026amp; Walls on map MORE FOG. HUGE maze. NO MAP!  For each size of the map the terrain mesh and it’s texture re-sized and scaled to perfectly fit edge to edge with the new width and height of the maze.\nSound # Sound was a big part of my game. There is a consistent eerie noise playing in the background. Whenever Slender moves there’s 2 loud footsteps thumps. When seen a loud screech noise is played. 2 sounds were assigned to the operation of the lever happening one after the other making a grinding gear noise followed by an opening noise. A clicking noise is played when the flashlight is switched on or off.\nPerformance # Various performance were kept in mind making the this game. They include loading GUIs and Sounds first so there’s something displayed to the user while they wait.\nA radius around the camera was used to decide if an object should be drawn. In this video a very small radius is used to demonstrate it\nExtra Links # Battery Recharging\n http://youtu.be/TmP2W_mjgys  Intro\n http://youtu.be/fmcseRKbw-I  Following + Animation\n http://youtu.be/3YOasOncnu4  Drawing Radius\n http://youtu.be/m1Yx7iGA8cY  Full Playthroughs\n http://youtu.be/MBXptMvaE7k http://youtu.be/Ynb7W2siZyg  Speedrun\n http://youtu.be/WEn7s0wHsK8 ","date":"17 December 2014","permalink":"/posts/slaze/","section":"Posts","summary":"\u003cspan class=\"preview\"\u003e\n\u003cp\u003e\n\n\n\n  \n  \n    \n  \n  \n    \u003cfigure\u003e\n      \u003cimg\n        class=\"my-0 rounded-md\"\n        srcset=\"\n          /img/slaze_gameplay_hu3f738039dc3c43439bccae095c13da22_518520_330x0_resize_box_3.png 330w,\n          /img/slaze_gameplay_hu3f738039dc3c43439bccae095c13da22_518520_660x0_resize_box_3.png 660w,\n          /img/slaze_gameplay_hu3f738039dc3c43439bccae095c13da22_518520_1024x0_resize_box_3.png 1024w,\n          /img/slaze_gameplay_hu3f738039dc3c43439bccae095c13da22_518520_1320x0_resize_box_3.png 2x\"\n        src=\"/img/slaze_gameplay_hu3f738039dc3c43439bccae095c13da22_518520_660x0_resize_box_3.png\"\n        alt=\"Slaze Gameplay\"\n      /\u003e\n      \n    \u003c/figure\u003e\n  \n\n\u003c/p\u003e\n\u003cp\u003eSlaze in a Survival horror single player game modeled on the story of Slender Man, a tall, thin, faceless man who follows you at a distance but is never seen moving\u003c/p\u003e\n\u003c/span\u003e","title":"Slaze"}]