Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fooyc
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
181.
▲
by
fooyc
13y ago
One way to avoid this kind of mistakes is to use Yoda conditions [0]: ASSERTS(1 == apples); If you forget one `=`, it doesn't compile. [0]: https://en.wikipedia.org/wiki/Yoda_conditions
182.
▲
by
fooyc
13y ago
5/5, as a MySQL user. I'm a bit ashamed by how bad MySQL users performed at this test.
183.
▲
by
fooyc
13y ago
If any government invented bitcoins, it seems unlikely that the motivation was to reduce their costs. Given the transparent nature of bitcoin transactions, it could however be used to track, cartography underground transactions.
184.
▲
by
fooyc
13y ago
PHP doesn't have annotations. The framework you are using may be emulating them, though. By parsing docblocks. Hence why it feels like that.
185.
▲
by
fooyc
13y ago
PHP doesn't have annotations. The framework you are using may be emulating them, though.
186.
▲
by
fooyc
13y ago
Thanks for your answer. > When matching routes, symfony uses a lot of function calls for each route This is the slow UrlMatcher. The one used by default in the standard symfony edition generates code like this: https://github
187.
▲
by
fooyc
13y ago
From the README, it also looks like that he didn't use the optimised (default) versions at all: "Pux tries not to consume computation time to build all routes dynamically (like Symfony/Routing). Instead, Pux compiles your rou
188.
▲
by
fooyc
13y ago
As always, it depends
189.
▲
by
fooyc
13y ago
The README says that the c extension is only 1.5x-2x faster than the pure PHP Pux. So this doesn't explain 50x faster.
190.
▲
by
fooyc
13y ago
> Pux tries not to consume computation time to build all routes dynamically (like Symfony/Routing). Instead, Pux compiles your routes to plain PHP array for caching, the compiled routes can be loaded from cache very fast. symfony&#x
191.
▲
by
fooyc
13y ago
Surely people love the C3PO character from Star Wars, and want the same color on their iPhone. https://pbs.twimg.com/media/BUA7NhCIcAEHxWO.jpg:large
192.
▲
by
fooyc
13y ago
Now someone has to do the same with Big Data.
193.
▲
by
fooyc
13y ago
That was my point :)
194.
▲
by
fooyc
13y ago
Great slides. Very interesting because implementing immutable data structures is not obvious. I'm having a hard time figuring out a use case for some of these purely functional structures. For instance, the queue: if you dequeue concur
195.
▲
Gnu tar happily connects to remote hosts, depending on filename
9 points
by
fooyc
13y ago
|
5 comments
196.
▲
by
fooyc
13y ago
Is "and" banned from headline titles? Does this punctuation make sense for native english speaking people? "Athletics cost colleges, students millions" Does it mean that "Athletics cost colleges" and "stud
197.
▲
by
fooyc
13y ago
No need to do this on the client side then (that was my point)
198.
▲
by
fooyc
13y ago
If your browser is untrusted, you are doomed. > Furthermore, this helps against content disclosure if the server is compromised. If the server is compromised, openpgp.js is compromised too.
199.
▲
by
fooyc
13y ago
Is there any benefit of doing this on the client side? The message is sent through HTTPS anyway. If HTTPS was compromised, the javascript code signing the message, and the signing key, and everything related to handling the clear text messa
200.
▲
by
fooyc
13y ago
While I totaly agree, this is in no way specific to PHP. Ruby on Rails has such ugliness too, a view helper called "escape_once": http://api.rubyonrails.org/classes/ActionView/Helpers/TagHel... What
201.
▲
by
fooyc
13y ago
After freezing for a few seconds it really crashed my Firefox, showing the crash reporting UI and everything. In chrome, the tab crashes too, but not the whole browser. For those interested, the responsible code is located here: dontclick:&
202.
▲
by
fooyc
13y ago
Usually the script would be remote (script src="..."), and the same origin policy would prevent you from getting its source in a similar way.
203.
▲
by
fooyc
13y ago
Is there a chance this could be vulnerable to timing attacks ? Is comparing two integers fixed time ? It may be pure hazard, but in the following two calls, E(0x000000FE); E(0xC0000000); The second one is significantly slower:
204.
▲
by
fooyc
13y ago
> tens of millions of realtime events daily Does it means hundreds per second ?
205.
▲
by
fooyc
13y ago
This is likely to consume more memory, because of copy on write pages (or lack of thereof). Implementing the prefork model by spawning unrelated processes (by opposition to forking from a common parent process) is likely to consume more mem
206.
▲
Hall of API shame: Boolean trap (2011)
(ariya.ofilabs.com)
8 points
by
fooyc
13y ago
|
2 comments
207.
▲
by
fooyc
13y ago
This is the most approaching clone of Google Reader I've seen so far. It has one big problem, however: A feed can have only one tag (or, if you see a tag as a folder, a feed can be only in one folder). This is a big problem because Goo
208.
▲
by
fooyc
13y ago
Nice. However: $ curl localhost:8080 & curl localhost:8080 <!doctype html> [...] curl: (7) Failed connect to localhost:8080; Connection refused Yes, the server "restarts" after each request, and duri
209.
▲
by
fooyc
13y ago
This casts only $sum to int. If $i is a float, the result is a float. With 32 bits, $sum will be a float bigger than PHP_INT_MAX at some point, and the cast will truncate it, which is unlikely to give the right answer. With 64 bits, which I
210.
▲
by
fooyc
13y ago
This issue happens on 32 bits builds of PHP and nodejs : The language switches to a floating point representation when the result of some operation exceeds INT_MAX. In 64 bits PHP builds, the computation is done right.
More ›