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
/* | |
* Simple Queue implementation. | |
* usage: | |
* var q = new Queue(checkEquality) | |
* Here checkEquality is a funciton that used to compare elements in the queue. | |
* If not specified, "==" is used. | |
* | |
* Implemented method is as follows: | |
* void enqueue(element) | |
* element dequeue() |
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
' This script shows all files and directories on current directory. | |
' Each line of output is corresponding to each file or directory | |
' and contains last modify time, whether direcotry or file, datasize(byte), and its name. | |
' Dir command on windows do not diplay size of a directory, so I implement it. | |
Option Explicit | |
main() |
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
package jp.gr.java_conf.daisy.quiz; | |
import java.util.Arrays; | |
import java.util.HashSet; | |
/** | |
* Utility class used for removing duplicate element from integer array. | |
* | |
* @author Kazuki Nishiura | |
*/ |
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
package jp.gr.java_conf.daisy; | |
import java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class Sieve { | |
List<Integer> mayPrimes; | |
List<Integer> primes; | |
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
class Array | |
def initializeFlags | |
@isPrimeArray = Array.new(self.size, true) | |
end | |
def isPrime(index) | |
@isPrimeArray[index] | |
end | |
def nonPrime(number) | |
index = number / 2 - 1 | |
@isPrimeArray[index] = false |
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
(function ($, namespace) { | |
var PopoverManager = function (element, option) { | |
this.init(element, option); | |
} | |
PopoverManager.prototype = { | |
constructor: PopoverManager | |
, init: function (element, option) { | |
this.$element = $(element); |
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
// usage: | |
// 1. goto http://www.koders.com | |
// 2. open console (if you using Google Chrome, type Ctrl + Shift + j) | |
// 3. copy and paste code below | |
// 4. kick searchKoders function | |
function searchKoders(searchQuery, visitedProjects) { | |
var kodersManager = new KodersManager(searchQuery, visitedProjects); | |
searchByEngineManager(kodersManager); | |
} |
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
var API_END_POINT = 'https://qiita.com/api/v1'; | |
stockAllPostByUserName('target_name'); | |
function stockAllPostByUserName(user_name) { | |
var qiita_test = {}; | |
getToken(qiita_test); | |
$.getJSON(API_END_POINT + '/users/' + user_name + '/items', null, | |
function(response) { |
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
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
// Project Euler no.105. | |
// http://daily-coding.herokuapp.com/problems/105 | |
// from data set obtained http://projecteuler.net/project/sets.txt, I got 73702 as a result. | |
public class Problem105 { | |
public static void main(String args[]) throws IOException { |
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
import java.util.Arrays; | |
// Project Euler 113 | |
// 51161058134250 | |
public class Problem113 { | |
static long[] numOfIncreasing = new long[10]; | |
static long[] numOfDecreasing = new long[10]; | |
static long sumOfIncreasing = 9; | |
static long sumOfDecreasing = 9; | |
public static void main(String[] args) { |
OlderNewer