Skip to main content

Importing MATLAB projects into SAGE (via OMPC)

Recently, I imported a large MATLAB project into SAGE. Here are the steps I followed. 

The first step was the conversion of .m files to python (.pym). ompc (An Open-Source MATLAB-to-Python Compiler) by Peter Jurica may be used as a standalone application, or online here. The online application is not a full-fledged cloud application where files may be imported and stored for future access -- instead, it allows the importing and conversion of a single file or piece of code, at a time. The standalone application requires the following packages -- scipy, numpy and matlibplot. These may found in any scipy-stack distribution based on Python 2.5 or 2.4 (for e.g. I used v1.1 of Portable Python). Then, ompc documentation describes how a file may be converted. There is a small bugfix that needs to be made in the code (if it hasn't already happened, ref. bitbucket pull request) -- change the line "if not os.path.exists(sys.path[1])" to "if not os.path.exists(sys.argv[1])" in ompc\ompcply.

After I converted all my .m files to .pym files, I created my project on sagecloud and uploaded my project directories into them. .mat files may then be converted as well, on the cloud, using the python notebook (see instructions here).

Popular posts from this blog

Migrating from MS SQL Server to MongoDB

The following contains notes from various attempts at migrating 2.5GB of MS SQL Server data to MongoDB, on an 8 GB, quad-core, 64-bit Windows 7 Enterprise machine.
[TERMINATED] : Simple to use. Exponential slowdown observed in migration. For a total of the 50 million records spanning two tables, the following migration times were observed: 1 second for the first 100,000 records,  30 minutes for 1,000,000, 20 hours for 16 million (after which I terminated the process).[DID NOT WORK] : A ruby-based approach. Use Ruby 1.9.3 (tiny_tds dependency causes problems with Ruby 2.0). Install DevKit before installing the mongify gem. Also, use 'sqlserver' as the adapter in the .config file. Then, before running 'mongify check <config-file>', install the gems activerecord-sqlserver-adapter and tiny_tds. At this stage, it fails. 'mongify translation <config-file>' fails as well.[MODIFIED/WORKED!!]…

Prohibition of envy in Judaism, Christianity and Islam

"One of the sanest, surest, and most generous joys of life comes from being happy over the good fortune of others." (attributed variously to Robert Heinlein & Archibald Rutledge).

The idea of envy (or, covetousness) is an important subject in the Abrahamic faith traditions of Judaism, Christianity and Islam.

The prohibition against covetousness rounds out the Mosaic moral code, codified as the 10th and final commandment in the Ten Commandments -- the injunction against coveting one's neighbor's property. The rationale behind this is the acknowledgement that all blessings arise from God's sovereign providence and it is not for his creation to question whom and how and when he chooses to bless.

Merriam-Webster's dictionary defines covetousness as :

1. "feeling or showing a very strong desire for something that you do not have and especially for something that belongs to someone else", or
2. "marked by inordinate desire for wealth or possessi…

The moral filth of neo-liberal and neo-conservative statism

or, progressive socialism is not the greater evil.
After years of trying to make sense of how the world works, economically and politically, and how, according to some, it ought to work, I have increasingly come to the realization that the libertarian political-philosophical persuasion is the only one consistent with justice. A just society must necessarily be a free society. Specifically, one that is founded on libertarian principles -- private property, NAP, non-initiation of violence, easement & homesteading rights, etc. In fact, the “justness” (righteousness) of a society will increase in concert with and to the degree to which a society moves from totalitarian statism to democratic statism (of the neo-conservative or neo-liberal varieties) to minarchism to anarchism.
After spending a few zealous but misguided and ignorantly happy years occupied with mainstream GOP politics, including loyally and foolishly supporting the Bush-Cheney-Rove regime, despite serious mo…