Wednesday, May 29, 2013
That's a Wrap
I am wrapping up this blog as I am preparing to print and bind it. There are a lot of loose threads, "I will post about"s, and a distinct lack of closure. Fractal Canvas has most of its features and most of its design, but hasn't been published, tested, and revised in full-form yet.
The process of developing Fractal Canvas has been fun, challenging, and instructional. My primary growth in reflecting on that learning process in this blog has been learning how to communicate my projects to a general audience in a varied, interesting, general voice. I hope you have enjoyed reading this blog, and maybe some day you can check out www.fractalcanvas.com again and see what it becomes.
Istvan.
Elite Athletes Listen To Their Coaches
An interesting trait shared by the best teachers I have ever had is they recognize what I do outside of class and have a reasonable idea of how their class fits in. A teacher who is fully involved in their subject may produce high test scores, but not necessarily well-rounded students.
A good coach, on the other hand, is hired to perfect one skill (gymnastics for example). To this extent, coaches and teachers are not similar.
Both do give advice and criticism, however. Being receptive to that feedback is important in both cases, and often difficult in both cases. Especially in my project where I wanted to incorporate user feedback into my site, the difference between criticism on how the site works vs. how they expect it to work is very different from criticism on my process. The former is easy to receive for me, the latter takes cogitation.
There isn't really a "moral" to this post, it's just some observations for consideration.
Istvan.
Logistics Explained
Sunday, May 26, 2013
Statistics
specified SFW lines: 448 (The basics for the page with no content (including sidebar, login, etc. just the page)
generated SFW lines: 2184 (The framework takes the above SFW lines and generates the live code of this length)
specified CSS lines: 2174 (Including the base style that comes with the framework, this is how many lines of styling code there are on the site)
specified JS lines: 23163 (Including the libraries included in the framework, this is how many lines of JavaScript are on my site)
I might modify the statistics code to tell me how much of those last two pieces I wrote. Stay posted!
Saturday, May 25, 2013
Fractal Engine
Note: this code is not yet optimized - by storing some values instead of calculating them multiple times and by algebraically simplifying some operations I anticipate this code running far more quicklky and effeciently than it does.
//fractalCanvasEngine provides tools to generate and manipulate fractals function fractalCanvasEngine() { //transpose is a function to scale and move the points in a fractal so that the first point is on (0,0) and the last point is on (1, 0) this.transpose = function(sketchPoints){ var transposedSketchPoints = [], angle, length, pointAngle, pointLength, i; //calculates the length of the line connecting the first and last points length = Math.sqrt(Math.pow(sketchPoints[0][1] - sketchPoints[sketchPoints.length - 1][1], 2) + Math.pow(sketchPoints[0][2] - sketchPoints[sketchPoints.length - 1][2], 2)); //calculates the angle of the line connecting the first and last points angle = Math.asin((sketchPoints[0][2] - sketchPoints[sketchPoints.length - 1][2]) / length); //for each point in the fractal apply the rotation and scaling for(i = 0; i < sketchPoints.length; i++){ pointLength = Math.sqrt(Math.pow(sketchPoints[0][1] - sketchPoints[i][1], 2) + Math.pow(sketchPoints[0][2] - sketchPoints[i][2], 2)); pointAngle = Math.asin((sketchPoints[0][2] - sketchPoints[i][2]) / pointLength) - angle; //Add the newly transformed point to the output array transposedSketchPoints.push([ sketchPoints[i][0], Math.cos(pointAngle) * pointLength / length || 0, Math.sin(pointAngle) * pointLength * -1 / length || 0 ]); } return transposedSketchPoints; } //scale takes a fractal and rescales it to fit in a 1 by 1 window this.scale = function(points){ var minX = points[0][1] || 0, maxX = points[0][1] || 0, minY = points[0][2] || 0, maxY = points[0][2] || 0, scaleFactor, point; //find the size of the fractal (height and width) for(point in points){ if(points[point][1] < minX) minX = points[point][1]; if(points[point][1] > maxX) maxX = points[point][1]; if(points[point][2] < minY) minY = points[point][2]; if(points[point][2] > maxY) maxY = points[point][2]; } //calculate how much the fractal needs to be scaled scaleFactor = Math.min(1 / (maxX - minX), 1 / (maxY - minY)); //apply the scaling to each of the points for(point in points){ points[point][1] -= minX; points[point][1] *= scaleFactor; points[point][2] -= minY; points[point][2] *= scaleFactor; } return points; } //the heart of the fractal engine - a recursive function that generates the fractal this.getLevel = function(remainingLevels, points) { //continue recursive operation, there are more levels to calculate if(remainingLevels > 0){ var subLevel = this.getLevel(remainingLevels - 1, points), prevPoint, curPoint, rotFactor, scaleFactor, returnLevel = new Array(), subRot, subScale, i, inverse; for(i = 1; i < points.length; i++){ prevPoint = points[i-1]; curPoint = points[i]; if(curPoint[0] === 1 || curPoint[0] === 2){ //this is where the actual fractal is generated... its fairly complex. In short, it converts the fractal to polar, applies the transformations (including flipping it if necessary) and then converts it back to rectangular. I am not going to try to explain where/how all of that happens. scaleFactor = Math.sqrt( Math.pow((curPoint[2]-prevPoint[2]), 2) + Math.pow((curPoint[1]-prevPoint[1]), 2) ); rotFactor = Math.asin((curPoint[2]-prevPoint[2])/scaleFactor); inverse = (curPoint[0] === 1 ? 1 : -1); for(var j = 0; j < subLevel.length; j++){ subScale = Math.sqrt(Math.pow(subLevel[j][2], 2) + Math.pow(subLevel[j][1], 2)); subRot = Math.asin((subLevel[j][2]/subScale) || 0); if(subLevel[j][1] < 0) subRot += (Math.PI/2 - subRot)*2; returnLevel.push(Array(subLevel[j][0], ((subScale)*scaleFactor)*Math.cos(rotFactor+inverse*subRot)+prevPoint[1], ((subScale)*scaleFactor)*Math.sin(rotFactor+inverse*subRot)+prevPoint[2])); } } else returnLevel.push(Array(curPoint[0], curPoint[1], curPoint[2])); //the type of this segment is not one that requires it to be replaced by a fractal } return returnLevel; } else return [[1, 0, 0], [1, 1, 0]]; //level 0 is just a line } } var fractalCanvasEngine = new fractalCanvasEngine();
Sample Presentation
The presentation also served as a good kick to start seriously thinking about my own project and my readiness.
Istvan.
Uh-oh
Stay posted.
Fractal Canvas - Major Update
it seems that several of my previous posts from my phone didn't publish to my blog, and were only saved as a draft due to a bug in the Blogger application. In this post, I will compile all of the exciting news that should have been posted over the last two weeks or so.
The control palate for a line segment has been tightened up and committed to the live code base (sketches and a mockup were posted earlier)! The live code now lets you draw a template and change the line types (0 through 5) for any line by clicking on that segment and then the appropriate number. The move, splice, and delete functions are working to varying degrees on the test site now. Hopefully those three functions will also be committed to the live site by tomorrow when I have a day off school and can work out some quirks.
The engine is what takes the points from the template and draws the fractal. I wrote the engine on a test site at first, then I updated the beta drawing engine, split it into three functions, committed it to the site, and linked it in. Users can now create fractals from custom templates.
Sunday, May 5, 2013
Happiness Revisited
Code Red
Sunday, April 28, 2013
Comfort Zone
Wednesday, April 17, 2013
Mentor Meeting
Monday, April 15, 2013
Revision 2827
When I found this app I figured I'd bring it to the Fractal Canvas site -- Check it out!
I will be posting documentation for it soon... Once I remember how it works :)
The title of this post comes from the revision of SAFE (the framework I use) that I installed today. I asked for a couple of features to be added that were required to get this app running, and that revision contains those updates.
Istvan.
Sunday, April 14, 2013
Two Tramps in Mud Time
...I had no right to play with what was another man's work for gain.
My right might be love but theirs was need.
And where the two exist in twain
Theirs was the better right - agreed.
I think it's interesting that in our culture one's enjoyment is second to another's livelihood. I don't know that it is good or bad.
Perhaps it is a naivety, but I think that people can make a living of their love. Ms. Gergely is always encouraging her students to love their projects, their school work. My greatest mentors have loved something enough that they made a living from it. In particular I think Neil deGrasse Tyson is a great example.
Istvan.
Wednesday, April 10, 2013
Controls
Monday, April 8, 2013
Tweaks and Quirks
When I work at home, I have my laptop's 17.3" screen and a 22" display connected. I test all of the apps I create on this setup, which leads to some quirks sometimes. For example, the Iterative Canvas controls all fit fine (with plenty of room to spare) on my screens, but when people viewed the app on school computers they found that the controls were too wide for the screen and that it was difficult to see the controls and the canvas at the same time. I have tweaked a few things to minimize the screen real estate the controls take up, hopefully bettering the experience of users.
Down the road, I might make the controls a drawer on the canvas, so you hover your mouse on the top or right side of the canvas, the controls slide out, you change what you like, and then when you hit 'Go' the controls slide back in. This will take some thought though, since it might be inconvenient at times.
But thats later to come.
One of the comments I have gotten several times has been "Can you explain the Fractals and Chaos behind the app?" -- In previous posts I have struggled with explaining what is going on in big chunks of text. For several reasons, those walls of information are less than ideal - not the least of which is that presented to me I certainly would not read it! One idea I got from a friend is to make videos. I need to explore this a little more, but I am thinking it would be very cool to make 1 minute videos explaining what is going on in apps. These are much more friendly to consume, and allow me to present the ideas verbally - a medium with which I am far more familiar.
Istvan.
Sunday, April 7, 2013
Quick Lists
- 7 Things I want to accomplish in the next week
- Design (sketch) the tool palette for Fractal Canvas
- Implement the tool palette for Fractal Canvas
- Code template functions
- Code template to sketchPoints features
- Decide on Canvas vs WebGL implementation
- Explore more ad spots
- Make Iterative Canvas more friendly to SMART Board setup
- 5 People I should talk to about my project
- Mr. Drix
- A student who is now using Iterative Canvas in class
- A student who is now using Iterative Canvas in class
- A student who is now using Iterative Canvas in class
- A student who is now using Iterative Canvas in class
- Supplies I need to get
- Supplies not required
- 3 Things I should talk to my mentor about
- Testing plan for Fractal Canvas
- Video lessons for all apps
- Review of how Iterative Canvas is doing in-class
- 7 Things to research
- JavaScript Closures
- SVG Optimization
- Canvas vs. WebGL implementation
- Advertising options
- How to perform usage analysis of web apps
- How to make the site load more quickly
- Learn how to use drag and drop features of HTML5 for layout adjustments
Ads
Istvan.
Wednesday, March 27, 2013
Data Structures
function hashedArray(){
this.id = 0; //the ID of the newly inserted element
this.elements = []; //holds the data
//gets the length of the elements (needed because array is sparse)
this.length = function(){
var cnt = 0;
for(var i in this.elements) cnt++;
return cnt;
};
//index is optional - defaults to the end of the array
this.insert = function(elem, index){
index = ((typeof index === 'undefined') ? this.elements.length : index);
this.elements.splice(index, 0, {hash: this.id, data: elem});
return this.id++;
};
//getter
this.get = function(){
return this.elements.map(function(elem){ return elem.data; })
};
//get an element by its hash
this.getElementByHash = function(hash){
for(var elem in this.elements) if(this.elements[elem].hash === hash) return this.elements[elem]; //find the element
};
}
//create an object to hold the sketch points
this.sketchPoints = new hashedArray();
Sunday, March 24, 2013
SVG
[...] an XML-based vector image format for two-dimensional graphicsPreviously, for the Fractasketch template, I drew a dot at the end of each line segment in the template and then drew lines connecting the dots on a template.
This is not flexible at all though when designing the UI. I only have access to events on the dots (mouse over, clicking on etc.) By switching to SVG for the template drawing, I will be able to write a highly interactive UI where users can click on the lines, points, and arrows that make up the template.
I will post pictures of tests and demos as I learn how to incorporate dynamic SVG content into my page.
Istvan.
Thursday, March 21, 2013
Mentor Meeting
In my experience, some teachers only use Smart Boards as projectors, some have them but don't use them at all, and a handful use Smart Boards to enhance their lessons beyond what an overhead can do. There are, however, some teachers and some lessons that feature a Smart Board so effectively it amazes me in the way only powerful tools that are used so effectively they become transparent can. Today, I think Iterative Canvas made it to the short list of lessons that are effective on Smart Boards.
While he ran through his lesson and I pointed out technical tips, I also discovered some small things to update. For example, now the grid updates resolution as you type, custom points are reverted to auto when you switch tabs, and changing the number of auto points and their scale are both immediately reflected.
I fixed a few typos in the text below the canvas that I found as we read through them together.
Progress is going well as I create an FUnit from the alpha Fractasketch template UI. More posts on this soon.
Istvan.
Walls of Text
Writing the documentation is turning out to be more difficult than I thought.I'm trying to make it interesting and thorough enough that people can appreciate what's going on. That amount of detail builds a formidable wall of text which easily surpasses what I would be willing to read if I stumbled upon this page.
In my meeting with Mr. Drix I will ask him how he approaches boiling this down in his class.
Istvan.
Tuesday, March 19, 2013
Wait... documentation
My Chaos Game (the old version of Iterative Canvas) has some poorly written, un-proofed documentation... which is still more than Iterative Canvas has now!
I'm going to get started now, and hopefully have at least a 'getting started' done by tomorrow.
Also, check out the new collapsing feature I added to the controls.
Istvan.
Iterative Canvas Code
this.addPoint = function(){ if(endPoints.length > 0){ //gets settings from the control panel var distChange = parseFloat(eval(document.getElementById('step').value)); //randonly choose a target point var targetPoint = nextTarget; nextTarget = Math.floor (Math.random() * endPoints.length); //find the X's position after jumping the set distance to that target point curPoint[0] = curPoint[0] + ((endPoints[targetPoint][0]-1)-curPoint[0])*distChange; curPoint[1] = curPoint[1] + ((endPoints[targetPoint][1]-1)-curPoint[1])*distChange; //draw the new black dot context.fillRect(curPoint[0], curPoint[1], 1, 1); //call other code to move the X to the new location funitfciterativecanvas.updateXdraw(); //if the program is running to infinity keep track of how far if(remainingPoints == 'inf') infRunCount++; //if the program isn't running to infinity, subtract one from the number of times this has to run if(remainingPoints != 'inf' && remainingPoints != 0) remainingPoints--; //if this has to be run more times if(remainingPoints != 0){ //if drawing normally (not quickly) then delay and run again - also a hack to solve overflow problems in recursion if((document.getElementById('quickDraw').checked === false && (!remainingPoints || remainingPoints == 'inf')) || remainingPoints == 1 || (infRunCount == 200 && document.getElementById('quickDraw').checked === true)){ setTimeout(funitfciterativecanvas.addPoint, 0); infRunCount = 0; } //continue drawing points quickly else{ funitfciterativecanvas.addPoint(); } } } }
What's Next?
I have mentioned my next project, Fractasketch, before. The attached images are a teaser of what you will be able to do. These were created by the current fractals and chaos students (I will credit them when their names are released).
Istvan.
Monday, March 18, 2013
Scary Code
<if:Empty $%username>
...
</if:Empty>
That is relatively straight forward - if the username is empty, then run what ever code is between those lines.
This segment stores the value 0 on the computer for use later:
remainingPoints = 0;There are times, however, that code really does resemble my preconceptions. The following code comes from the configuration file of my server:
#appsI wrote it to tidy up the web addresses (URLs) that my users visit.
RewriteRule ^apps/([^/.]+)(?!.)$ $1.sfw.php [L]
#app resources
RewriteRule ^apps/(.*(?=\.).*)$ $1 [L]
Now,
http://www.fractalcanvas.com/apps/iterativecanvasis the same page as
http://www.fractalcanvas.com/iterativecanvas.sfw.phpexcept a much nicer address. In fact, other applications I develop will have similar URLs now, of the form:
http://www.fractalcanvas.com/apps/some_app_name
There is a little insight into what programming really looks like- granted, each of those examples was hand-picked to prove a point. I'll be posting some code segments soon that are more representative of what my project entails.
Istvan.
Thoughts From a Project Past
The project I read was making a robotic arm that plays checkers against you. The student's journal showed several examples of the problem solving involved in his project, for example detecting stacked up pieces. The journal explained the problems in light detail, but explained the basic technical principles behind their solutions. Being familiar with these principles, and in fact having learned them from the same teacher on the same machines as he used, I particularly appreciated these posts.
The idea of having a blog be 'for your own benefit' has been advised to my class several times; but I will not be the only one who reads mine. The blog I read was littered with spelling errors, but was also hard to follow as a reader. I also would have benefited from benchmarks or some overall view of the project and occasional sign letting me know where he is.
From these conclusions I am starting two new habits in my own blog: milestone posts and posts that explain what I'm doing to a non-technical reader.
Istvan.
Sunday, March 17, 2013
Home Page
DirectoryIndex index.php index.sfw.phpI need to put some more substance on the home page soon. I will start drafting an "about this site" blurb to add to that page in the coming few days.
Istvan.
How Meta Can You Go?
I started with the goal of [some feature to implement]. I ran into some problems with the programs I'm using [list a couple of bugs, like "the sidebar is too wide in Firefox"]. I found a fix for [some problem I had before] - it works now. Next I need to [perhaps some goals].
At first glance, that seems like a thoughtful and perhaps even interesting blog post. As a tool to me, however, this post offers little help. 'The sidebar is too wide in Firefox' is the kind of bug developer hate. Its not really a bug, it's a symptom. A useful description of the bug might be "Firefox doesn't support the box-style CSS property. The style was written to use border-box, which is valid in Chrome. Using a temporary Firefox-specific style instead."
As a compromise, I might start prefacing some technical posts with a summary (following the above template roughly) and then getting into the technical details after.
Practice
Learning new things
Intuitive Sense
Maintenance
Relearning
Practice
Saturday, March 16, 2013
3D Page, Firefox Woes
Istvan.
Thursday, March 14, 2013
Mentor Meetings
My goals for the next week or so are to tidy up Iterative Canvas (especially the code and front end) and add snap to grid functionality for custom placement of points.Today I finished the second part of a two-part mentor meeting in which I showed Mr. Drix the successful completion of these goals. For a more complete summary, see the post I published this morning.
Moving forward, I will of course be tieng up loose ends for Iterative Canvas (including a style bug in which the custom points tab is nowhere to be found in Safari.) My main focus, however, is transitioning to implementing Fractasketch (under some other name.) I have been doing research about writing code in WebGL. The application of that research will come with Fractasketch as I port the alpha version I have and write the drawing engine in WebGL.
A quick, miscalculation project in the next day or two will be to add user authentication features to fractalcanvas.com so that users can save their work and create galleries online.
Istvan.
Iterative canvas updates
Last night I pushed several updates live, including features for iterative canvas,a home page, Google analytics code, and site-wide libraries.
Iterative canvas' controls now include a toggle for go to infinity/stop. The controls are all shorter so that they fit on smaller screens. A snap to grid checkbox has been added which uses a snap to grid function written in a utils FUnit.
The utils FUnit is activated by every page which inserts tracking code and makes JavaScript libraries available.
I will post later today about my mentor meetings today and Tuesday.
Istvan
Wednesday, March 13, 2013
Iterative Canvas Live
Here are some of the things it draws:
Monday, March 11, 2013
Thanks
Istvan.
Sunday, March 10, 2013
WISE Documentary
Integrated Live
I need to complete the control panel, map the site to my domain name, and then push those changes live for the world to enjoy in the coming week!
Istvan.
Thursday, March 7, 2013
Mentor Meeting Notes
Mr. Drix also pointed out that I should make a credits page or section for these apps since I took inspiration from other people's work. I also aught to contact Peter Van Roy again and mention to himthat I will be using a name other than Fractasketch (as good as the name is, the code is completely unrelated so it seems appropriate for the name to follow suit.)
My goals for the next week or so are to tidy up Iterative Canvas (especially the code and front end) and add snap to grid functionality for custom placement of points.
Iterative Canvas - the control section may look familiar. The styling is in-progress to match this sketch.
Istvan.
Wednesday, March 6, 2013
Scripting Mahem
Christening of Iterative Canvas
Tuesday, March 5, 2013
Behind the Curtain
> view you might not see the feature and trace over the peninsula, affording it no length in the coast line. If
> distance created by the features of the rocks, of the sand, even of the crystals that make up the sand.
Perl v10.what?
Sequence (?|...) not recognized in regex; marked by <-- HERE in m/((?| <-- HERE empty \( ([^)]+) \) | empty \s+ ([^\s&|)>]+) | notempty \( ([^)]+) \) | notempty \s+ ([^\s&|)>]+) | equal \( ([^,]+)\s*,\s*([^)]+) \) | notequal \( ([^,]+)\s*,\s*([^)]+) \) | \s+OR\s+ | \s+AND\s+ | \s+ at ../../sfwc/sfwc line 1480.
Can't GRANT me SUPER
Template Page
Research?
Apps
Files/Saving
When can I see this?
Sunday, March 3, 2013
SAFE on a shared host, status
Istvan.
Thursday, February 28, 2013
Mentor Meeting 2/27/13, Domain
The three main milestone programs for me will be versions of:
- Chaosgame
- Fractasketch
- Complex Paint
Tuesday, February 26, 2013
Database Solved, Perl Problems, Domain Resolution
EDIT: misspelling of Perl
Sunday, February 24, 2013
WISE Blogs
Joon, who is amazingly musically talented, has already composed a piece for a video a friend and I made! His journal is part of his personal blog, which I follow. Joon makes frequent and content-filled updates frequently, almost daily. Given the nature of his blog/project, there are often great videos to watch or inspirational pieces linked in his posts making it far more engaging. His varied post style (combinations of lists, paragraphs, quick comments on a video, formal writing, semi formal, personal writing, etc.) also help making his posts engaging to read.
Edan is IHS's magician. He inspired me at the start of this year to pick up a deck and learn a few tricks of my own. I can't wait to follow his progress through the next 14 weeks, hopefully have him practice the tricks on me, and maybe even pick up some of the tricks he learns too. We have even talked about doing a two-person trick as part of his final project!
Progress on the theme is progressing - I have started throwing in dummy-apps to get a sense of how some of the major applications will look/behave on different screens. In the next few days I need to start porting the theme into SAFE and preparing the script libraries!
Istvan.
296 Lines
My next step is to start bringing this into my SAFE environment running locally. Unfortunately, on my shared host where the database server is separate from the web server, the preliminary SAFE config files need heavy tweaking (by default some tables require SUPER privileges in mySQL.) I am talking to the other developers about fixing that.
Istvan.
Saturday, February 23, 2013
Color Scheme
I dug up the color scheme I used to design the current set of fractals and chaos applications!
Click here to check it out
Istvan.
Design Inspiration
Wednesday, February 20, 2013
Grammar
Friday, February 15, 2013
SAFE, WebGL
In addition to publishing individual applications via the framework, I need to create and host libraries on which the applications are build. For example, many of the applications will run on WebGL (a language with which I am familiarizing myself as part of this project). I have spent the last several days reading through these tutorials to learn about WebGL and how to build it into my framework.
Progress is off to a great start,
Istvan.
Wednesday, February 6, 2013
Gantt
My favorite formulas:
Hello World!
Welcome to my WISE project blog. For the next sixteen weeks, I will be developing web-based software to explore fractals and chaos. It is my goal to recreate the antiquated software used by the Ithaca High School fractals and chaos course in a modern environment accessible to students around the world.
My interest is in the mathematical, artistic, and programming aspects of this project. I am going to use a brand new web framework, SAFE, along with new, advanced technologies, including WebGL, that will allow for very fast computation and interactive environments to explore fractals and chaos.
Through the course of this project, I hope to learn not only computer-science-oriented project management skills (including bug tracking and time budgeting) as well as advanced technical skills as I mentioned previously.
I hope you enjoy my blog and my software!
~Istvan.