Better HN
topnewbestaskshowjobs
Log inSign up

16bytes

781 karma · joined Jun 2, 2011 (15y ago) · 212 submissions

Submissions

comment 9y ago · link · parent

Actually, I work in analytics well inside the commercial sector. 10 digits of accuracy works most of the time, and when it doesn't there are other alternatives. As with anything there are trade-offs.

I wish more languages would do this and I happily applaud Perl 6 and go for allowing sane operations in the real space without needing separate packages.

But there are high quality packages for all modern languages that allow you to get precision if you need it.

I'm not debating the utility of this feature, but I am saying it's not--by itself--going to make me want to pick up Perl 6 for my next project.

comment 9y ago · link · parent

I'm not saying there aren't applications where it is useful. If you can't tolerate errors, then you typically don't use floats in the first place. We've been running banking/accounting software for a long time without Perl 6.

What I am saying is that this isn't a killer feature.

It makes me go, "Oh, neat", and not, "Wow, this will make my life so much easier".

comment 9y ago · link · parent

Yes, I understand the example. It's a classic floating point numbers demonstration.

What I am saying is that I have not encountered a real-life case where this would have made my life easier.

Again, it's neat, but not a real reason to move to a new language.

comment 9y ago · link · parent

I've never faced a problem in another modern language where math became a big problem. Even using something like numpy made never made me frustrated with, say, python's numerical types.

From what I've seen perl6 makes some operations more convenient. Cool, I guess, but not a great reason to reach for perl6.

Grammars are really cool, and one reason I might reach for perl6, but you also have really great special-purpose tools like Antlr. I suppose I don't feel the need grammars that often to need them reified in my language of choice, but next time I need to do some parsing, however, I will probably play around with perl6.

comment 9y ago · link · parent

Even though this could more properly be called, "Why having language support for M:N thread multiplexing is important", I thought it was a refreshing article on why I might actually use a bit of perl6.

Last year I attended a conference and saw Larry Wall speak. It was an overview of Perl 6 and I was completely underwhelmed. Larry spent about half the time talking about unicode support. It wasn't a boring talk, but I never felt a moment when I said, "Awesome! This is a pain point in some other languages and I would pick up perl6 if this ever happened again."

I don't want to write perl6 completely off, but I have found that perl6 advocates have not done a great job on why you would actually want to use it. It's hard to justify learning "different" syntax just because someone says, "hey, it's fun!".

126.

CNN reserves right to dox GIF creator should he resume “ugly behavior”(reddit.com ↗)

6 points · by 16bytes · 9y ago · discuss

127.

Petya.2017 is a wiper not a ransomware(blog.comae.io ↗)

1 points · by 16bytes · 9y ago · discuss

128.

Bitcoin surges to all-time high above $1,700(reuters.com ↗)

183 points · by 16bytes · 9y ago · 205 comments

comment 9y ago · link · parent

The way I remember it is if you were single-stack from client to server, yeah, EJBs and others in the J2EE worked pretty well.

On the other hand, if you wanted to get of the rails and have clients in multiple stacks and clients who talked to different stacks, then it just all fell apart. Even multiple vendors in the J2EE space could be a problem.

Being able to do things simply hid a lot of complexity. It was hard to investigate that complexity when things went wrong.

It feels like chaos today, with myriad front-end frameworks and best practices changing every three months, but I would take this over mid-2000's Java tech because it just simply seems like less magic. I can break out Postman and just see what's going on.

I agree that there's no golden bullet, and that there's no end of crappy REST definitions. Furthermore, it's mostly not even REST, not in a HATEOAS kind of way.

But that's ok, I still feel more productive than I did 15 years ago, and I wouldn't want to go back.

comment 9y ago · link · parent

There is wide disagreement about drivers employment status.

There are several localities that have had legal status ruled one way or the other [1][2], but it's not settled enough to be able to claim that uber drivers aren't employees.

Uber, on the other hand, certainly would like to classify them as such.

[1] https://www.cnet.com/news/uber-uk-court-ruling-drivers-emplo...

[2] http://www.theverge.com/2016/4/21/11485424/uber-suit-califor...

comment 9y ago · link · parent

The demoscene relies heavily on procedural generation to cram a lot into a little tiny executable.

GUI toolkits aren't comparable in this regard.

comment 9y ago · link · parent

That's a completely unsupported assertion.

Why would the CPython devs punish one of the largest and well known python projects by moving to a non-python DVCS? That would create an absolutely toxic effect in the python community.

They didn't move from mercurial because of python any more than they moved to Git because they like C.

comment 9y ago · link · parent

Why would it matter if mercurial has python 3.x support? For writing hooks and extensions?

