How to execute a compiled code snipped in Frege online repl - frege

OK, I guess this is a stupid beginners question:
I try to learn Frege through the online repl. For doing so, I though it would be a good idea to paste code examples from Dierk's Real World Frege to the upper right window of the repl, press compile and... ? How do I start this code?

I guess I partly found the answer myself:
the :java command in the command line shows the generated code. Within this code, it is visible that the compiled module is automatically imported, so we don't have to reference it.
Now, if we take the HelloWorld example from the repl, it is simply executed by typing
frege> main
into the left window.
Dierk uses for his examples the syntax
main _ = do
If we now type
frege> main
we only get
:: a -> IO ()
as output. But if we type
frege> main "something"
the repl gives the expected output. While I still don't know what's going on, this helps me with my next steps :-)

Related

Minecraft Modding Using Forge: GradleStart is in default package?

My project runs, and I see my mod populating within Minecraft, but for some reason my code doesn't do anything. I followed a basic tutorial that should be adding an item with a texture. I also set some basic method as such within Main to test whether this is working or not:
public void onPlayerTick(TickEvent.PlayerTickEvent tick)
{
System.out.println("testing 123");
}
Upon loading of the world, this doesn't output anything.
Any help?
I think it's working now. I made the dev environment again, this time with a different tutorial from the beginning. The main difference was this tutorial used intellij like me, unlike the other tutorial which used eclipse. Seems to be working because something in the init method printed out something in the format that is expected in the console (meaning it is compiling and using the code properly). So it appears to be working... It seems. I used these tutorials, they were very in depth, would recommend regardless. This is the playlist: https://www.youtube.com/playlist?list=PLxZiPYkNuhkQKH-QlM0C_3-LvjbQA8ZAu

Import UIKit for debugging Objective-C by default

Whenever I try to read the frame of an UIView for example while debugging, I get this error:
error: property 'frame not found on object of type 'UIView *'
error: 1 errors parsing expression
After searching for a solution, I found out that I can use this command to solve this without adding (annoying and in some cases complicated) casts:
expr #import UIKit;
But I still find it annoying to have to do this every time (why doesn't Xcode do this by default?!), so I thought I should be able to do this using the .lldbinit file, but I couldn't get it to work.
I don't know much about that file, I have this in it atm:
command script import /usr/local/opt/chisel/libexec/fblldb.py
so I tried adding the UIKit import command at the end of the file but it didn't look that it worked. I also tried prefixing it with command to no avail. Is this possible or not? (please say yes; it will save my life)
lldb will auto-import modules that the debug info tells us the program imports fairly soon now. All the pieces weren't in place to do that for the first Xcode 7 releases.
Statements in the .lldbinit get run before the main file is read in, it is supposed to help set up the environment to read in your program. But at that point there's nothing into which to import these symbols. You need to do it after the main binary is read in (and you really need to do it after you have run, since I think we need to run some code to do this.)
At present, the simplest way to do this is to make an auto-continue breakpoint at main, and attach the expr #import UIKit statement as a debugger command in that breakpoint. You'll have to do this once per new project you make, but if you're working on the same project for a while, it's not such an inconvenient workaround.

compile error using openssl

I try to use openSSL on a app but I get a parse issue on the following line (in the rsa.h header file)
int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx);
error is : parse error expected ')'
Using XCode 5 on OSX 10.9 and openssl-1.0.1e
What can be the issue?
Thanks for your help.
For anyone who sees this in the future, it's an amazingly simple solution: on the line quoted in the question, just change BIGNUM *I to BIGNUM *i. (That is, change the capital "I" to lowercase "i".)
Recompile, and everything should work! I have no idea why that works, but I trusted the interwebs and once again my faith was rewarded.
It could be all sorts of things, either in the header or in the file before the point the header is included. If by looking at the region of source around the point it is not obvious you can try preprocessing the file.
In Xcode select Product -> Perform Action -> Preprocess "file" and you'll get an editor window containing the source the compiler actually sees after file inclusion and macro expansion. In that locate the point of the error, look around, and work backwards if needed, untill you spot the problem.

FlashDevelop code completion AIR API

I haven't used FlashDevelop in half a year, and on returning (and updating it) the code completion no longer functions properly. I'm not entirely sure, but I think the code completion doesn't know the AIR library.
When pressing "Ctrl+Space" after typing "import" will only show me the classes I have already imported.
Pressing "Ctrl+Space" after typing "import f" or "import flash." returns no suggestions.
If I type of the import by hand, the class will successfully compile though.
I have updated Flex, FlashDevelop, the debugger
Code completion is activated
I have set Compiler Options >> SWC Included Libraries to "Flex 4.6\frameworks\libs\player\11.1\playerglobal.swc"
searched google and stack overflow for a solution
I have tried shang's suggestions (this & this too)
and I'm out of ideas.
any help would be greatly appreciated.
Jake
Ctrl+Alt+Space will show all the classes included in the classpath. Select an entry and it will generate the import statement.

Objective-C: Trying to use Apple's MultipleDetailView

I am working on trying to make a splitview based application. I am trying to use Apple's MultipleDetailView example code
http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html
I have never really used example code like this (I usually just atart from scratch). All i did was copy the code into the correct classes of my app, but when I try to run it on the simulator the app doesn't open.
I feel like I am maybe forgetting something obvious, since I didn't code it myself.
Thanks!
The usual debugging technique applies. Put a breakpoint somewhere early in the program -- the first line of main() for instance, and debug from there. Do you hit the breakpoint? If yes, move forward through the code until you find the line that causes the problem. If no, try to back up even further if you can, and also look for any clues as to what's going wrong. If the app is running at all, there should be some sort of error message in the console output.
"...the app doesn't open" doesn't tell us nearly enough to help you. Something like "the app delegate is instantiated, but it's window and splitViewController properties are nil" goes much further toward getting to the root of the problem.