Skip to content

Instantly share code, notes, and snippets.

cpufreq-set -d 0.8GHz -u 3.5GHz -g powersave --cpu 0
@NagyGa1
NagyGa1 / bobyqa.kt
Created January 16, 2019 10:23
BOBYQA basic example
val point = doubleArrayOf(1.0, 2.0)
val function = object : MultivariateFunction {
private var eval = 0
// noise
private val random = Random()
override fun value(point: DoubleArray?): Double {
@NagyGa1
NagyGa1 / R xts column addition performance.R
Last active September 21, 2018 01:37
R xts column addition performance
v <- rnorm(nrow(bars))
microbenchmark(
xts_direct = {
bars2 <- bars
bars2$col1 <- v
bars2$col2 <- v
bars2$col3 <- v
bars2$col4 <- v
bars2$col5 <- v
@NagyGa1
NagyGa1 / gist:135d1c9dd7a0dcba6a8e8f6dd170ea5b
Created May 25, 2017 00:27
Trackpoint sensitivity Ububtu 16.04
http://nrvale0.github.io/posts/adjusting-thinkpad-trackpoint-sensitivity-on-ubuntu-1604-and-others/
@NagyGa1
NagyGa1 / gist:f5bcc86fcd1c7a9f516e572e41e6e6d8
Created April 14, 2017 03:06
mysql update uuid binary(16)
update UserAccount set uuid = unhex(replace(uuid(),'-',''));
@NagyGa1
NagyGa1 / AccessTransactionStatusJee.java
Created March 25, 2017 06:54
Accessing transaction status and key in JEE
@Resource
TransactionSynchronizationRegistry tsr;
public String startActivity(@Nonnull final PolicyActivity activity) {
LOG.debug("em: {}, tsr: {} {}", em, tsr.getTransactionStatus(), tsr.getTransactionKey());
import com.cpox.model.partner.Partner;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.implementation.FieldAccessor;
import net.bytebuddy.implementation.InvocationHandlerAdapter;
import net.bytebuddy.implementation.MethodDelegation;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.InvocationHandler;
@NagyGa1
NagyGa1 / gist:a9506822b364d7109d7d
Created December 21, 2015 08:08
Open new window by POST using h:commandButton
http://stackoverflow.com/a/11631563/2772979
<h:commandButton value="Open in new Window" onclick="this.form.target='_blank'" />
@NagyGa1
NagyGa1 / gist:26bc32409ec2fc8659a7
Created December 8, 2014 09:22
Futronic udev rules
Ubuntu 14.04:
/etc/udev/rules.d/52-futronic.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1491", MODE="0666", GROUP="plugdev"