This file contains hidden or 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
| public class hello { | |
| public static void main(String[] args) { | |
| System.out.println("Hello " + args[0]); | |
| } | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "sort" | |
| ) | |
| func main() { | |
| a := []int{10, 9, 8, 7, 6, 5, 4, 3, 2, 1} | |
| res := sort.SearchInts(a, 7) |
This file contains hidden or 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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| scanner := bufio.NewScanner(os.Stdin) |
This file contains hidden or 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
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| ) | |
| func main() { | |
| fmt.Println("flag.NArg():", flag.NArg()) | |
| } |
This file contains hidden or 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
| library collatz; | |
| collatz(int n) { | |
| print(n.toString()); | |
| if (n > 1) { | |
| if (n % 2 == 1) { | |
| collatz(3 * n + 1); | |
| } else { | |
| collatz((n / 2).round()); |
This file contains hidden or 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
| $ [[ 11 -eq 11 -a "bb" = "bb" ]]; echo $? | |
| -bash: syntax error in conditional expression | |
| -bash: syntax error near `-a' |
This file contains hidden or 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/sh | |
| if [[ $# -ne 3 ]] ; then | |
| echo argument is invalid. | |
| exit | |
| fi | |
| while : | |
| do | |
| after=`ls -l $1` | |
| if [[ $after != $before && $before != "" ]] ; then |
This file contains hidden or 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
| $ sh var.sh | |
| A=/Users/user_name/.get | |
| B=~/.get | |
| C=~/.get | |
| D=/Users/user_name/.get | |
| E=$HOME/.get |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| fmt.Println(os.Getenv("HOME")) | |
| } |
This file contains hidden or 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
| package main | |
| import "fmt" | |
| func main() { | |
| var a [10]int | |
| for i := 0; i < 10; { | |
| //a[i++] = 1 | |
| a[i] = 1 |
OlderNewer