Skip to content

Instantly share code, notes, and snippets.

View pyk's full-sized avatar
🐈‍⬛
I may be slow to respond.

pyk pyk

🐈‍⬛
I may be slow to respond.
View GitHub Profile
  1. General Background and Overview
@pyk
pyk / string.c
Created July 5, 2015 00:59
string & list of string in C
#include <stdio.h>
int
main()
{
/* character */
char a;
a = 's';
printf("char a\t= %c\n", a);
@pyk
pyk / vim-for-ide.md
Created July 18, 2015 00:12
Use vim for IDE

This is bunch of vim tips that I gather from the internet.

Project-specific configuration

" forces vim to source .vimrc file if it present in working directory
set exrc
" restrict usage of some commands in non-default .vimrc files
set secure

Navigate source code

@pyk
pyk / fib-dp.c
Last active August 29, 2015 14:25
the comparison of naive recursion and dynamic programming to compute n-th fibonacci number
#include <stdio.h>
long long fib(long long n);
long long fibs[100];
long long
main()
{
long long i;
@pyk
pyk / n.c
Created July 22, 2015 23:56
Exercise 1.2-2 & 1.2-3 on Introduction to Algorithm book by Cormen et al.
#include <stdio.h>
#include <math.h>
int
main()
{
int n;
for(n = 1; n < 10000; n++) {
if((8*pow(n,2)) < (64*n*log(n))) {
@pyk
pyk / insertion-sort.c
Last active August 29, 2015 14:25
Implementation of Sorting algotithm in C language
/* compile: gcc -o insertion-sort insertion-sort.c */
#include <stdio.h>
int
main()
{
int i;
int A[6] = {5, 2, 4, 6, 1, 3};
for(i = 1; i < 6; i++) {
@pyk
pyk / file.go
Last active August 29, 2015 14:27
golang "cannot assign to" http://play.golang.org/p/GJWp1G8H-E
package main
import (
"fmt"
)
type A struct {
name string
s []string
}
@pyk
pyk / kmp.c
Last active August 29, 2015 14:27
Knuth–Morris–Pratt algorithm in C https://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void create_failure_fn(char *p, int lenp, int table[]);
int search_kmp(char *s, int lens, char *p, int lenp, int table[]);
int
main()
{
@pyk
pyk / adams-heroku-values.md
Last active August 29, 2015 14:27 — forked from adamwiggins/adams-heroku-values.md
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@pyk
pyk / output.md
Last active September 7, 2015 09:34
solution of exercise http://tour.golang.org/#38

image