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::collections::BTreeMap; | |
// char to usize | |
fn parse_int(str: String) -> usize { | |
str.chars().fold(0, |val, c| (val*10 + (c.to_digit(10).unwrap()) as usize)) | |
} | |
fn read_input(filename: &str) -> String { | |
use std::io::Read; | |
use std::fs::File; |
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 bonus (input: &String) { | |
// input is the same as in the main.rs | |
let mut adj_mat:Vec<usize> = Vec::new(); | |
let mut length = 0; | |
for line in input.split('\n') { | |
let connections: Vec<_> = line.split_whitespace().collect(); | |
let conn_to:usize = parse_int(connections[0].to_string()); | |
// Tabs from input not handled... | |
if conn_to <= 0 { | |
continue; |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="utf-8" /> | |
<script type="text/javascript"> | |
var timer; | |
var myTimeout; | |
var updateTime = function(myTime){ | |
document.getElementById("timer").textContent = myTime; | |
} |
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
# Don't forget to ser $usernameFull to the name off account in this format : DOMAIN\username | |
$rule = new-object System.Security.AccessControl.FileSystemAccessRule($usernameFull, 'FullControl', 'Allow'); | |
$owner = new-object System.Security.Principal.NTAccount($usernameFull) | |
foreach($file in $(Get-ChildItem ./ -recurse)){ | |
$acl=get-acl $file.FullName | |
$acl.SetAccessRule($rule) | |
$acl.SetOwner($owner) | |
set-acl $file.FullName $acl | |
} |
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
// Just a method to log NodeList content | |
var logChildrenModifications = function(type, array) { | |
if (array instanceof NodeList) { | |
for (var i = 0; i < array.length; i++) { | |
if (array.item(i) instanceof NodeList) { | |
logChildrenModifications(type, array.item(i)); | |
} else { | |
console.log(type + ' ' + array.item(i).nodeName); | |
} | |
} |