This page's content was permanently moved to: https://www.ic.unicamp.br/~meidanis/courses/problemas-lisp/L-99_Ninety-Nine_Lisp_Problems.html
æ¨æ¥ã®ç¶ãã (rss->xsml "http://oss.timedia.co.jp/kahua-web/rss.xml") ãªã©ã¨ããã¨ã (*TOP* (*PI* xml version="1.0" encoding="euc-jp" ) (rss (@ (version 2.0)) (channel (title "Kahua-web") (link "http://oss.timedia.co.jp/show") (description "Kahua-web TEST Site") (lastBuildDate "Tue, 24 Oct 2006 08:09:40 +0900") (item (title "ä»æ¥ã®ä¸è¡") (link "http://oss.timedia.co.jp/show/column/%ba%a3%c6%fc%a4%ce%b0%ec%b9%d4") (
ä»ãµã¤ãã®RSSãèªã¿è¾¼ãã§å å·¥ããèªåã®ãµã¤ãã«è¡¨ç¤ºãã¦ã¿ããã (use rfc.uri) (use rfc.http) (use sxml.ssax) (define (rss->sxml uri) (receive (schema user-info hostname port path query fragment) (uri-parse uri) (receive (status header body) (http-get hostname path) (call-with-input-string body (lambda (in) (let ((sxml-data (ssax:xml->sxml in '()))) (values status header sxml-data))))))) ã¨ããããããã§SXMLã¯å¾ããããã ãã¦å¿ è¦ãªè¦ç´ ã ããåãåºãã¦å å·¥ããã«
Twitter ã OAuth ã¨ããèªè¨¼æç¶ããæ¡ç¨ããããã ã ç¾å¨ã® Basic èªè¨¼ã¯è¿ãå»æ¢äºå®ã ããã§ã Twitter é¢é£ã½ãã㯠OAuth 対å¿ãä½åãªãããã¦ããã OAuth ã«ã¤ãã¦ã¨ãããã¦ããããã°è¨äºãã¡ãã»ãã¨è¦æããã æµè¡ã«ä¹ããã¨ããããã§ããªããã Gauche 㧠OAuth èªè¨¼ (ã³ã³ã·ã¥ã¼ãå´) ã®ã³ã¼ããæ¸ãã¦ã¿ãã oauth_token ã¨ããåå¾ãããããã¾ã§ã ãã ããç½²åã®é¨åã ã使ãã¾ããã°ãã¨ã¯ç¹ã«é¢åãªãã¨ããªãã ããã ã³ã³ã·ã¥ã¼ããã¼ãã³ã³ã·ã¥ã¼ãç§å¯éµã¯ (å½ç¶ã ã) åèªã§åå¾ãã¦æ¬²ããã (use rfc.http) (use rfc.sha) (use rfc.hmac) (use rfc.base64) (use www.cgi) (use math.mt-random) (use gauche.uvector
èªåãGaucheã§OAuthã使ãããã«è©¦è¡é¯èª¤ãã¦ãããã id:SaitoAtsushiãããGaucheã§OAuthã使ãã³ã¼ããæ¸ãã¦ããã¦ãããããªã®ã§(http://d.hatena.ne.jp/SaitoAtsushi/20100429/1272545442)ã ãã®ã³ã¼ããå ã«ãTwitterã§ã¤ã¶ããã³ã¼ããä½ã£ã¦ã¿ã¾ããã ;APIã®URLãapi.twitter.comã«ãã¦ã¿ã ;uri-encode-stringãæ¥æ¬èªã«å¯¾å¿ããã¦ã¿ã (use rfc.http) (use rfc.sha) (use rfc.hmac) (use rfc.base64) (use www.cgi) (use math.mt-random) (use gauche.uvector) (define consumer-key "Consumer Key") (define con
使ããã人ã®ããã®ç¶ç¶å ¥éç¶ç¶æ¸¡ãå½¢å¼call/ccã¯æ®éã®é¢æ°call-withç³»é¢æ°call-with-procedurecall-with-continuation-procedurecall-with-current-continuationè©ä¾¡é åºã¨ç¶ç¶call/ccããºã«ãæå ãã«ãã¹ã¬ããé¨åç¶ç¶reset/pcã¨call/pcç°å¢ç ´å£ã¨é¨åç¶ç¶é¨åç¶ç¶ã®ä½¿ç¨æ³PRINT-AND-NEXT-REPLè°è«è³ªåãæå ãã«ãã¹ã¬ããã®ãµã³ãã«ããã°ã©ã ã«ã¤ã㦠使ããã人ã®ããã®ç¶ç¶å ¥é ã¨ããããæ®´ãæ¸ãã ãã©ãã£ããåé·ãªæç« ã«ãªã£ã¦ãããéè¤ãã¦ãããééã£ã¦ããã ããããªãåéãããã¦ãããæ¥ãã«ãã¦ãããããããããªããã©ãææ¬ã èããã¤ãã¿ããæ°æã¡ã§ç¶ç¶ã使ããããã«ãªããã人ã¯èªãã§ã¿ã¦ãã ããã ãã ãæè©®ã¯èã§ãã(ï½ ç¶ç¶æ¸¡ãå½¢å¼ ä¾ã«ãã£ã¦éä¹fact
ãsxpathãã¨ã¦ããããã«ãããã®è£è¶³ã sxpathã®ã¯ã¨ãªã«æ£è¦è¡¨ç¾ãåãè¾¼ããããã«ãã¦ã¿ãã ã¯ã¨ãªã®ä¸ã«æ£è¦è¡¨ç¾ãåºã¦ããå ´åããåãã¼ãã®ä¸ãããããã¹ãè¦ç´ ã§ãã¤æ£è¦è¡¨ç¾ã«ããããããã®ãåãåºã(åãã¼ãããé¸ã¶ã®ã¯ãä»ã®ã¯ã¨ãªã(ã//ããé¤ãã¦)åãã¼ãã«ã¤ãã¦æ¢ç´¢ããããªããã)ã ãã¨ãã° ((sxpath-rx '(// a @ href #/\.html$/)) node) ã§ãaè¦ç´ ã®hrefå±æ§ã®å¤ã®ãã¡ãã.htmlãã§çµãããã®ã ããåãåºããaè¦ç´ å ¨ä½ãå¿ è¦ãªã ((sxpath-rx '(// (a (@ href #/\.html$/)))) node) ã¨æ¸ãã ãã£ã¦ãããã¨ã¯ãã¯ã¨ãªã«åºã¦ããæ£è¦è¡¨ç¾ãé¢æ°ã«ç½®ãæãã¦ããsxpathã«æ¸¡ãã¦ããã ãã (use sxml.sxpath) (define (sxpath-rx query)
ãã£ã±RDBã使ããã¨ä½ãã¨ä¾¿å©ãªã®ã§ï¼SQLiteã使ã£ã¦ã¿ãï¼ ã¾ãã¯ï¼Gauche-dbd-sqlite3ãã¤ã³ã¹ãã¼ã«ï¼ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯ã°ã°ã£ã¦ãï¼ ã¤ã³ã¹ãã¼ã«ãçµãã£ãã®ã§ï¼æ©é試ãï¼ã¾ãã¯DBããªã¼ãã³ãã¦ã¿ãï¼ (use dbi) (use util.relation) (defin conn (dbi-connect "dbi:sqlite3:/db/file/path.db"))dbiã¨util.relationã®2ã¤ã®ããã±ã¼ã¸ãuseãã¦ï¼dbi-connectã§DBãã¡ã¤ã«ãæå®ãã¦ããã ãï¼DBãã¡ã¤ã«ããªãã£ããèªåçã«ä½ã£ã¦ãããã¿ããï¼ æ¬¡ã¯ãã¼ãã«ã®ä½æï¼ (let* ((query (dbi-prepare conn "create table hoge (foo integer primary key, bar varchar(256))")))
ãªã³ã¯ããã©ã£ã¦ããã¤ãå·¡åããã ãã®ç°¡åãªã¯ãã¼ã©ãä½ã£ã¦ã¿ãããæ¸æãã¨ãããå¤ãã£ãã®ã§ãã¾ãã¯ãã®ã¡ã¢ã æ¸æã£ãã¨ãã http-get ãªãã·ã§ã³ã§ã:no-redirect #tããæå®ããªãã¨ãèªåã§ãªãã¤ã¬ã¯ããã â ãªãã¤ã¬ã¯ããããã¨ãæã£ã¦ãããã¼ã¸ã®URIãæ³å®ãã¦ããURIã¨éãå ´åããããâ ãhttp://ãããå§ã¾ããªããã¹(ç¸å¯¾URI)ãé·ãURI(絶対URI)ã«æ»ããªãã ãªãã·ã§ã³ã:sink outããæå®ããã¨ãHTTPã®å¿çã®ã¡ãã»ã¼ã¸ããã£ã¯åºåãã¼ãoutã«æ¸ãåºããã¦ãããã:sink outããæå®ãã¦ããç¶æ ã§ãªãã¤ã¬ã¯ããçºçããã¨ããªãã¤ã¬ã¯ãåã«outã«æ¸ãåºããããã®ã¨ãªãã¤ã¬ã¯ãå¾ã®çµæã®ä¸¡æ¹ãæ¸ãè¾¼ã¾ããç¶æ ã«ãªããflusherãªãã·ã§ã³ã§é©åã«å¦çããã? æåã³ã¼ãé¢é£ http-getã¯æåã³ã¼ãã®æå®ãªãã·ã§ã³
ç¥æ´ 大å¦æ代ã«Cè¨èªãã¯ãããããããããããæ«æã ãã®å¾ãRubyãç¥ãç°¡åãªã¹ã¯ãªãããæ¸ãããã«ãªãã é¢æ°åè¨èªãåå¼·ããããªãHaskellããã£ãããããããããã ;Haskellãåå¼·ãç´ãä¸ ãã®å¾ããã¾ãã¾æ¬å±ã§ã¿ãã¼ã«å£ã¨ç®ã大ããéã®è¡¨ç´ã®ãªã©ã¤ãªã¼æ¬ãè¦ãããããã®æ¬ã¯ããã°ã©ãã³ã°Gaucheã¨ãããããã èªå® ã«å¸°ã£ã¦ãwikiã§èª¿ã¹ãã¨ä½ãåããããã¨ããããå¾æ¥è³¼å ¥ã ãã®å¾ã¯ãã»ã¨ãã©Gaucheã§ã³ã¼ããæ¸ãããã«ãªãã ã³ã³ãã¥ã¼ã¿é¢ä¿ã¯æ¬å½ã«åå¼·ãããã¨ãä¸æ¯ãããªã¼ã ããã ãã§ãä¸çãã£ã¦ããããã ã perl perlå ¥éãã¦ã¿ãã cpanã楽ãã¿ã Cè¨èª ããã°ã©ãã³ã°è¨èªCã¨ããã°ã©ãã³ã°ä½æ³ãèªã¿çµããã Cã¯è¯ãè¨èªã ããããã°ãã©ã£ãã§èªãã ãã©Cã®ã¤ã³ãã³ãã8ãªã®ã¯ããã¹ããæ·±ããã¦ã¯ãããªãã¨ããæè¨ããæ¥ã¦ããã¨æ¸
å 容ã«ç´æ¥é¢ä¿ããªãã®ã§ããããã¹ã¿ãã¯ã®ã³ã¼ã«ããã¯ãã@aharisuãããè¨ã£ã¦ããã®ã¯ãã¶ããã³ã¼ã«ã¹ã¿ãã¯ã®ç ´æ£ãçãªãã¨ã ã£ããã¨ãã³ã¼ã«ã¹ã¿ãã¯ãã¨å¹ãé£ã°ãçãªãéã£ãããªã ç¶ç¶ - Wikipedia ãããæç¹ã§ã®ç¶æ ããå¤æ°ã«æç¸ãã¦ãå¾ããããã¸æ»ãã¨ãã£ããã¨ãå¯è½ã«ãªããSchemeã®ç¶ç¶ã¯é¢æ°ã®å½¢ãã¨ã£ã¦ãããããã¯ããã®é¢æ°ãå¼ã¶ãã¨ã«ãããããã«æ¸¡ãããå¼æ°ãcall/ccã§å²ã¾ãã¦ããå¼å ¨ä½ã®å¤ã¨ãã¦ç¶ç¶ã«âæ³¨å ¥âã§ãããã¨å®ç¾©ããã¦ãããç¶ç¶ ããã°ã©ã ã®å®è¡é åºãå¶å¾¡ããæ¦å¿µç¶ç¶ æ¢ã«çµäºããã¹ã¿ãã¯ãã¬ã¼ã ãé»æ³ã®å½ã ãå¼ãããåºãã¦ã¹ã¿ãã¯ã«ã¶ã¡ãããããã§ãããæ®éã®äººéãããã£ãããã¯Call/CCã使ãã° ã«ãã³è¯ãå®è£ ã§ãããï¼ããªã©ã¨æãã¤ããããããã¨ã¯ã¾ãããããªãScheme/ç¶ç¶ - Wikibooks ç¶ç¶ãç¨ããã°å¤§åè±
sxpathã使ã£ã¦ã¿ããã¨ããããã¨ã¦ããããã«ããã£ãã®ã§ã¡ã¢ã Gaucheã®ããã¥ã¢ã«ãè¦ã㨠SXPathã¯ãXML Information set (Infoset)ã®ã¤ã³ã¹ã¿ã³ã¹ã®Så¼ãã©ã¼ã ã§ãã SXMLã®ããã®ã¯ã¨ãªè¨èªã§ãã ã¨ãããã©ãããã§ã¯ã¯ã¨ãªè¨èªã«éããã«ãsxmlæ§é ããç¹å®ã®ãã¼ããåãåºãããã®æ©è½å ¨è¬ã表ããã¨ã«ããã è£è¶³: HTMLãSXMLã«å¤æããã sxmlããªã¼ãæ¢ç´¢ãã ã³ã³ãã¼ã¿ sxpathé¢æ°ã«ä¸ããã¯ã¨ãª æ¡ä»¶ã§åãã¼ããéå®ãã ã³ã³ãã¼ã¿ã®åã込㿠é¢é£:2010-04-12ãsxpathã®ã¯ã¨ãªã«æ£è¦è¡¨ç¾ãæ¸ããããã«ããã è£è¶³: HTMLãSXMLã«å¤æããã ã¨ããããä½ãå ·ä½çãªXMLãã¼ã¿ããã£ãæ¹ãããã®ã§ãHTMLãã¡ã¤ã«ãSXMLã«å¤æãããã¨ã«ãããã§ãããã¦ãã®HTMLãã¡ã¤ã«ã¯XMLã®å½¢å¼ã«ãªã£ã¦ããª
åè GaUnit run-test.el GaUnit::wiki run-test.el::wiki .emacs C-c C-tãããscheme-trace-procedureãã³ãã³ãã«ãã¼ãã¤ã³ãããã¦ãã¦ä½¿ããªãã®ã§ãscheme-mode-hookã§å¤æ´ã (add-hook 'scheme-mode-hook '(lambda () (define-key scheme-mode-map "\C-c\C-t" 'run-test))) (setq load-path (cons "/usr/share/emacs/site-lisp/run-test/" load-path)) (load "run-test-setting") run-test.scm ãè¨ç½® testããããã¡ã¤ã«ã®ãããã£ã¬ã¯ããªã« test ã¨ããæ°è¦ãã£ã¬ã¯ããªãä½æããä¸ã«run-test.s
shiroããã«æãã£ãã®ã§ã¡ã¢ã£ã¦ããã¾ã ;;; from shiro (defun gauche-info-index (topic) (interactive (list (read-string (concat "Gauche help topic : ") (current-word)))) (switch-to-buffer-other-window (get-buffer-create "*info*")) (info "/usr/share/info/gauche-refe.info.gz") ;;(info "/usr/local/share/info/gauche-refe.info.gz") ;;ãã¡ã¯/usr/local/ (Info-index topic)) ;;(define-key global-map "\C-xH" 'gauche-info-index
Schemeã®ã·ã³ãã«ãè£å®å ¥åãã¦ããããscheme-complete.elã使ãå§ãã¾ããã ã½ã¼ã¹ã³ã¼ãã®è¨è¿°ã®éããè¦ã¦å¦çç³»ãèªåçã«å¤æãã¦ãããã¿ããã§ãã scheme-complete.el ã®ç¨æãã¦ãããè£å®ãããã¡ãããªãããã¾ãåä½ããªãã£ãã®ã§ãauto-complete.el ã§ä½¿ããããã«ãã¾ããã scheme-complete.elãã¤ã³ã¹ãã¼ã«synthcode - scheme-completeããææ°ã®scheme-complete.elããã¦ã³ãã¼ããã¾ãã 解åãã¦ããã¼ããã¹ã®éã£ãã¨ããã«ç½®ãã¾ãã gunzip -c scheme-complete-0.8.9.el.gz > scheme-complete.el mv scheme-complete.el /usr/share/emacs/site-lisp/ è¨å®(scheme-co
ããã³ãã³åç»ã«VOCALOIDãªãªã¸ãã«æ²ã®åç»ãæ稿ãããã®ããç¥ãããããã¨ãããTwitterã®botãå»å¹´ã®12æããã«ä½ã£ãã®ã§ããããGaucheã§æ¸ãç´ãã¦ã¿ã¾ããã ããããªbotå ¬éãã¦ããã®ããã¨æãããããªã»ã©æ¬ é¥ã ããã§ããã»ã»ã» å®ã¯ãèªåã§ãã³ãã³åç»ã®RSSãèªãã§ããããã§ã¯ãªããVOCALOIDãªãªã¸ãã«æ²ã®æ°çåç»ã表示ãã¦ããããµã¤ãã®ãã¼ãã«ã ã¼ãã¨ããã¨ããã®Atomãã£ã¼ããèªãã§ãã¾ãã (ã¼ãã«ã ã¼ã®éçºè ã®æ¹ã«ã¯è¨±å¯åã£ã¦ãã¤ããã§ããã»ã»ã») ä¸å¿ãã¼ãã«ã ã¼ã®URLãæ¸ãã¦ããã¾ãã ã¼ãã«ã ã¼: http://vocanew.naniyueni.org/ ã¼ãã«ã ã¼éçºããã°: http://d.hatena.ne.jp/vocanew/ ä¸å¿ãTwitter IDã@vnewsongãã§åãã¦ãã¾ãã ã¾ããæ¸ãç´ãåã®ãRuby
絶対ã«ãã§ã«èª°ããã£ã¦ããã¨æãã¾ãããGaucheã使ã£ã¦Twitterã«æ稿ããããã°ã©ã ãæ¸ãã¦ã¿ã¾ããã PerlãRubyãPythonã®ãããªãã¹ã¯ãªããçãªç¨éã¯Schemeã便å©ã§ãã ; Twitterã«æ稿ãã (use rfc.http) (use rfc.base64) (use rfc.uri) (define (twitter-update status username password) (http-post "twitter.com" (string-append "/statuses/update.json?status=" (uri-encode-string status)) "" :Authorization (string-append "Basic " (base64-encode-string (string-append username
Gaucheã®RDBã¤ã³ã¿ã¼ãã§ã¤ã¹ GaucheãRDBã¤ã³ã¿ã¼ãã§ã¤ã¹ã©ã¤ãã©ãªãæã£ã¦ãã¾ãããã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¯PerlãJavaã®RDBã¤ã³ã¿ã¼ãã§ã¤ã¹åæ§ã«ãRDBã½ããã«ä¾åããªãAPIãæä¾ããDBIï¼Database Independent Interfaceï¼ã¨ãDBIã¨åRDBç¨ã©ã¤ãã©ãªãã¤ãªãDBDï¼Database Driverï¼ã®2ã¤ã®ã¬ã¤ã¤ã«åããã¦ãã¾ãã å¾ã£ã¦ãGaucheã§RDBãæ±ãããã°ã©ãã³ã°ãè¡ãã«ã¯ãåRDBã½ããã®ã¤ã³ã¹ãã¼ã«ã®ã»ãã«ãåRDBã½ããã«å¯¾å¿ããDBDãã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ãã ç¾å¨ãGaucheãã使ããDBDã®ä¸è¦§ã¯ãGauche Packagesã¾ãã¯Gaucheã®Webãã¬ã¼ã ã¯ã¼ã¯ãKahuaãã®DBIãã¼ã¸ã«ããã¾ãã SQLite3ã®ã¤ã³ã¹ãã¼ã« ãã®é£è¼ã§ã¯ãRDBã½ããã¨ãã¦æ±ããç°¡åãªSQLit
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}