Can you install Google Protocol Buffers on Heroku? - heroku

Context
I'm new to Heroku, and fairly new to Google Protocol Buffers.
Steps Taken
Searched Stack Overflow
Searched Heroku help
Searched Google
Question
Is there way to install the Google Protocol Buffers on the Heroku platform?

You do not need to "install" Protobufs to use it at run-time. Just bundle the Protobuf Python code and the code generated by the Protobuf compiler together with your application's other code. The compiler (protoc) is only needed to generate code; it is not used when your application actually runs. So, there should be no problem.
If you want to use the experimental C-extension-backed implementation (which is off by default), you will also need to include the .so file implementing the extension. I am not personally very familiar with C extensions so I'm not sure exactly where you're supposed to put it, but again, you should be able to bundle it with your application without installing anything. I am also not very familiar with Heroku so I do not know if they will let you run C extensions -- I know that AppEngine, in comparison, does not allow extensions.

Related

How to install samples/libraries?

For some reason, the github page here https://github.com/microsoft/BotBuilder-Samples has no instructions on how to actually add the sample/functionality to your own bot.
I'm trying to add this library to my composer bot project: https://github.com/microsoft/BotBuilder-Samples/tree/main/experimental/handoff-library but it itself doesn't have any instructions either, just how to download it via git (which I've done).
The only guide I could find is here: https://learn.microsoft.com/en-us/composer/how-to-add-custom-action?tabs=csharp but it doesn't quite match up with the library above.
Am I missing something obvious?
The samples repo is not a library. It's literally a list of smaller bots that can be run locally, in every GA'd language SDK of the Bot Framework. It's not meant to be 'installed'. The purpose of the various samples are to show how the SDK can be leveraged for certain scenarios, so you can take the code and implement it for yourself, or mimic the code in your own bot. If there's a certain sample who's functionality you want in your bot, such as "How to add attachment handling", you should ask that.

How to run F-Logic programs?

I've found many tutorials about the language it self, but nothing about the platform needed in order to run it.
There's a github repository which only runs on mac, not sure if it's flogic itself. I know it's being used for semantic web so I thought that would be easy to find some oficial docs and use instructions.

Can I use two languages in a Heroku app?

I want to use Node.js as a Share.js server and Ruby for the frontend. As far as I know, Heroku only allows one web-facing process called "web". Does anyone have some experience trying to do something like this?
No, Heroku detects the application type when you push your code to Heroku and it compiles the slug. You'd need to have them as seperate applications with a defined API between the two (not always a bad thing)
UPDATE: You can 'stack' buildpacks these days, eg Ruby + PHP so you could have both executed. See https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app for how to use multiple buildpacks in the same app.
As a caveat, you technically can install two languages on a single app — but I'm not sure about running them concurrently. I made this buildpack to combine NodeJS and PHP (so that I could run Grunt during the slug compilation):
https://github.com/gcpantazis/heroku-buildpack-php-gruntjs
The language detection is usually fairly dumb; it'll be looking for a file indicative of the lang, i.e. index.php or a rakefile. You'll have to change the detect bin so that your code will pass.
Update:
Even better, consider using https://github.com/ddollar/heroku-buildpack-multi ; it'll let you install buildpacks sequentially. Depending on your application you might need to find language buildpacks that don't have verification steps, i.e. checking for a package.json file in a NodeJS app.
Yes, it is mostly possible I believe, as long as you're not doing something very tricky. I once deployed a Flask (Python) app that used Stanford's CoreNLP - which is all written in Java. You will need heroku-buildpack-multi.
After adding this, make sure to make a .buildbacks file and add all the buildpacks you will be needing from the Heroku github.
This circumvents Heroku detecting your app type itself and makes it install all necessary buildpacks from the .buildpacks file.

How do I translate monotouch code to xcode

I have an app written in MONOTOUCH. It works- I tested it with TESTFLIGHT. It is being added to a larger app, and that developer needs the full xcode project. Do I need to have it rewritten or is there a way to convert it easily.
There is no way to convert Mono code to Objective-C code.
There is an --xcode option that may or may not work. It has not been maintained and we do not officially support it, so I would not depend on it working.
My suggestion is to keep the two applications separate, and transfer control from one to the other by using urls. You register two url handlers "firstApp:" and "secondApp:" and when you need to go from the first to the second, you issue a Url open to "SecondApp:statevariables" and the same process is repeated to go back.
If you have a MonoTouch license, you can use mtouch --xcode yourapp.exe to generate Objective-C code. It doesn't work in the evaluation version.
Much more detail is available in this Stack Overflow answer.

Packaging precompiled binaries inside of a gem

I've got a ruby web app that uses lilypond to generate sheet music based on user input. I'd like to move the hosting to heroku (I've recently used heroku on a few projects and really liked it, plus my traffic is low enough that it'd be free host it on heroku, for a while at least). However, heroku's dyno architecture doesn't allow you to ssh in and install whatever packages you want...instead, you give it a gems manifest, and it will install the gems for you.
So, if I'm going to deploy to heroku, I'm going to need to package lilypond as a gem. I've released a few pure-ruby gems, but haven't dealt with native extensions or precompiled binaries, or anything like that.
Is it possible to take some precompiled binaries and package it inside a gem? Ideally, this would include binaries for OS X (which I develop on) and debian linux (which is what's running on heroku), and would install the proper binary when the gem was installed.
it is possible, since precompiled binary gems for windows are the norm. Take a look at rake compiler, perhaps.
also https://github.com/rdp/ruby_tutorials_core/wiki/gem (https://en.wikibooks.org/wiki/Ruby_Programming/RubyGems) might help
-r
I think you've got a few options here:
You could get the Lilypond source and package it into a gem with a native C extension. There are some useful guides on how to do that at http://guides.rubygems.org/c-extensions/ and http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions
There's also a gem called gitara but I haven't been able to find any information about using it on Heroku. It might be worth emailing the author and asking if he knows anything about that.
You could create a Heroku buildpack that installs Lilypond as part of your deployment. I wasn't able to find any for Lilypond, but there are plenty of examples that do similar things - for example, this one installs Imagemagick (which is included by default on Heroku, so probably not necessary anymore - but hopefully the code is helpful). More documentation at https://devcenter.heroku.com/articles/buildpack-api and https://devcenter.heroku.com/articles/buildpack-binaries
Based on my reading, I think the buildpack option is the best way to go.
Hopefully this helps!
Instead of precompiling, you should be able to just list the gem in your .gems file, see the Heroku documentation. Of course, this requires your gem builds the native code correctly - this is still a task, but hopefully an easier one.

Resources