Hacker Newsnew | past | comments | ask | show | jobs | submit | kiicia's favoriteslogin

Linux on Pi Zero can be used as a sidecar for iPads.

https://schwarztech.net/articles/my-ipads-raspberry-pi-sidec...

  This method configures the Raspberry Pi [Zero] in “gadget” mode, creating a private link that appears as a wired Ethernet connection over a USB cable. The Pi’s address will never change, either as it is also a DHCP server for the iPad. As an added bonus, the same cable powers the Pi, creating a setup as simple as plugging the Pi into your iPad and waiting for it to appear .. you have a full-blown Linux computer working in tandem with your iPad and the iPad acting as a directly-connected console that is also providing power.

Possibly relevant comment from a few years ago: https://news.ycombinator.com/item?id=26893693

>AirDrop also shares your full name (seemingly the one associated with your Apple ID, not what you have set for yourself in your contacts), both by displaying it in the sharing interface on the involved devices and by attaching it as an extended attribute to uploaded files.

>So if you AirDrop some files to your computer and then zip them up, anyone you send that zip to (a journalist, a public file-hosting site, w/e) will have your full legal name to go with them.

Linked article from that thread is moved to https://medium.com/@kieczkowska/introduction-to-airdrop-fore... (but is archived).

I wonder if Google is adding metadata as well. Otherwise there does seem to be the problem of, for example, threats being AirDropped in a public place.


First off, apologies for the bad first impression, the team is pushing super hard to make sure it is easy to access these models.

- On permission issue, not sure I follow the flow that got you there, pls email me more details if you are able too and happy to debug: Lkilpatrick@google.com

- On overall friction for billing: we are working on a new billing experience built right into AI Studio that will make it super easy to add a CC and go build. This will also come along with things like hard billing caps and such. The expected ETA for global rollout is January!


I just noticed the m = 10007 value in my comment above and I thought I should clarify it. The number of bits per bloom filter does not need to be a prime number if the hash functions have uniform distribution. Murmur2 hash functions do have uniform distribution, so m was not chosen to be prime in order to reduce collisions in the Bloom filter's bit positions. The reason for using a prime value was more mundane.

This was a fairly large project, with roughly 3 million lines of C and C++ code which had numerous constants with special values defined throughout the code. So instead of using a less interesting number like 10000, I chose 10007 so that if we ever came across the value 10007 (decimal) or 0x2717 (hexadecimal) while inspecting a core dump in a debugger, we would immediately recognise it as the constant defining the number of bits per Bloom filter.


When I worked at RSA over a decade ago, we developed Bloom filter-based indexing to speed up querying on a proprietary database that was specialised for storing petabytes of network events and packet data. I implemented the core Bloom filter-based indexer based on MurmurHash2 functions and I was quite proud of the work I did back then. The resulting improvement in query performance looked impressive to our customers. I remember the querying speed went up from roughly 49,000 records per second to roughly 1,490,000 records per second, so nearly a 30-fold increase.

However, the performance gain is not surprising at all since Bloom filters allow the querying engine to skip large blocks of data with certainty when the blocks do not contain the target data. False negatives are impossible. False positives occur but the rate of false positives can be made very small with well-chosen parameters and trade-offs.

With 4 hash functions (k = 4), 10007 bits per bloom filter (m = 10007) and a new bloom filter for every 1000 records (n = 1000), we achieved a theoretical false-positive rate of only 1.18% ((1 - e(-k * n / m)) ^ k = 0.0118). In practice, over a period of 5 years, we found that the actual false positive rate varied between 1.13% and 1.29%.

The only downside of a false positive is that it makes the query engine read a data block unnecessarily to verify whether the target data is present. This affects performance but not correctness; much like how CPU branch misprediction affects performance but not correctness.

A 30-fold increase in querying speed with just 1.25 kB of overhead per data block of 1000 records (each block roughly 1 MB to 2 MB in size) was, in my view, an excellent trade-off. It made a lot of difference to the customer experience, turning what used to be a 2 minute wait for query results into a wait of just about 5 seconds, or in larger queries, reducing a 30 minute wait to about 1 minute.


200 bytes for the business logic.

47MB for the UI & boilerplate around the business logic.

I get that this may be the easiest way to develop and publish an application today, but it's sad that this is the direction we have taken in recent years.


Here is a short list:

https://graphics.stanford.edu/~seander/bithacks.html

It is not on the list, but #define CMP(X, Y) (((X) > (Y)) - ((X) < (Y))) is an efficient way to do generic comparisons for things that want UNIX-style comparators. If you compare the output against 0 to check for some form of greater than, less than or equality, the compiler should automatically simplify it. For example, CMP(X, Y) > 0 is simplified to (X > Y) by a compiler.

The signum(x) function that is equivalent to CMP(X, 0) can be done in 3 or 4 instructions depending on your architecture without any comparison operations:

https://www.cs.cornell.edu/courses/cs6120/2022sp/blog/supero...

It is such a famous example, that compilers probably optimize CMP(X, 0) to that, but I have not checked. Coincidentally, the expansion of CMP(X, 0) is on the bit hacks list.

There are a few more superoptimized mathematical operations listed here:

https://www2.cs.arizona.edu/~collberg/Teaching/553/2011/Reso...

Note that the assembly code appears to be for the Motorola 68000 processor and it makes use of flags that are set in edge cases to work.

Finally, there is a list of helpful macros for bit operations that originated in OpenSolaris (as far as I know) here:

https://github.com/freebsd/freebsd-src/blob/master/sys/cddl/...

There used to be an Open Solaris blog post on them, but Oracle has taken it down.

Enjoy!


For those unindoctrinated with the underlying phenomenon being exploited, this demo[1] was shared almost a decade ago.

Also, undiscussed mitigation techniques[2] relevant to this general class of nuisance that circuit designers may find of value.

[1] https://news.ycombinator.com/item?id=8862689

[2] https://news.ycombinator.com/item?id=41505772


https://chat.enqai.com/ - decentralised, uncensorable

You don't seem to understand that Dunning-Kreuger effect. Let me quote from the article that you cited:

"The Dunning–Kruger effect is a cognitive bias whereby people with low ability, expertise, or experience regarding a certain type of task or area of knowledge tend to overestimate their ability or knowledge."

In other words, by invoking D-K, you have implicitly said that you think I am a person "with low ability, knowledge, or expertise" regarding the matter at hand. But I am a licensed private pilot with 30 years of flying experience, and a software engineer with a Ph.D. and over 40 years of professional experience, including over 15 years working at NASA and at an aerospace startup I co-founded. Those are all just facts. In the face of those facts, an implicit and unsupported assessment that I am a person of "low ability, expertise, or experience" is an ad hominem, essentially saying, "Yeah, you have all these credentials, but you still might be an idiot." Well, yeah, I might be. There are lot of idiot pilots out there, and there are a lot of idiot software engineers out there, and I may well be a member of both groups. One of the big problems with idiocy is that it does not yield readily to introspection. (And you might want to mull that over a few times before you respond.)

As long as I'm pointing out your logical fallacies, here's another one:

> your point is that professional airline pilots, their union, or an airline are less qualified to understand the safety implications of this incident

No, that is not my point, which makes this a straw-man [1]. The fact that neither the union nor the airline have publicly expressed the same concern that I have in no way implies a lack of expertise on their part. There are many other possibilities, one of which is that they agree with me, but they are savvy enough to realize that there is nothing to be gained by saying so publicly.

[1] https://en.wikipedia.org/wiki/Straw_man


When I first learned about homomorphic encryption it gave me the idea of "cryptographic AI", as some sort of sci-fi writing prompt. Suppose compute is readily available to interstellar civilizations but actually designing a (super)intelligent AI is difficult. Then it could be economically feasible for cryptographic AI to exist. These are descriptions of AIs that run under homomorphic encryption, where the private key is only known by the AI itself. The description of the AI program and its state is spread throughout many locations and generally runs in a decentralized way. Planet earth might receive a segment of a cryptographic AI and make deal: Earth executes the program with some inputs it may choose to compute a solution to a problem. The program can be given inputs via a public key. The execution of the program can not be modified or manipulated since it is running under homomorphic encryption. What the AI gets in return is that earth provides it with additional compute that it may use for its own purposes. Earth furthermore allows the AI to transmit updated fragments of state into the stars. Over the course of many years, the pieces of state of the decentralized AI spread throughout the galaxy combine to represent the thoughts and actions of a singular entity. If earth modified the computations then the transmitted state could cryptographically be seen to not be valid, and hence would not be used in the decentralized galaxy spanning computation of the AI. Furthermore if earth cheats the AI in the deal then there may be consequences such as relativistic kinetic kill projectiles.

Roger Schank was one of the pioneers in Natural Language Understanding with his work on Conceptual Dependencies.

I remember reading, in the late 70s, about his SAM (Script Applier Mechanism) and PAM (Plan Applier Mechanism) and be amazed that a computer program could answer questions about natural language text. I still have my copy of his book "Inside Computer Understanding, Five Programs Plus Miniatures" which gave detailed explanations of how they were implemented.


Related:

The Linux Scheduler: A Decade of Wasted Cores (2016) - https://news.ycombinator.com/item?id=15531332 - Oct 2017 (35 comments)

