This file contains hidden or 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 miniparser | |
import scala.util.parsing.combinator.RegexParsers | |
import scala.collection.mutable.Map | |
object Main { | |
def main(args: Array[String]): Unit = { | |
val expr = """ | |
def mod(x, y) ={ |
This file contains hidden or 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
/* | |
* Amazonランキングを1時間ごとに取得する。 | |
* NekoHTMLが必要。 | |
*/ | |
package amazonrank; | |
import java.io.*; | |
import java.net.URL; | |
import java.util.Date; | |
import java.util.concurrent.Executors; |
This file contains hidden or 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
/* | |
* Amazonランキングのグラフを表示する | |
* JFreeChartが必要。コンパイルはJavaSE7で。 | |
*/ | |
package amazonrank; | |
import java.awt.Font; | |
import java.awt.image.BufferedImage; | |
import java.io.*; | |
import java.net.URL; |
This file contains hidden or 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 kis.basicdb; | |
import java.io.PrintWriter; | |
import java.io.StringWriter; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; |
This file contains hidden or 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
Ext.define('Watch.controller.WatchController', { | |
extend: 'Ext.app.Controller', | |
requires: 'Ext.util.DelayedTask', | |
config: { | |
refs: { | |
timeLabel: '#time_label', | |
startButton: '#start_button', | |
stopButton: '#stop_button' | |
}, | |
control: { |
This file contains hidden or 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
module hexseg( | |
input clk, | |
input [3:0] num, | |
output [7:0] leds | |
); | |
parameter brightness = 30; | |
reg [7:0] cnt; | |
always @(posedge clk) begin | |
cnt = cnt + 1; |
This file contains hidden or 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
//表示 | |
wire [9:0] vtemp = airtemp < 10'h14 ? 10'h00 : (airtemp - 10'h14); | |
reg [7:0] bcd; | |
reg [7:0] bcdf2; | |
wire [7:0] bcdfadd = bcd + bcdf2; | |
wire [3:0] bcdfL = bcdfadd[3:0] < 4'd10 ? bcdfadd[3:0] : (bcdfadd[3:0] - 4'd10); | |
wire [3:0] bcdfH = bcdfadd[3:0] < 4'd10 ? bcdfadd[7:4] : (bcdfadd[7:4] + 4'd1); | |
reg [7:0] bcd1; |
This file contains hidden or 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
primenumbers :: Integer -> [Integer] | |
primenumbers n = reverse (prime_impl 2 n []) | |
where | |
prime_impl :: Integer -> Integer -> [Integer] -> [Integer] | |
prime_impl x m rs | |
| x > m = rs | |
| any (\n -> x `mod` n == 0) rs = | |
prime_impl (x+1) m rs | |
| otherwise = prime_impl (x + 1) m (x:rs) |
This file contains hidden or 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
fizzbuzz :: Integer -> [String] | |
fizzbuzz x = reverse $ impl x | |
where | |
impl :: Integer -> [String] | |
impl 0 = [] | |
impl n | |
| n `mod` 15 == 0 = "fizzbuzz" : next | |
| n `mod` 3 == 0 = "fizz" : next | |
| n `mod` 5 == 0 = "buzz" : next | |
| otherwise = show n : next |
This file contains hidden or 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 kishida.aparapisample; | |
import com.amd.aparapi.Kernel; | |
import java.util.Arrays; | |
import java.util.Random; | |
/** | |
* | |
* @author kishida | |
*/ |
OlderNewer