CookieCutter-Editor v2.0
I made a new version of my cookiecutter-editor.
Designs can be saved now and the node-count can be adjusted to your needs. I also exported a linux, a Macos X and a Windows version of the processing sketch.
Projektpage and Download Links
Go to the Projekt page and download the editor - because NOW is the right time of the year to desing your CookieCutters!
Table column highlighting with jquery
in one of my recent projects i needed to highlight a table row and column of a html table on mouseover.
i found out that it's quite simple to do in jquery - even without a plugin.
first you have to find out in which column your mouse pointer currently is.
var idx = $(this).parent().children('td,th').index( $(this))+1;
and then you mark all the td's and th's in the table with the same column index
$('td:nth-child('+idx+')').addClass( 'hover' );
$('th:nth-child('+idx+')').addClass( 'hover' );
click here to download a simple example project.
Eye drawn using straight lines
I made another simple processing sketch that draws an eye using two parabolic curves and a circle using straight lines
click here to see the code and run the applet
How to follow a bezier-path in Processing
Processing has various commands to draw curves like curve, bezier, bezierVertex and so on, but it also has commands that allow you to follow these paths. I wrote a simple sketch that shows how to animate a small ellipse that follows a bezier-path using bezierPoint
click here to see it in action or download the code
Pulsating Heart made from Bezier-Curves in processing
I made a short processing sketch that shows how to use the bezierVertex command. It can be used to draw a curve between a start- and an endpoint, using two control points (similar to the curve elements vector graphic programms use).
The following code block draws a heart in processing.
beginShape();
vertex(150,150);
bezierVertex( 150,120, 100,120, 100, 150);
bezierVertex( 100,180, 150,185, 150, 210 );
bezierVertex( 150,185, 200,180, 200, 150 );
bezierVertex( 200,120, 150,120, 150, 150 );
endShape();
click here to see the heart pulsing and the background rotating or download the code.
floating particles in processing
This is a small processing sketch that simulates a macro shot of some small, glowing particles floating in water. I used 4 layers of particles and called blur between them to generate the macro focus effect.
click here to see them in action
'Hello World' ABC
This is a small collection of "Hello World!"-Programs - One for each letter of the alphabet. Ada for A, Boo for B, C++ for C, and so on. Special thanks to the stackoverflowers who helped me with Q, U and Y :-)
Ada
with Text_IO; use Text_IO;
procedure Hello is
begin
Put_Line("Hello World!");
end Hello;
Boo
print("Hello World!")
C++
#include <iostream>
int main( int argc, char** argv ) {
std::cout << "Hello World!" << std::endl;
return 0;
}
D
import std.stdio;
void main(string[] args) {
writefln("Hello World!");
}
read more ...Retro-3D-Neon-LineGrid in processing
I made some aimated neon 3d linegrid in processing, very retro-style.
It uses no openGL - only lines, just as i would have coded it in Basic on my Atari :-)
click here to see it!
File Upload in Servlet 3.0
I played around a bit with the new servlet-api 3.0 and tomcat7 and i really like it. it has some nice features like servlet declaration using annotations or the support for asynchornous requesthandling, but the feature that i really really love is the support for file upload.
To handle a file upload form like this
<html>
<body>
<form action="upload" enctype="multipart/form-data" method="post">
<input type="file" name="filename"/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
is to mark the servlet with an annotation and access the uploaded file using 'request.getPart("filename")' like this
package at.hpc.servlettest;
import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;
@WebServlet(name="testUpload", urlPatterns={"/upload"})
@MultipartConfig
public class TestUpload extends HttpServlet {
protected void doPost( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException {
Part part = req.getPart("filename");
res.setContentType( part.getContentType());
res.setHeader( "disposition", "inline" );
OutputStream out = res.getOutputStream();
InputStream in = part.getInputStream();
byte buffer[] = new byte[ 4048 ];
int n = 0;
while ((n = in.read( buffer )) > 0) {
out.write( buffer, 0, n );
}
out.close();
}
}
This is a really silly example that just copies the uploaded file back to the browser, but it shows how clean and simple handling fileuploads gets with this api - this is the feature i have been waiting for years!
read more ...Outdoor Monster
These are some monsters that have been found out on the street (tnx to sidney and paul for the ticket monster :-))
read more ...