OK guys, before I drive to bed let me show you something. I constructed a new lexer (almost from scratch) for the new LinkSnooper (code-name Pink Roselon) because highlighting packet traffic as normal Mathematica code makes no sense: All important information are hidden inside strings. Therefore, I basically made a two step lexer which, if it dives into a string, treats the string-content as Mathematica syntax as well (with some attention to escaped stuff). Using this, I can e.g.
4
mark string-content italic but keep the coloring. This makes reading the link traffic very nice..
Let me show you an example (note that this is done with console colors.. looks awful):
As you can see, with this symbols, numbers, strings and operators can be highlighted even when they are inside a string.
AND the jflex lexer seems to be awesomely fast. I finished coloring and writing of the whole traffic of my session, which is 14MB in 0.22 seconds.. I guess this will do it in live mode.
how do you people program, do you start in a notebook and then move things over to a proper package file in Workbench/Intellij/external editor? Do you start your code externally and use the notebook to test it out? something altogether different?
@wesen I've found that the first approach works well if you're building a package as you go along. For example, if it's the result of some research work or a collection of commonly used functions, then it'll probably originate in a notebook and then you move it to an IDE and clean it up to fit in the package. I find the second approach to be better when I have a clear picture of what a package is supposed to do, what the moving parts are, etc.
I code almost exclusively in IDEA/Vim, sketch out the skeleton, fill in the parts one by one, write tests and evaluate/debug in the notebook. The second approach also requires a level of comfort and familiarity with the core language, so might not be the best way to start out
@kirma I thought there was a Q on this earlier, but I didn't find it. I think it's a bug. The AxesOrigin is set to {0., 2.}, but the PlotRange is determined from the plot only (apparently). If you set AxesOrigin -> {0, 2} explicitly, then {0., 2.} is included in the computation of the PlotRange.
@kirma If you compare you're example with Plot[1/x, {x, 0, Pi/2}], which does show both axes, you will find that in both examples the PlotRange is determine from the plot. To that is added 5% padding in the vertical direction. In your example, the bottom axis is still excluded, but in my example, the bottom axis is included (barely).
yeah, so we have quite a similar flow. now that i'm starting to write substantial cde in my notebooks, I start copy pasting them into .m files, mostly utility functions / smaller explorations, but it's starting to shape up
(i'm doing the coursera algorithm courses, some algorthms in mathematica, some i just exercise over JLink/MLink which is really fun)
i think i will very soon start to make blog psots about it, and then you guys can tear me apart for non idiomatic mathematica code :}
although today is oging to be a day where I force myself to use more rules. I usually revert to functional programming very quickly.
@wesen Thanks. We still miss some important features. Profiling, debugging, documentation building and unit tests. Some of them will be hard to implement not only because I myself have to collect the knowledge (e.g. I never use profiling) about it but for the reason that we cannot use code licensed by Wolfram.
For the unit tests there is a solution since it is included in Mathematica 10 now. Documentation building, etc.. is something else.
It is not included in the normal Mathematica installation and to support it, I have to look how it is done in WB. If I use this (even if I rewrite it) and publish it for free, I guess I have a bunch of Wolfram bloodhounds in my neck. Not a good idea.