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
val (unseenItems, changedItems, unchangedItems, status) = items.getData.grouped(3).map(_.toList). | |
foldLeft[(List[MediaFeedData], List[MediaFeedData], List[MediaFeedData], Map[String, Long])]((Nil, Nil, Nil, Map.empty))({ | |
case ((unseenSoFar, changedSoFar, unchangedSoFar, statusMap), unseen :: changed :: unchanged :: Nil) => { | |
( | |
unseen :: unseenSoFar, | |
changed :: changedSoFar, | |
unchanged :: unchangedSoFar, | |
statusMap ++ Map(unseen.getId -> 0L, | |
changed.getId -> (changed.getComments.getCount.toLong - 1L), | |
unchanged.getId -> unchanged.getComments.getCount.toLong)) |
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
[error] /Users/duane/pinsights/pinsights-utils/src/main/scala/com/getpinsights/utils/WorkerAuditor.scala:70: unsupported pattern: (_: Exception) (a class scala.reflect.internal.Trees$Typed). | |
[error] This is a scalac bug. Tree diagnostics: (_: Exception){<null>}. | |
[error] case e: Exception => { | |
[error] ^ | |
while compiling: /Users/duane/pinsights/pinsights-utils/src/main/scala/com/getpinsights/utils/WorkerAuditor.scala | |
during phase: patmat | |
library version: version 2.10.4 | |
compiler version: version 2.10.4 | |
reconstructed args: -classpath /Users/duane/pinsights/pinsights-utils/target/classes:/Users/duane/.m2/repository/com/typesafe/akka/akka-actor/2.0.5/akka-actor-2.0.5.jar:/Users/duane/.m2/repository/com/typesafe/config/0.3.1/config-0.3.1.jar:/Users/duane/.m2/repository/org/apache/curator/curator-recipes/2.2.0-incubating/curator-recipes-2.2.0-incubating.jar:/Users/duane/.m2/repository/org/apache/curator/curator-framework/2.2.0-incubating/curator-framework-2.2.0-i |
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
def run() { | |
Thread.sleep(60000) | |
while (true) { | |
val start = System.currentTimeMillis() | |
val next = start + 60000 | |
val numJobsToReport = numJobs | |
if (numJobsToReport != 0) { | |
val totalJobTimeToReport = totalJobTime |
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
//===- llvm/ADT/SmallVector.h - 'Normally small' vectors --------*- C++ -*-===// | |
// | |
// The LLVM Compiler Infrastructure | |
// | |
// This file is distributed under the University of Illinois Open Source | |
// License. See LICENSE.TXT for details. | |
// | |
//===----------------------------------------------------------------------===// | |
// | |
// This file defines the SmallVector class. |
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
module Main where | |
import Graphics.Sketch | |
import Data.Array.Repa | |
import Data.Word | |
import Control.Monad | |
import System.Random | |
randomWord8 :: IO Word8 |
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
use std; | |
fn poke(value: uint, index: uint, data: @mutable [mutable uint]) { | |
(*data)[index] = value; | |
} | |
fn main(_args: [str]) { | |
let vec = [mutable 4u]; | |
std::io::println(#fmt["%u", vec[0]]); | |
poke(3u, 0u, @mutable vec); |
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
#[link_name = ""] | |
#[link_args = "BAD LINKING"] | |
native mod c { | |
fn random() -> int; | |
} |
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
fn merge_sort<copy a>(&&d: [mutable a]) { | |
fn merge<copy a>(&&data: [mutable a], &&temp: [mutable a], low: uint, middle: uint, high: uint) { | |
let resultI = low; | |
let tempI = low; | |
let destI = middle; | |
while tempI < middle && destI <= high { | |
if data[destI] < temp[tempI] { | |
data[resultI] = data[destI]; | |
resultI += 1u; | |
destI += 1u; |
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
#[cfg(target_os = "macos")] | |
native mod c { | |
fn mach_absolute_time() -> u64; | |
} | |
#[cfg(target_os = "macos")] | |
#[link_name=""] | |
#[link_args = "-framework CoreServices"] | |
native mod CoreServices { |
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
> {-# LANGUAGE OverloadedStrings #-} | |
This is the main driver of the program. | |
> module Main where | |
We need System.Environment for access command line arguments: | |
> import System.Environment (getArgs) |
OlderNewer