The x-axis is time broken up into time intervals. There is an interval column in the data frame that specifies the time for each row.
Plotting a histogram or line using geom_histogram and geom_freqpoly works great, but I'd like to use geom_density to get a filled area. Perhaps there is a better way to achieve this.
Right now, if I use geom_density, curves are created for each discrete factor level instead of smoothing over all of them.
I'm trying to sort a column of data in a GTK tree view non-alphabetically. I can't seem to find a function in the GTK+ libraries that cant do such a thing.
Does anyone here know of a way to do this?
I have a model with a completed:boolean column that I'd like override so I can add some conditional code.
I've never override an ActiveRecord attribute before and wanted to know if the method below is good practice?
class Article < ActiveRecord::Base
def completed=(b)
write_attribute(:completed, b)
# IF b is true then do something
end
end
How can I plot (a 3D plot) a matrix in Gnuplot having such data structure. I cannot find a way to use the first row and column as a x and y ticks (or to ignore them)
,5,6,7,8
1,-6.20,-6.35,-6.59,-6.02
2,-6.39,-6.52,-6.31,-6.00
3,-6.36,-6.48,-6.15,-5.90
4,-5.79,-5.91,-5.87,-5.46
Is the splot 'data.csv' matrix the correct parameter to use ?
I am trying to setup a many-to-many mapping in Fluent Nhibernate that has a where clause attached to the child table.
This is basically how it should work:
HasManyToMany(p => p.Images)
.Table("ProductImages")
.ParentKeyColumn("ProductID")
.ChildKeyColumn("ImageID")
.Where("ImageTypeID = 2");
The ImageTypeID column is in the Images table, but NHibernate is assuming it is part of the ProductImages table. Any idea how I can specify this?
Thanks!
I have two tables (tbl and tbl_new) that both use the same sequence (tbl_id_seq). I'd like to drop one of those tables. On tbl, I've removed the modifier "not null default nextval('tbl_id_seq'::regclass)" but that modifier remains on tbl_new. I'm getting the following error:
ERROR: cannot drop table tbl because other objects depend on it
DETAIL: default for table tbl_new column id depends on sequence tbl_id_seq
After reviewing http://www.postgresql.org/docs/9.1/static/sql-droptable.html
It looks like there is only CASCADE and RESTRICT as options.
Hi
I have a table with a column event_time. How can I select two rows right before NOW() and the next one after NOW(), ordered by event_time?
Is is possible with a single query?
i have a gridpanel with a datefield column, when my application is in english the datefield is working fine, but when my application is using french my datefield language is changed to french but the time doesn't change in the gridpanel cell. so any idea?
I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?
I am currently html encoding all user entered text before inserting/updating a db table record. The problem is that on any subsequent updates, the previously encoded string is reencoded. This endless loop is starting to eat up alot of column space in my tables. I am using parameterized queries for all sql statements but am wondering would it be safe to just let the .NET Framework handle this part without the HTML Encoding?
Ok, so I'm trying to select an amount of rows from a column that holds the value 3, but only if there are no rows containing 10 or 4, if there are rows containing 10 or 4 I only want to show those.
What would be a good syntax to do that? So far I've been attempting a CASE WHEN statement, but I can't seem to figure it out.
Any help would be greatly appreciated.
(My database is in an MS SQL 2008 server)
I would need some help on how to optimize the query.
select * from transaction where id < 7500001 order by id desc limit 16
when i do an explain plan on this - the type is "range" and rows is "7500000"
According to the some online reference's this is explained as, it took the query 7,500,000 rows to scan and get the data.
Is there any way i can optimize so it uses less rows to scan and get the data. Also, id is the primary key column.
Hi All,
Here is my issue. I am working on an E-commerce solution that is deployed to multiple European countries. We persist all exceptions within the application to SQL Server and I have found that there are records in the DB that have a DateTime in the future!
We define the culture in the web.config, for example pt-PT, and the format expected is DD-MM-YYYY.
After debugging I found the issue with these 'future' records in the DB is because of Callback methods we use. For example, in our Caching architecture we use Callbacks, as such -
CacheItemRemovedCallback ReloadCallBack = new CacheItemRemovedCallback(OnRefreshRequest);
When I check the current threads CultureInfo, on these Callbacks it is en-US instead of pt-PT and also the HttpContext is null. If an exception occurs on the Callback our exception manager reports it as MM-DD-YYYY and thus it is persisted to SQL Server incorrectly.
Unfortunately, in the exception manager code, we use DateTime.Now, which is fine if it is not a callback. I can't change this code to be culture specific due to it being shared across other verticals.
So, why don't callbacks into ASP.Net maintain context? Is there any way to maintain it on this callback thread? What are the best practices here?
Thanks.
Hi,
I was wondering if this is possible.
The serialize-string will be inserted in a mySQL-database, so it would be fine if all checkboxes would be inserted and not only the ones that is ticked(on).
it's possible to make on column in the database for each of the checkboxes, and use this if/else-statement:
if(isset($_GET['checkbox'])) {
// It's checked!
}
else {
// not checked!
}
but its a bit unappropriate...
In Alex the generated boilerplate code includes
data AlexPosn = AlexPn !Int -- absolute character offset
!Int -- line number
!Int -- column number
What does the ! in front of the Int indicate?
Is it possible to create a table which has a check constraint on one of the column whose value lies within the result set given by another sql query
eg.
create table tablename
(
name varchar(10),
rollno int
)check rollno in (select rollno from anotherDatabase.TableName,candidateRoll)
or any thing like that.
I dont have to use it anywhere but still want to know.
I've mapped two entities using JPA (specifically Hibernate). Those entities have a one-to-many relationship (I've simplified for presentation):
@Entity
public class A {
@ManyToOne
public B getB() { return b; }
}
@Entity
public Class B {
@OneToMany(mappedBy="b")
public Set<A> getAs() { return as; }
}
Now, I'm trying to create a relationship between two instances of these entities by using the setter of the one-side/not-owner-side of the relationship (i.e the table being referenced to):
em.getTransaction().begin();
A a = new A();
B b = new B();
Set<A> as = new HashSet<A>();
as.add(a);
b.setAs(as);
em.persist(a);
em.persist(b);
em.getTransaction().commit();
But then, the relationship isn't persisted to the DB (the row created for entity A isn't referencing the row created for entity B). Why is it so? I'd excpect it to work.
Also, if I remove the "mappedBy" property from the @OneToMany annotation it will work. Again - why is it so? and what are the possible effects for removing the "mappedBy" property?
That's what I have:
- A table with a few rows, one column only
What I am trying to accomplish:
Double tap on any row should produce an animation of the cell.
The animation that I want is a flip vertically of the row.
I am displaying some data in each row and what I want to do
is displaying the source of the data "on the back" of the row, so to speak.
Is it possible? If yes, how?
When setting ExportFormatType.CharacterSeparatedValues crystal report generates every row of data prefixed with column names (Report Headers). Why it does this? How it could be fixed? Usually it is preferred to have single header. For excel export type - generated report looks ok (only single header for all rows).
I am using crystal reports 11.5.3700.0. Visual studio 2008, .net 3.5 sp1
We are having a table of elements in SysListView32. Actually they are a table arranged under 5 columns. How to access 3rd column in the table in SysListView32?
In SQL Server, is there any way to check whether the changes in the schema will impact Stored Procedures (and/or Views)?
For example a change of the column name in one table, may break some Stored Procedures; how to check the impacted stored procs?
Say I have a file of this format
12:04:21 .3
12:10:21 1.3
12:13:21 1.4
12:14:21 1.3
..and so on
I want to find repeated numbers in the second column for, say, 10 consequent timestamps, thereby finding staleness.
and I want to output the beginning and and end of the stale timestamp range
Can someone help me come up with it?
You can use awk, bash
Thanks
I would like to ask if there is a way to include the total number of rows, as an additional column, in the returned result sets from a TSQL query using also the Row_Number (SQL 2005) command.
For example, getting the results set from a query against Book table in a form similar to this:
RowNum BookId BookTitle TotalRows
--------------------------------------------
1 1056 Title1 5
2 1467 Title2 5
3 121 Title3 5
4 1789 Title4 5
5 789 Title5 5