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
int main(int argc, char const* argv[]) | |
{ | |
enum { INIT, CONFIRM, SUCCESS, FAILURE } state; | |
if (argc < 2) { | |
state = FAILURE; | |
} | |
return 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
irb(main):003:0> 10.times.map{|f| f.to_s} | |
=> ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] | |
irb(main):004:0> 2.upto(10).map{|f| f.to_s} | |
=> ["2", "3", "4", "5", "6", "7", "8", "9", "10"] |
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
#! /usr/bin/ruby -w | |
# encoding: utf-8 | |
require 'optparse' | |
require 'fileutils' | |
bak = from = to = nil | |
#引数解析 | |
opt = OptionParser.new | |
opt.on("-b", "--backup <extention>", String) {|val| bak = val} |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#define MAX 400000 | |
static void showarray(int *array, int length) | |
{ | |
int i; |
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> | |
#include <assert.h> | |
static void set_bit(unsigned char* barray, int idx) | |
{ | |
div_t t; | |
t = div(idx, 8); | |
*(barray + t.quot) |= (1 << t.rem); | |
} |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<a href='javascript: | |
var e = "",r = ""; | |
do { |
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
template<typename T> | |
void printList(list<T> values) | |
{ | |
typename list<T>::iterator p; | |
char separator = 0; | |
cout << "{ "; | |
p = values.begin(); | |
while (p != values.end()) { | |
cout << separator << *p; |
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 () { | |
$("document").ready(init); | |
var canvas; | |
var context; | |
var centerX; | |
var centerY; | |
var r; | |
var LINEWIDTH = 2; | |
var step = 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
static int mpermulate(char *prefix, char *array, char *match, long long* count) | |
{ | |
char gemstring[16]; | |
char newarray[16]; | |
char last; |
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
void | |
dg_cli(FILE *fp, int sockfd, const SA *pservaddr, socklen_t servlen) | |
{ | |
int n; | |
const int on = 1; | |
char sendline[MAXLINE], recvline[MAXLINE + 1]; | |
socklen_t len; | |
struct sockaddr *preply_addr; | |
preply_addr = Malloc(servlen); |
OlderNewer