0%

有很多的甜点看上去好像很难, 但是实际操作起来确实很简单的. 焦糖布蕾就是其中之一.

材料:

  • 蛋黄: 4个

  • 奶油(heavy cream): 250ml

  • 牛奶: 120ml

  • 糖粉: 30g *

  • 香草味香精( valinna extract): 1 drop

  • 朗姆酒: 1 Tablespoon

做法

  1. 将奶油,牛奶,糖粉混合入一个碗中, 加入一滴的香草香精
  2. 轻轻地打散蛋黄, 一定要小心不要打出过多的气泡
  3. 把蛋黄液倒入牛奶混合液, 并慢慢搅拌均匀
  4. 选择性加入朗姆酒. 其实加入朗姆酒之后, 布蕾会更有风味.
  5. 将最终的混合液过筛. 这样可以保证布蕾的内部没有蛋白凝结, 口感也会更加顺滑.
  6. 烤箱预热 350℉, 蛋奶液倒入小碗中, 盖上锡纸. 放入烤盘中
  7. 烤盘中倒入1cm的水. 烤大约35分钟.
  8. 取出冷置10分钟后, 放入冰箱. 等你想吃的时候拿出来就好啦~
  9. 最后是上焦糖层. 取一小勺的黄糖, 均匀的撒一层在布丁表面. 然后用喷枪烤到略微的焦糖色就可以啦.

Note:

  1. 在网上找的很多方子是使用砂糖, 而我在这个方子里面选择了使用糖粉. 相较于砂糖, 糖粉会更加细腻一点, 所以会更容易溶解于奶液. 如果使用砂糖的话, 可能需要稍微加热奶油,牛奶和砂糖, 才让砂糖完全溶解. 使用糖粉会更简单一些.

  2. 添加朗姆酒. 添加一点点的酒的味道会让布丁味道会更有层次. 所谓的更有层次, 就是当原来的味道与口感过于单一的情况下, 通过添加其他的味道以平衡味蕾. 比如说, 在这个焦糖布蕾中, 奶油比鸡蛋牛奶的比例高出太多导致布丁会突出奶油的腻. 朗姆酒中, 酒精的辛辣可以缓解奶油的腻. 而朗姆酒本身则是由蔗糖酿制而成, 在酒类中本就是属于比较甜的类别. 这就不会和布丁本身的甜味冲突. 以此类推, 甜味酒, 比如百利甜酒, Dutch Chololate 这类的酒都可以选择性的添加.

嘿嘿嘿~. 这个部分回头再补. 啦啦啦~. ♪(^∇^*)

材料:

  • 蛋白: 3个 ≈ 9 Tablespoons ≈ 4 oz

  • 糖粉: 150g

  • 砂糖: 75g

  • 杏仁粉: 120g

外壳做法:

  1. 混合杏仁粉和糖粉, 过筛. ( 赞一个whole food买的杏仁粉, 细腻, 几乎不会留下渣渣)

  2. 将蛋清打发至湿性发泡, 中间分2-3次加入砂糖.

  3. 加入色素, 打发至干性发泡.

  4. 将混合粉分两次加入到蛋白中, 翻拌均匀.

  5. 将面糊倒入到裱花袋中, 选择1cm的圆形裱花嘴.

  6. 将面糊在硅胶垫上挤出均匀的小圆型

  7. 在室温下风干约 30分钟. (室内空调温度稳定 75℉), 以手轻轻触碰不黏手为标准

  8. 烤箱预热 280℉, 下层烤架, 烤15分钟

  9. 烤好的马卡龙取出, 冷却至少20分钟.

内陷做法:

嘿嘿嘿, 偷懒直接用草莓慕斯的慕斯部分使用. 不过, 当放置在室温过久, 慕斯部分就会软化. 这个比较适合冷藏后, 取出30分钟内食用.

魔性内陷做法:

Mayonnaise

Takosan给的一个思路.uh… 她在我的冰箱里面看到了 Mayonnaise, 然后.. 魔性的Mayonnaise马卡龙就诞生了.. 请小心食用.

番外

其实上面的马卡龙的做法看上去是蛮简单的, 但是充满了各种坑呀!!!!

每一次做马卡龙都是跑随时会run time error的代码, 你不知道什么时候就会崩溃, 木有debugger, 只能靠事后查log, 写总结.

常见的几种问题:

  1. 表面开裂
  2. 整体变形
  3. 马卡龙整体太脆, 饼干状
  4. 黏底
  5. 空心~

呵呵哒~… 回头各种实验笔记, po出来.. 怎么可能一个post能写得完呢.. 起码要连载了呀.

Why is NFS and TFTP?

