| Andrew Cooke | Contents | RSS | Twitter | Previous

C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

© 2006-2015 Andrew Cooke (site) / post authors (content).

McCloskey Economics Trilogy

From: andrew cooke <andrew@...>

Date: Sat, 23 Apr 2016 21:58:40 -0300

Looks like this might be interesting.

https://www.metafilter.com/158864/Final-part-of-McCloskeys-trilogy-on-political-economy-is-here

Andrew

Permalink | Comment on this post

Previous Entries

For comments, see relevant pages (permalinks).

cmocka - Mocks for C

From: andrew cooke <andrew@...>

Date: Sat, 23 Apr 2016 20:35:04 -0300

As far as I can tell, these aren't actually mock objects, but mock
functions - you can override particular functions in the tests.

https://cmocka.org
http://zhuyong.me/blog/2014/03/19/c-code-unit-testing-using-cmocka/
https://lwn.net/Articles/558106/
https://blog.cryptomilk.org/2013/01/14/cmocka-a-unit-testing-framework-for-c/

Andrew

Permalink

Concept Creep (Americans)

From: andrew cooke <andrew@...>

Date: Fri, 22 Apr 2016 08:36:30 -0300

http://www.theatlantic.com/politics/archive/2016/04/concept-creep/477939/

Andrew

Permalink

Futhark - OpenCL Language

From: andrew cooke <andrew@...>

Date: Mon, 18 Apr 2016 14:09:42 -0300

Futhark is a small programming language designed to be compiled to
highly performant GPU code. It is a statically typed, data-parallel,
and purely functional array language, and comes with a heavily
optimising ahead-of-time compiler that generates GPU code via OpenCL.

Futhark is not intended to replace your existing languages.

http://futhark-lang.org/

Andrew

Permalink

Burgers in Santiago

From: andrew cooke <andrew@...>

Date: Fri, 15 Apr 2016 18:22:04 -0300

http://finde.latercera.com/2016/04/15/comer-beber/benditas-hamburguesas/

Andrew

Permalink

The Origin of Icosahedral Symmetry in Viruses

From: andrew cooke <andrew@...>

Date: Mon, 11 Apr 2016 16:27:31 -0300

http://virus.chem.ucla.edu/icosahedral_symmetry

After seeing http://tabletopwhale.com/img/posts/03-25-16-7.gif

Andrew

Permalink

REST

From: andrew cooke <andrew@...>

Date: Tue, 5 Apr 2016 21:50:24 -0300

https://github.com/rishal-hurbans/The-REST-Architectural-Style

Andrew Cooke

Permalink

US Elections and Gender: 24 Point Swing

From: andrew cooke <andrew@...>

Date: Tue, 29 Mar 2016 20:37:59 -0300

TBH this is somewhat unbelievable:
http://blogs.lse.ac.uk/usappblog/2016/03/24/gender-is-costing-hillary-clinton-big-among-men/

  Half of the respondents were asked about the distribution of income in their
  own households - whether they or their spouse earned more money - before
  being asked about their preference in the Presidential general election. The
  other half were only asked about the distribution of income in their
  household at the end of the survey. This question was designed to remind
  people of disruption to traditional gender roles, without explicitly
  mentioning Clinton or a female president, and simulate the sorts of subtle
  gender-based attacks that can be expected when Clinton is a general election
  candidate.

  The effects of the gender role threat question are enormous. As Figure 1
  shows, men who weren't asked about spousal income until after being asked
  about the Presidential election preferred Clinton over Trump, 49 to
  33. However, those who were reminded about the threat to gender roles
  embodied by Clinton preferred Trump over Clinton, 50 to 42.

Andrew

Permalink

PPPoE on OpenSuse Leap 42.1

From: andrew cooke <andrew@...>

Date: Sun, 27 Mar 2016 17:09:05 -0300

