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
/* AOJ 0041 | |
* | |
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0041 | |
* | |
*/ | |
#include <stdio.h> | |
#include <assert.h> | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
int fact(int n){ | |
int r, i; | |
r = 1; | |
for(i=1;i<=n;i++){ | |
r *=i; | |
} |
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
/* AOJ 0043 | |
* | |
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0043 | |
* | |
*/ | |
#include <stdio.h> | |
#include <memory.h> | |
#include <assert.h> |
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
(defn place-blocks-in-circle | |
[world center inner outer place-fn] | |
; with fill. naive way. | |
(map | |
(fn [d] | |
(prn d); | |
;(place-fn d 0)) | |
d | |
) | |
(blocks-in-radiaus-xz world center inner outer) |
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
(defn blocks-in-radiaus-xz | |
[world center inner outer] | |
(let [center-block (.getBlockAt world center) | |
grided-cetner-location (.getLocation center-block) | |
grided-cetner-vector (.toVector grided-cetner-location) | |
ux (Vector. 1.0 0.0 0.0) | |
uy (Vector. 0.0 1.0 0.0) | |
uz (Vector. 0.0 0.0 1.0) | |
inner-diameter (* 2 (Math/floor inner)) | |
outer-diameter (* 2 (Math/ceil outer)) |
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
[nori@akagi]~/Desktop/work/cloft/cloft% git diff | |
diff --git a/src/cloft/core.clj b/src/cloft/core.clj | |
index c25f160..ca89272 100644 | |
--- a/src/cloft/core.clj | |
+++ b/src/cloft/core.clj | |
@@ -80,6 +80,12 @@ | |
(swap! cloft-schedule-table assoc wake-up | |
(cons f (@cloft-schedule-table wake-up [])))))) | |
+(defn cloft-schedule-while [f] |
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
18:09:51 [WARNING] Task of 'cloft' generated an exception | |
clojure.lang.ArityException: Wrong number of args (0) passed to: core$entity-shoot-bow-event$fn | |
at clojure.lang.AFn.throwArity(AFn.java:437) | |
at clojure.lang.AFn.invoke(AFn.java:35) | |
at cloft.core$cloft_schedule_while$fn__2108.invoke(core.clj:86) | |
at cloft.core$cloft_scheduler$fn__2111.invoke(core.clj:96) | |
at clojure.lang.AFn.call(AFn.java:18) | |
at clojure.lang.LockingTransaction.run(LockingTransaction.java:263) | |
at clojure.lang.LockingTransaction.runInTransaction(LockingTransaction.java:231) | |
at cloft.core$cloft_scheduler.invoke(core.clj:90) |
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
{ | |
u'blog': { | |
u'ask_anon': False, u'updated': 1340441846, u'description': u'', u'title': u"nori's tumblr", u'url': u'http://bgnori.tumblr.com/', u'posts': 59760, u'ask': True, u'name': u'bgnori'} | |
, u'total_posts': 59760, u'posts': [{ | |
u'highlighted': [], u'reblog_key': u'W2wZ6hBq', u'format': u'html', u'timestamp': 1340441846, u'note_count': 11, u'tags': [], u'photos': [{ | |
u'caption': u'', u'original_size': { | |
u'url': u'http://24.media.tumblr.com/tumblr_m624jokw981qz4evpo1_1280.jpg', u'width': 1280, u'height': 960} | |
, u'alt_sizes': [{ | |
u'url': u'http://24.media.tumblr.com/tumblr_m624jokw981qz4evpo1_1280.jpg', u'width': 1280, u'height': 960} | |
, { |
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 org.apache.http.client.methods.HttpGet | |
import org.apache.http.impl.client.DefaultHttpClient | |
import org.apache.http.HttpResponse | |
import org.apache.http.HttpStatus | |
package something { | |
object ika { | |
val client = new DefaultHttpClient | |
def do_post(u: String): Unit = { |
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
「あるプログラミング言語を一通り触る」という目標を達成するのに必要な課題の集合はなにか? | |
"Hellow World" | |
まずはこれ | |
標準出力、実行環境 | |
"fizzbuzz" | |
if文, mod |