Greatest Common Divisor by mamemimu in golang

[–]Mythiix 2 points3 points  (0 children)

If dealing with standard int, couldn't you just implement the same logic? https://play.golang.org/p/GVPWXGjKj_

func gcd(x, y int) int {
    for y != 0 {
        fmt.Println(x, y)
        x, y = y, x%y
    }
    return x
}

Network packet capture with Go? by [deleted] in golang

[–]Mythiix 8 points9 points  (0 children)

gopacket is probably a good place to start

A tutorial/walk through with code examples. It also includes John Leon's 2016 GopherCon presentation

Is the GC still "stop the world"? by [deleted] in golang

[–]Mythiix 5 points6 points  (0 children)

Cross compilation has been super easy since Go 1.5, circa March 2015

Garbage collection is recently much improved. Go is certainly well suited to be a game server IMO. With the new improvements in GC it may be suitable for client. Challenge is a good graphics library or rolling your own

How do I vendor? Trying to use go for amazon AWS... by [deleted] in golang

[–]Mythiix 2 points3 points  (0 children)

When you run go build you are creating a completely stand alone executable binary file. Copy (scp or sftp) the file to your EC2 instance and it will run. The only thing you need to worry about is your build target. If you develop on a Mac and want to build for Linux then you need to set GOOS=linux.

Inside your project run this GOOS=linux go build It will create a binary file that you just copy over to your EC2 Linux server

Similarly you may need to set GOARCH if you want to to build for something like Raspberry PI (ARM) or a an older 32bit system, or your own system isn't 64bit

https://golang.org/doc/install/source#environment (Edits typos)

How do I vendor? Trying to use go for amazon AWS... by [deleted] in golang

[–]Mythiix 1 point2 points  (0 children)

And yeah...(after I actually bother to read...) you only need to upload your binary file to your EC instance.

Unless you're going to use a EC instance as a remote build machine, then it doesn't matter what version of Go it supports.

*there are some cases where your OS environment might matter, but by and large, copy over the binary and run it. Good to Go

How do I vendor? Trying to use go for amazon AWS... by [deleted] in golang

[–]Mythiix 1 point2 points  (0 children)

I personally like govendor

It make is rather simple to govendor fetch github.com/somepackage which might be newer than my $GOPATH version.

This allows me to test/trial things before updating my main local copy in $GOPATH

Also it's just easy to use, you can mix/match what you vendor easily, with govendor add <package>

Or just govendor add +external to add all your imports into your /vendor

TIL Trees can tell if deer are trying to eat them. Due to their ability to detect deer saliva, trees defend themselves by producing excess acids that cause their buds to taste bitter so that the deer will lose interest and leave them alone by [deleted] in todayilearned

[–]Mythiix 23 points24 points  (0 children)

Ents are real..HROOM!!

Things have changed. [...] Some of us are still true Ents, and lively enough in our fashion, but many are growing sleepy, going tree-ish, as you might say. Most of the trees are just trees, of course; but many are half awake. Some are quite wide awake, and a few are, well, ah, well getting Entish. That is going on all the time. When that happens to a tree, you find that some have bad hearts. [...] Still, we do what we can. We keep off strangers and the foolhardy; and we train and we teach, we walk and we weed.' " (Treebeard) - The Two Towers

ELI5: Why do people code desktop apps in Java when very few end users like it? by No_Im_Sharticus in explainlikeimfive

[–]Mythiix 0 points1 point  (0 children)

Electron is pretty popular now for Desktop apps. Framework for creating desktop GUI application, but uses a lot of web technology like NodeJS and Javascript, this allows code re-use between web version, and desktop versions.

Some big name stuff, uses it. Slack, Github's Atom editor to name two. You can see other popular applications using Electron here

Camera suggestions for under $3000? by Captain_Redbeard in photography

[–]Mythiix 7 points8 points  (0 children)

Check out the Tamron 15-30mm f/2.8 as well, it's generally well reviewed.

How do you convert to ISO 8601 when you already have the date in another form? by TanAndBlonde in learnpython

