Skip to content

Instantly share code, notes, and snippets.

@arthurtsang
arthurtsang / DynamicServiceActivatorBeanDefinitionParser.java
Last active March 18, 2020 09:23
Bean definition parser for custom spring namespace
public class DynamicServiceActivatorBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
protected Class getBeanClass(Element element) {
return DefaultDynamicServiceActivator.class;
}
@Override
protected void doParse(Element element, BeanDefinitionBuilder bean) {
List<Element> methodElements = DomUtils.getChildElementsByTagName(element, "method");
ManagedMap<String, BeanDefinition> methodMetadataMap = null;
@MarkMjw
MarkMjw / build.gradle
Last active November 27, 2023 13:40
build.gradle base on Android Studio, and modify manifest when building different channel.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
apply plugin: 'android'
@AdamMarsden
AdamMarsden / zshgit.md
Last active November 15, 2024 02:40
Oh My Zsh - Git Cheat Sheet

#Oh My Zsh - Git Cheat Sheet

ggit

gstgit status

glgit pull

gupgit pull --rebase

@rajshah4
rajshah4 / RNN_Simple_Addition_Public.ipynb
Last active March 4, 2018 01:43
RNN_Addition_1stgrade
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@sunsided
sunsided / caffe-lstm.py
Created November 18, 2016 09:18
Caffe LSTM trouble
# http://christopher5106.github.io/deep/learning/2016/06/07/recurrent-neural-net-with-Caffe.html
# https://github.com/BVLC/caffe/pull/3948
# https://github.com/junhyukoh/caffe-lstm/blob/master/examples/lstm_sequence/lstm_sequence.cpp
# https://github.com/BVLC/caffe/issues/4547
import caffe
import numpy as np
import matplotlib.pyplot as plt
@msievers
msievers / [Spring, JMH] Howto integrate JMH benchmarks with Spring.md
Last active October 11, 2024 09:39
[Spring, JMH] Howto integrate JMH benchmarks with Spring

Motivation

Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.

Idea

Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.

TL;DR;