This file contains 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
// | |
//Registry.cpp | |
// | |
//Implementation for DllRegisterServer,DllUnregisterServer | |
//Contains code to write COM server data into the registry and | |
//also removing the data that had been written into the registry | |
//by this module. | |
// | |
#include <windows.h> |
This file contains 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
#include <winrt/base.h> | |
#include <type_traits> | |
#include <hstring.h> | |
template <typename T> | |
winrt::impl::com_ref<T> load_winrt_component_from_dll(const winrt::hstring& dll_file) | |
{ | |
WINRT_ASSERT(std::is_base_of_v<winrt::Windows::Foundation::IUnknown, T>, "T must inherit from Windows::Foundation::IUnknown"); | |
INT32(__stdcall * get_activation_factory)(void*, void**) { nullptr }; |
This file contains 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 path import Pathlib | |
import hashlib | |
def hash_file(file: str | Path) -> str: | |
sha256 = hashlib.sha256() | |
file_mem_view = memoryview( | |
bytearray(128 * 1024) | |
) |
This file contains 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
/* | |
When loading the PDF document, you need to set the `fontExtraProperties` parameter to `true`. e.g. | |
getDocument({ | |
..., | |
fontExtraProperties: true | |
}) | |
*/ | |
var generateId = () => { | |
return ( |
This file contains 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 | |
layer = torch.nn.Conv2d(128, 256, kernel_size=(2, 2), stride=(3, 3), padding=(1, 1)) | |
for i in range(5, 21): | |
z = torch.zeros(1, 128, i, i) | |
z = layer(z) | |
print(z.shape) |
This file contains 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
/* | |
this is a snippet of the class that does this processing | |
*/ | |
foreach ($bibliography as &$work){ | |
foreach ($work as $key => $value) { //iterates over the properties of the work (an individual citation) one by one | |
if ($key != "author") { //does every property except author | |
$work[$key] = self::sentenceCase($work[$key], $key); //lowercases everything but the bracketed words | |
} | |
} |
This file contains 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
Command "/home/vagrant/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tm | |
p/pip-build-yof3w9qh/m2crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f | |
.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --r | |
ecord /tmp/pip-jbxkvphj-record/install-record.txt --single-version-externally-managed --co | |
mpile --install-headers /home/vagrant/venv/include/site/python3.6/m2crypto" failed with er | |
ror code 1 in /tmp/pip-build-yof3w9qh/m2crypto/ |
This file contains 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
flask.cli.NoAppException: While importing "stumpf.wsgi", an ImportError was raised: | |
Traceback (most recent call last): | |
File "/home/vagrant/venv/lib/python3.6/site-packages/flask/cli.py", line 235, in locate_app | |
__import__(module_name) | |
File "/vagrant/stumpf/wsgi.py", line 3, in <module> | |
from stumpf.app import create_app | |
File "/vagrant/stumpf/app.py", line 15, in <module> | |
from stumpf.views import (annotation_app_bp, artifact_bp, assignment_bp, | |
File "/vagrant/stumpf/views.py", line 12, in <module> |