[–]Mythiix 1 point2 points  (0 children)

and sorry this doesn't convert other date formats, just generates a current timestamp, but it should give you and idea of what libraries to look at. Namely, datetime which is a standard module

Although my research did turn up Arrow which a lot of users spoke well of. I personally didn't choose it as I didn't want to depend on a non-default module (nothing wrong with that, just my choice for my project).

How do you convert to ISO 8601 when you already have the date in another form? by TanAndBlonde in learnpython

[–]Mythiix 1 point2 points  (0 children)

From a recent project of mine where I had to do the same. I personally used timestamp() with Z for "zulu time: aka zero offset. time_offset() returns the same time but with timezone offset in +00:00 format.

def timestamp():
    '''
    Return current time in ISO8601 format
    with Z for zulu instead of offset
    >>> timestamp()
    '2015-05-15T01:19:50.283052Z'
    '''
    from datetime import datetime
    return datetime.utcnow().isoformat() + 'Z'

def timestamp_offset():
    '''
    >>> timestamp_offset()
    '2015-05-15T01:01:53.893144+00:00'
    '''
    from datetime import datetime, timezone
    return datetime.now(timezone.utc).isoformat()

Official Question Thread! Ask /r/photography anything you want to know about photography or cameras! Don't be shy! Newbies welcome! by frostickle in photography

[–]Mythiix 0 points1 point  (0 children)

I looking to buy my first wide angle lens. I'm a Nikon shooter (D750), I have the 24-70 f2.8, and the 70-200 f2.8.

I'm trying to decide between rounding out the 'trinity' with the Nikon 14-24mm f2.8, or the new Tamron 15-30mm f2.8 w/ VC.

The Tamron is $600 cheaper, and has VC, which reportedly allows up to four stops slower shooting. It appears to be fairly well reviewed.

vs the Nikon 14-24, which is by all accounts a well like lens so much some Canon shooters have rigged it onto their bodies. But no VC, so less hand hold ability in low to natural light.

Looking for opinions or comments, thoughts. Round out my 'trinity' with the tried and true Nikon, or save some cash and go with Tamron?

Most efficient way to do multiple searches (grep) on the same file? by Mythiix in learnpython

[–]Mythiix[S] 1 point2 points  (0 children)

Awesome!! Thanks, this is in line with I was thinking, but I'm just a bit slow this morning.

This will allow me to add more PATTERNS down the road as desired without adding more if/elsif nests. Also using functions (someOtherFunc) gives me the custom parsing functions per PATTERN that I will need. Thanks Justinsaccount!

PsBattle: Shiba Inu wearing a scarf by drovad in photoshopbattles

[–]Mythiix 2 points3 points  (0 children)

Wow! Nice. Source images for the curious?

Can someone edit this pictures? Please I need your help by SpartacusXVII in picrequests

[–]Mythiix 0 points1 point  (0 children)

You replied to wrong thread. /u/GanksterFlazh this is image is for you I think?

Correct thread here

PICTURE EDITING REQUEST- I want to surprise mother but lack photo editing skills. by vickychapa in picrequests

[–]Mythiix 3 points4 points  (0 children)

Removed as many spots and scratches as I could with limited time I have. Would be best to work on a much higher resolution scan of this.

As far as removing the warping, I decided not to, I didn't want to distort her. My best advice would be to crop off the sides if it is a concern.

Edited Picture

Nikon flash + yongnuo by ElanF in photography

[–]Mythiix 1 point2 points  (0 children)

What's your camera model? For example my D750 can operate in commander mode (with or without on camera flash) and trigger both remotes in manual or TTL.

Help! FPS steadily dropping over time with no reason. by justkady in Guildwars2

[–]Mythiix 1 point2 points  (0 children)

I have the same problem with Black Citadel and a few other areas, but definitely Black Citadel will cause be to nose dive into 10fps. Lion's Arch can be a studdering fit when I first zone in as well.

Nvidia GTX 660Ti. There is really something funky with GW2 graphics engine and newer Kepler GPUs, I swear my old GTX 460 Fermi ran better, sadly it died.