Skip to content

Instantly share code, notes, and snippets.

@am0c
am0c / gist:947938
Created April 29, 2011 06:23
android init vs perl
(
) this gist is posted without any special reason.
c[ ] ^^^^^^^ ^^^ ^^^^^^^ ^^^^^^
------------------------------------------------------------------------
struct action *action_remove_queue_head(void)
{
if (list_empty(&action_queue)) {
return 0;
@am0c
am0c / gist:911492
Created April 9, 2011 15:50
학과 스터디 숙제 - 구구단
/*
* 구구단 출력 프로그램:
* 1. 키보드를 통하여 입력한 단을 출력합니다.
* 2. 입력값 허용범위(2~9)
* 3. 입력된 값이 허용범위 값을 벗어나면...
* 입력 에러 메세지 출력후 다시 입력 요구를 합니다.
* 4. 종료 문자(q) 입력시까지 반복합니다.
* 5. 반복문은 while문과 for문 두개를 사용해서 코딩합니다.
* 6. 프로그램이 실행되면 최초 한번만 실행 화면과 같이 출력합니다.
*
@am0c
am0c / gist:896020
Created March 31, 2011 08:20
kldp #122160 연속되는 글자 찾기
#!/usr/bin/env perl
#
# 질문에 대한 정확한 답변을 위한 코드가 아님
#
use 5.010;
use warnings;
use strict;
use Data::Iter qw(:all);
my $s = '---- -- ----- ------- ---';
@am0c
am0c / gist:878274
Created March 20, 2011 11:17
String::Diff usage script
#!/usr/bin/env perl
use 5.010;
use warnings;
use strict;
use String::Diff;
use Term::ANSIColor;
use Encode;
print "line1: ";
chomp(my $line1 = readline *STDIN);
@am0c
am0c / gist:874683
Created March 17, 2011 16:56
네이트온 받은쪽지 파일과 보낸쪽지 파일을 병합
#!/usr/bin/env perl
#
# NateOn 보낸쪽지/받은쪽지 export 한 것을
# 하나로 뭉쳐주는 스크립트.
#
# 스크립트 파일과 입력파일은 UTF-8 가정
#
# 왜 이렇게 작성했는지 따지지 말아주세요.
# 저도 급해서 10분안에 날려 작성한 겁니다.
#
@am0c
am0c / gist:873960
Created March 17, 2011 07:18
test priority of * and ++ in c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#define TEST_STR "ABCD"
#define TEST_STR_SIZE 5
#define TEST_INIT() \
origin = malloc( TEST_STR_SIZE ); \
p = origin; strncpy(p, TEST_STR, TEST_STR_SIZE);
@am0c
am0c / gist:829110
Created February 16, 2011 09:53
Exporter 모듈 궁금증
--------------
#!/usr/bin/env perl
use warnings;
use strict;
use CHILD;
exported_ok();
--------------
@am0c
am0c / gist:822819
Created February 11, 2011 18:55
Jubeat Evans Play Simulation
#!/usr/bin/env perl
#
# Jubeat Evans Play Simulation
# -----------------------------
#
#
use Time::HiRes qw(usleep);
use List::Util qw(sum);
use warnings;
use strict;
@am0c
am0c / gist:822807
Created February 11, 2011 18:46
quick-dirty code duplication analyzer
#!/usr/bin/env perl
#
# Code Duplication Analyzer
# --------------------------
#
# Qui-Quic-Quick-and-Dirty-ly coded and
# I noticed that this approach does not
# return the trustful results.
#
#
@am0c
am0c / gist:822372
Created February 11, 2011 13:56
jubeat 隅田川夏恋歌 highlight
#!/usr/bin/env perl
#
# 隅田川夏恋歌
# ************
#
#
use strict;
use warnings;
sub get_line {