hit counter

Timeline

My development logbook

Compile Debug_info

After coming this SO question about (debug_info)[http://stackoverflow.com/questions/6830271/requesting-debug-info-in-an-erlang-module-using-compile], I am curious if it is indeed a problem.

Based on the (documentation)[http://www.erlang.org/doc/man/compile.html#debug_info], this should enable the addition of debug info to the .beam files.

1
2
-module(testdebuginfo).
-compile(debug_info).

However neither using c in erlang shell or using erlc directly will put the debug info into beam file.

I can only implant debug info through erlang shell like this:

1
2
3
4
5
6
7
4> debugger:start().

=ERROR REPORT==== 23-Jan-2014::12:23:39 ===
ERROR: Could not find 'wxe_driver.so' in: /usr/local/Cellar/erlang/R16B03/lib/erlang/lib/wx-1.1.1/priv
{ok,<0.49.0>}
5> c(testdebuginfo, [debug_info]).
{ok,testdebuginfo}

Using Automator in OSX

I want to implement a service in OSX such that I can easily shrink the size of image files in a folder to half of their original size.

This is what I have come up with at the end.

Lessons/Observations:

  • For non-standard action (e.g. copy files to a folder which is unknown at the workflow design time), I need to add an action to assign input value to a variable and then refer to it in subsequent task.

  • A lot of useful actions are already built in e.g. Scale image

  • Saving it to the default automator folder will automatically register the service to Finder.

Resize Images in a Stackoverflow Post

Markdown does not allow us to specify the size of an link image.

To get around this restriction it is what I did:

1. Upload an image as usual

Stackoverflow will add these lines to your post:

1
2
3
4
![enter image description here][1]


  [1]: http://i.stack.imgur.com/jxBxR.png

2. Change the above to an image tag

1
<img src="http://i.stack.imgur.com/jxBxR.png" width="100" height="100">

Done

Firefox Build Failure on Osx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0:12.72 configure:19592:10: fatal error: 'linux/ethtool.h' file not found
 0:12.72 #include <linux/ethtool.h>
 0:12.72          ^
 0:12.72 1 error generated.
 0:12.72 configure: failed program was:
 0:12.72 #line 19591 "configure"
 0:12.72 #include "confdefs.h"
 0:12.72 #include <linux/ethtool.h>
 0:12.73 int main() {
 0:12.73  struct ethtool_cmd cmd; cmd.speed_hi = 0;
 0:12.73 ; return 0; }
 0:12.73 configure:19790: checking __attribute__ ((aligned ())) support
 0:12.73 configure:19807: /usr/bin/clang -c  -std=gnu99 -fno-strict-aliasing -fno-math-errno -pthread -DNO_X11 -Werror -Qunused-arguments  conftest.c 1>&5
 0:12.73 configure: error: yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.
 0:12.73 *** Fix above errors and then restart with               "/Applications/Xcode.app/Contents/Developer/usr/bin/make -f client.mk build"
 0:12.73 make[2]: *** [configure] Error 1
 0:12.73 make[1]: *** [obj-x86_64-apple-darwin13.0.2/Makefile] Error 2
 0:12.73 make: *** [build] Error 2

Basically installing yasm fixes this problem. The ‘linux/ethtool.h’ fatal error seems to be irrevelant.

Here some build statistic (mach resource-usage):

1
2
3
4
5
6
7
8
Wall Time (s)   1230.61
Start Date  2014-01-09T10:24:38.582Z
End Date    2014-01-09T10:45:09.191Z
CPU %   93.85
Write Bytes 4659960320
Read Bytes  1421654016
Write Time  1749179
Read Time   509074