Dependent Origination

Archive for June 2012

due to licensing issues 😦

what does this mean? this means when you run php -a:
with readline support, you are going to see php> prompt and you can type in statements in php and the interpreter runs it for you. really useful tool when you just want to see what a statement does.
without readline support, you will see ‘Interactive Mode Enabled’, but without the prompt. you can paste in html code (i.e., with <?php tags), hit ctrl-D, then the interpreter runs it output something — it sucks.

one version says Php 5.4 compiled readline into a separate module, so you can work around it — the licensing issue only prevents debian wheezy from distributing a php with readline support, it doesn’t prevent you from using it

another solution is to install phpsh — i wanted to do this for a long time since phpsh (the one from facebook) is awesome — probably will do it for next hackathon — would love to get back to the beloved phpsh — even more useful than php -a the interactive shell.

one big difference:
su authenticates the target user’s password
sudo authenticates the invoking user’s password


it is a startup script for the local machine so you can do many useful things here. the easiest way is to have it call another script which you can check into the source depot.

this link explains more on what you should pay attention to when you write the script — for example always use absolute path since it will be run from the caller’s directory.

this thread explains that no need to enable rc.local service any more systemd picks it up automatically on reboot.

if [ -s $FILE ] ; then

commands for a non-empty file here


You’ve come to the right place!

template<typename T, string& url, int port> void your_function(param1_type param1 ….);

Then declare your strings in the global scope:

string prod_url = “your string literal”;

then instantiate:

your_function<T, prod_url, 443>(param1, param2, param3,…);

The compiler will be happy!


1. no amount of const, constexpr, static can make the compiler happy so the literals have to be declared in the global scope — the compiler apparently just wants it to be there, to be there, to be there.

2. i couldn’t make const char* work (instead of a string&) as a template parameter type.

June 2012


  • is loving shelter-in-place, in fact 2 days ago
  • is sleeping much better during shelter-in-place 2 weeks ago
  • is emotionally ready for the next chapter of life 7 months ago
  • is memorizing Himalaya keyboards and learning to type Tibetan. So exciting. Chinese, English, Spanish, now my fourth language Tibetan! 8 months ago
  • this is a special summer 11 months ago

Flickr Photos