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
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { |
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
| #include <stdio.h> | |
| int main() { | |
| char* map[] = {"", "Ayumu", "Honoka", "Chika"}; | |
| printf("1->%s\n", map[1]); | |
| printf("2->%s\n", map[2]); | |
| printf("3->%s\n", map[3]); | |
| return 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
| class ResBlock(keras.Model): | |
| def __init__(): | |
| super().__init__() | |
| # filters: 64, kernel_size: 3, stride: 1 | |
| self.conv1 = layers.Conv2D(64, 3, 1, padding='same') | |
| self.conv2 = layers.Conv2D(64, 3, 1, padding='same') | |
| self.shortcut = keras.Sequential() | |
| def call(self, input): | |
| shortcut = self.shortcut(input) | |
| input = self.conv1(input) |
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
| type BSTNode struct { | |
| Key int | |
| Val interface{} | |
| left *BSTNode | |
| right *BSTNode | |
| } | |
| type BST struct { | |
| root *BSTNode | |
| } |
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
| #include <stdio.h> | |
| const int global_x = 1; // data (read only) | |
| int global_y = 1; // data | |
| int global_z; // bss | |
| int main() { | |
| const static int x = 1; // data (read only) | |
| static int y = 1; // data | |
| static int z; // bss | |
| int w = 1; // stack |
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
| type AVLNode struct { | |
| Key int | |
| Val interface{} | |
| left *AVLNode | |
| right *AVLNode | |
| height int | |
| } | |
| func NewAVLNode(key int, val interface{}) *AVLNode { | |
| return &AVLNode{ |
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
| // gcc find-min-and-max.c -o find-min-and-max | |
| // (gcc >= 12.3.0) | |
| #include<stdio.h> | |
| void findMinAndMax(const int* arr, int k, int* max, int* min){ | |
| *max = arr[k-1]; | |
| *min = arr[k-1]; | |
| for(int i = 1; i < k; i+=2){ | |
| if(arr[i] < arr[i-1]){ | |
| if(arr[i-1] > *max) *max = arr[i-1]; |