Hi, I am a beginner in Clojure, and I have a simple question
Lets say i have a List, composed of Maps.
Each Map has a :name and :age
My code is:
(def Person {:nom rob :age 31 } )
(def Persontwo {:nom sam :age 80 } )
(def Persontthree {:nom jim :age 21 } )
(def mylist (list Person Persontwo Personthree))
Now how do i traverse the lis...
Hi, I am having a bit of difficulty with Lists in Clojure
I have a quick question concerning the filter function
Let's say I have a List composed of Maps
My code is:
(def Person {:name Bob } )
(def Person2 {:name Eric } )
(def Person3 {:name Tim } )
(def mylist (list Person Person2 Person3))
How would i go about filtering my list so t...
I looked at various Haskell resources on the web, before buying the book, Real World Haskell. Being otherwise excellent, it doesn't seem to contain anything about list comprehensions which I saw mentioned in the various websites I looked at. Could this just be because they are generally unused in well written Haskell for some reason, or ...
I'm trying to code a simple genetic programming utility in python. But right now I'm stuck at the crossover/mate function for my trees. The trees are built by nested lists and look something like this:
# f = internal node (a function), c = leaf node (a constant)
tree1 = [f, [f, [f, c, c], [f, c, c]], [f, [f, c, c], [f, c, c]]]
tree2 = [...
The book I'm reading about Erlang has exercises in the back of it and one is to re-create the lists:append function.
I could do this simply using the ++ operator, but isn't this really slow? And I think the point of the exercise is to do it using list operations that I write.
So far the only approach that I could think of is to do some...
After compiling some code, the compiler generates a bunch of files. I have statistics, symbols, call tree, errors, list, debug and exe. I have figured out what each means, except for the list file. What is the function of the list file. Is it for the user or the computer/embedded system itself?
...
So I wrote this simple console app to aid in my question asking. What is the proper way to use a lambda expression on line 3 of the method to get the common members. Tried a Join() but couldn't figure out the correct syntax. As follow up... is there a non-LINQ way to do this in one line that I missed?
class Program
{
static void Mai...
Hello,
I am trying to retrieve the latest 5 posts (by post time)
In the views.py, if I try blog_post_list = blogPosts.objects.all()[:5] It retreives the first 5 elements of the blogPosts objects, how can I reverse this to retreive the latest ones?
Cheers
...
In Python I have a list of strings, some of which may be the empty string. What's the best way to get the first non-empty string?
...
Is there a simple way to count the number of occurences of all elements of a list into that same list in C#? Something like this:
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
string Occur;
List<string> Words = new List<string>();
List<string> Occurrences = new...
I work for an Architecture firm and I am creating a plug-in for a 3D modeling program to assist design. I have a Building class, and a Floor class. The building contains a reference to a FloorList collection of floors. I'm trying to figure out what to base the FloorList collection off of so that I can minimize the amount of work I need t...
http://ec4u.dev.creative-ctrl.com/product/wallys-natural-100-beeswax-ear-candles-12pk
Check it.
cannot get .menu ul to render for the life of me!!
strange enough, it renders in ie6, ie8, safari, and ff, but not ie7! I've tried everything. Any ideas?
(I'm pretty close to xhtml strict validation too).
...
What is the best way to provide a caption for an HTML list? E.g
Fuit
Apple
Pear
Orange
How should the word "fruit" be handled, particularly if I want it to be semantically associated with the list itself?
...
Say I have a list like this:
[a, b, c, d, e, f, g]
How do modify that list so that it looks like this?
[a, b, c, def, g]
I would much prefer that it modified the existing list directly, not created a new list.
...
Can anyone suggest a good solution to remove duplicates from nested lists if wanting to evaluate duplicates based on first element of each nested list?
The main list looks like this:
L = [['14', '65', 76], ['2', '5', 6], ['7', '12', 33], ['14', '22', 46]]
If there is another list with the same element at first position [k][0] that ha...
I need to pull back from a database JSON documents that are not based on a standard object.
Is there a way using .NET to "deserialize" these documents into Lists & Dictionaries of primitive objects (string, int, bool, etc...)
Any library that can do this in both directions?
...
I'm generating an excel in ruby which each line represents the results of an nmap scan.
An example of a line could look like that: ip, yes (because port is 22 open), no (because port 80 is not open), etc.
I would like to be able to create a header line with a drop down list for each port that allow me to select if that port is open or ...
Office Client Integration features are disabled by design on an FBA site. How would I export a list into Excel programmatically? Pointers appreciated!
...
I read that Vectors are not seqs, but Lists are. I'm not sure what the rationale is for using one over the other. It seems that vectors are used the most, but is there a reason for that? Any answers are appreciated, thanks!
...
I need a fast method to determine if a given string is in a list of strings.
The list of strings is not known until runtime but thereafter it will not change.
I could simply have a List<String> called strings and then do:
if (strings.Contains(item))
However this will perform poorly if there are many strings in the list.
I could als...