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
| # -*- coding: utf-8 -*- | |
| import sqlite3 | |
| import re | |
| #or another Rikaichan formatted dictionary file | |
| d='.anki\\plugins\\yomichan_plugin\\languages\\japanese\\data\\dict.sqlite' | |
| f=sqlite3.connect(d).cursor() | |
| lookups=[(u'とく', u'徳')] | |
| def findWordsWithSameKanjiandReading(kana, kanji): |
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
| #!perl | |
| package DirectoryTraverser; | |
| use strict; | |
| use warnings; | |
| sub new() | |
| { | |
| my $class = shift; | |
| my $self = { |
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
| #!perl | |
| use v5.12; | |
| use strict; | |
| use warnings; | |
| use WWW::Mechanize; | |
| use Cwd; | |
| my $mech = WWW::Mechanize->new( autocheck => 1 ); | |
| my $desktop= "Desktop"; |
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
| # -*- coding: utf-8 -*- | |
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| from urlparse import urlparse | |
| from reading import mecab | |
| import json, urllib | |
| class MyHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| expr = u"カリン、自分でまいた種は自分で刈り取れ" |
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
| # -*- coding: utf-8 -*- | |
| from reading import mecab | |
| from codecs import open | |
| print mecab.reading(u'もう 冗談言わないでよ').encode('utf8') |
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
| #perl | |
| use v5.16; | |
| use warnings; | |
| use XML::Smart; | |
| use Mojolicious::Lite; | |
| my %videos; #videos to be saved; structured <id:[title, author_url, id, duration, [thumbnails]]> | |
| my %seen; #videos that have been seen and either saved or rejected; keys are video ids | |
| my %authors; #authors whose uploads have been seen; keys are author urls |
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
| #!perl | |
| use v5.16; | |
| use utf8; | |
| use XML::Smart; | |
| use Mojo::DOM; | |
| use Benchmark qw( timethese cmpthese ); | |
| my $xml = <<'EOF'; | |
| <?xml version='1.0' encoding='UTF-8'?><feed gd:etag="W/"A0ACRHgyfyp7I2A9WhNQGUo."" xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:gd="http://schemas.google.com/g/2005" xmlns:media="http://search.yahoo.com/mrss/" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><id>tag:youtube.com,2008:user:chemicalsreact14:uploads</id><updated>2012-11-27T01:29:25.697Z</updated><category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video" /><title>Uploads by chemicalsreact14</title><logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo><link href="http://gdata.youtube.com/feeds/api/users/chemicalsreact14?v=2" rel="related" type="application/atom+xml" /><link href="http://www.youtube.com/channel/UC6PnMX0ZSS4hnqGRmByH4gA/videos" rel="alternate" type="text/ht |
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
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| from urllib import unquote | |
| b=[] | |
| class MyHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| if not self.path in b: | |
| f.write('<li><a href=%s>%s</a></li>\r\n'%(unquote(self.path)[1:],unquote(self.path)[1:])) | |
| b.append(self.path) | |
| print self.path |
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
| const Cc = Components.classes; | |
| const Ci = Components.interfaces; | |
| const Cu = Components.utils; | |
| Cu.import("resource://gre/modules/Services.jsm"); | |
| function log(str) { Services.console.logStringMessage(str); } | |
| function showToast(aWindow, message) { aWindow.NativeWindow.toast.show(message, "short"); } | |
| var g; |
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
| python youtube-dl.py -v -f 18 -o "/Users/Owner/desktop/d/%(uploader)s/%(id)s_%(upload_date)s" |