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
def mixin(cls, mixinname: str, mixinmodule: str): | |
"""Mixes in the folling class. | |
Mixes in the methods defined in mixinname located in module mixinmdule. | |
This sidesteps the issue of circular dependencies by importing the dependencies | |
later on when the class is instantiated instead of in the global namespace. | |
With this decorator you avoid having to inherit from the mixins and you get | |
them at runtime. | |
Usage: |
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
Notification.requestPermission().then(function(result) { | |
console.log(result); | |
setInterval(function() { | |
if (document.querySelector('table.tcl-table tbody tr td:nth-child(3)').textContent.includes('Q2')) { var notification = new Notification('To do list', { body: 'q2' }); } | |
}, 10 * 1000); // 60 * 1000 milsec | |
}); |
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 os | |
import logging | |
from pathlib import Path | |
from redbaron import RedBaron | |
class PythonProject: | |
def __init__(self, projectname): | |
self.projectname = projectname | |
self.numclasses = 0 |
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
0x586dc8C52c833a330777bEAC3A079a7B47AF824a |
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
TARGET_EXEC ?= a.out | |
BUILD_DIR ?= ./build | |
SRC_DIRS ?= ./src | |
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) | |
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) | |
DEPS := $(OBJS:.o=.d) | |
INC_DIRS := $(shell find $(SRC_DIRS) -type d) |
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
# This is an appspec.yml template file for use with AWS CodeDeploy. | |
# The lines in this template starting with the hashtag symbol are | |
# instructional comments and can be safely left in the file or | |
# ignored. | |
# For help completing this file, see the "AppSpec File Reference" in the | |
# "AWS CodeDeploy User Guide" at | |
# http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html | |
version: 0.0 | |
# Specify "os: linux" if this revision targets Amazon Linux, | |
# Red Hat Enterprise Linux (RHEL), or Ubuntu Server |
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
# | |
# Chef Recipe | |
# | |
# | |
sudo nano /etc/hosts | |
111.222.333.444 chef.domain.com chef | |
# where 111.222.333.444 is your chef server ip | |
hostname -f |
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
## | |
# Bernoulli of parameter p | |
# p should be a float between 0..1 | |
def ber(p) | |
th = rand | |
return 0 if th < p | |
return 1 if th >= p | |
end |
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
function [points]=imgToPoints(im,z) | |
xsize=size(im,1); | |
ysize=size(im,2); | |
points = zeros(xsize*ysize,6); | |
for i=1:xsize | |
for j=1:ysize | |
%point(1)=(i-1)*4; % 4mm x resolution | |
% if im(i,j,1)~=0 | |
% disp([im(i,j,1) im(i,j,2) im(i,j,3)]) | |
% end |
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
function CloudToPcd(pcloud, filename) | |
% save point cloud to pcd format file | |
% only works with xyz pointclouds | |
pcdfile = fopen(filename, 'wt'); | |
% Write the pcd header | |
fprintf(pcdfile, '%s\n', '# .PCD v.7 - Point Cloud Data file format'); | |
% Write the pcd version | |
fprintf(pcdfile, '%s\n', 'VERSION .7'); | |
fprintf(pcdfile, '%s\n', 'FIELDS x y z'); |
NewerOlder