Displaying 20 results from an estimated 20000 matches similar to: "Fastest way to find the total length of your postgres query"
2002 Jun 27
2
Fastest way to find the last index k such that x[k] < y in a sorted vector x?
Hi, I am trying to find the fastest way to
"find the last index k such that x[k] < y in a *sorted* vector x"
These are my two alternatives:
x <- sort(rnorm(1e4))
y <- 0.2
# Alt 1
k <- max(1, sum(x < y))
# Alt 2 "divide and conquer"
lastIndexLessThan <- function(x, y) {
k0 <- 1; k1 <- length(x)
while ((dk <- (k1 - k0)) >
2007 Jan 04
2
postgres and asterisk
I need to retrieve my asterisk to retrieve a values from postgresql, i am
looking for some sort of application like *mysql*() app, I found one but it
is only available on Suse, is there any way for doing this?
Regards,
O.Youssef
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2007 Apr 10
2
postgres 7 - CentOS 4.4
Hi
Firstly apologies but i have to install an app that uses postgres but i
am more a MySQL/Oracle guy so i maybe doing something really wrong here..
I am following instructions for creating a DB user and encountering this
# createuser -ADP -U postgres foo
Enter password for new user:
Enter it again:
createuser: could not connect to database template1: FATAL: IDENT
authentication failed for
2006 May 30
5
Rails - Postgres - importing data
I am writing a application where there is a lot of data in an old
Filemaker program that I am going to need to do a 1 time import...1 main
table and 2 related tables. I can get the data from Filemaker into a dbf
or csv or Excel file without problem.
Is anyone aware of a utility for postgresql or a rails plug-in that
might make this easier? I am worried about Rails import since I can''t
2012 Feb 27
3
What is the fastest way to combine all columns of a matrix to one column?
Dear all,
Newbie: What is the fastest way to combine all columns of a matrix to one
column?
--
View this message in context: http://r.789695.n4.nabble.com/What-is-the-fastest-way-to-combine-all-columns-of-a-matrix-to-one-column-tp4423882p4423882.html
Sent from the R help mailing list archive at Nabble.com.
2010 Jun 15
2
Fastest way to merge matrix columns into a comma delimited string?
Folks:
Say I have a matrix:
test=matrix(c(1,2,3),nrow=10,ncol=3)
I would like to have an output character vector where each line is
row's values delimited by commas, e.g.:
"1,2,3"
"2,3,1"
"3,1,2"
...
"1,2,3"
What is the fastest way of doing this? I can paste() row-by-row but
this seems an inefficient approach to doing this. Thanks! I'm not
2011 Jun 24
1
Fastest way of finding if any members of vector x fall in the range of the rows of matrix y
Hi All,
What is the fastest way of finding if any members of vector x fall in the
range of the rows of matrix y?
I do not want to use two for loops as this will take forever.
Any help will be appreciated,
best,
salih
[[alternative HTML version deleted]]
2013 Aug 23
2
Fastest way of removing very large number of files?
Hi All.
I currently have a problem on my backup server with very large number of
small files in a large number of directories. I would like to delete them
as fast as possible. Currently I use:
rsync -a --delete /empty_directory/ dir_to_clean/
I've read that rsync will be faster than rm or find.
Can you recommend something? I use an ext4 filesystem.
Best regards,
Rafal.
2011 Feb 15
1
Most efficient/fastest way to see disk usage
Hi all,
I use this command to see disk usage:
du -cks * | sort -rn | while read size fname; do for unit in k M G T P
E Z Y; do if [ $size -lt 1024 ]; then echo -e
"${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done
The data itself is around 200GB with lots of subdir and small files.
The command takes for about 1 hour to finish.
Is there a faster way to see the disk
2014 Aug 10
1
"Fastest" way to merge 300+ .5MB dataframes?
Good afternoon,
Today I was working on a practice problem. It was simple, and perhaps
even realistic. It looked like this:
? Get a list of all the data files in a directory
? Load each file into a dataframe
? Merge them into a single data frame
Because all of the columns were the same, the simplest solution in my
mind was to `Reduce' the vector of dataframes with a call to
`merge'. That
2006 Feb 13
8
postgres and rake
am in a bit of a quandry...
I have asked postgresql-users list and haven''t gotten anything to work
with...
> > How do I change the owner of a schema?
> >
> > ALTER SCHEMA "public" OWNER to "some_user"; #?
>
>
http://www.postgresql.org/docs/current/interactive/sql-alterschema.html
>
> The docs explain this very situation. HTML
2006 Mar 29
3
MySQL in dev, Postgres in prod - differences in "LIKE" query
Hi everyone,
I run MySQL in my dev environment, but Postgres in my production
environment (out of necessity). I''m having trouble finding a way to
write a query with a LIKE condition that is supported as case
insensitive in both databases.
Right now, I have this:
@query = "m" # for example
@people = Person.find(:all, :conditions => ["last_name LIKE ?", @query +
2005 Dec 15
1
Variable '%r' doesn't transfomr in Postgres query
Hi,
i'm using postgres for authorization. When I switched from a4 to a5
authorization stoped working.
Query in conf file for postgres looks like this:
password_query = select password from auth('%u','%r');
But in logs, the transformed query looks like this:
Performing query: select password from auth('test','%r');
Looks like you don't transform that
2001 Sep 04
2
fastest way to multiply each column of a matrix by a single vlaue
Let A be a m by n matrix and b a length n vector. What is the fastest
vectorized code for doing
for(j in 1:n) A[, j] <- A[, j]/b[j] ?
solution 1:
t(t(A)/b)
solution 2:
B <- matrix( rep(b, m), byrow=T, nrow=m )
A/B
anything else?
I have a program that uses this kind of operation million of times and
I appreciate your input.
Thanks.
Jason Liao
=====
Jason G. Liao
Department of
2007 Jun 24
3
Fastest Way to run Rails
Hi,
I am a bit confused about what is the fastest way to run a rails application.
I have seen examples which use Apache, mongrel, lighthttpd, fastcgi etc.
Is there a correct way to do it? Or is it just a personal choice?
Thanks,
Keith
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2011 Aug 09
3
what is the fastest way to fetch results which are sorted by timestamp ?
what is the fastest way to fetch results which are sorted by timestamp ?
i want to use xapian as my search engine , use add_boolean_term(something) and add_value(0,sortable_serialise(get_timestamp())) to a doc.
search through enquire.set_weighting_scheme(xapian.BoolWeight()) and enquire.set_sort_by_value(0,True) to ensure that the results are sorted by the timestamp.
This method is ok , but
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs?
I have the following problem! I have a function that calls one or more
functions, depending on the input parameters. I am searching for the fastest
way to select and execute the selected functions and return their results in
a list. The number of possible functions is 10, however usually only 2 are
selected (although sometimes more, even all).
For examples, if I have function
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
lets say i have the following SQL in my database editor :
When i paste it into rad rails i have to add quotes and the ''+'' symbol
to the end of each line. It is very tedious. What is the best method?
select timesheets.employee,
sum(items.hours) as hours,
sum(items.hours*timesheets.cost)
as cost,
sum(items.hours*timesheets.charge*decode(activities.chargetype,0,1,0))
as charge,
2011 Aug 11
3
Fwd: Re: what is the fastest way to fetch results which are sorted by timestamp ?
(Forwarded off-list message)
-------- Original Message --------
Subject: Re: [Xapian-discuss] what is the fastest way to fetch results
which are sorted by timestamp ?
Date: Thu, 11 Aug 2011 01:06:36 +0800
From: ??? <panjunyong at gmail.com>
To: Tim Brody <tdb2 at ecs.soton.ac.uk>
On Wed, Aug 10, 2011 at 6:39 PM, Tim Brody <tdb2 at ecs.soton.ac.uk> wrote:
> Hi,
>
> In
2008 Jan 31
3
fastest way to compute the squared Euclidean distance between two vectors in R
I have a program which needs to compute squared Euclidean distance
between two vectors million of times, which the Rprof shows is the
bottleneck. I wondered if there is any faster way than my own simple
function
distance2 = function(x1, x2)
{
temp = x1-x2
sum(temp*temp)
}
I have searched the R-help archives and can not find anything except
when the arguments are matrices. Thanks for any