Skip to content

Instantly share code, notes, and snippets.

@isuruf
isuruf / symbench
Last active August 29, 2015 14:17
Symbench
CSymPy Python Sympy Sage
Time for R1 0.00066423 0.14357901 0.00441193
Time for R2 0.02706814 0.09750199 0.21840095
Time for R3 0.00001597 0.00000811 0.00023913
Time for R5 0.00000691 0.00002003 0.02814817
Time for S1 0.01834798 2.52634192 0.14646697
Time for S2 0.02388787 9.31213713 0.26978588
Time for S3 0.02070594 1.58386302 0.14189600
Time for S3a 2.09762287 14.9792959
@isuruf
isuruf / gist:ab8b43da7f0e27364e0d
Created July 12, 2015 16:07
symengine_conversions
/* Generated by Cython 0.22 */
/* BEGIN: Cython Metadata
{
"distutils": {
"language": "c++",
"libraries": [
"symengine",
"gmpxx",
"gmp"

You'll have store a pointer to SymEngine objects. For the test assume a SymEngine object is like below,

typedef struct {
    double A;
    double B;
} CStruct;

Come up with a solution to create a struct, update the struct, delete the struct and showing the contents of the struct from R.

@isuruf
isuruf / simpleRestfulHttpServerInPython
Created April 18, 2017 11:14 — forked from mafayaz/simpleRestfulHttpServerInPython
Writing Simple HTTP Server in Python (With REST and JSON)
There are many already existing powerful http servers that can be used in python e.g. gevent, twisted web server. However, they are a bit complex to use and you cannot start them in a thread other than the main thread.
Here is a sample of basic http server using "BaseHTTPRequestHandler". The example exposed two rest interfaces:
To ingest records into the web server
To retrieve already ingested records from the web server
The records are assumed to be JSON based, however, any type of records can be ingested.
[sourcecode language="python" wraplines="false" collapse="false"]
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
This file has been truncated, but you can view the full file.
isuru@bb8:~/octave-4.2.1$ ls
bin fc_update.bat lib man notepad++ plugins sbin x86_64-w64-mingw32
cmdshell.bat imports lib32 m.ico octave.bat postinstall share
doc include lib64 mkspecs octave-firsttime.vbs qsci translations
etc info libexec msys.ico octave.vbs README.html var
isuru@bb8:~/octave-4.2.1$ ls -R
.:
bin fc_update.bat lib man notepad++ plugins sbin x86_64-w64-mingw32
cmdshell.bat imports lib32 m.ico octave.bat postinstall share
This file has been truncated, but you can view the full file.
isuru@bb8:~/octave-4.2.1$ ls
bin fc_update.bat lib man notepad++ plugins sbin x86_64-w64-mingw32
cmdshell.bat imports lib32 m.ico octave.bat postinstall share
doc include lib64 mkspecs octave-firsttime.vbs qsci translations
etc info libexec msys.ico octave.vbs README.html var
isuru@bb8:~/octave-4.2.1$ ls -R
.:
bin fc_update.bat lib man notepad++ plugins sbin x86_64-w64-mingw32
cmdshell.bat imports lib32 m.ico octave.bat postinstall share
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file C:\\Users\\idf2\\AppData\\Local\\Temp\\test-282f6a.o
File Type: COFF OBJECT
FILE HEADER VALUES
8664 machine (x64)
@isuruf
isuruf / Error.log
Last active May 3, 2018 22:18
MSVC 2015 Update 3 ICE
Generating code
c:\bld\dipy_1525377738849\work\dipy\segment\metricspeed.c(5066) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 255)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.exe'
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
set YEAR=2015
set VER=14
mkdir "%PREFIX%\etc\conda\activate.d"
COPY "%RECIPE_DIR%\activate.bat" "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
echo if "%%VC14_ON_VS2017%%" == "" ( >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"
IF "%cross_compiler_target_platform%" == "win-64" (
echo SET "CMAKE_GENERATOR=Visual Studio 15 2017 Win64" -T "v140" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat"