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 <stdlib.h> | |
#include <gtk/gtk.h> | |
struct MainWindow { | |
GtkWidget *window; | |
gboolean draw; | |
GAsyncQueue *draw_queue; | |
cairo_surface_t *surface; | |
} *main_window; |
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 | |
func main() { | |
for i,v := range []string{"sss", "sffg", "gfdbf"} { | |
println("Ime " + string(i+48) + " = " + v[1:3]) | |
} | |
} |
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" | |
type Sortable interface { | |
Less(b Sortable) bool | |
} | |
type Person struct { | |
age, height 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" | |
type Sortable interface { | |
Less(b Sortable) bool | |
} | |
type Person struct { | |
age, height 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
/* | |
* A quick example how to generate expression trees using | |
* the Go programming language. | |
*/ | |
package main | |
import ( | |
"strings" | |
"container/vector" |
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 "gtk" | |
import "fmt" | |
func main() { | |
gtk.Init(nil) | |
vbox := gtk.VBox(false, 2) | |
window := gtk.Window(gtk.GTK_WINDOW_TOPLEVEL) |
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 ( | |
"os" | |
"encoding/binary" | |
) | |
type info struct { | |
a, b, c int32 | |
d, e, f uint8 |
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
/* | |
Parse() calls uuid_unparse() which takes unsigned char * as arg1 and char * as arg2 | |
-- parses the first argument and writes a string representation in the second argument (37 bytes) | |
*/ | |
func Parse(_uuid []byte) string { | |
var _str []byte = make([]byte, 37) | |
C.uuid_unparse((*C.uchar)(unsafe.Pointer(&_uuid)), (*C.char)(unsafe.Pointer(&_str))) | |
return string(_str) | |
} |
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 uuid | |
// #include <stdlib.h> | |
// #include <uuid/uuid.h> | |
import "C" | |
import "unsafe" | |
func Generate() []byte { | |
var uuid []byte = make([]byte, 16) |
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 ( | |
"io/ioutil" | |
"unsafe" | |
) | |
type Data struct { | |
Head [4]byte | |
Flags byte |
OlderNewer