Skip to content

Instantly share code, notes, and snippets.

public class ArcToBezier {
/**
* Usage:
*
* javac ArcToBezier.java
* java ArcToBezier x0 y0 x1 x2 rx ry theta large-arc-flag sweep-flag
*
* where (x0, y0) are the starting points of the arc, and the rest of the
* arguments correspond to the values in the elliptical arc curve command:
@alecgorge
alecgorge / java-properties.php
Created May 18, 2011 00:29
Parse Java properties files in PHP
<?php
function parse_properties($txtProperties) {
$result = array();
$lines = split("\n", $txtProperties);
$key = "";
$isWaitingOtherLine = false;
foreach ($lines as $i => $line) {
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0))
continue;