This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<rdf:RDF xmlns="http://www.semanticweb.org/ontologies/2016/facebook-ontology#" | |
xml:base="http://www.semanticweb.org/ontologies/2016/facebook-ontology" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" | |
xmlns:xml="http://www.w3.org/XML/1998/namespace" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> | |
<owl:Ontology rdf:about="http://www.semanticweb.org/ontologies/2016/facebook-ontology"/> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Licensed under GNU General Public License v2 | |
* (c) 2015, InfinityTotality | |
* (c) 2014, projektile, worron | |
* (c) 2013, Luke Bonham | |
* (c) 2009, Donald Ephraim Curtis | |
* (c) 2008, Julien Danjolu | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
compile: gcc -o ticks ticks.c | |
run: ./ticks $(pgrep awesome) 20 3 | |
This makes 3 measurements of each 20 seconds | |
Best used with short timeouts in the widgets and everything else idling. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Licensed under GNU General Public License v2 | |
* (c) 2014 projektile, worron | |
* (c) 2013 Luke Bonham | |
* (c) 2009 Donald Ephraim Curtis | |
* (c) 2008 Julien Danjolu | |
With gaps between windows two times wider | |
(like xmonad) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network={ | |
ssid="eduroam" | |
scan_ssid=1 | |
key_mgmt=WPA-EAP | |
eap=TTLS | |
#anonymous_identity="anonymous@ox.ac.uk" | |
#ca_cert="/etc/ssl/certs/AddTrust_External_Root.pem" | |
phase2="auth=MSCHAPV2" | |
identity="<email>" | |
password="<pwd>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A script to fade volume when toggling MPD via mpc | |
mpc=`which mpc` | |
# volume commands, customize here | |
decrease="amixer -q set Master 1%-" | |
increase="amixer -q set Master 1%+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct Point { // 2-D | |
double x, y; | |
Point(double x, double y) : x(x), y(y) {} | |
}; | |
// Barycentric method - https://stackoverflow.com/a/9755252 | |
bool isInsideTriangle(const Point& a, const Point& b, const Point& c, const Point& s) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://projecteuler.net/problem=347 | |
#include <vector> | |
#include <cmath> | |
#include <iostream> | |
std::vector getSieveOfEratosthenes(const int& n) | |
{ | |
if (n <= 0) return {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Returns the total stopping time of positive number n in the Collatz sequence. | |
""" | |
def collatz(n: int) -> bool: | |
def get_next(n: int) -> int: | |
return n % 2 == 0 and n//2 or (3*n + 1)//2 | |
""" | |
Shortcut: 3n + 1 is even if n is odd, so we can divide it by 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://leetcode.com/problems/median-of-two-sorted-arrays | |
// https://www.youtube.com/watch?v=LPFhl65R7ww | |
// https://leetcode.com/problems/median-of-two-sorted-arrays/discuss/2471/Very-concise-O(log(min(MN)))-iterative-solution-with-detailed-explanation | |
class Solution { | |
public: | |
double findMedianSortedArrays(vector<int>& a1, vector<int>& a2) { | |
if (a1.size() > a2.size()) swap(a1, a2); // ensure a1 is shorter |
OlderNewer