Skip to content

Instantly share code, notes, and snippets.

View FanwangM's full-sized avatar
🏠
Working from home

Fanwang Meng FanwangM

🏠
Working from home
View GitHub Profile
@FanwangM
FanwangM / CP_GFJSP.py
Last active January 11, 2024 20:24
CP_GFJSP
from itertools import product
from collections import OrderedDict
from ortools.linear_solver import pywraplp
from ortools.sat.python import cp_model
import numpy as np
from utils import get_m_value, parse_data
# n_opt, n_mach, operation_data, machine_data = parse_data("gfjsp_10_10_1.txt")

TopSpin on macOS 10.15 (Catalina) or 11.x (Big Sur)

Due to new security measures introduced in Catalina (macOS 10.15), many apps including TopSpin don't work the way one might expect, especially when trying to access files on the Desktop and other protected folders.

On my own Mac (running Big Sur), this problem still persists in TopSpin 4.1.3. Furthermore, this can't be solved by changing permissions from inside System Preferences.

This guide will walk you through:

  • How to open TopSpin using the macOS Terminal in order to circumvent this issue.
  • How to create an app which you can place in the Dock and click on, so that you don't have to open the terminal every time.
@FanwangM
FanwangM / gist:6460cb24b66aeb3b40aa85960a56a351
Created July 23, 2021 03:10 — forked from amueller/gist:1351047
sklearn precomputed kernel example
from sklearn.datasets import load_digits
from sklearn.svm import SVC
from sklearn.utils import shuffle
from sklearn.metrics import zero_one_score
import numpy as np
digits = load_digits()
X, y = shuffle(digits.data, digits.target)
X_train, X_test = X[:1000, :], X[1000:, :]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FanwangM
FanwangM / README-badges.md
Created February 18, 2020 07:21 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
import numpy as np
from sklearn.datasets import make_moons
from sklearn.cross_validation import train_test_split
n_feature = 2
n_class = 2
def make_network(n_hidden=100):
import numpy as np
from sklearn.datasets import make_moons
from sklearn.cross_validation import train_test_split
n_feature = 2
n_class = 2
def make_network(n_hidden=100):
@FanwangM
FanwangM / monokai-exteded.xml
Created September 20, 2019 03:50 — forked from LeoIannacone/monokai-exteded.xml
Monokai Extended - GtkSourceView Theme
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 Leo Iannacone <[email protected]>
This file was generated from a textmate theme named Monokai Extended
with tm2gtksw2 tool. (Alexandre da Silva)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@FanwangM
FanwangM / .gitconfig
Created September 19, 2019 15:15 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls