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 <iostream> | |
using namespace std; | |
int main() { | |
int x = 1 << 30; | |
int y = 1; | |
cout << (x << y) << endl; | |
return 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
#include <iostream> | |
template <typename T> | |
void func(T&& t) { | |
T y = t; | |
t += 3; | |
std::cout << y << " "; | |
} | |
int main() { | |
int c = 5; |
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 get_char(data: String) -> char { | |
data.chars().last().unwrap() | |
} | |
fn string_uppercase(mut data: &String) { | |
data = data.to_uppercase(); | |
println!("{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
import Clarity from 'clarity'; | |
Clarity.initialize('YOUR_CLARITY_TRACKING_CODE'); |
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
npm install clarity@latest | |
yarn add clarity@latest |
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 obj = { | |
value: 29, | |
method: function() { | |
const nested = () => { | |
console.log("LOG 1: ",this.value); | |
}; | |
nested(); | |
} | |
}; |
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 obj = { | |
value: 29, | |
method: function() { | |
const nested = () => { | |
console.log("LOG 3:",this.value); | |
}; | |
nested(); | |
} | |
}; | |
const obj2 = { |
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 <stdio.h> | |
int main() { | |
char c = 'D'; | |
char *cp = &c; | |
int *ip = (int*)cp; | |
*ip = 0x64567842; | |
printf("%c\n", c); | |
return 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
struct Provider: TimelineProvider { | |
// Provides a placeholder entry while the widget is loading. | |
func placeholder(in context: Context) -> DayEntry { | |
DayEntry(date: Date(), configuration: ConfigurationIntent()) | |
} | |
// Provides a snapshot of the widget's current state. | |
func getSnapshot(in context: Context, completion: @escaping (DayEntry) -> ()) { | |
let entry = DayEntry(date: Date(), configuration: ConfigurationIntent()) | |
completion(entry) |
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 Provider: TimelineProvider { | |
// Provides a placeholder entry while the widget is loading. | |
func placeholder(in context: Context) -> DayEntry { | |
DayEntry(date: Date(), configuration: ConfigurationIntent()) | |
} | |
// Provides a snapshot of the widget's current state. | |
func getSnapshot(in context: Context, completion: @escaping (DayEntry) -> ()) { | |
let entry = DayEntry(date: Date(), configuration: ConfigurationIntent()) | |
completion(entry) |
NewerOlder