Skip to content

Instantly share code, notes, and snippets.

import numpy as np
from collections import namedtuple
### Convenience functions
variables = (
"rank", # 0 for no bid, 1 for 1 clubs, 2 for 1 diamonds, ..., 5 for 1 no-trump, ..., 35 for 7 no-trump
"passes", # 0 - 4 consecutive passes
"turn", # whose turn it is; 0 for the team who opens the bidding, 1 for the other
"contractor", # the team who did the last bidding; 0 for the team who opens the bidding, 1 for the other
"doubles" # the number of doubles (0,1,2)
1. Hex:
wget http://hex.loria.fr/dist800/hex-8.0.0-x64-mint14.run
chmod +x ./hex-8.0.0-x64-mint14.run
./hex-8.0.0-x64-mint14.run
Press Enter if there is any default value (in [...] )
Otherwise, type "y"
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="kekule/release/kekule.js?modules=chemWidget,openbabel,indigo"></script>
<script>
Kekule.Indigo.enable();
@sjdv1982
sjdv1982 / AspectLayout.py
Created September 7, 2017 13:12
QLayout that keeps fixed aspect ratio of its only widget.
# Sjoerd de Vries, 2017
# partially based on code ported from https://gist.github.com/pavel-perina/1324ff064aedede0e01311aab315f83d, copyright (c) 2017 Pavel Perina
"""
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: