1. A server app (using Machine Learning technique ) that helps people organize their credit card transactions (hopefully written lisp).2. A device that could be used remotely to help me cook rice.3. A markdown language that I suits my daily use perfectly.4. Learn how to use Emacs for lisp.5. My AR.Drone project that needs the conclusion part finished an updated.Above are projects in the category of either engineer or practicing programming skills. Other aspects of life like health/food/social are listed below.1. Working out. The first step is to rent lockers at the gym.Running/Basketball/Swimming2. Food. Cooking is always important, I love good food.3. Learn Japanese.4. Learn investment / understand economy.5. Visiting Canada
This site was previously hosted by 000webhost.com. I used Windows Live Writer (WLW) as the offline editor.
WLW is the best blog tool I have used so far. It copes with WordPress flawlessly and it has good plug-ins for all I need. For example, I can upload my pictures directly to Flickr with Flickr4Writer; I can pull old posts back with one click; I can drag and move things easily. Everything feels native, all I need to worry about is the actual content. With this tool, life is good and happy.
However, free server is usually not well supported. My eventually went out of business around Oct. 2013. The log in option was intentionally directed to the main page of 000webhost.com . I can still edit the content of my blog, but I no longer have the feeling that I am the owner of this server.
Chance finally came this last Friday (11/29/2013), DigitalOcean has a promotion where people get $50 worth of credits if registered on that Black Friday. I was about to buy Linode but it is more expensive. With a little bit of thought I decided to give this VPS hosting service a shot.
All other billing and registration things aside, the actual site relocation was not a smooth journey. I have the back-up file for my old site (old_database.sql). What I need to do is to import this old MySQL database into the new MySQL database that is storing my newly installed WordPress database.
One thing DigitalOcean VPS does differently from 000webhost is that how it connects MySQL database with the WordPress. DigitalOcean VPS has a mysql installed on the VPS machine. All database operations are done on that machine. It is like you have a really machine and you just ssh into that machine and does operations there inside the machine (You can install the graphic interface phpAdimin on that machine too). 000webhost will just give you a control panel and you can do the database manipulation within the panel.
Therefore what I did is type in ‘mysql’ in to the terminal that connects to the VPS and following this post at StackOverflow on how to copy one table in one database to another database. The is useful because what I intended to do is to copy the wp_posts table in my old database to the wp_posts in the new database. Because the installation process for WordPress is just creating new tables in given databases. For my own record, the list of tables I have copied is the following:
Once these two tables are imported to the database, all my posts and comments are back and online.
So far so good, data is back how could one ask for more? What had been achieved was good enough for most people but not for a pathetic stubborner. I want the WLW back too. Even though now I am using a mac. I have always wanted to find the alternative to Windows Live Writer. I searched once furiously online when I turned from Windows to Ubuntu and failed. This time I was hoping Mac users will have a beautiful solution. With this motivation I started looking for a good blogging tool on Mac OS X platform. Long story short, I failed, again. There is nothing event close to WLW. However possibility exists that people do not write their blogs inside a high integrated environment. They might just write the markdown and then run a script that will generate HTML+CSS code for them.
There are two lessons I learned here. First, free service is not necessary always good; Second, there is no good alternative to WLW.
The idea for this post comes from this thread (How did you learn the GNU make tool) from StackOverflow.
The GNU make command will look for a file named makefile by default.
Makefile is just a set of rules. If you offer options for make to build, then make will go to that rule to build according to the rules corresponds to the rules you give it. If you do not offer make any option, then make will go with its default option which is identical to the option all.
For simple projects like projects with one or two files. The following makefile is already good enough.
gcc foo.c – o foo
We can also have different rules for different object files (files with .o extension), like the following.
gcc -c foo.c
gcc -c bar.c
gcc foo.o bar.o -o app
There is a problem as we add more files in to projects because the we need to type in the name for each one of them. Make will compile and link everyone of them every time you invoke make command. This way, it will do some unnecessary work.
Make knows how to save this extra work if makefile tells make which object file depends on which source file. With this dependency assumed, make will compare the time stamp of source file and object file. If the source is no newer than the object file, then make will not recompile the source file. Else if the source file is newer than the object file, then make will recompile the source file and link it the final executable.
An example makefile will be the following.
gcc -c foo.c
gcc -c bar.c
foo.o bar.o gcc foo.o bar.o -o app
Those text in red is the part tells make which source file some object file corresponds to. At this point the makefile is already in good shape and make will not do extra work when invoked. However, there is still some extra typing we need to do. In other words, for each object file, we need to create one specific rule to compile it, and add its name for “all” option. Fortunately, this extra work could be further saved.
Make will assume the dependency by default. So we can do the following thing.
gcc $(OBJS) -o app
This is almost the final version. The only problem for this is that we cannot change the flag, plus we may want to use anther command other than cc command to compile our code like gcc.
The final version is:
$(CC) $(CFLAGS) $(OBJS) -o app
That is it, a quick introduction to GNU make command.
I have always wondered how the compiler works, after I have watched this video, I understood the overall process.
Processing: expand the macros
Compilation: from source code to assembly language
Assembly: from assembly language to machine code
Linking: create the final executable
总而言之，语言 + 签证