I am using Istanbul for code coverage of Protractor Tests.
In the process of Instrumenting the source Code I am getting a "Failed to parse, Unexpected Token" error, and after going through the error it is found that the "import" token is creating the issue.
Been working on Angular2 and Typescript.
I am using command : istanbul instrument ./dir/to/instrument/ -o ./out/dir/
Istanbul by default uses esprima parser to parse the code before instrumenting.
This is a parsing error, but I am unable to find any solution to resolve it.
Istanbul:v0.4.5
Esprima parser:v3.1.3
Use this command:
npx nyc instrument [input-file] [output-file]
Related
I am trying to run the hyphae (fungus) using the code provided here : https://github.com/petercollingridge/code-for-blog/blob/master/hyphae/hyphae.py
But, when I run the code I get this error in terminal: Blocking request with no referer...
Furthemore, does anyone have any simulations on hypahe ?
Thanks again
I was trying to implement a Spring boot application on vs code and came up with this error when I tried to run the code (Screenshot below). I am not clear what this error indicates and did not know what exactly to look for on the internet. could anyone tell me how I can resolve this error?
edit:
as I was told to copy-paste the error message as text, here it is.
PS D:\study material\java code\springbootdemo> cd 'd:\study material\java code\springbootdemo'; & 'c:\Users\manjeet arneja\.vscode\extensions\vscjava.vscode-java-debug-0.27.0\scripts\launcher.bat' 'C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\bin\java.exe' '-Dfile.encoding=UTF-8' '#C:\Users\manjeet' 'arneja\AppData\Local\Temp\cp_9w87n9v9bnokxm9i3k10qtvnm.argfile' 'com.explore.springbootdemo.DemoApplication'
Error: could not open `C:\Users\manjeet'
I am just trying to create a basic IoT core image by following this guide.
But I am always getting the below errors, whenever I run buildimage <product name> Test after building the BSP (Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip (or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2)
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package: C:\OEEWorkspace\Build\arm\pkgs\test.OEM.Sample.cab
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\RPi2FMFileList.xml' as a FM file list ... fatal error : Error: Missing package:
I also followed this issue in GitHub, but couldn't find the exact issue. Have you ever faced any error something similar?
Huh!. It was a silly mistake. I didn't run the New-IoTCabPackage All (or) buildpkg all after building the BSP (Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip (or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2). Hence the cab files were not pushed into the Build\arm\pkgs folder.
After running the buildpkg all I am able to see all the required cab files in the pkgs folder, thus no error. You must do the commands in the below order.
PS C:\OEE>importbsp RPi2 "C:\Users\SibeeshVenu\Downloads\RPi_BSP.zip"
PS C:\OEE>buildpkg all
PS C:\OEE>newproduct OEEIoTCore RPi2
PS C:\OEE>buildimage OEEIoTCore Test
Once that is done, you should be able to see an output as below.
I am trying to use Python to program watson_developer_cloud and I am getting an API key error. My code is really simple:
import json
from watson_developer_cloud import VisualRecognitionV3 as VisualRecognition
visual_recognition = VisualRecognition('2016-05-20', api_key='<myAPIkey>')
test_url = 'https://www.ibm.com/ibm/ginni/images/ginni_bio_780x981_v4_03162016.jpg'
print(json.dumps(visual_recognition.classify(images_url=test_url)))
But for some reason when I run it, I get a SSL error:
requests.exceptions.SSLError: hostname 'gateway-a.watsonplatform.net' doesn't match either of 'access.alchemyapi.com', 'www.access.alchemyapi.com'
I know the API key (omitted above) works because when I use CURL or NodeJS it works just fine.
I am really stumped. Could someone please help?
Figured it out. It turns out you require python>=2.7.8 because of server name identification (SNI). My version of python is 2.7.3, and it does not support that and therefore I am getting the error seen above.
So this is why CURL and other attempts to use the API key work, whereas my python was generating a SSLError. Happy upgrading!
Quick Hack:
Change the file - watson_developer_cloud_service.py:243 as below:
diff watson_developer_cloud_service.py watson_developer_cloud/watson_developer_cloud_service.py
243c243
< params=params, data=data, files=files, verify=False, **kwargs)
---
> params=params, data=data, files=files, **kwargs)
after that -
rm -f /usr/lib/python2.7/site-packages/watson_developer_cloud-0.14.0-py2.7.egg
followed by ..
python setup.py install
I followed this quickstart:
https://docs.prediction.io/templates/classification/quickstart/
and this document for evaluation metrics
https://docs.prediction.io/evaluation/paramtuning/
Everything seems ok until the step build and run evaluation metrics
pio eval org.template.classification.AccuracyEvaluation \
org.template.classification.EngineParamsList
I am getting the exception:
Exception in thread "main" scala.reflect.internal.MissingRequirementError: object org.template.classification.AccuracyEvaluation not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)
at scala.reflect.internal.Mirrors$RootsBase.ensureModuleSymbol(Mirrors.scala:126)
at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:161)
at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:21)
at io.prediction.workflow.WorkflowUtils$.getEvaluation(WorkflowUtils.scala:103)
at io.prediction.workflow.CreateWorkflow$$anonfun$19.apply(CreateWorkflow.scala:146)
at io.prediction.workflow.CreateWorkflow$$anonfun$19.apply(CreateWorkflow.scala:144)
Could anyone help me with this?
Thank you very much.
Had the exact same problem. Fixed it by doing the following:
For each .scala file in engine_dir/src/main/scala/org/template/engine_name/ you need to change the first line from...
package <SomeTemplateName>
To the following (replacing engine_name with the name of the folder in the path mentioned above):
package org.template.<engine_name>
Then, in engine.json you need to change the following line...
"engineFactory": "<template name>.<template engine>",
To the following (once again replacing engine_name with the name of the folder in the path mentioned above):
"engineFactory": "org.template.<engine name>.<template engine>",
Now re-run...
pio build
pio train
pio deploy
Then you should be able to run the model evaluation without errors.
Simply run it like this
$ pio eval org.example.classification.AccuracyEvaluation \
org.example.classification.EngineParamsList
You dont have to change anything. The class package from the sample was org.example.classification not org.template.classification