HNHacker News
TopNewBestAskShowJobs

Kristine1975

2,687 karma · joined October 2, 2015

submissionscomments
Kristine1975··on Final features of C++17
Lambdas support that in C++14 (generic lambdas/polymorphic lambdas).
Kristine1975··on Final features of C++17
>I need to assert in the base class that all my "derived" classes implement a method with a certain signature. Does C++ allow me to do this?

Of course (C++14, possibly C++11):

  #include <type_traits>
  
  template <typename T, typename... Params>
  struct HasFoo {
      // SFINAE will disable this function template if U has no method foo(float)
      template <typename U>
      static constexpr bool check(decltype(std::declval<U>().foo(std::declval<Params>()...))*)
      {
          // We don't check foo's return type here
          return true;
      }
      
      // Fallback if above function template is disabled
      template <typename U>
      static constexpr bool check(...)
      {
          return false;
      }
      
      static constexpr bool value = check<T>(0);
  };
  
  template <typename D>
  struct Base {
      Base()
      {
          static_assert(HasFoo<D, float>::value, "D must implement 'foo(float)'");
      }
  };
  
  struct Derived {
      void foo(int)
      {
      }
  };

Since this essentially simulates a method call, implicit conversions work, as does overloading "foo".

As you have to implement "HasFoo" for every method you check, a macro will come in handy, say MAKE_METHOD_CHECK(Foo, bool, float)

I added some comments, feel free to ask if something is not clear :-)

Kristine1975··on Stop Bashing G.M.O. Foods, More Than 100 Nobel Laureates Say
>Talking about 2050...

I don't think it's useful to not do anything merely because it's possible the future might turn out like you describe. We (as in humanity) should try to solve the food problem while also preventing nuclear war etc.

Or did I misunderstand what you're saying?

Kristine1975··on Stop Bashing G.M.O. Foods, More Than 100 Nobel Laureates Say
>Do you have a source for GMO improving nutrition?

Golden Rice comes to mind: https://en.wikipedia.org/wiki/Golden_rice >Golden rice is a variety of rice (Oryza sativa) produced through genetic engineering to biosynthesize beta-carotene, a precursor of vitamin A, in the edible parts of rice.

But see: https://news.ycombinator.com/item?id=12015708

Kristine1975··on FAQ from Guccifer 2.0
Maybe he used that style on purpose to mislead any adversaries?
Kristine1975··on FAQ from Guccifer 2.0
Russian source just for fun: https://www.rt.com/usa/347681-guccifer-clinton-dnc-defense/

Hacker 'Guccifer 2.0' publishes DNC campaign docs with strategies for defending Clinton

The handle is a reference to https://en.wikipedia.org/wiki/Guccifer

Kristine1975··on FAQ from Guccifer 2.0
That's mostly conjecture. No facts, just observations that might be true or not.
Kristine1975··on FAQ from Guccifer 2.0
That article seems to be mostly speculation, though. Maybe Guccifer is a Russian, but not affiliated with the Russian government (aka Putin aka Ivan the Terrible).

But apparently this is The Cold War 2.0, and whenever Russians may be involved, this means that the Russian government is involved...

Kristine1975··on Spanish authorities raid Google offices over tax
Destruction of evidence?
Kristine1975··on Spanish authorities raid Google offices over tax
>Google is ruthlessly paperless internally.

Not if they have to keep information on paper to comply with the law.

Kristine1975··on Spanish authorities raid Google offices over tax
If Google paid €8.8b in fees to avoid paying taxes, just how much taxes are we talking about?

Also seconding vmateixeira: Thanks for your research!

Kristine1975··on How China Took Center Stage in Bitcoin’s Civil War
>Ironic that Bobby Lee calls the Americans imperialistic

He doesn't:

He said the American companies failed to understand the power dynamics in the room that day. “It was almost like imperialistic Westerners coming to China and telling us what to do,”

almost like

And as the article states Chinese firms are hardly a hive-mind. But even if they were, "taking control" by virtue of mining the most coins is a feature, not a bug. And not "imperialistic."

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>but money is not the only thing of value an internship can (or should) provide.

Of course not. But unpaid internship is always exploitation.

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>Both are facile.

Proof by assertion?

Kristine1975··on Universal rendering with SwiftShader, now open source
It also seems to have parallels to Apple's OpenGL implementation which, if the hardware doesn't support the required functionality, falls back to software rendering. It uses LLVM to dynamically generate machine code.

It's also dead slow (obviously).

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
> how does that work?

Unpaid internship. Aka exploitation.

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>Tyler Durden quote

So it's mainly uttered by fascists? (Tyler Durden is a textbook fascist) Sounds about right.

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>gang up

So aggressive and aggravating!/s

>a reasonable decision

Who says the dress code is a reasonable decision?

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
Every human is special.
Kristine1975··on I was fired from my internship for proposing a more flexible dress code
Oh yes, so aggravating/s
Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>it was determined long before you got there that the dress code would help them achieve that goal.

That's a big assumption to make. I doubt the company ever tested whether their business made more or less money without dress code.

Kristine1975··on I was fired from my internship for proposing a more flexible dress code
The other 10% it's a slur used to attack everybody who doesn't want to be a submissive corporate pawn. See the comments in this very thread.
Kristine1975··on I was fired from my internship for proposing a more flexible dress code
>to push back on it in such an aggressive way.

Yes, a petition is really aggressive/s

Kristine1975··on The real damage Brexit will do do this industry is the one you won't see
Original title: "What Brexit Really Means for Independent Developers"

I would add: "in the UK", since that is what the author is talking about.

Kristine1975··on Apple could block iPhone camera at cinemas, concerts
How so?
Kristine1975··on Ask HN: Examples of reliable software you enjoy using
How does it compare to mpv?
Kristine1975··on Donald Knuth: Surreal Numbers [video]
I guess this refers to Donald Knuth's "3:16 Bible Texts Illuminated": http://www-cs-faculty.stanford.edu/~uno/316.html >The text found in chapter 3, verse 16, of most books in the Bible is a typical verse with no special distinction. But when Knuth examined what leading scholars throughout the centuries have written about those verses, he found that there is a fascinating story to be learned in every case, full of historical and spiritual insights. This book presents jargon-free introductions to each book of the Bible and in-depth analyses of what people from many different religious persuasions have said about the texts found in chapter 3, verse 16, together with 60 original illustrations by many of the world's leading calligraphers. >The result is a grand tour of the Bible -- from Genesis 3:16 to Revelation 3:16 -- a treat for the mind, the eyes, and the spirit.
Kristine1975··on The life of American workers in 1915
The Industrial Workers of the World was founded in 1905 in Chicago: https://en.wikipedia.org/wiki/Industrial_Workers_of_the_Worl...

There was also the Women's Trade Union League, founded in 1903, and the American Federation of Labor, founded in 1886.

Kristine1975··on Using Multi-Byte Characters to Nullify SQL Injection Sanitizing
String literals in SQL were a mistake.
Kristine1975··on Spoiled Rotten (2012)
>the children are under pressure to prove their worth to the family

This sounds like a really dysfunctional family to me.

← PreviousPage 4 of 26Next →