Operation | nanosec | microsec | millisec | notable | 1Bx |
---|---|---|---|---|---|
L1 cache reference | 0.5 ns |
0.5 s |
|||
Branch mispredict | 5 ns |
5 s |
|||
L2 cache reference | 7 ns |
14x L1 cache | 7 s |
||
Mutex lock/unlock | 25 ns |
25 s |
|||
Main memory reference | 100 ns |
20x L2 cache, 200x L1 cache | 1.6 m |
||
Compress 1K bytes with Zippy | 3,000 ns |
3 µs |
`5 |
Sometimes you need a specific version of Terraform a build for your combination of Operating System / Architecture doesn't exist. This can be because that combination came out later than the version of Terraform you are after, or some other reason.
But, no fear, Golang compiler is great, and the Terraform codebase is pretty easy.
This describes a build process that produces a working binary,
If you, like me, want to contribute to Folding@Home from your Linux home server, it takes just few easy steps.
- Create your Folding@Home Passkey here (needed in a sec)
- Install the Folding@Home Client (instructions)
- Configure it at
/etc/fahclient/config.xml
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
use http::Error as HttpError; | |
use std::{fmt, error}; | |
type Result<T> = std::result::Result<T, ResolutionError>; | |
/// A type of `Error` emitted by `Resolver` | |
/// | |
/// It contains a description and an optional `HttpError` that might have caused it | |
#[derive(Debug)] |
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 org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; | |
import javax.validation.constraints.NotNull; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
/** | |
* Wraps a generic InputStream into a XZ Compressed InputStream. | |
* |
I hereby claim:
- I am detro on github.
- I am ivandemarino (https://keybase.io/ivandemarino) on keybase.
- I have a public key ASAqluqfdxEe_p__agBOYpFKA_rnlPdZmi3YWIpyt90w8go
To claim this, I am signing this object:
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
fn main() { | |
// This might seem like a lot of lines for just catching the 2nd argument, | |
// parse the string to int and store it in a variable, but what this also covers is | |
// the absence of such value (first error case) or the non-parsability of the argument (second error case). | |
// | |
// I'm liking this stuff so far. | |
let n = match env::args().skip(1).next() { | |
Some(x) => match x.parse::<usize>() { | |
Ok(y) => y, |
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
description "Starts a SimpleHTTPServer to host 1 Password Anywhere" | |
author "Ivan De Marino <[email protected]>" | |
version "1.0.0" | |
# When to start/stop | |
start on runlevel [2345] | |
stop on runlevel [016] | |
# Keep it running | |
respawn |
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
private LogEntries getRemoteEntries(String logType) { | |
Object raw = executeMethod.execute(DriverCommand.GET_LOG, ImmutableMap.of(TYPE_KEY, logType)); | |
@SuppressWarnings("unchecked") | |
List<Map<String, Object>> rawList = (List<Map<String, Object>>) raw; | |
List<LogEntry> remoteEntries = Lists.newArrayListWithCapacity(rawList.size()); | |
for (Map<String, Object> obj : rawList) { | |
remoteEntries.add(new LogEntry(LogLevelMapping.toLevel((String)obj.get(LEVEL)), | |
(Long) obj.get(TIMESTAMP), | |
(String) obj.get(MESSAGE))); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder