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 sat import clause, get_variables, exclude, to3, randomize, propagate, clean | |
| import php | |
| import dimacs | |
| import random | |
| def preprocess(xs): | |
| if not xs: | |
| return xs | |
| vs = get_variables(xs) |
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
| def transform(n): | |
| powers = [] | |
| k = 0 | |
| while n: | |
| if n & 1: | |
| powers.append(k) | |
| n >>= 1 | |
| k += 1 | |
| return powers |
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 torch, torch.distributions as distributions | |
| import numpy | |
| import math | |
| import random | |
| DTYPE=torch.float32 | |
| device = 'cuda' | |
| pi = None | |
| inf = None | |
| uniform = None |
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 math | |
| import matplotlib.pyplot as plot | |
| EPS = 1e-24 | |
| red = (2.0,0.0,0.0) | |
| green = (0.0,2.0,0.0) | |
| blue = (0.0,0.0,2.0) | |
| yellow = (1.0,1.0,0.0) | |
| cyan = (0.0,1.0,1.0) | |
| magenta = (1.0,0.0,1.0) |
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
| diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c | |
| index 1f8b2ebcc..e216904fe 100644 | |
| --- a/src/gui_gtk_x11.c | |
| +++ b/src/gui_gtk_x11.c | |
| @@ -4059,6 +4059,28 @@ gui_mch_init(void) | |
| G_CALLBACK(gtk_settings_xft_dpi_changed_cb), NULL); | |
| } | |
| + if (GTK_IS_WIDGET(gui.mainwin)) | |
| + { |
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
| # Example showing how to create a minimal GTK 4 app with a main window and on it a Wayland subsurface fed by Vulkan. | |
| # The FPS counter printed on the console should show about 60 fps on Gnome/Mutter. | |
| # One may need to install vulkan (the python package) from source. | |
| # Maybe same for pywayland. Mileage may vary. | |
| # I happen to have two discrete GPUs installed in the test computer, one AMD, one NVIDIA, and Intel integrated to top. | |
| # The Radeon is the main one running Gnome/Mutter (after some /usr/share/glvnd/egl_vendor.d/ symlinking happened, that is) | |
| # "Works for me" on the Radeon, when started from Gnome Terminal as python example4.py | |
| # Playing around with switcherooctl style env variables trying to get the Nvidia card to render vulkan while being composited to | |
| # the main window does not work though. |
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
| #pragma once | |
| #ifdef _WIN64 | |
| #define _USE_MATH_DEFINES | |
| #endif | |
| #include <cstdint> | |
| #include <complex> | |
| #include <cmath> | |
| #include <vector> | |
| #include <map> |
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
| <?php | |
| /** | |
| * Plugin Name: My Test Plugin | |
| */ | |
| defined('ABSPATH') or die(); | |
| require_once 'lessc.inc.php'; | |
| class my_test_plugin { | |
| private $less; |