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
#include <stdio.h> | |
#include <stdlib.h> | |
#define TRUE 1 | |
#define FALSE 0 | |
int main(int argc, char *argv[]) | |
{ | |
FILE *in; | |
int a, d, n; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int number; | |
int i; | |
int max, min; | |
int score; | |
int count; |
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
size(480, 120); | |
rect(160, 30, 260, 20); | |
ellipse(140, 0, 190, 190); |
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
upstream app { | |
server unix:/usr/local/nginx/html/apps/service/shared/tmp/sockets/unicorn.app.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name service.dbsj.org; | |
client_max_body_size 4G; | |
root /usr/local/nginx/html/apps/service/current/public; |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.1.0' | |
} | |
} |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 20 | |
buildToolsVersion "21.1.2" | |
defaultConfig { | |
applicationId "com.example.time_circle" | |
minSdkVersion 17 | |
targetSdkVersion 17 |
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 com.example.time_circle; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.app.DialogFragment; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; |
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
datatype 'label btree = | |
Empty | | |
Node of 'label * 'label btree * 'label btree; | |
fun lower(nil) = nil | |
| lower(c::cs) = (Char.toLower c)::lower(cs); | |
fun lt(x, y) = | |
implode(lower(explode(x))) < implode(lower(explode(y))); |
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
fun remove_a_stone vec i = | |
let | |
open VectorSlice | |
val size = Vector.length vec - 1 | |
val newvec = | |
if i = 0 then vector (slice (vec, 1, SOME size)) | |
else if i = size then vector (slice (vec, 0, SOME size)) | |
else concat [slice (vec, 0, SOME i), | |
slice (vec, i+1, SOME (size-i))] | |
in |
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
exception NotFoundException | |
fun get_primes n = | |
let | |
val l = List.tabulate (n, fn n => n + 2) | |
fun get_primes_sub nil result = result | |
| get_primes_sub (x::xs) result = | |
get_primes_sub (List.filter (fn n => n mod x <> 0) xs) (x::result) | |
in | |
List.rev (get_primes_sub l nil) |
OlderNewer