SMTP Service Round-Up

Spending lunching time to look for a cheap and reiliable SMTP cloud service, I sum up this post so it may be helpful for others. To me, SES price is most reasonable, but you will have no support and implement the tracking yourself.

Service Cost to send 100k emails / month Additional Features / Remark
SMTP.com 130$ (using email delivery lite plan)
  • Email / Phone Support
  • Dedicated IP (with higher plan)
  • Anaytlcs / Tracking
ElasticMail 50$ (using provided calculator)
  • Analytics / Tracking
  • Lists & Email Template (somewhat like Mailchimp)
  • SMTP / REST
SendGrid 79.95$ (Silver Plan)
  • Email / Phone Support
  • Dedicated IP (with higher plan)
  • Anaytlcs / Tracking
CloudSMTP 50$ (0.5$ / 1k emails)
  • Analytics / Tracking
  • No visible document about API :(
Amazon SES 10.29$
(using AWS Calculator, assumed that email size is 20KB, sending 3333 emails / day, no free tier included)
  • SMTP / REST
  • No Tracking ??
Jango SMTP 250$  (plan up to 120k emails)
  • 100KB / email limit
  • Additional data can be purchased with 1$ / 10MB

 

Presentation: Strategic Process Integration

Finally, I managed to bring my presentation to the Internet. I have made a few presentations recently but never publish them :D , this is the first one

This presentation I made on Saturday with my group in Information Management subject. The topic is about integrating company Mission, Goals and Objectives into its Enterprise model(s). A guideline to define objectives for enterprise processes and activities, the benefits would be an objective-oriented enterprise and you can control the processes in a better manner. Any information or discussion is welcomed.

Symfony 2 Form Extension

Here is a way to allow you to extend Symfony 2 Form using tagged Service. I think it's the correct way but not yet documented on the book. Symfony 2 is still brand new and the document is not completed yet, I found out this solution while diving into Symfony Form component :(

Well, the code is quite simple. You need to create a service tagged with form.type_extension with alias value is the type of Form element you want to override. Then make the service inherits from Symfony\Component\Form\AbstractTypeExtension, implement the getExtendedType method to return the same value with alias and then override the buildForm method to do whatever you want with the Form. Here is an example to illustrate how to add more field to a form

services.yml

services:
  demo.form_extension:
    class: Demo\MyBundle\Form\Extension\MyFormExtension
    tags:
      - {name: form.type_extension, alias: form}

FormExtension.php

namespace Demo\MyBundle\Form\Extension;
 
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\AbstractTypeExtension;
 
class MyFormExtension extends AbstractTypeExtension
{
	public function buildForm(FormBuilder $builder, array $options)
	{
		// TODO: add some check for the form you want to use here
		$data = $options['data'];
 
		// extend the form here, you can also use custom validator
		$builder->add('new_item', 'text');
 
		$builder->addEventListener(FormEvents::POST_BIND, function($event) {
			$form = $event->getForm();
 
			// do whatever you want here, such as additional data binding
		});
	}
 
	public function getExtendedType()
	{
		return 'form';
	}
}

Note: Symfony 2 also has form.extension, you can use it to load form type or extension by PHP. Check Symfony/Component/Form/Extension/Csrf namespace for example.

[Paper] A proposal for a method to translate BPMN model into UML activity diagram

This is my final report for Business Process Management course. I have finished it quite a long time ago, and now I would like to post it to my blog. This report is about finding an aproach to automate the conversion from UML Activity diagram to BPMN model based on well-defined rules and context. The goal is to be able to synchronize BPMN models with business system.

I am quite new to this area so I am not completely sure that the information in the report is 100% correct. Most of the idea is from this report, I added my idea, add more translation rules and suggestion some further approach for the translation. This is my first formal english report that I did only on my own. I think it is somewhat a paper but not really sure if it satisfy the condition to be a paper, hehe. I hope it would be useful for someone.

Any suggestion, discussion or typo correction is always welcome ;)

