Better HN
topnewbestaskshowjobs
Log inSign up

devit

4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions

Submissions

comment 6y ago · link · parent

I don't think it's likely that you ever really need query hints.

Even if updating analyses, creating indices, changing the query, etc. fails, you can always either use CTEs or temporary tables, or use a stored procedure that manually iterates over results to implement whatever strategy is desired.

It might be more time consuming than having query hints, although this is compensated by the fact that almost always queries just work after creating appropriate indices.

comment 6y ago · link · parent

"create stand alone database: ~30m"

If creating a database takes 30 minutes, there is something extremely wrong either in the procedure the person used to do so, or in the Oracle software itself.

comment 6y ago · link · parent

Reselling at higher price is only profitable if the original seller are selling at a price that is too low because they failed to raise the price properly, and in that case the resellers are correcting the prices.

The advantage of having higher prices is that only people who REALLY need an article will buy it, so limited supplies will go to them.

For instance, if FFP2 masks are in a limited supply and cost $0.01 each, then everyone is going to try to buy in lots of 1000, and they will run out immediately, with the supply going to random people who probably will not even use most of them.

But if FFP2 masks cost $100 each, then people will buy and use them only when strictly needed, and they will be available for those who absolutely need them and are thus willing to pay any amount of money.

The only problems are:

- People who irrationally try to price gouge when the price is already correct, costing themselves money and making the article unavailable

- The potential inability of people who are highly needy to obtain loans or have sufficient basic income to purchase high-priced supplies

The former is fixed by providing the forecasts that are used to set prices, thus providing a credible insight that there will be no shortage at current prices, while the latter by having better ways of ensuring that loans are repaid and generally making it easier to give out loans.

comment 6y ago · link · parent

While equivalent to a proper approach, it feels like hooks are an unnecessary hack.

What could be done is to have the component function return a closure that returns the VDOM nodes instead of the VDOM nodes themselves, and then the hooks would be run only once, since rerendering would only run the returned closure and not the whole component function, and there would be no need for the magic or rules.

Like this:

  const Component = component((comp) => {
    const [show, setShow] = useState(comp, false);

    return (...props) => (
      <div>
        <button onClick={() => setShow(!show())}>Show Menu</button>
        // Mounted with show = true and unomunted with show = false
        {show() && <MenuDropdown />}
      </div>
    );
  });
Where the changes are that the hook takes the component as an argument, show is now a function rather than a value and a closure (that takes the props) is returned rather than returning the VDOM nodes directly.

The React Hooks API is essentially equivalent to this, but inelegant, unintuitive and somewhat inefficient.

comment 6y ago · link · parent

It's easy to see that this cannot be a valid definition for fraction addition because applying it along with the rule that a/b = (ak)/(bk) gives a contradiction:

3/7 = 2/4 (+) 1/3 = 1/2 (+) 1/3 = 2/5, absurd because 2/5 != 3/7

Once this is realized, it's easy to see that the correct formulation for the "table joining" operation used here is a weighted arithmetic mean, i.e. a(/)b (+) c(/)d = weighted arithmetic mean of a/b and c/d with relative weights b and d = ((a/b) * b + (c/d) * d) / (b + d) = (a + c)/(b + d).

On the other hand, fraction addition is clearly determined as a/b + c/d = ad/bd + bc/bd = (ad + bc)/bd given the a/b = (ak)/(bk) and (a/b + c/b) = (a + c)/b axioms.

comment 6y ago · link · parent

It's not a bug, it's due to the trait (aka typeclass) system.

Apparently Haskell has some restrictions that make typeclasses decidable (if -XUndecidableInstances is not set), but Rust has no such mechanism other than numeric iteration limits.

comment 6y ago · link · parent

A big breakthrough can be in finding ways to use contractors instead of employees, or in other words allowing people to contribute when they want rather than being tied in a full-time employment contract.

Obviously there are big, possibly insurmountable, obstacles related to the cost of onboarding/learning bespoke tech stacks, the need to preserve trade secrets and serial dependencies that require work to be performed quickly.

comment 6y ago · link · parent

Have you considered presenting the data in a concise manner in addition to the in-depth analyses?

