QR Code generation in shell / mac terminal - perl

I want to create QR codes for a project I'm working on in applescript the resulting qr will be placed in the indesign document. I have found that there is a plugin for indesign but I suspect that requires user interaction.
So I've been search for how to generate the qr using a shell command. I've found things related to php and rails and even coldfusion but none of those will fit the bill on this. I need to generate them using shell command so image events or perl basically anything I can run from the command line that comes with the mac os
thanks for your help.
antotheer
I wonder if I could call a url using curl or somthing to get one ?

For doing something similar, we use libqrencode.
It's a c library for generating QR codes, but it comes with a command line utility (called qrencode) which lets you generate QR codes from a string, e.g.:
./qrencode -o /tmp/foo.png "This is the input string"
It supports most options you'd probably want (e.g. error correction level, image size, etc.).
We've used it in production for a year or two, with no problems.
I've only run it on linux systems, but there's no reason you shouldn't be able to compile it on Mac OS, assuming you have a compiler and build tools installed (and any libraries it depends on of course).

As Riccardo Cossu mentioned please use homebrew:
brew install qrencode
qrencode -o so.png "http://stackoverflow.com"

Related

Set version number for Swift executable command line tool

I have built a small command line tool with an Xcode template.
The built works as it should, I can Archive it to obtain an executable quite fine.
What I cannot figure out is where I can set the version number of the binary. I do not have a Info.plist, but I can see several places containing the verb "Version"–none of which will attach a version number to my binary.
What am I missing here?
Command line tools don't have external info like a version number (eg something that would show up in the Finder). You should write internal code that returns a version number when someone calls SwiftyAppleMailCreator --version.

NetBeans IDE: Resolve Missing Native Build Tools

I am trying to install Fortran in my Windows 10 laptop.
I followed step-by-step this tutorial.
On the last step I am promted to run the following piece of code:
program testfortran
implicit none
print*,'Hello world '
end program testfortran
However a Resolve Missing Native Build Tools window pops-up: it seems that the Make command field is empty.
To be more specific at the bottom of this window there is a message that Tolls marked with * are required. There are three such fields:
(1)C++ compiler to which is attributed the message C:\MinGW\bin\g++.exe
(2)Fortran compiler to which is attributed the message C:\MinGW\bin\gfortran.exe
(3) Make command which is empty (it comes with a red *)
What should I write inside the Make command field?
P.S. All I want is Fortran 90/95 installed on my Windows 10 laptop. I try to do this with step-by-step tutorials because installing software is not exactly what I am good at. So any alternatives would be welcome.
MinGW comes with the mingw32-make program (or it can be installed by mingw-get install mingw32-make). So you should use
C:\MinGW\bin\mingw32-make.exe

How to run the PJSIP in xcode?

I'm new with XCode and still trying to understand objective-C. I'm using xcode 4.3.2, and I have to create an app that integrates with PJSIP.
I found this link. I am still confused about that link, because the article said that we must have installed the command line tool. But the command line tool is already installed in my XCode. How can i use it?
Do I need to create a view base application? how can I run the command line tool like the link says?
The command line tools allow you to compile "traditional UNIX programs" from source, generally using make. If you are using Xcode to create your projects then you don't even need them installed.
EDIT OK you have edited your question, stating the real issue you are facing; You don't know how to use the PJSIP package you have installed. The link you reference is about building PJSIP, not using it, so you can still forget about the command line and concentrate on how to configure your Xcode project to use PJSIP. This will require setting the header search paths and library search paths to find the header files and library file, in order to compile and link against it. Hopefully it's a static library as that will be easier to use; if it's a dynamic library or framework then you have your work cut-out as that's much harder to use.
In newer XCode (4.3 or above) you might have to install command line tools since it has been made optional. Open XCode and go to XCode->Preferences
Open the Downloads panel and click on "Components". If Command Line Tools are not installed already, you will get an option to install them from here.
Do so and you are set.
I done with it by myself. if you face the same problem, you can refer to this link, I already tried and run it. It works both on simulator and device. thanks.

eXosip2 function missed?

I am writing a software for an embedded device, the basic function is VoIP, now I want to implement the SIP using eXosip2. I have downloaded the libeXosip2-3.6.0 source code from http://savannah.nongnu.org/projects/exosip/
I checked a few example code and find that to send an INVITE message, I need to call:
eXosip_call_build_initial_invite (in eXcall_api.c)
In this function, it will call osip_to_init , osip_to_parse , osip_to_free etc functions, however I could not find these functions in the eXosip2 folder....why?
Actually I also downloaded the osip2 library, I can find these functions, but can not see them in the eXosip2. Are these functions included in some object files that I can not read the content? Or actually I need to include both the osip2 and eXosip2?
I am sorry if this is a trivial question, I am novice to programming and would be very thankful if you can help.
You need to also build libosip2. Then link libeXosip2 to the libosip2 libraries
To be complete, you need to download libosip-3.6.0 and install it with those commands line (on a linux/unix platform):
$> tar -xvzf libosip-0.X.X.tar.gz
$> mkdir linux-build
$> cd linux-build
$> ../libosip-0.X.X/configure
$> make
# make install
Then compilation of eXosip2 should work.
The same is true for newer versions.

Run Perl code into GUI

I have been working in a Perl script to read log files, but none of the people at work
want to use it as it requires run it from CLI, Im looking to integrate my Perl code which mainly
reads a txt file and produces and output (Already more than 2,000 lines) into a GUI which can be used with Windows or MAC PCs,
Example:
my perl script:
#./perl -i myfile
# HELLO this is the output!
Instead I want users to run the App and give them the chance to upload file and a Run button.
Thanks!
Then you can either write a web based frontend or use a GUI library such as Tk, Wx or Gtk.
Run as a CGI script which should ouput as HTML. For more you use template system like Template tool kit
In my experience, Tk is the most cross-platform GUI framework for Perl. It is very primitive (both in looks and API), but it works as expected almost everywhere with minimal fuss. Even with Gtk, I found there were some combinations of platforms and Perl deployments that just wouldn't work.
If you want to go the CGI route, try POEx::HTTP::Server. This will run a small web server within Perl without needing all the configuration of a full web server like Apache.