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
« May   Jul »


  • couldn't get over the jetlag, sleeping during the day from seven to four, for days. 1 month ago
  • is emptying trash and happily discovering the available disk space now ranks at 100G+. 2 months ago
  • is looking at other people's intentions, not their capabilities, and feeling much happier every day :) 1 year ago
  • is planning on how to spend the next two weeks until the new year, at home. 1 year ago
  • is going to have human company for Thanksgiving; a rare event for the past like twenty years. 1 year ago

Flickr Photos











More Photos