コード例 #1
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('eye_of_argon', 'Eye of Argon acronym generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'eye_of_argon'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'eye_of_argon'
p.mathjax = False
p.tags = 'Frivolous'
p.technologies = 'HTML,MySQL,PHP'
p.links.append(link_object(p.domain, 'eye_of_argon/', 'Live page'))
p.introduction = 'This project was made to demonstrate a point.  A student said that they doubted I could make a simple application in an afternoon, so within about an hour I had made this is.  It takes a string from the user and makes a phrase using word from the Eye of Argon to make an initialisation.'
p.overview = ''

p.challenges.append(
    challenge_object(
        'The numbers of words in the Eye of Argon is larger than 10,000, which could slow down performance.',
        'The words were sorted alphabetically, with duplicates removed, and words with fewer than four letters are removed.',
        'Resolved'))
コード例 #2
0
ファイル: project.py プロジェクト: aidansean/boxer
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('boxer', 'Box filler')
p.domain = 'http://www.aidansean.com/'
p.path = 'boxer'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'boxer'
p.mathjax = True
p.tags = 'Frvilolous'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'boxer/', 'Live page'))
p.introduction = 'This is a rather frivolous script I wrote to serve some sort of purpose, but I forget exactly what that purpose was.  I think it may have been to create a random sitemap using images from various pages.  It takes rectangular array of squares and fills it with squares (or boxes) of random sizes.  Then to make it look more attractive it fills each rectangle with a picture from <a href="http://www.placekitten.com">placekitten</a>.'
p.overview = '''The tool allows the user to create a plot in several steps.  Each entry can be styled quickly and simply, and bands can also be added around different groups of results.  The user can specify up to three uncertainties (for example, statistics, systematic, and theoretical) which can be asymmetric.  The output is an SVG document, giving a very clean and slick image that scales well.  Unfortunately this is not as well suited for creating bitmaps, and also relies on server side (PHP) scripting.'''

p.challenges.append(
    challenge_object(
        'The only real challenge here is to make sure none of the squares end up more than one box.',
        'This challenge is overcome by choosing a square at random which has not yet been used, then finding the largest possible box size starting from that square, \(n\).  A random number is thrown in the range \(1,n\) to determine the box size.  Each square which fits in this box has it status changed to "used".  This process is repeated until all squares are accounted for.',
        'Resolved'))
コード例 #3
0
ファイル: project.py プロジェクト: aidansean/euler
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('euler', 'Project Euler')
p.domain = 'http://www.aidansean.com/'
p.path = 'euler'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'euler'
p.mathjax = False
p.tags = 'Euler,Maths'
p.technologies = 'CSS,HTML,python'
p.links.append(link_object(p.domain, 'euler/', 'Live page'))
p.introduction = 'To hone my problem solving skills I occasionally take part in Project Euler, which is a series of mathematical and computational problems.  These pages summarise my solutions and strategies.'
p.overview = '''This is just a collections of pages that show solutions to the problems.  There's nothing particularly special about these pages.'''
コード例 #4
0
ファイル: project.py プロジェクト: aidansean/platform_game
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('platform_game', 'Generic platform game')
p.domain = 'http://www.aidansean.com/'
p.path = 'platform_game'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'platform_game'
p.mathjax = True
p.tags = 'Games'
p.technologies = 'canvas,CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, '%s/play.php'%p.path, 'Live page (Play)'))
p.links.append(link_object(p.domain, '%s/edit.php'%p.path, 'Live page (Edit)'))
p.introduction = 'This project is something I\'ve been working for a long time and something I have wanted to develop for as long as I can remember.  It\'s a platform game strongly inspired by the BBC Micro game, Citadel.  (I have another project dedicated to mapping <a href="http://aidansean.com/projects/?p=141">Citadel</a>.)  When I was younger I would dream about playing non-existant extra levels in Citadel, and when I started recreational programming I would sometimes dream about making new levels for the game.'
p.overview = '''The game is organised into a two dimensional array of rooms, which are subsequently split into blocks.  Each block is then specified using a shape, foreground, background, obstacle, medium, and objects.  The medium can be air, water, fire, solid rock etc, and the obstacle is wall, ladder etc.  The foreground and background are purely cosmetic.  The objects are things like coins, doors, keys etc.

Motion is controlled using the keyboard and is handled on a pixel-by-pixel basis.  The function defining the motion are very loosely inspired by <a href="http://www.codeproject.com/Articles/22423/Tom-s-Halls-A-JavaScript-Platform-Game-Engine"></a>, although all the code and algorithms are my own.  The player is modeled by a rectangle which is moved across the blocks pixel by pixel, searching for collisions.  When a collision is detected movement is stopped along that axis.  If movement along the other axis means there is no longer a collision then movement along the first axis resumes.  This is how collisions were handled in Citadel, and was something I wanted to replicate.  When the collision happens at \(45\deg\) the ambiguity is resolved by the direction of movement of the player.  (For example if the player is moving down along the \(y\) axis and collides with a corner the player will move down instead of horizontally.)  The movement was initially monitored using a "mask" of pixels surrounding the player, with a special mask view for debugging, but this has since been retired due to the huge CPU demands.

This game is in progress, so at the moment there is very limited functionality.  The physics engine is pretty much complete, although it would benefit from some optimisations.  The main environment types have already been developed, including air, water, solid, fire, and ladder.  A few extra features have been added including trampolines and the double jump feature.  The features I was working on when I paused development were interactions with objects and the inventory, and adding a "pain" feature instead of instant death (another feature of Citadel that I very much enjoyed.)

The game has an editor so that the developer can "draw" rooms onto the canvas directly instead of writing things in a text editor, as it was arranged initially.  This speeds up content writing a lot, but there are almost certainly some features that need to be added to make this better, and probably a handful of bugs that need to be fixed as well.

When the player or editor goes into a room that does not exist, a new room with the name "Nothingness" is automatically added to the map.  This is very important because players always find new ways to break the map.  In fact this is something that was handled very well in the original Citadel, although it did lead to a serious exploit, where players could "fall off of the edge of the map" and end up elsewhere.

This game needs some more development, but already it has potential to be very interesting.  As well as adding more content and assets it's necessary to optimise the game play so that it can be played on lower end computers.'''

p.challenges.append(challenge_object('This game needed a decent physics engine.', 'This was my first time writing a physics engine, and being a physicist I thought it would be easy.  I was wrong.  I love classical physics and its inherent beauty, but writing code for a classical physics enging is hard.  I started out with a ball bouncing around a square room, followed by adding gravity, then adding player controls.  I built up the model step by step until I had something reasonabe and intuitive.  It was a very informative experience.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('The rooms needed to have some kind of model that was both versatile and had good performance.', 'I built the rooms out of blocks.  Each block had a shape and this allows the developer to create a detailed room for the game, as well as having pixel perfect control over the player\'s movements.  however this comes at the cost of performance, so some additional gains needs to made with the physics engine.  The versatility of the room design is excellent and I am very happy with the amount of creative freedom the developer has in assembling the rooms.', 'Resolved'))
コード例 #5
0
ファイル: project.py プロジェクト: aidansean/symbols
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('symbols', 'Symbol browser')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'aidansean'
p.path = 'symbols'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.github_repo_name = 'symbols'
p.mathjax = True
p.tags = 'Tools,Physics,Web design'
p.technologies = 'CSS,HTML,JavaScript,ZeroClipboard'
p.links.append(link_object(p.domain, 'symbols', 'Live page'))
p.introduction = 'This is a simple tool to allow the user to quickly copy a string of symbols.'
p.overview = '''This is a mixture of Javascript and the flash based ZeroClipboard.  The user clicks on the symbols they want and copy the output with a single click.'''

p.challenges.append(challenge_object('The project required making ZeroClipboard work.', 'Making ZeroClipboard work for single clikcks is not trivial for several DOM elements, so it now only works for a single DOM element.', 'Resolved'))

p.challenges.append(challenge_object('The list of symbols needs to be updated simply and easily.', 'Symbols are arranged in groups with special functions to manage them, so symbols can be added in a single line.', 'Resolved'))
コード例 #6
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('transformer', 'Image transformer')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'aidansean'
p.path = 'transformer'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.github_repo_name = 'transformer'
p.mathjax = True
p.tags = 'Images,Maths'
p.technologies = 'HTML,PHP'
p.links.append(link_object(p.domain, 'transformer', 'Live page'))
p.introduction = 'When I discovered I could manipulate images with PHP one of the first things I wanted to do was perform coordinate transformations.  They have fascinated me since I first came across them and so I developed this project to satifsy my curiosity about what a skyline might look like when transformed into polar coordinates.'
p.overview = '''This project takes an image and uses PHP to manipulate it pixel by pixel so that the \\((x,y)\\) coordinates get translated into \\((r,\\theta\\) coordinates.'''

p.challenges.append(
    challenge_object(
        'The transformation itself isn\'t trivial.',
        'The first difficulty to overcome is the transformation itself.  The details are given on the page, so I won\'t reproduce them here.',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'The transformation has to be performed "backwards".',
        'It took me a while to realise that the transformation has to be performed from target to source rather than the other way around.  Rather than taking a pixel from source to the target, the pixel must be taken from the target to the source, because otherwise the target image will have "gaps" in it.',
        'Resolved'))
コード例 #7
0
ファイル: project.py プロジェクト: aidansean/LXR_tidy
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('LXR_tidy', 'LXR tidy')
p.domain = 'http://www.aidansean.com/'
p.path = 'LXR_tidy'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.folder_name = 'greasemonkey'
p.github_repo_name = 'LXR_tidy'
p.mathjax = False
p.links.append(link_object('http://cmslxr.fnal.gov/', 'lxr/', 'CMSSW LXR home'))
#p.links.append(link_object(p.domain, 'greasemonkey/greaseBox.php', 'Live page'))
p.introduction = 'When I was working on the CMS experiment I used their LXR a lot when browsing code.  The interface was fairly basic and would return a poorly formatted (and unsemantic) HTML output, so I write a greasemonkey script to make the results easier to read.  Within a couple of weeks of writing this code the developers improved the output, so this project never got any wider use.'
p.overview = '''The output is parsed and carefully separated into different results.  These are then wrapped in more pleasant looking HTML, colour coded based on the file type (with characters for the colour blind) and the main modules are summarised to give an idea of the main users of a given piece of code.'''

p.challenges.append(challenge_object('The default output is terrible.  Just terrible.', 'The default output was not even semantically correct (from what I remember there were no <tt>&lt;html&gt;</tt> tags) so I had a hard time parsing the DOM properly.  Special character sequences such as <tt>&lt;&lt;</tt> appearing in C++ code didn\'t make things much easier.', 'Resolved.'))
コード例 #8
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('tricolor', 'Tricolor')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'aidansean'
p.path = 'tricolor'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.github_repo_name = 'tricolor'
p.mathjax = True
p.tags = 'Toys'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'tricolor', 'Live page'))
p.introduction = 'While investigating Conway\'s game of life I wanted to see if I could easily extend the framework I\'d developed to explore other systems.  One of the more interesting cellular automata is the rock-paper-scissors system where three populations feed on each other.'
p.overview = '''The algorithm used to make the rock-paper-scissors cellular automata is does not seem to be well documented in an easy to obtain source, so I had to interpet much of the algorithm based on subjective descriptions.  Each cells has a health which can take a value between \(0\) and \(10\).  If a prey species is adjacent to its predator species then the prey species gives a health point to the predator species.  When the prey species health reaches \(0\) it is replaced by a predator species.  The result is that this creates spiral patterns on the canvas.'''

