factor

Good resources to learn the Factor programming language?

What are some good resources to learn the Factor programming language? I understand that Factor is based on Forth, so I guess resources on Forth would be nice too. ...

Good resources for learning Factor

Having recently come across this introduction to Factor, I've been a bit curious to learn more. Aside from the official FAQ mentioned there, do you have resources for learning the language (as well as the stack-based "paradigm," if that's the right word) that you've found helpful? As a side note, would learning Forth help, or is that li...

Do you plan on using the Factor programming language?

Do you plan on using Factor? Have you looked at it? Checked it out. Do you understand stack oriented programming? http://www.youtube.com/watch?v=f_0QlhYlS8g ...

Which factor GUI tutorial/example app?

Is there a non-trivial example application written in Factor language, pregerrably for GUI application which could server as a language tutorial? ...

Building a web application with Factor

Has anybody built a web application with Factor? What were some of the stumbling blocks or problems that you encountered during the process? ...

Efficient storage of prime numbers

For a library, I need to store the first primes numbers up to a limit L. This collection must have a O(1) lookup time (to check whether a number is prime or not) and it must be easy, given a number, to find the next prime number (assuming it is smaller than L). Given that L is fixed, an Eratostene sieve to generate the list is fine. Rig...

How to do median splits within factor levels in R?

Here I make a new column to indicate whether myData is above or below its median ### MedianSplits based on Whole Data #create some test data myDataFrame=data.frame(myData=runif(15),myFactor=rep(c("A","B","C"),5)) #create column showing median split myBreaks= quantile(myDataFrame$myData,c(0,.5,1)) myDataFrame$MedianSplitWholeData = cut...

Renaming large IDs in R

Suppose I have a data.frame with N rows. The id column has 10 unique values; all those values are integers greater than 1e7. I would like to rename them to be numbered 1 through 10 and save these new IDs as a column in my data.frame. Additionally, I would like to easily determine 1) id given id.new and 2) id.new given id. For example...

Real world usage of concatenative programming langauges

What are some real-world projects done in concatenative languages like Forth, Factor, Joy, etc.? ...

Fudge Factor in Matlab

Hello, Can anyone enlighten me about the use of fudgeFactor in Matlab? Thanks. ...

how to determine "weight" of each factor that could improve website's performance?

is anyone know how to determine the "weight" of each factor affecting the performance improvement? actually i'm on the way in bulding some kinda simply tool look a like yslow to analyze website performance. But i have problem in determining the score of each factor. I use these factor to be analyzed : - make fewer http req - minify js an...

Factor Analysis in python

Hi is there a module that contains a function that calculate Factor Analysis (not PCA) in python? ...

Recode/relevel data.frame factors with different levels

Each time when I have to recode some set of variables, I have SPSS recode function in mind. I must admit that it's quite straightforward. There's a similar recode function in car package, and it does the trick, but let's presuppose that I want to get things done with factor. I have data.frame with several variables with value range from...

How (and why) do you use contrasts (in R) ?

I am sorry for asking such a basic question, but I can't seem to put my head around this or find a satisfying answer. I checked ?contrasts and ?C - both lead to "Chapter 2 of Statistical Models in S", which is not readily available to me. Under what cases do you create contrasts (in R) in your analysis? How is it done and what is it us...

Reorder levels of a data frame without changing order of values

Hello, I have data frame with some numerical values and factors for groups, treatment etc. The order of levels for those factors is not the way I want them to be. numbers = 1:4 letters = factor(c("a", "b", "c", "d")) df <- data.frame(numbers, letters) numbers letters 1 1 a 2 2 b 3 3 c 4 4 ...

Why is as.factor returns a character when used inside apply ?

I tried doing this: a <- data.frame(x1 = rnorm(100), x2 = sample(c("a","b"), 100, replace = T), x3 = factor(c(rep("a",50) , rep("b",50)))) apply(a2, 2,class) # why is column 3 not a factor ? a a2 <- apply(a, 2,as.factor) apply(a2, 2,class) # why are all columns not factors ? But don't understand why it doesn't have factors... Thank...

fastest calculation of largest prime factor of 512 bit number in python

dear all, i am simulating my crypto scheme in python, i am a new user to it. p = 512 bit number and i need to calculate largest prime factor for it, i am looking for two things: Fastest code to process this large prime factorization Code that can take 512 bit of number as input and can handle it. I have seen different implementatio...

stats::reorder vs Hmisc::reorder

I am trying to get around the strange overlap of stats::reorder vs Hmisc::reorder. Without Hmisc loaded I get the result I want, i.e. an unordered factor: > with(InsectSprays, reorder(spray, count, median)) [1] A A A A A A A A A A A A B B B B B B B B B B B B C C C C C C C C C C C C D D [39] D D D D D D D D D D E E E E E E E E E E E E ...

Factors in R: more than an annoyance?

One of the basic data types in R is factors. In my experience factors are basically a pain in the ass and I never use them. I always convert to characters. I feel oddly like I'm missing something. Are there a lot of functions that use factors as grouping variables? When should I be using factors? Do you use them? ...

Fiddling with point-free code?

I have been learning the Factor and J languages to experiment with point-free programming. The basic mechanics of the languages seem clear, but getting a feeling for how to approach algorithm design is a challenge. A particular source of confusion for me is how one should structure code so that it is easy to experiment with different pa...