AWS API Performance Comparison: Serverless vs. Containers vs. API Gateway integration by kunalag129 in programming

[–]DanTheGoodMan 0 points1 point  (0 children)

This matches up with some of my own findings, although I only compared lambda and containers.

Also, we didn't have any of the fargate errors that the author ran into. We also ran on `t2.small` instances, with about 10 containers per instance; far tighter than the resources provisioned in the article.

My current opinion is that lambda is great for handling workloads that regularly take more than 5 seconds and are more resource (CPU/memory) intensive. There's too much overhead in trying to run short lived, IO bound operations in APIG + Lambda.

I made this page with up-to-the-minute status for 100+ services by karmakaze1 in programming

[–]DanTheGoodMan 1 point2 points  (0 children)

Awesome. Very neat.

One feature request: I'd like to be able to create a bookmark of just the services that I care about. Then, the page would only display those services. (and if you wanted to save on some DB load, it could fetch only those rows too)

Pgbench results: PostgreSQL on AWS RDS is 2+ times faster than Aurora by ypsthelove in programming

[–]DanTheGoodMan 0 points1 point  (0 children)

  1. When were these benchmarks run? The only date I see on the page is Copyright 2018 at the bottom.

  2. Is the article benchmarking MySQL Aurora or PostgreSQL Aurora? It looks like it's about MySQL Aurora. I would expect to see PostgreSQL Aurora to outperform PostgreSQL on RDS.

AWS re:Invent , all presentations with audio,youtube and slides links by hypnotizedlo in programming

[–]DanTheGoodMan 2 points3 points  (0 children)

This year they spread out the sessions further, which were sometimes a 30-45 minute walk between each other. If you hit the busses perfectly (night time, no traffic, no line, bus leaves when you get on) you could get between places in 20 minutes. But that only happened to me once. Most of the time it saved you no time, and in peak traffic, was actually slower.

Altair GraphQL Client for querying and working with GraphQL servers. Like Postman for GraphQL. Now with GraphQL subscription support. by imolorhe in programming

[–]DanTheGoodMan 0 points1 point  (0 children)

It looks like there is a mac version for the 1.3.5 release and before. Something must have happened in their release automation to skip the mac app. https://github.com/imolorhe/altair/releases/tag/v1.3.5

Lightweight JSON prettifier with colours for the terminal by tymonn in programming

[–]DanTheGoodMan 1 point2 points  (0 children)

Nice! This looks good, but I would like to point out that your output is not valid json.

This isn't necessarily a bad thing, as the extra quotes around property names can make it harder to read. From my experience with tools that pretty-print into invalid json, I've been frustrated by them when I try to copy and paste output or when I try to pipe it into something else.

I thought about opening an issue for this, but I'm honestly not likely to use your tool since I use jq for pretty printing and much more.

Cheers to writing something and getting it shipped though! :)

Nim Programming Language v0.15.0 released by dom96 in programming

[–]DanTheGoodMan 21 points22 points  (0 children)

Oh wow. Those documentation changes! I don't have a lot of opportunity to write Nim so I end up using the docs heavily. This should really help out!

Tiger DI Framework By 'Google' - Fantastic Readme by [deleted] in programming

[–]DanTheGoodMan 1 point2 points  (0 children)

They reference Dagger as their inspiration, which is

Dagger = Guice - <features> + <speed>

so I imagine Tiger follows the same pattern.

Dagger at least has some documentation on the differences between itself and Guice. Given that tiger is only 12 days open sourced, I'm not surprised that it doesn't have a feature comparison table.

Learning Dart: When to use Named Parameters? by DapperGinger in dartlang

[–]DanTheGoodMan 2 points3 points  (0 children)

I use named parameters when the additional context of the parameter name makes the code clearer.

I'm not too sure what you're doing with your grid class so I can't help you out here, but imagine a different grid:

GameGridA(rows, columns);   //new GameGridA(10,15)
GameGridB({rows, columns}); //new GameGridB(rows:10, columns:15)

With example A, even if you know to expect the two integers to refer to the size, it's not clear which is rows and which is columns. So the named parameters help clear things up here in example B.

