Hacker Newsnew | past | comments | ask | show | jobs | submit | timb's commentslogin

"It's easy to idiomatically achieve vertical centering. http://jsfiddle.net/aMMxj/10/ "

that solution

1. only works for text, which is part of eranation's rant.

2. only works if you know the exact height of the container.

3. isn't even centered: http://i.imgur.com/lz8Mq.png


1. Not true. Could have been an image, or even SVG element http://jsfiddle.net/aMMxj/55/

2. Fair enough. It would be nice to be able to set line-height to a percentage of height.

3. Bug, my bad. http://jsfiddle.net/aMMxj/51/


It's still not precisely centered. Check out this version using a table.

http://jsfiddle.net/nJy8t/

I added a background image with a grid that extends 80px from top and bottom. There's also a small margin/padding/border reset and doctype just to make sure defaults and quirks aren't messing with anything.


Yeah, I concede mine wasn't pixel-perfect.

To continue down this path of the "natural" way to vertically-center, font-size must also be explicitly set. This works http://jsfiddle.net/nJy8t/3/ . Though it's certainly not without it's flaws (we lose font-size cascading).


indiegogo existed as a fundraising platform before kickstarter (but it was originally only for filmmakers).


seems like that issue is being worked on: http://code.google.com/p/chromium/issues/detail?id=62435

Chrome has similar problems on Windows. For example, the Mathematical Alphanumeric Symbols work in Firefox, Internet Explorer, and even Notepad, but not in Chrome. http://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbo... http://code.google.com/p/chromium/issues/detail?id=109844


Echoing what dflock said in the Apple thread, it would be great if webkit (and IE) added animated PNG support: http://caniuse.com/apng

Also, it's interesting to note that out of 31,000 open issues on the chromium site, APNG support is at #9 counting by user votes. http://code.google.com/p/chromium/issues/list?sort=-stars...



Personally, I am a little frustrated by OpenCV's move to C++ interface. Yes, it looks like a high-level language by mimicking Matlab style. But at the end of the day, the implementation uses many advanced C++ features, and ignored one thing that C++ is really good at: abstracting to objects / object interactions.

Computer vision task is very different, from, for example, a game engine. From engineering perspective, computer vision tasks are very functional. You throw an image to it, get some semantic information out of it, and done. The only objects there are images, and it is boring (Really? You need a inheritance relationship between different type of images? Tell me what's the behavioral difference!). Thus, object-oriented style is not the best abstraction for this kind of task at all. However, C++ is all about object-oriented programming! (and it is really useful for game engines, where you actually have a lot different objects and interacting with each other).

(Then here is the question, how to support different types of image? From the people I talked with, it seems to me the general conscious is to use generated code no matter you use c or c++. Generated code can be type safe, and still very fast. Effectively, this is what template does for OpenCV and macro does for ccv, although, both approaches are not the best.)

Take the end result, it is easy to use OpenCV's new interface (if you are familiar with Matlab), but hard to hack in. OTOH, it does provide quite a lot algorithms for you to experiment with, but then, if you need to write something new (the end goal of experimentation after all), it is really not an easy undertaking.

ccv takes a different path. Don't experiment with it, use it in your application, trust the underlying implementation is the best-of-its-kind, and you will be happy.


> However, C++ is all about object-oriented programming!

That really depends on how you use the language. Looking at the code I normally see there's almost no inheritance, but lots of static polymorphism through templates. Data tends to be stored in structs, tuples and the default data structures (vectors, mostly), and a lot of use is made of the new lambdas and the functional bits of the STL.

I know that you can write Java in C++ (and that many people do), but it's not really the language's raison d'être.


This matches my experience with opencv. Great job liuliu! For practical tasks your libccv looks really useful.


Hmm, sounds to me like one of those "Flask vs. Django" arguments - Flask has less features, hence it's more flexible and better.


One of the creators of Django once told me, "Flask is what Django would have been if we designed it in 2010 instead of 2006." Sometimes smaller is actually better.


There's a difference between software having features and having opinions. For example, Pylons (http://www.pylonsproject.org/) ships with a large feature set but doesn't feel like you're forced to use any of them, whereas Django ships with a larger feature set and doesn't give you much choice.

Naturally, there are advantages and disadvantages to both approaches.


try adding tsched=0 to one of the lines in /etc/pulse/default.pa so it becomes

load-module module-udev-detect tsched=0

this fixed my chrome ubuntu audio problems. (source: links at bottom of http://code.google.com/p/chromium/issues/detail?id=110375 )


in the html of http://16s.us/sha1_pass/js/ add <!doctype html> to the top. this will prevent "quirks mode" in IE and String.prototype.trim will reappear.

if you want to support IE 8 and lower you'll have to add a shim for String.prototype.trim. (see http://kangax.github.com/es5-compat-table/ )


Thank you. Adding that line made it work in IE 9.


that first image looks like the old munching square effect http://en.wikipedia.org/wiki/Munching_square


It also reminds me of http://www.jasondavies.com/hamming-quilt/ where the Hamming distance is used.


Yes, the munching square picture is the same because the hamming distance of two binary numbers is their XOR.

As to why it looks similar to the visualization in the article, your hamming distance picture is essentially the multiplication table for a galois ring GF(2^n), where n is width of the bits of the binary numbers you were using.

Note that I say galois ring, not field; assuming that an n (for n even) bit unsigned binary number overflows as such: 0x00..01 + 0xFF..FF = 0x00..00, then your chart is the multiplication table of the ring formed by taking Z_2 modulo the ideal generated by the polynomial <x^n-1 + x^n-2 + ... + x^3 + x^2 + x + 1>, which is a ring since this polynomial is reducible (it has a root of 1).


A quibble of terminology: fields are rings too, so what you want to say is that it's not a field (or that it's 'only a ring') because the polynomial is reducible, rather than that it's a ring because the polynomial is reducible. It's a ring because it satisfies all the necessary properties--whether the polynomial is reducible or not has no bearing at all on whether the object under discussion is a ring.


For binary strings a and b the Hamming distance is equal to the number of ones ( population count) in a XOR b.

Population count of x is not the same as x, so... how are the images the same?


the editor could turn down samples for lights while dragging, and turn samples back up when dragging is finished.


the newest chrome has support for transferable objects that can be sent directly to a worker without being copied. this works with ArrayBuffer now, not sure if ImageData is transferable yet, but it should be eventually.

demo: http://html5-demos.appspot.com/static/workers/transferables/...


nope, the canvaspixelarray is no arraybuffer, doesn't work yet. i check for changes in that regard with every google chrome canary release.


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

Search: