Friday, September 30, 2011
Pithos -- Gnome Padora Client
One reason that I hadn't used Pandora in a while was that I most want to listen to music when working at the computer, however when I work at the computer I use the processor, hard! Unfortunately Pandora's webclient (flash based) sucks up processor power. Thankfully Kevin Mehall created a native Gnome client called Pithos! I'm just trying it right now but it seems to do the trick!
Tuesday, September 13, 2011
The Joy of For-Loops in Making Figures
I love TikZ, the "vector" graphics package for LaTeX. One of the biggest reasons is that I can programmatically create the drawing. For example the nested foreach loops in this code saved me lots of work:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{tikz} | |
\usepackage{pgffor} | |
\begin{document} | |
\begin{tikzpicture} | |
\draw [fill=gray!30] | |
(0,0) | |
coordinate (front top left) | |
-- ++(5,0) | |
coordinate (source) [pos=0.5] | |
coordinate (front top right) | |
-- ++(0,-0.5) | |
coordinate (front bottom right) | |
-- ++(-5,0) | |
-- cycle | |
; | |
\draw [fill=gray!30] | |
(front top left) | |
-- ++(60:2) | |
-- ++(5,0) | |
coordinate (back top right) | |
-- (front top right) | |
-- cycle | |
; | |
\draw [fill=gray!50] | |
(back top right) | |
-- ++(0,-0.5) | |
-- (front bottom right) | |
-- (front top right) | |
-- cycle | |
; | |
%front left corner (0.5, 0.35) | |
\foreach \y/\d in {0/0,0.5/0.25,1/0.5} { | |
\foreach \x in {0,1,2,3,4} { | |
\draw [fill=red!70] | |
(1+\x-\d,1.35-\y) | |
arc [start angle=180, delta angle=180, x radius=0.25, y radius=0.15] | |
-- ++(0,2) | |
-- ++(-0.5,0) | |
coordinate [pos=0.5] (top) | |
-- cycle | |
; | |
\draw [fill=red!60] | |
(top) ellipse [x radius=0.25, y radius=0.15] | |
; | |
} | |
} | |
\end{tikzpicture} | |
\end{document} |
Subscribe to:
Posts (Atom)