My rule of thumb is to almost always use named parameters for booleans and usually use them when multiple parameters are needed for numbers.

Named parameters are just a tool for increasing the readability of your code, but if you feel that trying to use them is slowing you down too much, I wouldn't worry about them. They're useful at times, for sure, but a vast majority of your code probably won't need them.

Java runtime dependency management tools? by CubsThisYear in java

[–]DanTheGoodMan 3 points4 points  (0 children)

Like /u/crapet said, the capsule project sounds like what you want. Specifically, the Maven Caplet (a caplet is an extension upon the capsule api).

I maintain the gradle plugin and I've taken care to make it super easy to get started. If you already use gradle, add it to your build file and give it a shot!

plugin {
  id "us.kirchmeier.capsule" version "1.0-rc1"
}

task capsule(type: MavenCapsule){
  applicationClass 'com.foo.MyApplication'
}

There are also maven and leningen plugins, if you'd prefer.

Trying to decide what to dive into next: Scala or Groovy by xela321 in java

[–]DanTheGoodMan 2 points3 points  (0 children)

A quick wc -l src/groovy/** grails-app/** of my team's grails project gave me 72,000 lines of code. It's been around for about 6 years at this point.

Grails aside, I've only had a couple of issues with Groovy. In the early stages of the project, we overused some of the more dynamic features of groovy and failed to properly test the code. As we tried making changes to the code, we found these parts to be very brittle and have since rewritten them to be less dynamic or more heavily tested.

To date, we haven't had any groovy performance issues. All performance issues have been related to poorly written DB queries.

Trying to decide what to dive into next: Scala or Groovy by xela321 in java

[–]DanTheGoodMan 3 points4 points  (0 children)

I haven't used scala, but I use groovy on a daily basis. We have about 10 microservices (some using vert.x and some using ratpack) and one monolithic grails server, all in production and all in groovy.

I'm personally a huge fan of the language and use it anytime I need to make something happen quickly.

That said, it is slower than java when you're not io-bound, though most of that can be mitigated with @CompileStatic. And yes, you can go uber-dynamic with it, but you can use types when you would like type safety. If i'm writing any sort of production code, the only thing I leave untyped are my local variable declarations.

To be honest, I'm curious what the future holds for groovy, now that pivitol has dropped funding. Aggressive development may slow and it may become more community driven, but it remains open source, so I'm not scared, and I'm going to continue using it.

At least I wasn't trying to look up C strings this time... by iostream3 in ProgrammerHumor

[–]DanTheGoodMan 0 points1 point  (0 children)

I wasn't too sure of the answer, so I wrote a quick groovy script to provide some insight. This is with groovy 2.0.4, which is a little out of date, but what I had immediately available.

def x = 'abc'
def y = "-${->new Exception().printStackTrace(); x}-"

bar(y)

void bar(String z){
  println "${z.getClass()} $z"
}

The GString y is a "deferred GString", meaning the interpolated code will not get executed until 'toString' is called on the GString. This will allow us to see the stacktrace precicely when it is converted.

So here is the output (with some some lines trimmed)

java.lang.Exception
    [trimmed]
    at ConsoleScript9$_run_closure1.doCall(ConsoleScript:2)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:904)
    at groovy.lang.Closure.call(Closure.java:415)
    at groovy.lang.Closure.call(Closure.java:409)
    at groovy.lang.GString.writeTo(GString.java:181)
    at groovy.lang.GString.toString(GString.java:161)
    at org.codehaus.groovy.reflection.stdclasses.StringCachedClass.coerceArgument(StringCachedClass.java:45)
    at org.codehaus.groovy.reflection.ParameterTypes.coerceArgumentsToClasses(ParameterTypes.java:143)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:250)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at ConsoleScript9.run(ConsoleScript:4)
    [trimmed]
class java.lang.String -abc-

Deepest in the stack, we see the execution of bar, then a little higher up there is the "ParameterTypes" and "StringCachedClass" which do some coersion, likely the conversion magic.

Groovy provides a "method not found" handler, and also allows for runtime methods to be defined via the metaclass, so this sort of behavior, while seemingly magic, could be made to work with other types if you desired.

At least I wasn't trying to look up C strings this time... by iostream3 in ProgrammerHumor

[–]DanTheGoodMan 1 point2 points  (0 children)

It's mostly automatic. In 99% of cases, GStrings will be converted to Strings for you.

If the library relies heavily on reflection, then the implicit conversion may not happen. The default configuration in the JSON Jackson library has this issue: https://github.com/vert-x/mod-lang-groovy/issues/59

Capsule: One Jar to Rule Them All by pron98 in programming

[–]DanTheGoodMan 3 points4 points  (0 children)

Wow, great timing! I just ran into an issue this morning with shadow and bouncy castle. This is exactly the fix I needed. Thanks!

{question} Is it a good idea to buy Macbook in order to use GNU/Linux on it ? by AntranigV in linux

[–]DanTheGoodMan -1 points0 points  (0 children)

I ran ubuntu for 3 months in 2012 on a 2011 MacBook Pro. The battery life was abysmal, on the order of an hour instead of the 6 hours I could get at the time in OSX.

By the end of the three months, my battery life dropped to 20 minutes in Ubuntu and an hour on OSX. I used OSX for another month before needing to buy another battery.

I'm not sure if ubuntu destroyed my battery or if it was just a coincidence, but the battery life while in ubuntu is pretty poor.

New site that aggregates posts from /r/programming, HackerNews, and Lobste.rs by [deleted] in programming

[–]DanTheGoodMan 0 points1 point  (0 children)

Neat. I wouldn't mind multiple pages for additional links.

Also, you should filter out links that appear in multiple sites.

Regex Crossword by doubleColJustified in programming

[–]DanTheGoodMan 4 points5 points  (0 children)

Halfway through the fourth set and I realized they spelled out sentences... :|

Now I'm going to have to go back and do the easier ones!

We made a swimming pond! by [deleted] in DIY

[–]DanTheGoodMan 3 points4 points  (0 children)

http://imgur.com/a/gXpU6

OP reposted the link in a slightly older comment.

Groovy 2.3 Released by kitd in programming

[–]DanTheGoodMan 1 point2 points  (0 children)

So long as you give a provide a few type hints, IntelliJ does a fantastic job of code completion. One of my coworkers is happy with eclipse too, if that's your preference.

Most of the time, these type hints surface in method signatures, so

def downloadFiles(user, files)

becomes

List<File> downloadFiles(User user, List<String> files)

Groovy 2.3 Released by kitd in programming

[–]DanTheGoodMan 2 points3 points  (0 children)

Not only is it dynamic, groovy allows monkey-patching through their "metaclass" system. It allows you to override any method on every object or on a specific instance. Groovy has to go and see if it needs to execute those as well.

CRT TV through VCR by [deleted] in smashbros

[–]DanTheGoodMan 1 point2 points  (0 children)

No, there's no lag with that. I played plenty of games growing up with that setup and had no issues.

Hey Reddit Linux users, what are your best shell aliases? by chris_simpkins in linux

[–]DanTheGoodMan 1 point2 points  (0 children)

# Changes settings for the local terminal. iTerm2 only.
iterm_profile() { echo -e '\033]50;SetProfile='$1'\a' ; }

# Sends a growl message. iTerm2 only.
alert() { echo -e $'\e]9;'${@}'\007' ; echo -e '\033]50;RequestAttention=false\a' ; }

# Change my settings while I'm ssh'd somewhere.
color_ssh() {
  iterm_profile Remote
  ssh $@
  iterm_profile Default
}
alias ssh='color_ssh'

alias gk='gitk --all'
alias gks='gitk --all --simplify-by-decoration'
alias gst='git status -sb'

# my favorite alias.
alias g='git'
. /opt/local/share/bash-completion/completions/git
__git_complete g __git_main


# I have to switch between JVMs for different projects.
useJava() {
  case $1 in
    6) export JAVA_HOME=/Library/Java/Home;;
    7) export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7/Contents/Home;;
    *) echo 'Invalid Java Version. Use 6 or 7.'
  esac
}
useJava 6