In C and C++, the comma operator is a binary operator that:
- Evaluates the first operand, and discards the result
- Evalutes the second operand, and returns this value
So:
if (a,b) {
// Note: Use mutexes people | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// generic type: response | |
type re [T comparable, U any] struct { |
package main | |
import "fmt" | |
import "encoding/json" | |
import "bytes" | |
type AuthPost [T any] struct { | |
UserID string `json:"userid"` | |
SID string `json:"sid"` | |
Data T `json:"data"` | |
} |
package main | |
// Continue here: https://go.dev/blog/pipelines | |
import ( | |
"crypto/md5" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
"sort" | |
"sync" |
package main | |
import "fmt" | |
// Take a variadic list of integers, and launch a goroutine which will block trying to send them on channel 'out' | |
// Return this channel as a receive-only channel | |
func gen(ns ...int) <-chan int { | |
out := make(chan int) // Create a bidirectional channel | |
go func() { | |
for _, n := range ns { |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
class Sensor | |
{ | |
public: | |
enum Type | |
{ | |
ALTIMITER = 0, |
package main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
"strings" | |
"unicode" | |
) |
package main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
"strings" | |
"math" | |
) |
package main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
"strings" | |
) | |
func gamePossible (line string, constraints map[string]int) bool { |
// Online Go compiler to run Golang program online | |
// Print "Hello World!" message | |
package main | |
import "fmt" | |
// Type A, normal receiver, and pointer receiver | |
type A struct { | |
s string | |
} |