Skip to content

Instantly share code, notes, and snippets.

rm(list=ls())
options(digits=22)
g <- expand.grid(replicate(10, 0:1, simplify=F))
m <- rowMeans(g)
unique(m)
df = data.frame()
for (j in 1:1024) {
@efi
efi / gist:82e5c8caff814bbb53ac097ddac5c2d8
Created February 13, 2019 19:29
MaixPy Face_detect demo on the MAIX Bit (MAIX GO Suit)
__ __ _____ __ __ _____ __ __
| \/ | /\ |_ _| \ \ / / | __ \ \ \ / /
| \ / | / \ | | \ V / | |__) | \ \_/ /
| |\/| | / /\ \ | | > < | ___/ \ /
| | | | / ____ \ _| |_ / . \ | | | |
|_| |_| /_/ \_\ |_____| /_/ \_\ |_| |_|
Official Site:http://www.sipeed.com/
Wiki:http://maixpy.sipeed.com/
[MAIXPY]Pll0:freq:806000000
[MAIXPY]Pll1:freq:159714285
OpenSSL::SSL::SSLError: Socket closed
OpenSSL::SSL::SSLError: writer side was already closed.
OpenSSL::SSL::SSLError: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
OpenSSL::SSL::SSLError: Eine bestehende Verbindung wurde softwaregesteuert durch den Hostcomputer abgebrochen
Net::ReadTimeout: Net::ReadTimeout
Errno::ECONNREFUSED: Connection refused - Connection refused
TypeError: exception class/object expected
@efi
efi / keyboard_controller.rb
Created April 5, 2015 16:49
Send system keyboard events in JRuby via java.awt.Robot
class KeyboardController
def initialize
@robot = java.awt.Robot.new
end
def type *args
[args].flatten.map(&:to_s).map{|s|s.split(/\s+/)}.flatten.map(&:upcase).each do |n|
press, name = (n[0]=="-") ? [false,n[1..-1]] : [true,n]
press ? @robot.key_press(@code) : @robot.key_release(@code) if @code = java.awt.event.KeyEvent.const_get("VK_#{name}")
end
self
@efi
efi / index.html
Last active August 29, 2015 14:04 — forked from gka/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Alpha-Shapes</title>
<script src="http://mbostock.github.com/d3/d3.js"></script>
<script src="http://mbostock.github.com/d3/d3.geom.js"></script>
<style type="text/css">
path {
@efi
efi / original.rb
Last active December 13, 2015 23:49
# -*- encoding : utf-8 -*-
require 'rubygems'
require 'pacer'
Dir["titan-0.2.0/lib/\*.jar"].each { |jar| require jar }
# Benchmark code
def time ; start = Time.now ; yield ; puts "Executed in #{Time.now - start}" ; end
# Purge local Titan store and create new instance
system "rm /disk/tmp/titan/*"