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
#include <opencv2/opencv.hpp> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
using namespace cv; | |
// Code from: http://www.adp-gmbh.ch/cpp/common/base64.html | |
static const std::string base64_chars = |
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
#include <stdio.h> | |
#include <iostream> | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include "opencv2/highgui/highgui.hpp" | |
#include "opencv2/flann/miniflann.hpp" | |
#include <tesseract/baseapi.h> | |
using namespace cv; | |
using namespace std; |
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
# run instructions : python rename_all.py folder_path start_file_prefix | |
# ex: python rename_all.py /home/xxx/Pictures/my_collection "Garden-" | |
# output will be "Garden-1.png, Garden-2.png" etc.. | |
import sys | |
import os | |
# input arguments folder_path & rename prefix | |
args = sys.argv | |
# folder path which files are contains |
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
# run instructions : python find.py / -m "2015-12-07 21:25:29" 30 | |
import sys | |
import os | |
from datetime import datetime, timedelta | |
TIMESTAMP_FORMAT = "%Y-%m-%d %H:%M:%S"; | |
# file mod info infomation hashmap | |
rwx_hash = {1:"--x", 2:"-w-", 4:"r--", 3:"-wx", 5:"r-x", 6:"rw-", 7:"rwx"} |
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
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); | |
//CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(new URI("sampleCacheManager")); | |
String cacheName = "cacheXXX"; | |
cache = cacheManager.createCache(cacheName, new MutableConfiguration<K, V>() | |
.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, cacheTimeout))) | |
.setExpiryPolicyFactory(ModifiedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, cacheTimeout))) | |
.setStoreByValue(false)); | |
int value = 9876; | |
cache.put(key, value); | |
assertEquals(cache.get(key).intValue(), value); |
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
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); | |
//CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(new URI("sampleCacheManager")); | |
Cache<String, Integer> cache = cacheManager.getCache("sampleCache"); | |
String key = "1"; | |
int value1 = 9876; | |
cache.put(key, value1); | |
int value = cache.get(key).intValue(); |
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
CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("test"); | |
String cacheName = "cacheXXX"; | |
cache = cacheManager.<String,Integer>createCacheBuilder(cacheName).setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, 10)). | |
setStoreByValue(false).build(); | |
int value = 9876; | |
cache.put(key, value); | |
assertEquals(cache.get(key).intValue(), value); |
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
CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("sampleCacheManager"); | |
Cache<String, Integer> cache = cacheManager.getCache("sampleCache"); | |
String key = "1"; | |
int value1 = 9876; | |
cache.put(key, value1); | |
int value = cache.get(key).intValue(); |
NewerOlder