Interesting. I’ve build few Mathematics Applets 10 years ago. Yet, I can still discover their links on internet. I’ve just found my Spirals Applet being featured at comPADRE – a Physics and Astronomy community site.
Applet is http://www.roussev.org/applets/spiral/spiral.html.
And the Spirals Algorithm is as simple as:
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class HelloSpirals extends Applet {
int max = 100;
int centerPosition = 150;
double angle = 22 / (double) 128;
public void paint( Graphics g){
setBackground(Color.black);
g.setColor(Color.red);
for (int i = 0; i < max; i++) {
int[] coordEnd = getCoordinates(i);
int[] coordStart = getCoordinates(i - 1);
g.drawLine(centerPosition + coordStart[0],
centerPosition + coordStart[1],
centerPosition + coordEnd[0],
centerPosition + coordEnd[1]);
}
}
private double getAngle( int inx){
return (inx - 1) * angle;
}
private int[] getCoordinates( int inx){
double angle = getAngle(inx - 1);
int x = (int) Math.round(inx * Math.cos(angle));
int y = (int) Math.round(inx * Math.sin(angle));
return new int[] { x, y };
}
}
Just opened my first Git account.
http://github.com/atanasroussev
An interesting project. Looks sexy, feels unix.
Go Canada!
Go Bulgaria!
Remember your first cup of Object Oriented Java? Shape, Triangle, Circle polymorphism?
Here it’s the kewl Ruby equivalent:
class Shape
def info
// prints abstract method name and area. Confusing eh?
puts "#{name} area: #{area}"
end
end
class Triangle < Shape
attr_reader :base, :height
def initialize(base, height)
super()
@base = base
@height = height
end
def area
return ((base * height).to_f./ 2)
end
def name
return "Triangle"
end
end
class Square < Shape
attr_reader :height
def initialize(height)
super()
@height = height
end
def area
return (height * height).to_f
end
def name
return "Square"
end
end
class Circle < Shape
attr_reader :r
PI = 22.to_f./7
def initialize(r)
super()
@r = r
end
def area
return (PI * r * r)
end
def name
return "Circle"
end
end
if __FILE__ == $0
g = Triangle.new(7, 7)
g.info
g = Square.new(7)
g.info
g = Circle.new(7)
g.info
end
Result is:
Triangle area: 24.5
Square area: 49.0
Circle area: 154.0
Google never cease to surprise me. They’ve recorded the ski slopes at Whistler. http://bit.ly/9W7Xra
Go Canada!
Go Bulgaria!
{
"response": "Unable to locate element: {"method":"id","selector":"q"}",
"context": "{711c552c-4fac-473c-83ce-dc767ff37ff2} ",
"commandName": "findElement",
"isError": true
}
public class FirefoxDriver implements WebDriver ... {
protected Object executeCommand(Class<RuntimeException> throwOnFailure,
Command command) {
Response response = extension.sendMessageAndWaitForResponse(
throwOnFailure, command);
context = response.getContext();
response.ifNecessaryThrow(throwOnFailure);
......
I am constantly experiencing this bug since I got my Vaio for more than 3 years already. Whenever I quickly move images, copy/paste fast enough over the folders (and I am very quick typer), Windows Explorer crashes and ask me to report to Windows. Well, this problem is a know issue for years. 1.3 million people are screaming for help. Odd enough seems Windows 7 is plaged by the same problem?! Anyone at Microsoft paying attention? And what is the purpose of reporting this problem when when it never gets fixed.
Anyhow, being frustrated with the Windows experience I looked for my favorite Ubuntu file manager called Dolphin. After installing KDE I am happy camper with:
- NON crashing Dolphin
- More logical folder structure.
- Bookmarking
Thank you Windows. Next time try better. Meanwhile I am switching to Mac OS.






