Skip to content

Instantly share code, notes, and snippets.

View rickhg12hs's full-sized avatar
😎

rickhg12hs

😎
  • ČVUT
  • Prague, Czech Republic
View GitHub Profile
@rickhg12hs
rickhg12hs / gist:3ae86f4e8b4a9af9b0335c6bf6ff8120
Created March 14, 2022 15:54
`PolynomialFeatures(2)` with out `sklearn`
new_M = np.apply_along_axis(lambda x: np.array([x[k1]*x[k2] for k2 in range(len(x)) for k1 in range(len(x)) if k1>=k2]), axis=1, arr=M)
N.B.: ^ could be simpler and more efficient
Is _roughly_ equivalent to:
[pseudocode]
new_M = empty array
Foreach row in M:
@rickhg12hs
rickhg12hs / Ipopt-config.log
Last active August 29, 2015 14:05
~/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Ipopt configure 3.11.7, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure --prefix=/home/rick/.julia/v0.4/Ipopt/deps/usr --prefix=/home/rick/.julia/v0.4/Ipopt/deps/usr --enable-dependency-linking --with-blas=/home/rick/.julia/v0.4/Ipopt/deps/usr/lib/libcoinblas.a --with-lapack=/home/rick/.julia/v0.4/Ipopt/deps/usr/lib/libcoinlapack.a --cache-file=/dev/null --srcdir=.
## --------- ##
## Platform. ##
@rickhg12hs
rickhg12hs / Built search.html
Last active August 29, 2015 13:59
Sphinx built HTML search.html
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; Julia Language 0.3.0-dev documentation</title>
@rickhg12hs
rickhg12hs / zigtab-32bit.csv
Created March 26, 2014 10:17
32-bit and 64-bit Ziggurat tables for randn (CSV format: index,ki[index],wi[index],fi[index])
0 0x0007799ec012de1d 0x3cdf493b78164498 0x3ff0000000000000
1 0000000000000000 0x3c9b8d0be3d6973c 0x3fef446ac97c027e
2 0x0006045f4c79561f 0x3ca250af3c2009d0 0x3feeb7545b6e5a42
3 0x0006d1aa7d5d2108 0x3ca57cb9383ae4d8 0x3fee3f11e0296bc5
4 0x000728fb3f6024cf 0x3ca801fce827fa64 0x3fedd36fa706360a
5 0x0007592af4e97d19 0x3caa230c2e46384e 0x3fed70920658fa21
6 0x000777a5c0bf1109 0x3cac004d2f328d4d 0x3fed144978a24297
7 0x00078ca3857ce63d 0x3cadac2f5a6f30e1 0x3fecbd33a8a8460f
8 0x00079bf6b0ffb894 0x3caf32482d48076f 0x3fec6a5eceaa82c4
9 0x0007a7a34ab06fc9 0x3cb04d32278c8313 0x3fec1b1cd9efb953
@rickhg12hs
rickhg12hs / ki_wi_fi_tables_32-bit
Created March 25, 2014 05:54
deps/random/randmtzig.c Ziggurat tables
for (int i = 0; i < ZIGGURAT_TABLE_SIZE; i++)
printf("%i,%#.16llx,%+#la,%+#la\n", i, ki[i], wi[i], fi[i]);
0,0x0007799ec012de1d,+0x1.f493b78164498p-50,+0x1.p+0
1,0000000000000000,+0x1.b8d0be3d6973cp-54,+0x1.f446ac97c027ep-1
2,0x0006045f4c79561f,+0x1.250af3c2009dp-53,+0x1.eb7545b6e5a42p-1
3,0x0006d1aa7d5d2108,+0x1.57cb9383ae4d8p-53,+0x1.e3f11e0296bc5p-1
4,0x000728fb3f6024cf,+0x1.801fce827fa64p-53,+0x1.dd36fa706360ap-1
5,0x0007592af4e97d19,+0x1.a230c2e46384ep-53,+0x1.d70920658fa21p-1
6,0x000777a5c0bf1109,+0x1.c004d2f328d4dp-53,+0x1.d144978a24297p-1