The mercurial team prioritized end-user features, like evolve, over moving to Python 3, which would only affect a very small number of mercurial users (mostly devs).

I've personally moved to Python 3 for most development and not once have I encountered a case where I couldn't do something in mercurial that would have been possible if the core code was on python 3.

comment 9y ago · link · parent

If you had an intern that was responsible for turning GZIP on in IIS for a website that had 1B users it starts to become much more of an accomplishment.

Even small changes at that scale require careful analysis and coordination.

comment 9y ago · link · parent

What about breaking this table into to parts, 00000-01111, and 10000-11111?

https://jsfiddle.net/y0pyaax9/

It's a bit easier (for me) to read, if it's on one page. Also, it makes a bit more explicit that digits start at 0110000.

comment 9y ago · link · parent

I don't understand the claim that Akka actors are both impure and non-deterministic.

If your actor is communicating only through its inbox, then it is both pure and deterministic. Given the same set of messages in the same order, you arrive at the same actor state. Sure, you can do wacky things with side-effects, but that's not akka's fault.

> in general if you place those in the same article, there's a high probability that you never did functional programming; and if you did actual functional programming

This sounds a lot like the "no true Scotsman" fallacy. I'm not attacking your argument here, but perhaps you could expound upon that first point and clarify.

comment 9y ago · link · parent

Neat game! It would be interesting to hear about your ad revenue numbers, especially before and after pointing to HN.

Also, it sounds like you're thinking about a paid, ad-free version. It would be another interesting analysis to compare the revenue streams of both apps.

Cheers! Great work!

comment 9y ago · link · parent

I think the argument for UBI would say that OP is better served not working in that position, because it's not what he wants to do. The employer, would then hire somebody else who actually wanted to do that work (I actually don't mind designing UI sometimes).

Or failing that, would have to raise compensation until they got somebody who agreed to do the work.

It seems that under the UBI system, the labor pool is more efficient. By taking away the basic requirement of needing to work, you introduce a more fair supply-and-demand free-market labor force. Currently this is tipped far in the favor of employers because employees' livelihood is at stake, and this asymmetric power dynamic suppresses wages.

comment 9y ago · link · parent

There's a lot of if's here. My only point is that it didn't sound like an obvious overreach by prosecution.

Would I risk gun ownership if I thought my family was in imminent danger? Without question. I would have even done so even if I risked significant jail time.

But here, it's not just "borrowing" a firearm from a friend, it was an illegal purchase. Did this person look into restoring their gun-rights due to extenuating circumstances?

Was justice served? Hard to said because, as I said, we don't have all of the information.

But it's also hard to say that somebody convicted of felon in possession of a firearm, who was in fact both a felon and in possession of a firearm, was an abuse of the legal system.

comment 9y ago · link · parent

Manslaughter may not have even been the harshest puninshment, since depending on the circumstances, you could argue the act was a death during the commission of a felony.

IANAL, but jail time is not only protective, but punitive and a deterrent. Illegally obtained firearms are a huge problem in the US.

You and I know only anecdotal details about this case so arguing about societal impacts and fair self-defense are pointless.

comment 9y ago · link · parent

So there was an ex-felon with an illegally obtained firearm, who used it--albeit defensively--in a homicide, and that's prosecutorial aggression?

We'll never know for sure if the gun helped or hurt this man's family safety, as the mere presence of a gun can escalate a situation out of control.

But even from the facts that you mention, it's hard to call this unnecessary prosecution.

comment 9y ago · link · parent

> Because correct me if I'm wrong, but the majority of interview questions are based on CS 101

AFAIK, they actually send out a prep-sheet which recommends experience with not only big-O and simple algorithms, but knowing how search algorithms compare, dijkstra's algorithm, A*, graphs, trees, networks, http, combinatorics, etc.

I'm not sure which CS 101 you took, but to me that's not 101 stuff. They definitely expect a candidate to know nearly all of what you'd learn in an entire typical CS program.

comment 10y ago · link · parent

> No wonder R and Python are the only languages popular in ML

R is a curious counter-example, given that the '%>%'[1] operator in dplyr is nearly identical to the '|>' operator in F#. Given dplyr's ubiquity, it would seem that people coming from R would have no issue with F#.

[1] https://cran.rstudio.com/web/packages/dplyr/vignettes/introd...

comment 10y ago · link · parent

Thanks for the additional links. My first thought was, "is today April 1st?", but this appears to be real.

This is good work. I like this new Microsoft.

comment 10y ago · link · parent

If you used Bower and Angular in 2011 and disappeared for 5 years, then nearly all of the stuff that the "js guy" talks about would be new to you.

comment 10y ago · link · parent

