Better HN
topnewbestaskshowjobs
Log inSign up

voidlogic

3,297 karma · joined Nov 15, 2012 (14y ago) · 1,171 submissions

Submissions

comment 9y ago · link · parent

>That POST is actually meant for updates and PUT is meant for new entities

No.. So any creation or update can be a POST. If your operation is idempotent, then you can make it a PUT. If you take the subset of POSTS that are idempotent in your application, this is what could be made a PUT.

So a set operation foobar=50, would could be a POST, but since its idempotent, it could also be a PUT.

A increment operations foobar++, would have to be a POST, but could not be a PUT since it is not idempotent.

comment 9y ago · link · parent

>However, you don't really want to fire up into the air in the middle of a domestic city, making birds a more interesting option.

Shotguns with bird-shot would be effective and are comparatively low risk to bullets.

comment 9y ago · link · parent

>Are you suggesting men don't seek medical treatment therefore it's their fault for getting sick?

I made no attribution of fault... simply an alternative primary cause to the person I responded to.

comment 9y ago · link · parent

>Because men receive worse medical treatment.

What about an alternative... Men are less likely to seek medical treatment?

comment 9y ago · link · parent

I'd be curious how similar the results of being in nutritional ketosis would be. I've been studies in the past looking at rigorous caloric restriction benefits that demonstrated that people in isocaloric nutritional ketosis got most of the benefits of the restriction group (while not having the misery long term caloric restriction).

comment 9y ago · link · parent

>too much "if error return error" noise for my taste.

