This file contains hidden or 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
Ref: http://www.nesterovsky-bros.com/weblog/2008/12/04/ASimpleCacheForJavaApplication.aspx | |
Although in last our projects we're using more Java and XSLT, we always compare Java and .NET features. It's not a secret that in most applications we may find cache solutions used to improve performance. Unlike .NET providing a robust cache solution Java doesn't provide anything standard. Of course Java's adept may find a lot of caching frameworks or just to say: "use HashMap (ArrayList etc.) instead", but this is not the same. | |
Think about options for Java: | |
1. Caching frameworks (caching systems). Yes, they do their work. Do it perfectly. Some of them are brought to the state of the art, but there are drawbacks. The crucial one is that for simple data caching one should use a whole framework. This option requires too many efforts to solve a simple problem. | |
2. Collection classes (HashMap, ArrayList etc.) for caching data. This is very straightforward solution, and very productive. Everyone knows these classes, nothin |
This file contains hidden or 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
Problem: Seems like npm (now?) installs node modules to /usr/local/lib/node_modules/ and not /usr/local/lib/node/ | |
Solution: sudo ln -s /usr/local/lib/node_modules/ /usr/local/lib/node | |
OR: | |
Check NODE_PATH: npm root -g | |
You can add the following to ~/.bash_profile: | |
export NODE_PATH=/usr/lib/node_modules:$NODE_PATH |
This file contains hidden or 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
Easy WordPress Parallax Slider | |
http://wordpress.org/plugins/easy-wp-parallax-slider/ | |
http://demo.oscitasthemes.com/demos/easy-wordpress-parallax-slider/ | |
http://www.velvetinkmedia.com/wp-content/themes/vim/sliders/ | |
http://www.velvetinkmedia.com/wp-content/themes/vim/sliders/parallax/documentation/documentation.html |
This file contains hidden or 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 | |
if [ $# -eq 0 ]; then | |
echo "You have to specify a module index" | |
exit 128 | |
fi | |
pactl unload-module $1 |
This file contains hidden or 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
try to use the -r flag (read-only) | |
# mount -r -o loop file.img /mnt | |
if that doesn't work try: | |
# unsquashfs |
This file contains hidden or 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
mvn dependency:copy-dependencies -DoutputDirectory=path/to/lib/folder |
This file contains hidden or 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
sudo yum update | |
sudo yum groupinstall "Development Tools" | |
sudo yum install kernel-devel kernel-headers |
This file contains hidden or 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
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav | |
# To convert all mp3 files in a directory in Linux: | |
for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done | |
# Or Windows: | |
for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav |
This file contains hidden or 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
# 1. Output to Console | |
# All logging will be redirected to your console. | |
# Specific properties: PropertyConfigurator.configure("/log4j.properties"); | |
# Root logger option | |
log4j.rootLogger=INFO, stdout | |
# Direct log messages to stdout | |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.Target=System.out |
This file contains hidden or 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/sh | |
mkdir -p alaw | |
mkdir -p ulaw | |
mkdir -p gsm | |
mkdir -p wav | |
mkdir -p sln16 | |
mkdir -p g722 | |