News for hackers. Stuff that matters.

jhdevos

> It looks as though cryptkeeper makes assumptions about encfs' command-line interface that are no longer valid.

This looks like a developer mistaking a command line interface for an API.

Unless an (interactive) CL interface is explicitly marked as being an API, and documented in such a way, and regression tests exist to make sure the interface remains backwards-compatible - you should never program against it. Ask for a proper API to access.

(edit: formatting)

This is explained in the article in a bit more detail. The point is not that the type system does something with the actual value - the point is that it would be impossible to create any code that results in such a value (other than null), since then you would have to provide an actual type that is somewhere between Integer and String - and that would obviously not pass the type checking. Using null avoids that.

Section 4.5 in the language spec deals with parameterized types; 4.5.1 deals with wildcards. Of course, there is no example in the specs that clearly points out what happens in this example - otherwise this wouldn't have remained undiscovered for so many years :)

If you can show, using the rules in the spec, that the sample program shouldn't pass type checking, then you'll have proved the article wrong :-)

I don't see the headline as misleading at all. There are two type systems in Java: the JVM's run-time type system, and Java's compile time type system. It's the latter that has been shown to be unsound. As the paper notes, it's fortunate that generics have been implemented with type erasure, because that is what saves the JVM from being unsound, too.

As for the problem itself: it really has nothing to do with inner classes (they are static in the example!). The problem is with this line:

    Constrain<U,? super T> constrain = null;
which leads the type system to assume that there is a type that is a superclass of T, which also is a subclass of B (from the 'Constrain' class) - even though no such type could possibly exist! The evil trick is in the 'null' - even though a type with the stated constraints is impossible, and so no actual 'real' value of this generic type could exist, 'null' is part of all types, so the compiler can't see the problem.

It really is a problem in the type system as defined in the standard, not just a compiler bug.