That is, a table on the jepsen.io frontpage, or at least on each product's review page, with database products and configuration on rows and consistency properties on columns, and a nice "Yay!" or "Nope!" mark in the cell, plus links on how to achieve the database configurations in the table (esp. how to configure each database to have the most guarantees).

Also, ideally the analyses should be rerun automatically (or possibly after being paid, but making it easy for the company to do so) every time a new major release happens rather than being done once and then being stale.

Finally, there should be tests for the non-broken databases (PostgreSQL for instance, both in single-server mode, deployed with Stolon on Kubernetes and using the multimaster projects) as well to confirm they actually work.

comment 6y ago · link · parent

Rust can create dynamic libraries that import and export symbols using the C ABI, so it is not worse than C in such a comparisons, since it can do exactly the same thing as C.

comment 6y ago · link · parent

Rust is that language.

Some things, namely array indexing and RefCell borrowing, have unavoidable extra runtime overhead in the default safe usage, but it's unlikely that it is significant (often array bounds checks are either essential and thus needed in C++ as well or optimized out by LLVM in Rust, and RefCell usage is generally rare), and you can use unsafe unchecked operations as well.

comment 6y ago · link · parent

If the conditional is almost always true or almost always false and the CPU has a branch predictor, then a branch is likely faster; otherwise, the CMOV will be faster.

Obviously a CPU could use a predictor for CMOVs as well, although I think the commonly used CPUs don't (but not too sure).

comment 6y ago · link · parent

Especially since it seems that this extension is for paid users, you can tell them to use Firefox instead (or use Chromium and sideload the extension).

comment 6y ago · link · parent

It's kind of hard to decode the explanation given that it spends a lot of text on useless formalism instead of substance, but it seems like this language has three fatal problems:

1. Borrowed pointers are not a first class concept, but just syntax sugar over returning a parameter from a function, i.e. &T or &mut T are not actual types in Rust parlance

2. There is no mention on how to achieve safe shared mutable data or even just shared read-only data, i.e. the equivalent of Rust's Arc<Mutex<T>> or Arc<T>, which probably means the language has no support

3. It seems there is no way for a struct/record/tuple to contain another non-primitive data type without the latter being allocated on the heap

So as far as I can tell aside from the dependent types this language is much less powerful than Rust and cannot fully utilize the CPU, and hence far from the goal of having a perfect Rust+dependent types language.

comment 6y ago · link · parent

I think it's better to simply buy a very high resolution laser mouse (which are commonplace now) and map sensor displacement to screen displacement in a trivial linear way.

comment 6y ago · link · parent

Or in other words, people in Lagos and Jakarta will now have access to higher salaries (not as high as SF ones, but higher than their alternatives) because they can now work for Facebook and similar companies, rather than being discriminated because they happened to be born in Africa.

comment 6y ago · link · parent

You can just run it on your local machine and dedicate some of the cores to it with a tool like "cset shield".

If you _really_ want to avoid any contention, then build the benchmark as a Linux kernel module and call stop_machine(), which will prevent anything else including interrupt handlers from running.

comment 6y ago · link · parent

Blog discovery is now done on social networks, i.e. you publish an article on your blog (often hosted on Medium), then share it on Facebook, Twitter, Reddit, HN and then people find it there and can possibly follow you and get new articles either from the social network or from the blog itself.

comment 6y ago · link · parent

You could remove the DNS block and only block it from loading from 3rd party sites using the built-in Firefox support or a suitable WebExtension (and also block it in non-browser apps if desired by setting up a MITM proxy with a certificate only trusted by the browser and user agent filtering).

comment 6y ago · link · parent

This is an API issue, not a protocol issue.

Looking at the Android API docs, it looks like Google does not trust government apps and so provides only limited data and alerts the user with a popup when the app asks for information.

It's not clear why Google doesn't provide the UI themselves, although maybe they intend to do so at a later time?

comment 6y ago · link · parent

What is the reason for making a JavaScript runtime based on browser APIs that cannot also be a browser?

Or in other words, wouldn't it have been easier and better to make an optionally headless version of the Servo browser with additional native APIs and some enhancements like being able to run JavaScript directly in addition to HTML?

The choice made means that Deno can't be used, at least directly, to make desktop applications, and also doesn't have all the features that browsers have for free, like multiprocess and multiple sandboxes, network traffic inspector, local storage, GPU compute, etc.

