Fedora BCC Example
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
struct Foo { | |
x: i32, | |
s: String, | |
opt: Option<i32>, | |
} | |
struct Bar(i32, i32); | |
fn play_with_struct() -> Foo { | |
let d = Foo { |
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
type Callback = fn(); | |
struct Processor { | |
callback: Callback, | |
} | |
impl Processor { | |
fn process_event(&self) { | |
(self.callback)(); | |
} |
The root cause is because JSONB can't unmarshall an interface.
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
// 关于by value和by reference | |
fn main() { | |
let x = String::from("hi"); | |
let y = &x; | |
println!("{}", y); | |
let z = { | |
let _z = String::from("42"); | |
_z |
步骤:
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
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false | |
defaults write -g NSScrollAnimationEnabled -bool false | |
defaults write -g NSWindowResizeTime -float 0.001 | |
defaults write -g QLPanelAnimationDuration -float 0 | |
defaults write -g NSScrollViewRubberbanding -bool false | |
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false | |
defaults write -g NSToolbarFullScreenAnimationDuration -float 0 | |
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0 | |
defaults write com.apple.dock autohide-time-modifier -float 0 | |
defaults write com.apple.dock autohide-delay -float 0 |
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 java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Predicate; |