p.challenges.append(
    challenge_object(
        'The algorithm needed some experimentation and tweaking to get right.',
        'There are numerous papers and articles about how these algorithms work, but I couldn\'t find a source that was explicit or that I could understand.  As a result I had to create my own algorithm and tweak it until it was stable.  Hopefully others users can read my code and develop it further.',
        'Resolved'))
コード例 #9
0
ファイル: project.py プロジェクト: aidansean/box_plotter
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('box_plotter', 'Box plotter')
p.domain = 'http://www.aidansean.com/'
p.path = 'box_plotter'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'box_plotter'
p.mathjax = True
p.tags = 'Maths,Physics,Tools'
p.technologies = 'HTML,PHP,SVG'
p.links.append(link_object(p.domain, 'box_plotter/', 'Live page'))
p.introduction = 'One of the most popular ways to compare results in particle physics is to create plots that show different results with horizontal bands (sometimes known as boxes), making comparisons easier on the eye.  Unsatisfied with the quality of available solutions at the time, I created my own scripts which would make these plots for use in my thesis.'
p.overview = '''The tool allows the user to create a plot in several steps.  Each entry can be styled quickly and simply, and bands can also be added around different groups of results.  The user can specify up to three uncertainties (for example, statistics, systematic, and theoretical) which can be asymmetric.  The output is an SVG document, giving a very clean and slick image that scales well.  Unfortunately this is not as well suited for creating bitmaps, and also relies on server side (PHP) scripting.'''

p.challenges.append(
    challenge_object(
        'The axis must be generated dynamically, ensuring that the range looks sensible and attractive.',
        'Through some cunning mathematics the range is automatically chosen, with a suitable precision.  Since the aim is to make the comparison by eye of different results easy the precision is less important than giving a good sense of scale, so fewer tick marks are preferred.',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'It\'s currently not possible to enter a block of text to create an image.',
        'Add a textarea to input user defined text and a parser to read this input.  This would benefit greatly from a simple custom markup language.',
        'To be done'))

