This file contains hidden or 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
| [ 1090.825] (WW) Failed to open protocol names file lib/xorg/protocol.txt | |
| [ 1090.826] | |
| X.Org X Server 1.20.8 | |
| X Protocol Version 11, Revision 0 | |
| [ 1090.826] Build Operating System: Linux Alpine Linux | |
| [ 1090.826] Current Operating System: Linux falco 3.4.113 #6-postmarketOS SMP PREEMPT Tue Nov 5 06:54:09 UTC 2019 armv7l | |
| [ 1090.826] Kernel command line: androidboot.bootdevice=msm_sdcc.1 androidboot.hardware=qcom vmalloc=400M utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags buildvariant=userdebug androidboot.bootdevice=msm_sdcc.1 androidboot.hardware=qcom vmalloc=400M utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags buildvariant=userdebug androidboot.emmc=true androidboot.serialno=TA92903XW6 androidboot.baseband=msm androidboot.mode=normal androidboot.device=falcon androidboot.hwrev=0x83C0 androidboot.radio=0x1 androidboot.powerup_reason=0x00100000 bootreason=hardware_reset androidboot.write_protect=0 restart.download_mode=0 androidboot.fsg-id= androidboot.secure_hardware=1 androidboot.cid=0 |
This file contains hidden or 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::mem::MaybeUninit; | |
| impl Solution { | |
| pub fn is_alien_sorted(words: Vec<String>, order: String) -> bool { | |
| let order_arr = Solution::get_order_arr(order); | |
| words | |
| .as_slice() | |
| .windows(2) | |
| .map(|x| Solution::check_pair(x[0].as_bytes(), x[1].as_bytes(), &order_arr)) |
This file contains hidden or 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
| model = SARIMAX(data1, exog=data2, order=(1, 1, 2), seasonal_order=(1, 1, 1, 52)) | |
| model_fit = model.fit(disp=False) | |
| print(f"Global: {model_fit.summary()}") | |
| for site in sites: | |
| # make prediction | |
| newdfinner = df_site.loc[df_site.site == site, :].fillna(0).reset_index(drop=True) | |
| exog2 = newdfinner.loc[ | |
| newdfinner["start_week_dt"] >= last_sunday, ["exog1", "exog2"] |
This file contains hidden or 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 split_with_matches<'a, F>(s: &'a str, f: F) -> Vec<&'a str> | |
| where | |
| F: Fn(char) -> bool, | |
| { | |
| let mut out: Vec<&'a str> = Vec::new(); | |
| let mut prevpos: usize = 0; | |
| for (pos, c) in s.bytes().enumerate() { | |
| if f(c as char) { | |
| if prevpos != pos { |
This file contains hidden or 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
| # Running specific applications through a VPN with network namespaces | |
| # Initial state | |
| curl ifconfig.co/city | |
| sudo ip link list | |
| sudo ip netns list | |
| # Disable Uncomplicated Firewall (Ubuntu) | |
| sudo ufw disable |
This file contains hidden or 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
| // Definition for a binary tree node. | |
| #[derive(Debug, PartialEq, Eq)] | |
| pub struct TreeNode { | |
| pub val: i32, | |
| pub left: Option<Rc<RefCell<TreeNode>>>, | |
| pub right: Option<Rc<RefCell<TreeNode>>>, | |
| } | |
| impl TreeNode { | |
| #[inline] |
This file contains hidden or 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
| struct Node { | |
| value: Symbol, | |
| children: (Option<Box<Node>>, Option<Box<Node>>), | |
| } | |
| let movechild = ((&root).as_ref().unwrap().children).1; | |
| (&mut root).as_mut().unwrap().children.1 = Some(Box::new(Node::new(symbol, (movechild, None)))); |
This file contains hidden or 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 split_with_matches<F>(s: &str, f: F) -> Vec<&str> where | |
| F: Fn(char) -> bool { | |
| let mut out: Vec<&str> = vec![]; | |
| let mut curstring: String = String::new(); | |
| for c in s.chars() { | |
| if f(c) { | |
| out.push(&curstring); | |
| out.push(&c.to_string()); | |
| } else { | |
| curstring.push(c); |
This file contains hidden or 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
| abstract class SpaceObject() { | |
| type T <: SpaceObject | |
| def ===(that: T): Boolean | |
| } | |
| class Sphere(val transform: Matrix, val material: Material) extends SpaceObject { | |
| type T = Sphere |
This file contains hidden or 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
| def encodePair(pair: (Char, Char)): (Char, Char) = { | |
| (findLetterInSquare(pair._1), findLetterInSquare(pair._2)) match { | |
| case ((A, B), (A, D)) => (indexToLetter((A, (B+1)%5)), indexToLetter((A, (D+1)%5))) // same row | |
| case ((A, B), (C, B)) => (indexToLetter(((A + 1)%5, B)), indexToLetter(((C+1)%5, B))) // same column | |
| case ((A, B), (C, D)) => (indexToLetter((A, D)),indexToLetter((C, B))) | |
| } | |
| } |