AttachmentSize
BPMN-UMLAD.pdf277.65 KB

ChromeSniffer 0.2.9

I just released ChromeSniffer 0.2.9. This is a minor update for chromesniffer after few months. This release fix broken icons on linux, improve YUI, Wordpress, Moodle detection. The following applications are added to detection list:

This release is also the first release driven by community. Most of the commits are contributed by community. Many thanks to onlineamateur, kevtufc and nb.

There is no roadmap for 0.2.10 yet, but I am thinking about to extends ChromeSniffer to support to detect additional information of the site too, such as detect for site microfotmat or RDF. CSS framework will be considered too. The goal for chromesniffer will be a tool for developer to have an overview of the technology on the site. If you have any idea, feel free to send me your idea via the contact form.

php-rar extension on Ubuntu

Just a very quick post for new comers to Ubuntu who is looking for a way to install rar extension. RAR extension (should be php5-rar) is not available on Ubuntu official, apt-get install php5-rar won't work, not sure why. If you want to install it then you can use PECL from PEAR instead, as following:

$ sudo apt-get install php5-dev php-pear g++
$ sudo pecl install rar

Then you will need to edit php.ini to include rar.so, it should be placed somewhere in /etc/php5. You should be able to install any extension on PECL using pecl command too. But anyway, package from Ubuntu repository is recommended.

GameBoy Advance: Flying Mario (final)

Mario

I just finished my presentation today's afternoon about GBA  project, so this post will be the last post about my Gameboy Advance project. Not too much time pass by since the last post, so not much things were done too. I manage to get a lot of stuff done, but the whole game is not yet finished. There is no princess and no counter for the coins you collect. But anyway, it is a lot of work for a single developer like me. I share the source code of the project in case you need some references.

So the subject is over, I two weeks and a few days to clean up working mess and prepare for the next one.

Cheers,

AttachmentSize
FlyingMario_Final_Mar212011.zip520.39 KB

GameBoy Advance: Flying Mario

It turns out that it's an extremly busy week. Not mentioning about studying, I also have to help my friend to deploy his servers (18 total, woot!). I don't have time to blog about my Gameboy project.

It's quite fun and interesting. I have decided to write a game to demonstrated all the techniques in GBA. It's a simple game, Mario theme, you control Mario to flight through Mario world, earning coins and avoiding monsters. Here is what's going on so far:

There are still a lot of things to do. No background, no sound, no point, no life, even no goal for the game. Maybe after 5 mins, you will see the Princess and the game ends. I'm not really sure if I can handle all the stuff. But anyway, I will just do my best :D

Hello GameBoy Advance

This is a boring post while I am waiting for checking out the project and copying 2GB of data to another laptop. It's kind of boring because I have these two things finish to continue my work. But actually, this post is not about my boring stuff, hehe, I happen to have a chance to work with GameBoy Advance (GBA) development for the next two weeks and it's quite interesting  so I wanna blog about it. It's just my note about the progress of studying, so don't mind about the noob work.

The very first step is to setup the development environment. Pure C is used and some tools for compiler and emulator. It has been a long time since I come back to low-level C. it's quite fun to work with byte and bit again, it's like stoneage. The emulator is easy, you just go to VBA and download the latest version. For the environment, I think the document is not generally available because I have a hard time to setup the environment. Go to DevKitAdv and download the latest version (latest version is 2003, woot!!!).  I choose release 4, it's look safe. I have no idea which file should download so I just download all, and then later I found out that you will need the following one:

  • agb-win-core-r5.zip
  • agb-win-binutils-r4.zip
  • agb-win-gcc-r4.zip
  • agb-win-libstdcpp-r4.zip
  • agb-win-newlib-r4.zip
  • crtls.zip (for compiling crts0.o)

