sequences Questions
2
Solved
why does not this code work?
type Test() =
static member func (a: seq<'a seq>) = 5.
let a = [[4.]]
Test.func(a)
It gives following error:
The type 'float list list' is not compatible wi...
Chau asked 29/7, 2010 at 10:24
4
Solved
I am a Clojure newbie. I am trying to get two copies of a vector of card suits. The non-DRY way that I can come up with is
(def suits [:clubs :diamonds :hearts :spades])
(def two-times (concat sui...
Inadvertent asked 23/4, 2010 at 18:34
4
Solved
def flattenList(toFlatten):
final=[]
for el in toFlatten:
if isinstance(el, list):
final.extend(flattenList(el))
else:
final.append(el)
return final
When I don't know how deeply the lists ...
4
Solved
In C#, you could do something like this:
public IEnumerable<T> GetItems<T>()
{
for (int i=0; i<10000000; i++) {
yield return i;
}
}
This returns an enumerable sequence of 10 mi...
3
Solved
I have this "learning code" I wrote for the morris seq in f# that suffers from stack overflow that I don't know how to avoid. "morris" returns an infinite sequence of "see and say" sequences (i.e.,...
Noisemaker asked 22/5, 2009 at 17:25
2
Solved
I have a class hierarchy:
abstract DomainObject {
...
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ")
@SequenceGenerator(name="SEQ",sequenceName="SEQ_DB_NAME")
@Column...
4
Solved
Clojure is a functional lisp, reportedly not at all object-oriented, even though it runs on the JVM, a VM designed for an object oriented language. Clojure provides identical interfaces for iterati...
Bradytelic asked 10/10, 2009 at 15:20
3
Solved
First, I assume each structure-specific sequences would have different ways to remove an item: Vectors could be by index, List could be remove first or last, Set should be passing of the actual ite...
2
Solved
Several things here:
Can anyone point me at C code to decode ANSI console escape sequences?
Is there a way to get Cygwin BASH to emulate a dumb old TTY?
Maybe this should be 2 questions.
Thank...
2
Solved
I'm trying to generate the morris sequence in python. My current solution is below, but I feel like I just wrote c in python. Can anyone provide a more pythonic solution?
def morris(x):
a = ['1',...
Upright asked 16/2, 2009 at 16:24
8
Solved
Some people don't like sequences on Oracle. Why? I think they are very easy to use and so nice. You can use them in select, inserts, update,...
12
Solved
I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I don't want it to be restricted to a hardcoded list. ...
2
Solved
In SQL, how do update a table, setting a column to a different value for each row?
I want to update some rows in a PostgreSQL database, setting one column to a number from a sequence, where that c...
Brainstorming asked 29/9, 2008 at 8:56
4
Solved
I'm trying to think of clever, clear, and simple ways to write code that describes the sequence of integers in a given range.
Here's an example:
IEnumerable<int> EnumerateIntegerRange(int ...
Jemina asked 11/10, 2008 at 16:46
3
Solved
I've been unable to find a source for this information, short of looking through the Python source code myself to determine how the objects work. Does anyone know where I could find this online?
Binturong asked 5/9, 2008 at 4:27
© 2022 - 2024 — McMap. All rights reserved.