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
// Projekt6.1.1 | |
package main | |
import "fmt" | |
func NWD(a, b int) int { | |
var w int | |
for w == 0 { | |
if a > b { |
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
// Projekt6.1.1 | |
package main | |
import "fmt" | |
func NWD(a, b int) int { | |
for { | |
if a > b { | |
a = a - b | |
} else if a < b { |
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
// Projekt6.1.1 | |
package main | |
import "fmt" | |
func NWD(a, b int) int { | |
for a != b { | |
if a > b { | |
a = a - b | |
} else { |
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
#!/bin/bash | |
# 1. Save file as go_install.sh | |
# 2. chmod +x go_install.sh | |
# 3. ./go_install.sh | |
# 4. Profit. | |
# Get Go package | |
PKGNAME=go1.3.3.linux-amd64.tar.gz | |
rm -f $PKGNAME | |
wget https://storage.googleapis.com/golang/$PKGNAME |
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
package main | |
import ( | |
"fmt" | |
"path" | |
) | |
type StringGenerator interface { | |
Next() bool | |
Get() string |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func CalcNewSize(w, h uint, maxW, maxH int32) (uint, uint) { | |
haveF := float64(w) / float64(h) | |
wantF := float64(maxW) / float64(maxH) |
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
version: '2' | |
services: | |
rmq: | |
container_name: rm-rabbitmq | |
image: rabbitmq:3.6 | |
networks: | |
- rmnet | |
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
// http://dev.pawelsz.eu/2016/04/go-imagick-image-croping-after-rotation.html | |
// | |
package main | |
import ( | |
"gopkg.in/gographics/imagick.v2/imagick" | |
"log" | |
"math" | |
) |
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
# pip install pyqrcode | |
# pip install pypng | |
import pyqrcode | |
for i in range(1000,1500): | |
number = pyqrcode.create(i) | |
number.png('dest/{}.png'.format(destdir,i)) |
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
package pl.pawelsz.apache.beam; | |
import org.apache.beam.sdk.transforms.SimpleFunction; | |
import org.apache.beam.sdk.values.KV; | |
public class Only { | |
public static class Values<TK, TI, TO> extends SimpleFunction<KV<TK, TI>, KV<TK, TO>> { | |
private final SimpleFunction<TI, TO> map; |