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
#!/bin/bash | |
free -h | |
echo "Pruning caches..." | |
sync | |
echo 3 | sudo tee /proc/sys/vm/drop_caches | |
free -h | |
echo "Hibernating..." | |
sudo systemctl hibernate |
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
pactl load-module module-loopback latency_msec=1000 | |
#switch off: | |
#pactl unload-module module-loopback |
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
TEST_CASE("C-Box-relations", "") { | |
CTestEnv env; | |
env.enableManyEntity(); | |
obx_schema_id test_id = obx_store_entity_id(env.store(), "TestEntityCpp"); | |
obx_id ta_id = env.putTestEntity(0, "ta"); | |
obx_id tb_id = env.putTestEntity(0, "tb"); | |
obx_id tc_id = env.putTestEntity(0, "tc"); |
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
update-alternatives --set cc /usr/bin/gcc | |
update-alternatives --set c++ /usr/bin/g++ | |
cc --version | |
c++ --version | |
apt install nvidia-driver-460 | |
update-alternatives --set cc /usr/bin/clang | |
update-alternatives --set c++ /usr/bin/clang++ | |
cc --version |
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
TEST_CASE("IntSortSpeed-64vs32bit") { | |
std::random_device rd; | |
std::mt19937_64 mt(rd()); | |
std::uniform_int_distribution<uint32_t> int32Dist; | |
int count = 100000000; | |
std::vector<uint32_t> v32; | |
v32.reserve(count); | |
std::vector<uint64_t> v64; | |
v64.reserve(count); | |
StopWatch stopWatch; |
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
package io.objectbox.test.stress; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import io.objectbox.Box; | |
import io.objectbox.BoxStore; | |
import io.objectbox.query.Query; |
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
/** | |
* A "rescue" version of Box.removeAll() for DBs that reached their size limit. | |
* Removes data in multiple transactions of increasing size to minimize required additional disk space. | |
* <p> | |
* Note that this method is not transactional, so it might fail in between, with any number of objects removed. | |
* Thus, you should persistently track the state yourself, e.g. by setting a SharedPreferences flag to indicate | |
* that removal is in progress. If this methods fails, you can check this flag to retry at a later point. | |
* Only once this method succeeds, this flag should be cleared. | |
* <p> | |
* It's recommended to increase the max. DB size to ensure addition capacity is available for this method. |
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
/* | |
* Copyright 2017 ObjectBox Ltd. All rights reserved. | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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
package org.greenrobot; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class CircularStaticDependencies { | |
static AtomicInteger count = new AtomicInteger(1); | |
static class A { | |
static String a1 = "a" + count.getAndIncrement(); | |
static String a2 = "a" + count.getAndIncrement() + B.b1; |
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
package io.objectbox.relation; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.io.File; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.concurrent.CountDownLatch; |
NewerOlder