How do I deal with Error stated below? - pymongo

I am performing a pymongo experiment.
Query: To add the article
jess#ubuntu:~/pymongo/pymongo$ python pymongo_assg.py --add_articles '{"text":"abc","title":"hi","author":"xyz","tags":"mongo,test","image":"/home/jess/pymongo/pymongo/index.png"}'
Respective Error:
usage: pymongo_assg.py [-h] [--get_articles] [--add_article ADD_ARTICLE]
pymongo_assg.py: error: unrecognized arguments: --add_articles {"text":"abc","title":"hi","author":"xyz","tags":"mongo,test","image":"/home/jess/pymongo/pymongo/index.png"}

I think the answer is in the error message.
You should use --add_article instead of --add_articles.

Related

Getting error in Karate v1.1.0 - TypeError: invokeMember (contains) on ["ABC","XYZ","OTHR","NEW"] failed due to: Message not supported

I was using Karate v0.9.6 all this while. Recently thought of upgrading the version to 1.1.0 and then 1.2.0.
One thing is troubling a lot is as belows,
Earlier I used to use 'contains' to verify in the schema that
#An array of expected values
def dept_type_code = ["ABC","XYZ","OTHR","NEW"]
##Then verify in the schema that the type_code has any one of those values in the array
def index_department_type_schema = {"code": '#? dept_type_code.contains(_)'}
It was working in 0.9.6 but with 1.1.0 is failing with error;
TypeError: invokeMember (contains) on ["ABC","XYZ","OTHR","NEW"] failed due to: Message not supported.
I'm sure I'm missing important part from the release notes. I would really appreciate any solution to this problem.
Thanks!
replacing .contains with .includes resolved the issue
https://github.com/karatelabs/karate/wiki/1.0-upgrade-guide#java-api-s-for-maps-and-lists-are-no-longer-visible-within-js-blocks

error in simulating sample.py on gem5: "AttributeError: Not allowed to set pio on 'SimObjectVector' "

I have been trying to simulate the 'simple.py' code on gem5 from the gem5 tutorial. Link of the tutorial is: http://pages.cs.wisc.edu/~david/courses/cs752/Spring2015/gem5-tutorial/part1/simple_config.html#simple-config-fig
I am getting an error saying that "AttributeError: Not allowed to set pio on 'SimObjectVector'".
Does anyone know how to resolve it?

Parse.FacebookUtils.init gives InvalidCharacterError

I'm getting Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('<iframe name="fb_xdm_frame_http"/>') is not a valid name. when I try to run Parse.FacebookUtils.init. Init code can be found at https://gist.github.com/ryansmith94/0ff03caf002fa2a8eb8b. Any ideas how I can resolve this problem?
Fixed this by changing Facebook's sdk.js code at line 46. https://developers.facebook.com/bugs/1466190186951391

Error 22 when scanning for available WiFi-Networks using CoreWLAN

I use the following code to scan for all available WiFi-Networks:
[[CWInterface interface] scanForNetworksWithSSID:nil error:&err];
Usually I get a NSSet of Networks but sometimes I get the following error:
The operation couldn’t be completed. (com.apple.coreWLAN.error error
22.)
Error Domain=com.apple.coreWLAN.error Code=22
I haven't find anything about that error code 22. Is there a documentation or a solution for this?
Because I had another problem with CoreWlan(http://stackoverflow.com/questions/9943833/cwinterface-returning-no-data) i replaced it with Apple80211.framework.
This also is a workaround for this one...

Django raw query cursor error

The following code gives me an error
from django.db import connection
cursor = connection.cursor()
Error message:
Undefined variable from import: cursor
I have Django 1.2.5 installed. How can a resolve this issue?
Thanks
This was just a PyDev information message as Daniel pointed out. I am able to run the script without modifying anything.