Re:Myths about Hash Tables on Friday September 30, 2016 @05:57AM (#12611481)
After interviewing many more and less experienced programmers (and asking most of them if they can explain a hash table - just for statistics!), I concur that most cannot.

There were quite some people that thought trees were faster than hash tables though - mostly the ones that had some incling of what a hash table does, but didn't know the entire picture. At least in all those cases I had the pleasure of educating them a little bit :-)

Re:Judge wipes out patent troll’s $625M verdict against Apple on Wednesday August 03, 2016 @06:23AM (#12216949)
> First the law expressly forbids a patent on ideas.

Only in the sense that you can't forbid anyone else /having/ an idea, just that you can forbid them doing anything with it.

In software, it is definitely the idea that is protected, not the specific implementation - otherwise, copyright would be enough.

Re:Google achieves AI 'breakthrough' by beating Go champion on Wednesday January 27, 2016 @03:23PM (#10982927)
Of course, another question is: will the AI's consider us humans to have the equivalent of their consciousness? Or will they think "These humans don't not really possess consciousness, they just exhibit a crude biological simulation of it".

(BTW: This is not just meant as a joke, nor just as instigating fear of the singularity - turning a question on its head can sometimes lead to interesting insights).

Re:SourceWeb: A C/C++ source code indexer and navigator on Thursday January 21, 2016 @12:17PM (#10946652)
Any idea what the best vim plugin for rtags is? I see there are several...
Re:Mindfulness meditation trumps placebo in pain reduction on Saturday November 14, 2015 @03:30AM (#10564955)
True - which is why they did the cream as well. At the very least, this study tells us that the mindfulness meditation is a 'more effective' placebo than the cream.

It's very hard do really do in a 'double blind' way - I would not be able to think of something that is to all appearances equal to the real mindfulness mediation, but actually only a fake. There's no substance to it.

Do you have any suggestions to do it better?

Re:A Puzzle Book That Drove England to Madness on Monday September 28, 2015 @03:57AM (#10289326)
Yeah, the original Eternity puzzle (https://en.m.wikipedia.org/wiki/Eternity_puzzle) was a lot better in that regard - it spiked a whole online community focused on finding clever ways to find a solution, and was in fact solved within a year.
Re:The Humble Programmer on Thursday August 06, 2015 @05:25AM (#10015391)
Integer overflow?
Re:Musicians launch campaign to save the bassoon on Monday August 03, 2015 @04:31AM (#9994441)
Having played on (and heard people play on) a pBone, I'd have to say that even though it's quite impressive to see what they've been able to do with just plastic, it's still quite some way off from being a 'quality' instrument.

And they do not prove at all that the same can be done for any kind of instrument: trumpets and trombones are a lot cheaper to make than things like bassoons - you can find very cheap brass trumpets on ebay for very little money, some of which are surprisingly acceptable; and a rather good trumpet will set you back quite a lot less than a basson only fit for a beginner.

Re:Should I Use Signed or Unsigned Ints? on Saturday August 01, 2015 @06:46PM (#9989013)
That seems like a false sense of safety: when doing arithmetic, your program is most likely not going to be handling overflows correctly anyway. Also, when using unsigned ints, any code involving subtractions can lead to subtle bugs that only occur when one value is larger than another. I'd recommend sticking with signed ints for all arithmetic code.
Re:India blocks Colgate patents for spices on Monday July 20, 2015 @08:56AM (#9915648)
In firefox: Preferences -> Advanced -> enable "Warn me when websites try to redirect or reload the page".

Other browsers will probably have similar options.

I think when smaller companies have patents, they tend to be closely related to their core business, and they have them precisely in order to use them 'offensively' - or, in other words, to protect their core business from companies that want to 'copy' them.

In principle, that is sort of what the patent system was intended for. (I still don't agree with it, but that's another story).

Re:Manacher's Algorithm – Longest Palindromic Substring on Thursday February 19, 2015 @07:42AM (#9073721)
Wording is a bit sloppy: "Extending R (the inner while loop) takes at most a total of N steps, and positioning and testing each centers take a total of N steps too. Therefore, this algorithm guarantees to finish in at most 2*N steps, giving a linear time solution."

What he means is that the total time taken by ALL executions of the inner loop combined is at most N, not that each run of the inner loop takes at most N steps (otherwise it would become quadratic).

Re:Writing Multithreaded Applications in C++ on Saturday February 07, 2015 @02:20PM (#9015001)
> Where can i find more information regarding this.

The C++ standard, of course :) But if you prefer some lighter reading, either http://www.cplusplus.com/reference/mutex/mutex/unlock/ or http://en.cppreference.com/w/cpp/thread/mutex/unlock explain what happens, in slightly different ways. I usually prefer the cppreference version, because it uses terminology from the standard more consistently, but there is no harm in reading multiple explanations about difficult concepts like these :)

I'd repeat the explanation here, but I think you'd best be served by reading one of the two links above.

Re:Ten years of Ubuntu on Thursday October 23, 2014 @04:24PM (#8500540)
> Will Windows run on it? Well... Yeah. Windows runs on everything powered by an x86 processor.

I've tried installing Windows 7 on an old Dell laptop a while ago. I got it working eventually, but had to hunt around for drivers for various things -- rather important things, like network, and video. In the end, I had to persuade some download site to give me the Windows XP drivers for the video card, and it worked with that (which, btw, is pretty awesome).

Of course, this is just anecdote, just like any story about Linux not working immediately on some modern laptop is -- but my experience is that these kinds of issues are much rarer than 10 years ago. Especially with Linux (with which I have most experience), but also with Windows.

Re:Simple CPU on Monday October 20, 2014 @06:34AM (#8481437)
A button to execute a single instruction would also be nice.
Re:A replacement for JavaScript's “alert” on Wednesday October 08, 2014 @08:52AM (#8426601)
In fact, the animation draws attention away from the text, which you are probably supposed to read (otherwise, why bother with an alert). I really don't understand this infatuation with distracting unnecessary animations that people have nowadays...
Re:Netherlands bans illegal downloading on Thursday April 10, 2014 @09:42AM (#7565958)
No, we don't want that. A while ago there was even a headline here that boils down to 'Illegality will not be punishable'.

This was about people residing in the country illegally. Everyone understands the headline immediately, but it's still pretty ridiculous.

Re:Why Stack Overflow in Portuguese? on Thursday February 13, 2014 @02:45PM (#7233751)
Mine was 'REDO FROM START' :-)
Re:Why Stack Overflow in Portuguese? on Thursday February 13, 2014 @02:42PM (#7233736)
The answer to your '(is it?)' is 'No!', english is just the language of the programming culture that we are part of.

And that is the whole point of this article; there already is a lot of programming culture that we simply don't know about because those people don't hang out on HN. They deserve a StackOverflow, too :)

Re:Ask HN: How to learn OpenCL on Sunday January 26, 2014 @02:58PM (#7126571)
To add some reasons why you'd want to learn CUDA first: It turns out that simple things are a lot simpler, and take a lot less code, in Cuda than OpenCL. With Cuda, your kernel and host code will be close together in the same file. You'll need a /lot/ less boilerplate than are needed in OpenCL to accomplish even the most simple things. OpenCL exposes you to a lot more concepts, and a lot more extrinsic complexity, than Cuda. All this means just playing around a lot easier to do in Cuda.

Just take a look at some simple examples in both, and you'll quickly see what I mean. Even though I'm a fan of OpenCL because it is available on more platforms, Cuda is a lot better suited as a learning platform.

Re:What are the 'real numbers', really? on Thursday December 26, 2013 @02:42PM (#6967654)
Perhaps your intuition changes if you think about the line (in a plane) coinciding with the x-axis. Don't you think it is reasonable to define that line as the set of points (in the plane) having y=0? Also, should that line not be identical (isomorphic) to the set of real numbers - which is just a set of numbers? And should not all other lines in the plane be identical (isomorphic) to the first line?
Re:Git Cheatsheet on Friday November 08, 2013 @03:43PM (#6699011)
Small fun bug: if you click twice on an item, the description at the bottom shows 'git null' :)
Re:Why didn't we patent the spreadsheet? Were we stupid? (1999) on Friday September 20, 2013 @04:37PM (#6420359)
Exactly. Innovation in the field of spreadsheet programs would have completely stagnated by keeping it limited to a company that was clearly done innovating. Their lack of further innovation would only have been greater with a monopoly.
Re:It's not the $7, but the principle on Saturday August 31, 2013 @06:22AM (#6306426)
Does seem like an 'honest' bug. I did what the OP did (except I checked the middle option), and when you then look at the source of the page, it includes

  <div style="margin:20px 10px 32px 0px;padding:0;background-color:#eeeeee;border-bottom:#cccccc 1px solid; width:220px; height:300px; background:url(images/print-int-2013.png) no-repeat; float:left;"><input name="cds_term_value" type="radio" id="radio" value="1"  style="margin-top:138px;margin-left:10px;" /></div>
  <div style="margin:20px 10px 32px 0px;padding:0;background-color:#eeeeee;border-bottom:#cccccc 1px solid; width:220px; height:300px; background:url(images/digital-int-2013-v2.png) no-repeat; float:left;"><input name="cds_term_value" type="radio" id="radio" value="2" CHECKED style="margin-top:138px;margin-left:10px;" /></div>
  <div style="margin:20px 10px 32px 0px;padding:0;background-color:#eeeeee;border-bottom:#cccccc 1px solid; width:220px; height:300px; background:url(images/bundle-int-2013.png) no-repeat; float:left;"><input name="cds_term_value" type="radio" id="radio" value="3"  style="margin-top:138px;margin-left:10px;" checked="" /></div>
The 'div' that you had checked earliers has an empty 'CHECKED' attribute, while the third one has the 'checked=""' that firefox apparently picks up.
Re:iOS 7 looks familiar on Wednesday June 12, 2013 @07:18AM (#5867507)
> Uhh... the whole idea with the present generation of smartphone (software) comes from the iPhone.

Oh come on. It's an evolution of what was there before; Palm OS was already very clearly moving in that direction. There is very little that is conceptually new in the first iPhone.

The execution was superb, and everyone certainly got shaken awake by the fact that that level of quality was even possible... but the core ideas were already there.

Re:CUDA grep on Saturday June 01, 2013 @04:21PM (#5805798)
I don't see what hardware they tested on. What are the specs of this GHC 5000 computer they mention?
Re:C++11 breaking changes in const-correctness guarantees on Thursday May 30, 2013 @07:16AM (#5791816)
There are two different considerations:

* what the compiler will enforce: this has nothing to do with thread safety, and will allow what you mention.

* what guarantees the standard library will give:

[17.6.5.9/3] A C++ standard library function shall not directly or indirectly modify objects (1.10) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s non-const arguments, including this.

This means that the standard library assumes that your const objects will be thread safe in order to guarantee thread-safety itself. Updating a global without synchronization is not thread-safe.

Older »