Tags related to tag emacs
Tuesday, November 27. 2007
With apologies to Shaftoe
This is my emacs. There are many like this one, but This emacs is mine.
Monday, July 9. 2007
New Selenemacs Packages
New Selenemacs packages are here:I fixed some of the more obvious and glaring bugs.
For now the Selenemacs main page will be Here. If/when there is more interest, I'll put up a proper SVN repository and a page on bunnywiki.
For now the Selenemacs main page will be Here. If/when there is more interest, I'll put up a proper SVN repository and a page on bunnywiki.
Monday, June 25. 2007
Automated Web Developer Tests using Selenium, Emacs, and MozRepl
One of the biggest hassles with web development is the lack of any real test harness. I have lamented about this before, especially when it comes to testing such ephemerals as an elements height, width, etc. So far the best tests I have run into are your two eyes, which is fine when you are working and testing on one discreet component... but web sites, especially the ones I work on, tend to be more then just 1 or two discreet components.
Enter Selenium IDE. The Selenium IDE provides you with a method to record and execute automated tests of your website. It is easy to use, and hella cool. It can test things like the existence of an element, the text contained inside of an element, its width, height, position, etc. Using selenium, you can build yourself unit tests. This is especially useful and powerful if you happen to be one of the unlucky bastards faced with writing code in JSTL, SMARTY, or some other templating-language-that-needs-to-die. Now you finally have unit tests.
Using Selenium, the testing process is a little more automated. More importantly, you can build a series of regression tests, to ensure the stability of your web application.
There is another piece of the web-development puzzle here, and that is the Moz Repl. An REPL is a Read Eval Print Loop, basically an interactive command interpreter that you can feed commands to, and experiment with. the Moz REPL is a javascript version, that lets you inspect and modify any Javascript object in the browser. This REPL is telnet enabled, in fact, there is even a way to make Emacs talk to this REPL, so you can poke around the browser from within your text editor. This is amazingly powerful in two regards:
So the final piece of the puzzle is something I call Selenemacs. It is a global emacs minor mode, in conjunction with some simple javascript that will script selenium, and provide you with feedback on whether or not its tests pass or fail.
Update 2007-07-09: new versions (Version 0.2) added
Here are the two files:
Here is how you use them:
First, download the MozREPL and Selenium IDE extensions for firefox
Edit selenemacs.el to make sure that the variable selenemacs-js-file points to selenemacs.js
Enable the MozRepl (Tools->MozLab->StartREPL)
Load up selenemacs.el inside emacs (load-file "path/to/selenemacs.el") works
Enable the minor mode selenemacs-minor-mode
Record your test in SeleniumIDE
Use the emacs command selenemacs-execute-test to launch the test, its shortcut is C-c C-s C-e
Emacs tells you if the test passed or failed.
The idea here is that you write your test, and stop using your eyes to test the results of your coding to the browser, but instead use Selenium. This is especially good if you are doing multi-stage and repetitive like testing logins, searches, etc. You can code and test right inside emacs, and only have to switch to the browser to verify that your tests actually passed.
These files also show an interesting way to script mozilla through emacs. The next step of course is to get emacs to start interacting with Firebug.
Enter Selenium IDE. The Selenium IDE provides you with a method to record and execute automated tests of your website. It is easy to use, and hella cool. It can test things like the existence of an element, the text contained inside of an element, its width, height, position, etc. Using selenium, you can build yourself unit tests. This is especially useful and powerful if you happen to be one of the unlucky bastards faced with writing code in JSTL, SMARTY, or some other templating-language-that-needs-to-die. Now you finally have unit tests.
Using Selenium, the testing process is a little more automated. More importantly, you can build a series of regression tests, to ensure the stability of your web application.
There is another piece of the web-development puzzle here, and that is the Moz Repl. An REPL is a Read Eval Print Loop, basically an interactive command interpreter that you can feed commands to, and experiment with. the Moz REPL is a javascript version, that lets you inspect and modify any Javascript object in the browser. This REPL is telnet enabled, in fact, there is even a way to make Emacs talk to this REPL, so you can poke around the browser from within your text editor. This is amazingly powerful in two regards:
- you can script your browser from emacs
- you can edit code inside emacs, and send it right to the javascript interpreter for testing, and evn install it on the current page
So the final piece of the puzzle is something I call Selenemacs. It is a global emacs minor mode, in conjunction with some simple javascript that will script selenium, and provide you with feedback on whether or not its tests pass or fail.
Update 2007-07-09: new versions (Version 0.2) added
Here are the two files:
Here is how you use them:
First, download the MozREPL and Selenium IDE extensions for firefox
Edit selenemacs.el to make sure that the variable selenemacs-js-file points to selenemacs.js
Enable the MozRepl (Tools->MozLab->StartREPL)
Load up selenemacs.el inside emacs (load-file "path/to/selenemacs.el") works
Enable the minor mode selenemacs-minor-mode
Record your test in SeleniumIDE
Use the emacs command selenemacs-execute-test to launch the test, its shortcut is C-c C-s C-e
Emacs tells you if the test passed or failed.
The idea here is that you write your test, and stop using your eyes to test the results of your coding to the browser, but instead use Selenium. This is especially good if you are doing multi-stage and repetitive like testing logins, searches, etc. You can code and test right inside emacs, and only have to switch to the browser to verify that your tests actually passed.
These files also show an interesting way to script mozilla through emacs. The next step of course is to get emacs to start interacting with Firebug.
Wednesday, June 13. 2007
Emacs and UTF-8 Encoding
Want to get UTF-8 (unicode) to work on Emacs but don't know where to start?
Snarf this, and toss it in your .emacs.
Snarf this, and toss it in your .emacs.
;;;;;;;;;;;;;;;;;;;; ;; set up unicode (prefer-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) ;; This from a japanese individual. I hope it works. (setq default-buffer-file-coding-system 'utf-8) ;; From Emacs wiki (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) ;; MS Windows clipboard is UTF-16LE (set-clipboard-coding-system 'utf-16le-dos)The part about the clipboard-coding-system is essential for MS windows users who want to transfer content back and forth between windows apps and Emacs.
Saturday, May 5. 2007
State of the Jonnay (part 1): Managment, Emacs and Japanese
It has been a long time since I last wrote an entry. There are 2 major forces at work here:
As part of being I have received a lappy by the evil masters, which is as good, if not better than both my desktop at work and at home. This is hella cool. This of course necessitates the re installation of the "software server stack of doom", code editor, utilities, productivity tools, etc. etc. etc. This is a perfect opportunity for me to make a jump that I have been fighting for a LONG time...
- I don't have enough time anymore to write entries
- I twitter stuff that makes good blog entries, because it takes far less time
Management
Management is posing to be an exciting, interesting and challenging—erm—challenge. I am slowly starting to get a handle of the job, the responsibilities, etc. The other seniors on the team have been a big help with this. I just keep plugging along and try to learn as much as I can from the people around me.As part of being I have received a lappy by the evil masters, which is as good, if not better than both my desktop at work and at home. This is hella cool. This of course necessitates the re installation of the "software server stack of doom", code editor, utilities, productivity tools, etc. etc. etc. This is a perfect opportunity for me to make a jump that I have been fighting for a LONG time...
Emacs
I started working with emacs last year, mostly to edit and work with scheme code. What this meant was that I would goto work, edit code in jEdit and then come home, and edit code in emacs. I am a relatively proficient editor-of-code with jEdit, but emacs has always felt really uncomfortable. But since I have to re-install everything anyway, I thought that this would be the perfect time to take the plunge and start using emacs for everything, work and personal projects. I found a relatively decent window distribution, so it is time to make a go of it. I've since found some cool tools, including a Javascript REPL for emacs, as well as instructions to connect Oracle to emacs. The crux here is that I am going to take a bit of a performance hit at work while I get ramped up on working with emacs, but this will also mean I have a good 4-12 hours (depending on my day) to spend on emacs. Basically its time to approach emacs by jumping right into it. Kind of like the best way to learn a whole new language...Japanese
Learning Japanese has been going well. I have a small selection of manga that I am slowly going through and reading. There is a lot that I miss, but there is a lot to pick up on as well, due to context. I am up into 500 kanji now, with only a 1-4% failure rate. It is really interesting to see a chunk of Japanese text and actually understand a little about what is trying to be communicated on. I still maintain that Japanese is going to be a long-term learning adventure of 10 years. Thank god for my PDA and flashcard software (twinkle), without it there would be no way I could even think about trying to learn this crazy wonderful language. Twinkle lets me define my own flashcards, and practice all of my Japanese wherever and whenever. Very handy for the commute to and from work.
(Page 1 of 1, totaling 5 entries)




