Skip to content

Instantly share code, notes, and snippets.

View ukitazume's full-sized avatar

Yu Kitazume ukitazume

  • Tokyo and Gunma, Japan
View GitHub Profile
- 掃除機
- レンタル返却
- 風呂、便所掃除
- 買い出し
- ゴミ捨て
- チェック
- お金用意
10:45 家発
11:04 春日初
春日(東京)
//
// main.c
// helloworld
//
// Created by kitazume yu on 11/11/24.
// Copyright (c) 2011年 none. All rights reserved.
//
#include <stdio.h>
#include <stdio.h>
# liner serch
int lookup(char *word, char *array[]) {
int i;
for (i = 0; array[i] != NULL; i++) {
if (strcmp(word, array[i]) == 0)
return i;
}
return -1;
[TapjoyConnect requestTapjoyConnect:TAPJOY_APPID secretKey:TAPJOY_SECRET];
[Pankia initWithGameKey:GAME_KEY gameSecret:GAME_SECRET title:GAME_TITLE delegate:self options:launchOptions];
[TapjoyConnect setUserID:[[PNUser currentUser] userId]];
#include <stdio.h>
typedef struct Nameval Nameval;
struct Nameval {
char *name;
int value;
};
int lookup(char *word, Nameval st[], int sts) {
#include <stdio.h>
typedef struct Nameval Nameval;
struct Nameval {
char *name;
int value;
};
void swap(int v[], int i, int j) {
int tmp = v[i];
#include <stdio.h>
int scmp(const void *p1, const void *p2) {
char *v1, *v2;
v1 = *(char **) p1;
v2 = *(char **) p2;
return strcmp(v1, v2);
}
Normal mode default mappings.
{lhs} {rhs}
-------- -----------------------------
<TAB> <Plug>(vimfiler_switch_to_other_window)
j <Plug>(vimfiler_loop_cursor_down)
k <Plug>(vimfiler_loop_cursor_up)
gg <Plug>(vimfiler_cursor_top)
<C-l> <Plug>(vimfiler_redraw_screen)
<Space> <Plug>(vimfiler_toggle_mark_current_line)
<S-Space> <Plug>(vimfiler_toggle_mark_current_line_up)
# data
label = %w{aa, bb, cc}
v1 = [1, 2, 3]
v2 = [11, 22, 33]
# use zip
label.zip(v1) #= > [["aa,", 1], ["bb,", 2], ["cc", 3]]
label.zip(v1, v2) #= > [["aa,", 1, 11], ["bb,", 2, 22], ["cc", 3, 33]]
Hash[label.zip(v1)] #= > {"cc"=>3, "bb,"=>2, "aa,"=>1}
Hash[label.zip(v1.zip(v2))] #= > {"cc"=>[3, 33], "bb,"=>[2, 22], "aa,"=>[1, 11]}
class Hash
def values_classify
inject({}) do |options, (key, value)|
options[key] = value.class
options
end
end
def values_classify!
replace(self.values_classify)