Skip to content

Instantly share code, notes, and snippets.

import Combine
@available(OSX 10.15, watchOS 6.0, iOS 13.0, iOSApplicationExtension 13.0, OSXApplicationExtension 10.15, *)
public protocol RealmSubscribable {
func observe<S>(_ subscriber: S) -> NotificationToken where S: Subscriber, S.Input == Self
}
@available(OSX 10.15, watchOS 6.0, iOS 13.0, iOSApplicationExtension 13.0, OSXApplicationExtension 10.15, *)
extension Object: Combine.ObservableObject {
public var objectWillChange: RealmPublisher<Object> {
TEST_CASE("bench") {
InMemoryTestFile config;
config.cache = false;
auto r = Realm::get_shared_realm(config);
r->update_schema({
{"Project", {
{"id", PropertyType::Int, Property::IsPrimary{true}},
{"items", PropertyType::Object|PropertyType::Array, "Item"}
}},
{
"sans-serif" => [
0 => "LucidaGrande"
1 => "AppleSymbolsFB"
2 => "GeezaPro"
3 => "Thonburi"
4 => "Kailasa"
5 => [
0 => [
0 => "ja"
#!/usr/bin/python
from subprocess import check_call
import os
build_order = [
'ffmpeg',
# 'libav',
'ffms2',
'fftw',
+ (void)checkForRealm
{
@autoreleasepool {
[KST_TriviaSource deleteAllObjectsInRealm];
RLMArray *matches = [KST_Match allObjects];
int countMatches = (int)[matches count];
NSLog(@"before copy, count is %i", countMatches);
if (countMatches == 0) {
NSError *error;
+ (void)checkForRealm
{
if (![[NSFileManager defaultManager] fileExistsAtPath:[RLMRealm defaultRealmPath]]) {
NSString *defaultInBundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"default.realm"];
NSError *error = nil;
[[NSFileManager defaultManager] copyItemAtPath:defaultInBundlePath toPath:RLMRealm.defaultRealmPath error:&error];
if (error != nil) {
NSLog(@"error copying default realm was %@", [error debugDescription]);
}
}
[Script Info]
; Script generated by Aegisub 8608-master-73eaedc
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: 640
PlayResY: 480
struct {
using result_type = void;
ProjectProperties &obj;
std::string const& value;
void operator()(std::string ProjectProperties::*f) const { obj.*f = value; }
void operator()(int ProjectProperties::*f) const { try_parse(value, &(obj.*f)); }
void operator()(double ProjectProperties::*f) const { try_parse(value, &(obj.*f)); }
} visitor {target->Properties, value};
boost::apply_visitor(visitor, it->second);
diff --git i/src/subtitles/RTS.cpp w/src/subtitles/RTS.cpp
index 56102e3..2ea5461 100644
--- i/src/subtitles/RTS.cpp
+++ w/src/subtitles/RTS.cpp
@@ -390,9 +390,14 @@ void CWord::Transform(PathData* path_data, const CPointCoor2& org)
//if(fSSE2) { // SSE code
// Transform_SSE2(path_data, org);
//} else // C-code
- Transform_C(path_data, org);
+
local re = require 'aegisub.re'
aegisub.register_macro('re.find', 're.find test', function()
local string = 'hèllò'
local matches = re.find(string, '\\X')
aegisub.log('total: %d\n', #matches)
for i, match in ipairs(matches) do
aegisub.log('%d: %s\n', i, match.str)
end
end)