Warning after adding siren gem - ruby-on-rails

After adding the siren gem to my project, it started to give the following warning either running a test or starting rails console:
/Users/{user}/.rvm/gems/ruby-2.0.0-p247#project/gems/methodphitamine-1.0.0/lib/methodphitamine/it_class.rb:14: warning: undefining `object_id' may cause serious problems
/Users/{user}/.rvm/gems/ruby-2.0.0-p247#project/gems/methodphitamine-1.0.0/lib/methodphitamine/it_class.rb:14: warning: undefining `__send__' may cause serious problems
Does someone had the same problem?
I was looking for a gem who could provide Xpath like features for JSON. If someone know another one, i'll appreciate :)
Thanks

That gem is very old (last commit over five years ago). For basic JSON parsing you should us Ruby's built-in JSON support.
If you need more complex data structures (I see that Siren provides cross-referencing), maybe another data format like YAML or XML would suit you better.
If you need to use Siren for compatibility reasons, it's probably more compatible with an older version of Ruby.

Related

How to fix the codes with the newest pydrake bindings?

I found a useful demo in github(https://github.com/maggiewu19/compass-gait-simulator). However, the codes didn't work with the newest pydrake. I ran the codes in google colabĀ  and got errors.
Any reply will be appreciated.
I see. This is quite old -- it is using RigidBodyPlant which has been replaced by MultibodyPlant.
Drake has supported quite a long deprecation period on this. You can make most of it work by pulling the old RigidBodyPlant classes from attic, e.g. by changing this
from pydrake.all import (Box,
DiagramBuilder,
FindResourceOrThrow,
Isometry3,
SignalLogger,
Simulator)
from pydrake.attic.all import (FloatingBaseType, RigidBodyTree, RigidBodyPlant, VisualElement)
Unfortunately, I didn't leave as long of a deprecation period on PlanarRigidBodyVisualizer in the underactuated repo. You will have to pull an old version of underactuated to make that work.
FTR -- we are currently working on a way to make the colab setup's durable, by having a peg revision of drake (and underactuated) in the setup script. For now, you could download the old version of the underactuated repo, or just that specific file that was removed after it's deprecation period.
I can't guarantee you won't hit more errors after that. It would be much better to use the updated compass gait examples from class which are all using MultibodyPlant.

Is there any support for extending Ruby using C on Heroku?

I am trying to quickly calculate the hamming distance between two 64 bit integers in Ruby. I quickly discovered that even with Ruby's optimized string functions etc. it wouldn't be enough, so I turned to C extensions. For comparison, Pure Ruby benchmarked at about 350,000 comparisons per second and C extensions benchmarked at around 4,000,000.
I used the implementation here and compiled it on my computer where it worked fine. The problem I have is using it on Heroku. I tried ruby extconf.rb make to create the makefile, which worked, and then make to compile it which failed with make: gcc: Command not found. It doesn't matter to me if I do this on deploy or not, but I don't know how to run code automatically at deploy. This has vexed me - if anyone could help it would be much appreciated.
You can use Heroku Buildpacks to solve this https://blog.heroku.com/buildpacks
I did some work with the linguist gem which required C extensions to work and solved it by using the correct buildpack.
You can either use a prebuilt buildpack or build your own

Unity3d: Error building Player: Append is not supported

I receive this error when appending an already-successful build in XCode. What I don't understand is I'm not changing anything when appending, and this error shows up.
I've never used an 'old version of Xcode' as the error implicitly states.
Does anyone know how to get append working on a consistent basis?
This is a very simple project, and I'm using Playhaven and TapForTap SDK's, if that offers any insight.
Turns out, XCode upgraded itself without telling me. :(
I rolled back to the version I was using and all is well.
With no code snippets or error logs, it's very hard to determine what the source of your problem is. There's no way to know if your error is describing the cause of your problem or a symptom of the problem without more information.
I can only offer some suggestions:
My first thought is that you're using a deprecated method in your code somewhere, possibly "Append", which if that is the case, more than likely has an updated counterpart, but you'll have to check documentation regarding that.
If you've used "Append" previously with no errors, then you should look into what exactly you've changed in your new build, and verify that the methods you're using are supported.
If your errors are vague or unhelpful, you can begin the process of elimination and start commenting out blocks of code until it builds successfully, and narrow down the source of the problem significantly.
However, it would be to your benefit to expand your question with more information.

KDevelop 4.3.1 not parsing Eigen 3

I'm using KDevelop 4.3.1 on ubuntu 12.04. It's not parsing the Eigen 3 library, while this release note says it should.
It is a little more subtle than this.
KDevelop is parsing part of the Eigen library when placing a using namespace Eigen before the code. However, it will not parse into the the classes (e.g. Identity in Matrix2d::Identity() will not be parsed).
When using nested namespaces, it will parse the namespace, but nothing more (e.g. Matrix2d in Eigen::Matrix2d will not be parsed), except for something called internal (i.e. Eigen::internal).
I've only found this post which resembled my problem, although here the issue is resolved after a KDevelop crash. Does anyone have a more reliable sollution? Is there anyone with the same issue, at all?
Kind regards
PS: Building the code works fine.

SGML Parser for Python 3?

I have some documents that are structured using SGML, and I have a DTD file which describes this structure.
Can someone recommend a Python-3 compatible library or module to me to parse this data? For Python 2.x my Google-fu seems to turn up SGMLParser, but that of course is now deprecated (and outright removed from Py3k).
Many seem to suggest lxml, but that is not an option for me due to dependency issues.
I know BeautifulSoup is great for messy markup, but A) last I heard it wasn't py3k compatible, and B) this content is well-structured.
BeautifulSoup is deprecated. Use the replacement instead, which is Py3k compatible:
BeautifulSoup4

Resources