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
// | |
// main.c | |
// minishell | |
// | |
// Created by SungJinYoo on 11/7/14. | |
// Copyright (c) 2014 SungJinYoo. All rights reserved. | |
// | |
#include <libgen.h> |
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
// | |
// command.c | |
// minishell | |
// | |
// Created by SungJinYoo on 11/10/14. | |
// Copyright (c) 2014 SungJinYoo. All rights reserved. | |
// | |
#include "command.h" | |
#include <string.h> |
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
#!/bin/bash | |
#============================================================================== | |
# GW-Kit | |
# @author : (origin) yunsang.choi([email protected]) | |
# @author : (forked) jinkwon([email protected]) | |
# @src : (origin) https://gist.github.com/gists/3115022 | |
# @src : (forked) https://github.com/Jinkwon/naver-gw-kit/ | |
#------- |
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
def __name__ == "__main__": | |
print("Hello World!") |
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
interface SampleFunctionalInterface { | |
// I am the only abstract method in this interface | |
int foo(); | |
} | |
interface AnotherSampleFunctionalInterface { | |
// I am the only abstract method in this interface | |
int foo(); | |
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
interface SampleNonFunctionalInterface { | |
// there are two abstract methods! | |
int foo(); | |
int bar(); | |
} |
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
interface Consumer<T> { | |
void accept(T value); | |
} | |
// create Consumer by defining a class explicitly | |
class HelloWorldPrinter implements Consumer<String> { | |
public void accept(String name) { | |
System.out.println("Hello World! " + name); | |
} |
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
interface Function<T, R> { | |
R apply(T value); | |
} | |
// a function that returns the same type with the input type | |
Function<Integer, Integer> square = (num) -> { | |
return num * num; | |
} | |
System.out.println(square.apply(3)); // prints out 9 |
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
@FunctionalInterface | |
interface Printer { | |
void print(String value); | |
} | |
class TextPrinter implements Printer { | |
void print(String value) { | |
System.out.println(value); | |
} | |
} |