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
| testredis06/1$ redis-cli flushall | |
| OK | |
| testredis06/1$ redis-load clients 100 requests 10000000 datasize 32 keyspace 10000000 set 100 | |
| testredis06/0$ redis-cli info | grep -E "(db0:keys|used_memory_human|mem_fragmentation_ratio)" | |
| used_memory_human:836.31M | |
| mem_fragmentation_ratio:1.02 | |
| db0:keys=6321117,expires=0 |
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
| package spark.bagel.examples | |
| import spark._ | |
| import spark.SparkContext._ | |
| import scala.math.min | |
| import spark.bagel._ | |
| import spark.bagel.Bagel._ |
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> | |
| int main() | |
| { | |
| char curr, next, ans; | |
| unsigned int cnt; | |
| for (curr = getchar();;curr = next) { | |
| if ((next = getchar()) == EOF || next == '\n') break; | |
| if (next == curr) { | |
| if (cnt == 0) ans = next; |
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
| datatype 'a ternarylikeop = TrueExpression of 'a | FalseExpression | |
| fun op ? (true, y) = TrueExpression y | |
| | op ? (_, y) = FalseExpression | |
| infix 6 ?; | |
| fun op :- (TrueExpression x, _) = x | |
| | op :- (FalseExpression, y) = y | |
| infix 6 :-; |
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
| $ sml | |
| Standard ML of New Jersey v110.72 [built: Sun May 22 00:51:36 2011] | |
| - fun op -: (x,y,z) = x + y * z; | |
| val -: = fn : int * int * int -> int | |
| - infix 6 -:; | |
| - 3 -: 2; | |
| stdIn:5.1-5.7 Error: operator and operand don't agree [tycon mismatch] | |
| operator domain: int * int * int | |
| operand: int * int | |
| in expression: |
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
| #!/usr/bin/perl -w | |
| use strict; | |
| use warnings; | |
| use IPC::Shareable; | |
| my $glue = 'access_counter'; | |
| my %options = ( | |
| create => 'yes', | |
| exclusive => 0, | |
| mode => 0644, | |
| destroy => 0, |
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
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| # using ruby 1.9.2p180 | |
| # Author: Kohei Ozaki (@smly) | |
| # demo of DGIM method | |
| # ref: | |
| # Mayur Datar, Aristides Gionis, Piotr Indyk, and Rajeev Motwani | |
| # "Maintaining stream statistics over sliding windows", |
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
| >>> x= np.matrix([[2,3],[4,5],[5,6],[6,7]]).T | |
| >>> x | |
| matrix([[2, 4, 5, 6], | |
| [3, 5, 6, 7]]) | |
| >>> u,s,vh = np.linalg.svd(x) | |
| >>> u | |
| matrix([[-0.63626513, -0.77147047], | |
| [-0.77147047, 0.63626513]]) | |
| >>> s | |
| array([ 14.13594166, 0.41851331]) |
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 <iostream> | |
| #include <fstream> | |
| #include <vector> | |
| #include <sstream> | |
| #include <gtest/gtest.h> | |
| #include "lp.hpp" | |
| #include "testing/utils.hpp" | |
| namespace gmll { |
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 | |
| # Usage: lp.sh -w W.txt -l L.txt -p result.csv | |
| # * requirement | |
| # http://pages.cs.wisc.edu/~jerryzhu/pub/harmonic_function.m | |
| # and matlab. | |
| MATLAB=matlab | |
| HELP="$0 -w <weight_matrix> -l <label_matrix> -p <predict_matrix>" |