Displaying 20 results from an estimated 10000 matches similar to: "Floats being stored in database as integer?"
2007 Jan 26
10
Camping and DBI
Hi,
I''ve been playing around with using DBI instead of ActiveRecord ''cause
I just love to beat myself up! ;) Is this an okay way to do this, or
is there any other more creative ways?
require ''dbi''
module MyApp:Models
class DB
def self.dbh
DBI.connect(''DBI:Mysql:dbname'', ''username'',
2004 Jun 22
0
Perl Script for pulling information from a mysql database
Here''s the script. I would have posted it to a website, but I figure
this''ll be better so it is always on the list for people in the future
in case they wanted to see it.
If you have any questions about any of it, please let me know. Mike and
I aren''t the cleanest of programmers. Cron the script to run whenever
you need it to. :)
#!/usr/bin/perl
#
# TC Helper Script:
2006 Jun 26
0
DBI question. How do I load a database with data parsed from REXML?
I wrote a rexml script that parses rather big xml files (DOM parsing) and
builds an object out of them. This is what it looks like after i parse the
xml file and display the object:
[#<Article:0xb79e7428 @brand="This is a story from ", @id=5337,
@fblurb="burb", @ntype="news type here", @copy="Copyright \302\251 2006 ",
@source="source",
2008 Mar 20
0
Mixing stored procedure call with RoR db calls in the same function gives errors
Folks,
I am using ruby 1.8.5 with rails 1.2.3 and have made changes to
mysql_adapter.rb based on recommendations made here
http://wiki.rubyonrails.org/rails/pages/StoredProceduresInMySql to be
able to use stored procs in my code.
I have changed this call in mysql_adapter.rb
ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username,
password, database, port, socket], config)
to
2006 Jan 23
5
Bibtex database design
I am working a Bibtex database for my school using Rails and I need some idea
on how to manage the bibtex types.
I crated an Author and Publications model and put has_and_belongs_to_many
relationship between them.
The user model basically is like this:
class User < ActiveRecord::Base
has_and_belongs_to_many :publications
end
The Publication model has all the Bibtex fields
2004 Dec 10
1
subset bug?
I ran into a problem with "subset" while working at home that I am not sure is a bug or not. I defined a custom function to take a data frame of tree positions, sizes, and types (containing the columns TRT, COMP, PLOT, X, Y, DBH and CON) and wanted to make a stem map of the plot using different symbols and colors to represent the different types of tree stems. I copied a bit of the
2005 Dec 25
0
CentOS-announce Digest, Vol 10, Issue 11
Send CentOS-announce mailing list submissions to
centos-announce at centos.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.centos.org/mailman/listinfo/centos-announce
or, via email, send a message with subject or body 'help' to
centos-announce-request at centos.org
You can reach the person managing the list at
centos-announce-owner at centos.org
When
2006 Jan 03
0
Automatically mapping content_columns?
Hi all,
Quick setup - I''ve got a table Foo. Foo has a foreign key (bar_id) to the
table Bar. The Bar table has an "id" and "name" column. Assume a 1:1
relationship.
The issue I''m trying to resolve (or rather, be lazy about) is with regards to
Foo.content_columns. By default it doesn''t pickup the foreign key. What I''m
wondering is if
2003 Nov 16
2
prevent conversion to factors in aggregate?
I've been trying to figure out how to prevent a column that is the result of
an aggregate function call so that I can use it in further calculations. For
example, I would like to aggregate the expf for the data.frame by sp
(character) and dbh (double d=rounded to integer) using the command:
> st2 <- aggregate( ntrs$expf, by=list(sp=ntrs$sp,dbh=ntrs$dbh), sum )
> st2$expf <- st2$x
2011 Jul 22
1
3d plotting with cloud and wireframe
Hi,
I'm trying to plot an equation in two variables to get a feel
for sensitivity to its parameters. I've run expand.grid to get made-up
vectors of the combinations of the two independent variables, and am trying
to plot the output of the dependent, M, against both the dependent in a 3d
space.
t <- 0:100
DBH <- 10:100
TxDBH<-expand.grid(t,DBH)
time<-TxDBH[,1]
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help,
Here's a simple example of nonlinear curve fitting where nls seems to get
the answer wrong on a very simple exponential fit (my R version 2.7.2).
Look at this code below for a very basic curve fit using nls to fit to (a)
a logarithmic and (b) an exponential curve. I did the fits using
self-start functions and I compared the results with a more simple fit
using a straight lm()
2012 Oct 03
1
Difficulties in trying to do a mixed effects model using the lmer function
Dear people of the help list
I am drying to analyze my data using the 'lmer' function and I keep having problems.
This is the model:
> fm1<-lmer(dbh~spec+scheme+(1|Plot),data=d, REML=FALSE).
I analyse tree size (dbh) of 3 different species (spec) and 3 planting schemes (scheme). I have 5 plots, which I hope to model as a random factor. (However, the subsequent output is based on
2007 Dec 12
1
How to plot the grid figure using R?
Now I have the forest plot data with x, y locations, and I measured the DBH for every indivicuals.
The data looks like that:
x=runif(100,0,100)
y=runif(100,0,100)
dbh=runif(100,1,100)
rdata=data.frame(x,y,dbh)
> rdata[1:5,]
x y dbh
1 99.5354145 1.412844 34.10112
2 0.8259361 87.737036 39.12914
3 6.5678613 65.699032 22.55990
4 67.2987881 72.053877 45.83978
5 2.2491372
2013 Apr 06
1
Plotting a curve for a Holling Type III Functional Response
Hey,
So I have a scatter plot and I am trying to plot a curve to fit the data
based on a Holling Type III functional response. My function is this:
nll2<-function(a,b) {
conefun<-(a*DBH^2)/(b^2+DBH^2)
nlls2<-dnbinom(x=cones ,size=DBH, mu=conefun,log=TRUE)
-sum(nlls)
}
and my plot is this:
plot (DBH,cones)
DBH is on the x-axis and cones is on the y-axis. How do I get the curve
2006 Dec 01
3
Creating databases on the fly
Hi,
Is there a recommended way of creating a new database from within
rails? (or is the recommended way not to do it?)
In my application I wish to be able to create a new database structure
for each user who signs up, but there doesn''t seem to be a way of doing
this using ActiveRecord.
At present I can create it by establishing a new connection to the
database
dbh =
2006 Feb 08
1
Possible AGI Bug in Asterisk?
Dear All,
I seem to have stumbled across an AGI problem;
I have written an AGI Script (bottom of this email);
The script does the following;
Makes a CDR entry when called
Records the call
Updates the CDR
Finds a corresponding DNIS from the SMDR table (captured via a serial
port logger)
Matches up the record and updates the CDR.
The script works perfectly in my test lab and has been doing so
2007 Aug 14
1
find_by_sql vs connection.select_all
I was trying to do SUM based mySQL query simliar to the following:
SELECT SUM(updated_on - created_on) AS total from signups
If I were to run this command in the mySQL console I would get a
result. However, if I were to run it using the following command in
Rails:
Signup.find_by_sql("SELECT SUM(updated_on - created_on) AS total from
signups")
The query that is written to the log is:
2006 Apr 01
0
CEBA:2005-1224-1 CentOS 4 i386 dbh - bugfix update (Extras Only)
CentOS Errata and Bugfix Advisory 2005:1224-1
CentOS 4 i386 dbh - Bugfix Update (Extras Only)
This CEBA is for the Extras repository only, and not for the main CentOS
repository.
-------------------
The following upstream changes have been rolled into dbh:
* Thu Dec 22 2005 Kevin Fenzi <kevin@tummy.com> - 1:1.0.24-3.fc4
- Bump release to fix tagging issue
* Thu Dec 22 2005 Kevin Fenzi
2006 Apr 01
0
CEBA:2005-1224-1 CentOS 4 x86_64 dbh - bugfix update (Extras Only)
CentOS Errata and Bugfix Advisory 2005:1224-1
CentOS 4 x86_64 dbh - Bugfix Update (Extras Only)
This CEBA is for the Extras repository only, and not for the main CentOS
repository.
-------------------
The following upstream changes have been rolled into dbh:
* Thu Dec 22 2005 Kevin Fenzi <kevin@tummy.com> - 1:1.0.24-3.fc4
- Bump release to fix tagging issue
* Thu Dec 22 2005 Kevin Fenzi
2007 Jul 31
2
choosing between Poisson regression models: no interactions vs. interactions
R gurus,
I'm working on data analysis for a small project. My response
variable is total vines per tree (median = 0, mean = 1.65, min = 0,
max = 24). My predictors are two categorical variables (four sites
and four species) and one continuous (tree diameter at breast height
(DBH)). The main question I'm attempting to answer is whether or not
the species identity of a tree has