## Eclim: The power of Eclipse in your favorite editor

Eclim provides the ability to access Eclipse code editing features (code completion, searching, code validation, and many more) via the command line or a local network connection, allowing those features to be integrated with your favorite editor. Eclim provides an integration with Vim, but third party clients have been created to add eclim support to other editors as well (emacs, sublime text 2, textmate).

Via emacslife.

## Who ever got fired for compiling code?

Q. How do you fix a memory corruption in S-PLUS?
A. Use R.

The IBM AS/400 is an application-platform consisting of custom hardware, an operating system, and database. It is a quite interesting system giving you literally everything that you need to develop a custom computing environment for a company immediately “out of the box”.

Working to deploy a pretty typical Java based system with DB2 and WebSphere backing it up, my co-worker and I ran into a bug with the JVM. The issue revolved around the fact that the web-application layer utilized a byte-code engineering library that resulted in the revelation of a bug in the JVM itself. First level support explained that it was our bug so we provided a stand-alone example in straight Java and that got us to second level support.

They explained that they would look into it and that that we should watch for a release note in the next version of OS/400. This was getting kind of silly so our department wanted to cash-in in one of their immediate-support “get out of jail free cards” that you get when you spend hundreds-of-thousands-of-dollars per quarter for IBM support. That got us to third level support.

Upon reviewing the issue that we researched, tracked down the exact situation where the bug occurred, and demonstrated a reproducible example, they expertly agreed that there was indeed a bug in their JVM, that they would have it fixed for the next release six months from now, and thanks for letting them know.

One of the value-adds of purchasing something from IBM is that every C-level knows that you can’t get fired for buying IBM. Something that you can’t have done either apparently is computing Java! :P

## More Basic Setup

### Custom JESS REPL

If you want to use a custom JESS REPL with Emacs then set up a shell script
jsjs-repl like this:

#!/bin/bash
mvn --file /home/gcr/git/jess-sample-java-setup/jsjs/pom.xml compile -Pjess-repl


And then make this call in EMACS before calling run-jess:

(setq inferior-jess-program "/home/gcr/git/jess-sample-java-setup/jsjs/jsjs-repl")


### More Background

My background is custom software development in a consulting and stuff sup role. My work has been primarily in insurance, manufacturing, and the financial industries with clients ranging from large to small. Tech/training wise I studied mscs, computing, and computational sciences at MU; and have practiced software engineering at my day job for the past eleven years, and I mean practice, it is something I am constantly trying to get better at. Tech wise I am a pretty typical GNU/Linux & Windows person more or less, doing Java, .NET, Lisp, and recently Python.

A commonality among nearly every project I’ve worked on is the eventual occurrence of if statements 5-levels deep repeated across multiple call-sites (40+ typically) through no want/action/desire of my own. When I look at stuff like this, I feel like in addition to refactoring (regardless of the system type) there might be a better way. From what I’ve learned so far, rules engines seem like they might be a good fit.

Part of my goal here was to find a tool that not only provided a rules engine, but also helps the user to understand and debug what is happening, when, how, and why, with the intent that the developer implementing the rules can do it in a non-arcane manner and also share the behavior of the engine with business-related users to help them down the path of thinking in that manner.

### jess-mode Cheat Sheet

Before tackling the CLIPS literature I felt like I ought to ramp up on the key-bindings for jess-mode in EMACS. Here are some good ones, you will find that they are basically what you would expect in the grouping that I view them in order to help the development process:

Comprehension:

• \C-c,f ‘inf-jess-get-facts: Retrieve the fact list from the inferior Jess process.
• \C-c,r ‘inf-jess-get-rules: Retrieve the rule list from the inferior Jess process.
• \C-c,a ‘inf-jess-get-agenda: Retrieve the agenda from the inferior Jess process.
• \C-c,v ‘inf-jess-get-view: The view command displays a live snapshot of the Rete network in a graphical window. I added this one myself.

Management:

• \C-c,g ‘inf-jess-run-engine: Run the inference engine in the inferior Jess process.
• \C-c,i ‘inf-jess-reset-engine: Reset the inference engine running in the inferior Jess process.

Evaluation:

• \C-x\C-e ‘inf-jess-eval-last-sexp: Send the previous sexp to the inferior Jess process. Prefix argument means switch to the Jess buffer afterwards.
• \C-c,e ‘inf-jess-eval-region: Send the current region to the inferior Jess process. Prefix argument forces switch to Jess buffer afterwards.
• \C-c,b ‘inf-jess-eval-buffer: Send the entire buffer to the Inferior Jess process. Prefix argument means switch to the Jess buffer afterwards.
• \C-c,t ‘inf-jess-eval-deftemplate: Send the current deftemplate to the inferior Jess process. Prefix argument means switch to the Jess buffer afterwards.
• \M-\C-x ‘inf-jess-eval-deffunction: Send the current deffunction to the inferior Jess process. Prefix argument means switch to the Jess buffer afterwards.

I bound ‘inf-jess-val-buffer to , that is what I do for all lisp modes, but that is a personal preference thing.

To set the JESS interpreter command (make sure it is a shell scrip):

(setq inferior-jess-program "foo")

To start JESS in EMACS run:

run-jess

### CLIPS Notes

For fun I worked through the CLIPS 6.30 beta literature specifically the user’s guide and basic programming guide. These are so, so helpful; they are aimed and programmers who have never worked in an expert system before. It goes in a lot more depth what you may do in CLIPS, and consequently JESS, than JESS does.