HNHacker News
TopNewBestAskShowJobs

phoboslab

5,828 karma · joined February 16, 2010

X: https://x.com/phoboslab

Blog: https://phoboslab.org/

submissionscomments
phoboslab··on A Comparison of Image Hashing Libraries
We've been using phash for an image board for a while now and are quite happy with it. We only use it to detect reposts when someone uploads an image. It gives some false positives quite often, but that's totally okay for our use case. We specifically set it up to err on the safe side. Users are only presented with a "Are you sure your upload is not a duplicate?" message.

Currently we're just doing a `WHERE BIT_COUNT(images.phash ^ inputHash) < 12` in MySQL over 400k rows, which still works reasonably well (~200ms) given that it can't use an index for the XOR/BIT_COUNT operation. To my knowledge there's no way to speed up this query in MySQL, so if we continue to grow we probably have to write a small daemon that is able to search hashes more efficiently.

phoboslab··on Show HN: Run dedicated iOS Simulators in the browser
There are two sides to this problem. For jsmpeg (or even in the server), it would be possible to simply wait for the next intra frame (a frame that doesn't require previous frames to decode) on certain conditions and throw away all other frames in between. This will give the decoder and network time to catch up. By default ffmpeg emits one intra frame per second, iirc.

The more difficult part is probably detecting this lag. I'm not sure how this could be done. Maybe the node websocket server (ws) can detect congestion somehow.

phoboslab··on Show HN: Run dedicated iOS Simulators in the browser
This is really cool!

The "video" quality is pretty bad though. From what I can see, the app streams base64 encoded JPEGs via WebSockets and draws them in a Canvas. The overhead of sending complete images costs a lot of bandwidth.

You may want to look into jsmpeg for live streaming: https://github.com/phoboslab/jsmpeg

phoboslab··on CSS: It was twenty years ago today
Be careful with using // in CSS. It causes some browsers to completely ignore the whole rest of the CSS file after the line you wanted to comment out (iirc IE9 does this).

When I want to quickly comment something out (and don't have an editor shortcut handy), I just put an 'x' in front of the property name. I.e.:

    xbackground-color: #f0f;
phoboslab··on Oculus Connect 2014
First Hands-on: Oculus Rift Crescent Bay is Incredible: http://www.roadtovr.com/hands-on-oculus-rift-crescent-bay-pr...
phoboslab··on Doom
I recently made a Wolfenstein like 3D shooter with HTML5/WebGL, called Xibalba[1]. It's based on a 3D Plugin[2] for the 2D Game Engine Impact[3] that I released as open source. With this, it should be really simple to make a similar game.

Also, in case you're interested, I created a making-of video for Xibalba[4] that explains the tech and level editor a bit.

[1] http://phoboslab.org/xibalba/

[2] http://phoboslab.org/twopointfive/

[3] http://impactjs.com/

[4] https://www.youtube.com/watch?v=GEP7zJ9cQfw

phoboslab··on Nemex – A tiny app that helps you to track and curate ideas and projects
The app needs write access to the /projects folder. Many shared hosts need 0777 because PHP runs as a different user than FTP. If you know what you're doing, you can always set it to the minimum required permissions.

What's wrong with the username and pass stored in a config file? Almost all PHP apps store their database credentials in a config.php as well.

phoboslab··on Ask HN: Google AdSense Still Bans Ajax. What are the Alternatives?
Afaik AdSense still explicitly prohibits refreshing through JS, but this doesn't seem to apply when going through GPT. I'm not entirely sure what the situation here is.

Case in point: I have an AJAX site where users spend about 18 minutes per visit and refresh ads every two minutes. So far no complaints from Google.

phoboslab··on A Rare Peek Inside Amazon’s Massive Wish-Fulfilling Machine
Found this on youtube: https://www.youtube.com/watch?v=lWsMdN7HMuA
phoboslab··on Firefox OS Apps run on Android
Shameless plug: the game shown in the screenshot and video is X-Type[1]. I'm working on a much improved version that will be released on the Nintendo Wii U soon[2].

[1] http://phoboslab.org/xtype

[2] http://www.nintendolife.com/news/2014/02/developer_interview...

phoboslab··on The boy who stole Half Life 2 source code (2011)
I still remember the day HL2 leaked. All of my friends and I were in IRC trying to download the damn thing from DCC bots.

I was lucky and got a slot that provided the full 80kbyte/s. I finished the download first, but my PC was pretty old back then so I didn't even bother trying to run it. Instead, I removed my hard drive (my system drive!), picked up a friend and we drove to another friend who had the fastest PC at the time. About 30 mins later all of us (I believe 5 or 6 guys) gathered in a tiny dorm and just stood in awe as we booted up HL2.

There was barely any gameplay present. You could just walk around in some maps and admire the graphics. It didn't matter. If we hadn't been stoked before, we were now.

In hindsight, this all was just an amazing PR stunt. Fun times.

phoboslab··on Neutralizing the iOS camera click sound through active sound cancellation
Yes, I believe Apple requires the shutter sound. They actually rejected the first version of my video streaming App because the recording beep was missing.
phoboslab··on Introducing the WebKit FTL JIT
Right, but seeing the speed comparison with the LLINT makes me really sad that we can't even use the baseline JIT in iOS Apps. I still have some hope that Apple works on a way to run JSC in an isolated, trusted process that is allowed to use the JIT. Otherwise the new FTL JIT doesn't get us anything in many cases.

[1] http://www.webkit.org/blog-files/ftl-jit/four_tier_performan...

phoboslab··on Ejecta – A Fast, Open Source JavaScript, Canvas and Audio Implementation for iOS
Not true. Ejecta has been supporting WebGL for a while now. It was announced in this blog post: http://impactjs.com/blog/2013/05/ejecta-1-3

If you're doing WebGL stuff, I would encourage you to get the current Ejecta dev version from Github, instead of the last release version. There have been a lot of WebGL related bugfixes since: https://github.com/phoboslab/Ejecta

phoboslab··on Ejecta – A Fast, Open Source JavaScript, Canvas and Audio Implementation for iOS
With a bit more trickery, you can even implement the Non-Zero fill rule (Canvas2D default), instead of the simpler Even-Odd rule. Ejecta now supports both:

https://github.com/phoboslab/Ejecta/blob/master/Source/Eject...

phoboslab··on Ejecta – A Fast, Open Source JavaScript, Canvas and Audio Implementation for iOS
v8 also doesn't have an interpreter mode, just a compiler. On iOS you can't allocate writable+executable memory, so you can't use v8.

As I mentioned in another thread, I currently have a toy project that implements most of the Canvas2D API in plain C. Maybe this will amount to something some day.

phoboslab··on Ejecta – A Fast, Open Source JavaScript, Canvas and Audio Implementation for iOS
(Ejecta dev here)

Ejecta uses OpenGL ES 2 for Canvas, not Core Graphics.

The default demo that comes with Ejecta[1] runs with 60fps on the iPhone4S. Just try it in Mobile Safari. Even Desktop Browsers struggle with this. Of course it's a contrived benchmark, but it still makes a point, I think :)

There are also a lot of other reason to use Ejecta. If you _want_ to distribute your App in the AppStore, the alternative is to use a WebView framework such as PhoneGap, which can't use JIT either. That said, the raw JavaScript performance is rarely the bottleneck for games - most of the time, drawing is.

[1] http://phoboslab.org/crap/bezier/

phoboslab··on MLB.com is using my Google Analytics code
Happened (or rather still happens) to me too. My game X-Type[1] was stolen by a Chinese company called Leiyoo[2], who tout themselves as pioneers of HTML5 gaming.

They copied everything[3], including my tracking code, but at least changed the name to "Thunder Fighter"[4]. I receive about 20k visits per day from their domain. All my efforts trying to contact them amounted to nothing.

Btw.: is there a way to ignore certain domains in GA? This pollutes all my stats and I have no way to turn it off, other than getting a new tracking code.

[1] http://phoboslab.org/xtype/

[2] http://www.leiyoo.com/

[3] http://img.3366img.com/fileupload/html5/games/X-Type2/X-Type...

[4] http://agame.qq.com/game/100001283/detail.shtml

phoboslab··on Flash is dead, long live OpenFL
(Edit: for those unfamiliar with Ejecta: http://impactjs.com/Ejecta )

I do have a toy project that aims to be a cross-platform Ejecta eventually. It's written in C and divided in an OpenGL Canvas drawing library (so you essentially get the HTML5 Canvas API in native code) and a host application that provides the JavaScript binding.

Currently, there's only a host application for iOS. I don't know much about Android and have yet to figure out how to best couple the C lib with the Java code... or if I even need Java code to begin with.

I wanted to have a working Android host app first, before putting it on github and then building up the feature set on both platforms to where Ejecta is now.

I also thought about doing a kickstarter for this, but I'm not sure what exactly I could "sell", because the I want to have it open source anyway. If anybody wants to sponsor the development, get in touch :)

tl;dr: yes.

phoboslab··on Flash is dead, long live OpenFL
It always makes me happy to see my game engine mentioned here. Thank you! :)

Just to chime in, I believe that HTML5 currently is as "cross-platform" as it can get, especially for games. Two examples made with Impact:

- Olympia Rising[1] - this game recently had a successful kickstarter campaign and will be released for various desktop platforms and maybe more later.

- XType Plus[2] - my own game coming to the Nintendo Wii U, using the Nintendo Web Framework. It's a pimped up version of this XType[3], which you can play in your browser right now.

[1] https://www.kickstarter.com/projects/paleozoic/olympia-risin...

[2] http://www.nintendolife.com/news/2014/02/developer_interview...

[3] http://phoboslab.org/xtype/

phoboslab··on Git add -p
The GitHub App for Mac[1] and Windows[2] as well as msysgit[3] (and probably others) have this feature as well. I always resort to these GUIs when only commiting parts of a file, because it's a very visual process and I believe a GUI is the right tool in this case.

[1] http://mac.github.com/

[2] http://windows.github.com/

[3] http://msysgit.github.io/

phoboslab··on Racing the Beam (2009)
I haven't read the book yet, but David Crane's Pitfall Post Mortem[1] also covers a lot of what you mentioned. Truly fascinating stuff.

[1] http://www.youtube.com/watch?v=MBT1OK6VAIU

phoboslab··on Gfycat - Jiffier gifs through HTML5 video conversion
For a cross browser solution that just needs one video file, supports mobile browsers and still has a much smaller file size than GIF try jsmpeg: http://phoboslab.org/log/2013/05/mpeg1-video-decoder-in-java...
phoboslab··on Gfycat - Jiffier gifs through HTML5 video conversion
ffmpeg can load GIFs and encode into about any video format.
phoboslab··on Intel XDK: An HTML5 development IDE
AppMobi actually used Ejecta[1] for their Canvas2D rendering on iOS - which it seems also made its way into the Intel XDK[2]. I believe they have their own implementation for Canvas2D on Android, but sadly, it's all closed source.

I should really get a cross-platform effort for Ejecta going. We have CocoonJS and Intel's XDK, but afaik there's no Open Source alternative right now.

[1] http://impactjs.com/ejecta

[2] http://www.html5dev-software.intel.com/amdocs/readmes/ios.ap...

phoboslab··on Coinbase Raises $25 Million From Andreessen Horowitz
But it doesn't show up on your banking statements where your spouse could see it. The "felt anonymity" is much higher, imho.
phoboslab··on Coinbase Raises $25 Million From Andreessen Horowitz
Porn.

Though I'm wondering why Bitcoin adoption in the porn industry still seems to be so slow. Usually they're the first to jump on new technology.

phoboslab··on Feminism and Programming Languages
That sounds really interesting, actually. But, please correct me if I'm wrong, isn't one of the big arguments of feminism that women and men are "the same", i.e. women and men think in the same way and our current differences are only conditioned by society?

Wouldn't this feminist programming language imply that this is not actually the case? That men and women truly are different and think in different ways and that this is not (solely) a matter of condition but natural differences in our brains?

phoboslab··on A JavaScript parser and interpreter written in Go
Reminds me of the early 2000s argument "why do we need another browser? IE is good enough".

This project may not be the fastest JS engine or the one with the most features right now, but if nothing else, it's a really nice project for learning Go and writing interpreters.

Maybe some new ideas will be explored in this engine first, because it's faster to implement them in Go than in the (huge) V8 or other JS engines.

Having new alternatives to established software is always a good thing.

phoboslab··on Apple’s iOS7 Native JavaScript Bridge
You might be interested in Ejecta[1] then. X-Type[2], a game I made with it, easily draw hundreds of sprites with 60fps.

[1] http://impactjs.com/ejecta

[2] https://itunes.apple.com/us/app/x-type/id597488149?mt=8

← PreviousPage 6 of 13Next →