I have a little problem to understand do in lisp
I have this code :
(defun iota-b (n)
(do ((x 0 (+1 x))
(u '() (cons x u)))
((> x n) (nreverse u))))
(iota-b 5)
(0 1 2 3 4 5)
In documentation there is the "do" basic template is:
(do…
This is my code:
libname Project 'XXX'; run;
%let dname = q1males;
%let Gender = 'Male';
%let samp = q1msamp;
%let stats = Malestats;
data project.data1; set project.data;
id = _n_;
run;
data project.&dname; set project.data1;
if Gender =…
I have two questions regarding Do Loops in SAS.
Say that I have three datasets:
(1) one dataset, called last with one observation called last_observation:
last_observation
150
(2) a second dataset with two columns of observations:
Time ID
34200…
I would like to create a list of IDs (bee_created) that combine a treatment group (i), replicate (j) and serial number (k). I have 9 replicates to work on, each with slight variations in serial numbers in the treatment groups. So it would a lot more…
The code doesn't exit after I type "stop" - for some reason. Why?
Step-by-step debugging shows that after I enter "stop" it's value consists of exactly 's','t','o','p' without any line breaks, etc. - however, the code still goesn't exit. Could…
I am trying to create a mimic autocomplete, as the one jQuery provides is overloaded, and I don't want to use it that much.
var easyBB = {
spellCheck: function(boolean,options) {
if(boolean === true){
$('textarea').on('keyup',function() {
…
Hello: I have a lot of files called test-MR3000-1.txt to test-MR4000-1.nt, where the number in the name changes by 100 (i.e. I have 11 files),
$ ls test-MR*
test-MR3000-1.nt test-MR3300-1.nt test-MR3600-1.nt test-MR3900-1.nt
test-MR3100-1.nt …
I am trying to read an XML file and store the structure into an array of objects. Here is my code:
class Bike
attr_accessor :id, :color, :name
def initialize(id, color, name)
@id = id
@color = color
@name = name
…
I want to get blog01.xml from data01.xml, blog02.xml from data02.xml and so on. I'm trying with the following code, but it doesn't work. What is wrong?
I'm working on a data set (DATA) which has 3 variables (Var1, Var2, Var3) in a format I need to change.
The variables are in a special date format (for example purposes, say OLDFMT1) and I need to change them into regular SAS date format using the…
Here is the macro I'm running....
%macro ControlLoop(ds);
%global dset nvars nobs;
%let dset=&ds;
/* Open data set passed as the macro parameter */
%let dsid = %sysfunc(open(&dset));
/* If the…
Bad news Everyone,
I recently started to learn FORTRAN to understand a code and translate it to C++ (I
know what the code does is not important for this question, but to give some background,
this code solves boundary value problems using…
I have this loop which looks like the following in openmp but I am getting allocation errors:
!$OMP PARALLEL DO PRIVATE(fn)
do fn=0, NFILES
allocate(temparray(1:3,1:Ntot))
LOAD temparray FROM FILE(fn)
Ntot = len(temparray)
…
I need to call a function in a loop.
I have the following code....
do {
var name = prompt("Enter name:");
if (!isNaN(age) && name != null && name != "") {
names[i] = name;
}
loop = confirm("Add new name?");
i++;
//…
Im trying to add numbers together inside a list box. First of all i put the numbers inside the listbox into an array and integers.
I now want to sum all the numbers together inside the list_box to give me a total.
The way i was going to approach…