Better HN
topnewbestaskshowjobs
Log inSign up

djcb

118 karma · joined Apr 12, 2011 (15y ago) · 29 submissions

Submissions

comment 8y ago · link · parent

mu/mu4e author here... please let me know if you have any specific questions.

comment 9y ago · link · parent

One big item is that that Emacs' internal string/buffer representation supports things like loading weirdly (or even erroneously) encoded data, and saving this unchanged; this is sometimes quite useful.

Guile's strings (gnulib's) do not support that, and adding the support is quite a bit of works for all the corner-cases that emacs supports.

Now, emacs and guile do not necessarily have to use the same underlying string/buffer implementation, but it would definitely be a big plus, and I wouldn't be surprised the emacs maintainers would require it.

comment 10y ago · link · parent

(mu4e author here)

Mu4e has a few different options for displaying rich-text messages. In recent emacsen, it defaults to a shr/eww based display; it's not perfect, but it reduces the set of problem cases.

For those, there are the view-in-browser action, and with (as of yet unreleased) emacs-25 you can use a webkit-based display embedded in emacs.

With those, I'm able to view just about any message; even the ones I get from airlines etc., which tend to be html-only.

Anyway - to get back to the top-level subject: congratulations to mutt, which is a great e-mail client, and a big influence on mu/mu4e.

comment 10y ago · link · parent

In the same spirit, I wrote some functionally-flavored extensions for GLib a few months back. https://github.com/djcb/gxlib, taking a bit of inspiration from Rust and SRFI-1.

It's fun to get some of the functional flavor, while still being very near the bare pointers.

comment 10y ago · link · parent

While they weren't card-carrying ornithologists, the Wright brothers studied bird flight extensively and explicitly used it for their designs.

But they concluded that the flapping motion wasn't essential for propulsion, and could more easily be achieved by a propeller.

comment 11y ago · link · parent

There are also gdb and make, which are probably a bit more prominent examples of guile-integration. Perhaps one day, emacs will do so as well.

I've embedded Guile into some of my own projects, and it's a great and fun way to bring a bit of life in "dead" compiled code. Many more projects would benefit from this.

comment 11y ago · link · parent

And, for completeness, Chong Yidong, how co-maintained together with Stefan for quite a while (and did a great job as well). I think both of them were quite a big part of the "emacs renaissance" of the last few years.

http://emacs-fu.blogspot.fi/2009/08/interview-with-chong-yid...

comment 12y ago · link · parent

Agreed -- I remember some of the alternative ways to solve the same problems, such as CORBA and various custom protocols, but they were painful to use...

