Cabal - Installing beam-migrate - haskell

I'm trying to install beam-migrate dependency and it fails with the following error:
Configuring library for beam-migrate-0.5.0.0..
Preprocessing library for beam-migrate-0.5.0.0..
Building library for beam-migrate-0.5.0.0..
[ 1 of 20] Compiling Database.Beam.Migrate.SQL.SQL92 ( Database/Beam/Migrate/SQL/SQL92.hs, dist/build/Database/Beam/Migrate/SQL/SQL92.o )
[ 2 of 20] Compiling Database.Beam.Migrate.Types.Predicates ( Database/Beam/Migrate/Types/Predicates.hs, dist/build/Database/Beam/Migrate/Types/Predicates.o )
[ 3 of 20] Compiling Database.Beam.Migrate.SQL.Types ( Database/Beam/Migrate/SQL/Types.hs, dist/build/Database/Beam/Migrate/SQL/Types.o )
[ 4 of 20] Compiling Database.Beam.Migrate.Serialization ( Database/Beam/Migrate/Serialization.hs, dist/build/Database/Beam/Migrate/Serialization.o )
[ 5 of 20] Compiling Database.Beam.Migrate.Checks ( Database/Beam/Migrate/Checks.hs, dist/build/Database/Beam/Migrate/Checks.o )
[ 6 of 20] Compiling Database.Beam.Migrate.Generics.Tables ( Database/Beam/Migrate/Generics/Tables.hs, dist/build/Database/Beam/Migrate/Generics/Tables.o )
[ 7 of 20] Compiling Database.Beam.Migrate.Types.CheckedEntities ( Database/Beam/Migrate/Types/CheckedEntities.hs, dist/build/Database/Beam/Migrate/Types/CheckedEntities.o )
[ 8 of 20] Compiling Database.Beam.Migrate.Types ( Database/Beam/Migrate/Types.hs, dist/build/Database/Beam/Migrate/Types.o )
[ 9 of 20] Compiling Database.Beam.Migrate.SQL.Tables ( Database/Beam/Migrate/SQL/Tables.hs, dist/build/Database/Beam/Migrate/SQL/Tables.o )
Database/Beam/Migrate/SQL/Tables.hs:32:5: warning: [-Wdodgy-exports]
The export item ‘IsNotNull(..)’ suggests that
‘IsNotNull’ has (in-scope) constructors or class methods,
but it has none
|
32 | , IsNotNull(..)
| ^^^^^^^^^^^^^
[10 of 20] Compiling Database.Beam.Migrate.SQL.BeamExtensions ( Database/Beam/Migrate/SQL/BeamExtensions.hs, dist/build/Database/Beam/Migrate/SQL/BeamExtensions.o )
[11 of 20] Compiling Database.Beam.Migrate.SQL ( Database/Beam/Migrate/SQL.hs, dist/build/Database/Beam/Migrate/SQL.o )
[12 of 20] Compiling Database.Beam.Migrate.SQL.Builder ( Database/Beam/Migrate/SQL/Builder.hs, dist/build/Database/Beam/Migrate/SQL/Builder.o )
[13 of 20] Compiling Database.Beam.Migrate.Generics.Types ( Database/Beam/Migrate/Generics/Types.hs, dist/build/Database/Beam/Migrate/Generics/Types.o )
[14 of 20] Compiling Database.Beam.Migrate.Generics ( Database/Beam/Migrate/Generics.hs, dist/build/Database/Beam/Migrate/Generics.o )
[15 of 20] Compiling Database.Beam.Haskell.Syntax ( Database/Beam/Haskell/Syntax.hs, dist/build/Database/Beam/Haskell/Syntax.o )
Database/Beam/Haskell/Syntax.hs:1041:10: error:
Duplicate instance declarations:
instance Hashable a => Hashable (S.Set a)
-- Defined at Database/Beam/Haskell/Syntax.hs:1041:10
instance Hashable v => Hashable (S.Set v)
-- Defined in ‘hashable-1.3.5.0:Data.Hashable.Class’
|
1041 | instance Hashable a => Hashable (S.Set a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build beam-migrate-0.5.0.0

beam-migrate-0.5.0.0 is incompatible with hashable-1.3.5.0. Either upgrade to beam-migrate-0.5.1.0 (preferred), or downgrade to hashable-1.3.3.0.

Related

unhashable type: 'numpy.ndarray' for scatter plot

I am getting unhashable type: 'numpy.ndarray' error. so I cast the df_subset , 'Views' to int,however, it is returning object
here is the script:
tsne = TSNE(n_components=2, verbose=1, perplexity=20, n_iter=1000)
tsne_results = tsne.fit_transform(logits_list)
df_subset = pd.DataFrame({'X':tsne_results[:,0], 'Y':tsne_results[:,1], 'Views':targets})
print(df_subset)
df_subset.astype({'Views': 'int'}).dtypes
print(df_subset.dtypes)
colors = {'A2CH':'red', 'A3CH':'green', 'A4CH_LV':'blue', 'A4CH_RV':'cyan', 'A5CH':'magneta', 'Apical_MV_LA_IAS':'yellow',
'PLAX_TV':'black', 'PLAX_full':'white', 'PLAX_valves':'orange', 'PSAX_AV':'purple', 'PSAX_LV':'dodgerblue', 'Subcostal_IVC':'lightgreen', 'Subcostal_heart':'darkcyan', 'Suprasternal':'grey'}
ax = sns.scatterplot(x= "X", y= "Y", hue='Views', legend = 'full',palette = colors, data=df_subset)
plt.show()
here is a print of df_subset and dtype:
X Y Views
0 13.208739 -19.657906 [11]
1 7.932375 -31.547863 [6]
2 -3.896450 -23.075047 [9]
3 -11.836237 -12.138339 [9]
4 -8.077571 17.220371 [11]
5 9.463497 23.756912 [2]
6 8.354083 -47.790867 [10]
7 -2.848731 -0.220144 [9]
8 25.724466 -29.862696 [9]
9 -26.956612 -8.361418 [9]
10 -16.011475 2.309184 [7]
11 16.193329 -0.280985 [8]
12 5.060284 -9.906323 [9]
13 37.827713 -16.174528 [4]
14 -5.971475 -39.845860 [7]
15 6.608039 9.085782 [12]
16 -20.108206 -26.253906 [8]
17 32.851559 0.332044 [2]
18 23.818949 13.762548 [2]
19 23.625357 -12.107020 [3]
X float32
Y float32
Views object
dtype: object
I assume I am getting the unhashable type: 'numpy.ndarray' error because of object type? Any help would be appreciated.
.astype() returns a copy so it should work if you do
df_subset = df_subset.astype({'Views': int})

When does excel use a single item from a named range v.s. all the items?

Say you have the following named-ranges a, b, c, in column A, B, and C:
|A |B |C
---+---+---+---------
1 |a |b |c
---+---+---+---------
2 |1 |=a |=b+a
---+---+---+---------
3 |2 |=a |=b+a
---+---+---+---------
4 |3 |=a |=CONCATENATE(b+a)
---+---+---+---------
5 |4 |=a |=MIN(a)
then B4=3 and C4="33" for instance are calculated from a single cell in their named-range reference. C5=1 on the other hand is calculated using the whole range over a.
I would like to know where this behavior is defined and how can I know when and how it is used. Is this a case-by-case type of thing or is the behavior well-defined?
I got the answer, or at least captured a large collection of the answer. It seems like the single-item behaviour works on functions that has arguments that are single-variable like (so no ranges or vectors).
To find these functions, I wrote a script that inspects some files from the LibreOffice source code, and try to map all the Excel functions (that are listed by the project) with arrays or ranges as arguments.
Here's the script: https://gist.github.com/heetbeet/64cdfce26c2e4420ed416028b1d22393
And here's the output. All functions are listed with single-item arguments left blank, and multi-item arguments filled with their abbreviated type:
AGGREGATE ( □, □, RX, … )
AND ( RX, … )
AVEDEV ( RX, … )
AVERAGE ( RX, … )
AVERAGEA ( RX, … )
CHISQ.TEST ( VA, … )
CHITEST ( VA, … )
CORREL ( VA, … )
COUNT ( RX, … )
COUNTA ( RX, … )
COVAR ( VA, … )
COVARIANCE.P ( VA, … )
COVARIANCE.S ( VA, … )
DEVSQ ( RX, … )
F.TEST ( VA, … )
FORECAST ( □, VA, … )
FORECAST.ETS ( □, VA, □, … )
FORECAST.ETS.CONFINT ( □, VA, □, … )
FORECAST.ETS.SEASONALITY ( □, VA, □, … )
FORECAST.ETS.STAT ( □, VA, □, … )
FORECAST.LINEAR ( □, VA, … )
FREQUENCY ( RA, … )
FTEST ( VA, … )
FVSCHEDULE ( □, RX )
GCD ( RX, … )
GEOMEAN ( RX, … )
GROWTH ( RA, RA, RA, □ )
HARMEAN ( RX, … )
IMPRODUCT ( RX, … )
IMSUM ( RX, … )
INDEX ( RA, □, … )
INTERCEPT ( VA, … )
IRR ( RA, □ )
ISREF ( RX )
KURT ( RX, … )
LARGE ( RX, □ )
LCM ( RX, … )
LINEST ( RA, RA, □, … )
LOGEST ( RA, RA, □, … )
LOOKUP ( □, RA, … )
MATCH ( □, RX, □ )
MAX ( RX, … )
MAXA ( RX, … )
MDETERM ( VA )
MEDIAN ( RX, … )
MIN ( RX, … )
MINA ( RX, … )
MINVERSE ( VA )
MIRR ( RA, □, … )
MMULT ( VA, … )
MODE ( VA, … )
MODE.MULT ( VA, … )
MODE.SNGL ( VA, … )
MULTINOMIAL ( RX, … )
NETWORKDAYS ( □, □, RX, □, … )
NETWORKDAYS.INTL ( □, □, □, RX )
NPV ( □, RX, … )
OR ( RX, … )
PEARSON ( VA, … )
PERCENTILE ( RX, □ )
PERCENTILE.EXC ( RX, □ )
PERCENTILE.INC ( RX, □ )
PERCENTRANK ( RX, □, □ )
PERCENTRANK.EXC ( RX, □, □ )
PERCENTRANK.INC ( RX, □, □ )
PROB ( VA, VA, □, … )
PRODUCT ( RX, … )
QUARTILE ( RX, □ )
QUARTILE.EXC ( RX, □ )
QUARTILE.INC ( RX, □ )
RSQ ( VA, … )
SERIESSUM ( □, □, □, RX )
SKEW ( RX, … )
SKEW.P ( RX, … )
SLOPE ( VA, … )
SMALL ( RX, □ )
STDEV ( RX, … )
STDEV.P ( RX, … )
STDEV.S ( RX, … )
STDEVA ( RX, … )
STDEVP ( RX, … )
STDEVPA ( RX, … )
STEYX ( VA, … )
SUM ( RX, … )
SUMPRODUCT ( VA, … )
SUMSQ ( RX, … )
SUMX2MY2 ( VA, … )
SUMX2PY2 ( VA, … )
SUMXMY2 ( VA, … )
T.TEST ( VA, VA, □, … )
TREND ( RA, RA, RA, □ )
TRIMMEAN ( RX, □ )
TTEST ( VA, VA, □, … )
TYPE ( VX )
VAR ( RX, … )
VAR.P ( RX, … )
VAR.S ( RX, … )
VARA ( RX, … )
VARP ( RX, … )
VARPA ( RX, … )
WORKDAY ( □, □, RX, □, … )
WORKDAY.INTL ( □, □, □, RX )
XIRR ( RX, RX, □ )
XNPV ( □, RX, RX )
XOR ( RX, … )
Z.TEST ( RX, □, … )
ZTEST ( RX, □, … )

Numpy , Python3.6 - not able to understand why address is different?

Here is my Code
my_array_1 = np.arange(25).reshape(5, 5)
print(my_array_1)
my_array_red = my_array_1[:, 1::2]
print(my_array_red)
my_array_blue = my_array_1[1::2, 0:3:2]
print(my_array_blue)
my_array_yellow = my_array_1[-1, :]
print(my_array_yellow)
print(id(my_array_1))
print(id(my_array_red))
print(id(my_array_yellow))
print(id(my_array_blue))
print(my_array_1.data)
print(my_array_red.data)
print(my_array_blue.data)
print(my_array_yellow.data)
Here is the Output:
[[ 0 1 2 3 4]
[ 5 6 7 8 9]
[10 11 12 13 14]
[15 16 17 18 19]
[20 21 22 23 24]]
[[ 1 3]
[ 6 8]
[11 13]
[16 18]
[21 23]]
[[ 5 7]
[15 17]]
[20 21 22 23 24]
2606769150592
2606769282544
2607017647120
2606769282624
<memory at 0x0000025EFE56CA68>
<memory at 0x0000025EFE56CA68>
<memory at 0x0000025EFE56CA68>
<memory at 0x0000025EFE5A8F48>
Question :
Just check the last 4 lines of my output . why my_array_1.data.data , my_array_red.data, my_array_blue.data have same value , But where as my_array_yellow.data have a different value ?
I find the data value of the __array_interface__ to be more informative:
In [2]: my_array_1.__array_interface__['data']
Out[2]: (33691856, False)
In [3]: my_array_red.__array_interface__['data']
Out[3]: (33691864, False)
In [4]: my_array_blue.__array_interface__['data']
Out[4]: (33691896, False)
In [5]: my_array_yellow.__array_interface__['data']
Out[5]: (33692016, False)
Out[2] is the start of the data buffer.
red is 8 bytes larger - that is one element from the start.
blue is 40 bytes in - the next row
In [8]: my_array_1.strides
Out[8]: (40, 8)
yellow is 160 bytes in - that's the start of the last row (40 from the end)
In [9]: 2016-1856
Out[9]: 160
In [10]: my_array_1.nbytes
Out[10]: 200
The data addresses all differ, but are in the same ballpark. But they are harder to interpret.
In [11]: my_array_1.data
Out[11]: <memory at 0x7fa975369a68>
In [12]: my_array_red.data
Out[12]: <memory at 0x7fa975369b40>
In [13]: my_array_blue.data
Out[13]: <memory at 0x7fa975369c18>
In [14]: my_array_yellow.data
Out[14]: <memory at 0x7fa9710f11c8>
The data attribute can be used in an ndarray constructor:
Two elements from yellow:
In [17]: np.ndarray(2,dtype=my_array_1.dtype,buffer=my_array_yellow.data)
Out[17]: array([20, 21])
Same 2 elements, but with the original address, and an offset (as deduced above):
In [18]: np.ndarray(2,dtype=my_array_1.dtype,buffer=my_array_1.data, offset=160)
Out[18]: array([20, 21])
Actually the data display doesn't tell us anything about where the data buffer is located. It's the address of the memoryview object that references the buffer, not the address of the buffer itself. Call data again, and get a different memoryview object:
In [19]: my_array_1.data
Out[19]: <memory at 0x7fa975369cf0>
If I print these memoryview objects, I get the same pattern as you do:
In [22]: print(my_array_1.data)
<memory at 0x7fa970e37120>
In [23]: print(my_array_red.data)
<memory at 0x7fa970e37120>
In [24]: print(my_array_blue.data)
<memory at 0x7fa970e37120>
In [25]: print(my_array_yellow.data)
<memory at 0x7fa9710f17c8>
For 23 and 24, it's just reusing a memory slot, because with print there's no persistence. I'm not sure why yellow doesn't reuse it, except maybe the object is sufficiently different that it doesn't fit in the same space. In the Out[11] etc. cases, the ipython buffering hangs onto those objects, and thus there's not reuse.
It just reinforces the idea that there's nothing significant about the print display of these memoryview objects. It has nothing to do with the databuffer location. It's more like the id, just an arbitrary place in memory.

Segmentation violation detected in Matlab2016a on Ubuntu15.10

I get this error when starting Matlab2016a on Ubuntu 15.10 64bit. How can I fix it?
MATLAB crash file:/home/jalal/matlab_crash_dump.8510-1:
------------------------------------------------------------------------
Segmentation violation detected at Wed Aug 31 20:50:17 2016
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Current Visual : 0x21 (class 4, depth 24)
Default Encoding : UTF-8
GNU C Library : 2.21 stable
Host Name : klein
MATLAB Architecture : glnxa64
MATLAB Root : /usr/local/MATLAB/R2016a
MATLAB Version : 9.0.0.341360 (R2016a)
OpenGL : hardware
Operating System : Linux 4.2.0-42-generic #49-Ubuntu SMP Tue Jun 28 21:26:26 UTC 2016 x86_64
Processor ID : x86 Family 6 Model 63 Stepping 2, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11702000), display :0
Fault Count: 1
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000000 RBX = 00007f7a44573808
RCX = 0000000000000000 RDX = 0000000000000003
RSP = 00007f7b3bdf3cd0 RBP = 00007f7b3bdf3df0
RSI = 0000000000000000 RDI = 00007f7a4456f9e8
R8 = 0000000000000018 R9 = 0000000000000000
R10 = 00007f7a4456f000 R11 = 00007f7a44574450
R12 = 00007f7a4478ff80 R13 = 0000000000000006
R14 = 00007f7a44570cc0 R15 = 00007f7aa82b4a60
RIP = 00007f7b5ce778ca EFL = 0000000000010206
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007f7b5ce778ca /lib64/ld-linux-x86-64.so.2+00051402
[ 1] 0x00007f7b5ce804c1 /lib64/ld-linux-x86-64.so.2+00087233
[ 2] 0x00007f7b5ce7b474 /lib64/ld-linux-x86-64.so.2+00066676
[ 3] 0x00007f7b5ce7f9b3 /lib64/ld-linux-x86-64.so.2+00084403
[ 4] 0x00007f7b5a528fc9 /lib/x86_64-linux-gnu/libdl.so.2+00004041
[ 5] 0x00007f7b5ce7b474 /lib64/ld-linux-x86-64.so.2+00066676
[ 6] 0x00007f7b5a52962d /lib/x86_64-linux-gnu/libdl.so.2+00005677
[ 7] 0x00007f7b5a529061 /lib/x86_64-linux-gnu/libdl.so.2+00004193 dlopen+00000049
[ 8] 0x00007f7b56d740b6 /usr/local/MATLAB/R2016a/bin/glnxa64/libut.so+00315574
[ 9] 0x00007f7b56d74c76 /usr/local/MATLAB/R2016a/bin/glnxa64/libut.so+00318582 _Z11utGetModuleRKSbIDsSt11char_traitsIDsESaIDsEEPi+00000022
[ 10] 0x00007f7b56d74d6b /usr/local/MATLAB/R2016a/bin/glnxa64/libut.so+00318827 utGetModule+00000171
[ 11] 0x00007f7b4a1f9d45 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_dispatcher.so+00482629
[ 12] 0x00007f7b4a1eceaf /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_dispatcher.so+00429743 _ZN13Mlm_MATLAB_fn8try_loadEv+00000031
[ 13] 0x00007f7b4a1e3e95 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_dispatcher.so+00392853 _ZN13Mlm_MATLAB_fn4loadEv+00000037
[ 14] 0x00007f7b4a1e15e9 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_dispatcher.so+00382441 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000057
[ 15] 0x00007f7b472261c9 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+09232841
[ 16] 0x00007f7b47352dbf /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+10464703
[ 17] 0x00007f7b47348a5a /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+10422874
[ 18] 0x00007f7b47311911 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+10197265
[ 19] 0x00007f7b46ddfb2a /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04750122
[ 20] 0x00007f7b46de0a4c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04753996
[ 21] 0x00007f7b46ddeebc /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04746940
[ 22] 0x00007f7b46ddc9ea /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04737514
[ 23] 0x00007f7b46ddcdb1 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04738481
[ 24] 0x00007f7b46ddea63 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04745827
[ 25] 0x00007f7b46ddebe9 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+04746217
[ 26] 0x00007f7b46e8f16f /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+05468527
[ 27] 0x00007f7b46e9222a /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+05481002
[ 28] 0x00007f7b47134543 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08242499
[ 29] 0x00007f7b470fd07e /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08015998
[ 30] 0x00007f7b47101058 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08032344
[ 31] 0x00007f7b47101107 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08032519
[ 32] 0x00007f7b4717732c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08516396
[ 33] 0x00007f7b4717770c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_lxe.so+08517388
[ 34] 0x00007f7b49bfad7d /usr/local/MATLAB/R2016a/bin/glnxa64/libmwm_interpreter.so+03165565 _Z51inEvalCmdWithLocalReturnInDesiredWSAndPublishEventsRKSbIDsSt11char_traitsIDsESaIDsEEPibbP15inWorkSpace_tag+00000077
[ 35] 0x00007f7b4a8739e1 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00825825 _ZNK3iqm18InternalEvalPlugin24inEvalCmdWithLocalReturnERKSbIDsSt11char_traitsIDsESaIDsEEP15inWorkSpace_tag+00000081
[ 36] 0x00007f7b4a873b58 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00826200 _ZN3iqm18InternalEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000120
[ 37] 0x00007f7afe767ee4 /usr/local/MATLAB/R2016a/bin/glnxa64/libnativejmi.so+00974564 _ZN9nativejmi21JmiInternalEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000340
[ 38] 0x00007f7afe78dedd /usr/local/MATLAB/R2016a/bin/glnxa64/libnativejmi.so+01130205 _ZN3mcr3mvm27McrSwappingIqmPluginAdapterIN9nativejmi21JmiInternalEvalPluginEE7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000429
[ 39] 0x00007f7b4a866f98 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00774040
[ 40] 0x00007f7b4a850c87 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00683143
[ 41] 0x00007f7b496c87a9 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwbridge.so+00173993
[ 42] 0x00007f7b496c8c44 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwbridge.so+00175172
[ 43] 0x00007f7b496cf1a5 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwbridge.so+00201125
[ 44] 0x00007f7b496cf2ac /usr/local/MATLAB/R2016a/bin/glnxa64/libmwbridge.so+00201388
[ 45] 0x00007f7b496cf97b /usr/local/MATLAB/R2016a/bin/glnxa64/libmwbridge.so+00203131 _Z8mnParserv+00000715
[ 46] 0x00007f7b4a523c13 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00695315
[ 47] 0x00007f7b5c80d81c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmvm.so+02410524 _ZNK5boost9function0IvEclEv+00000028
[ 48] 0x00007f7b4a525925 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00702757
[ 49] 0x00007f7b4a526839 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00706617 _ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025
[ 50] 0x00007f7b572ee8a0 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwms.so+03168416 _ZN5boost6detail22task_base_shared_stateIvE3runEv+00000064
[ 51] 0x00007f7b4a527717 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00710423
[ 52] 0x00007f7b4a52375a /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00694106
[ 53] 0x00007f7b4a896c06 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00969734
[ 54] 0x00007f7b4a884b4c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00895820 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
[ 55] 0x00007f7b4a88521f /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00897567 _ZNK5boost9function0INS_3anyEEclEv+00000031
[ 56] 0x00007f7b4a884993 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00895379 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000163
[ 57] 0x00007f7b4a53871d /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00780061
[ 58] 0x00007f7b4a866f98 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00774040
[ 59] 0x00007f7b4a8515af /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00685487
[ 60] 0x00007f7b4a84e7e3 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwiqm.so+00673763
[ 61] 0x00007f7b5c1caa3a /usr/local/MATLAB/R2016a/bin/glnxa64/libmwservices.so+03443258
[ 62] 0x00007f7b5c1c98a7 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwservices.so+03438759
[ 63] 0x00007f7b5c1ca10c /usr/local/MATLAB/R2016a/bin/glnxa64/libmwservices.so+03440908 _Z25svWS_ProcessPendingEventsiib+00000092
[ 64] 0x00007f7b4a523ed2 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00696018
[ 65] 0x00007f7b4a524211 /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00696849
[ 66] 0x00007f7b4a510cfd /usr/local/MATLAB/R2016a/bin/glnxa64/libmwmcr.so+00617725
[ 67] 0x00007f7b5acff6aa /lib/x86_64-linux-gnu/libpthread.so.0+00030378
[ 68] 0x00007f7b5aa3513d /lib/x86_64-linux-gnu/libc.so.6+01077565 clone+00000109
[ 69] 0x0000000000000000 <unknown-module>+00000000
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.
Solved the problem this way using the instructions in MathWorks bug reports:
jalal#klein:~$ cd /usr/local/MATLAB/R2016a/
jalal#klein:/usr/local/MATLAB/R2016a$ cd sys/os/glnxa64/
jalal#klein:/usr/local/MATLAB/R2016a/sys/os/glnxa64$ sudo mv libstdc++.so.6 libstdc++.so.6.old
[sudo] password for jalal:
jalal#klein:/usr/local/MATLAB/R2016a/sys/os/glnxa64$ matlab
After installing matlab-support
I have to run sudo matlab -nodisplay

How can I compute an exact (integer) determinant in Haskell?

I wanted to use hmatrix but it insists on Double and this gives rounding errors sometimes. Looking at the source, I tried
type instance DoubleOf Rational = Rational
but DoubleOf is not exported (Numeric.ContainerBool is hidden), and that's probably for a reason.
You can perform exact operations on matrices using bed-and-breakfast package.
Here's sample ghci session:
>>> import Numeric.Matrix
>>> import Data.Ratio
>>> let m = fromList [[1 % 2, 2 % 3], [3 % 4, 4 % 5]] :: Matrix Rational
>>> det m
(-1) % 10
>>> m * m
3 % 4 13 % 15
39 % 40 57 % 50
>>> m^4
563 % 400 819 % 500
7371 % 4000 10723 % 5000

Resources