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
| -module(helpers). | |
| is_pid_alive(Pid) when node(Pid) =:= node() -> | |
| is_process_alive(Pid); | |
| is_pid_alive(Pid) -> | |
| lists:member(node(Pid), nodes()) andalso | |
| (rpc:call(node(Pid), erlang, is_process_alive, [Pid]) =:= true). | |
| get_current_time() -> | |
| Now = calendar:local_time(), |
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
| var redisScan = require('redisscan'); | |
| var redis = require('redis'); | |
| var riak = require('riakpbc'); | |
| var async = require('async'); | |
| var args = require('optimist') | |
| .usage('--import or --export Redis archives in Riak\nUsage: $0') | |
| .boolean('import') | |
| .boolean('export') | |
| .boolean('debug') | |
| .describe('import', "Import from Riak to Redis") |
- Note: always set
umask 022for system-shared libraries - See http://blog.equanimity.nl/blog/2014/02/09/erlang-r17-rc1-on-osx-with-wx-and-a-working-observer/ for the details
- wxWidgets 3.0.0 works the same in R16B03-1 and 17.0-rc2
- Note well:
wx:demo()on OS X 10.9.2 with wxWidgets 3.0.0 is still unstable, thoughobserver:start()is more stable. - If you really don't have time, try Erlang Solutions' 32bit (not 64bit) distribution at https://www.erlang-solutions.com/downloads/download-erlang-otp to use it as a debugging console.
- Update 28-FEB-2014 0230UTC: Leo Liu reports
brew install wxmac --disable-monolithicwill do. See http://erlang.org/pipermail/erlang-questions/2014-February/077952.html.
This is a purely in-browser demo of Riak 2.0's sets datatype. The application code uses React.js and jquery.
To get started, make a 5-node devrel cluster of the 2.0 preview using these instructions. After your cluster is built, make a bucket-type for sets:
cd dev/dev1
bin/riak-admin bucket-type create sets '{"props":{"datatype":"set","allow_mult":true}}'
bin/riak-admin bucket-type activate sets
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
| image.gallery <- function(url, ncol = 3L) { | |
| ## This function reformats the contents of a Craigslist search result URL | |
| ## into an image gallery, opened into the default browser | |
| ## | |
| ## Inputs: | |
| ## - url: a Craigslist search URL as created by search.url | |
| ## - ncol: the number of columns for the output image gallery | |
| ## | |
| ## Output: none. As a side effect, a browser is opened. |
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
| erlang$1:::*-function-entry | |
| { | |
| self->funcall_entry_ts[copyinstr(arg1)] = vtimestamp; | |
| } | |
| erlang$1:::function-return | |
| /self->funcall_entry_ts[copyinstr(arg1)]/ | |
| { | |
| @time[copyinstr(arg1)] = quantize((vtimestamp - self->funcall_entry_ts[copyinstr(arg1)] ) / 1000); | |
| } |
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
| deb http://binaries.erlang-solutions.com/debian precise contrib | |
| wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install esl-erlang |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
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
| import urllib2 | |
| import re | |
| from BeautifulSoup import * | |
| from datetime import * | |
| symbols = ['YHOO', 'MU', 'AA', 'CI', 'EOG', 'ZMH', 'G', 'HON', 'IWM', 'WYE', 'JCP', 'OXY', 'AAPL', 'SBUX', 'MO', 'KLAC', 'SIRI', 'GDT', 'WMT', 'LLTC', 'PALM', 'EA', 'SUN', 'CL', 'JAVA', 'SMH', 'NBR', 'JNJ', 'GCI', 'SHLD', 'AMD', 'ORCL', 'ERIC', 'LEH', 'WLP', 'CAH', 'LXK', 'CAR', 'CVX', 'GE', 'DE', 'NTAP', 'BSC', 'VRSN', 'DNA', 'GENZ', 'ASKJ', 'BRCM', 'TGT', 'MCD', 'CMCS', 'KBH', 'SYMC', 'BAC', 'NCC', 'BSX', 'IR', 'UNH', 'F', 'ADBE', 'MDY', 'CCL', 'TASR', 'SCHW', 'GS', 'T', 'ADI', 'MON', 'HOG', 'DIA', 'SEPR', 'BTU', 'X', 'D', 'GILD', 'NEM', 'BUD', 'MET', 'CMX', 'AVP', 'MDT', 'QCOM', 'XLNX', 'XOM', 'AMGN', 'OSTK', 'AXP', 'AET', 'GLW', 'KMG', 'GM', 'MXIM', 'APOL', 'SGP', 'IBM', 'MS', 'SNDK', 'BA', 'KO', 'MER', 'RTH', 'M', 'FDC', 'PD', 'XLE', 'XLF', 'FLEX', 'KRB', 'UTX', 'TZOO', 'FDX', 'NKE', 'NXTL', 'DOW', 'HES', 'KSS', 'BP', 'BIIB', 'BBBY', 'SII', 'DELL', 'AIG', 'HIG', 'BBY', 'EBAY', 'RD', 'GPS', 'MERQE', 'PEP', 'IGT', 'CECO', 'ALL', ' |