Side note: all available resource metrics are documented here:
These are used for isolating files on disk from both the host system as well as other running tasks.
Side note: all available resource metrics are documented here:
These are used for isolating files on disk from both the host system as well as other running tasks.
| # Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 | |
| # Run instrumented program, generate and write pgo data | |
| ./runIt | |
| # Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 |
| ... | |
| NiftySecurityHandlers niftySecurityHandlers = new NiftySecurityHandlers() { | |
| @Override | |
| public ChannelHandler getAuthenticationHandler() { | |
| return noOpHandler; | |
| } | |
| @Override | |
| public ChannelHandler getEncryptionHandler() { |
| /** | |
| * To get started: | |
| * git clone https://github.com/twitter/algebird | |
| * cd algebird | |
| * ./sbt algebird-core/console | |
| */ | |
| /** | |
| * Let's get some data. Here is Alice in Wonderland, line by line | |
| */ |
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
| package com.yieldmo.rtb.util | |
| class LazyMap[A,B](delegate: Map[A,() => B]) extends scala.collection.immutable.Map[A,B]{ | |
| def get(key: A): Option[B] = delegate.get(key).map{ _() } | |
| def iterator: Iterator[(A,B)] = delegate.iterator.map{ pair => (pair._1, pair._2()) } | |
| def +[B1 >:B](kv: (A, B1)): Map[A, B1] = new LazyMap[A,B1](delegate + (kv._1 -> (() => kv._2))) | |
| def -(key: A): Map[A, B] = new LazyMap[A,B](delegate - key) | |
| } |
| var lambda = function (str) { | |
| var res = str.match(/^\s*([a-z]+(?:\s+[a-z]+)*)\s*\->\s*(.+?)\s*$/); | |
| if (!res) { | |
| throw new Error('Invalid lambda expression'); | |
| } | |
| var args = res[1].replace(/\s{2,}/g, ' ').split(' ') | |
| , body = 'return ' + res[2] + ';'; | |
| //! A simplistic echo server that allows client to exit using the quit command. | |
| #![crate_id = "echo:0.1pre"] | |
| #![feature(phase)] | |
| #[phase(plugin, link)] extern crate log; | |
| use std::io::{Listener, Acceptor, BufferedStream}; | |
| use std::io::net::tcp::TcpListener; |
| ;; Prevent the cursor from blinking | |
| (blink-cursor-mode 0) | |
| ;; Don't use messages that you don't read | |
| (setq initial-scratch-message "") | |
| (setq inhibit-startup-message t) | |
| ;; Don't let Emacs hurt your ears | |
| (setq visible-bell t) | |
| ;; You need to set `inhibit-startup-echo-area-message' from the | |
| ;; customization interface: |
| class PartialFunctionBuilder[A, B] { | |
| import scala.collection.immutable.Vector | |
| // Abbreviate to make code fit | |
| type PF = PartialFunction[A, B] | |
| private var pfsOption: Option[Vector[PF]] = Some(Vector.empty) | |
| private def mapPfs[C](f: Vector[PF] ⇒ (Option[Vector[PF]], C)): C = { | |
| pfsOption.fold(throw new IllegalStateException("Already built"))(f) match { |