import processing.pdf.*;

Table atolls;
PGraphicsPDF pdf;
PFont helvetica;

void draw() {
  textFont(helvetica);
  textSize(2);
  textAlign(CENTER);
  float scale = 300;
  String[] years = {"1911", "1921","1953","1960",  "1965","1977","1985","1990","1995","2000","2006","2014"};
  for (TableRow atollrow : atolls.rows()) {
    String atoll_short = atollrow.getString("Atoll_short");
    float lat = atollrow.getFloat("Lat");
    float lon = atollrow.getFloat("Long");    
    pushMatrix();
    ____                                  __      __                  
   / __/  ___    ____    _____  ____ _   / /__   / /__  ____ _  ____ _
  / /_   / _ \  / __ \  / ___/ / __ `/  / //_/  / //_/ / __ `/ / __ `/
 / __/  /  __/ / / / / / /    / /_/ /  / ,<    / ,<   / /_/ / / /_/ / 
/_/     \___/ /_/ /_/ /_/     \__,_/  /_/|_|  /_/|_|  \__,_/  \__,_/  
                                                                      
function r(id, label, mdp, ppm, jp, gi, invalid, nonvoters, max) {
  var total = mdp+ppm+jp+gi+invalid+nonvoters+max;
  var canvas = document.createElement('canvas');
  var chartwidth = 2100;
  var chartheight = 50;
  var top = 2;
  if (max < 10000 && max != 0) {
    canvas.width = 2100; 
  } else {
    chartwidth = 800;
    canvas.width = chartwidth ;   
  }
                                                __                    _         
   _____  ___    ____ ___   ___    ____ ___    / /_   ___    _____   (_)   ____ 
  / ___/ / _ \  / __ `__ \ / _ \  / __ `__ \  / __ \ / _ \  / ___/  / /   / __ \
 / /    /  __/ / / / / / //  __/ / / / / / / / /_/ //  __/ / /     / /   / / / /
/_/     \___/ /_/ /_/ /_/ \___/ /_/ /_/ /_/ /_.___/ \___/ /_/     /_/   /_/ /_/ 
                                                                                
                           _           __     _                     
   ____ _        _   __   (_)  _____  / /_   (_)   ____ ___    _____
  / __ `/       | | / /  / /  / ___/ / __/  / /   / __ `__ \  / ___/
 / /_/ /        | |/ /  / /  / /__  / /_   / /   / / / / / / (__  ) 
 \__, /         |___/  /_/   \___/  \__/  /_/   /_/ /_/ /_/ /____/  
/____/                                                              
                                                      __                      
   ____ ___  _   __   ____ ___   __  __   _____  ____/ /  ___    _____   _____
  / __ `__ \| | / /  / __ `__ \ / / / /  / ___/ / __  /  / _ \  / ___/  / ___/
 / / / / / /| |/ /  / / / / / // /_/ /  / /    / /_/ /  /  __/ / /     (__  ) 
/_/ /_/ /_/ |___/  /_/ /_/ /_/ \__,_/  /_/     \__,_/   \___/ /_/     /____/  
                                                                              
    __         __                                
   / /  ___   / /_   _____          ____ _  ____ 
  / /  / _ \ / __/  / ___/         / __ `/ / __ \
 / /  /  __// /_   (__  )         / /_/ / / /_/ /
/_/   \___/ \__/  /____/          \__, /  \____/ 
                                 /____/          
                        __       __    _                      
   ____ ___   ____ _   / /  ____/ /   (_) _   __  ___    _____
  / __ `__ \ / __ `/  / /  / __  /   / / | | / / / _ \  / ___/
 / / / / / // /_/ /  / /  / /_/ /   / /  | |/ / /  __/ (__  ) 
/_/ /_/ /_/ \__,_/  /_/   \__,_/   /_/   |___/  \___/ /____/  
                                                              
                                                        
   ____ ___    _____  _____        _   __  _____  ____ _
  / __ `__ \  / ___/ / ___/       | | / / / ___/ / __ `/
 / / / / / / / /    / /__         | |/ / / /__  / /_/ / 
/_/ /_/ /_/ /_/     \___/         |___/  \___/  \__,_/  
                                                        
                     _        __          __    _                       
   ____ _  __  __   (_)  ____/ /  ___    / /   (_)   ____   ___    _____
  / __ `/ / / / /  / /  / __  /  / _ \  / /   / /   / __ \ / _ \  / ___/
 / /_/ / / /_/ /  / /  / /_/ /  /  __/ / /   / /   / / / //  __/ (__  ) 
 \__, /  \__,_/  /_/   \__,_/   \___/ /_/   /_/   /_/ /_/ \___/ /____/  
/____/                                                                  
for (var i=1; i<nakaiy.length; i++){
  nakaiydb.insert({ id:i, 
    nakaiy:nakaiy[i][0], 
    dates:nakaiy[i][1], 
    season:nakaiy[i][2], 
    number:nakaiy[i][3], 
    description:nakaiy[i][4], 
    meaning:nakaiy[i][5], 
    weather:nakaiy[i][6], 
    averages:nakaiy[i][7], 
    fishing:nakaiy[i][8], 
    agriculture:nakaiy[i][9], 
    asterism:nakaiy[i][10]
  }); 
}
                 _        __               
  ____ _ ____   (_)  ____/ /  ____    ____ 
 / __ `//_  /  / /  / __  /  / __ \  / __ \
/ /_/ /  / /_ / /  / /_/ /  / /_/ / / / / /
\__,_/  /___//_/   \__,_/   \____/ /_/ /_/ 
                                           
    __                                 __
   / /_    _____  ____ _   ____   ____/ /
  / __ \  / ___/ / __ `/  / __ \ / __  / 
 / /_/ / / /    / /_/ /  / / / // /_/ /  
/_.___/ /_/     \__,_/  /_/ /_/ \__,_/   
                                         
       __    __      __
  ____/ /   / /_    / /
 / __  /   / __ \  / / 
/ /_/ /   / / / / / /  
\__,_/   /_/ /_/ /_/   
                       
               __                        __     _             _         
  ____ _  ____/ / _   __  ___    _____  / /_   (_)   _____   (_)   ____ 
 / __ `/ / __  / | | / / / _ \  / ___/ / __/  / /   / ___/  / /   / __ \
/ /_/ / / /_/ /  | |/ / /  __/ / /    / /_   / /   (__  )  / /   / / / /
\__,_/  \__,_/   |___/  \___/ /_/     \__/  /_/   /____/  /_/   /_/ /_/ 
                                                                        
                                         __                                     
   ____ ___    _____  _____         ____/ /  ___    ____    ____ _  __  __  ___ 
  / __ `__ \  / ___/ / ___/        / __  /  / _ \  / __ \  / __ `/ / / / / / _ \
 / / / / / / / /    / /__         / /_/ /  /  __/ / / / / / /_/ / / /_/ / /  __/
/_/ /_/ /_/ /_/     \___/         \__,_/   \___/ /_/ /_/  \__, /  \__,_/  \___/ 
                                                         /____/                 
                                                                      
  ____ _ _      __  ____ _   _____  ___    ____   ___    _____   _____
 / __ `/| | /| / / / __ `/  / ___/ / _ \  / __ \ / _ \  / ___/  / ___/
/ /_/ / | |/ |/ / / /_/ /  / /    /  __/ / / / //  __/ (__  )  (__  ) 
\__,_/  |__/|__/  \__,_/  /_/     \___/ /_/ /_/ \___/ /____/  /____/  
                                                                      
import processing.video.*;
MovieMaker mm;
....
float x = -7000 + float(pieces[6])*100;
float y = 715 + float(pieces[7])*-100;
scale(50);
String[] shapes = split(pieces[0], ',');

beginShape();
  for (int nodes = 0; nodes < shapes.length; nodes = nodes+1) {
    String[] xy = split(shapes[nodes]," ");  
    float x1 = -7000 + float(xy[0])*100 - x+6.4;
    float y1 = 715 + float(xy[1])*-100 - y+4.0;
    vertex(x1, y1);
  }
endShape(CLOSE);
function population_density() {
  $content = '';
  $fp2 = fopen('source.csv', 'r');    
  while (!feof($fp2)) {
    $line = fgetcsv($fp2, 4096);
    if ($line[0] == "138") { continue; }; // remove male' 
    if (is_numeric($line[4]) AND  is_numeric($line[5]) AND  !empty($line[6]) AND  !empty($line[17]) ) {
       $content .= '';
       $content .= '';
    }
  }
  fclose($fp2);
  $content .= '';
  return $content;
}
foreach ($xml->children() as $atolls) {
  $island_count = 0;
  foreach ($atolls->children() as $atoll){
    $content .= '';
    foreach ($atoll->children() as $island){
      $content .= 'x  . '" y="' . $island->y . '" 
              width="' . $island->size . '" height="'. $height .'" 
              fill="black"  />  ';  
    }
    $content .= '';
  }
}
                    _                  ____
  __  __   ____    (_)  _____  ___    / __/
 / / / /  / __ \  / /  / ___/ / _ \  / /_  
/ /_/ /  / / / / / /  / /__  /  __/ / __/  
\__,_/  /_/ /_/ /_/   \___/  \___/ /_/     
                                           
                   __             _    __     _                
   ____   __  __  / /_   _____   (_)  / /_   (_)  ____    ____ 
  / __ \ / / / / / __/  / ___/  / /  / __/  / /  / __ \  / __ \
 / / / // /_/ / / /_   / /     / /  / /_   / /  / /_/ / / / / /
/_/ /_/ \__,_/  \__/  /_/     /_/   \__/  /_/   \____/ /_/ /_/ 
                                                               
#!/usr/bin/python
#
import datetime
for row in cursor.fetchall():
  if row['country_code'] + ".png" in srcfiles:
    x = datetime.datetime.now().date() - row['h_gov_since']
    if x.days > 365*2:
      years = " ("+ str(math.floor(x.days/365))[:-2] + " years)"
    elif x.days < 365:
      years = " ("+ str(x.days) + " days)"
      
    else:
      years = " ("+ str(math.floor(x.days/365))[:-2] + " year)" 
    img = row['country_code'] + ".png"
    imgs.append(img)
    li[img] = row['country_name'].capitalize() + years
    height.append(Image.open(pathx + img).size[1]+35)
    width.append(Image.open(pathx + img).size[0]+20)
#!/usr/bin/python
#
from sys import argv
import Image, ImageDraw 
im = Image.open(argv[1]) 
im = im.convert('RGB') 
colors = {}; total = 0
for y in range(im.size[1]):
  for x in range(im.size[0]):
    color = im.getpixel((x,y))
    if color in colors.keys():
      colors[color] += 1
    else:
      colors[color] = 1
    total += 1 
#!/usr/bin/python
from common import *
import random


while 1:
  num = 000
  files = ls (images, 'jpg')
  last = len(files)
  half = str(round (last/2))
  half = int(half[:half.find('.')])-3
  using = files[last-10:last]
  using.sort()
  using.reverse()
  using += files[half:half+10]
                       __      __                                            __  
   ____ ___  _   __   / /_    / /  ____    ____ _  ____    _____    ____    / /_ 
  / __ `__ \| | / /  / __ \  / /  / __ \  / __ `/ / __ \  / ___/   / __ \  / __ \
 / / / / / /| |/ /  / /_/ / / /  / /_/ / / /_/ / / /_/ / (__  )   / /_/ / / / / /
/_/ /_/ /_/ |___/  /_.___/ /_/   \____/  \__, /  \____/ /____/   / .___/ /_/ /_/ 
                                        /____/                  /_/              
                    
  ___    _____  ___ 
 / _ \  / ___/ / _ \
/  __/ / /    /  __/
\___/ /_/     \___/ 
                    
       __                              _                  
  ____/ /   _____  ____ _ _      __   (_)   ____    ____ _
 / __  /   / ___/ / __ `/| | /| / /  / /   / __ \  / __ `/
/ /_/ /   / /    / /_/ / | |/ |/ /  / /   / / / / / /_/ / 
\__,_/   /_/     \__,_/  |__/|__/  /_/   /_/ /_/  \__, /  
                                                 /____/   
              _    __     __             __    _              __     __ 
 _      __   (_)  / /_   / /_           / /   (_)   ____ _   / /_   / /_
| | /| / /  / /  / __/  / __ \         / /   / /   / __ `/  / __ \ / __/
| |/ |/ /  / /  / /_   / / / /        / /   / /   / /_/ /  / / / // /_  
|__/|__/  /_/   \__/  /_/ /_/        /_/   /_/    \__, /  /_/ /_/ \__/  
                                                 /____/                 
                                         __ 
  __  __   ____          _____  ____ _  / /_
 / / / /  / __ \        / ___/ / __ `/ / __/
/ /_/ /  / / / /       / /__  / /_/ / / /_  
\__,_/  /_/ /_/        \___/  \__,_/  \__/  
                                            
    __                    __      __         __ 
   / /_   ____   ____    / /__   / /  ___   / /_
  / __ \ / __ \ / __ \  / //_/  / /  / _ \ / __/
 / /_/ // /_/ // /_/ / / ,<    / /  /  __// /_  
/_.___/ \____/ \____/ /_/|_|  /_/   \___/ \__/  
                                                
    __      __    _                __                                      
   / /_    / /   (_)   ____   ____/ /   _____  _____  ____ _    ____   ___ 
  / __ \  / /   / /   / __ \ / __  /   / ___/ / ___/ / __ `/   / __ \ / _ \
 / /_/ / / /   / /   / / / // /_/ /   (__  ) / /__  / /_/ /   / /_/ //  __/
/_.___/ /_/   /_/   /_/ /_/ \__,_/   /____/  \___/  \__,_/   / .___/ \___/ 
                                                            /_/            
        
   _____
  / ___/
 (__  ) 
/____/  
        
                        __      
   ____ ___   ____ _   / /  ___ 
  / __ `__ \ / __ `/  / /  / _ \
 / / / / / // /_/ /  / /  /  __/
/_/ /_/ /_/ \__,_/  /_/   \___/ 
                                
                          _             __
  ____ _  ___    _____   (_)  ____ _   / /
 / __ `/ / _ \  / ___/  / /  / __ `/  / / 
/ /_/ / /  __/ / /     / /  / /_/ /  / /  
\__,_/  \___/ /_/     /_/   \__,_/  /_/