p.challenges.append(
    challenge_object(
コード例 #10
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('ascii_art', 'ASCII art generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'ascii_art'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'ascii_art'
p.mathjax = True
p.tags = 'Images,Art'
p.technologies = 'CSS,HTML,JavaScript,canvas'
p.links.append(link_object(p.domain, 'ascii_art/', 'Live page'))
p.introduction = 'After talking to a friend who suggested I write a text based adventure game, I decided that it would be useful to develop a way to generate graphics that could be displayed as text.  To achieve this I used the HTML canvas to analyse images and comapared the distribution of colours with various characters, providing graphical, textual, and HTML outputs.'
p.overview = '''The tool allows the user to choose various character sets for processing the images, including particles for images related to particle physics. The user can also choose which display modes to use, including "colour", "black and white", "red green, and blue", "pixelate", "Matrix".

There are two rules for determining which characters to use, which are "parsimony", and "random". Parsimony chooses a single character of a single colour that best matches the local pixels.

<h3>Strategy</h3>
The source image is divided into rectangles of equal size. The rectangles are then painted to a canvas one by one, and the pixel colours analysed to define a single characteristic colour for the rectangle depending on the mode used. (For example, when the mode is "black and white" the characteristic colour is \\((\\bar{r}+\\bar{g}+\\bar{b})/3\\), where \\(\\bar{r}\\) is the average red value of the pixels, and similarly for green and blue.)

For each rectangle each character is tested one by one to find the best match between the pixels in the source image and those in the character using the characteristic colour. To find the character with the best match a parsimony parameter, \\(p\\), is defined as the sum of the squares of the differences between the rgb values of the pixels between the character and the source image. The character with the smallest value of \\(p\\) is chosen. The expression for \\(p\\) is:

\\( p = \\sum_i \\left[ (r_i^s-r_i^c)^2 + (g_i^s-g_i^c)^2 + (b_i^s-b_i^c)^2 \\right] \\)

where \\(r_i^s(c)\\) is the r value of the \\(i\\)th pixel in the source image (character), and similarly for green and blue.

This character then gets drawn to a large canvas for graphical output, added to a <code>span</code> element for textual output, and added to a <code>textarea</code> element for HTML output.'''

p.challenges.append(
コード例 #11
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('apollo', 'Apollonian gasket generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'apollo'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'apollo'
p.mathjax = True
p.tags = 'Art,Images,Maths'
p.technologies = 'canvas,HTML,JavaScript'
p.wiki_link = 'https://en.wikipedia.org/wiki/Apollonian_gasket'
p.links.append(link_object(p.domain, 'apollo/', 'Live page 1'))
p.links.append(link_object(p.domain, 'apollo/index2.php', 'Live page 2'))
p.introduction = 'One of my hobbies is creating fractals and one of the most interesting is the Apollonian gasket.  An area defined by some arcs and straight lines is recursively filled with circles and in all cases (except the trivial case of a single circle) this process recurses infinitely, making counting circles challenging.'
p.overview = '''Circles and lines are defined in much the same way (with lines having an infinite radius, and vanishing inverse radius) and from this point lines will be referred to as circles.  There is then a relatively straightforward relationship between the position of a circle and the three circles/lines which enclose it.  For three circles \\([c_1,c_2,c_3]\\) that enclose a circle \\(c_4\\), the radii are related by:

\\[
  r_4 = \\frac{r_1r_2r_3}{r_1r_2+r_2r_3+r_3r_1+2\\sqrt{r_1r_2r_3(r_1+r_2+r_3)}}
\\]

where \(r_i\) is the radius of the \(i\)th circle.  The centres of the circles, \((x_i,y_i)\) for the \(i\)th circle, are related by:

\\begin{eqnarray*}
  A_{12} & = & x_1^2 - x_2^2 + y_1^2 - y_2^2 + (r_2+r_4)(r_2+r_4) - (r_1+r_4)(r_1+r_4) \\\\
  A_{13} & = & x_1^2 - x_3^2 + y_1^2 - y_3^2 + (r_3+r_4)(r_3+r_4) - (r_1+r_4)(r_1+r_4) \\\\
  B_{12} & = & 2(x_2-x_1) \\\\
  B_{13} & = & 2(x_3-x_1) \\\\
  C_{12} & = & 2(y_2-y_1) \\\\
コード例 #12
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('aDetector', 'aDetector')
p.domain = 'http://www.aidansean.com/'
p.path = 'aDetector'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.folder_name = 'LHCGames'
p.github_repo_name = 'aDetector'
p.mathjax = True
p.links.append(link_object(p.domain, 'aDetector/v1/', 'Live page V1'))
p.links.append(link_object(p.domain, 'aDetector/v2/', 'Live page V2'))
p.links.append(link_object(p.domain, 'aDetector/v3/', 'Live page V3'))
p.links.append(link_object(p.domain, 'aDetector/v4/', 'Live page V4'))
p.links.append(link_object(p.domain, 'aDetector/v5/', 'Live page V5'))

p.introduction = 'One of the projets I have wanted to develop for a long time is a browser based particle physics experiment simulator.  Such a project would generate events using Monte Carlo methods and simuate their interactions with the detector.  This was made partly as an educational aid, partly as a challenge to myself, and partly because at the time I was feeling some frustration with the lack of real analysis in my job.  As expected for a Javascript based CPU intensive appplication, this reaches the limits of what is possible with current technology quite rapidly.'
p.overview = '''The model for the detector is saved in an <tt>xml</tt> file which is loaded using the same methods developed in the <a href="http://aidansean.com/projects/?p=235">Marble Hornets</a> project.  Particle data are currently stored in Javascript source files, but will eventually use <tt>xml</tt> as well.  The particle interactions are simulated first by choosing a process (eg \(e^+e^- \to q\bar{q}\)) and then decaying the particles.  Jets are formed by popping \(q-\bar{q}\) pairs out of the vacuum while phase space allows and then arranging the resulting pairs in hadrons.  Bound states are then decayed according to their <a href="http://pdg.lbl.gov">Particle Data Group (PDG)</a> branching fractions, with phase space decays used.  The paths of the particles are propagated through the detector using a stepwise helix propagation.  Energy depositions in the detector are estimated, according to the characteristic properties of the detector components.  A list of particles is then compiled based on the particles produced and these can be used to reconstruct parent particles.

The user has access to several controls to interact with the application.  They can choose how to view the detector, using Cartesian coordinates and two <a href-"http://en.wikipedia.org/wiki/Aircraft_principal_axes">Euler angles</a> (with the roll axis suppressed.)  The most expensive parts of the process are the generation of the event displays and the generation of the particle table.  By default these are only updated after a certain interval, to allow the user to accumulate a significant number of events without being slowed down by the graphics.  To save time the detector itself is rendered once in a cutaway view, and the particle tracks are overlaid on the saved image.  Eventually the user will be able to get a full event display, including the detector response to the particle with glowing detector components etc.

The user has access to collections of particles, including electrons, muons, pions, kaons, photons, and protons.  From these they can construct other particles, making selections as they do so.  Once they have made parent particles they can then plot kinematic variables including mass, momentum, transverse moment, and helicity angle.  This should, in principle, allow students to learn how to recreate particles and how to separate signal from background effectively.

Given the large amount of information available the user has access to a number of tabs which can can be collapsed out of view.  This allows the user to run the application with the expensive canvas and DOM updates, and thus collect many more events.

This is still a work in progress, with reconstruction of particle being the next main priority.  Eventually the user would be able to load their favourite detector geometry and beam conditions, then perform their analysis, saving the output in <tt>xml</tt> files and possible being able to upload these to a server.  This would allow users to act as "players" with "physics campaigns", including the SPS experiments, HERA experiments, B factories, LEP experiments, and LHC experiments.  This is, of course, a very ambitious goal, and one which has been ongoing for over a year at this point.

See other posts tagged with <a href="http://aidansean.com/projects/?s=aDetector">aDetector</a>.'''

p.challenges.append(challenge_object('A sophisticated model for the detector was needed.', 'The detector is split up by subdetector, with each subdetector having its own characteristic responses to different particles.  The detector is split up in cylindrical coordinates, \((\rho,\eta,\phi)\), with each subdetector also being split into modules.  Individual modules then react the particles for reconstruction purposes.  Thus with a few key parameters even a sophisticated model can be stored in a few variables that can be tuned quickly and easily.', 'Resolved.'))

p.challenges.append(challenge_object('The detector shold have a three dimensional view that the user can control.', 'The detector is drawn using a wireframe with transparent panels.  This is a method I developed in 2009 for a now defunct PHP generated SVG based visualisation of the BaBar electromagnetic calorimeter, which I used to show the absorbed dose as a function of detector region and time.  The drawing algorithm is not perfect, as panels are drawn in order from furthest from the user to closest.  This is sufficient for most purposes, but occasionally panels will intersect causing strange artefacts.  Eventually this should be replaced with a much more stable, robust, and fast implementation, such as in <a href="http://threejs.org/"><tt>three.js</tt></a>.', 'Resolved, to be revisited.'))
コード例 #13
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('wolfram', 'Wolfram rules')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'aidansean'
p.path = 'wolfram'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.github_repo_name = 'wolfram'
p.mathjax = True
p.tags = 'Maths'
p.technologies = 'HTML,JavaScript'
p.links.append(link_object(p.domain, 'wolfram', 'Live page'))
p.introduction = 'I enjoy playing with recreational mathematics and the Wolfram rules are a rich source of complex behaviour from simple rules.  So I created this project to explore how the rules can lead to different patterns.'
p.overview = '''This project allows the user to input different rules to create different patterns.  The results are displayed in an HTML table which is automatically generated.  I cannot remember the motivation for using an HTML table rather than the canvas, as there are obvious disadvantages to using a table, even if it does arrange the results in a semantic manner.'''

p.challenges.append(
    challenge_object(
        'The interface has to be relatively intuitive.',
        'Although the interface is simple, I am not satisfied that it is intuitive enough for someone new to Wolfram rules.  This may need to be revisited, with some example rules explained to show how the game works.',
        'Resolved, to be revisited'))
コード例 #14
0
ファイル: project.py プロジェクト: aidansean/tetris
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('tetris', 'Generic block stacking game')
p.domain = 'http://www.aidansean.com/'
p.path = 'tetris'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'tetris'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'AJAX,CSS,HTML,JavaScript,MySQL,PHP'
p.links.append(link_object(p.domain, 'tetris/', 'Live page'))
p.introduction = 'This was my first serious Javascript project which was written some time in 2009.  I chose to write a Tetris clone because it was a well defined project that would teach me how to use Javascript.  In addition to Tetris I also made Tritris and Pentris to see how well balanced the three games are compared to each other.  It turns out that Tetris is about right, with Tritris being too easy and Pentris being too hard.'
p.overview = '''The user plays the game with the arrow keys, and the game gets slowly faster as their score increases.  There is a MySQL and PHP backend to save scores on the server.  As much as possible, the three games have been harmonised so that they use the same page, the same Javascript library, and the same PHP page for interaction with the server.  This is outlined in <a href="http://aidansean.com/projects/?p=473">a previous post</a> where I discussed how the code was refactored.  This is one of my favourite projects, as it's one of the few "complete" projects that touches on almost all of Javascript, with some HTML, CSS, PHP, MySQL, httpxml, and cookies also thrown in there.  This project taught me so much about Javascript and was an excellent start with the language.'''

p.challenges.append(
    challenge_object(
        'This project required learning how to use Javascript.',
        'What a challenge!  Having worked previously with C++, I found that Javascript was rather easy to learn, and quickly came across its peculiarities and limitations.',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'The project required detailed manipulation of the DOM.',
        'It was with this project that I learned how to use the DOM, which helped me to better understand the heirarchical structure of XML in general.  I also wanted the HTML to be semantically pure, so while I used the DOM to store some information about the state of the game, I also ensured that it was semantically consistent.',
        'Resolved'))

p.challenges.append(
    challenge_object(
コード例 #15
0
ファイル: project.py プロジェクト: aidansean/mastermind
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('mastermind', 'Generic code guessing game')
p.domain = 'http://www.aidansean.com/'
p.path = 'mastermind'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'mastermind'
p.mathjax = True
p.tags = 'Games'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'mastermind', 'Live page'))
p.introduction = 'This project was made as an exercise in dynamic HTML manipulation.  It\'s a clone of a classic code guessing game where the player plays against the computer.'
p.overview = '''The user has to guess the code and gets a score in the form of \(S=10A+B\) where '\(A\) is the number of correct guesses in the correct place and \(B\) is the number of correct guesses in the wrong place.'''

p.challenges.append(challenge_object('The number of rows and columns must match the user input and be maintained correctly..', 'This was the main purpose of the project, to investigate the safest and most performant way to achieve this.  It\'s mostly a matter of bookkeeping once it was achieved it made many future projects much easier.', 'Resolved'))
コード例 #16
0
ファイル: project.py プロジェクト: aidansean/parodier
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('parodier', 'Parodier')
p.domain = 'http://www.aidansean.com/'
p.path = 'parodier'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'parodier'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'CSS,HTML,JavaScript,MySQL,PHP'
p.links.append(link_object(p.domain, 'parodier', 'Live page'))
p.links.append(link_object('http://en.wikipedia.org/', 'wiki/Keep_Calm_and_Carry_On', 'Background information on the original'))
p.introduction = 'This was something I made a while back for reasons that I can\'t quite remember.  It allows the user to create their own version of the "KEEP CALM AND CARRY ON" posters that have been popular in the past decade.'
p.overview = '''The user inputs up to five lines of text which are sent via a GET request to the server.  The server then parses the input, assembles the image and returns it, and then adds the input to a MySQL database on the backend.'''

p.challenges.append(challenge_object('The project needed to interact with a source image and a font.', 'One of the main reasons for working on this project was to learn how to use fonts with PHP and how to create meme-like images.  Finding a suitable font was not easy, and I suspect the actual "font" does not exist.  I cannot remember if the font I used was royalty free or not, so I should probably check on that.  The source image itself was quite easy to use.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('This project uses a MySQL database, and had to be secure.', 'As usual, the input to the database has to be sanitised.  First time round I left a loophole in there, but that\'s fixed now.  I might revisit this again to tidy up the code a little, it could be made more elegant.  (The MySQL backend was just for my own amusement really.  It\'s fun to see what strangers have used this project to create.)', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('The layout should look good and be semantically correct.', 'To my shame I used a table to make this layout look good.  It\'s not best practice and it\'s not semantically correct so I should come back to this next time I have the urge to practice my CSS skills and remake it using div elements.', 'Resolved, to be replaced'))
コード例 #17
0
ファイル: project.py プロジェクト: aidansean/boxer
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('boxer', 'Box filler')
p.domain = 'http://www.aidansean.com/'
p.path = 'boxer'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'boxer'
p.mathjax = True
p.tags = 'Frvilolous'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'boxer/', 'Live page'))
p.introduction = 'This is a rather frivolous script I wrote to serve some sort of purpose, but I forget exactly what that purpose was.  I think it may have been to create a random sitemap using images from various pages.  It takes rectangular array of squares and fills it with squares (or boxes) of random sizes.  Then to make it look more attractive it fills each rectangle with a picture from <a href="http://www.placekitten.com">placekitten</a>.'
p.overview = '''The tool allows the user to create a plot in several steps.  Each entry can be styled quickly and simply, and bands can also be added around different groups of results.  The user can specify up to three uncertainties (for example, statistics, systematic, and theoretical) which can be asymmetric.  The output is an SVG document, giving a very clean and slick image that scales well.  Unfortunately this is not as well suited for creating bitmaps, and also relies on server side (PHP) scripting.'''

p.challenges.append(challenge_object('The only real challenge here is to make sure none of the squares end up more than one box.', 'This challenge is overcome by choosing a square at random which has not yet been used, then finding the largest possible box size starting from that square, \(n\).  A random number is thrown in the range \(1,n\) to determine the box size.  Each square which fits in this box has it status changed to "used".  This process is repeated until all squares are accounted for.', 'Resolved'))
コード例 #18
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('SM_notes', 'Standard Model lecture notes')
p.domain = 'http://www.aidansean.com/'
p.path = 'phd_notes'
p.preview_image_ = image_object(
    'http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg',
    408, 287)
p.github_repo_name = 'SM_notes'
p.mathjax = False
p.links.append(
    link_object(p.domain, 'phd_notes/StandardModel.pdf',
                '[pdf] Compiled notes'))
p.links.append(
    link_object(p.domain, 'phd_notes/StandardModel.zip', '[zip] Archive'))
p.introduction = 'During my PhD lecture course I typed up my notes as a form of revision.  A few years later someone asked for a copy.  After that I wrote the Feynman diagram maker application and shared the files on a repository.'
p.overview = '''This is a LaTeX project of around 200 pages, so there a lot of LaTeX source files.  In addition there are many images generated with the Feynman diagram maker, as well as many sourced from elsewhere.  These LaTeX source files are shared so that anyone can use them, subject to the terms outlined in the files.'''

p.challenges.append(
    challenge_object(
        'This project required an extensive collection of figures.',
        'Custom Feynman diagram making applciations were developed to produce figures.  Initially PHP and SVG were used to generate some images, but this procedure was found to be too slow.  Instead a Javascript based application was developed that used the HTML canvas, saving images as bitmaps.',
        'Resolved'))
コード例 #19
0
ファイル: project.py プロジェクト: aidansean/errors
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('errors', 'HTTP error pages')
p.domain = 'http://www.aidansean.com/'
p.path = 'errors'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'errors'
p.mathjax = False
p.tags = 'Tools,Meta,Web design'
p.technologies = 'Apache,CSS,HTML,PHP'
p.links.append(link_object(p.domain, 'errors', 'Live page'))
p.introduction = 'As part of my webspace I wanted to add some humourous error pages to soften the blow when there\'s a problem.'
p.overview = '''This project works in two distinct phases: first the <code>.htaccess</code> file catches HTTP responses and redirects them before the client's browser can display an error page, and second the PHP script interprets the redirected URI and displays the relevant message.  For whimsy, a random comic from Lore Brand Comics is shown.  I've loosely followed Lore Sjoeberg's work since the Brunching Shuttlecocks started in the mid '90s.'''

p.challenges.append(challenge_object('<code>.htaccess</code> must catch a relative path from anywhere in the domain.', 'For some reason this eluded me for years.  On receiving an HTTP request error, the <code>.htaccess</code> used to redirect to an absolute path, including the full domain name, which meant that the PHP script didn\'t know the original URI.  Once I fixed this issue I could provide more useful information for the client.', 'Resolved'))

p.challenges.append(challenge_object('The data for each constituency varies in its content and structure.', 'The data contains various parties and candidates which vary from constituency to constituency.  As a result the data processing must be able to add an arbitrary list of candidates and parties per constituency.  This turned out to be trivial, using the database schema, but did add another layer of complexity to the project.', 'Resolved'))
コード例 #20
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('accelerator_future_prospects', 'Accelerator future prospects')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'Physics'
p.path = ''
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.github_repo_name = 'accelerator_future_prospects'
p.mathjax = True
p.introduction = 'This project was written as part of the content for a talk presented at the International Workshop on Future Linear Colliders to compare the future prospects of the LHC and lepton colliders.  It is shared here in case it is of use for other physicists.'
p.overview = '''This project simply plots a series of graphs.'''


p.challenges.append(challenge_object('Using a TMultigraph in pyroot is not easy.', 'In order to make this work I had to use the <tt>array</tt> module, a step I usually forget!  This macro should save me a few headaches in the future.', 'Resolved.'))
コード例 #21
0
ファイル: project.py プロジェクト: aidansean/i
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('indigo', 'i, short for indico')
p.domain = 'http://www.aidansean.com/'
p.path = 'indigo'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'indigo'
p.mathjax = True
p.tags = 'Physics,Tools'
p.technologies = 'AJAX,CSS,HTML,JavaScript,PHP,ZeroClipboard'
p.links.append(link_object(p.domain, 'indigo', 'Live page'))
p.introduction = 'At CERN we used a meeting orgnisation system called indico.  Each meeting had a unique ID that was used to identify the resourcs associated with it.  In many instances there were times when a person had to access a meeting page when they only knew the unique id, and not the full uri.  I made this tool to obtain the full uri, given only the meeting id.  Since this project shortens the uri for indico it is called "\(i\)", which leads to all kinds of puns.'
p.overview = '''The user can interact with \(i\) in two different ways.  They can enter the uri of a meeting page, a meeting category page, or a meeting resource, and it will return the shortened uri.  They can also enter a shortened uri to be redirected to the full uri.

When the user enters a full uri it get parsed and strings are replaced to get a short uri.  They then have the option to copy the short uri with the use of ZeroClipboard.

When they user enters a short uri the HTTP request is captured using rewrite rules in <code>.htacces</code> or <code>web.config</code>.  They are then parsed and strings replaced to give the full uri.

The domain names are matched against known domain names to make the uris even shorter.  This limits the versatility of the tool, but to include custom domain names would result in strings which were almost as long and difficult to remember as the original long uris.  users can download and extend \(i\) to include any domains they want, and instructions to do with are given in the dev page.'''

p.challenges.append(challenge_object('The user should be able to copy the short uri with a single click.', 'This was the first project where I used ZeroClipboard to enable the user to copy with one click.  It is not a solution I am completely happy with, as it takes the control away from Javascript, which is appropriately sandboxed.  However the content that is handled with flash is harmless, so there are no security issues using ZeroClipboard.', 'Resolved'))

p.challenges.append(challenge_object('The tool must be usable by users who do not use flash or Javascript.', 'In order to use the tool, the user must interact using HTTP requests.  This ensures that the user can always use the tool even if they disable flash and Javascrpt.', 'Resolved'))

p.challenges.append(challenge_object('This tool should be extendable to suit different hosts and domain names.', 'Users are encouraged to assist with the development of \(i\), and with the GitHub repository they can be download and develop their own copy.', 'Resolved'))
コード例 #22
0
ファイル: project.py プロジェクト: aidansean/ScramBuildEggs
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('ScramBuildEggs', 'ScramBuildEggs')
p.domain = 'http://www.aidansean.com/'
p.path = ''
p.preview_image_ = image_object(
    'http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg',
    408, 287)
p.github_repo_name = 'ScramBuildEggs'
p.mathjax = True
p.introduction = 'This project parses a build log and gives more untuitive output.'
p.overview = '''This is a script that parses the build log created by the CMSSW command "scram build" (hence the name!)  It takes the output, wraps it to a more readable width, splits errors by type and colours them, and also gives more useful output.  It's not complete yet, but it is already rather useful.'''
コード例 #23
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('advent2012', 'Advent Calendar 2012')
p.domain = 'http://www.aidansean.com/'
p.path = 'advent2012'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'advent2012'
p.mathjax = False
p.tags = 'Physics,Outreach,Video'
p.technologies = 'CSS,HTML,JavaScript,YouTube'
p.links.append(link_object(p.domain, 'advent2012/', 'Live page'))
p.links.append(link_object('http://www.youtube.com/', 'aidanatcern', 'YouTube acount'))
p.introduction = 'This is a collection of YouTube videos as made as an outreach project in December 2012.  Each day of Advent gives a different interesting fact about particle physics.'
p.overview = '''This is mostly an exercise in using the YouTube Javascript API.  It was this project that made me realise that the old Javascript API is now deprecated, which means I will have to update the <a href="">Marble Hornets</a> project at some point.'''

p.challenges.append(challenge_object('The YouTube Javascript API changed.', 'Having already become accustomed to the old YouTube API, it was somewhat frustrating to get used to a new one, but such is life and working with bleeding edge technologies!', 'Resolved.'))
コード例 #24
0
ファイル: project.py プロジェクト: khuramrashid/trigger
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('trigger', 'Trigger game')
p.domain = 'http://www.aidansean.com/'
p.path = 'trigger'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.folder_name = 'LHCGames'
p.github_repo_name = 'trigger'
p.mathjax = True
p.links.append(link_object(p.domain, p.path, 'Live page'))

p.introduction = 'Like the <a href="">Science Shift Simulator</a>, this is a game that emerged as a subset of the <a href="http://aidansean.com/projects/?p=543">aDetector</a> project.  The player has to save events that match the criteria given, just like a trigger does in real life.  The results are then combined across all the players in a given team to determine the final score.  The scores can be combined across experiments to make a "discovery".  This is still in development, which will continue over the net week and months.'
p.overview = '''This is another cooperative multiplayer game aimed at showing the public (especially high school pupils) how particle physics research actually takes place.  Any number of players can take part and they are split into "Team ATLAS" and "Team CMS".  The score of each team is determined by the performance of the players on each "shift" they take at the trigger, and the final scores are combined for the discovery of the Higgs boson.  There is also a "spy" mode where people can see the events as they are submitted.'''

p.challenges.append(challenge_object('This project needs an attractive, fast, and realistic detector model.', 'Having already developed a decent detector model for the aDetector project, I simply used a two dimensional version for this project.  I then split the detector finely in \(\eta\) and \(\phi\) to make interactions between the particles and detector easier.  The aesthetics went through a few iterations before settling on the final design.  However further optimisations and aesthetic changes are anticipated as development continues.', 'Resolved, to be revisited.'))

p.challenges.append(challenge_object('This game puts a bit of a strain on my server.', 'My web space uses a shared server, so sometimes many HTTP requests from the same client looks like a Denial Of Service (DOS) attack, resulting in a throttling of the requests.  There are two main strategies to overcome this.  The first option is to bundle up several requests into one request, reducing the total number of requests, and the load on the server.  This solution has not been implemented yet.  The second option is to change the server settings.  I do not have access to these, but as development continues I intend to move to a different server that can handle so many very small requests.', 'To be revisited.'))

p.challenges.append(challenge_object('This game needs cross platform and cross device support.', 'This game was initially intended to be played with an iPad, but I did not have an iPad for testing.  On the day of the release of the game I had to tweak the settings so the response times were slower with respect to mouse events to make it easier to play on a tablet device.  These settings are trivially changed to allow multiple device support.', 'Resolved.'))

p.challenges.append(challenge_object('The game should be repsonsive to the inputs of the user.', 'Initially the game did not confirm success when a user clicked on the screen and this lead to confusion.  As a result I had to add a big green "tick" for success and a big red "cross" for failure to inform the user of the status of the event.', 'Resolved.'))

p.challenges.append(challenge_object('The game needed an animated histogram for the final result.', 'I\'ve made histogras before, including histograms that update themselves on the aDetector project, but until now I had not animated a histogram.  This was a bit tricky as I had to call events which were using the <tt>this</tt> keyword, so the histogram object had to be stored as a global variable because, although I\'d like to, I couldn\'t use <tt>this</tt> to refer to the histgoram.  Javascript can be frustating like that.', 'Resolved.'))

コード例 #25
0
ファイル: project.py プロジェクト: aidansean/apollo
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('apollo', 'Apollonian gasket generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'apollo'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'apollo'
p.mathjax = True
p.tags = 'Art,Images,Maths'
p.technologies = 'canvas,HTML,JavaScript'
p.wiki_link = 'https://en.wikipedia.org/wiki/Apollonian_gasket'
p.links.append(link_object(p.domain, 'apollo/', 'Live page 1'))
p.links.append(link_object(p.domain, 'apollo/index2.php', 'Live page 2'))
p.introduction = 'One of my hobbies is creating fractals and one of the most interesting is the Apollonian gasket.  An area defined by some arcs and straight lines is recursively filled with circles and in all cases (except the trivial case of a single circle) this process recurses infinitely, making counting circles challenging.'
p.overview = '''Circles and lines are defined in much the same way (with lines having an infinite radius, and vanishing inverse radius) and from this point lines will be referred to as circles.  There is then a relatively straightforward relationship between the position of a circle and the three circles/lines which enclose it.  For three circles \\([c_1,c_2,c_3]\\) that enclose a circle \\(c_4\\), the radii are related by:

\\[
  r_4 = \\frac{r_1r_2r_3}{r_1r_2+r_2r_3+r_3r_1+2\\sqrt{r_1r_2r_3(r_1+r_2+r_3)}}
\\]

where \(r_i\) is the radius of the \(i\)th circle.  The centres of the circles, \((x_i,y_i)\) for the \(i\)th circle, are related by:

\\begin{eqnarray*}
  A_{12} & = & x_1^2 - x_2^2 + y_1^2 - y_2^2 + (r_2+r_4)(r_2+r_4) - (r_1+r_4)(r_1+r_4) \\\\
  A_{13} & = & x_1^2 - x_3^2 + y_1^2 - y_3^2 + (r_3+r_4)(r_3+r_4) - (r_1+r_4)(r_1+r_4) \\\\
  B_{12} & = & 2(x_2-x_1) \\\\
  B_{13} & = & 2(x_3-x_1) \\\\
  C_{12} & = & 2(y_2-y_1) \\\\
  C_{13} & = & 2(y_3-y_1) \\\\
コード例 #26
0
ファイル: project.py プロジェクト: aidansean/inverter
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('inverter', 'Mathematical inverter')
p.domain = 'http://www.aidansean.com/'
p.path = 'inverter'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'inverter'
p.mathjax = True
p.tags = 'Maths'
p.technologies = 'CSS,HTML,JavaScript,PHP'
p.links.append(link_object(p.domain, 'inverter', 'Live page'))
p.introduction = 'This project performs the mathetical inversion transformation.  A curve on the plane is inverted such that points within the unit circle are mapped outsid the unit circle and vice versa.'
p.overview = '''This project was developed to satisfy my curiosity about the inversion transformation.  The user can choose to use on three coordinate systems, which are Cartesian, polar and parametric.  The equations are sent to a PHP script which generates an SVG file with Javascript embedded within in.  The SVG image then changes dynamically to show the user how the curve transforms under inversion.  The user can change the graphical settings to make a more aesthetically pleasing image.

The transformation of the point \(\vec{r}=(r,\theta)\) takes the form:

\begin{eqnarray}
  r      & \\to r'      & = 1/r        \\\\
  \\theta & \\to \\theta' & = \\pi+\\theta \\\\
\end{eqnarray}
'''

p.challenges.append(challenge_object('The project should allow the user to specify an arbitrary equation to use, without incurring a penalty associated with parsing the equation.', 'By passing the equations via PHP, it is possible to write the equations otu without relying on a CPU intensive function such as <code>eval</code> to interpret the equations.', 'Resolved'))

p.challenges.append(challenge_object('This project requires Javascript to interact with an SVG iamge.', 'The security restrictions imposed on SVG images are severe, so any Javascript must be completely embedded within the SVG image itself.  This was not the first time I had embedded Javascript within an SVG image, but it was one of the first time I\'d automated the writing of the SVG image to include Javascript.', 'Resolved'))
コード例 #27
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('dice', 'Dice simulator')
p.domain = 'http://www.aidansean.com/'
p.path = 'dice'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'dice'
p.mathjax = False
p.tags = 'Tool,Frivolous'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'dice/', 'Live page'))
p.introduction = 'This is another somewhat frivolous script I wrote when playing an RPG game where we did not have enough sets of dice.  It simulates dice rolls with various modes.'
p.overview = '''There are three modes:
<ul>
  <li>Fair dice</li>
  <li>fudge dice</li>
  <li>xkcd dice</li>
</ul>
The fair dice setting is straightforward, the fudge dice have \\([-1,-1,0,0,+1,+1]\\), and the xkcd dice always return \(4\), which is an xkcd in-joke.  The colors can be chosen to match the fudge dice colours we used in the RPG, and since one of our players had OCD and we'd sometimes exchange dice colors to wind him up, there was an option to choose colors randomly.'''

p.challenges.append(
    challenge_object(
        'Picking random rgb values for the colors means that black is not always the best choice of text color.',
        'Add a few lines to see how dark a color is, and change the text to white where suitable.',
        'To be done'))
コード例 #28
0
ファイル: project.py プロジェクト: aidansean/map91
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('91map', '91 map')
p.domain = 'http://www.aidansean.com/'
p.path = '91map'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'map91'
p.mathjax = True
p.tags = 'Fiction,Poster'
p.technologies = 'canvas,CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, '91map/', 'Live page'))
p.links.append(
    link_object('http://jayisgames.com/', 'review/91.php',
                'Jayisgames review'))
p.links.append(
    link_object('http://startcontinue.com/', '91/', 'Play 91 online'))
p.introduction = 'I played the game 91 and wanted to create a map of the world.  What started out as a simple map to help keep track of the regions soon turned into a larger project which resulted in an A0 sized poster being produced.  The creator of the game got in touch and at the time of writing the first poster has been printed and more will follow.  The creator is going to publish and sell these posters online.'
p.overview = '''The game 91 is a tile based canvas game which is written entirely in Javascript (served up by PHP via AJAX requests).  The game itself has a "fog" which means that only regions in a line of sight are visible.  Given the way the game is organised means that in principle it should be easy to create a map.  I adapted the code to make maps of each region, and then created a patchwork of all these small maps to create a larger map.'''

p.challenges.append(
    challenge_object(
        'The code had to be reverse engineered to obtain all the maps.',
        'One of the most fun parts of this project was reverse engineering how the AJAX requests were handled and how the maps were parsed.  Fortunately it was relatively straightforward to do.',
        'Resolved.'))

p.challenges.append(
    challenge_object(
        'Small maps had to be combined with different drawing styles.',
コード例 #29
0
ファイル: project.py プロジェクト: aidansean/LHCDriver
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('LHCDriver', 'LHCDriver')
p.domain = 'http://www.aidansean.com/'
p.path = 'LHCDriver'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.folder_name = 'LHCGames'
p.github_repo_name = 'LHCDriver'
p.mathjax = True
p.links.append(link_object(p.domain, 'LHCDriver/', 'Live page'))

p.introduction = 'I wanted to make a "steady hand" game and realised I could make one based on the beams of the LHC.  In this game the player(s) have to control magnets in the \(x\) and \(y\) directions to keep the beams on target.  This eventually lead on to the Science Shift Simulator games.'
p.overview = '''Both beams have a random walk that moves them around the canvas.  The player(s) can affect the forces that act on the beam(s) in the \(x\) and \(y\) directions and have to keep the beams within the valid range of the canvas.  If the beams are close to each other then the instantaneous luminosity increases, and the integrated luminosity is a measure of the score.  When the beams get dumped there is the customary toilet flush!'''

p.challenges.append(challenge_object('I had to make sliders to control the forces.', 'This is the first time I made some sliders (that I would later reuse in the <a href="http://aidansean.com/projects/?p=355">Mandelbrot</a> project) and it was trickier than I thought it would be.  The event listeners need to keep track of all mouse and keyboard actions to use the slides properly and intuitively.', 'Resolved.'))

p.challenges.append(challenge_object('This was the first two player game I made.', 'Making a game that two players can play is a bit tricky, since their controls cannot be allowed to interfere with each other.  This was achieved by moving both with the keyboard.', 'Resolved.'))
コード例 #30
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('pixeler', 'Pixeler')
p.domain = 'http://www.aidansean.com/'
p.path = 'pixeler'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'pixeler'
p.mathjax = True
p.tags = 'Images,Tools'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'pixeler', 'Live page'))
p.links.append(
    link_object('http://stackoverflow.com/',
                'questions/3114147/100-safe-photo-upload-script',
                'Stack overflow: 100% safe photo upload script'))
p.introduction = 'This project was made rather quickly in response to an image challenge.  Afterwards I changed the project to allow the user to choose any image to pixelate.'
p.overview = '''The user specifies the uri of an image, and the settings for pixelation.  The image is loaded server side using PHP and then the pixels are manipulated and the image returned.  The image has to be loaded safely server side and the following code is used to check the MIME type:

<code>$imageURI = (isset($_GET['uri'])) ? $_GET['uri'] : 'monalisa_before.png' ;
$image_extension = substr(strrchr($imageURI, '.'), 1) ;</code>

<code>// Taken from http://stackoverflow.com/questions/3114147/100-safe-photo-upload-script
$mime_mapping = array('png' => 'image/png', 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg') ;
$info = getimagesize($imageURI);
if(!$info){ exit('not an image') ; }
$type = $mime_mapping[$image_extension] ;
if($info['mime']!=$type){ exit('wrong extension given') ; }</code>
コード例 #31
0
ファイル: project.py プロジェクト: aidansean/image_fader
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('image_fader', 'Image fader')
p.domain = 'http://www.aidansean.com/'
p.path = 'image_fader'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'image_fader'
p.mathjax = True
p.tags = 'Images,Tools,Web design'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'image_fader/', 'Live page'))
p.introduction = 'This is a simple script that fades an image to a given color and transparency.  It\'s used to make images for use in web design (for example, a background image that needs to fade to match the background color.)'
p.overview = '''This was made to edit the background images on my website.'''

p.challenges.append(challenge_object('Due to lack of time it only fades from the top at the moment.', 'The other three directions will be added as needed!', 'To be revisited.'))
コード例 #32
0
ファイル: project.py プロジェクト: aidansean/tricolor
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('tricolor', 'Tricolor')
p.domain = 'http://www.aidansean.com/'
p.folder_name = 'aidansean'
p.path = 'tricolor'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.github_repo_name = 'tricolor'
p.mathjax = True
p.tags = 'Toys'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'tricolor', 'Live page'))
p.introduction = 'While investigating Conway\'s game of life I wanted to see if I could easily extend the framework I\'d developed to explore other systems.  One of the more interesting cellular automata is the rock-paper-scissors system where three populations feed on each other.'
p.overview = '''The algorithm used to make the rock-paper-scissors cellular automata is does not seem to be well documented in an easy to obtain source, so I had to interpet much of the algorithm based on subjective descriptions.  Each cells has a health which can take a value between \(0\) and \(10\).  If a prey species is adjacent to its predator species then the prey species gives a health point to the predator species.  When the prey species health reaches \(0\) it is replaced by a predator species.  The result is that this creates spiral patterns on the canvas.'''

p.challenges.append(challenge_object('The algorithm needed some experimentation and tweaking to get right.', 'There are numerous papers and articles about how these algorithms work, but I couldn\'t find a source that was explicit or that I could understand.  As a result I had to create my own algorithm and tweak it until it was stable.  Hopefully others users can read my code and develop it further.', 'Resolved'))
コード例 #33
0
ファイル: project.py プロジェクト: aidansean/image_morpher
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('image_morpher', 'Image morpher')
p.domain = 'http://www.aidansean.com/'
p.path = 'image_morpher'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'image_morpher'
p.mathjax = False
p.tags = 'Frivolous'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'image_morpher/', 'Live page'))
p.introduction = '<tt>*.gif</tt> images have been around for a long time, but this is something a bit different.  It takes an array of images and changes between them randomly with random intervals of time.'
p.overview = '''The canvas is used to load images and switch between them.  The time interval is determined randomly, and images are selected at random, so this differs from the traditional .gif images in a fundamental way.'''
コード例 #34
0
ファイル: project.py プロジェクト: aidansean/dice_game
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('dice_game', 'Generic dice game')
p.domain = 'http://www.aidansean.com/'
p.path = 'dice_game'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'dice_game'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'CSS,HTML,JavaScript,Unicode'
p.links.append(link_object(p.domain, 'dice_game/', 'Live page'))
p.introduction = 'This project is a rewrite of a previous project.  It emulates the popular dice game, Yahtzee.  This game previusly used PHP, but was converted to Javascript once I became sufficiently skilled to rewrite it.'
p.overview = '''The user clicks to roll the dice, with the interactions being detected by event listeners.  As the user fills in the scores the corresponding boxes are removed via the DOM.  Users can submit scores via AJAX which are then stored in a MySQL table.'''

p.challenges.append(challenge_object('This page requires dynamic HTML content to allow the buttons to be removed as the user clicks them, and added as the game is reset.', 'This is simply achieved using the HTML DOM.', 'Resolved'))
コード例 #35
0
ファイル: project.py プロジェクト: aidansean/ROOT_colors
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('recolourer', 'Recolourer')
p.domain = 'http://www.aidansean.com/'
p.path = 'ROOT_colors'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.github_repo_name = 'ROOT_colors'
p.mathjax = True
p.links.append(link_object('http://root.cern.ch/', 'root/html/TColor.html', 'ROOT page'))
p.introduction = 'This project creates an infographic showing the ROOT colors and how they relate to each other.'
p.overview = '''Physicists use ROOT to make plots and it's often useful to be able to easily browse the color space.  ROOT provides a color wheel, but I find the rectangular display very useful as well.  In principle, colors in the same column should suit each other, which makes the rectangular display more useful than the color wheel.'''
コード例 #36
0
ファイル: project.py プロジェクト: aidansean/circle_points
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('circle_points', 'Circle from three points')
p.domain = 'http://www.aidansean.com/'
p.path = 'circle_points'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'circle_points'
p.mathjax = True
p.tags = 'Maths'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'circle_points/', 'Live page'))
p.introduction = 'This project was thrown together rather quickly to solve a geometrical problem: How can you analytically find the circle which passes through three given points?  The construction simply demonstrates that the method works, and it not intended to give any further information to the user.'
p.overview = '''Finding a circle which passes through \(n\) points is fairly easy to do: simply define a \(\chi^2\) and vary the centre and radius of the circle until the \(\chi^2\) is minimised.  I didn't want to pursue a numerical method because it was to be used in the aDetector project to emulate helix reconstruction, where it could be called hundreds or thousands of times per event.  Instead I opted to take triplets of points and estimate the circle properties from the triplets, hence I need a fast algorithm to find the circle that passes through three points.'''

p.challenges.append(challenge_object('The The main challenge was working through the algebra to find a solution.', 'It took a while to realise that some GCSE level geometry had the answer- a chord bisector is a diameter, so all I had to two was define two chords using the three points, find their perpendicular bisectors, and fint their point of intersection.', 'Resolved'))

p.challenges.append(challenge_object('Two points which are horizontally aligned lead to infinite gradients.', 'This was not addressed in the algorithm.  Initially I tried to rotate the points to solve the problem, but this seems like a poor solution.  Upon writing this report I realise that only one chord can ever be horizontal, leaving two other non-horizontal chords for use.', 'Solved, not implemented.'))
コード例 #37
0
ファイル: project.py プロジェクト: aidansean/SCP
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('SCP', 'SCP')
p.domain = 'http://www.aidansean.com/'
p.path = 'scp'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'SCP'
p.mathjax = True
p.tags = 'Fiction'
p.technologies = 'CSS,HTML'
p.links.append(link_object('http://www.scp-wiki.net/', '', 'SCP Wiki'))
p.introduction = 'SCP stands for Secure, Contain and Protect. The SCP is a wiki of special instructions for containing objects which are of interest to "The Foundation". Writing these instructions proves to be a fascinating and rewarding exercise in creative writing, and a good way to practice one''s horror writing skills.'
p.overview = '''The SCP Wiki is description of a fictional emergency containment facility.  This project collects mostly attempts at writing articles, and anything else relevant to the SCP, including the python script.'''

p.challenges.append(challenge_object('The python script has to make an HTTP request and keep the user entertained while it handles the request.', 'This was the first time I used python with HTTP requests, which turned out to be quite easy.  The script produces a series of messages to emulate the security steps needed to access the articles.', 'Resolved'))

p.challenges.append(challenge_object('It would be nice to have ASCII images appear.', 'Most SCP articles contain small images, and I\'ve already worked with <a href="http://aidansean.com/projects/?p=17">ASCII art</a> elsewhere, so it should be a matter of putting the two together, when I get time.', 'To be done'))

コード例 #38
0
ファイル: project.py プロジェクト: aidansean/mssng_vwls
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('mssng_vwls', 'Only Connect Missing Vowels game')
p.domain = 'http://www.aidansean.com/'
p.path = 'mssng_vwls'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'mssng_vwls'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'marathon', 'Live page'))
p.introduction = 'Once I came across Only Connect I became a big fan, and especially enjoyed the Missing Vowels game.  I thought this could use a game that people could play online to complement the existing "Connecting Wall" game.'
p.overview = '''The user is given a series of consonants and has to type the complete phrase, with vowels, into the input.  Event listeners handle all the user interaction and update the score when the enter key is pressed.  The quiz is timed so that the user gets 10 seconds per clue.  The categories are separate from the rest of the code to make it easier for contributors to add new categories (although in reality they still email me lists instead of sending me an updated file).'''

p.challenges.append(challenge_object('The user interface had to be very intuitive.', 'After a few iterations I made the interface as simple as possible.  The interface matches the show quite well, making it easier.  Even so, the uers has to type the answers instead of speaking them, and some users have complained that the string matching should be tolerant of simple mistakes.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('The style should match the show, as much as possible.', 'This project gave an excellent opportunity to work on CSS styling and it was a lot of fun to come up with the colour scheme to match the show.', 'Resolved'))
コード例 #39
0
ファイル: project.py プロジェクト: aidansean/color_converter
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('color', 'Color converter')
p.domain = 'http://www.aidansean.com/'
p.path = 'color'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'color_converter'
p.mathjax = False
p.tags = 'Tools,Web design'
p.technologies = 'JavaScript,CSS,HTML'
p.links.append(link_object(p.domain, 'color/', 'Live page'))
p.introduction = 'This is a very simple yet useful script for converting colours from one description to another.  What causes the most frustration here is the difference between US and UK English, as it seems I\'ll never be happy with the uri for this tool.  So I use the word "color" in the context of values the computer understands and "colour" to describe the aesthetic experience of humans.  That makes the best of a bad situation.'
p.overview = '''The user enters an rgb or hex value and the page calculates the corresponding value in the other color space. At the moment it does not alert the user when a value is invalid.'''

p.challenges.append(
    challenge_object(
        'The user can enter nonsense values, so the tool should alert the user when this is the case.',
        'Add alerts for incorrectly formatted strings and illegal values.',
        'To be done'))
コード例 #40
0
ファイル: project.py プロジェクト: aidansean/ascii_art
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('ascii_art', 'ASCII art generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'ascii_art'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'ascii_art'
p.mathjax = True
p.tags = 'Images,Art'
p.technologies = 'CSS,HTML,JavaScript,canvas'
p.links.append(link_object(p.domain, 'ascii_art/', 'Live page'))
p.introduction = 'After talking to a friend who suggested I write a text based adventure game, I decided that it would be useful to develop a way to generate graphics that could be displayed as text.  To achieve this I used the HTML canvas to analyse images and comapared the distribution of colours with various characters, providing graphical, textual, and HTML outputs.'
p.overview = '''The tool allows the user to choose various character sets for processing the images, including particles for images related to particle physics. The user can also choose which display modes to use, including "colour", "black and white", "red green, and blue", "pixelate", "Matrix".

There are two rules for determining which characters to use, which are "parsimony", and "random". Parsimony chooses a single character of a single colour that best matches the local pixels.

<h3>Strategy</h3>
The source image is divided into rectangles of equal size. The rectangles are then painted to a canvas one by one, and the pixel colours analysed to define a single characteristic colour for the rectangle depending on the mode used. (For example, when the mode is "black and white" the characteristic colour is \\((\\bar{r}+\\bar{g}+\\bar{b})/3\\), where \\(\\bar{r}\\) is the average red value of the pixels, and similarly for green and blue.)

For each rectangle each character is tested one by one to find the best match between the pixels in the source image and those in the character using the characteristic colour. To find the character with the best match a parsimony parameter, \\(p\\), is defined as the sum of the squares of the differences between the rgb values of the pixels between the character and the source image. The character with the smallest value of \\(p\\) is chosen. The expression for \\(p\\) is:

\\( p = \\sum_i \\left[ (r_i^s-r_i^c)^2 + (g_i^s-g_i^c)^2 + (b_i^s-b_i^c)^2 \\right] \\)

where \\(r_i^s(c)\\) is the r value of the \\(i\\)th pixel in the source image (character), and similarly for green and blue.

This character then gets drawn to a large canvas for graphical output, added to a <code>span</code> element for textual output, and added to a <code>textarea</code> element for HTML output.'''

p.challenges.append(challenge_object('The versatility of the tool is limited by the same origin policy restrictions, meaning that currently users can only download image generated from sources files on the same server.', 'Create a secure and reliable service for uploading images to a temporary directory on the server.', 'To be done'))
コード例 #41
0
ファイル: project.py プロジェクト: aidansean/marble_hornets
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('marble_hornets', 'Marble Hornets')
p.domain = 'http://www.aidansean.com/'
p.path = 'marble_hornets'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'marble_hornets'
p.mathjax = True
p.tags = 'Fiction,Poster'
p.technologies = 'canvas,CSS,HTML,JavaScript,MySQL,PHP,XML,YouTube'
p.links.append(link_object(p.domain, 'marble_hornets', 'Live page'))
p.introduction = 'Marble Hornets was a webseries that spans the course of about five years.  The premise of the series is that a student film maker started filming an amateur movie in 2006, but abandoned the film due to "unworkable conditions on set".  It quickly turns into a horror series that brings with some novel techniques.  However what really inspired me to make this project was the asynchronous storytelling narrative, which requires the viewer to piece together the true chronology based on the context of the videos.  I\'m an active participant on one of the busiest discussion boards for this series and regularly update this project as each new video is released.'
p.overview = '''So far, the Marble Hornets project has two main aspects to it.  The initial work began with the Marble Hornets player, a collection of youtube videos that are manipulated by the youtube JS API.  The user can autoplay all the videos in the series, filter based on many parameters, and even create their own playlists.  The player is made so that the user can autoplay everything in chronological order in full screen mode.  The data was originally stored in Javascript files, but this has since been moved to XML files to make maintenance and data entry easier and more portable.  After creating the player I added a lot of further information including links to the wikia pages, youtube videos and forum threads for each video, as well as the twitter feed, a real world map of filming locations and other interesting links, turning the player into a hub of information.

A previous version of the player was adapted to make the my_dads_tapes player, although I lost interest in the series and stopped updating that player.  At some point I intend to automate some of the player manipulation so that a user can create their own player for any youtube account, which would automatically source the relevant information and download the thumbnails.

The second aspect of the project is more interesting and challenging, and it is the automated creation of infographic images to help clarify the information known about the series.  These files are shared with the community on the  forums, and help users discuss the series.  Videos are split into scenes, which contains characters and items.  The scenes are sorted chronologically (although in many cases the chronological ordering is ambiguous, and the consensus opinion is usually taken in these cases) and then the characters and items are represented by arrows which flow from scene to scene.  The scenes are arranged in columns to give the location of the characters, or the owners of the items.  Users can create and enter their own XML files to make their own infographics, and automatically dump XML snippets by clicking on the scenes they wish to select.  The users can filter by characters, camerapersons, items, and seasons.  The scenes are colour coded to represent the sources of the footage.'''

p.challenges.append(challenge_object('The web series is told out of order, so one of the biggest problems to solve was sorting the scenes in order, when the order was sometimes ambiguous.', 'This was solved by following the fan-made "comprehensive timeline" when in doubt, and sorting the scenes with dates, and in the case of multiple scenes per day, by time.  The scenes are assigned timestamps, and the videos are assigned release dates.  With this in place, the scenes and videos can then be sorted quickly and easily.', 'Resolved'))

p.challenges.append(challenge_object('The data has to be stored in an organised manner.', 'Initially this was solved by declaring objects directly.  In order to make the data more portable and for other users to contribute, I wrote and parsed xml files, so that nearly all the data is sorted semantically.  One of the infographics keeps track of the exchange of posessions between characters, and this data is not yet accounted for in the xml files.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('This project required extensive use of the youtube js API.', 'Thanks to this project I can now queue up videos, make them autoplay, and use a timer to move between sections of video.', 'Resolved'))

p.challenges.append(challenge_object('The video stills had to respond to the user\'s actions.', 'The video player in this project allows the user to mouseover the video stills, with dynamic changes of style as the user does so, makng it more aesthetically pleasing.  This had to be responsive and with little overhead, and the result is rather pleasing.', 'Resolved'))

p.challenges.append(challenge_object('The timeline has to be laid out properly on the page.', 'This means that each element must be given enough space to display all the text and images, and then arranged to give the character arrows sufficient space.  This has been achieved using a text wrapping function, and parsing the lists of objects multiple times to ensure sufficient spacing.  Editing this code is not a pleasant experience though, it could certianly benefit from some refactoring.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('The player should allow the user to create a custom playlist', 'The user can create a playlst filtering by characters etc, and choosing to play in release order or chronological order.  The player also allows the user to watch all scenes in order.', 'Resolved'))
コード例 #42
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('conway', 'Conway\'s Game of Life')
p.domain = 'http://www.aidansean.com/'
p.path = 'conway'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'conway'
p.mathjax = True
p.tags = 'Maths,Toys'
p.technologies = 'canvas,JavaScript,HTML'
p.links.append(link_object(p.domain, 'conway/', 'Live page'))
p.introduction = 'Conway\'s game of life is a very famous mathematical model with a rich variety of "creatures" that can interact with one another.  This script is a simple interactive sandbox where the user can "paint" cells to create different shapes.  There are a number of predefined boards that the user can choose to investigate some small and interesting patterns as they evolve.'
p.overview = '''The underlying mathematics is very simple.  Conway's game of life follows three simple rules:
<ol>
  <li>A dead cell comes to life if there are three adjacent cells which are alive.</li>
  <li>A living cell dies if there are fewer than two adjacent cells which are alive.</li>
  <li>A living cell dies if there are more than three adjacent cells which are alive.</li>
</ol>

This is achieved by simply iterating over the board where each cell has two possible states (dead/alive) as well as the state from the previous turn.  This procedure is then wrapped up in a series of <code>window.setTimeout</code> calls to allow the board to evolve.'''

p.challenges.append(challenge_object('The user must be able to paint cells to make shapes.  The interaction must match the underlying grid.', 'Overcoming this challenge was largely a matter of seamless performance as well as correct handling of events.  This was surprisingly straightforward given the <a href="http://www.quirksmode.org/js/events_properties.html#position">lack of cross browser support</a> for finding the cursor position.', 'Resolved'))

p.challenges.append(challenge_object('Ideally this should be an infinite sandbox.', 'After toying with the idea of an unlimited size of board the stretches to match the user\'s patterns it was decided that this would be unfeasible.  As the size of the board increases (for example, due to gospel gliders moving off to infinity) the amount of memory required to contain the game would increase to dangerous levels.  In addition the splicing of additional columns (and to a lesser extent, rows) of the board would incur a significant CPU cost.  The board is sufficiently large for most interesting patterns.', 'Resolved'))

p.challenges.append(challenge_object('Saving patterns with markup.', 'One of the most useful features was for users to be able to share their patterns with other people.  To do this there is a link which automatically updates, storing the current board as a string as a url argument.  This is then parsed, which turned out to be quite simple, and centred on the board.', 'Resolved'))
コード例 #43
0
ファイル: project.py プロジェクト: aidansean/tetris
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('tetris', 'Generic block stacking game')
p.domain = 'http://www.aidansean.com/'
p.path = 'tetris'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'tetris'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'AJAX,CSS,HTML,JavaScript,MySQL,PHP'
p.links.append(link_object(p.domain, 'tetris/', 'Live page'))
p.introduction = 'This was my first serious Javascript project which was written some time in 2009.  I chose to write a Tetris clone because it was a well defined project that would teach me how to use Javascript.  In addition to Tetris I also made Tritris and Pentris to see how well balanced the three games are compared to each other.  It turns out that Tetris is about right, with Tritris being too easy and Pentris being too hard.'
p.overview = '''The user plays the game with the arrow keys, and the game gets slowly faster as their score increases.  There is a MySQL and PHP backend to save scores on the server.  As much as possible, the three games have been harmonised so that they use the same page, the same Javascript library, and the same PHP page for interaction with the server.  This is outlined in <a href="http://aidansean.com/projects/?p=473">a previous post</a> where I discussed how the code was refactored.  This is one of my favourite projects, as it's one of the few "complete" projects that touches on almost all of Javascript, with some HTML, CSS, PHP, MySQL, httpxml, and cookies also thrown in there.  This project taught me so much about Javascript and was an excellent start with the language.'''

p.challenges.append(challenge_object('This project required learning how to use Javascript.', 'What a challenge!  Having worked previously with C++, I found that Javascript was rather easy to learn, and quickly came across its peculiarities and limitations.', 'Resolved'))

p.challenges.append(challenge_object('The project required detailed manipulation of the DOM.', 'It was with this project that I learned how to use the DOM, which helped me to better understand the heirarchical structure of XML in general.  I also wanted the HTML to be semantically pure, so while I used the DOM to store some information about the state of the game, I also ensured that it was semantically consistent.', 'Resolved'))

p.challenges.append(challenge_object('This game required careful control of Javascript events and synchronisation.', 'This was probably the most difficult and instructive part of the project.  I had to learn how to register event handlers in a manner which worked across browsers.  I still use the same style of event handling today that I developed when I wrote this project.  It took a while to get used to the issues of synchronisation using the <tt>window.setTimeout</tt> method, which I still use frequently today.', 'Resolved'))

p.challenges.append(challenge_object('I had to store some data on the server.', 'I had had plenty of experience with PHP and MySQL before this project, including sanitising input to the database, so the PHP side of this challenge was easy to implement.  However making the httpxml requests was not so easy and took some practice.  After a few iterations I got a working model, although this is something I should improve further, as httpxml requests tend to be rather messy.', 'Resolved'))

p.challenges.append(challenge_object('One of the users wanted a feature that required cookies.', 'One user spent so long playing the game that he wanted to be able to "block" himself.  As a result I had to implement a feature hat sets a cookie that prevents the user from playing.  This was the first time I had set and read cookies using Javascript, and not something I have had much use for since.', 'Resolved'))

p.challenges.append(challenge_object('The game has a soundtrack.', 'Having used so many feature of Javascript, I wanted to add some music.  This is far from trivial in the world of Javascript, and not so easy in the days befre embedded YouTube videos.  Although support is a little shaky, the music was added and an interface included.', 'Resolved'))

p.challenges.append(challenge_object('The game had to have cross browser support.', 'This game was initially developed using Firefox, but one of the users wanted it to work with Chrome.  This was the first time I met the frustration of cross browser event handling, which has been something of a pain ever since, but it was not too hard to overcome.', 'Resolved'))
コード例 #44
0
ファイル: project.py プロジェクト: aidansean/recolourer
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('recolourer', 'Recolourer')
p.domain = 'http://www.aidansean.com/'
p.path = 'recolourer'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'recolourer'
p.mathjax = True
p.tags = 'Tools'
p.technologies = 'canvas,CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'recolourer', 'Live page'))
p.introduction = 'This project has been on my to-do list for a very long time.  The idea is to take an image which is difficult for a colour blind person to view, and then remap the colours to make it easier for them to view.'
p.overview = '''This project has been on the back-burner for many years, and a physicist interested in equal opportunities this issue has been of interest to me since my sabbatical year working as an equal opportunities officer.  Scientists often use colour to make plots clearer, most physicists are male, most colourblind people are male, and most scientist generally do not care about making their plots more accessible.  The situation is getting better, slowly, but I thought it would be useful to have a stop gap tool to help people.  This project was the first step in that direction, but since making the first step there have been many other higher quality tools out there. As a result I stopped working on this project and left it as a legacy tool.

The project takes an image and maps the colours from one part of the rgb space to another, essentially removing the red component.  This should in principle make the images easier to view for someone with red-green colourblindness, although in practice an individual user's colourblindness would have to be mapped out and a custom built algorithm made.  In principle this is not difficult to achieve, I simply didn't dedicate time to this part of the project given the success of other tools.'''

p.challenges.append(
    challenge_object(
        'The colours had to be matched in a way that retained good discrimination between colours in a smaller colour space.',
        'I\'m not actually sure I achieved a good discrimination by removing the red component, but this is as good as I could manage with fairly little time.  The sample image suggests that the boundaries between the various colours looks clear enough.',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'As usual, when using external images it\'s important to check the input.',
        'I recycled code from the pixeler project to make sure the images were safe server-side.  Since this tool is used for remapping colours of any image I cannot limit it to the same domain, so PHP must be used.',
        'Resolved'))
コード例 #45
0
ファイル: project.py プロジェクト: aidansean/insult
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('insult', 'Insulter')
p.domain = 'http://www.aidansean.com/'
p.path = 'insult'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'insult'
p.mathjax = False
p.tags = 'Frivolous'
p.technologies = 'CSS,HTML,PHP'
p.links.append(link_object(p.domain, 'insult', 'Live page'))
p.introduction = 'This is another simple and frivolous project.  A student showed me a page illustrated a table with three columns that could be used to make an insult.  It looked liek it should be coded up, and I had 15 minutes to spare, so I did.'
p.overview = '''The insult is generated randomly using PHP.  This ensures that the user has no way to know in advance how many possible insults there are, or how many combinations are available.  This can, of course, be extended to anything, and may be used to give random compliments in the future.'''
コード例 #46
0
ファイル: project.py プロジェクト: aidansean/cipher
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('cipher', 'Ciphers')
p.domain = 'http://www.aidansean.com/'
p.path = 'cipher'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'cipher'
p.mathjax = False
p.tags = 'Maths'
p.technologies = 'CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'cipher/', 'Live page'))
p.introduction = 'This page contains some simple ciphers. This was going to be extended to include some more sophisticated ciphers, but I didn\'t have the time or incentive to develop this page further.'
p.overview = '''At the moment the page currently supports two simple cipher:
<ul>
  <li>rot-13: A cipher where each character is shifted by 13 places along the alphabet</li>
  <li>Holly: A cipher developed by a friend as a child.  This page was made to crack that cipher for fun.</il>
</ul>'''
コード例 #47
0
ファイル: project.py プロジェクト: aidansean/i_greasemonkey
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('i', 'i (greasemonkey)')
p.domain = 'http://www.aidansean.com/'
p.path = 'i'
p.preview_image_ = image_object('http://placekitten.com.s3.amazonaws.com/homepage-samples/408/287.jpg', 408, 287)
p.folder_name = 'greasemonkey'
p.github_repo_name = 'i'
p.mathjax = False
p.links.append(link_object(p.domain, 'indigo/', 'indigo page'))
p.introduction = 'One of the projects I wrote was an indico uri shortening service, called <em><a hhref="http://aidansean.com/projects/?p=191">i</a></em> (or indigo, depending on how ugly "<em>i</em>" looks in context) but I wanted to go a step further.  So I write a greasemonkey script so that I could get to indico pages without even loading the main page.  This takes up very few pixels on the screen, making it much faster to get to the meeting pages.'
p.overview = '''This is a rather simple script.  It simply redirects (in a new tab) to the <em>i</em> page, which redirects to indico.'''
コード例 #48
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('hotel', 'L\'Hotel d\'Aidan')
p.domain = 'http://www.aidansean.com/'
p.path = 'hotel'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'hotel'
p.mathjax = False
p.tags = 'Tools'
p.technologies = 'CSS,HTML,JavaScript,MySQL,PHP'
p.links.append(link_object(p.domain, 'hotel', 'Live page'))
p.introduction = 'When I was living near Geneva I had a spare room and many people came to visit for work or leisure.  To make it easier to keep track of who was visiting when I created a page where people could book my spare room.'
p.overview = '''This project makes extensive use of Javascript, PHP and a MySQL backend.  The user interacts by selecting HTML elements, which change dynamically based on the interactions.  Data is sent to the server via POST requests, which are then parsed via PHP and stored to a MySQL table.  The status of the data can be updated via a custom made admin panel.  Whenever a request is made, an email is sent to alert the admin.  This project had its own standalone HTML wrapper, and enabled the admin to add several pages containing additional information.  Bookings were requested using a custom made calendar interface.'''

p.challenges.append(
    challenge_object(
        'Dynamic user interaction had to be monitored carefully.',
        'The user interaction is monitired using Javascript and the HTML elements dynamically changed via the DOM.  The status of a booking changes depending on the current state in the database and how the user interacts.  Interaction required updating multiple elements (eg several succesive days.)',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'The booking system required a functional and intuitive calendar interface.',
        'This project was one of the first time I had to create a calendar interface from first principles.  Given that the differences in time took place in a single timezone this was relatively straightforward, although string paring initially presented some difficulties.',
        'Resolved'))

p.challenges.append(
    challenge_object(
コード例 #49
0
ファイル: project.py プロジェクト: aidansean/pixeler
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('pixeler', 'Pixeler')
p.domain = 'http://www.aidansean.com/'
p.path = 'pixeler'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'pixeler'
p.mathjax = True
p.tags = 'Images,Tools'
p.technologies = 'canvas,HTML,JavaScript'
p.links.append(link_object(p.domain, 'pixeler', 'Live page'))
p.links.append(link_object('http://stackoverflow.com/','questions/3114147/100-safe-photo-upload-script', 'Stack overflow: 100% safe photo upload script'))
p.introduction = 'This project was made rather quickly in response to an image challenge.  Afterwards I changed the project to allow the user to choose any image to pixelate.'
p.overview = '''The user specifies the uri of an image, and the settings for pixelation.  The image is loaded server side using PHP and then the pixels are manipulated and the image returned.  The image has to be loaded safely server side and the following code is used to check the MIME type:

<code>$imageURI = (isset($_GET['uri'])) ? $_GET['uri'] : 'monalisa_before.png' ;
$image_extension = substr(strrchr($imageURI, '.'), 1) ;</code>

<code>// Taken from http://stackoverflow.com/questions/3114147/100-safe-photo-upload-script
$mime_mapping = array('png' => 'image/png', 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg') ;
$info = getimagesize($imageURI);
if(!$info){ exit('not an image') ; }
$type = $mime_mapping[$image_extension] ;
if($info['mime']!=$type){ exit('wrong extension given') ; }</code>

<code>switch($type){
	case 'image/jpeg': $source = imagecreatefromjpeg($imageURI) ; break ;
	case 'image/gif' : $source = imagecreatefromgif ($imageURI) ; break ;
	case 'image/png' : $source = imagecreatefrompng ($imageURI) ; break ;
コード例 #50
0
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('pebbling', 'Pebbling a Chessboard')
p.domain = 'http://www.aidansean.com/'
p.path = 'pebbling'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'pebbling'
p.mathjax = True
p.tags = 'Games,Maths'
p.technologies = 'canvas,CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'pebbling', 'Live page'))
p.introduction = 'One of the channels I follow on YouTube is called Numberphile, and they give plenty of good ideas for mathematical games.  In this game the user has to move pieces around a chessboard in order to liberate "clones" from a prison. On Numberphile, they suggested playing this game using an actual chessboard, but I decided that a better way to do it would be to write my own game.  So here it is.'
p.overview = '''The user interacts by clicking on the clones it wants to move around.  In addition to this the user can create their own puzzles.  Since I had already developed a lot with the canvas, this was simply a matter of using existing experience to make a game.'''

p.challenges.append(
    challenge_object(
        'Making the weights.',
        'Ideally the weights of the squares should be displayed when requested.  In Firefox this worked fine, but not in Chrome.  The reason for this is that I wanted to make a fraction line with a length proportional to the number of digits in th denominator.  This meant I had to use a <code>log10</code> function, but his does not exist in Chrome.  After much debugging I found the problem and fixed it.  This one bug prevented me from sending this page to Numberphile within a few days of making the game.',
        'Resolved'))
コード例 #51
0
ファイル: project.py プロジェクト: jhualberta/feynman
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('feynman', 'Feynman diagram maker')
p.domain = 'http://www.aidansean.com/'
p.path = 'feynman'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'feynman'
p.mathjax = False
p.tags = 'Tools,Physics'
p.technologies = 'canvas,HTML,PHP,SVG'
p.links.append(link_object(p.domain, 'feynman', 'Live page'))
p.introduction = 'One of the most common diagrams that particle physicists use are Feynman diagrams.  There are already a few tools that can be used to make them, but they usually have some significant drawback (including non-intuitive interface, poor quality graphics, lack of control over the final image, text only input.)  This is a drag and drop style Feynman diagram maker aimed at making creation of the diagrams as quick and simple as possible.  This is quite an advanced project with lots of scope for further development.'
p.overview = '''The user clicks and drags to create elements on an HTML canvas.  These elements can be simply written to an image file.  In order to create symbols, MathJax is used to interpret LaTeX snippets.  When the user clicks on a symbol an SVG image is used to capture the element graphically and then this is written to a canvas.  (Often a symbol is used several times in one diagram, so saving to an intermediate canvas saves CPU time and memory.)  This canvas is then copied to the larger canvas when the user clicks on it.'''

p.challenges.append(
    challenge_object(
        'The application requires the user to be able to interact with the mouse, requiring careful managing of event listeners.',
        'The interactions are handled using the <code>mousedown</code>, <code>mousemove</code>, <code>mouseup</code>, and <code>mouseout</code> to handle the interacations, and a variable <code>current_brush</code> keeps track of the current action and (for a many step interaction) the current step.',
        'Resolved'))

p.challenges.append(
    challenge_object(
        'It\'s necessary to be able to add different symbols.',
        'Adding a symbol to the canvas is not a simple procedure.  MathJax can be use to take a snippet of LaTeX and lay it out on the page in an attractive manner, similar to LaTeX.  In order to import this to a canvas it must be first imported to an SVG object, and then imported to a canvas.  By using MathJax it is possible to allow the user to create their own symbols.  In addition, a selection of preset symbols are defined.  By using SVG in Chrome and Safari the security limitations make it impossible to export the pixel data from the canvas.',
        'Resolved, to be revisited'))

p.challenges.append(
    challenge_object(
コード例 #52
0
ファイル: project.py プロジェクト: aidansean/GoogleMapsWar
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('GoogleMapsWar', 'Google Maps War')
p.domain = 'http://www.aidansean.com/'
p.path = 'GoogleMapsWar'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'GoogleMapsWar'
p.mathjax = False
p.tags = 'Games'
p.technologies = 'canvas,HTML,JavaScript,GoogleMaps'
p.links.append(link_object(p.domain, p.path, 'Live page'))
p.introduction = 'This project was made partly to combine the <a href="http://aidansean.com/projects/?p=605">Hexagonal civ</a> game with Google Maps, and partly to push the Google maps API to its limits.  It turns out that Google Maps is not suited to this heavy use.'
p.overview = '''This project is intended to be a Risk style conquest game based on a map of Europe.  The maps would be split into hexagons with rules for how the different unit (land, air, sea) could move from place to place.  The map is split into equal areas of latitude and longitude with values chosen to best suit the arrangement of cities.  Ideally the economic value of each hexagon would be taken into account, although this would require quite a bit of research.  The connections between the hexagons is already defined, so in principle this could lead to a rather simple game by randomising the economic and defensive values of each hexagon (or giving them all equal value.)'''

p.challenges.append(challenge_object('The hexagons should be arranged in equal latitude and longitude, which isn\'t necesarily equal area on the page.', 'The hexagons are not equal in area, so I had to draw them from the centre of each hexagon and find their vertices using polar coordinates around the centre of the hexagon.  This was the first time I had drawn the hexagons this way and it turned out easier to make the drawing functions if I did it like this, given that I had already solved the coordinate problem in the hexagonal civ project.', 'Resolved'))

p.challenges.append(challenge_object('The game requires quite a bit of data entry.', 'Finding the economic values of each hexagon is very difficult and time consuming, so this has been put off indefinitely.  The connections for the land, sea and air units have already been determined.', 'To be revisited'))

p.challenges.append(challenge_object('Drawing the hexagons requires drawing many polygons.', 'Using geometrical experience from the <a href="http://aidansean.com/projects/?p=608">Skyline project</a>, I found a reasonable way to label the hexagons with hatching in a colourblind friendly way.  However the sheer number of polygons means that the performance is quite poor.  It might be prefereable to draw the large map without Google Maps, and only underlay Google Maps when the user requests it.', 'Resolved, to be revisited'))
コード例 #53
0
ファイル: project.py プロジェクト: aidansean/skyline
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('skyline', 'Skyline generator')
p.domain = 'http://www.aidansean.com/'
p.path = 'skyline'
p.preview_image    = image_object('%s/images/project.jpg'   %p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg'%p.path, 150, 250)
p.folder_name = 'aidansean'
p.github_repo_name = 'skyline'
p.mathjax = False
p.tags = 'Maths,Toys'
p.technologies = 'canvas,CSS,HTML,JavaScript'
p.links.append(link_object(p.domain, 'skyline', 'Live page'))
p.introduction = 'One of the features I want on my webpage is the silhouette of a skyline to use as background image.  This project is aimed at allowing the user to draw a complex skyline, with the possibilty for animation.'
p.overview = '''The user can create individual "buildings" with many layers, and then arrange the buildings into a skyline to generate an image.  If possible, the user can animate the image (for example adding lights at night, allowing the sky to change to match the time of day.)

The design would take place on the canvas, with a suite of tools to allow the user to correctly determine the size of buildings, add arches, spires etc.  A second layer would allow the user to add windows, and a third layer would allow them to add other features.  These would then be saved to file and a script would read the file to render the images on screen.  The images would be rendered on a canvas that sits behind the main content of the page.  This project is largely a problem of geometry.'''

p.challenges.append(challenge_object('Initially I wanted to set the canvas as the background of the page.', 'There are methds of taking the content of a canvas and using it to draw images that can be used with the DOM.  I tried to use Javascript to change the source of the background image to match the canvas, but this lead to "flickering" effects, even when to canvases were used.  As a result this was not a viable option.', 'Abandoned'))

p.challenges.append(challenge_object('The user needs a simple and intuitive interface.', 'This project allows the user to draw wire frames for the buildings.  They can draw straight lines, circle arcs, and quadratic curves.  The interface is not perfect, but it is easy enough to quickly make buildings.  A grid is also provided so the user can keep track of sizes.', 'Resolved'))

p.challenges.append(challenge_object('This projects needs to be able to calculate interections and unions of polygons.', 'One of the hardest problems to solve is the interserction and union of two shapes, so that the user can make complex shapes.  This is a non-trivial problems of geometry and finding solutions online was not east.  I honest cannot remember if I completely solved this problem or not.', 'Resolved, to be revisited'))

p.challenges.append(challenge_object('This project would ideally respond to the client\'s time.', 'Animation and time dependence has not been implemented yet, but eventually the colour of the sky and weather would chance, lights would turn on and off, and vehicles would move.  This should be relatively simple to implement, once I find the time.', 'To do'))
コード例 #54
0
ファイル: project.py プロジェクト: aidansean/LGBT_map
from project_module import project_object, image_object, link_object, challenge_object

p = project_object('LGBT_maps', 'LGBT map')
p.domain = 'http://www.aidansean.com/'
p.path = 'LGBT_maps'
p.preview_image = image_object('%s/images/project.jpg' % p.path, 150, 250)
p.preview_image_bw = image_object('%s/images/project_bw.jpg' % p.path, 150,
                                  250)
p.folder_name = 'aidansean'
p.github_repo_name = 'LGBT_maps'
p.mathjax = True
p.tags = 'LGBT,Tools'
p.technologies = 'canvas,CSS,HTML,GoogleMaps,JavaScript,XML'
p.links.append(link_object(p.domain, 'LGBT_map', 'Live page (Google Maps)'))
p.links.append(
    link_object(p.domain, 'LGBT_map', 'Live page (Colourblind safe)'))
p.introduction = 'One of my more far reaching projects is the LGBT CERN group. It is a diverse group with people from across the world, and one of the issues that we care about is safety in different nations.  This project keeps track of progress in different nations.'
p.overview = '''The information is stored in xml files which are then read and used to create maps.  The user can step forward and backward through the history, or let it autoplay.  There are two versions of the page, once which uses Google Maps and one which has a custom map which is more colourblind friendly.

There is scope to extend this project for other uses, and I also have maps showing the state of the EU and its history.

This project is currently unfinished and needs some further cleaning up of code when time allows.'''

p.challenges.append(
    challenge_object(
        'Finding vectors for the national borders was not easy.',
        'After much searching I found some useful vectors for the national borders. They are used here with two caveats: they are not my intectual property, and they are not small in size.  As a result I am not too keen to share this project with the wider world.',
        'Resolved'))

p.challenges.append(
    challenge_object(