Updated Oct 16: After testing my code on different machines, I found that disk/io performed varyingly, for some very large files, reading file in parallel may cause longer elapsed time (typically on non-server machine, which is not equipped for fast disk/io). So, I added another version tbray4b.erl ...
Playing with Tim's Erlang Exercise is so much fun.
I've been coding in Erlang about 6 months as a newbie, in most cases, I do parsing on string (or list what ever) with no need of regular expressions, since Erlang's pattern match can usaully solve most problems straightforward.
Tim's log file is al ...
My first solution for Tim's exercise tried to read file in parallel, but I just realized by reading file module's source code, that file:open(FileName, Options) will return a process instead of IO device. Well, this means a lot:
It's a process, so, when you request more data on it, you actually se ...
Updated Oct 09: Added more benchmark results under linux on other machines.
Updated Oct 07: More concise code.
Updated Oct 06: Fixed bugs: 1. Match "GET /ongoing/When/" instead of "/ongoing/When/"; 2. split_on_last_newline should not reverse Tail.
Backed from a short vacation, and sit down in fron ...
Updated Oct 10: pread_file/5 should open a new FIle process each cycle
Updated Oct 05: Wrote a new version, which is more parallelized-likeness.
Updated Sep 27: Per Gustafsson gave a better solution, it took 5.155 seconds on my computer, with all record maching tasks done. And, get all lines ready ...
Updated Aug 16: Fix bugs when json is an array. Add a 'json:root' element always since valid xml should have a root. Remove 'obj' tag that is not necessary.
Updated Aug 15: A more complete json_parser.erl. Thanks for tonyg's beautiful work, fixed some bugs.
Updated Aug 5: rewrote json_parser.erl bas ...
The migrating from Rails to Erlyweb of our project is going to be finished. I got more experience on how to deal with Erlyweb. First, the project management can be more straightforward. Here is it:
2. Manage project - Reloaded
Erlyweb provides erlyweb:compile(App, ..) to compile the source files un ...
Updated Aug 23: Please see From Rails to Erlyweb - Part II Manage Project - Reloaded
Updated July 15: store the database configuration in <opaque> session of yaws.conf
Updated May 2: erlweb:compile(AppDir::string(), Options::[option()]) has option: {auto_compile, Val}, where Val is 'true', or ...
You should have read Yariv's recless blog, a nice blog talking about how to make record accessing simple.
Recless is a static type inferring record parse transform, that means, as described in Yariv's blog:
one main restriction in Recless’s type inference algorithm: function parameters must indicat ...
2007-08-20
A Simple XML State Machine Accepting SAX Events to Build xmerl Compitable XML Tree: icalendar demo
xmerl is a full XML functionality in Erlang, with a lot of features like XPATH, XSLT, event_function, acc_function etc. Well, now I just want to get icalendar to be parsed to form of xmerl tree, which will contain #xmlElement, #xmlAttribute, #xmlText etc, and easily to apply XPATH on it.
How about a ...
Per previous blogs:
A Simple XML State Machine Accepting SAX Events to Build xmerl Compitable XML Tree: icalendar demo
Parse JSON to xmerl Compitable XML Tree via A Simple XML State Machine
I wrote a simple xml state machine that receives SAX events to build xmerl compitable XML tree. This time, ...
I'm pleased to announce ErlyBird 0.12.0, an Erlang IDE based on NetBeans.
This is a bug-fix, performance improvement release. This release will only provide all-in-one IDE package,
which is in size of 15.9M.
Java JRE 5.0+ is requested.
To download, please go to:
http://sourceforge.net/project ...
Updated July 20 2007: new params.erl which uses dict to store params and converts to proper type(integer/float/string)
It's time to migrate our project from Rails to Erlyweb (It cost me one month to write an Erlang IDE before this happens :-)). I'll blog some tips of the procedure, focus on the dif ...
3. The Magic Behind Erlyweb
With dynamic typing, hot code swapping, built-in parsing and compilation tools, Erlang is also suitable for dynamic meta-programming. Erlyweb uses a small convenient tool smerl
to generate db record CRUD code automatically.
The music example on erlyweb.org shows the mag ...
According to [erlang-bugs] xmerl and standard HTML entity refs, currently xmerl_scan only recognizes the very limited set of entity references. In brief, if you try to xmerl:scan xml text that includes standard HTML entity refs, such as nbsp, iexcl, pound, frac14, etc. you'll encounter something li ...
IV. Support Mysql Spatial Extensions via erlydb_mysql
ErlyDB supports most database operations, and it can also be extended to support more complex operations. Here is an example, where I need to support Mysql spatial extensions.
Assume we have a table: places, which has a mysql point field: locatio ...
I've updated "From Rails to Erlyweb" Part I and Part II. What's new?
The database configuration is now stroed in opaque part of yaws.conf
A new params.erl which uses dict to store params and converts to proper type(integer/float/string)
- 浏览: 133100 次

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
ErlyBird 0.16.0 Released
Others->Erlang...
-- by dcaoyuan -
ErlyBird 0.16.0 Released
为什么我在NB内导入完成后,在New Project里面无法看到 create ...
-- by fatdong -
新的Scala for NetBeans提 ...
因为NetBeans的几个基础模块在Trunk里有与6.1不兼容的的变化,所以现 ...
-- by dcaoyuan -
新的Scala for NetBeans提 ...
另外,dcaoyuan大叔有空时能否简单说一下为NetBeans开发某一门语言的 ...
-- by 自言200801 -
新的Scala for NetBeans提 ...
重新更新以后就装不起来啦,错误如下:====================== ...
-- by 自言200801






评论排行榜