search for: _count

Displaying 20 results from an estimated 34 matches for "_count".

Did you mean: count
2010 Nov 22
1
Using RInside in Visual Studio 8.0 VC++.NET Program
...96 error C2065: '_First1' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale 875 Qdev_R1 Error 97 error C2065: '_Last1' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale 875 Qdev_R1 Error 98 error C2065: '_Count' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale 875 Qdev_R1 Error 100 error C2065: '_First1' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale 1117 Qdev_R1 Error 101 error C2065: '_Last1' : undeclared...
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has foreign keys in another called equipment. When I create a new record, it is added to the spares table however the list action does not show all the columns in the table. It only shows those columns that are not foreign keys. I am using the default action generated by scaffold for list. Why is that so? Do i need to re-write my
2006 Feb 27
0
Better counter_caches
Hey everybody, Rails currently offers ''belongs_to :counter_cache'', which is a very basic replacement for count triggers: ":counter_cache - caches the number of belonging objects on the associate class through use of increment_counter and decrement_counter. The counter cache is incremented when an object of this class is created and decremented when it?s destroyed. This requires that a column named "#{table_name}_count" (such as comments_count for a belonging Comment class) is used on the associate class (such as...
2008 Oct 31
0
Loading fixtures and counter_cache
Hi everyone, Does anybody know who is responsible for updating *_count columns (via :counter_cache) when creating the db and loading fixtures? In my case, the *_count elements remain zero! Thanks, Omid --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group....
2006 Feb 03
2
acts_as_tree counter_cache behavior is different than API docs
Before I file a ticket, I''ll query ya''ll about this: The API docs for acts_as_tree''s counter_cache is to create a database column called "children_count" to hold the counter_cache. I have enabled this option in my model. While writing tests I wrote a test for creating children from the a parent: message = @forum_message["parent"].find child = message.children.create( "member_id" => 1, "forum_id" => 1...
2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
...t_page_testzero checks if the page can be made volatile if the page * still has users and guest page hinting is enabled. */ -static inline int put_page_testzero(struct page *page) +static inline int put_page_testzero_nocheck(struct page *page) { - int ret; VM_BUG_ON(atomic_read(&page->_count) == 0); - ret = atomic_dec_and_test(&page->_count); + return atomic_dec_and_test(&page->_count); +} + +static inline int put_page_testzero(struct page *page) +{ + int ret = put_page_testzero_nocheck(page); if (!ret) page_make_volatile(page, 1); return ret; @@ -356,6 +360,7 @@ s...
2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
...t_page_testzero checks if the page can be made volatile if the page * still has users and guest page hinting is enabled. */ -static inline int put_page_testzero(struct page *page) +static inline int put_page_testzero_nocheck(struct page *page) { - int ret; VM_BUG_ON(atomic_read(&page->_count) == 0); - ret = atomic_dec_and_test(&page->_count); + return atomic_dec_and_test(&page->_count); +} + +static inline int put_page_testzero(struct page *page) +{ + int ret = put_page_testzero_nocheck(page); if (!ret) page_make_volatile(page, 1); return ret; @@ -356,6 +360,7 @@ s...
2006 Mar 23
2
Way to iterate over each associtaion
Is there a way with ActiveRecord to get ahold of a collection containing each association? I want to write a rake task that will dump a model and all its related models to yaml. Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/abdf4305/attachment.html
2006 Feb 28
0
ActiveRecord: Legacy primary keys
...= self.class_eval <<-EOS def #{pk}_before_type_cast return read_attribute(self.class.primary_key) if read_attribute(self.class.primary_key) return self.id end EOS end def self.content_columns @content_columns = columns.reject { |c| c.name =~ /(_id|_count)$/ || c.name == inheritance_column } end def update if !@new_id sql = "UPDATE #{self.class.table_name} " + "SET #{quoted_comma_pair_list(connection, attributes_with_quotes(false))} " + "WHERE #{self.class.primary_key} = #{quote(id)}"...
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully: <% for column in ModelName.content_columns %> <th><%= column.human_name %></th> <% end %> but it does not pick up any columns in my model''s table that end in "_id". Is this by design? Is there a helper method that will reference the related tables? Or will I need to code the column titles and detail records by
2006 Jun 08
2
counter_cache is not looking for children_count with acts_as_tree
Hi there, the acts_as_tree API says that I can set a counter cache and that it will automatically increment the "children_count" column. I did that but when I create a new page it asks for a "pages_count" column instead. Here is the relevant part of page.rb model: class Page < ActiveRecord::Base acts_as_tree :order => :position, :counter_cache => true acts_as_list :scope => :parent_id end A...
2006 Jan 25
1
Rails day 2: where is my association?
I?m following along a few tutorials on the web and trying to implement my own example, but I must be missing something because I can?t get has_many or belongs_to to work like I expected. now I have watched all the videos and made a cookbook several times with different interfaces. what I''m looking for is *not* a code snippet to solve something (because I already have that),
2012 May 06
1
isohybrid.c, problem reports and questions
...e block counts in the Apple partitions obviously assume 512 bytes per block, whereas the start block numbers obviously assume 2048 as announced in the APM header. In initialise_apm() i see two occasions where block counts are handled: - This should probably be 4 rather than 0x10: part->block_count = bendian_int(0x10); - These _count variables should probably be divided by 4 before being submitted to bendian_int(): part->block_count = bendian_int(efi_count); part->data_count = bendian_int(efi_count); part->block_count = bendian_int(mac_count); part->data_count =...
2023 Jul 25
1
[PATCH drm-misc-next v8 03/12] drm/nouveau: new VM_BIND uapi interfaces
...the requested mapping in bytes > +? ? ? ? */ > +? ? ? ?__u64 range; > +}; > + > +/** > + * struct drm_nouveau_vm_bind - structure for DRM_IOCTL_NOUVEAU_VM_BIND > + */ > +struct drm_nouveau_vm_bind { > +? ? ? ?/** > +? ? ? ? * @op_count: the number of &drm_nouveau_vm_bind_op > +? ? ? ? */ > +? ? ? ?__u32 op_count; > > > I've chatted a bit with Dave on IRC about this but both VM_BIND and EXEC > should support `op_count == 0` and do exactly the same thing that they > would do if there were re...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...true if the refcount fell to zero (the page has no users) + * put_page_testzero checks if the page can be made volatile if the page + * still has users and guest page hinting is enabled. */ static inline int put_page_testzero(struct page *page) { + int ret; VM_BUG_ON(atomic_read(&page->_count) == 0); - return atomic_dec_and_test(&page->_count); + ret = atomic_dec_and_test(&page->_count); + if (!ret) + page_make_volatile(page, 1); + return ret; } /* diff -urpN linux-2.6/include/linux/page-flags.h linux-2.6-patched/include/linux/page-flags.h --- linux-2.6/include/linux/...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...true if the refcount fell to zero (the page has no users) + * put_page_testzero checks if the page can be made volatile if the page + * still has users and guest page hinting is enabled. */ static inline int put_page_testzero(struct page *page) { + int ret; VM_BUG_ON(atomic_read(&page->_count) == 0); - return atomic_dec_and_test(&page->_count); + ret = atomic_dec_and_test(&page->_count); + if (!ret) + page_make_volatile(page, 1); + return ret; } /* diff -urpN linux-2.6/include/linux/page-flags.h linux-2.6-patched/include/linux/page-flags.h --- linux-2.6/include/linux/...
2012 Oct 12
13
Dom0 physical networking/swiotlb/something issue in 3.7-rc1
...be split in several fragments (between 1 and 8), assuming PAGE_SIZE=4096 Switching to bigger pages (32768 bytes for PAGE_SIZE=4096 case) allows : - Better filling of space (the ending hole overhead is less an issue) - Less calls to page allocator or accesses to page->_count - Could allow struct skb_shared_info futures changes without major performance impact. This patch implements a transparent fallback to smaller pages in case of memory pressure. It also uses a standard "struct page_frag" instead of a custom one....
2007 Mar 27
0
[PATCH] make all performance counter per-cpu
...a64/asm-offsets.c =================================================================== --- 2007-03-19.orig/xen/arch/ia64/asm-offsets.c 2007-02-12 14:00:54.000000000 +0100 +++ 2007-03-19/xen/arch/ia64/asm-offsets.c 2007-03-27 16:35:08.000000000 +0200 @@ -223,10 +223,11 @@ void foo(void) #ifdef PERF_COUNTERS BLANK(); - DEFINE(RECOVER_TO_PAGE_FAULT_PERFC_OFS, offsetof (struct perfcounter, recover_to_page_fault)); - DEFINE(RECOVER_TO_BREAK_FAULT_PERFC_OFS, offsetof (struct perfcounter, recover_to_break_fault)); - DEFINE(FAST_HYPERPRIVOP_PERFC_OFS, offsetof (struct perfcounter, fast_hyperprivop)); -...
2013 Mar 27
0
[PATCH 04/22] block: Convert bio_for_each_segment() to bvec_iter
...e kernel, * but this has never been seen here. @@ -909,11 +909,11 @@ bio_pageinc(struct bio *bio) static void bio_pagedec(struct bio *bio) { - struct bio_vec *bv; - int i; + struct bio_vec bv; + struct bvec_iter iter; - bio_for_each_segment(bv, bio, i) - atomic_dec(&bv->bv_page->_count); + bio_for_each_segment(bv, bio, iter) + atomic_dec(&bv.bv_page->_count); } static void diff --git a/drivers/block/brd.c b/drivers/block/brd.c index ddf2b79..0f3a3bb 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -328,9 +328,9 @@ static void brd_make_request(struct reque...
2013 Mar 27
0
[PATCH 04/22] block: Convert bio_for_each_segment() to bvec_iter
...e kernel, * but this has never been seen here. @@ -909,11 +909,11 @@ bio_pageinc(struct bio *bio) static void bio_pagedec(struct bio *bio) { - struct bio_vec *bv; - int i; + struct bio_vec bv; + struct bvec_iter iter; - bio_for_each_segment(bv, bio, i) - atomic_dec(&bv->bv_page->_count); + bio_for_each_segment(bv, bio, iter) + atomic_dec(&bv.bv_page->_count); } static void diff --git a/drivers/block/brd.c b/drivers/block/brd.c index ddf2b79..0f3a3bb 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -328,9 +328,9 @@ static void brd_make_request(struct reque...