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
getCurPosition_ie = function(id){ | |
var elm = document.getElementById(id); | |
var docRange = document.selection.createRange(); | |
var textRange = document.body.createTextRange(); | |
textRange.moveToElementText(elm); | |
var range = textRange.duplicate(); | |
range.setEndPoint("EndToStart", docRange); | |
var start = range.text.length; | |
return start; |
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.actors._ | |
import java.lang.Thread | |
import java.net.{Authenticator, PasswordAuthentication} | |
import java.net.{URL, HttpURLConnection,URLEncoder} | |
import java.text.SimpleDateFormat | |
import java.util.Locale | |
import java.util.Calendar | |
import scala.xml.XML |
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
# -*- coding: utf-8 -*- | |
# | |
# Yaruo AA macro for Trac 0.11 | |
# | |
# Author : Yuroyoro | |
# License: BSD | |
from trac.core import * | |
from trac.util.html import Markup | |
from trac.wiki.macros import WikiMacroBase |
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
class Bar(object): | |
def __init__(self,p1,p2): | |
self.p1 = p1 | |
self.p2 = p2 | |
def val(self): | |
return (self.p1,self.p2) | |
def __lt__( self, other): | |
return self.val() < other.val() |
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
# -*- coding: utf-8 -*- | |
# | |
class PriorityQueue(object): | |
def __init__(self): | |
self._queue = [] | |
def push( self, obj , priority=0): | |
self._queue.append( (obj, priority) ) | |
return self |
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.net.{URL,HttpURLConnection} | |
import java.io._ | |
object BijintDownloader extends Application{ | |
for( hour <- 0 to 23; minute <- 0 to 59){ | |
val fname = "%02d%02d.jpg".format( hour,minute ) | |
val url = "http://bijint.com/jp/img/clk/%s".format( fname ) | |
val urlConn = new URL(url).openConnection.asInstanceOf[HttpURLConnection] | |
urlConn.addRequestProperty("REFERER","http://bijint.com/jp/") |
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
/** | |
* (./) FaceDetection.java, 03/05/08 | |
* (by) cousot stephane @ http://www.ubaa.net/ | |
* (cc) some right reserved | |
* | |
* Sample program for "OpenCV" project. | |
* Use ESC key to close the program properly. | |
* | |
* This sample is released under a Creative Commons Attribution 3.0 License | |
* 腦駈醜 http://creativecommons.org/licenses/by/3.0/ 腦駈什 |
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.awt.*; | |
import java.awt.image.MemoryImageSource; | |
import hypermedia.video.OpenCV; | |
public class AnimeFaceDetection extends Frame { | |
OpenCV cv = null; | |
AnimeFaceDetection(String imagePath) { | |
super(); |
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._ | |
import scala.io.Source | |
object LDRFeedSummary { | |
val opmlUrl = "http://reader.livedoor.com/user/%s/opml" | |
val r = """http\:\/\/([^\/]+)\/.*$""".r | |
// まとめるドメイン | |
val topLevelDomain = List("fc2.com", |
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.lang.{String ⇒ 文字列} | |
import scala.{Int ⇒ 整数 , Double ⇒ 倍精度浮動小数点} | |
import scala.{List ⇒ リスト, Array ⇒ 配列} | |
import scala.xml.{XML ⇒ XMLオブジェクト, NodeSeq ⇒ ノードリスト} | |
import scala.io.{Source ⇒ ソース} | |
import scala.collection.immutable.{Map ⇒ マップ} | |
object LDRの購読数をドメイン毎に集計する{ | |
val opmlの場所= "http://reader.livedoor.com/user/%s/opml" |
OlderNewer