The Linux Scheduler: A Decade of Wasted Cores - https://news.ycombinator.com/item?id=11570606 - April 2016 (38 comments)

The Linux Scheduler: A Decade of Wasted Cores [pdf] - https://news.ycombinator.com/item?id=11501493 - April 2016 (142 comments)


I just worked on a new diff algorithm for VS Code, in particular for the new merge editor (you can turn it on with "diffEditor.diffAlgorithm": "experimental").

Diffing is hard and there are many subtleties (e.g. https://github.com/microsoft/vscode/issues/164370).

The space efficient Myers diff algorithm has some problems when using it for merging, as tiny changes at the beginning of a file can cause a different path selection later on. Also, Myers doesn't minimize the number of hunks (only their total length), which sometimes leads to unnatural outcomes.

If anybody has good ideas for more advanced diffing algorithms, I'm all ears! (maybe even tree based ones, like difftastic) It's already very difficult to objectively evaluate the quality of a diff or to see if improving the diff for a special case doesn't make the average case worse.

As for the visualization of Myers, I can recommend to have a look at https://blog.robertelder.org/diff-algorithm/.


Even slightly further off topic, but probably useful in this context. Another top tip in git is that you can use `--color-moved=dimmed-zebra` to get a sense of code that was just moved but unchanged. More importantly, it directs you to code that differs in the midst of a move.

I used it yesterday to spot where a refactor that was moving code around lost changes during a rebase on master.


This made me think of a couple other interesting things:

1. you can change which algorithm is used in git diff as multiple are supported

https://luppeng.wordpress.com/2020/10/10/when-to-use-each-of...

2. Google has an edit graph implementation in Go in the cmp package

https://github.com/google/go-cmp/blob/master/cmp/internal/di...


> The experience is so awful when I browse on my iPad, instead of my Android phone with Firefox+UBlock. I really don't understand how most people can stand to browse with all the ads.

Most people don’t.

Most people who use anything for iOS tend to use things like:

- 1Blocker - super full featured, including custom script and css rules. business model is paid software, not ‘acceptable ads’ paying them for placement or third parties paying for your data

- AdGuard Pro - Similar to 1Blocker, less custom config friendly

- https://nextdns.io/ - pihole type blocker with unlimited configurations, custom rules, and analytics, native hooks for devices

- https://adguard-dns.io/ - similar DNS[1] service to nextdns.io with ability to upload your own rules based configurations

- Firefox Focus if using that ecosystem

- Brave if using that ecosystem

- iCab Mobile if wanting a super configurable browser with filter rules and longest history as indie browser for iOS

Folks also use ancillary quieters such as:

- Hiya - call / sms blocking

- Hushed - throwaway numbers for spam SMS

- - -

1. Note that the AdGuard public DNS server including custom DNS filtering rules has just (26 August 2022) gone open source: https://adguard.com/en/blog/adguard-dns-2-0-goes-open-source...


> Not yet. In the history of life on Earth, this has happened once.

1) That we know about.

2) Not unlike startups vs. established business, any newly emerging "eukaryotes" have to out-compete the already-evolved incumbents, which are already quite good at harnessing energy. You're much more likely to find success in business than in an entirely new evolutionary branch, though I doubt biological "gray goo" is outright impossible [1].

[1] Reverse chirality autotrophs sound like a scary sci-fi novel plot https://news.ycombinator.com/item?id=28038505


Panspermia is fascinating conjecture.

The preferred chirality of organic molecules could absolutely have arisen by chance, but it's an interesting to see this in meteorites.

On the unrelated subject of handedness, I saw an interesting thread on Twitter today [1] speaking about how we're starting to synthesize reverse chirality polymers and enzymes, most notably DNA and replication enzymes.

There are a lot of interesting implications.

You can't get rid of L-DNA without reverse DNase, leading to an accumulation of information and transcription. So they need to remake all the enzyme steroisomers.

That alone is interesting, but you can take it further to the limit and produce reverse biology that synthesizes reverse sugars that can't be metabolized by much of extant life [2]. Suddenly a lab-escaped reverse autotroph can out-compete all of us right-handed lifeforms because nothing can eat them. Bacteria, plankton, the entire food web collapses. When we have nothing left to fish or farm, we die too.

Never thought nanotech's grey goo was plausible. Now I see something that rhymes with it, and I could see it happening within our lifetimes.

It'd make a crazy MAD bioweapon on par with or potentially worse than nukes.

Wild tangent, sorry.

[1] https://twitter.com/eigenrobot/status/1420952351968432130

[2] https://twitter.com/prawncis/status/1420982623048925187


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: