Skip to content

Instantly share code, notes, and snippets.

# coding: utf8
print [x for x in range(1900, 2201) if x%4 == 0 and x%100 != 0 or x%400 == 0]
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: ut-addventure_development
PImage markers = loadImage("AllBchThinMarkers.png");
int w = 12, h = 12;
int w_m = 8, h_m = 8;
int r_num = 64;
int c_num = 64;
int id = 0;
for (int ky = 0; ky < c_num * h; ky += h) {
for (int kx = 0; kx < r_num * w; kx += w) {
PImage marker = createImage(w_m, h_m, RGB);
for (int y = ky + h - h_m, _y = 0; y < ky + h; y++, _y++) {
@takuma7
takuma7 / ps-grid-generator.jsx
Created November 6, 2012 06:43 — forked from jameswburke/ps-grid-generator.jsx
Photoshop Script - Generate Grid Guides
//Modified version of sprite-grid.jsx by Filip Van Tendeloo
//Fixed for earlier versions of Photoshop based on guideLine function from
//http://www.ps-scripts.com/bb/viewtopic.php?f=9&t=3493&start=0
//None of this code is mine
// check for document
if(app.documents.length > 0){
// get active document
var psDoc = app.activeDocument;
@takuma7
takuma7 / pagination.ctp
Created August 28, 2012 02:53 — forked from slywalker/pagination.ctp
pagination element for CakePHP on twitter bootstrap
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('«',
array(
'tag' => 'li',
'class' => 'prev',
),
$this->Paginator->link('«', array()),
array(
import java.util.Random;
import java.io.*;
class Mondai19_3{
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
boolean undone=true;
Random rand=new Random();
while(undone){
int my=0;
class Mondai19_2{
public static void main(String[] args){
double b=Double.parseDouble(args[0]);
double c=Double.parseDouble(args[1]);
double _A=Double.parseDouble(args[2]);
double a=Math.sqrt(c*c + b*b - c*b*Math.cos(_A));
double area=b*a/2;
System.out.println("b:" + b + "\nc:" + c + "\nA:" + _A + "\narea : " + area);
}
}
class Mondai19_1{
public static void main(String[] args){
System.out.println(args[0].toUpperCase() + ", and its length is " + args[0].length() + ".");
}
}
import java.io.*;
class Mondai18_2{
public static void main(String[] args){
try{
BufferedReader r = new BufferedReader(new FileReader("siken.txt"));
PrintWriter w = new PrintWriter(new BufferedWriter(new FileWriter(args[0])));
String[] t=r.readLine().split(" ");
int[] a = new int[t.length];
for(int i=0; i<a.length; i++){