I thought I had documented this, but when I went to install on a new machine I
couldn't find it.  So maybe I copied it all from somewhere else.  Anyway,
here's what I did:

 * Install ppp related packages

 * Create a network device in yast that exists but is not associated with an
   IP address (neither indeirectly nor via dhcp).

 * Check that connecting the ethernet cable from the modem is logged correctly
   (link up) for that device (so you know you have the right ethernet port).

 * In /etc/ppp:

   * Add "hostname" = "password" (not literally) to both pap-secrets and
     chap-secrets (I don't know which is correct).

   * Modify ETH=... in pppoe.conf to be the device created above (eth0).

   * Create peers/movistar (or whatever your ISP is called) with the
     contents

#
# PPP over Ethernet options (using roaring pinguin plugin)
#
plugin rp-pppoe.so

eth0
user hostname
defaultroute
replacedefaultroute
usepeerdns
idle 0
maxfail 0
persist
passive

# pppoe has a lower mtu/mru
mtu 1492
mru 1492
# switch off all compressions (this is a must)
nopcomp
# this is recommended
novjccomp
noccp

   * Create ip-up (with executable bit set):

#!/bin/bash

{
    echo "INTERFACE='$IFNAME'"
    echo "IPADDR='$IPLOCAL'"
    echo "PTPADDR='$IPREMOTE'"
    echo "DNSSERVERS='$DNS1 $DNS2'"
} | /sbin/netconfig modify -s pppd -i "$IPNAME"

/etc/sysconfig/network/scripts/firewall try-restart

   * Create ip-down (with executable bit set):

#!/bin/bash

/sbin/netconfig remove -s pppd -i "$IPNAME"

/etc/sysconfig/network/scripts/firewall try-restart

 * Create /etc/systemd/system/ppp@...

[Unit]
Description=PPP link to %I
Documentation=man:pppd(8)
After=network-pre.target network.service SuSEfirewall2_init.service
Before=network.target multi-user.target shutdown.target SuSEfirewall2.service

[Service]
Type=forking
PIDFile=/var/run/ppp-%I.pid
ExecStart=/usr/sbin/pppd call %I linkname %I updetach nolog
ExecReload=/usr/bin/kill -s HUP $MAINPID
Restart=always
SuccessExitStatus=1
RestartPreventExitStatus=3 4 5

[Install]
WantedBy=network-online.target multi-user.target

 * Create /etc/systemd/system/network-online.target.wants/ppp@...

[Unit]
Description=PPP link to %I
Documentation=man:pppd(8)
After=network-pre.target network.service SuSEfirewall2_init.service
Before=network.target multi-user.target shutdown.target SuSEfirewall2.service

[Service]
Type=forking
PIDFile=/var/run/ppp-%I.pid
ExecStart=/usr/sbin/pppd call %I linkname %I updetach nolog
ExecReload=/usr/bin/kill -s HUP $MAINPID
Restart=always
SuccessExitStatus=1
RestartPreventExitStatus=3 4 5

[Install]
WantedBy=network-online.target multi-user.target

 * Create /etc/systemd/system/multi-user.target.wants/ppp@...

[Unit]
Description=PPP link to %I
Documentation=man:pppd(8)
After=network-pre.target network.service SuSEfirewall2_init.service
Before=network.target multi-user.target shutdown.target SuSEfirewall2.service

[Service]
Type=forking
PIDFile=/var/run/ppp-%I.pid
ExecStart=/usr/sbin/pppd call %I linkname %I updetach nolog
ExecReload=/usr/bin/kill -s HUP $MAINPID
Restart=always
SuccessExitStatus=1
RestartPreventExitStatus=3 4 5

[Install]
WantedBy=network-online.target multi-user.target

And then:

  systemctl enable ppp@...
  systemctl start ppp@...

Note that /usr/share/doc.packages/ppp/SETUP has much useful information.

I think I also had to set the DNS server somewhere, so something above isn't
quite right.  But it works...

In the past I've had issues with the connection dropping and not restarting.
To hack that, I have used this script, run as a cron joib for root (every
minute, say...):

#!/bin/bash

log="/var/log/dsl-check.log"

touch "$log"

exists=`/sbin/ifconfig ppp0 | grep "inet addr"`
if [ ! "$exists" ]
then
  date >> "$log"
  systemctl restart ppp@...
  rm -f /tmp/getmail*.lock
fi

(but you probably don't want to clean out getmail locks from tmp!)

Andrew

Permalink

SuperMicro X10SDV-TLN4F/F with Opensuse Leap 42.1

From: andrew cooke <andrew@...>

Date: Sat, 26 Mar 2016 16:57:36 -0300

New computer :o)

I'm typing this on one of these -
http://www.supermicro.com/products/motherboard/Xeon/D/X10SDV-TLN4F.cfm -
that's 8 Xeon cores (16 hyperthreads) with 64GB buffered ECC memory
(Samsung 4x16 DDR4).

The graphics card I'm using is an ASUS NVidia GTX 960
https://www.asus.com/Graphics-Cards/GTX960-MOC-4GD5/specifications/ (it's
small enough to fit the enclosure, but still reasonably powerful for
GPGPU work).