I understand that. I was pointing out this is less noise than try-catch-finally (assuming the programmer is comparing Go to C++/Java/C#). I don't deny some functional langs have more elegant handling in this respect.

comment 9y ago · link · parent

I agree, I wonder if C++/Java would have gone down the exception path if they had multiple return values? Its it seems to me exceptions are really a special kind of return value that doesn't clobber your single return value.

Compared to Java I have ported to Go, returning error + defer has led to much more localized (and this grokable) and less verbose error handling. Less verbose? I suppose this is not true if you throw exceptions and handle them all at the top (Go has panic for these kind of fatal events BTW), but if you regularly have try-catch-finally blocks, the Go approach is in fact less verbose.

comment 9y ago · link · parent

Besides a shell script with a "for each repo. git clone", there is no build process (besides running the go build command)...

comment 9y ago · link · parent

How so? The project just includes a script that git clones the forks into your Go workspace for the project /foobar/src....

comment 9y ago · link · parent

>Things like the weird split between functions returning errors but occasionally panicking, lack of inheritance, and poor dependency management through github links make Go a poor choice for applications within a business setting.

FWIW I've been using Go since 0.8 and this stuff isn't really an issue for me.

1. Panics should not cross package boundaries unless they are meant to be fatal!

2. "lack of inheritance": 90% of the time embedding does the job of inheritance for my use cases just fine. It also prevents a lot of stupid... (from me and others)

3. "poor dependency management through github links" For all my non-trival projects I always fork all my dependencies into their own repos and then link upstream as upstream. If there is not feature I want or bug that needs fixing, I update them every 6 mo - 1 yr. I do this with every language I use where my dependences are source code and not distributable libraries (.a, .so, .jar etc).

comment 9y ago · link · parent

I agree, the backup that isn't used to populate a stage/qa instance right after being taken is untrushworthy.

comment 9y ago · link · parent

>When we went to look for the pg_dump backups we found out they were not there. The S3 bucket was empty, and there was no recent backup to be found anywhere. Upon closer inspection we found out that the backup procedure was using pg_dump 9.2, while our database is running PostgreSQL 9.6 (for Postgres, 9.x releases are considered major). A difference in major versions results in pg_dump producing an error, terminating the backup procedure.

Yikes. One common practice that would have avoided this is by using the just taken backup to populate stage. If the restore fails pages go out. If integration tests that run after a successful restore/populate fail- pages go out.

Live and learn I guess.

comment 9y ago · link · parent

>Unfortunately, this is required in the enterprise world where corporate MiTM is often done

This still should not be the default, rather corps should have an easy about:config switch they can flip. The default should protect private users.

comment 9y ago · link · parent

You realize I am asking about the effects of someone in nutritional ketosis who is getting a lot of hypoglycin lychee right? Of course I am not saying there is anything wrong with nutritional ketosis itself.

comment 9y ago · link · parent

Thanks for this great reply, that makes sense. Do you know if hypoglycin interferes with the synthesis of beta hydroxybutyrate?

comment 9y ago · link · parent

Does that mean a person in nutritional ketosis could die... ?

Background for others: Most people in keto are running on mostly fatty acids and some ketones (for the things that can't use fatty acids) and a small amount of glucose from gluconeogenesis for the obligate glucose tissues (retina, small percentage of brain, etc).

If you take away the ability to use fatty acids then you have to run off ketones, which should work, but I don't know if the body can make enough (and maybe that is impacted too?). And if your body is using gluconeogenesis to make your essential glucose from protein, and that is inhibited, I would think those tissues would be in trouble (its called essential glucose for a reason).

comment 9y ago · link · parent

>What's being tested is the presence of pipelining :D

Which is silly considering a majority of wild browsers now support HTTP/2.

Thanks for pointing our the repo, I missed it before: https://github.com/squeaky-pl/japronto

His Go isn't horrible, but it could be written like this:

  func hello(respWtr http.ResponseWriter, req *http.Request) {
    text, status := []byte("Hello world!"), http.StatusOK
    if request.URL.Path != "/" {
      text, status = []byte("Not Found"), http.StatusNotFound
    }
    respWtr.WriteHeader(status)
    response.Write(text)
  }
Rather than: https://github.com/squeaky-pl/japronto/blob/master/benchmark...

Also, limiting Go to use a single core is unfair because the Go GC is optimized for multi-core operation.

comment 9y ago · link · parent

>wrk with 1 thread, 100 connections and 24 simultaneous

Say what? When I do this kind of testing using wrk:

  1. I use multiple clients
  2. Each client uses a thread for every logical CPU
  3. I usually use at least 256 connections
What is actually being tested here? This smells like a test to get a desired result.

No to mention in regards to Go/Others:

  1. He is using an RC
  2. By default it uses all all cores, why handicap it?
  3. He didn't share his code for his contestants, how can I trust this?

comment 9y ago · link · parent

>What would that gain you?

This is a deterrent and would be very disruptive to the owners conducting business. It would discourage investors from elevating questionable people to boards of directors.

It could be something like this: 1. Sell/auction assets 2. Pay fines and damages and debts 3. Split remaining proceeds amongst non-legally culpable share holders

comment 9y ago · link · parent

>though I hope you're joking about the guillotine

I read that remark as this: If corporations are people legally, there should be certain crimes that lead to their dissolution. I assumed this was the proposal: If a corporation does something evil enough, its leaders going to prison and paying a fine isn't enough, it should face the corporate guillotine which revokes its incorporation.

comment 9y ago · link · parent

While this may have a lot of truth to it, the ironic thing here is you are posting this in response to a Dijkstra quote urging us down the path of humility.

comment 9y ago · link · parent

Post apoc. things like bows and crossbows would be more valuable, but I can't see weapon tech falling much below the 1850s. Its much easier to make a lead ball than an arrow and making blackpower is less about infrastructure than knowledge.

I have a replica Remington Model 1858 black power revolver. It shoots lead balls which are easy to make, same with its percussion caps. The kicker is, once loaded, its tactically the same as any modern single action 6 shooter.

If things really got bad, I have a heard time imaging my .55 cal muzzle loading flint lock would be out of commission either. I'd save the cross bow for stealth actions and maybe hunting smaller game, for which it would rock.

There is also the fact it would take years to burn up all the ammo floating around out there, so this would be gradual.

comment 9y ago · link · parent

We wrote ours around the time Go 1.1 was released so its way older and featureful than that package.

comment 9y ago · link · parent

In Go 1.8; due this month, cgo calls got half as expensive. They all ready are OK as long as you are smart about them.

comment 9y ago · link · parent

The problem isn't the methodology. Its the library support. I (for my employee) wrote a library a few years ago (~go 1.1) with "errs.New" and "errs.Append(err, ..work like fmt..)" that generates error that look like:

  main.go:13 main.main(): highest level error;
    Details: foo.go:8 foo.ExportedMethod(): mid level error;
    Details: foo.go:42 foo.innerMethod(): low level error!
It provides handy helpers like GetRootErr and PanicToError too. I hope we can opensource it in the next month or two.

comment 9y ago · link · parent

When I was a consultant I saw it happen often, BUT, seldom does technical debt get called out explicitly as a reason for failure. More usually it goes like this:

feature requests with no mind to maintainability/cleanup -> tech debt -> slow dev. velocity -> failure to deliver features for the businesses -> failure to retain/grow/compete

comment 9y ago · link · parent

Good feeedback, further thoughts:

>I don't view this as lower level, just more verbose and explicit.

Well in this case, aren't these the same? The Go flow shows the explicit spawning of a (go/co)routine and the reading and wring to a thread safe queue. The C# abstracts this so the Go is closer to what is actually happening (ie low level). I should point out, you say more verbose, but there isn't much, if any, of a line count hit here for Go compared to C#.

>but it's harder to read the operations—not knowing go, `await` makes a lot more sense than `<-`.

Fair point, but if you swap <- for await I'd think the Go is more clear for people equally unfamiliar with Go and if you are learning Go <- is a core operator you will learn early.

comment 9y ago · link · parent

Doing this with Go using goroutines and channels pretty simple: https://play.golang.org/p/fattakS6aj

But something struck me, the low level execution flow was much much more intuitive. I think this might be an example how simple syntactic sugar can make code much harder to reason about intuitively. I do write a lot of Go so maybe its just that... you tell me!

comment 9y ago · link · parent

What about Cinelerra?

comment 9y ago · link · parent

>but wifi drivers are always an issue

This is not true if you have Intel wifi hardware, which is a lot (a majority?) of laptops.

1
456
40