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 <stdio.h> | |
void printArray(int * array, int size){ | |
int i; | |
printf("[ "); | |
for (i = 0; i < size; i++) | |
printf("%d ", array[i]); | |
printf("]\n"); | |
} |
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
CryptoJS.enc.u8array = { | |
stringify: function (wordArray) { | |
var words = wordArray.words; | |
var sigBytes = wordArray.sigBytes; | |
var u8 = new Uint8Array(sigBytes); | |
for (var i = 0; i < sigBytes; i++) { | |
var byte = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; | |
u8[i]=byte; | |
} |
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
commands: | |
01_install_yarn: | |
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y" | |
02_download_nodejs: | |
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -" | |
03_install_nodejs: | |
command: "yum -y install nodejs" | |
04_mkdir_webapp_dir: | |
command: "mkdir /home/webapp" |
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
/** | |
* Producer-Comsumer example, written in C++ May 4, 2014 | |
* Compiled on OSX 10.9, using: | |
* g++ -std=c++11 producer_consumer.cpp | |
**/ | |
#include <iostream> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> |
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
# Resume UUID set to enable hybernation, will write RAM to swap | |
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=<PARTITION UUID> loglevel=3 quiet" |
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
[Sleep] | |
suspend=suspend-then-hibernate | |
HibernateState=disk | |
# Suspend then Hibernate after 45 min | |
HibernateDelaySec=2700 |
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
[Login] | |
HandlePowerKey=suspend-then-hibernate | |
HandleLidSwitch=suspend-then-hibernate |
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
[Unit] | |
Description=Powertop tunings | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/powertop --auto-tune | |
[Install] | |
WantedBy=multi-user.target |
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
publication_title = bs.find('invention-title').text | |
publication_num = bs['file'].split("-")[0] | |
publication_date = bs.find('publication-reference').find('date').text | |
application_type = bs.find('application-reference')['appl-type'] | |
classifications = [] | |
for classes in bs.find_all('classifications-ipcr'): | |
for el in classes.find_all('classification-ipcr'): | |
cclassifications.append(el.find('section').text | |
+ el.find('class').text |
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
# Load USPTO .xml document | |
xml_text = html.unescape(open(filename, 'r').read()) | |
# Split out patent applications / grants | |
for patent in xml_text.split("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"): | |
# Skip if it doesn't exist | |
if patent is None or patent == "": | |
continue | |
NewerOlder