Now, early DBus was a bit lacking in that respect as well, but with GDBus (GLib's DBus implementation) it's become as straightforward as IPC can be, even in plain C; I've seen quite a few people new to the technology that were able to get up to speed with it quickly.

It'll be interesting to see how people are taking DBus and pushing the boundaries of what it can be used for, such as kdbus.

Thank you hp!

comment 12y ago · link · parent

Had a lot of (slightly masochistic) fun programming the Z80 back in the day on my MSX2 machine.

I didn't have an assembler, so I wrote my code by taking the opcodes from a table, calculating offsets etc., then turning them into DATA-lines in an MSX-Basic program, which POKEd the code into RAM, then CALL into the starting address.

comment 13y ago · link · parent

It's the difference between understanding and copy-pasting.

comment 14y ago · link · parent

Could you elaborate on the 'horrible design'? In general, I've found GLib very useful (say, the data structures, mainloops, GError, the G_GNUC_ stuff, ...) . If the biggest problem is some typedef that you can happily ignore, it can't be that bad, or?

GObject is a bit different matter - there's quite a bit of boilerplate, which makes me think twice before adding one. But at the same time, it's quite nice to use them in libraries like GStreamer.

GLib is certainly not perfect, but I found it more pleasant to use than, say, talloc. Are there any specific advantage is APR? (I've never used it) Does it cover the same functionality?

comment 14y ago · link · parent

There can be only one database (index) per mu4e/emacs instance, but you can store multiple maildirs in one database though, and there's support for multiple accounts (esp. in the upcoming 0.99; there are some recent ML-threads about this).

comment 14y ago · link · parent

I wrote an emacs-based e-mail client "mu4e"; see e.g. http://emacs-fu.blogspot.fi/2012/08/introducing-mu4e-for-ema...

Its user-interface is a bit mutt-influenced, but it's fully query-based and very fast, and of course you can extend it using elisp. A fairly young project, but it's near-fully documented, and the manual has instructions on how to set things up with Gmail.

comment 14y ago · link · parent

I've been using zsh for a decade or so, and I like it quite a lot. For basic things, it works enough like bash to hardly notice it; but slowly I've learned all the special tricks.

Now, I would recommend against using /oh-my-zsh/ and the like wholesale; just add useful things to your zsh setup step-by-step, where you actually understand each step.

Otherwise you're just importing a blob of magic that can interact with other things in weird ways. /oh-my-zsh/ contains a lot of gems, but take them one by one.

comment 14y ago · link · parent

Hmmm, is this HN worthy? These commands are so basic that I don't expect any HN-reader using Unix systems not to know those.

What about some slightly less basic ones that I'd think would be useful for many people.

  # less with syntax highlighting
  alias less="/usr/share/vim/vimcurrent/macros/less.sh"
  
  tailf # tail -f, but better & shorter

  mtr # check your connection (ie., traceroute with more info)

  htop # nice a colorful process listing (better than top)

  locate # search files by name -- that late-night disk thrashing is useful after all!

comment 14y ago · link · parent

for the somewhat-graphically-inclined, gdb mode in emacs has the much under-advertized 'M-x gdb-many-windows' which shows your stack, local variables, breakpoints etc. in separate 'windows'.

comment 14y ago · link · parent

  alias myip="dig +short myip.opendns.com @resolver1.opendns.com"

  alias myip2="curl -s icanhazip.com"

comment 14y ago · link · parent

Eh? I have been using org-mode for years for calendaring, smart todo-lists and what not -- with all the things like deadlines, schedules, repeated items, tags, priorities etc. etc.

comment 14y ago · link · parent

Guile is nice embeddable scheme, and seems to have a lot of momentum, cool new developments. If this project is about making it a bit easier to integrate it in your app, that would be great. It's not /too/ hard to embed guile, but I certainly think there's room for making it easier.

comment 14y ago · link · parent

Teaching students about being careful about sources -- online or not -- is good of course. But he should just have shared a paper about or something like that.

I agree with Wales; deliberately putting untruths on Wikipedia is really anti-social behavior. Wikipedia, however imperfect, is a really great asset -- people using it for their own little experiments like this is really doing everyone a great disservice, and I can only imagine how many others he has inspired to do similar things.

comment 14y ago · link · parent

There's the 'pmccabe' tool, which can check for # of lines of functions and their cyclomatic complexity.

Then,

  pmccabe `find . -name '*.c'` | sort -nr | awk '($1 > 10)'
gives me all functions that have a cyclomatic complexity over 10; I often add it as a target in a Makefile, so I can easily check this. Similar, for functions of a certain length.

comment 14y ago · link · parent

"Outliers"? Malcolm Gladwell is an entertaining writer, but I really wouldn't take it too serious... extrapolating way too much, and then reaching faux-unexpected conclusions that resonate nicely with what people like to believe.

comment 14y ago · link · parent

There are some systems based on the Xapian full-text indexer, including my own 'mu'[1] which might be able to do this. It expects the messages in a Maildir, and it can handle > 150 messages per sec, on fairly slow hardware - so after a peak of thousands of new messages, it would take a few seconds to catch up. Tens-of-thousands per day would be no problem. There have been people using [1] for a few million of messages without any problem, but I'm not sure how well it scales beyond that.

[1] http://www.djcbsoftware.nl/code/mu, or 'maildir-utils' in debian/ubuntu

comment 14y ago · link · parent

similarly, the 'approaches' pseudo-operator:

while (i --> 0) { /* do something */ }

comment 15y ago · link · parent

I wrote 'mu' (http://www.djcbsoftware.nl/code/mu), which let's you index/search maildirs; I'm currently adding glue to use it as an emacs-based e-mail client as well (basically, something between wanderlust and notmuch).

Anyway, to get back on-topic, as an alternative way to analyse your mails, I've added guile (scheme) bindings, and it's pretty easy to get all kinds of interesting statistics from your mails -- see https://gitorious.org/mu/mu/blobs/master/toys/muile/README

comment 15y ago · link · parent

I think the first step is to leverage Guile as a 'better elisp interpreter'. A lot of progress has been made in that direction, lately. Now, if it will ever replace the existing elisp interpreter depends on a lot of things, technical and non-technical. Guile could (potentially) be significantly faster, and stuff like threads, FFI may be nice as well. Anyway, I wouldn't hold my breath :)

comment 15y ago · link · parent

Hmm, I usually use guile[1] + geiser[2] in emacs, which works quite well for me. There's even an info-version[3] of SICP, so all the fun can happen within emacs.

[1] http://www.gnu.org/s/guile/ [2] https://savannah.nongnu.org/projects/geiser/ [3] http://www.neilvandyke.org/sicp-texi/

comment 15y ago · link · parent

Fish-like syntax highlighting for zsh: https://github.com/nicoulaj/zsh-syntax-highlighting