This file contains hidden or 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
| //static initialization of containers | |
| vector <int> V = {1, 2, 3}; | |
| pair <int, int> p = {1, 2}; | |
| map <int, string> M = { | |
| {0, "Hello"}, | |
| {1, "World"} | |
| }; | |
| //Type inference |
This file contains hidden or 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
| class BIT{ | |
| int T[MAX], size; | |
| public: | |
| BIT(int n){ | |
| size = n; | |
| for(int i=1; i<=n; i++) | |
| T[size] = 0; | |
| } | |
| int get(int i){ |
This file contains hidden or 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> | |
| using namespace std; | |
| struct sudoku{ | |
| int A[9][9]; | |
| bool FIXED[9][9]; | |
| bool check_row(int x, int i, int j){ | |
| //For a row, i=const |
This file contains hidden or 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
| if [ -d /etc/X11/xinit/xinitrc.d ] ; then | |
| for f in /etc/X11/xinit/xinitrc.d/?* ; do | |
| [ -x "$f" ] && . "$f" | |
| done | |
| unset f | |
| fi | |
| xrdb -merge ~/.Xresources #To merge settings | |
| nm-applet &> /dev/null & #NetworkManager | |
| xscreensaver -no-splash & #Screensaver | |
| xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 & #Compositing |
This file contains hidden or 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
| pacman -S python2-{twisted,crypto,dnspython,gdata} | |
| git clone https://github.com/ffledgling/dtella.git | |
| cd dtella | |
| sed '1,1s/python/python2/' -i dtella.py | |
| ./dtella.py |
This file contains hidden or 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
| diff --git a/awesome/rc.lua b/awesome/rc.lua | |
| index 7587d6b..7d2d3a2 100644 | |
| --- a/awesome/rc.lua | |
| +++ b/awesome/rc.lua | |
| @@ -560,3 +560,32 @@ end | |
| battery_timer = timer({timeout=100}) | |
| battery_timer:connect_signal("timeout", function() check_battery() end) | |
| battery_timer:start() | |
| + | |
| + |
This file contains hidden or 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
| sudo apt-get install python-pip | |
| pip install -v twisted PyCrypto dnspython gdata | |
| git clone https://github.com/ffledgling/dtella.git | |
| cd dtella | |
| ./dtella.py |
This file contains hidden or 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
| import lxml.html | |
| import requests | |
| import re, operator | |
| def extract_page_ips(response): | |
| tree = lxml.html.fromstring(response.text) | |
| content = tree.xpath('//div[@id="border-wrapper"]')[0] | |
| expr = re.compile("/ip/[0-9.]*") | |
| hrefs = map(lambda x: x[2], content.iterlinks()) | |
| ip_links = filter(expr.match, hrefs) |
This file contains hidden or 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
| x = document.getElementsByTagName("a") | |
| arr = [].slice.call(x); | |
| y = arr.map(function(z){ | |
| return z.href; | |
| }); | |
| t = y.filter(function(x){ | |
| a = x.indexOf("mp4") != -1; | |
| b = x.indexOf("srt") != -1; | |
| c = x.indexOf("pdf") != -1; |
This file contains hidden or 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
| <!-- Add the below rule to /etc/fonts/fonts.conf or ~/.fonts.conf --> | |
| <match target="pattern"> | |
| <test qual="any" name="family"><string>helvetica</string></test> | |
| <edit name="family" mode="assign" binding="same"><string>Open Sans</string></edit> | |
| </match> |
OlderNewer