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.

Advertisements

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

/etc/rc.local

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

fi;

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!

Note:

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
M T W T F S S
« May   Jul »
 123
45678910
11121314151617
18192021222324
252627282930  

Twitter

  • is reflecting on the past three years and reading the article on divided self aptly showing up at the top of my tweeter feed. 5 months ago
  • is having a nice feeling of connecting dots all over the place. they are now illuminating the same point. 6 months ago
  • Style Transfer is fun! TensorFlow rocks! #WTM17 https://t.co/zYP0IFIDfp 8 months ago
  • couldn't get over the jetlag, sleeping during the day from seven to four, for days. 10 months ago
  • is emptying trash and happily discovering the available disk space now ranks at 100G+. 11 months ago

Flickr Photos