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
| // Fill inside of the optimizeFunction function | |
| function doExpensiveTask(input) { | |
| const result = 2 * input | |
| console.log("Doing expensive task...:", result); | |
| return result; | |
| } | |
| function optimizeFunction(func) { | |
| /* | |
| * Only write code in this function. | |
| * This function returns an optimized version of the func |
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
| #!/usr/bin/python | |
| import socket #for sockets | |
| import sys #for exit | |
| try: | |
| #create an AF_INET, STREAM socket (TCP) | |
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| except socket.error, msg: | |
| print 'Failed to create socket. Error code: ' + str(msg[0]) + ' , Error message : ' + msg[1] |
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
| import datetime | |
| from dataclasses import dataclass | |
| @dataclass | |
| class ArduinoStatus: | |
| sicaklik : float | |
| battery : float | |
| isik_sens : int | |
| isik_role : int | |
| kasa_kapak : int |
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" | |
| "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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "sync/atomic" | |
| ) | |
| type ObjectPool[T any] struct { | |
| pool sync.Pool |
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 example | |
| import ( | |
| pgx "github.com/jackc/pgx/v5" | |
| "github.com/jackc/pgx/v5/pgtype" | |
| "github.com/jackc/pgx/v5/pgxpool" | |
| ) | |
| func postgresCustomJSONUpgrade(conn *pgxpool.Pool) { | |
| conn.Config().AfterConnect = func(ctx context.Context, conn *pgx.Conn) error { |
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
| #!/usr/bin/env bash | |
| export GOTOOLCHAIN="go1.25.0" | |
| export CGO_ENABLED="0" | |
| export GOAMD64="v4" | |
| export GOARM64="v8.4,lse,crypto" | |
| export GOFLAGS="-ldflags=-s -ldflags=-w -trimpath -buildvcs=false -installsuffix=cgo" | |
| export GOEXPERIMENT="newinliner,greenteagc" | |
| export CGO_CFLAGS="-O3 -march=native" |
OlderNewer