Disks are 2TB RAID spinning and 220GB SSD.  Keyboard is an old IBM
spacesaver, with PS2 to USB.

Operating system is Opensuse Leap 42.1, connected to my local ISP using
PPoE(!).

Enclosure is an old Silverstone case, about the size of a large shoebox.
It's pretty quiet, but you can hear the GPU fan, slightly.

Everything works very smoothly, but it took some time to get here.  Below
I'll detail the main issues to help others on the way.


First hurdle was getting to the BIOS setup screen.  It's slooooow to
boot and I may simply have run out of patience, or perhaps it needs
memory installed.  But anyway, you seem to have just 1 second in which
to hit DEL when the correct screen comes up.

So once you get into the setup, disable the "quiet" boot (gets rid of
the pretty Supermicro logo, but doesn't display any more until later in
the boot - at the start you get just a single line ending with cryptic
hex digits) and set the pause time to 15s or so.


Next issue was booting from disk.  I think there were two separate fixes,
but it could have been just one that addressed the real problem.  Anyway,
things work for me with UEFI disabled (legacy boot) and also with all the
alternate boot options disabled (this is hard to describe, but on the
BIOS setup boot screen, below the usual list of devices, there are
further entries - select each and disable that fucker).


Third issue was USB3 to my backup disk.  The board has just two USB3
ports on the rear panel, and it seems like the cheapo PS2 keyboard
converter was dragging things down to USB2(?) so I moved the keyboard to
a USB2 on the case and forced USB3 in BIOS (disabled legacy).  That got
USB3 to the disk.


Fourth issue was getting Nvidia to start.  I did my initial install using
the VGA port on the mobo.  Connecting the graphics card didn't change
anything (except the errors in the xorg log) - the chip on this card is
too new to be supported by Nouveau (this is with two monitors - one
connected to VGA and one to the graphics card).  So you need to install
the proprietary drivers.  That's easy in OpenSuse (add the repo and run
"zypper inr" as described at https://en.opensuse.org/SDB:NVIDIA_drivers),
but still doesn't work.  What finally got things working was moving the
jumper JPG1 on the mobo - you can't just remove this, you actually have
to shift it to pins 2+3, which will disable the VGA hardware and allow
Nvidia to come up cleanly (I don't understand why the two can;t coexist,
but there you go).


That's all, so far.  For the 24 or so hours it's been up, it's been
completely solid.  No idea what the total power draw is, but the (old,
Silverstone) PSU is rated at 450W.

I guess I should go spin up a few VMs running Oracle and giggle.

Andrew

Permalink

Big Data AI Could Be Very Bad Indeed....

From: andrew cooke <andrew@...>

Date: Thu, 24 Mar 2016 14:18:15 -0300

http://www.telegraph.co.uk/technology/2016/03/24/microsofts-teen-girl-ai-turns-into-a-hitler-loving-sex-robot-wit/

Andrew

Permalink

Postcapitalism (Paul Mason)

From: andrew cooke <andrew@...>

Date: Fri, 11 Mar 2016 17:20:41 -0300

https://www.youtube.com/watch?v=EM1IOe51NZo

Book not yet available in paperback.

Discussion I haven't watched yet -
https://www.youtube.com/watch?v=4HMs0kkUvq8

Andrew

Permalink