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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import socket, string | |
import codecs, sys | |
SERVER = sys.argv[1] | |
PORT = int(sys.argv[2]) | |
PASS = sys.argv[3] |
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.ProtocolException; | |
import java.net.URL; | |
public class HttpConnectionSample | |
{ |
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
object FizzBuzz{ | |
def main(args: Array[String]){ | |
val numbers:List[Int] = 1 to 100 toList | |
val results:List[String] = numbers.map(s => | |
if(s % 15 == 0) "FuzzBuzz" | |
else if(s % 3 == 0) "Fuzz" | |
else if(s % 5 == 0) "Buzz" | |
else s.toString | |
) | |
println( results ) |
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
よりいい方法があったら誰かエロイ人教えてください |
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
lv hoge.txt| grep -o "\w*Page"| sort | uniq -c |
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
Android | |
google-chrome -user-agent="Mozilla/5.0 (Linux; U; Android 1.5; ja-jp; HT-03A Build/CDB72)" | |
iPhone | |
google-chrome -user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7" |
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
scala> def selectTailRec(items : List[Int], removeIrems : List[Int], removeItem : Int, roop: int) : (List[Int], List[Int]) = { | |
| if(roop > 0) { val newList = items.filter(i => i != removeItem) | |
| selectTailRec(newList, removeItem :: removeIrems, newList.head, roop -1)} | |
| else (items, removeIrems) } | |
warning: there were deprecation warnings; re-run with -deprecation for details | |
selectTailRec: (List[Int],List[Int],Int,int)(List[Int], List[Int]) | |
scala> selectTailRec(List(1,2,3,4,5,6,7,8), Nil, 7, 3) | |
res2: (List[Int], List[Int]) = (List(3, 4, 5, 6, 8),List(2, 1, 7)) |
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
import scala.xml.parsing._ | |
import scala.xml._ | |
import scala.io._ | |
val src = Source.fromString("<html><head /><body><script>var foo = \"fooooooo\";</script></body></html>") | |
val cpa = ConstructingParser.fromSource(src, false); | |
val doc = cpa.document(); | |
val ppr = new scala.xml.PrettyPrinter(80,2); | |
val ele = doc.docElem; | |
val out = ppr.format(ele); |
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
for filename in `ls FOO_*.html`; do newname=`echo $filename | sed -e 's/FOO/BAR/g'`; mv $filename $newname; done |
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
<html> | |
<head> | |
<style type="text/css" rel="stylesheet"> | |
#root{ | |
width:480px; | |
height:480px; | |
overflow:hidden; | |
position:relative; | |
margin: 0 auto; | |
} |
OlderNewer