Thursday, 3 October 2013

mongodb complex query on nested array

mongodb complex query on nested array

I have a single document in MongoDb whose structure is something like this
.. NESTED ARRAY. I want to $addToSet into d:["x","y"] to make it
d:["x","y","z"].
I have tried out $elemMatch and $. But they only work at a SINGLE LEVEL of
array.
{
id:1,
a:[
{
id:2,
b:[
{
id:3,
c:[
{
id:4,
d:["x","y"]
},
{
id:5,
d:["p","q"]
}
]
},
{
id:13,
c:[
{
id:14,
d:["w","q"]
},
{
id:15,
d:["i","j"]
}
]
}
]
}
]
}
What will be the query to get d:["x","y","z"] where query part could be ..
{id:1, "a.id":2, "a.b.id":3, "a.b.c.id":4 } or may be using $elemMatch ?

Wednesday, 2 October 2013

Wait for Android animation to finish

Wait for Android animation to finish

I was wondering if anyone could help me out, I've been looking everywhere
for usefull help, but found nothing. I have four View elements (Buttons),
and I need to animate them, in random order, one after the other. I've
tried waiting for Animation.hasEnded(), that just freezes the entire app.
Also I tried waiting for an AnimationListener to change a boolean from
onAnimationEnd(), but that also froze the app. Both Thread.sleep() and
SystemClock.sleep() for waiting gave the same result. Please, can someone
help me?

Make a matrix with putting zeros between numbers in every rows

Make a matrix with putting zeros between numbers in every rows

I want make a 4*P matrix from P numbers
P=p1+p2+p3+p4
X=[x11 ... x1p1 0...0 0...0 0...0 ; 0...0 x2p1+1 ... x2p2 0...0 0...0 ;
0...0 0...0 x3p2+1 ... x3p3 0...0 ; 0...0 0...0 0...0 x4p3+1 ... x4p4]
there are values in pi of P elements in every row and other elements of
row are zero for example input=[1,2,3,4,5,6,7,8,9] p1=1, p2=2, p3=3, p4=3
X=[1 0 0 0 0 0 0 0 0; 0 2 3 0 0 0 0 0 0; 0 0 0 4 5 6 0 0 0; 0 0 0 0 0 0 7
8 9]
thanks

what the hell ubuntu has with amd processor

what the hell ubuntu has with amd processor

I'm using ubuntu since three year and loves it. But now problem is that I
can't install ubuntu on my pc which has amd processor. I tried all the
solution regard my problem but it didnt work. I was loving ubuntu and
hating to windows but now I think that windows is much better than ubuntu.

migrate to a page from personal account

migrate to a page from personal account

I'm trying to migrate a personal account to a bussines page, but when I do
the process I get an alert that says, "please access from a computer from
which you previously login facebook" ('m comunity manager, entered daily
from my computer ) Is this a bug? How I can fix it? thnks!

Tuesday, 1 October 2013

How to read a txt file line by line in R/RstudioH

How to read a txt file line by line in R/RstudioH

Suppose I have a messy text file like the following for example
Today is a good
day, but I feel very tired. It seems like it is
going to rain pretty soon.
I want to read the txt file into R as a character vector exactly the way
it appears as in the original text file. In other words, I want to have
the first element of the character vector being the first line, second
element of the character vector being the second line, etc, as below
char_vector[1] = "Today is a good"
char_vector[2] = "day, but I feel very tired. It seems like it is"
char_vector[3] = "going to rain pretty soon."
I have tried read.table and read.csv, but it's always the case that some
lines join together as one line. Is there a way to fix this?

Unable to resolve symbol 'ExecutionInfo'

Unable to resolve symbol 'ExecutionInfo'

I'm getting "Unable to resolve symbol 'ExecutionInfo'" when trying to use
ReportingService2010. ExecutionInfo and ExecutionHeader worked in
ReportingService2005. I'm using Visual Studio 2010, VB.Net, and Reporting
Services 2010. I can connect to the server and do things like
rs.ListChildren.
Any Ideas?

Should you ask a question asker to accept an answer=?iso-8859-1?Q?=3F_=96_meta.stackoverflow.com?=

Should you ask a question asker to accept an answer? – meta.stackoverflow.com

What I often see is questions that gets answered where the asker of the
question says "thank you this was exactly what I was looking for" in the
comments but forgets to mark the answer as ...

What is apache handlers equivalent in Lighttpd

What is apache handlers equivalent in Lighttpd

Hi experts can somebody give some clues about this.
In httpd.conf we use user defined handlers like
AddHandler ctc-handler getLauncher
What is the equivalent of userdefined apache handlers in Lighttpd.