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 static Map<Integer, List<Integer>> makeFriendlists(List<Map<String, List<Integer>>> hashes) { | |
Map<Integer, List<Integer>> result = new ConcurrentHashMap<>(); // concurrent put might happen in parallelstream | |
// 1.: parallel stream all maps in list | |
// 2.: parallel stream all entries in entrysets of hashes | |
// 3.: for each entry in streamed hash, add it to the index list | |
hashes.parallelStream().map(hashmap -> hashmap.entrySet().parallelStream()) | |
.forEach(entries -> entries.forEach(e -> { | |
List<Integer> friends = e.getValue(); | |
for (Integer index : friends) { | |
if (result.containsKey(index)) { |
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
extern crate rustyline; | |
use rustyline::error::ReadlineError; | |
use rustyline::Editor; | |
#[link(name = "mpc")] | |
extern { | |
fn mpc_new(s: &str) -> *mut mpc_parser_t; | |
} | |
fn main() { |
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
mod timesheet; | |
fn main() { | |
let mut ts = timesheet::Session::new(); | |
println!("{:?}", ts); | |
} |
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 std::process::Command; | |
fn main() { | |
println!("{}", git_name().unwrap_or("".to_string())); | |
} | |
pub fn git_name() -> Option<String> { | |
let output = Command::new("git") | |
.arg("config user.name") |
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 std::process::Command; | |
fn main() { | |
println!("{}", git_name().unwrap_or("".to_string())); | |
} | |
pub fn git_name() -> Option<String> { | |
let output = Command::new("git") | |
.arg("config") |
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
#[macro_use] | |
extern crate clap; | |
#[macro_use] | |
extern crate serde_derive; | |
mod timesheet; | |
fn main() { |
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
//! # Toolbar, Scrollable Text View and File Chooser, Cairo Widget | |
extern crate gtk; | |
extern crate cairo; | |
use std::io::prelude::*; | |
use std::io::BufReader; | |
use std::fs::File; | |
use gtk::DrawingArea; |
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
class ModelSerializer implements JsonSerializer<FHEMModel> { | |
private final List<String> permissions; | |
public ModelSerializer(List<String> permissions) { | |
this.permissions = permissions; | |
} | |
@Override | |
public JsonElement serialize(FHEMModel model, Type type, JsonSerializationContext jsc) { | |
/* All the other adapters set non-permitted or empty fields to null */ |
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
{ | |
"Identifier": [ | |
{ | |
"name": "incorrectJSON", | |
"note": "the comma", | |
}, | |
] | |
} |
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 <Servo.h> | |
// Assign your channel in pins | |
#define THROTTLE_IN_PIN 8 | |
volatile uint16_t unThrottleInShared; | |
uint32_t ulThrottleStart; | |
void setup() |
OlderNewer