Giter VIP home page Giter VIP logo

holidays2013's Introduction

Holidays2013

looking at 2weeks free time over the holidays this is where I hope to put some of my "reaserch" and toy samples

Mandelbrot

I had a look around Hackage searching for a suitable library to help me generate pictures (I want come back and try to write a medicore raytracer in Haskell as advanced project) and JuicyPixels seemd just fine (I kindof liked the easieness of generateImage)- so thank you Vincent for your great work!

Of course I need something to toy with and I always loved to write yet another mandelbrot-set drawing app ... so here we go!

Right now this will only produce a complete image of the well-known set - no zoom or anything. Like this: MandelbrotSetImage

I modified the algorithm to test the Repa package - that is I tried to compute the images pixel-array in parallel. So far the speedupt is not that great and I guess I have to really think this through a bit more.

fiddling with threepenny-gui

After some timeout I decided to play a bit more with this mandelbrot-generator by trying to implement it using threepenny-gui.

As of now this works ... well ok - it's not very fast or very beautiful (just shows the image and some very basic "wait"-text).

I am not sure I really got the libraries spirit right but it was kindof fun (really nasty hacking and head-scratching, till I got it).

To get this running you have to run the executable and then go with your favorite browser to localhost:10000. It will take a while to create the starting image and after this is done you can click on a point on the image to zoom into that region (rinse and repeat / enjoy).

obvious-stupid-mistakes I made

Yes this is embarassing, but here are the most-stupid:

  • toyed with JuicyPixels and imported PixelRGB8 but forgot the constructors (PixelRGB8(..)) and then being dumbfolded for several minutes by the obvious error:

    Not in scope: data constructor `PixelRGB8'

  • tried to implement a widget into Threepenny-GUI to show my image and really fried my head how I could to some kind of accumulation to translate the clicks into new views (you see: i need the old-view to know "where" I clicked) ... the solution I found was to create a "mapper"-function between views for a click (at the image-coordinates) and then use this together with accumulateB interesting concept but a bit counterintuitive for me but logical in the end ... really love Haskell - always something new to figure out.

holidays2013's People

Contributors

carstenkoenig avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.