View parseder.d
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
import std.file : read; | |
import std.stdio; | |
import std.base64; | |
import std.string; | |
import std.conv; | |
import std.algorithm : map; | |
enum DerTag { | |
EndOfContent = 0x0, | |
Bool = 0x1, |
View countingkeywords.d
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 dmd -run | |
import std.range; | |
struct Words(R,int maxWordLen = 4) | |
{ | |
int wordLen; | |
R inner; | |
dchar[maxWordLen] buffer; | |
this(R inner) { | |
this.inner = inner.save;//refRange(&inner); | |
foreach (ref d; buffer) { |
View robo.ino
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
#define MOTOR_L_F 6 | |
#define MOTOR_L_B 5 | |
#define MOTOR_R_B 9 | |
#define MOTOR_R_F 10 | |
#define SENSOR_L 11 | |
#define SENSOR_F 12 | |
void left(int speed) | |
{ |
View mrz.d
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
// Copyright Lionello Lunesu, placed in the public domain. | |
import std.algorithm; | |
import std.range; | |
ubyte charCode(dchar c) pure { | |
switch (c) { | |
case '<': return 0; | |
case 'A': .. case 'Z': return cast(ubyte)(c - 'A' + 10); | |
case '0': .. case '9': return cast(ubyte)(c - '0'); | |
default: assert(0); |
View imageset2mipmap.js
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 node | |
const FS = require('fs') | |
const Path = require('path') | |
const FolderMap = { | |
"1x": "mipmap-mdpi", | |
"2x": "mipmap-xhdpi", | |
"3x": "mipmap-xxhdpi", | |
} |
View optimize_eagle.d
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
import std.xml; | |
import std.file; | |
import std.stdio; | |
import std.conv; | |
import std.math; | |
real EPSILON = 1e-2; | |
real distance_to_line(real fx, real fy, real tx, real ty, real px, real py) { |
View androiduml.d
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 dmd -run | |
import std.xml; | |
import std.file; | |
import std.stdio; | |
Element getElementByTagName(Element parent, string name) { | |
foreach (child; parent.elements) { | |
if (child.tag.name == name) { | |
return child; |
View ModExp.sol
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
pragma solidity ^0.4.17; | |
contract ModExp { | |
// Wrapper for built-in bigint_modexp (contract 0x5) as described here https://github.com/ethereum/EIPs/pull/198 | |
function modexp(bytes memory _base, bytes memory _exp, bytes memory _mod) public view returns(bytes memory ret) { | |
uint256 bl = _base.length; | |
uint256 el = _exp.length; | |
uint256 ml = _mod.length; |
View base64url
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 bash | |
ignore=0 | |
decode=0 | |
dashdash=0 | |
args=() | |
files=() | |
while [ $# -gt 0 ]; do | |
if [ $dashdash -eq 1 ]; then |
View repro181.sol
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 node | |
const Child_process = require('child_process') | |
const Web3 = require('web3') | |
const Assert = require('assert') | |
const SOL = ` | |
contract BS { | |
function isValidSignature( | |
address signer, | |
bytes32 hash, |