In embedded development, we have to build and flash system image very often. There is a convinient way to flash and switch different kernel and root filesystem. We can utilize Network File System(NFS) to do this. In general, NFS host multiple rootfs in a centeral server, distrubuted embedded devices can launch rootfs through internet. In 1000Mb LAN enviroment, modify and distrubute kernel and rootfs will extremely easy. High Speed internet only give a very small latency.

So In my case, the idea is R board’s U-Boot has TFTP client, bootscript use TFTP boot and trivial uImage and device tree file, then Mount rootfs from NSF server to boot up R board.

In this case, cross-compiled application just need to build and deploy on the host machine, and run on R board device.

Setup TFTP

1
2
sudo apt-get install tftpd-hpa
sudo vim /etc/rc.local

the rc.local should looks like

1
2
3
4
# By default this script does nothing.
service tftpd-hpa start

exit 0

then run

1
sudo service tftpd-hpa restart

edit tftp configuration file: /etc/default/tftpd-hpa if /srv/tftp/lager is the correct TFTP path, uImage-lager.bin and dtb file should located at here

1
2
3
4
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp/lager"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="--secure"

to utilize the benefit from NFS, we can have multiple bootloader and root filesystem. Following is the idea TFTP folder structure looks like.

1
2
3
4
5
6
7
/svr/tftp/					// TFTP service directory
lager/ // lager from robert repo
uImage-lager.bin
uImage-r8a7790-lager.dtb
vs_lager/ // lager from vs repo
uImage-lager.bin
uImage-r8a7790-lager.dtb

To make sure /srv/tftp should be owned by nobody:nogroup

1
sudo chown -R nobody:nogroup /srv/tftp/

setup xinet

  1. install xinetd package
    sudo apt-get install xinetd

  2. configure /etc/xinetd.d/tftp After configuration, it should looks like following

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    serivce tftp
    {
    protocol = udp
    port = 69
    socket_type = dgram
    wait = yes
    user = nobody
    server = /usr/sbin/in.tftpd
    server_args =/srv/tftp/lager
    disable = no
    }
  3. restart the xinetd and tftp service
    1
    2
    sudo service xinetd restart
    sudo service tftpd-hpa restart

    Setup the NFS

the ideal nfs directories should looks like following structure

1
2
3
/svr/nfsroot/			// nfs service directory
res/ // lager from robert repo
vs_res/ // lager from vs repo

make corresponding directories.

  1. Install NFS service, and run nfs service
    1
    2
    sudo apt-get install nfs-kernel-server
    sudo service nfs-kernel-server restart
  2. Edit exports file:
    sudo vim /etc/exports
    add following line in the /etc/exports
    1
    2
    /srv/nfsroot 192.168.23.0/24(rw,sync,no_root_squash)
    /srv/nfsroot/res *(rw, no_subtree_check,sync,no_root_squash,no_all_squash)
    This edit will give access permission for corresponding folder.

Export the NFS directories

sudo service nfs-kernel-server restart

Once you see following message

1
2
3
4
* Stopping NFS kernel daemon                                                  [ OK ]
* Unexporting directories for NFS kernel daemon... [ OK ]
* Exporting directories for NFS kernel daemon... [ OK ]
* Starting NFS kernel daemon ... [ OK ]

Then NFS service is running.

离职总结

这两周就要离开PASA了. 一直在写文档,争取在离开前把所有的工作都处理清楚,好交接给同事. 其实也应该好好写一下关于个人的总结啦.

从2013年9月算起, 不知不觉我来这个team也快将近2年半了. 在Panasonic,一共四个学期的intern和一年的fulltime经历让我学到的很多的东西. 由于team比较特殊的关系, 最开始的两个学期有mentor手把手的教我写code. 从Build system, toolchain, IDE, git, code style到向我展现了Open Source Software Engineer的世界. Danylov教会了我很多基础的东西,特别是Engineering方向的知识, 最重要的是他教会了学习的方向和学习方法. How to Google the question you want to ask. LOL. 至此,我成为了一个合格的StackOverflow Engineer.

在过去一年, jin, 我和andrii一起完成了一个application. 从design, architect, 到implementation的整个环节, 全程参与的感觉还是不错哒. 由于andrii是contractor的关系, 我也发现了如果仅仅是码农会有多郁闷. 对于整个项目, 基本上是没有任何的权利的. 代码写完了, 产品就不属于你了. 资深码农可以对构架,design提出意见建议,但是也仅仅是意见而已. 是否接受则取决于对方. 有些时候, andrii明明有很好的设计, 却由于其他人看不懂这种设计的优点,或者只是觉得没有必要, 就被否决了. 果然是contractor没有人权. 呵呵哒. 不过对于我这样新手, 有了更大的自由度, 不停地问问题, 在过去一年所有不懂得内容都有andrii给我讲解回答. 这样的机会在未来的工作中估计是不会有啦. 就在这样的边学边写的过程中, 对于整个program的构架, design的深入了解让我在后来interview的过程中受益良多.

