Like the Lispbox package IDE with Common Lisp, to jump right in with Scheme without having to spend hours setting things up, it’s either DrRacket or SublimeText. And since DrRacket’s editing interface is a tad unfriendly, let’s fortify Sublime Text with Scheme REPL.
Author Archives: lucia
Ruby Logging: Print, Puts, P
Reference:
New Line | [nil, 1, 2] |
"\n" |
|
print |
N | [nil, 1, 2] |
# blank line |
puts |
Y | # blank line 1 2 |
# blank line |
p |
Y | [nil, 1, 2] |
"\n" |
Import Font Looks Weirdly Bold
Book Recommendation Updates
[Latest Update 5/16, 2016]
- Verbal Judo, should legitimately be taught in school
- Deep Work, on productiveness
- The Geography of Bliss, the happiest place on earth?
- Trust Me, I’m Lying, not cheerful, but worth the read
- The Boy Who Was Raised as a Dog, a thought provoking page turner
$.getJSON Not Working
If the format of the JSON file is not strictly JSON, it would not work.
Subscribe to Non-RSS Page
This is handy for following pages that don’t provide RSS access: Turn the page into RSS.
PHP: Script Base Url
To get the url of current script’s directory:
$script_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; $dir_url = preg_replace("/[^\/]*.php/", "", $script_url);
Essential Differences between Session and Cookie
- Cookie gets send with every single request to server, sessions don’t.
- Cookies are saved on client side. Sessions on server side.
- Cookie can be created with an expire date (e.g., 30 days), so that users won’t have to re-login after closing browser window. Sessions die with page close*.
PHP: Select from Database Error
$link = mysqli_connect("localhost", "root", "root"); $result = mysqli_select_db($link, 'internship'); $email_duplicate = "SELECT * FROM Interns WHERE email='$email';"; $result = mysqli_query($link, $email_duplicate);
PHP: Check Server Method
if ($_SERVER['REQUEST_METHOD'] === 'POST') {...}
The POST
part is all CAPITAL.