This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data ApplyKey b a where | |
| F :: ApplyKey (a -> b) | |
| A :: ApplyKey a | |
| instance Reflex t => Apply (Event t) where | |
| evf <.> evx = fmapMaybe fromDMap e' where | |
| e' merge (DMap.fromList [F :=> evf, A :=> evx]) | |
| fromDMap m = case (DMap.lookup F m, DMap.lookup A m) of | |
| (Just (Identity f), Just (Identity a)) -> Just (f a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data ApplyKey b a where | |
| F :: ApplyKey (a -> b) | |
| A :: ApplyKey a | |
| instance Reflex t => Apply (Event t) where | |
| evf <.> evx = fmapMaybe fromDMap e' where | |
| e' merge (DMap.fromList [F :=> evf, A :=> evx]) | |
| fromDMap m = case (DMap.lookup F m, DMap.lookup A m) of | |
| (Just (Identity f), Just (Identity a)) -> Just (f a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| untilE :: (Reflex t, MonadHold t m, MonadFix m) => (a -> Bool) -> Event t a -> m (Event t a) | |
| untilE f e = do | |
| last <- headE (ffilter f e) | |
| switchHold e (never <$ last) | |
| holdDynUntil :: (Reflex t, MonadHold t m, MonadFix m) => (a -> Bool) -> Dynamic t a -> m (Dynamic t a) | |
| holdDynUntil f d = buildDynamic (sample (current d)) =<< untilE f (updated d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| import os.path as path | |
| import os | |
| from matplotlib import pyplot as plt | |
| def valid(file): | |
| _, ext = path.splitext(file) | |
| return ext in ['.jpg', '.png', '.jpeg'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| causality loop detected: | |
| Main.main (test/DebugCycles.hs:182:1-30) | |
| | | |
| `- Main.runTest (test/DebugCycles.hs:(144,1)-(160,28)) | |
| | | |
| `- Test.Run.runApp' (test/Test/Run.hs:(64,1)-(66,75)) | |
| | | |
| `- Test.Run.runApp (test/Test/Run.hs:(29,1)-(58,92)) | |
| | | |
| `- Reflex.PerformEvent.Base.hostPerformEventT (src/Reflex/PerformEvent/Base.hs:(130,1)-(150,15)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| read -p 'Enter COSC Username: ' user | |
| echo "Writing ~/.ssh.config..." | |
| cat > ~/.ssh/config << END | |
| # This is the most part as it allows access to the gateway computer | |
| # Accessing any internal computers requires this base configuration. | |
| Host cosc | |
| Hostname linux.cosc.canterbury.ac.nz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #!/bin/bash | |
| read -r -d '' script <<-'EOF' | |
| /netfs/share/bin/mountp | |
| ln -sf ~/.p_drive/file.canterbury.ac.nz/Student/Class/cosc ./cosc_shared | |
| EOF | |
| ssh cosc "$script" > /dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from os.path import split | |
| import torch | |
| import opt_einsum as oe | |
| import torch.utils.benchmark as benchmark | |
| from torch import nn | |
| import torch.nn.functional as F | |
| f1 = 256 | |
| f2 = 256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from os.path import split | |
| from typing import List | |
| import torch | |
| # import opt_einsum as oe | |
| from torch.nn.modules.activation import ReLU | |
| import torch.utils.benchmark as benchmark | |
| from torch import nn | |
| import math | |
| import nestedtensor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| import numpy as np | |
| import functools | |
| from scipy.optimize import leastsq | |
| def homog_points(points): |