Fsharp CSV parsing - csv

I'm trying to get this to work
http://fsharp.github.io/FSharp.Data/library/CsvFile.html
But to me it seems like tha CsvFile class and the CSVextionson are removed of the Data lib
I'm running it on Manjaro (Arclinux system)
I'm using the mono compiler (fsharpc)
I got the dotnet core lib
So nothing should be wrong
please help
EDITED
Code
open FSharp.Data
let msft = CsvFile.Load("https://github.com/kam1986/Data-Science-project/blob/master/news_sample.csv")
It is placed in a .fsx file
get hte error message
Fake News.fsx(3,14): error FS0039: The value, namespace, type or module 'CsvFile' is not defined.

Related

"Error Deserializing JSON Credential Data" gcp auth file c#

Following on from this question, I'd like to open a related one to verify an answer.
Originally my code looked like
string path2key = "C:/Users/me/Downloads/project-id-1-letters.json";
string jsonString = File.ReadAllText(path2key);
Console.WriteLine(jsonString); // this works and prints correctly
// I presume I'm passing json as a string???
var credential = GoogleCredential.FromJson(jsonString);
but I was getting the following error
System.InvalidOperationException: 'Error deserializing JSON credential data.'
FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
I'm using netframework 4.5, meaning I'm somewhat limited in updating packages to the latest and greatest.
The other answer is correct. I was about to post the same answer but #serge beat me to it.
The class GoogleCredentials has a member FromJson. That member takes a string argument. In your code, you were trying to pass an object.
For the error in your comment to the answer:
FileNotFoundException: Could not load file or assembly 'System.Security.Permissions
That error can be corrected by using nuget package manager and adding System.Security.Permissions or via the CLI:
dotnet add package System.Security.Permissions

How to remove error created using cocos2d-x v2.2.3 (Language cpp) for windows phone?

I'm trying to run my Game created using cocos2d-x-v2.2.3 (language cpp) for windows phone. But it shows following error.
error C2440: 'type cast' : cannot convert from 'void (__cdecl StartScene::* )(void)' to 'cocos2d::extension::SEL_CCControlHandler'
If I include pch.h file in all class file above error is removed then new error created. The error is
"Cannot open include file: 'pch.h': No such file or directory"
Though pch.h and pch.cpp are presented in CocosDenshion. In this circumstances what should i do?
Thanks in Advance
i think this because you use wrong function, fowllow this (CCObject::SEL_CCControlHandler)(CCObject, CCControlEvent) so the func you use must have func(CCObject*, CCControlEvent),

Using JUnit in Jython - NameError for assertTrue

Environment Details
Mac OS X 10.9
Oracle JDK 1.7.0_55 64-bit
jython-standalone-2.5.3.jar
junit-4.11
What I have done so far
I have added the junit jar to /Library/Java/Extensions.
I invoked Jython as follows java -jar jython-standalone-2.5.3.jar
In the Jython interpreter, I imported the following import org.junit.Assert, and this import was successful.
Problem
When I tried to use assertTrue, I got a NameError in the interpreter. Why is this so?
I understand that assertTrue is a static method. Not sure what implication this has when I try to use it in Jython.
Additional Context
I am using XMLUnit in Jython. Was able to successfully import the Diff class from org.custommonkey.xmlunit in Jython. Also able to use the methods in this class, and call them on a Diff object. The result of this method call is what I am trying to pass to assertTrue, when it throws the error.
from org.custommonkey.xmlunit import Diff
import org.junit.Assert
xml1 = ...some XML string...
xml2 = ...some XML string...
myDiff = Diff(xml1, xml2)
assertTrue(myDiff.similar())
Hope this additional information is useful in identifying a solution to this problem.
Latest Status
I narrowed it down to setting this property python.security.respectJavaAccessibility = false, since the Assert() constructor is protected.
Still trying to get it to work. Any help is greatly appreciated.
Figured it out.
In addition to junit.jar file, the hamcrest-core.jar file also needed to be copied to /Library/Java/Extensions.
Then I got rid of the jython.jar file, and instead installed it using the jython installer.
After the installation was completed, I updated the registry file in the installation folder, specifically setting this property python.security.respectJavaAccessibility = false.
Now I am able to see the assertTrue method, and no longer getting a NameError.

Dart confusing TYPE error

I am building a web application using dart with web_ui.
Everything was working fine until i added the web_ui pub, and now, when I am trying to run a build.dart file I get an error:
Uncaught Error: type 'AttributeName' is not a subtype of type 'String' of 'name'.
What does this mean?
From what I understand, this means there is somewhere an instance named 'name' of class 'AttributeName' that is extending 'String' class.
I searched my entire project and there is nowhere a class named 'AttributeName', nowhere an instance of 'name'.
I have the latest Dart editor and SDK:
Dart Editor version 0.4.7_r21658
Dart SDK version 0.4.7.5_r21658
EDIT:
this is my build.dart file:
import 'package:web_ui/component_build.dart';
import 'dart:io';
void main() {
build(new Options().arguments, ['web/menyplattan.html']);
}
Also, i updated all the pubs
This message looks like web_ui is failing a type check.
The similar SO question MarioP links to has a stacktrace showing this message coming from within the web ui library itself.
Do you have an xmlns attribute in your html?
Have a look at this web-ui issue.
AttributeName is defined within the html5lib library. Perhaps web-ui is expecting a newer version of this library but getting an older one. Make sure you've done a pub install. You can also try deleting your packages folder and doing a fresh pub install.
This could be caused by out-of-date packages, but it could also be a bug in web-ui. See if you can get a stacktrace and file a bug report, or post it on the web-ui mailing list.

Unable to parse JSON error using Twitterizer TwitterStatus.Show method

Running this code:
var statusResponse = TwitterStatus.Show(tweet.Id);
gives an error message: Unable to parse JSON in the statusResponse object and the ResponseObject comes back as null.
Not sure how to fix this. Any ideas?
I run into the same issue today. It seems that you reference a newer version of Newtonsoft.Json in your project (or maybe an other NuGet package included it).
The problem can be fixed by using the Newtonsoft.Json 4.0.5.0 library that is shipped with the Twitterizer project. It needs to be that exact version.