search for: is_empty

Displaying 20 results from an estimated 57 matches for "is_empty".

Did you mean: zs_empty
2006 Mar 07
6
Flickr - Tutorial
So I''ve pretty much followed the steps in the video tutorial on RoR.com for creating a small app, to search for photos on flickr.com - all is good, and works as intended to.. How would I go about adding validation, so if no tags are specified it will fail. I know I have to use validates_presence_of :tags - but not in the controller.. so I tried to generate a model called
2024 Jul 30
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...ot, *dir; > > + struct r535_gsp_log *log; > > + int ret; > > + > > + /* If we were told not to keep logs, then don't. */ > > + if (!keep_gsp_logging) > > + return; > > + > > + /* Check to make sure at least one buffer has data. */ > > + if (is_empty(&gsp->blob_init) && is_empty(&gsp->blob_intr) && > > + is_empty(&gsp->blob_rm) && is_empty(&gsp->blob_rm)) { > > + nvkm_warn(&gsp->subdev, "all logging buffers are empty\n"); > > + return; > > + } &gt...
2007 Aug 02
7
has_many and class function
Hello, i have two models : class Container < ActiveRecord::Base has_many :bottles end class Bottle < ActiveRecord::Base belongs_to :container def self.find_all_from_container(container) container.bottles.find(:all) end end i was asking myself if there was a better way to write the function find_all_from_container : i can call it from an instance of Container but
2024 Jul 30
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...e(log->debugfs_logging_dir); > + > + kfree(log->blob_init.data); > + kfree(log->blob_intr.data); > + kfree(log->blob_rm.data); > + kfree(log->blob_pmu.data); > + > + /* We also need to delete the list object */ > + kfree(log); > +} > + > +/** > + * is_empty - return true if the logging buffer was never written to > + * @b: blob wrapper with ->data field pointing to logging buffer > + * > + * The first 64-bit field of loginit, and logintr, and logrm is the 'put' > + * pointer, and it is initialized to 0. It's a dword-based in...
2024 Jul 29
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...tainer_of(_log, struct r535_gsp_log, log); + + debugfs_remove(log->debugfs_logging_dir); + + kfree(log->blob_init.data); + kfree(log->blob_intr.data); + kfree(log->blob_rm.data); + kfree(log->blob_pmu.data); + + /* We also need to delete the list object */ + kfree(log); +} + +/** + * is_empty - return true if the logging buffer was never written to + * @b: blob wrapper with ->data field pointing to logging buffer + * + * The first 64-bit field of loginit, and logintr, and logrm is the 'put' + * pointer, and it is initialized to 0. It's a dword-based index into the + * cir...
2005 Jul 18
2
scriptaculous dragdrop.js empty list problem
Hi, I''ve just been having a look at the scriptaculous drag-n-drop library, which looks exceedingly good. I''m running across a show-stopper here, though - something that''s cropping up in both the online demos and my own test scripts. If I set up two lists so that I can drag items between them, then if either list becomes empty, I can''t drag elements back into
2024 Oct 30
1
[PATCH 2/2] [v9] drm/nouveau: expose GSP-RM logging buffers via debugfs
...tainer_of(_log, struct r535_gsp_log, log); + + debugfs_remove(log->debugfs_logging_dir); + + kfree(log->blob_init.data); + kfree(log->blob_intr.data); + kfree(log->blob_rm.data); + kfree(log->blob_pmu.data); + + /* We also need to delete the list object */ + kfree(log); +} + +/** + * is_empty - return true if the logging buffer was never written to + * @b: blob wrapper with ->data field pointing to logging buffer + * + * The first 64-bit field of loginit, and logintr, and logrm is the 'put' + * pointer, and it is initialized to 0. It's a dword-based index into the + * cir...
2024 Aug 02
1
[PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object
Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object. This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp. This is needed so that we can retain DMA buffers even after the nvkm_gsp object is deleted. Signed-off-by: Timur Tabi <ttabi at nvidia.com> --- Notes: v2: added get/put_device calls
2024 Jul 31
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...g *log; > > > + int ret; > > > + > > > + /* If we were told not to keep logs, then don't. */ > > > + if (!keep_gsp_logging) > > > + return; > > > + > > > + /* Check to make sure at least one buffer has data. */ > > > + if (is_empty(&gsp->blob_init) && is_empty(&gsp->blob_intr) && > > > + is_empty(&gsp->blob_rm) && is_empty(&gsp->blob_rm)) { > > > + nvkm_warn(&gsp->subdev, "all logging buffers are empty\n"); > > > + return; &g...
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()) { Element.addClassName($(container),''empty''); } } I was using this for 2 sortable (UL) lists - my class for the &quot...
2014 Mar 21
2
[LLVMdev] [RFC] Add empty() method to iterator_range.
...benefit of range based for loops. It doesn't enable anything fundamentally new, but improving readability of C++ code is welcome. This is easy to punt (and I won't be especially bothered if that's what we do), but it also seems like it would be easy to implement our own version (llvm::is_empty?) and replace it when the committee decides on something, the same way we did with llvm::move? Is there any reason not to follow that approach? Cheers, Lang. On Thu, Mar 20, 2014 at 2:31 PM, Chandler Carruth <chandlerc at google.com>wrote: > Since Richard first poked me about this, I...
2024 Jun 12
2
[PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object
Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object. This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp. This is needed so that we can retain DMA buffers even after the nvkm_gsp object is deleted. Signed-off-by: Timur Tabi <ttabi at nvidia.com> --- v2: rebased to drm-misc-next
2014 Mar 19
5
[LLVMdev] [RFC] Add empty() method to iterator_range.
Hi all, As RFCs go this is short and sweet - I think it would be nice to add an empty method to iterator_range. Something like: bool empty() const { return begin() != end(); } My motivation is to make the 'if' test at the start of this common pattern tidier: if (!collection.empty()) // initialization... for (auto& c : collection) // do something for each c. which I think that
2010 Jul 09
8
DO NOT REPLY [Bug 7565] New: --check-point=<TIME> +options.c.patch +generator.c.patch
...FO, verbose > 1 ? " (%d <= %d)\n" : "\n", check_point, attrib.st_mtime ); + } + return DR_NEWER; + //} + /* + DIR *d = opendir(fbuf); + struct dirent *p; + int is_empty = 1; + while ((is_empty>0)&&(p=readdir(d))) { + if (!strcmp(p->d_name, ".") || !strcmp(p->d_name, "..")) continue; + is_empty = 0; + } + closedir(d); + if ((is_em...
2015 May 24
2
[Mesa-dev] [PATCH 07/11] glsl: Add arb_cull_distance support
...rue; > diff --git a/src/glsl/tests/varyings_test.cpp b/src/glsl/tests/varyings_test.cpp > index 4573529..7a962c5 100644 > --- a/src/glsl/tests/varyings_test.cpp > +++ b/src/glsl/tests/varyings_test.cpp > @@ -202,6 +202,33 @@ TEST_F(link_varyings, gl_ClipDistance) > EXPECT_TRUE(is_empty(consumer_interface_inputs)); > } > > +TEST_F(link_varyings, gl_CullDistance) > +{ > + const glsl_type *const array_8_of_float = > + glsl_type::get_array_instance(glsl_type::vec(1), 8); > + > + ir_variable *const culldistance = > + new(mem_ctx) ir_variable...
2024 Jul 29
2
[PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object
Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object. This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp. This is needed so that we can retain DMA buffers even after the nvkm_gsp object is deleted. Signed-off-by: Timur Tabi <ttabi at nvidia.com> v2: added get/put_device calls ---
2024 Sep 10
1
[PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object
Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object. This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp. This is needed so that we can retain DMA buffers even after the nvkm_gsp object is deleted. Signed-off-by: Timur Tabi <ttabi at nvidia.com> --- .../gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 1 +
2024 Oct 03
1
[PATCH 2/2] [v8] drm/nouveau: expose GSP-RM logging buffers via debugfs
...oot.kref, release_root_dentry); > + > + kfree(log->blob_init.data); > + kfree(log->blob_intr.data); > + kfree(log->blob_rm.data); > + kfree(log->blob_pmu.data); > + > + /* We also need to delete the list object */ > + kfree(log); > +} > + > +/** > + * is_empty - return true if the logging buffer was never written to > + * @b: blob wrapper with ->data field pointing to logging buffer > + * > + * The first 64-bit field of loginit, and logintr, and logrm is the 'put' > + * pointer, and it is initialized to 0. It's a dword-based in...
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
...ntrolWithItems_getstring </span><span class="cx"> * "ControlWithItems#get_string_selection":#ControlWithItems_getstringselection </span><span class="lines">@@ -50,8 +41,7 @@ </span><span class="cx"> * "ControlWithItems#is_empty":#ControlWithItems_isempty </span><span class="cx"> * "ControlWithItems#number":#ControlWithItems_number </span><span class="cx"> * "ControlWithItems#select":#ControlWithItems_select </span><del>-* "ControlWithIte...
2018 Sep 11
1
[PATCH] daemon: consider /etc/mdadm/mdadm.conf while inspecting mountpoints.
...device paths listed in /etc/mdadm.conf + (* Generate a map of MD device paths listed in mdadm.conf * to MD device paths in the guestfs appliance. *) let md_map = if mdadm_conf then map_md_devices aug else StringMap.empty in @@ -224,11 +225,13 @@ and map_md_devices aug = if StringMap.is_empty uuid_map then StringMap.empty else ( (* Get all arrays listed in mdadm.conf. *) - let entries = aug_matches_noerrors aug "/files/etc/mdadm.conf/array" in + let entries1 = aug_matches_noerrors aug "/files/etc/mdadm.conf/array" in + let entries2 = aug_matches_noer...