Displaying 6 results from an estimated 6 matches for "rosettacode".
2011 Jan 27
1
performance question
I got sidetracked while benchmarking ruby factorial code:
http://rosettacode.org/wiki/Factorial#Ruby
I put all that code into test_fact.rb and ran with:
> ruby test_fact.rb
> rails runner test_fact.rb #from a fresh rails app
> rails runner test_fact.rb #from a mature rails app
here are the respective results:
user system total...
2024 Apr 13
1
Just for your (a|be)musement.
...y have appendix material showing three queries to ChatGPT
and the answers. Paraphrased, the queries are "if I throw 2 (3, 4)
fair dice, what is the probability I get 7 or 11? Show the reasoning."
I thought those questions would make a nice little example,
maybe something for Exercism or RosettaCode. Here's the R version:
> faces <- 1:6
> sum(rowSums(expand.grid(faces, faces)) %in% c(7,11))/6^2
[1] 0.2222222
> sum(rowSums(expand.grid(faces, faces, faces)) %in% c(7,11))/6^3
[1] 0.1944444
> sum(rowSums(expand.grid(faces, faces, faces, faces)) %in% c(7,11))/6^4
[1] 0.09567901...
2011 May 30
1
[LLVMdev] Reg2mem: Identifying introduced memory locations (also, what happens to the phi nodes)
Hi.
Im exploring `opt -reg2mem` output for a simple C program (actually,
that is this snippet:
http://rosettacode.org/wiki/Dining_philosophers#C - compiled with
clang -O1) and got two questions regarding this pass.
1. How would I tell which memory locations were introduced by the
pass, and which memory locations were present in the original program?
After a brief diffing of .ll files, I'd suppose that int...
2010 Aug 03
4
hi!!! guestion!!
I made some matlab codes...
Is there any method to perform matlab codes in R program??
--
View this message in context: http://r.789695.n4.nabble.com/hi-guestion-tp2311219p2311219.html
Sent from the R help mailing list archive at Nabble.com.
2013 Apr 09
2
[PATCH 1/2] add run_shell helper
The new run_shell helper is a copy of run_python,
and will be used by upcoming changes.
Signed-off-by: Olaf Hering <olaf at aepfle.de>
---
src/supermin_utils.ml | 9 +++++++++
src/supermin_utils.mli | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/src/supermin_utils.ml b/src/supermin_utils.ml
index f98e09a..cb8a27e 100644
--- a/src/supermin_utils.ml
+++ b/src/supermin_utils.ml
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...tmp_pkg_cache_dir
- (if verbose then "--verbose --verbose" else "--quiet")
- (match packager_config with None -> ""
- | Some filename -> sprintf "--config %s" filename)
- tmp_root
- repos_dir
- in
- run_shell sh names;
-
- (* http://rosettacode.org/wiki/Walk_a_directory/Recursively *)
- let walk_directory_tree dir pattern =
- let select str = Str.string_match (Str.regexp pattern) str 0 in
- let rec walk acc = function
- | [] -> (acc)
- | dir::tail ->
- let contents = Array.to_list (Sys.readdir dir) in
-...