Post your random thoughts/feelings etc

Ithior

Well-known member
Programming can be really useful. I wanted to print a pdf in A4 pages but I wanted to cut those pages in half in order to make an A5 book. So that meant I had to print 2 pages per A4 page, in the order 1, 3, 4, 2 (and so on, 5, 7, 8, 6, etc). I would have to write all the pages individually to get it to print like this. Fortunately, with R I can create a function that will return to me all these numbers easily, with commas between them as well.

I haven't written the function yet, but I know I can do it and that's what I'll be doing today and maybe tomorrow, depending on how long it takes me. This will be really useful because I have a lot of stuff to print which I want to print in this pattern, and this can save me a lot of time.
 

Ithior

Well-known member
Programming can be really useful. I wanted to print a pdf in A4 pages but I wanted to cut those pages in half in order to make an A5 book. So that meant I had to print 2 pages per A4 page, in the order 1, 3, 4, 2 (and so on, 5, 7, 8, 6, etc). I would have to write all the pages individually to get it to print like this. Fortunately, with R I can create a function that will return to me all these numbers easily, with commas between them as well.

I haven't written the function yet, but I know I can do it and that's what I'll be doing today and maybe tomorrow, depending on how long it takes me. This will be really useful because I have a lot of stuff to print which I want to print in this pattern, and this can save me a lot of time.

Already did the function. Ran into some trouble because I was making it more complicated than it had to be, but it was still pretty easy.

Edit: altered it even further so it can be used for different patterns, different start page and different last page.
You input something like this in the R console:
pages(first = 1, last = 10, pattern = c(1, 3, 4, 2))
And it returns:
"1, 3, 4, 2, 5, 7, 8, 6, 9, blank, blank, 10"
The "blank" is there to tell you you should put the number of a blank page there, otherwise it'll print pages you don't want. You can't simply omit these because then page 10 wouldn't be behind page 9. In fact, I'm going to add an option that allows you to keep the numbers instead of having the "blank" thing.
You can change the pattern to whatever you want, like c(1, 4, 5, 2, 3) for example.

Anyway, I don't think anyone here cares about this but I don't have anyone else to tell this to.
 
Last edited:
Already did the function. Ran into some trouble because I was making it more complicated than it had to be, but it was still pretty easy.

Edit: altered it even further so it can be used for different patterns, different start page and different last page.
You input something like this in the R console:
pages(first = 1, last = 10, pattern = c(1, 3, 4, 2))
And it returns:
"1, 3, 4, 2, 5, 7, 8, 6, 9, blank, blank, 10"
The "blank" is there to tell you you should put the number of a blank page there, otherwise it'll print pages you don't want. You can't simply omit these because then page 10 wouldn't be behind page 9. In fact, I'm going to add an option that allows you to keep the numbers instead of having the "blank" thing.
You can change the pattern to whatever you want, like c(1, 4, 5, 2, 3) for example.

Anyway, I don't think anyone here cares about this but I don't have anyone else to tell this to.

It's plenty interesting! I've done a fair bit of programming (being a computer science student and all), no R though. I haven't written much code this summer, so I might borrow this idea for a little exercise.

Also, why not take the blank page number as part of the command?
 

Ithior

Well-known member
It's plenty interesting! I've done a fair bit of programming (being a computer science student and all), no R though. I haven't written much code this summer, so I might borrow this idea for a little exercise.

Also, why not take the blank page number as part of the command?

Good idea, I'll add that!
 

Ithior

Well-known member
It's plenty interesting! I've done a fair bit of programming (being a computer science student and all), no R though. I haven't written much code this summer, so I might borrow this idea for a little exercise.

Also, R is not very hard to learn. You won't use it to write programs or apps (unless you use special packages that create the necessary HTML code). It's mainly used to analyse data, for statistical stuff and to create graphs.
 
Some believe Tony Abbott and his team Australia are zombies or reptiles.

here's proof!
anigif_enhanced-14771-1432167176-4.gif
 
^Totally agree with you there, hoddesdon!



I was watching an ant the other day as it carried a piece of food back to the nest. The food was like 10 times bigger than the ant and the ant was really struggling. And I thought to myself, that is just like the average human except the ant doesn't have to pay taxes, get lured into debt, or spend years being educated so that it can prove that it is worthy of carrying food back to the nest.

Of course an ant's life is much more dangerous and fleeting than a human life but I'm sure that the ant has no concept of that, so...
^ My thoughts when I see wild animals are like yours.

I frequently watch birds fly around in the large trees in my backyard.

They are so god damn FREE!
They can go wherever they want, do whatever they want, whenever they want.
I look at them with such ferocious burning envy.
 
Top