Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
Discover gists
import tiktoken | |
import langdetect | |
T = tiktoken.get_encoding("o200k_base") | |
length_dict = {} | |
for i in range(T.n_vocab): | |
try: | |
length_dict[i] = len(T.decode([i])) | |
except: |
[send-sip-response-code] | |
; Context to send a specific SIP response code and terminate the channel | |
; Create Custom Destination in FreePBX with a dial string of the format | |
; send-sip-response-code,404,1 | |
; substitute the appropriate response code in place of the 404 | |
; Reference: https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings | |
; | |
; latest version: https://gist.github.com/lgaetz/480582a1827cc98db1ee539c249f074b | |
; | |
; License GPL/2 |
## Credits to John Lieske - https://www.ansible.com/blog/getting-started-writing-your-first-playbook | |
--- | |
- name: Install nginx | |
hosts: host.name.ip | |
become: true | |
tasks: | |
- name: Add epel-release repo | |
yum: | |
name: epel-release |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
Read this file first. | |
Then read the comments at the top of parity_test.c | |
Then read the comments above each algorithm implementation in parity.c | |
So there I was talking about efficient implemetation of fundamental functions | |
with Palmer over at SiFive. Back in the day, I used to participate in informal | |
contests on rec.games.programmer to see who could craft the most efficient | |
implementations for population count or bit reversal or bit-blitting. For | |
programmer types, it's great fun. |
Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.
The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060
, which represents November 28th, 2018
at 09:01:00
hours for my local time zone (GMT+0100 Central European Standard Time).
Style | Input | Output (12-hour clock) | Output (24-hour clock) |
---|---|---|---|
Default | <t:1543392060> |
November 28, 2018 9:01 AM | 28 November 2018 09:01 |