Skip to content

Instantly share code, notes, and snippets.

View CodeIQ's full-sized avatar

CodeIQ CodeIQ

View GitHub Profile
@CodeIQ
CodeIQ / gist:3663955
Created September 7, 2012 06:52
120910_1
//[ index.html ]
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>scriptからscriptを読み込む</title>
</head>
<body>
<script>
document.write('<script src="javascript.js"></script>');
@CodeIQ
CodeIQ / gist:3856987
Created October 9, 2012 06:32
121022_1
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
@interface MemoryLeakTestTableViewController ()
{
NSMutableArray *dataForCellArray1;
}
@property (retain, nonatomic) NSMutableArray *dataForCellArray2;
@property (retain, nonatomic) NSMutableArray *dataForCellArray3;
@CodeIQ
CodeIQ / clock.py
Created October 10, 2012 02:17 — forked from vkgtaro/clock.py
CodeIQ 用問題
# -*- coding: utf-8 -*-
import sys
import time
import datetime
class Observable():
pass
class Tick(Observable):
@CodeIQ
CodeIQ / gist:3863315
Created October 10, 2012 05:24
Find Memory Leaks
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
@interface MemoryLeakTestTableViewController : UITableViewController
{
NSMutableArray *dataForCellArray1;
}
@property (retain, nonatomic) NSMutableArray *dataForCellArray2;
@property (retain, nonatomic) NSMutableArray *dataForCellArray3;
@CodeIQ
CodeIQ / gist:3871386
Created October 11, 2012 10:04
20121022_1
<?php
/**
* セプテーニ営業実績登録スクリプト
*/
// 今月の営業マン別売上情報
$SALES_DATA = array(
array('salesperson_id'=>1, 'salesperson_name'=>"佐藤", 'sales_volume'=>20000000),
array('salesperson_id'=>2, 'salesperson_name'=>"武藤", 'sales_volume'=>8900000),
array('salesperson_id'=>3, 'salesperson_name'=>"瀬戸口", 'sales_volume'=>50000000),
@CodeIQ
CodeIQ / gist:3871397
Created October 11, 2012 10:06
20121022_2
mysql> desc SALES;
+----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+-------+
| SALES_DATE | date | YES | MUL | NULL | |
| SALES_VOLUME | int(11) | YES | | 0 | |
| SALESPERSON_ID | int(11) | NO | PRI | NULL | |
+----------------+---------+------+-----+---------+-------+
mysql> desc SALESPERSON;
@CodeIQ
CodeIQ / gist:3903758
Created October 17, 2012 04:48
20121025_1
CREATE TABLE IF NOT EXISTS t_order (order_id int(5) NOT NULL AUTO_INCREMENT, product_id int(5) NOT NULL, order_date date NOT NULL, PRIMARY KEY (order_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21;
INSERT INTO t_order (order_id, product_id, order_date) VALUES
(1, 1, '2012-09-01'),(2, 1, '2012-09-01'),(3, 2, '2012-09-01'),(4, 3, '2012-09-03'),(5, 3, '2012-09-03'),
(6, 2, '2012-09-03'),(7, 1, '2012-09-11'),(8, 2, '2012-09-11'),(9, 1, '2012-09-14'),(10, 3, '2012-09-15'),
(11, 1, '2012-09-16'),(12, 2, '2012-09-16'),(13, 2, '2012-09-16'),(14, 3, '2012-09-16'),(15, 3, '2012-09-16'),
(16, 3, '2012-09-16'),(17, 1, '2012-09-20'),(18, 2, '2012-09-20'),(19, 3, '2012-09-30'),(20, 2, '2012-10-01');
CREATE TABLE IF NOT EXISTS t_product ( product_id int(5) NOT NULL AUTO_INCREMENT, product_name varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (product_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
INSERT INTO t_product (product_id, product_name) VALUES (1, 'プランA'), (2, 'プ
print [ "Hello", "World!", "Ruby" ].map{|e| e.length }.max
System.out.print(new SmartArray(new String[] { "Hello", "World!", "Java" })
.map(new SmartArray.Op<String, Integer>() {
public Integer op(String s) {
return s.length();
}
})
.max());
@CodeIQ
CodeIQ / gist:4117416
Created November 20, 2012 11:34
20121122_1
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
#import "ASIHTTPRequest.h"
@interface MemoryLeakTest2ViewController : UITableViewController
{
NSMutableArray *_dataForCellArray0;
}