search for: is_empty

Displaying 20 results from an estimated 46 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
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
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
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...
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...
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...
2007 Jul 04
0
[1104] trunk/wxruby2: Added 2.8 methods to TextCtrl & document them; tidy up header file
...;> * "TextCtrl#get_value":#TextCtrl_getvalue </span><span class="cx"> * "TextCtrl#hit_test":#TextCtrl_hittest </span><span class="cx"> * "TextCtrl#is_editable":#TextCtrl_iseditable </span><ins>+* "TextCtrl#is_empty":#TextCtrl_isempty </ins><span class="cx"> * "TextCtrl#is_modified":#TextCtrl_ismodified </span><span class="cx"> * "TextCtrl#is_multi_line":#TextCtrl_ismultiline </span><span class="cx"> * "TextCtrl#is_...
2006 Jul 20
5
How can I make has_many prevent a delete that would lead to orphans?
...be fairly easy and built into AR but my hopes of that are fading... Hopefully it''s just that I''ve missed something though. If there is no way to do it that is built into AR how might I mod AR or something to add that functionality? Presumably some kind of call to location.assets.is_empty? to check if the delete is going to be allowed? -Rob -- ------------------------------------------------------ "On two occasions, I have been asked [by members of Parliament], ''Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?''...
2007 Apr 13
0
[956] branches/wxruby2/wxwidgets_282: Additions to TreeCtrl API 2.6->2.8
...reeCtrl#insert_item":#TreeCtrl_insertitem </span><span class="cx"> * "TreeCtrl#insert_item_before":#TreeCtrl_insertitembefore </span><span class="cx"> * "TreeCtrl#is_bold":#TreeCtrl_isbold </span><ins>+* "TreeCtrl#is_empty":#TreeCtrl_isempty </ins><span class="cx"> * "TreeCtrl#is_expanded":#TreeCtrl_isexpanded </span><span class="cx"> * "TreeCtrl#is_selected":#TreeCtrl_isselected </span><span class="cx"> * "TreeCtrl#is_vis...
2017 Jul 24
0
Re: [PATCH] common/mlstdutils: Implement StringSet.
...he GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + *) > + > +type elt = String.t > +type t = Set.Make(String).t > + > +val empty : t > +val is_empty : t -> bool > +val mem : elt -> t -> bool > +val add : elt -> t -> t > +val singleton: elt -> t > +val remove: elt -> t -> t > +val union: t -> t -> t > +val inter: t -> t -> t > +val diff: t -> t -> t > +val compare: t -> t ->...
2014 Mar 19
3
[LLVMdev] [RFC] Add empty() method to iterator_range.
On Mar 19, 2014, at 11:32 AM, Aaron Ballman <aaron at aaronballman.com> wrote: > On Wed, Mar 19, 2014 at 2:13 PM, Lang Hames <lhames at gmail.com> wrote: >> 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();
2017 Feb 02
7
[PATCH 0/6] dib: various improvements
Hi, this series improves virt-dib, adding some upstream changes, and refactoring the handling of output formats. Thanks, Pino Toscano (6): dib: clear up "already provided" message dib: add --checksum dib: pass custom mkfs options after the filesystem type dib: refactor output formats handling dib: clarify "output:" lines in --machine-readable documentation dib:
2014 Sep 17
4
[PATCH 0/2] supermin: use librpm for rpm support
Hi, this work makes supermin use the rpm library instead of invoking rpm directly. This, together with a needed refactoring of the dependency resolution, should help in make supermin faster on rpm-based systems. Surely the patches will still need polishing, especially for behaviours of newly added stuff, but at least it's a good starting point. Noting that you need rpm-devel on most of rpm
2015 May 24
19
[RFC PATCH 00/11] Implement ARB_cull_distance
This patch series adds the needed support for this extension to the various parts of mesa to finally enable it for nvc0. Dave Airlie (1): glsl: lower cull_distance into cull_distance_mesa Tobias Klausmann (10): glapi: add GL_ARB_cull_distance mesa/main: add support for GL_ARB_cull_distance mesa/prog: Add varyings for arb_cull_distance mesa/st: add support for GL_ARB_cull_distance
2019 Aug 14
9
[9.0.0 Release] Release Candidate 2 is here
Hello everyone, 9.0.0-rc2 was tagged yesterday from the release_90 branch at r368683. In the Git monorepo it's available as the llvmorg-9.0.0-rc2 tag. Source code and docs are available at https://prereleases.llvm.org/9.0.0/#rc2 Binaries will be added as they become available. The tag went in roughly one week behind schedule (see "Upcoming Releases" at https://llvm.org), but
2016 Jul 13
6
[PATCH 0/5] Fix SELinux
We can use the setfiles(8) command to relabel the guest filesystem, even though we don't have a policy loaded nor SELinux enabled in the appliance kernel. This also deprecates or removes the old and broken SELinux support. This patch isn't quite complete - I would like to add some tests to the new API. I'm posting here to garner early feedback. Rich.