Extract all these files to a folder, like C:\devkitadv. Then set the PATH variable in  in the Environment Variables window to include the bin folder, my case is C:\devkitadv\bin. Check if you can run gcc from Command line then you are in the right way. Also, you need to download gfx2gba to convert (I don't know other way yet, hehe). Now we are ready to write some hello world.

Open paint, create a hello world picture and then save as BMP format. Make sure it's 8bit BMP or gfx2gba won't work. Copy the image to your workspace folder, name it hello.bmp or so, create src folder and then go to the command line and type gfx2gba -fsrc -osrc hello.bmp, it will create hello.raw.c for you. Then open src\main.c and paste the following code

#include "../common/gba.h"
#include "master.pal.c"
#include "hello.raw.c"
 
#define MODE_4 0x4
#define BG2_ENABLE 0x400
#define VideoBuffer ((unsigned short*)0x6000000)
#define BGPaletteMem ((unsigned short*)0x5000000)
 
int main (void) {
	int i;
 
	REG_DISPCNT = MODE_4 | BG2_ENABLE;
 
	for (i = 0; i < 120*160; ++i) {
		VideoBuffer[i] = ((u16*)hello_Bitmap)[i];
	}
 
	for (i = 0; i < 255; ++i) {
		BGPaletteMem[i] = master_Palette[i];
	}
 
	while (1);
 
	return 0;
}

You can get gba.h on this page. The idea is simple, copy the image to video buffer, then copy the color palette. Now we need to compile this script, open build.bat then paste the following build code

@echo off
 
gcc -O3 -W -o main.elf src\main.c
objcopy -O binary main.elf main.gba

Run this file, If you see main.gba then: congratulation. Open VBA (the emulator) then select main.gba, you will see something like this (depends on your picture, of course!).

 

This is just the first step, I'm going to blog more about this in next two weeks. Hope so =)) !

Note: In case you have some problem with crt0.o then download crtls.zip, then go to the folder where you extract crtls.zip and type as -o crt0.o crt0.s, then copy crt0.o to  devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2, devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\interwork, devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\thumb, devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\thumb\interwork.

 

S3 and S3FS

I just has an interesting experiment with Amazon S3 and EC2. S3 is an excellent storage with streaming support and I wonder how to use S3 and EC2 together most efficiently. Transfer between S3 and EC2 is free, so don't care about the cost. Basically, there are three ways you can use S3 with EC2:

  • S3 API: Files are handle directly via S3 API
  • Synchronization: working files on a local folder, and then a background deamon will sync it later. File Convenyor can be used to sync between S3 and local folder.
  • Local Mount: Mount S3 directly to file system, then access this folder as other normal folder. S3FS is a good implementation.

I'm most interested in #3, because its transparency, easy to setup, and ready for mostly every applications. Especially for my case is readonly with some random access with the file. But after I ran a few test, the performane is slow in an unacceptable way. I ran a Large-instance and check the reading IO, it's only about 9MB/s. I double-check again with HTTP access directly from S3, and the download speed is quite good: ~50MB/s. I  test these speed with the below commands and these commands was executed directly on my EC2 instance.

$ sudo s3fs bao-test-bucket /mnt/s3 -ouse_cache=/tmp -odefault_acl=public-read -oallow_other
$ time cp /mnt/s3/500mb /tmp
$ wget http://s3-ap-southeast-1.amazonaws.com/bao-test-bucket/500mb

I'm asking myself why it's so different, is it the API or FUSE or S3 or my configuration. After a quite, through I'm not a C-master, but I did take a look at S3FS code, and seem like S3FS downloads the whole content of the file before passing to system file handle. It's ridiculous at first because why you need all the file when you may only need a part of it, but later, on second thought, I understand that I forgot about the actual protocol is still HTTP and HTTP is traveless, you can't seek the file randomly or you will have to open many HTTP requests per seek and that way will only make thing worse.

So my conclusion about #3 is not practical for my case, it will be better in the case you write a lot with less read, but the more you read, the slower you are. Note: I have already enabled cache for s3fs. I hope this post will be useful for you. In my case, I fall back to #1, more work, more code, but extremely better performance :)

Pages

Subscribe to Front page feed