On 2009-06-16 10:27:00, Allan Engelhardt wrote in CYBAEA Data and Analysis:
I like the "multicore" library for a particular task. I can easily write a combination of if(require("multicore",...)) that means that my function will automatically use the parallel mclapply() instead of lapply() where it is available. Which is grand 99% of the time, except when my function is called from mclapply() (or one of the lower level functions) in which case much CPU trashing and grinding of teeth will result.
So, I needed a function to determine if my function was called from any function in the "multicore" library. Here it is.
First define a generally useful function:
is.in.namespace <-
function (ns) {
for ( frame in seq(1, sys.nframe(), 1) ) {
fun <- sys.function(frame);
env <- environment(fun)
n <- environmentName(env)
if ( n == ns ) return(TRUE);
}
return(FALSE);
}
Then we use it for our purpose:
is.in.multicore <- function (...) { return(is.in.namespace("multicore")) }
library("multicore")
stopifnot( mclapply(as.list(1), is.in.multicore)[[1]] == TRUE )
stopifnot( lapply(as.list(1), is.in.multicore)[[1]] == FALSE )
stopifnot( local( {mclapply <- function(x) return(x); mclapply(is.in.multicore())} ) == FALSE )
Easy when you know how.
On 2009-08-17 09:18:00, Allan Engelhardt wrote in CYBAEA Journal:
We knew the potential existed already, of course. Mobile devices in the USA generates some 600 billion transactions per day, each tagged with the location and time. Jeff Jonas: Every call, text message, email and data transfer handled by your mobile device creates a transaction with your space-time coordinate[...].
The mobile operators have this data, of course. We all know this (especially here where we have been using some of it for social network analysis). No real surprises here, except perhaps in the volumes.
But did you know that the operators are sharing your data? What is new, at least to me, is that this data is being provided to third parties that are leveraging specially designed analytics to make sense of our space-time-travel data.
Read more (~449 words, 1 comments).
On 2009-07-27 19:38:00, Allan Engelhardt wrote in CYBAEA Data and Analysis:
O'Reilly's recent publication Beautiful Data has a chapter by Jeff Jonas which is enough reason in itself for me to recommend it. The chapter, Data Finds Data, is also available as a PDF download.
Read more (~66 words).
On 2009-07-22 13:37:00, Allan Engelhardt wrote in CYBAEA Data and Analysis:
This is by far the best description of why traditional parallel databases (like Teradata, Greenplum et al.) is a evolutionary dead end. But much more than a theoretical discussion, they have built a solution which they call HadoopDB. It is based on Hadoop, PostgreSQL, and Hive and is completely Open Source. Alternative, column-based, backends to PostgreSQL are being implemented now. Read: Announcing release of HadoopDB.
Read more (~83 words).
On 2009-07-22 06:59:00, Allan Engelhardt wrote in CYBAEA Journal:
The nice people at Velocity has released The B2B Content Marketing Workbook. It is behind a registration wall which means we wouldn’t normally recommend it but you can just type junk in the fields if you are not comfortable with giving your personal details to a marketing agency. (Think about it....) If you are relatively new in the B2B world, say having joined a professional services or consulting organization, you may find this one useful.
Read more (~263 words).
On 2009-07-10 21:25:00, Allan Engelhardt wrote in CYBAEA Journal:
A story from antiquity involving a king of Rome and a Greek Sibyl has lovely marketing lessons for today.
Sometime around 576 BC the Cumaean Sibyl arrives in Rome and offer nine books of her prophesies to King Tarquin, the legendary (in both senses of the word) last king of Rome (they had emperors after that).
The king laughs at the enormous sum she is asking for the books and sends her packing. She then burns three of the books and goes back to the king offering the six books at the same high price as the original nine. He rejects her again.
Then she burns three more of the books and offer the last three to the king at the same price.
This time he buys them.
Read more (~269 words).
Join the discussion
There are no comments yet. Be the first to comment.