BigInt file cannot be opened in Julia - exception

I am new to julia and experimenting with it. I tried to solve a problem involving very large numbers (100^100) using julia BigInt library but when I use
require("BigInt")
at the interpreter prompt, I get the following error:
could not open file /Applications/JuliaStudio.app/Contents/Resources/juliaengine/BigInt.jl
Any ideas what is going on? I am using the latest version of 64 bit Mac OSX.

BigInt is available by default these days so requiring them won't work. Just use them instead.

Related

Linking to specific glibc version in Cython

I have a Cython extension which I've compiled on Ubuntu 14 and uploaded as an Anaconda package. I'm trying to install the package on another machine which is running Scientific Linux (6?) which ships with an older version of glibc. When I try to import the module I get an error that looks (something like) this:
./myprogram: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./myprogram)
When I say "something like" - the "myprogram" is actually the .so name of the extension.
From what I understand this error is because I have a newer version of glibc on the build system which has an updated version of the memcpy function.
This page has a good description of the problem, and some rather impractical solutions: http://www.lightofdawn.org/wiki/wiki.cgi/NewAppsOnOldGlibc
There is also a much simpler answer proposed here: How can I link to a specific glibc version?
My question is: how to I apply this solution to my Cython extension? Assuming the __asm__ solution works (as given in the second link) what's the best way to get it into the C generated by Cython?
Also, more generally, how to other modules avoid this issue in the first place? For example, I installed and ran a pre-built copy of numpy without any issues.
This turned out to be quite simple.
Create the following header, glibc_fix.h:
__asm__(".symver memcpy,memcpy#GLIBC_2.2.5")
Then include it by using CFLAGS="-include glibc_fix.h". This can be set as an environment variable, or defined in setup.py.
Additionally, it turns out numpy doesn't do anything special in this regard. if I compile it myself it links with the newer version on my system.

Code completion in Toad

I started developing in pl/sql recently. The IDE of choice is Taod. I quickly found out how to do codecompletion for tables, but I can't find a way to get code completion for variables.
I'm used to Textmate on the Mac where I simply write the beginning letters of a string and hit esc. The string is suplemented then with other strings from the same file which have the same beginning.
I was wondering if there is something like it in Taod, but I can't find it anywhere. I checked the checkbox next to Available Variables/Parameteres in Code Assist -> Toad Insight Objects but that didn't help.
Update: Toad Version 12.5.1.1. As pointed out in the first comment I did everything right, but it's actually a bug in this version of Toad.
That checkbox you tried is the way to go about it. There is a bug in Toad 12.5 (maybe earlier versions too) where it's not showing variables if they are defined in lowercase. If they are in uppercase it's OK. This is fixed in Toad 12.6 to be released soon.

Do we have to build the program got from clcreatewithbinary in opencl?

I went through some tutorials to optimize kernal invocation using binary files. I refered the link below,
http://www.fixstars.com/en/opencl/book/OpenCLProgrammingBook/online-offline-compilation/
There it is mentioned that if we use binary files , we don't have to build the created program. I tried that. But it doesn't work as it mentions. When I insert "clBuildProgram(program, 0, NULL, NULL, NULL, NULL)" after the line of creating program from binary files, the program works.
I also went through other references also. Some of them mention we have to insert the "build" line there. I also went through all related questions in this site. But i couldn't get any clear idea about this.
I feel if we really avoid the "build" part, we can reduce the time taken to execution.
If we have to use the "build" part, then my other question is what is the benifit of using binary instead of source.
Thanks in advance.
The specification is your friend. https://www.khronos.org/registry/cl/specs/opencl-1.2.pdf
. clBuildProgram must be called
for program created using either clCreateProgramWithSource or
clCreateProgramWithBinary to build the program executable for one or more devices
associated with program.
So it's explicitly said that you must call the buildprogram even if you are using binary programs.
In most cases the buildprogram is faster for binaryprograms than what they are for text programs. So there is marginal speed benefit.

Installing mym to connect to mysql with matlab

After quite a bit of searching and trying different things, I am stumped on how to get mym to work (as found here: http://sourceforge.net/projects/mym/). I was wondering if anyone has a very simple list of actions needed to get this to work. I think my main trouble is installing zlib. I don't understand how to actually install it or work with it. I have tried to use Microsoft Visual C++ Express 2010 but then only the debug versions are compiled. That means when I try to use the mex function in matlab it gives me the error:
Error: Could not detect a compiler on local system
which can compile the specified input file(s)
I just don't understand the process and everywhere I look it says something different. I have tried multiple versions of each all of the programs involved and nothing seems to work. Any help would be greatly appreciated.
Do:
mex -setup
from the command line to define your compiler on your system. Once you do that then Matlab will correctly locate the compiler and build the mex libraries it needs.
See:
http://www.mathworks.com/help/matlab/matlab_external/building-mex-files.html

MySQL Connector/NET - support for transactions under Mono

Does anyone know how to get MySQL transactions working under Mono?
I'm using MySQL Connector/NET (via Subsonic 3) and it works perfectly under Microsoft .NET. Recently however I tried running the same site under Mono on Ubuntu and it almost works - except I can't seem to get transactions working.
Reading around the Mono/MySQL sites it's not exactly clear what is and isn't supported.
The original problem is a NotImplementedExcetion with call stack like this:
[System.NotImplementedException]: The requested feature is not implemented.
at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction) <0x00181>
at MySql.Data.MySqlClient.MySqlConnection.Open () <0x00381>
at SubSonic.DataProviders.DbDataProvider.CreateConnection (string) <0x00059>
at SubSonic.DataProviders.DbDataProvider.CreateConnection () <0x00015>
There's a few mentions of this on the MySQL site which seem to point to Mono not supporting the required infrastructure to make transactions work. There's also a comment that transactions work fine when using CommittableTransaction rather than TransactionScope. So I tried that, but got the same exception.
Another comment on the MySQL site suggested rebuilding the MySQL data provider with the MONO build option. Which I tried and the site now works, but transactions aren't being used - they've been simply disabled. Really?
I find it hard to believe that transactions can't be made to work in this environment, but can't find a working example.
Mono 2.6.7, MySQL Connection/NET 6.3.4, Subsonic 3, Ubuntu 10.10
Figured it out. It's TransactionScope that doesn't seem to work. Reverting back to DbConnection.BeginTransaction works fine. I've written up how to do it under Subsonic here: http://www.toptensoftware.com/blog/posts/18/using-transactions-with-mono-mysql-and-subsonic
I also had this problem with mono v.2.10.9 and mysqlconnector v. 6.6.5 and 6.7.2-Beta and I was unable to find a solution for this problem but now I figured it out.
First I took the sources of mysqlconnector and added them into my project folder. Thought it would work if I compile the connector directly with mono but it doesn't.
Then I stepped trough the code and I found that there are the following lines of code at line 530 in the file Connection.cs of the MySql.Data project:
#if !MONO && !CF && !RT
Console.WriteLine("### Should not be here... ###");
if (Transaction.Current != null && Settings.AutoEnlist)
EnlistTransaction(Transaction.Current);
#endif
The Console.WriteLine was added by me to try if it will also appear if I run my Application with mono and it appeared. So I commented this lines out and after that everything was working at this moment.
The real solution however should not be to comment out some lines of code.
For solving this you have to define the 'MONO' symbol.
If you are using MonoDevelop just right click on the project MySql.Data and select the compiler section. There you will find a textbox with the label 'define symbols' or something similar. Simply add the new symbol 'MONO' into this textbox.