myApp.factory('Excel',function($window){
var uri='data:application/vnd.ms-excel;base64,',
template='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));},
format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})};
return {
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
// just wrap 'filesizejs.com' as filter. | |
module | |
.filter('FileSize', function () { | |
return function (arg, descriptor) { | |
var si = { | |
bits : ["B", "kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], | |
bytes : ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | |
}; | |
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
# RESUME | |
## Personal Information | |
---- | |
Name: Mavlarn. Tuohuti (买乌拉江) | |
Birthday: 1980 | |
Gender: male | |
Phone: 13810957617 | |
Email: mavlarn@163.com mavlarn@gmail.com | |
Nation: China |
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
;; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
;; An Introduction to ClojureScript for Light Table users | |
;; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
;; Basics | |
;; ============================================================================ | |
;; To begin open the command pane (type Control-SPACE), Add Connection, select | |
;; Light Table UI. Once connected you can evaluate all the forms in this file |
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
;; LOAD ME WITH | |
;; (load-file "/home/john/hobby-code/require-all-snippet.clj") | |
;; This file conditions a repl in various ways that I do all the time. | |
;; Firstly we want to 'require' all the namespaces on the classpath | |
;; This ensures that find-doc and the like will work | |
(require 'clojure.contrib.find-namespaces) | |
;; Some namespaces may fail to load, so catch any exceptions thrown |
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
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.util.jar.JarEntry; | |
import java.util.jar.JarOutputStream; | |
import java.util.jar.Manifest; | |
public class CreateJarFile { | |
public static int BUFFER_SIZE = 10240; | |
protected void createJarArchive(File archiveFile, File[] tobeJared) { |
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
# Git tutorial # | |
This tutorial will show you some basic usgae of git, including how to create a git repository, commit, push to local and remote repository. And also show you how to use with more than one remote repository, | |
## Working in local repository ## | |
------- | |
At first, we will create a git repository in our local and working on that. We will create a project with git and add/modify some files. | |
At first, create a repository: | |
```bash |
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
/** | |
* Workable C client code for zookeeper ensemble under zoopiter management. | |
* Include async and sync mode, for async mode, should use some synchronization method like 'lock'. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <zookeeper/zookeeper.h> |
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 my.test; | |
import java.io.File; | |
import java.io.IOException; | |
import java.lang.management.GarbageCollectorMXBean; | |
import java.lang.management.ManagementFactory; | |
import java.lang.management.MemoryMXBean; | |
import java.lang.management.MemoryPoolMXBean; | |
import java.lang.management.MemoryUsage; | |
import java.util.HashSet; |
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
# -*- coding:utf-8 -*- | |
from io.socket import IOCallback | |
from java.util.concurrent.locks import ReentrantLock | |
from io.socket import SocketIO | |
# it use socket.io java client of: https://github.com/Gottox/socket.io-java-client | |
class BlockingSocketIO(IOCallback): | |
respMsg = ""; |
NewerOlder