+-----+---+--------------------------+
| rwx | 7 | Read, write and execute |
| rw- | 6 | Read, write |
| r-x | 5 | Read, and execute |
| r-- | 4 | Read, |
| -wx | 3 | Write and execute |
| -w- | 2 | Write |
| --x | 1 | Execute |
| --- | 0 | no permissions |
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
public String triangleGenerator(int num, char letter ){ | |
if(num%2==0){ | |
num++ | |
} | |
// int num = 21; // input num (assume odd) | |
// char letter = 'A'; // input char | |
int rows = (num+1)/2; // the amount of rows | |
String result = ""; | |
int rowIdx = 1; // assume the idx of first row is 1 |
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
const url = 'ws://localhost:1234' | |
let ws = new WebSocket(url,'test_protocol') | |
ws.onopen = () => { | |
console.log('Client connection opened') | |
ws.send('Hello Websocket') | |
} | |
ws.onmessage = (event) => { | |
console.log('Received message : '+ event.data) | |
} |
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
registry=https://registry.npm.taobao.org | |
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
phantomjs_cdnurl=http://cdn.npm.taobao.org/dist/phantomjs | |
electron_mirror=http://cdn.npm.taobao.org/dist/electron/ |
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
04c0c0e476bd9f08980c6451372e78fa3accea476a6206b2219c3fe67fdf1bebdf0c7827f93e7f864f7ef778f83f053bb08c790977cc632cb81e987f6121cfe7a5 |
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 mio::{Handler, EventLoop}; | |
use std::{thread, time}; | |
fn main() { | |
let mut event_loop = EventLoop::<MyHandler>::new().unwrap(); | |
let sender = event_loop.channel(); | |
let sender2 = sender.clone(); | |
thread::spawn(move || { | |
loop { | |
thread::sleep(time::Duration::from_secs(1)); |
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_export] | |
macro_rules! invarint { | |
($condition:expr, $($arg:tt)*) => { | |
if !$condition { | |
panic!($($arg)*); | |
} | |
}; | |
} |
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::cell::RefCell; | |
use std::rc::{Rc, Weak}; | |
pub type NodePtr<T> = Rc<RefCell<Node<T>>>; | |
#[derive(Debug)] | |
pub struct Node<T> { | |
pub data: T, | |
pub prev: Option<Weak<RefCell<Node<T>>>>, | |
pub next: Option<Rc<RefCell<Node<T>>>>, | |
} |
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
package common | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// `flatten` recursively retrieves every leaf node in a struct in depth-first fashion | |
// and aggregate the results into given string slice with format: "path.to.leaf = value" | |
// in the order of definition. Root name is ignored in the path. This helper function is |
+----------+
| |
| C |
| |
+----^-+---+
| |
| |
MsgAppend(e[4,5])| | MsgAppendResp
| |
OlderNewer