在Full time期间, 还参加了几次的intern interview和带了一个intern. 从intern成长到mentor, 身份的转换还是让我学到了不少新的东西. 我从intern身上看到了自己的影子. 现在再认真思考还是会发现原来自己犯过这么多的基础错误. 很多东西真的不从mentor的角度观察, 很难理解和想到合适的解决方式. 特别是作为mentor, 对于intern的期望值其实并没有那么高. Make things done就足够让人印象深刻. 如果有更精确的schedule and plan, 然后按照你的计划完成或者及时汇报进度, 这样的素质就足够让我愿意和你一起工作了. 想想也是, 作为manager, 主要的工作就是做计划,然后执行计划. 一个好的手下不就是能帮老板把他的问题解决了么. 不论你干的再好还是再烂, 对于manager而言, 都必须在他的计划之内的, 才算是他的accomplishment. 这个也算是职场心得吧.

John的return offer给了我比其他人更好的待遇, 在他的计划里面, 也给我很大的发展空间. 不错的工资, 愿意为我争取更多的bonus和title, 可以预见的升职空间和计划, 以及人格魅力, 他是我见过的最棒的老板. 如果不是为了去西雅图, 我还是很愿意在John的手下继续做下去的.

最后, 虽然他们看不到, 还是超级感谢老板同事在过去这两年来的照顾, 让我在程序员生涯有了一个还不错的开始. Well.. 下一站, Microsoft. 还是蛮期待的.

I implemented the logger 2 months ago. I know I should review and summarize it. Here is place holder now, so I won’t forget about this post. Hope I will finish it by next week.

Why I need a logger?

This is a review for the logger implementation. At the beginning, I want to log my program to see see heartbeat in every 0.5 sec, and track its performance. It is the first logger at AirLogger. It is very straightforward: Open a file, start to write string, and until I close it. Honestly, I wrote a terrible logger class.

[x] Singleton Pattern. It’s barely a good singleton design.
[x] Log level. I defined 5 log levels to provide different depth message
[x] Macro function wrapper. Use macro to wrap logger function itself
[ ] Thread-safe
[ ] I/O control Just Open and leave it there, thank I remember to close it before it ends This bad File IO slow my program from 20fps camera capture reduce to 10fps.
[ ] precision timestamp. I used localtime() routine, but it is in second.
Appropriate message format.

After a few weeks, I need a real logger at my work. It is not just heart beat, but also write different level info into files. It should has a very high precision timestamp in millisecond, even nano second level. I want to extract data from each video frame and write into file with this utility. The video is about 30fps or 60 maybe, 1080p. I need to record the timestamp of each frame. If it is real-time camera. The timestamp should be the clock epoch, in microseconds or nanosecond precision. For future work, I want this tool can measure the time elapse for a code block. On my understanding, I will identify a block of code that highly hog the CPU and could processed at GPGPU or DSP. After modify this code block, use CUDA/OpenCL to make code in parallel programming. then we can compare what is different between them.

What I changed

So consider others implementation, here is something I improved on my logger class.

  1. Move getInstance to header, and keep header as clean as possible.
  2. disable copy constructor and assignment operators
    1
    2
    3
    4
    MetaLogger(MetaLogger const&) = delete;
    MetaLogger(MetaLogger&&) = delete;
    MetaLogger& operator=(MetaLogger const&) = delete;
    MetaLogger& operator=(MetaLogger &&) = delete;
  3. Use enum to define Logger Level instead of a type struct
  4. Instead of use a log() and switch condition for different level. Make each level log method as deprecated method. And try to use parameter format list to format message. Like this:
    1
    std::string error(const char* fat, ...)
  5. Make default destructor as protected
    1
    2
    protected:
    ~MetaLogger() = default
  6. each error() or info() only provide the ostream, and use another write(msg) to format the final message.
  7. Corresponding to last one, make logger I/O as another class. metaLogger only format log message, but call another fileLogger to handle Output stream.
  8. Use constant size buffer
    1
    static const int MAX_BUFF 512
  9. Use a mutex lock to access the text buffer
  10. Use a better macro wrap to delegate my write function
    1
    2
    #define LOG_ERROR_(fmt, ...) \
    m_logger_error("0x%08x](%s:%s:%d)" fat, std::this_thread::get_id(), FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__)
  11. use va_list, va_start to delegate the debugging message.
  12. Multi-threading. The original implementation REALLY slow everything down. However, even with multi-threading, I can’t write this message into file very time it calls. Another thread-safe queue.

Key Components

  • Singleton
  • Threading
  • Tread-safe queue

Thanks for the following reference:
Logging In C++
Logger in Java
log4cpp
Design Patterns: Elements of Reusable Object-Oriented Software