comment 6y ago · link · parent

Your device can and probably should save the time and location if available at which rolling identifiers are received along with the rolling identifiers.

comment 6y ago · link · parent

Isn't this just a problem due to money-losing competitors selling at low prices?

Getting restaurant food delivered is a waste of money compared to getting bulk food delivered from supermarkets, so those who order it are probably not very price sensitive, and thus simply raising prices until the company is profitable should work without losing so much customers that economies of scale are lost, assuming there are no money-losing competitors.

comment 6y ago · link · parent

The fact that they were requesting https://*/* and http://*/* (i.e. full control over all your accounts) without it being absolutely necessary reflects terribly on them.

Still not clear why localhost (which can mean root access to the local machine since it may have localhost-only services that enable that) and cookies access is needed, also http://*.pushbullet.com is unnecessary since they should always use HTTPS.

If they had properly implemented the extension they may not have this problem now.

comment 6y ago · link · parent

All non-toy languages and compilers only add constant overhead; unfortunately that's still a problem, the goal is to not have any overhead at all.

malloc/free is fast with a moving GC, but moving is not, and if an object is never moved it's likely that it should not have been allocated on the heap in the first place.

The cmpxchg problem is solvable by epoch-based reclamation libraries (RCU, crossbeam-epoch, etc.), and while a traditional GC also solves it, it's not necessary.

comment 6y ago · link · parent

I don't see why it would be important to for employers to specifically compensate people for things like that: ultimately what matters is the total amount of money earned regardless of how it is split.

Also in most cases work that is done at home is done in on a computer, so the same space that is used for home computer use can be reused at no additional space cost besides possibly an extra desktop or laptop if a dedicated machine is used.

comment 6y ago · link · parent

Monads work for just doing in-place updates, but they seem unable to also prevent/control mutable aliasing, avoid rc/gc of arrays/records, put arrays/records inline in the containing record, and anyway they unnecessarily linearize code, which also seems to play badly with providing proofs.

Mandatory GC is not a zero-cost abstraction (it is ridiculously inefficient and unnecessary in general), and a language with mandatory GC is a non-starter as a universal language. C programs (like web browsers) are starting to have new code written in a different language only now that Rust is available as the first zero-cost non-GC safe language.

Yes, dependent types improve performance by eliding checks, but that's only likely to be a net win if the rest of the compilation is optimal.

comment 6y ago · link · parent

AFAICT Coq doesn't have linear types, and thus can't provide in-place modification of array elements or non-reference-counted/GCed non-primitive values, which means it can't take full advantage of a real CPU+RAM machine.

Also it's not enough to erase irrelevant types, the types that end up in the program also need to be treated efficiently, which means generic monomorphization, not auto-boxing things unless essential (or ideally never), using computed layouts where possible (i.e. store (n, [T; n], [T; n]) in a single allocation if n is immutable), etc.

The issue is that I think all of the current dependently typed languages don't have zero-cost abstraction and compiled code efficiency as a primary goal, they are designed for research or as machine-checked proof systems.

There's also the issue that some features may not compose well, e.g. Rust's ability to mutate a single field in place (needed for zero-cost since CPUs can do that with a store instruction) doesn't compose very well with dependent types because that can change the type of other fields, and also linear types (again needed to fully use CPUs) don't go well with having proof-like types that refer to other values, etc. All this seems fixable, but it seems quite involved to find the most general and ergonomic solution.

comment 6y ago · link · parent

The problem is that, as far as I can tell, there is no language with zero-cost dependent types, i.e. a language with dependent types that has a subset equivalent to Rust that compiles to machine code as efficient as the Rust compiler outputs.

Hopefully Rust will evolve into it or a new language will come up for that: we really need this to finally have a programming language that is strictly better than all others and can thus be the single language in use and finally the solve the programming language problem.

comment 6y ago · link · parent

Yeah, you can only use SGX-like systems when the reward from breaking them is limited since they can all be broken given sufficient resources (or even just insider knowledge).

For example, it might be fine as a way to guarantee the integrity of things like Folding@Home where disruption provides no gain other than the satisfaction of successful vandalism, but not for securing a popular cryptocurrency.

1
252627
51