f# file not running - twitter

I am a noob when it comes to f#, I am a phd student in Maths and I am trying to run the following:
http://blogs.msdn.com/b/dsyme/archive/2011/03/10/slides-and-demo-scripts-for-sigcse.aspx
Under the zip file Demos/TwitterFeed/.....
I am trying to run the files in the TwitterFeed. I have never used f# and when I try to run it under visualstudio shell I get errors. Could anybody please help me.
Thanks,
Mohit

In twitterstream.fsx, change the #load directive for twitterpassword.fs to the following:
#load "TwitterPassword.fs"
This should fix it.

Related

How to run Derric

I'm trying to run Derric with command
import lang::derric::testparse;
I followed all instructions and got everything to work with eclipse and Rascal. I am running the rascal console with Derric. I have tried downloading older versions of eclipse, used windows 7, and windows 10. Nothing is working, I even read the rascal tutorial on modules to see if everything looks right and it does. I need it to work for a school assignment, if someone can get it to run can you tell me under which circumstances (i.e eclipse version, windows version, steps taken) to run the program?
rascal>import lang::derric::testparse;
Error: Cannot import module lang::derric::testparse
Time: 484ms
ok
rascal>
It's suppose to say ok at the end, and then I can run command generate().
Hi #yoyo great that you are trying Rascal, but you need to give more explanation about what you are trying to do. There are potentially two main causes of the message you get:
the module is correct but it cannot be found, or
the module is incorrect (e.g. it does not even parse correctly).
It would therefore be helpful if you show
where lang::derric::testparse is located in your file system, and
to show its contents.
As a side question: is there any relation with the Derric language (a DSL for file formats) Jeroen van den Bos has been working on a few years ago?

How to install Lua GUI in ZBS IDE

I am completely new to programming in Lua outside a sandbox.
I have found a library called Lua GUI that I'd like to use (https://github.com/williamwilling/luagui/). I have still not understood how to quite install the library, and how I even go about using it.
That's part 1 of my question; How can I install Lua GUI(or an library for that matter), and then how do I go about actually using it? By that I mean, is it as simple as writing a program that starts with "require "gui"" and then running it, or is there more to it?
Part 2 of my question is then how do I go about installing it as a package for ZeroBrane Studio IDE, I have no idea at all what the readme file is instructing me to do so I would be grateful if someone could clarify.
If you copy the contents of the src folder in the luagui project to your project directory you should be able to call:
local gui = require("gui")
in your main Lua file and use it that way.

Is there something like Python help function in Fsharp interactive?

Using Python in command line you can write help(function) to see docstring.
Is there something similar in Fsharp for fsi?
Do you have any tips and tricks for working in fsi anyway?
What is even possible to find out without using IDE? Just from interactive session.
EDIT:
This question is actually addressed to Python guys who know Fsharp as well. I guess MS guys relying on their VS might find my question pretty strange :)
So far it seems that my question has simple answer: NO.
EXAMPLE:
Lets say you are logged to remote computer via console. I dont know whether this is typical or even possible scenario. For some reason I started fsi and now what? Am I lost or do I have some chances to get some help from fsi directly
DISCLAMER:
I know Scott Wlaschins fsharpforfunandprofit.com pretty well. But his example is dedicated to C# users. Pythonists have different workflow.
If you are used to interactive python, and you like the approach, you may have a look at this F# engine for iPython Notebook:
https://github.com/fsprojects/IfSharp
Yes.
Simple introspection can be done by typeof <_> or typedefof<_>.
For example:
typeof<System.Console>;;
In fsi you can use TAB completation, but apperantly just from command line. It is not working in my Xamarin.
Neat trick is to run:
fsi --use:yourfile.fsx
which run your file and let you test it interactively.
For more info you can use in command line fsi.exe --help.

F# FAKE Get script directory

Is there an easy way for me to get the path of the executing .fsx file using FAKE? Powershell and (psake) by nature of its use and MSBUILD provide this functionality but as FAKE/F# a noob it is not immediately apparent how to do this.
Try __SOURCE_DIRECTORY__ or
__SOURCE_FILE__.
It should work like in every other F# script file see F# for scripting: location of script file.

Texments package not working on Ubuntu

I am trying to use the Texments Latex package on Ubuntu to do syntax highlighting.
Texments is a wrapper around Pygments.
I installed Texments and followed the steps to add the style file to the path.
But when I try to compile the .tex file, I get the error.
!Undefined Control Sequence
and then it prints out a bunch of wierd characters and places the ? prompt.
Anybody facing this error? What is the resolution?
If there is any other better way to provide syntax highlighting of source code I would be glad to accept it.
I know there is something called "listings" but frankly, i did not find the colors so good in it.
Thanks,
Perhaps you could give minted a try … it basically does the same as texments but has more features and is a little more robust in the face of errors.
Furthermore, as the maintainer of minted I’m always glad of error reports. ;-)
Texments uses a special control sequence for pdftex to allow shell escapes, needed to call the pygmentize binary. You need to call it with pdflatex, and you need to pass pdflatex the -shell-escape switch. Cf. the texments documentation.

Resources