Thanks for continuing to indulge me in this conversation. So, if I understand you correctly, your data looks something like this:

    StudentId|    Name |CourseId
    ============================
            1|      Bob|       1
            2|     Jane|       1
            1|      Bob|       2
            1|      Bob|       3
            2|     Jane|       4
With many more columns of course. The point being that it's a denormalized listing of student-course pairs. If so, you'd be able to get immutability by reading the query result into a data table and doing something like:

    var result = from row in dt.AsEnumerable() 
    group row by row.Field<int>("StudentId") into grp 
    select new Student(
        grp.Key,
        grp.First().Field<string>("Name"),
        from courseRow in grp select new Course(courseRow)
        );
This seems to satisfy all of the conditions that you list (namely immutable objects), but with the added advantages of not needing a inner Completion class, and a number of less lines of code.

Furthermore this is less coupled because now the Student class doesn't need to worry about DataReaders or DataTables or which column names to read from.

I would also argue that this version is a lot easier to read and reason about.

I think you could make a similar transformation for any circumstance in which you wanted to use an out variable in the fashion you outline.

Does that make sense? Is there another case in which you would advocate for our variables in new code?

comment 10y ago · link · parent

Thank you, in turn, for replying. I'm of the opinion that out variables have little value if you have tuples and deconstruction, but I wanted to understand your point. I'm not sure I do, unfortunately. I'm little out of practice with C#, so bear with me.

Back to this code:

  if(!memo.TryGetValue(rdr.GetInt32("student_id"), var out complete)
    memo.Add(new Student(rdr out complete).ID, complete);
There's a parens missing on the end of the if, correct? Also I can't parse the student c'tor:

  new Student(rdr out complete)
I was assuming there is a comma in there somewhere. Does this compile? What does "out" do here? I thought you were getting a new out variable, but that's not correct since you wouldn't be able to name it the same in the same scope.

Also, I don't see how "complete" is ever non-null. If the ID isn't in the dictionary, then TryGetValue returns false and "complete" is null. Then you add the null "complete" to the dictionary, and throw away the Student object (which apparently does other side effects) once you have its id? If ID is in the dictionary, you get back what you inserted, which is still null.

And then you call .AddCourse on the possibly null reference? I'm lost.

Can you post the code again? Maybe I'm just missing something due to a syntax error.

comment 10y ago · link · parent

So I'm taking a look at this line:

  if(!memo.TryGetValue(rdr.GetInt32("student_id"), var out complete)
    memo.Add(new Student(rdr out complete).ID, complete);
I think I understand your point, but I found this code really hard to read. You don't use the first var out complete in the TryGetValue, right? And the Student c'tor returns itself as an out parameter?

If I understand you correctly, you like this because you don't have to declare a new student before you add it? I.e. the alternative would be

  if(!memo.ContainsKey(rdr.GetInt32("student_id")))
    var student = new Student(rdr);
    memo.Add(student.ID, student);
I guess I would prefer this over the former. Also, why not enforce your student ID constraint in SQL instead of putting everything in a dictionary only to take it back out again? That would simplify your code to the point of just being a map from rdr->Student. Furthermore, if all I had was the Student c'tor, I would never guess that was the intent of the out parameter. This seems more anti-pattern than pattern.

I would rather put a simple IEnumerable in front of SqlDataReader so that you could just do:

  foreach(var row in rdr) yield return new Student(row)
This doesn't obviate your use case, however, which is to inline a variable where it's needed in multiple places in that line because you can save yourself an explicit declaration. In this case, however, I think that the increased readability justifies the explicit declaration.

comment 10y ago · link · parent

> Out variables are really great when working with existing code that predates Tuples (for example, the entire BCL). We don't just introduce language features that will only work well for new code. We also want to make the experience of coding against existing APIs feel better.

I disagree on this point. If there is a language feature that has been superseded by a better alternative, continuing to add sugar to the old feature only serves to perpetuate its use.

It embiggens the language while providing relatively little value in return. Furthermore, it adds confusion as to what should be considered idiomatic.

Tuples and deconstruction are so clearly better than out variables, I would have thought it would make more sense to deprecate the "out" feature entirely. Or, at the very least, not make it easier to use them.

Awkward and outdated features should be painful to use.

I also felt that this was a very odd addition. Even odder, the article doesn't even list tuples and deconstruction first.

comment 10y ago · link · parent

A questionnaire with results would not be a bad way to describe an initial interaction with a lawyer.

"Did you say yes to these 10 questions? If so, you have a case and we'll proceed. I'll file some paperwork for you."

If the target topic is as small and well-constrained like this one, it's not a far jump to consider this a legal service.

1
45678