Displaying 20 results from an estimated 1000 matches similar to: "drag and drop sorting recipe"
2019 Oct 17
2
Static assert fails when compiler for i386
Hi Devs,
Consider below testcase.
$cat test.cpp
#include <vector>
#include<type_traits>
typedef int _int4 __attribute__((vector_size(16)));
typedef union{
int data[4];
struct {int x, y, z, w;};
_int4 vec;
} int4;
typedef int4 int3;
int main()
{
static_assert(std::alignment_of<int4>::value <= alignof(max_align_t), "over
aligned!");
}
$clang++ -m32
error:
2017 Jan 20
9
How to handle INT8 data
Hello r users,
I have to deal with int8 data with R. AFAIK R does only handle int4
with `as.integer` function [1]. I wonder:
1. what is the better approach to handle int8 ? `as.character` ?
`as.numeric` ?
2. is there any plan to handle int8 in the future ? As you might know,
int4 is to small to deal with earth population right now.
Thanks for you ideas,
int8 eg:
human_id
2006 Mar 03
5
Message Board?
I''m interested in working on a message board application that uses ruby on
rails.
I''d like to see something end up similar to vBullieten, but with more of a
37signals type of less-is-more philosophy... mostly meaning less need for
preferences and settings and configurations.
I''ve checked rubyforge, and it looks like there are various forum apps
uploaded there, some
2006 Mar 31
2
RE: drag and drop sorting with an empty lis
I ran into this issue too. My solution was to add an "onUpdate" function to
the sortable that tests the container to see if it''s got any children or
not:
function is_empty(container)
{
if ($(container).hasChildNodes()) {
Element.removeClassName($(container),''empty'');
} else if (!$(container).hasChildNodes()) {
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find
"acts_as_list" ...
NameError in SpecialsController#printer
undefined local variable or method `acts_as_list'' for #<Class:
0xb7a46994>
RAILS_ROOT: /usr/local/apache2/htdocs/dps
Application Trace | Framework Trace | Full Trace
vendor/plugins/trunk/lib/scope_out.rb:70:in
2009 Jan 04
3
undefined local variable or method `acts_as_list'
So I seem to be having an issue with trying to install acts_as_list in
rails 2.2.2?
I have downloaded the files from: http://github.com/rails/acts_as_list/tree/master
I have put the files in the vendor/plugins folder the files are as
follows:
vendor/plugins/acts_as_list/init.rb
vendor/plugins/acts_as_list/lib/active_record/acts/list.rb
vendor/plugins/acts_as_list/test/list_test.rb
2006 Apr 28
2
Active Record save doesn''t save! (more detail - is this a bug?)
I got it to work by changing
scheduled_end_date= nil
to
self.scheduled_end_date= nil.
I believe these statements should be equivilent.
I don''t know Ruby/Rails well enough to know when, if or why that should
matter. Can someone educate me please? I want to believe this framework is
ready for production work, but silently dropping data is a very big
problem. I expect that I''ve
2006 May 26
6
Help needed with acts_as_list
Hi ! There must be something I don''t understand clearly in acts_as_list
I have a list of gallery entries (images + text), model is GalleryEntry.
I have a field in_exhibition (boolean)
I want the list to be sorted with a scope on in_exhibition : from 1 to N
for every record having in_exhibition = false and 1 to N for every
record having in_exhibition = true
When I use acts_as_list
2005 Nov 30
8
nested attributes with update_attributes()
Hi,
I am trying to use the update_attributes on object with nested
attributes and I am getting the following error:
ProductPrice expected, got HashWithIndifferentAccess
Here''s the situation (simplified):
class Product < ActiveRecord::Base
belongs_to :productPrice
end
class ProductPrice < ActiveRecord::Base
has_one :product,
:dependent => true
2007 May 22
3
can I use acts_as_list with a has_many :through association
I''d like to be able to use a has_many :through association and treat
the associations as a list but I''m getting this error when I try an
use an acts_as_list method:
NoMethodError: undefined method `move_to_bottom''
I''m using edge rails r6786.
Here are my domain rules:
Activities are things students can do.
Units consists of a sequenced list of
2017 Jan 20
4
How to handle INT8 data
Well I definitely cannot use them as numeric because join is the main
reason of those identifiers.
About int64 and bit64 packages, it's not a solution, because I am
releasing a dataset for external users. I cannot ask them to install a
package in order to exploit them.
I have to be very carefull when releasing the data. If a user just use
read.csv functions, they by default cast the
2007 Aug 15
3
ActsAsList specs
Hi,
How are people specifying models which act_as_list?
I''m thinking that it would be possible to check that acts_as_list
instance methods have been added to a class using something like this:
describe Page, "acts_as_list" do
it "should act as a list" do
Page.ancestors.should be_include(ActiveRecord::Acts::List::InstanceMethods)
end
it "should use
2005 Apr 20
4
acts_as_list and single table inheritance
in a single table inheritance model, rails will automatically set the
scope for acts_as_list to the ''type'' field as well as any other scope
conditions we provide.
Is there a way to disable this? i want to use STI but I want
acts_as_list to disregard the class type when getting/setting
positions.
thanks
alan
2006 May 02
3
Ajax scaffolding respones are received, but not rendered in browser
Hi i installed the latest ajaxscaffolding gem and generated a scaffold.
List works fine. Delete deletes, but the update doesn''t show and the busy
icon spins indefinitely. Pressing new or edit also causes the busy icon to
spin, but again the ui doesn''t update.
my development.log indicates the request was handled and (using firebug) I''m
seeing this response:
new
2003 Apr 02
1
RODBC sqlSave problem.
Dear list,
Being new to both the postgres database, ODBC and the RODBC interface, I
am somewhat confused by some of the problems I am experiencing trying to
connect R to the database.
Whai I am trying is basically the example part of the help file for the
sqlSave function:
> library(RODBC)
> odbcConnect("theodor") -> channel
> data(USArrests)
> sqlSave(channel,
2007 May 15
4
Way to mark record as main?
I was curious if there was a built in feature in ActiveRecord or a
plugin, but I basically have a database for phone numbers. I want a user
to be able to make a phone number as main. There can only be one phone
number marked as main at all times. Is there something for this?
Thanks for your help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers,
I''ve got a Categories table.
I want it to act as a list within the scope of the parent_id AND the
site_id.
Categories table :
id
label
site_id
parent_id
So, in my Category class, I have :
acts_as_list :scope => ''site_id = #{site_id} AND parent_id = #
{parent_id}''
The problem is that when I try to move_up a Category with a parent_id
that is null,
2006 Sep 03
7
using polymorphic associations with acts_as_list
This is what I have
class Photo < ActiveRecord::Base
belongs_to :image, :polymorphic => true
acts_as_list :scope => image
end
class Place < ActiveRecord::Base
has_many :photos, :as => :image
end
class Child < ActiveRecord::Base
has_many :photos, :as => :image
end
I want to be able to reorder the images. What I need is for the
position of the photos to be set
2009 Jan 05
3
Plugin not found: ["acts_as_list"]
I am trying to install acts_as_list in a rails 2.2.2 project but when I
try the following: ruby script/plugin install acts_as_list
I get: Plugin not found: ["acts_as_list"]
I had to download the acts_as_list plugin from the github because it
isn''t included in Rails 2.2.2.
The files are in my vendor/plugins/acts_as_list folder so I have:
lib/active_record/acts/list.rb
2017 Jan 20
1
How to handle INT8 data
Right, they are identifiers.
Storing them as String has drawbacks:
- huge to store in memory
- slow to process
- huge to index (by eg data.table columns indexes)
Why not storing them as numeric ?
Thanks,
Le 20 janv. 2017 ? 18h16, William Dunlap ?crivait :
> If these are identifiers, store them as strings. If not, what sort of
> calculations do you plan on doing with them?
> Bill