QR Code reading/writing in Ruby - ruby

What's the easiest way to add QR Code reading/writing capabilities to a Ruby (2.0) program (if it helps, the codes will be written to and read from PDFs)? All of the gems I've found seem to have not been updated in quite some time, and usually have a ton of dependencies. Are there any good options out there?

https://github.com/smparkes/zxing.rb
YMMV, I'm the author. But I'm also the primary C++ maintainer of zxing and I use zxing.rb for a lot of testing so it should be as up-to-date as the C++ port is.
No comment on the number of dependences: they're not a barrier for me, obviously.

Related

Where can I compile my ruby code?

I started programming on ruby at codecademy but where can I compile my codes on doing a website?
When I was making some lessons on C I used codeblocks to run codes. I know any text editor can run a HTML code. So what about ruby?
Thank you.
I'll take a stab at answering the question that I think you're asking, but I'm not 100% sure here.
Ruby is an interpreted language (what does that mean? Not a whole lot nowadays. If you'd like a more in depth discussion on the distinction or lack thereof between interpreting vs compiling, read Jorg's comments below). To execute ruby code, you'll need to install ruby. Fortunately for you, this is freely available on any major platform. If you're on something unix-y (eg, linux or mac), I'd strongly recommend installing ruby via something like rvm or rbenv. If you're on windows, you can either go the cygwin route and pretend it's a unix-y environment, or there are prebuilt installers out there. Googling 'install ruby' should have some sites that can help you at or near the top of the search results.

making stand-alone binaries in Julia?

Is there a way to make stand-alone binaries that contain all julia dependencies and do not require the user to have julia installed? I think it is possible to do using the Go language. It is very hard to do in other languages like Python and I wanted to know if Julia can do this or if there are plans to do it.
It is not officially supported really yet, but there is some functionality to do it. By "not officially supported" I mean that I don't think its being tried regularly, and isn't being checked for regressions.
I understand it is planned to make it easier in the future, but that its not a very high priority right now (can't find citation right now).

Best practices for internationalization using PyQt4

I want to add multiple language support to my application which is written in Python using PyQt4. I was looking for information on how to add multiple languages and would like to see how other people do this.
Here i read:
The PyQt behaviour is unsatisfactory and may be changed in the future.
It is recommended that QCoreApplication.translate() be used in
preference to tr() (and trUtf8()). This is guaranteed to work with
current and future versions of PyQt and makes it much easier to share
message files between Python and C++ code.
In files generated by pyuic4 i see something like:
WPopupCalendar.setWindowTitle(QtGui.QApplication.translate("WPopupCalendar", "Календарь", None, QtGui.QApplication.UnicodeUTF8))
This looks too long for me. I was thinking to make my own tr helper function which somehow would automate the process.
Also i could not find articles describing a workflow and specifics for developing multilingual apps in python with pyqt4.
Would you please advice me with some good and convenient techniques on this?
Just use tr (or trUtf8) everywhere to start with. Only bother with translate when you identify code that is affected by the issue with multiple inheritance (which could easily be never).
I would suggest you have a look at Qt's i18n overview, and the Qt Linguist Manual. They are obviously both oriented towards C++ projects, but it should give you a pretty clear idea of what's required.
For a working example, you could also download the source code of the Eric Python IDE - it's written in PyQt4, and has support for a half dozen or more languages.

Ruby for the PIC32 Microcontroller

Is there an existing library to write code for the PIC32 in Ruby?
Currently I've been writing code in C to perform tasks on it, but I would love to use Ruby.
Thanks,
Andy
I doubt that there is an existing library for that task, but it should be possible (surely not without some effort) to extend Metasm to include a new assembler backend for your processor. It also includes a C parser/compiler.
EDIT: I just realized you are looking for a Ruby interpreter on that platform, which I hardly can believe exists.
I also doubt that Ruby on iron exists, but it would be nice to be wrong. :)
If your pic32 can handle an OS that would run Ruby, that might be an option. Otherwise you may be able to prototype a lot of your algorithms in locally run Ruby and then translate them to C on the PIC32.
Probably too late, but according to this link, mruby can run on pic32
As a consequence, the interpreter is now much reduced in size and can
be cross compiled for low cost 32-bit microcontrollers including ….
the PIC32 (MX7)! The official repository on GitHub contains already
examples for a few embedded platforms including the chipKIT MAX32!
https://github.com/mruby/mruby

Step-by-step execution for Intel AT&T assembler?

I'm writing a compiler that converts source code (written in a small imperative programming language) to Intel AT&T 32-bit assembler.
I tend to spend a lot of time debugging, because of nasty offset-mistakes etc. in the generated code, and I would like to know if anyone knows of a tool to "walk through" the generated assembler code step-by-step, visualizing what's on the stack etc.
I use Ubuntu Linux as my development platform, and I'm comfortable with the terminal -- a GUI-program would be nice though. Does it exist? Or is there a good reason it doesn't (maybe the problem isn't so straightforward..?)
If you have good ideas for approaching debugging tasks in assembly code, I'll be glad to hear from you!
I like EDB (Evan's Debugger) on Linux. It has a nice, easy-to-use, QT4-based GUI. Its developer's goal is to make it similar to OllyDbg. And it's being actively maintained:
EDB on FreshMeat
I'm pretty sure it's installable through Synaptic on Ubuntu as well. Enjoy!
Is the end result of the compile process something that you can actually execute, and therefore examine in a debugger? If so the Data Display Debugger (ddd) might be useful.
My experience with debuggers such as Olly and EDB is quite sparse, so I wasn't able to solve my problem with those. I ended up
scattering calls around to a Debug function in the source code, nailing down bad register values
letting the compiler output HTML-formatted code with useful metadata for different iterations in the liveness analysis etc.

Resources