|
I am reading "On lisp" and encounter this code (I simplified a bit).
CL-USER> (defun foo () '(a b c)) FOO CL-USER> (foo) (A B C) CL-USER> (nconc * '(D E)) (A B C D E) CL-USER> (foo) (A B C D E) CL-USER> (defun foo () (list 'a 'b 'c)) STYLE...
Started by Thura on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
"*" must refer.
Which explains why (foo) evaluates to (A B C D E) the second time it's used....
|
|
In Ruby, I'd like to convert a slash-separate String such as "foo/bar/baz" into ["foo/bar/baz", "foo/bar", "foo"]. I already have solutions a few lines long; I'm looking for an elegant one-liner. It also needs to work for arbitrary numbers of segments...
Started by Yehuda Katz on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The highest voted answer works, but here is a slightly shorter way to do it that I think will be more readable for those not familiar with all the features used there:
a=[]; s.scan(/\/|$/){a << $`}
The result is stored in a :
> s = 'abc/def/ghi... .
|
|
I have a computer at home with ip 192.168. 221 .xxx I have another computer at work that I can ping and it has 2 ip addresses: 192.168. 1 .xxx and 192.168.0.xxx. Those last 2 addresses have the same gateway ie 192.168. 1 .1 . the computer at work is connected...
Answer Snippets (Read the full thread at superuser):
This might....
So, let's say B is 10.10.10.10 and C is 20.20.20.20, and you.
Using -R makes B listen on a port and forward to C, and tunnel the connection through B to C.
Answer to below queries]
You are on host A.
|
Ask your Facebook Friends
|
I want to achieve the following:
Have a AxBxC matrix (where A,B,C are integers). Access that matrix not as matrix[a, b, c] but as matrix[(a, b), c], this is, I have two variables, var1 = (x, y) and var2 = z and want access my matrix as matrix[var1, var...
Started by devoured elysium on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Something like this:
class SpecialMatrix(np.....
If var1 = (x,y) , and var2 = z , you can use
matrix[var1][var2]
I think you can simply subclass the NumPy matrix type, with a new class of your own; and overload the __getitem__() nethod to accept a tuple .
|
|
This is supposedly a very easy question, but I just can't seem to find the right solution. There is a string in the format:
A:B=C;D:E=F;G:E=H;...
whereas A, B and C are alphanumeric (and may be lower as well as upper case). A and B are of length 1+, C...
Started by echorhyn on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
*);"); string test = "A:B=C;D:E=F;G:E=H"; // get all matches MatchCollection mc = regex.Matches(test}", m.Groups["B"].Value); Console.WriteLine("C = {0}", m.Groups["C"].Value); }
note : there are several captures groups....
|
|
Marcus Thornton SG 27 6'5'' 205 C+ B+ B- B- C- B looking to trade Marcus Thornton SG 27 6'5'' 205 C+ B+ B- B- C- B not looking for anything in particular but would love to get rid of his contracct
Started by Mama There goes That Ring on
, 8 posts
by 5 people.
Answer Snippets (Read the full thread at nbadimensions):
EC CHAMPIONS....
KNICKS GM.
Last edited by pootbrah; 01-19-2012 at 10:26 PM.
Team? The Magic I'll do Tyrus Thomas for Thornton + '14 Grizz first and '16 Magic first
Suns ill give u a josh harrellson n take on his contract pryz and bellinelli as cutbacks .
|
|
Hi all,
OK so I have two datatables A and B. They are both produced from CSV files. I need to be able to check which rows exist in B that do not exist in A.
Is there a way to do some sort of query to show the different rows or would I have to iterate ...
Started by Jon on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use the Merge and GetChanges methods on the DataTable to do this:
A.Merge(B); // this will add to A any records that are in B but not A return A.GetChanges(); // returns records originally only in B
Just FYI:
Generally speaking....
|
|
Hello, It appears to me that one way of storing data in a B-tree as a file can be done efficiently with C using binary file with a sequence (array) of structs, with each struct representing a node. One can thus connect the individual nodes with approach...
Answer Snippets (Read the full thread at stackoverflow):
For implementing B-Trees in a file, you can use the file offsetI did a....
Cvs.savannah.gnu.org/viewvc/wb/wb/c/ - it seems to offer disk-based B-tree style databases - although with C programs and implements B+ tree.
|
|
Hi,
I am looking for a lightweight open source paging B+ tree implementation that uses a disk file for storing the tree.
So far I have found only memory-based implementations , or something that has dependency on QT (?!) and does not even compile.
Modern...
Started by Laurynas Biveinis on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
( BDB , SQLite etc)
Faircom's C-Tree Plus has been available commercially for over 20 years writing our own paging B-Tree implementation....
You can also consider re-using the B-Tree implementations from an open source embeddable database.
|
|
In 32 bit integer math, basic math operations of add and multiply are computed implicitly mod 2^32, meaning your results will be the lowest order bits of the add or multiply.
If you want to compute the result with a different modulus, you certainly could...
Started by SPWorley on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Then a*b mod 2^N-1 = p+q mod 2^N-1 since....
This can require 64-bit computations, or you can split a and b into 16-bit parts and compute on 32-bits.
Suppose you can compute a*b as p*2^N+q.
But it's probably in that paper somewhere.
|