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).


Comments

Popular posts from this blog

the brave new economy

A free(er) market is emerging and has been emerging ever since the advent of the Internet and the Web. Newer technologies have accelerated this. Old inefficiencies in knowledge and access to the market are quickly disappearing. Participation is increasingly peer-to-peer (P2P). Participants can produce, create, curate, give, lend, sell, share, auction, consume, take, borrow, buy, reuse, rent and/or barter goods, services, cash, credit, currency, equity, debt and/or knowledge. The resultant economy is highly collaborative and is sometimes referred to as the ‘ sharing economy ’. Efficiencies are being introduced and value is being created in the smallest of markets. Non-profit activities are thriving as well, in addition to for-profit ones. The marketplace is becoming, at once, global and local. An important subset of the new economy is collaborative and crowdsourced , and may be described as commons-based peer production . Asymmetries in information are diminished by algorithms (Google

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]  http://mssql2mongo.codeplex.com/ : 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] http://rubydoc.info/gems/mongify/ : 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.

the World Cup draw -- an alternative proposal

The FIFA World Cup seeding and draw system has consistently produced groups of death and groups comprised mainly of teams that fail to invoke passion or imagination from fans around the world, except perhaps for such teams' own fans. The latest edition is no exception -- and may even be the worst ever on this measure. An outline of the draw system can be seen here . We have one group which contains Switzerland, Ecuador and Honduras and another consisting of Russia, Algeria and South Korea!! And, on top of this, we have at least three, if not four or more, groups of death. Depending on one's perspective, esp. given the recent rise of African powerhouses, all of the rest of the groups may even be considered Groups of Death!! This is a disservice to football fans around the world, not to mention the skilled and enterprising teams that worked hard to get here. To address this, I propose a simplified draw system : Randomize Pot 1 and assign to Groups Assign remaining Pots t