Displaying 20 results from an estimated 47 matches for "is_null".
2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
...Function::isVarArg()
Driver code:
val make_constant : unit -> llconstant t
val make_global_variable : unit -> llglobalvariable t
val make_function : unit -> llfunction t
(* typesafe *)
value_name (make_constant ());;
value_name (make_global_variable ());;
value_name (make_function ());;
is_null (make_constant ());;
is_declaration (make_global_variable ());;
is_declaration (make_function ());;
is_global_constant (make_global_variable ());;
is_var_arg (make_function ());;
(* type errors *)
is_null (make_global_variable ());;
is_null (make_function ());;
is_declaration (make_constant ());;...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick,
On 2008-03-15, at 04:03, Erick Tryzelaar wrote:
> I was talking to Gordon on #llvm earlier, and he challenged me with
> coming up with a way to improve the ocaml binding's type safety. I
> think I got an easy solution with phantom types.
This could be a good step. I'm not sure I can predict all of the
implications; I'd suggest you work up a proof of concept.
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
...nectionAdapters::Column
def required?
@required
end
end
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
alias_method :_real_columns, :columns
def columns( table_name, name=nil )
cols = _real_columns( table_name, name )
cols.each{ |col|
sql = "select is_nullable from information_schema.columns where
table_name=''#{table_name}'' and column_name=''#{col.name}''"
col_is_required = nil
log(sql, nil, @connection) { |connection| col_is_required =
connection.query(sql)[0][0].downcase != ''yes'...
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with
coming up with a way to improve the ocaml binding's type safety. We
can't go letting haskell beat us now, can we? I think I got an easy
solution with phantom types.
For those who don't know what the problem is, the ocaml bindings share
one type between whole class branches (like values). This means we
need to downcast
2019 Jun 27
0
[PATCH 2/9] Rust bindings: Add create / close functions
...self.create_no_close_on_exit_flag {
+ GUESTFS_CREATE_NO_CLOSE_ON_EXIT
+ } else {
+ 0
+ };
+ flag
+ }
+}
+
+impl Handle {
+ pub fn create() -> Result<Handle, &'static str> {
+ let g = unsafe { guestfs_create() };
+ if g.is_null() {
+ Err(\"failed to create guestfs handle\")
+ } else {
+ Ok(Handle { g })
+ }
+ }
+
+ pub fn create_flags(flags: CreateFlags) -> Result<Handle, &'static str> {
+ let g = unsafe { guestfs_create_flags(flags.to_libc_int())...
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...NullTerminatedIter<T> {
+ fn new(p: *const T) -> NullTerminatedIter<T> {
+ NullTerminatedIter{ p }
+ }
+}
+
+impl<T: Copy + Clone> Iterator for NullTerminatedIter<T> {
+ type Item = T;
+ fn next(&mut self) -> Option<T> {
+ if self.p.is_null() {
+ None
+ } else {
+ let r = unsafe { *(self.p) };
+ self.p = unsafe { self.p.offset(1) };
+ Some(r)
+ }
+ }
+}
+
fn arg_string_list (v: &Vec<String>) -> Vec<*const i8> {
let length = v.len();
let mut w =...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
...lue = [ `Value ]
> type llconstant = [ llvalue | `Constant ]
> type llglobalvalue = [ llvalue | `GlobalValue ]
> type llglobalvariable = [ llglobalvalue | `GlobalVariable ]
> type llfunction = [ llglobalvalue | `Function ]
>
> val value_name : [> `Value] t -> string
> val is_null : [> `Constant] t -> bool
> val is_declaration : [> `GlobalValue] t -> bool
> val is_global_constant : [> `GlobalVariable] t -> bool
> val is_var_arg : [> `Function] t -> bool
Ah, I get it now. type b = [ a | `B ] is idiomatic type theoretician
for b t is a subc...
2010 Nov 25
1
RODBC
...gt; <NA> 8
NA
3 10 1 <NA> <NA> 4
NA
4 10 1 <NA> <NA> 4
NA
5 2 1 <NA> <NA> 8
NA
CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE ORDINAL
1 510 1 YES 1
2 NA 2 YES 2
3 NA 3 YES 3
4 NA 4 YES 4
5 NA 5 YES...
2005 Aug 17
1
RODBC and sqlColumns
...TABLE_QUALIFIER TABLE_OWNER TABLE_NAME COLUMN_NAME
DATA_TYPE
[6] TYPE_NAME PRECISION LENGTH SCALE
RADIX
[11] NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE
SQL_DATETIME_SUB
[16] CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE DISPLAY_SIZE
FIELD_TYPE
<0 rows> (or 0-length row.names)
But there is no test table defined anywhere else but the X schema. If I
do sqlSave(db,aDataFrame,"X.test",T,F), it says test already defined. If
I change the aDataFrame to be different than the fields actual...
2019 Aug 05
0
[PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...u64]) + 'a>>,
+ >,
}
-impl Handle {
- pub fn create() -> Result<Handle, error::Error> {
+impl<'a> Handle<'a> {
+ pub fn create() -> Result<Handle<'a>, error::Error> {
let g = unsafe { guestfs_create() };
if g.is_null() {
Err(error::Error::Create)
} else {
- Ok(Handle { g })
+ let callbacks = collections::HashMap::new();
+ Ok(Handle { g, callbacks })
}
}
- pub fn create_flags(flags: CreateFlags) -> Result<Handle, error::Error> {
+...
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...NullTerminatedIter{ p }
+ fn new(p: *const *const T) -> NullTerminatedIter<T> {
+ NullTerminatedIter { p }
}
}
impl<T: Copy + Clone> Iterator for NullTerminatedIter<T> {
- type Item = T;
- fn next(&mut self) -> Option<T> {
- if self.p.is_null() {
+ type Item = *const T;
+ fn next(&mut self) -> Option<*const T> {
+ let r = unsafe { *(self.p) };
+ if r.is_null() {
None
} else {
- let r = unsafe { *(self.p) };
self.p = unsafe { self.p.offset(1) };
S...
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...mp;[u64]) + 'a>,
+ >,
}
-impl Handle {
- pub fn create() -> Result<Handle, error::Error> {
+impl<'a> Handle<'a> {
+ pub fn create() -> Result<Handle<'a>, error::Error> {
let g = unsafe { guestfs_create() };
if g.is_null() {
Err(error::Error::Create)
} else {
- Ok(Handle { g })
+ let callbacks = collections::HashMap::new();
+ Ok(Handle { g, callbacks })
}
}
- pub fn create_flags(flags: CreateFlags) -> Result<Handle, error::Error> {
+...
2018 Feb 26
0
Parallel assignments and goto
...-> acc,
? ? ? ? ? CONS(car, cdr) -> llength(cdr, acc + 1))
}
The tail-recursion I get out of transforming this function looks like this:
llength_tr <- function (llist, acc = 0) {
? ? .tailr_env <- rlang::get_env()
? ? callCC(function(escape) {
? ? ? ? repeat {
? ? ? ? ? ? if (!rlang::is_null(..match_env <- test_pattern(llist,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? NIL)))
? ? ? ? ? ? ? ? with(..match_env, escape(acc))
? ? ? ? ? ? else if (!rlang::is_null(..match_env <-
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?test_pattern(llist, CONS(car, cdr))))
? ? ? ? ? ? ? ?...
2018 Feb 27
2
Parallel assignments and goto
...llength(cdr, acc + 1))
> }
>
> The tail-recursion I get out of transforming this function looks like this:
>
> llength_tr <- function (llist, acc = 0) {
> ? ? .tailr_env <- rlang::get_env()
> ? ? callCC(function(escape) {
> ? ? ? ? repeat {
> ? ? ? ? ? ? if (!rlang::is_null(..match_env <- test_pattern(llist,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? NIL)))
> ? ? ? ? ? ? ? ? with(..match_env, escape(acc))
>
> ? ? ? ? ? ? else if (!rlang::is_null(..match_env <-
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?test_pattern(llist, CONS(car,...
2018 Feb 27
0
Parallel assignments and goto
...> The tail-recursion I get out of transforming this function looks like
> this:
> >
> > llength_tr <- function (llist, acc = 0) {
> > .tailr_env <- rlang::get_env()
> > callCC(function(escape) {
> > repeat {
> > if (!rlang::is_null(..match_env <- test_pattern(llist,
> > NIL)))
> > with(..match_env, escape(acc))
> >
> > else if (!rlang::is_null(..match_env <-
> > test_...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
...ented why it was changed.
>
> > +pub fn event_to_string(events: &[guestfs::Event]) -> Result<String,
> error::Error> {
> > + let bitmask = events_to_bitmask(events);
> > +
> > + let r = unsafe { guestfs_event_to_string(bitmask) };
> > + if r.is_null() {
> > + Err(error::unix_error("event_to_string"))
> > + } else {
> > + let s = unsafe { ffi::CStr::from_ptr(r) };
> > + let s = s.to_str()?.to_string();
>
> These two look like utils::char_ptr_to_string().
>
> > diff --git a...
2019 Jun 27
4
Re: [PATCH 9/9] Rust bindings: Complete bindings
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be
better to spend some time with git rebase -i trying to work this into
more coherent patches.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live
2017 May 05
0
[PATCH v1] ACPI: Switch to use generic UUID API
On Fri, May 05, 2017 at 12:50:31PM +0300, Amir Goldstein wrote:
> To complete the picture for folks not cc'ed on my patches,
> xfs use case suggests there is also justification for the additional helpers:
>
> uuid_is_null() / uuid_equal()
> guid_is_null() / guid_equal()
The is_null is useful and I bet we'll find other instances. I'm
not sure _equals really adds much value over the existing _cmp
helpers, but on the other hand they are so trivial that we might as
well add them.
The other thing XFS has is...
2017 May 05
1
[PATCH v1] ACPI: Switch to use generic UUID API
...p() / uuid_copy() / uuid_to_bin() / etc
> guid_cmp() / guid_copy() / guid_to_bin() / etc
>
> Correct? Christoph?
>
That looks right to me.
To complete the picture for folks not cc'ed on my patches,
xfs use case suggests there is also justification for the additional helpers:
uuid_is_null() / uuid_equal()
guid_is_null() / guid_equal()
Cheers,
Amir.
2006 Jan 19
0
db_schema_dump for SQL Server
...th the SQL Server adapter and not issues with
me :)
1) Fields are not properly setup with proper null settings (:null => true /
false). I''m wondering if we need to update the def columns method in
activerecord/lib/activerecord/connection_adapters/sqlserver_adapter.rb to
include "IS_NULLABLE as NULL" in the sql we use to retrieve the columns so
that the following line in schema_dumper.rb will work: "tbl.print ", :null
=> false" if !column.null". That''s a total guess and I''m new to Rails so am
not exactly sure how to figure out if that...