Using SVN with Git
Once I learned Git I never wanted to go back to the days of svn. The only problem is that SVN is used almost in every linux shop I worked for. Luckily there is git-svn. With git-svn I can just import an svn repositories and use git to browse, branch, merge etc.
My typical workflow:
1) Import the repository into git.
mkdir reponame && cd reponame git svn init -s https://svn.hostname.com/svn/reponame/ git svn fetch --fetch-all #If this step fails because the repo is huge, just run it again
2) Get a branch to hack on
git br -a git co --track -b branchname remotes/branchname git br -vv #I like -vv to see which branches are tracked and which are just local branches
3) Keep up with svn commits:
git svn fetch git svn rebase
This fetches revisions from the SVN parent of the current HEAD and rebases the current (uncommitted to SVN) work against it.
This works similarly to svn update or git pull except that it preserves linear history with git rebase instead of git merge for ease of dcommitting with git svn.
This accepts all options that git svn fetch and git rebase accept. However, --fetch-all only fetches from the current [svn-remote], and not all [svn-remote] definitions.
Like git rebase; this requires that the working tree be clean and have no uncommitted changes.
4) Commit changes back to svn
git svn dcommit
sin(n) = -1 where n is an integer in radians
I saw a fun math problem on reddit the other day.
find a number n, so that sin(n)=-1, where n is an integer in radians; so sin(270 degrees) doesn't count. Obviously it will never be exactly -1 but close enough for the difference to be lost in rounding.

I need the argument of sin function to be as close to an integer as possible. Call this integer m.

Solving for
leads to:

If I have a rational approximation to
with an even numerator I can divide it by two get my m. I also have to make sure that the denominator is in the form of 4n+3.
It's possible to use continued fractions to approximate real numbers. Here's a continued fraction sequence for pi: http://www.research.att.com/~njas/sequences/A001203
The first rational approximation I learned in elementary school is 22/7 which is perfect.
> (sin 11)
-.9999902065507035
For the others I'll have to evaluate the continued fraction to get my approximation of a simple fraction.
> (eval-terms (list 3 7 15 1 292 1))
104348/33215
> (sin (/ 104348 2))
-.9999999999848337
> (eval-terms (list 3 7 15 1 292 1 1 1 2 1 3 1 14 2 1))
245850922/78256779
> (sin (/ 245850922 2))
-.99999999999999999532
Looks like a good candidate was found.
This is the code to evaluate a continued fraction coefficients. It's very convenient that scheme has a native rational data type.
(define (eval-terms ts) (cond ((= (length ts) 1) (car ts)) (else (+ (car ts) (/ 1 (eval-terms (cdr ts))))))) (define (eval-terms-iter ts) (let ((rev-ts (reverse ts))) (define (ev-terms ts frac) (if (null? ts) frac (ev-terms (cdr ts) (+ (car ts) (/ 1 frac))))) (ev-terms rev-ts (car rev-ts))))