My Hanukah present has so far been a success. My hope was that an eBook reader would get me to read more. Although I’ve tapered off a bit, since it arrived in December, I’ve finished three books:
I highly recommend all three, although Makers struck me a bit too much like a remake of Ayn Rand’s The Fountainhead.
I find myself wishing there were graphic novels available in eBook format.
A* in Clojure: Part Two -
January 24, 2010 by
pardsbane
Today, I decided to flush out and clean up my A* implementation in Clojure. I cleaned up the namespaces, removed some cruft, got the Java integration working (which required by-passing RT.loadResourceScript() since it seems to be broken), and moving my graph structure definition out of code and into a separate XML file (which is read and parsed directly in Clojure).
I’m still not sold on functional programming, these minor changes took me more hours than I care to admit and gave me a crazy headache, but that could just be because I’m unfamiliar with the language.
I also uploaded the code to GitHub, because I figured where’s the fun in learning a new algorithm in a new language without tossing in the risk of losing all your code to an silly mistake with an unfamiliar version control system?
Luckily no data was lost, and if you have any interest in Clojure, Clojure-Java integration, or A-Star search, check it out here:
http://github.com/jbcpollak/AStar-Clojure
My next steps are going to be more rigorous unit testing and perhaps some benchmarking. I’d like to see how this implementation does against a large graph.
The Problem
Frequently, say, one out of 10 times, when I try and log back into my Mac from the screensaver, or when I wake it from sleeping, I will get a spinning beachball and be unable to type my password. Other times I will be able to log in, but I am prompted to enter my password multiple times for various applications, and invariably one of them (usually gconsync) will get stuck after I enter my password with a spinning beach ball. I can still use most applications, but application that needs keychain authorization locks up.
I happen to be using a very handy tool called SSHKeychain, which turned out to be the culprit.
If you are using SSHKeychain, this post will walk you through fixing the unstable-wake-from-screensaver, and also solves the problem of having to type your keychain password 3-5 times when I returned to my computer.
read the entry »
If you are having trouble compiling Android on Snow Leopard, first make sure you’ve installed the Leopard 10.5 Java 1.5 SDK, according to these instructions.
Second, make sure you have the latest XCode installed, and make sure you have installed the optional 10.4 SDK. In my case, it appeared that the 10.4 sdk was installed, but it was either corrupt or out of date, resulting in many strange errors like the following:
Issue 993
(out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.jar)
Docs droiddoc: out/target/common/docs/framework
Could not load 'clearsilver-jni'
java.library.path = out/host/darwin-x86/lib
make: *** [out/target/common/docs/framework-timestamp] Error 45
Issue 5000
host C: emulator <= external/qemu/distrib/zlib-1.2.3/adler32.c
host C: emulator <= external/qemu/distrib/zlib-1.2.3/compress.c
host C: emulator <= external/qemu/distrib/zlib-1.2.3/crc32.c
host C: emulator <= external/qemu/distrib/zlib-1.2.3/deflate.c
host C: emulator <= external/qemu/distrib/zlib-1.2.3/gzio.c
In file included from external/qemu/distrib/zlib-1.2.3/gzio.c:601:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h:
No such file or directory
external/qemu/distrib/zlib-1.2.3/gzio.c: In function ‘gzprintf’:
external/qemu/distrib/zlib-1.2.3/gzio.c:610: warning: implicit declaration
of function ‘va_start’
external/qemu/distrib/zlib-1.2.3/gzio.c:628: warning: implicit declaration
of function ‘va_end’
So if these issues strike you, follow the directions to switch to Java 1.5, and reinstall XCode, then run:
make clean && make
In the android platform’s main directory.
Unfortunately, I’m still stuck with this build error I haven’t gotten past yet:
host Prebuilt: libSDL (out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a)
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_getenv.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_malloc.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_qsort.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_stdlib.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_audiodev.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_mixer_MMX.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_yuv_mmx.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_nullmouse.o) has no symbols
host Prebuilt: libSDLmain (out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDLmain_intermediates/libSDLmain.a)
host Executable: emulator (out/host/darwin-x86/obj/EXECUTABLES/emulator_intermediates/emulator)
Undefined symbols:
"_xml_builtin", referenced from:
_xml_builtin$non_lazy_ptr in gdbstub.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [out/host/darwin-x86/obj/EXECUTABLES/emulator_intermediates/emulator] Error 1
So if anyone has any tips on that, I’d appreciate it!
A-Star Search in Clojure -
October 16, 2009 by
pardsbane
I wanted to refresh my knowledge of functional programming, A-Star search, and I figured learning Clojure at the same time couldn’t hurt. I figured I’d do all three at once, and throw in a health dose of Maven and Java at the same time.
This project was intended to:
- Refresh myself on how to do functional programming
- Refresh my knowledge of A* search
- Help me learn Clojure
- Demonstrate Java interoperating with Clojure
- Demonstrate Maven as a viable build system for Clojure
Download The Demo Here
Once downloaded, unzip the zip file and open a terminal.
You now have three options:
Review the Source Code
The meat of the code is all in Clojure, here:
src/main/resources/com/example/clap/astar.clj
There is a bit of boot-strap Java code in the following file, but I can’t say its all that interesting:
src/main/java/com/example/clap/App.java
Running from Source
If you are on a Mac, or you already have Maven and Java installed, just run the following:
cd astar && mvn test
Maven will download all the needed packages and then compiled and execute the demo.
Running from Binary
If you are on Linux, or have cygwin installed on Windows, you can run the following:
cd astar/bin/ && ./run-astar
If you are finding mail sometimes not appearing in your Mail inbox after upgrading to Snow Leopard, but then it appears again once you restart Mail, try shutting off the ‘Use IDLE command’ option in account settings. (Its at the bottom of the advanced tab).
After upgrading to Snow Leopard on my Mac, I noticed this was happening with email in my Dreamhost IMAP account.
I’ve been running with the ‘IDLE’ option turned off for a day, and it seems to be working correctly again.
« old Posts