5 ms·
Creating a QR Code step by step
- aabiji 2y agoI built an implementation in Rust a while back: https://github.com/aabiji/qr https://github.com/aabiji/qr
- larsbrinkhoff 2y agoI built an implementation in PDP-10 assembly language a while back: https://github.com/PDP-10/its/blob/master/src/lars/qrcode.8 https://github.com/PDP-10/its/blob/master/src/lars/qrcode.8
- belter 2y agoThe feedback he receives is quite fun: https://www.nayuki.io/page/poor-feedback-from-readers https://www.nayuki.io/page/poor-feedback-from-readers
- redbell 2y agoOh, I see how terrible managing a personal blog might be. You have to deal with all kinds of people. Fortunately, he also shares good/decent feedback: https://www.nayuki.io/page/decent-feedback-from-readers https://www.nayuki.io/page/decent-feedback-from-readers
- seabass-labrax 2y agoPersonally, I don't enjoy reading that as much. The commentary seems a bit reminiscent of XKCD #406, and has what I read as tinges of racism. The characterization of some of these senders as lazy is simply not true: I once engaged with a student who wrote like some of those examples and was trying to contribute to a FOSS project I ran; he turned out to be an excellent contributor who nobody could reasonably say was lacking in either skill or effort. It is usually just a combination of shyness and excessive respect that produces these 'lazy' requests. And, frankly, using words like 'ur' and 'thx' are how some 100% native speakers of English write. (The ever-relevant XKCD strikes again, #1414 this time.) I consider myself to be extremely lucky that my native language happens to be the lingua franca of the computer industry if not the world, and even luckier that I don't have any impediment such as dyslexia that would hinder me capitalizing on that good fortune to the full. And finally, yes, most of what one receives online is spam. Lots of spam, in fact, but when someone makes as least as much effort to contact me individually I try to make at least that much effort in return.
- jacomoRodriguez 2y agoSorry, Sounds more like the blog author is kind of a douche: "No, your not allowed to use my code from a GitHub repo for your university projekt chat bot: your coding standards are not up to mine. And btw. Your English sucks"
- meiraleal 2y agoMaking fun of poor english is always a sign of stupidity (smart people can be idiots).
- ipdashc 2y agoMan, I understand that it can be annoying to get spammy messages, but a few of these are really kind of lame on the blogger's part. The sales mail, advertisement requests, and "want to sell your website" offers, sure, whatever, post and slander 'em. But a chunk of these are just genuine, polite requests for help, even if some (but not all) are sloppy or have bad grammar. There's a few that are asking for an interview or sound like they just want to be friends. There's no obligation to reply, of course, but to post them online just to mock them? That's really kind of sad, and I'm surprised the author is fine with doing it / thinks it casts them in a good light? Put all together, this is one of the most pretentious pages I've ever seen on the Internet. And then there's "that shameless country", "that needy country", "that unspeakable country", as others have pointed out. ... really? Yeah, we've all gotten spammy emails from Indian senders, joking about it is one thing, but that's just gross.
- saagarjha 2y agoGenerally, when you get a message from someone that you don’t like, it helps if your complaint does not include casual racism and a critique of the author’s English proficiency.
- prab97 2y ago<rant> The commentary mocking people for their poor English, followed by disparaging remarks about an entire country as if the email senders represent a typical sample from that nation, says more about the blog owner than about the email senders themselves. The blog owner exudes elitist vibes in the commentary. A quick skim of the blog reveals a request for Bitcoin donations, suggesting $3 as the amount, without considering that a large portion of this donation will be eaten up by fees. </rant>
- nindalf 2y agoDude really doesn’t like Indians huh. I can see why these racists come to the conclusion that all Indians speak a certain way. If they see something written with a few quirks common to Indian English they confirm their bias that all Indians speak and write that way. If they see text without that tell, their bias is still confirmed because they conclude this person must have grown up elsewhere. For the racists at the back - language diverges over time. That’s perfectly normal. As the reader/listener it’s easier for us to make the effort to understand than it is for someone to change how they speak. If you’re ok with making an effort to understand unusual words and phrases used by Australian, Scottish, Irish, Kiwi people but you won’t do the same for Indian people, reflect on why you do that. People from NZ change most “e” sounds to “i”, so they’d eat pincakes for breakfast for example. I find that quirk endearing. Or Australians using words like ute, jaffle etc. But somehow only white English speakers are given the benefit of the doubt when they do this? Why can’t Indians get the same thing when they’re speaking their second language?
- InsideOutSanta 2y ago"it’s easier for us to make the effort to understand than it is for someone to change how they speak" Not just change how they speak, but learn entirely new concepts that do not exist in their language, and that they have no intuition for. I'm currently teaching German to somebody whose native language has no tenses, no cases, mostly no plurals, essentially no genders, different phonemes, and is written in a different script. Having to not just learn these concepts, but be familiar enough with them to form an intuitive understanding and use them correctly in most instances, at a near-native level, is something that takes a decade or more for an adult. To be dismissive of somebody who makes that effort is pathetic.
- agnishom 2y agoI understand it is annoying to receive spam, and Nayuki is under no obligation to help strangers with their code. However, how about a little empathy for the students whose cultural and education system have not taught them any better? In some cases, Nayuki is not even happy with people pointing out legit errors in their blog. For example, > I want to use the parameters [...] and > > invNTT(NTT(invec)) !=invec ?
- nindalf 2y agoFun for racists, sure.
- bilekas 2y agoIn what sense?? Edit: Okay I didn't read the commentary of the author. It's an unnecessary complaint for sure.
- redbell 2y agoA good practice is to tag the title with the year of the article (in this case, 2018), when it is not from the current year.
- D4Ha 2y agoI agree, the original link to the post, doesnt have a date as far as i can tell, and I can't edit it anymore.
- redbell 2y agoAlthough the date is included in the article, it is located at the very bottom of the page, which is unlikely to be easily found. It reads: "Last updated: 2018-11-05"
- bb88 2y agoThis is pretty awesome. I would like to see the same thing for the decoder.
- smitelli 2y agoSame. I always marvel at how my phone can decode a badly lit, blurry, 1/4 out of frame QR code as quickly as it does.
- bb88 2y agoMy first instinct would be to go look at the discrete cosine transform that JPEG uses. But I don't know how to do the other parts like aligning and using the timing patterns.
- kfl 2y agoMaybe you'll enjoy Piko and blinry's guide on reading QR codes without a computer: https://qr.blinry.org/ https://qr.blinry.org/
- bb88 2y agoYeah interesting, but not really any different than the original content. Maybe a little easier to grok. I was looking for algorithms to extract out a QR code from an image.
- phoronixrly 2y agoYeah, I've been looking for a guide to implementing qr readers from 0. Explicitly not 'oh just plug in this CV library in, feed it the image and it spits out the result' like all the stuff I find in Google on the topic. I am looking for a guide that walks you through implementing all the algorithms necessary after you have the decoded raw image data.
- vrighter 2y agofind a copy of the standard. A version of it is floating online. The latest version just added some clarifications, but is not needed. I built an implementation out of that, though the error correction part, of course, I had to learn somewhere else. But the spec is very readable
- jaza 2y agoNice! Learning how QR codes work has been on my todo list for ages, this was a nice introduction.
- throw0101c 2y agoRecent Veritasium video on the topic, "I used to hate QR codes. But they're actually genius": * https://www.youtube.com/watch?v=w5ebcowAJD8 https://www.youtube.com/watch?v=w5ebcowAJD8
- slig 2y agoThis resource is awesome. I wanted to have the smallest readable QR code for my printables pages footer [1], and I discovered there that it's possible to encode URLs in "Alphanumeric mode", version 1, using only uppercase characters, e.g., HTTPS://FOO.CC/ABCDEFGHIJ, so I got a three letter domain name and built the simplest URL shortener hosted on a CF worker. [1]: https://pdf.ahaprintables.com/pdf/preview/aha/zebra-puzzles-ultra-hard-vol1.pdf https://pdf.ahaprintables.com/pdf/preview/aha/zebra-puzzles-... (PDF)
- greggman24 2y agoit's nice to have an explanation. for me, I just wanted to quickly make them. Googling led to ad covered sites and "register to use" site. Found a few on GitHub but they had other issues so threw together my own using a well designed library I'd used before. took about 15 minutes https://greggman.github.io/qr-code/ https://greggman.github.io/qr-code/ might add more options but in truth I don't think most users need the options
- D4Ha 2y agohappy you found it to be useful. I also wanted to write an implementation for sometime. The only things I could find were ready-made packages (python/Golang...etc). The part I'd also like to know about is error correction, if you have anything useful related to QR codes for that.
- Timwi 2y agoUnfortunately it seems that every online explanation of QR codes always leaves out the Reed-Solomon error code calculation. The author here describes it as “long, tedious, and not very interesting”, but since everyone seems to think that, it is now very hard to find.
- cammikebrown 2y agoThere’s a Wikipedia article for it
- steventhedev 2y agoI took a code theory course in grad school. It was the most rigorous course I took, and for all of the 5 students it was difficult, but I'm also really glad I took it. Reed Solomon was about two thirds of the way through the semester, and the gist is that it's based on polynomials - with enough points you can define exactly where the polynomial is - so include some extra points and that way if some get lost along the way you can recreate them. The rest of it is how to apply that for binary data (finite fields). Which is mathematically beautiful, but where they get somewhat complex.
- larsbrinkhoff 2y agoThese two tutorials explain the error code calculations: https://www.thonky.com/qr-code-tutorial/error-correction-coding https://www.thonky.com/qr-code-tutorial/error-correction-cod... https://dev.to/maxart2501/let-s-develop-a-qr-code-generator-part-iii-error-correction-1kbm https://dev.to/maxart2501/let-s-develop-a-qr-code-generator-...
- Timwi 2y agoThank you so much! That's really helpful and enlightening.
- amenghra 2y agohttps://www.quaxio.com/an_artisanal_qr_code.html https://www.quaxio.com/an_artisanal_qr_code.html and PagedOut! Issue #2 have a qrcode from scratch including the error code calculation using long division. Enjoy!
- fforflo 2y agoPlug: Now that you know how they work, you can use them in your SQL queries too https://github.com/Florents-Tselai/pgQR https://github.com/Florents-Tselai/pgQR
- rose987a 2y ago[dead]
- deleted 2y ago[deleted]