Hello, i have a list like this
["peter","1000","michell","2000","kelly","3000"]
and i would like to convert to
[("peter",1000),("michell", 2000),("kelly",3000)]
Please help.
Thanks.
When defining a struct type and instance, I can print the value and get the "struct" implementation type:
(defstruct person :name :age)
(def p (struct person "peter" 30))
user=> p
{:name "peter", :age 30}
user=> (type p)
clojure.lang.PersistentStructMap
But is it possible to tell whether p is an instance of the struct type "person"?
Customers Holidays
id | name customer_id | start | end
---+------ ------------+--------+------
1 | Peter 1 | 5 | 10
2 | Simon 1 | 15 | 20
3 | Mary 2 | 5 | 20
How should my SQL query look that out of start=11,end=14 I get these…
I have a dictionary object of type Dictionary
and trying to use StreamWriter to output the entire content to a text file but failed to find the correct method from the Dictionary class.
using (StreamWriter sw = new StreamWriter("myfile.txt"))
{
sw.WriteLine(dictionary.First());
}
I can only retrieve the…
Hi I would like to ask if its possible get array with clear data from ActiveRecord query without using map, collect or each.
names = User.find(:all, :select => "name")
return names == [#<User name:"Peter">,#<User name:"Martin">]
and I want names == ["Peter", "Martin"] without using map, collect or each. Thanks for…
Is there a character, say, $,
SELECT * FROM Persons WHERE firstName='Peter' AND areaCode=$;
such that the statement would return the same as
SELECT * FROM Persons WHERE firstName='Peter'
i.e. areaCode=$ would always return always true and, thus, effectively “turns of” the criteria areaCode=...
I’m writing a VBA code in Excel…
I have a colon-delimited text file containing grouped, related data. The People group contains people's names followed by their ages, separated by colons. How can I parse the text and group people according to their ages?
The structure is as follows:
Group.txt
Age:10:20:30:40:
Group:G1:10:G2:30:G3:20:G4:40:…
Hello,
I'm using JQuery to consume a WCF Service. Actually this works fine:
var para = ' { "Parameter" : { "ID" : "5", "Name" : "Peter" } }'
$.ajax({
type: "POST",
contentType: "application/json",
data: para,
url: url
success: success
});
But I don't want to pass the data parameter as…
I have set 'max_prepared_transactions' to 20 in the local postgres.config and yet the transaction fails with the following error trace (but only on Linux). Since in Windows the same code works seamlessly I am wandering if this isn't an issue of permission. What would be the solution?
Thanks
Peter…
Hi,
I have a bit of code which loads data from a stored procedure in MS SQL Server and then loads the data to a datagridview, which works fine. What i want is for the code that connects / loads the data to sit in my Database Class and then everything associated with the datagridview to be stored…
hello,
i have a tricky question, so i need to describe my problem:
i need to print 2-sided booklets (a third of a paper) on normal paper (german A4, but letter is okay also) and cut the paper afterwards.
The Pages are in a Postscript Level 2 File (generated by an ancient printer driver, so no…
Hi,
I'm having a problem with NSUserDefaults. I've followed the steps in the books as closely as I can for my app, but still get the same problem.
I am getting a
*** -[NSUserDefaults integerForKey:]: message sent to deallocated instance 0x3b375a0
error when I try and load in the…
Hi,
I'm trying to adapt a bash script from "Sams' Teach Yourself Linux in 24 Hours" which is a safe delete command called rmv. The files are removed by calling rmv -d file1 file2 etc. In the original script a max of 4 files can by removed using the variables $1 $2 $3 $4.
I want to…
I am working in Flash Builder 4 with Google Map's ActionScript API. I have created a map, loaded some custom markers onto it and added some MouseEvent listeners to each marker.
The trouble comes when I load an InfoWindow panel. I want to dynamically set the htmlContent based…
I have seen this topic discussed several times, but emphasis is on "very good in-line-comparison" here, which was not really covered by those threads.
E.g. I would like the tool to recognize and highlight that the resource "colorpicker_newstring" has been added when comparing…
Hi!
I searched before I ask, without lucky..
I looking for a simple script for myself, which I can search for files/folders. Found this code snippet in the php manual (I think I need this), but it is not work for me.
"Was looking for a simple way to search for a…
Man, I am still not able to save a picture when I send an intent asking for a photo to be taken. Here's what I am doing:
Make a URI representing the pathname
android.content.Context c = getApplicationContext();
String fname =…
I am working on a .NET project which uses Microsoft SQL server. In this project, I need a CLR stored procedure (written in C#) that uses a remote web service. So, when the stored procedure is executed on the SQL server, it makes web…
I am puzzled by generics. You can declare a field like:
Class<Collection<String>> clazz = ...
It seems logical that you could assign this field with:
Class<Collection<String>> clazz =…
When somebody shares a Spotify playlist, the attachment is missing from the Graph API.
What is shown in Facebook:
What is returned by the Graph API:
{
"id": "********_******",
"from": {
"name":…
I have downloaded, compiled and installed so far:
apr-1.3.9
apr-util-1.3.9
sqlite-3.6.23
zlib-1.2.4
libtool-2.2.6b
Now after downloading subversion-1.6.9, the config works fine but compiling it will end…
I am trying to update an ms access database from a datagridview.
The datagridview is populated on a button click and the database is updated when any cell is modified.
The code example I have been…
Hi, I'm not yet a skilled programmer but I thought this was an interesting problem and I thought I'd give it a go.
Triangle, pentagonal, and hexagonal
numbers are generated by the following
…
Hello,
I'm currently developing a C# app with an SQL Server DB back-end. I'm approaching the point of deployment and hitting a problem. The applicaiton will be deployed within an active…
I've got custom errors to work for .aspx page like: www.domain.com/whateverdfdgdfg.aspx
But, when no .aspx url is requested, (like http://www.domain.com/hfdkfdh4545) it results in an…