similar to: [PATCH] golang: make API idiomatic so that functions return (<val>, error)

Displaying 20 results from an estimated 200 matches similar to: "[PATCH] golang: make API idiomatic so that functions return (<val>, error)"

2020 Mar 17
0
[PATCH libnbd] Add outline framework for Go language bindings (golang).
This simply compiles, passes tests, but is only able open a handle. This commit does not contain the full bindings. --- Makefile.am | 2 + configure.ac | 32 +++++ generator/GoLang.ml | 116 ++++++++++++++++++ generator/GoLang.mli | 19 +++ generator/Makefile.am
2020 Apr 29
0
golang: panic: runtime error: cgo argument has Go pointer to Go pointer
Hello, when i use libguestfs to ceph rbd by golang, but there has panic: panic: runtime error: cgo argument has Go pointer to Go pointer goroutine 1 [running]: guestfs.(*Guestfs).Add_drive.func11(0xc000010028, 0xcda6a0, 0xc0000d6000, 0xc000090280) /opt/gopath/src/guestfs/guestfs.go:1440 +0xc2 guestfs.(*Guestfs).Add_drive(0xc000010028, 0x7ffd4b5d67ff, 0xd, 0xc00008d9d8, 0x0)
2006 Jun 27
0
More idiomatic way of doing this
Folks, I''m trying to write a validating filter that checks if the user exists and renders XML if not. Most of the controllers will be returning XML on some error or other so I''m including RenderError in ApplicationController. Is my approach a sound one? Also, is there a shorter and more idiomatic way of writing this: if @user.nil? render_user_exists
2006 Jun 30
4
More idiomatic way of writing a filter
Is there a more elegant way of writing this? def verify_user @user = User.find_by_username params[:username] if @user.nil? message = xml.error do |xm| xm.message "User does not exists: #{params[:username]}" end render :xml => message return false else true end end Thanks, Joel --
2006 Feb 19
0
looking for more idiomatic way of doing this
I have proposals and members can vote for them. In my proposal view I have a little div where the currently logged in member can vote: <div id="vote_div" class="vote"> Your vote: <% if @member_vote %> You have voted for this proposal<br /> <%= start_form_tag :action => "delete_vote" %> <%= hidden_field_tag :id,
2006 Feb 08
2
Idiomatic way to change partial''s behavior based on caller
Guys, I have a partial that is shared by many controllers, and this partial has a link that needs to do different things based on which controller calls it. So, the partial looks like this: <!-- _part.rhtml --> <tr> <td><%=part.number%></td> <td><%=part.associated_part_number%></td> <td><%=part.drawings%></td>
2010 May 04
3
Idiomatic looping over list name, value pairs in R
Considering the python code: for k, v in d.items(): do_something(k); do_something_else(v) I have the following for R: for (i in c(1:length(d))) { do_something(names(d[i])); do_something_else(d[[i]]) } This does not seem seems idiomatic. What is the best way of doing the same with R? Thanks. Luis
2008 Feb 25
4
A more idiomatic way to write this
Hello, I have a vector of 1,000,000 numbers and another vector of 1,000 divisors. What I'd like to do is to divide the first 1,000 numbers of the first vector by the first divisor, then the next 1,000 by the second divisor and so on. I came up with this, but I was wondering if there is a more idiomatic, R-like way to write it: x <- ... divs <- ... for (i in seq(from = 1, to = 1000000,
2011 Aug 20
4
[PATCH 1/2] Make xencommons a bit more idiomatic
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> diff -r 8d6edc3d26d2 -r cfb49fe940fd tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 @@ -29,11 +29,9 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -if test
2018 Jun 28
1
[nbdkit PATCH] main: More idiomatic use of getopt_long
Prefer named constants over magic numbers in the 'struct option' list, and expand the list of enums for long-only options so that the call to getopt_long() can switch directly to every option, rather than needing a lengthy if/else chain that grows for every new long option. Patch best viewed with whitespace changes ignored. Signed-off-by: Eric Blake <eblake@redhat.com> ---
2007 Aug 23
4
Idiomatic way to do a non-database Enumeration?
I have a class which stores as one of its attributes a day of the week as an integer (0-6, 0=Sunday, standard UNIXy values). I want, obviously, the views to show the weekday name and the forms to provide a drop-down with the weekday names. Essentially it''s a vrtual attribute whose value is the localized weekday name, which maps to the integer value that''s actually stored.
2011 Jul 15
1
validate survival with val.surv
Dear R users: I want to externally validate a model with val.surv. Can I use only calculated survival (at 1 year) and actual survival? Or I needed the survival function and actual survival. Thanks *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* [[alternative HTML version deleted]]
2012 Oct 03
0
[klibc:master] [PATCH] fix ARM longjmp with zero 'val'.
Commit-ID: f05ff116bb9edbbb81d82fa47b78e630ce878470 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=f05ff116bb9edbbb81d82fa47b78e630ce878470 Author: Bill Pringlemeir <bpringle at sympatico.ca> AuthorDate: Tue, 2 Oct 2012 13:29:52 -0400 Committer: maximilian attems <max at stro.at> CommitDate: Wed, 3 Oct 2012 18:41:43 +0200 [klibc] [PATCH] fix ARM longjmp
2011 Aug 20
1
val.surv
 Dear R-users,   I  have two questions regarding validation and calibration of Survival regression models.   1.  I am trying to calibrate and validate a cox model using val.surv. here is my code:  f.1<-cph(Surv(time,event)~age, x=T, y=T, data=train)  test1<-test[,"age"]  val.surv(f.1, newdata=data.frame(test1), u=10)    but I get an error message:    Error in val.surv(f.1, newdata
2007 Dec 17
0
odd error messages coming from val.prob() {Design}
Hi, after upgrading my R install from 2.5 -> 2.6.1 and performing multiple iterations of update.packages(), I am getting an odd error when trying to plot a calibration curve from the val.prob() function in package Design. when running this function (which used to work) I get the following error message: Error in .C("lowess", x = as.double(xy$x[o]), as.double(xy$y[o]), n,
2007 Feb 21
0
japanese chars output as "?????" or garbage val in rails app
Guys, In my rails app the japanese chars output as "?????" or garbage value. I have searched the forum get some help but I am not clear about the tropic I use InstantRails 1.4, In the package mysql version is 4.1.9. So please help me in the points 0.What will be the mysql(version 4.1.9) collation? (I used latin1_swedish_ci) 1. any change in database.yml configuration? 2. What
2016 Apr 28
0
Snowfall - Error in checkForRemoteErrors(val) with sfClusterApplyLB()
Hello, I'm trying to run a code that uses the snowfall package. Here is the structure of my code. sfInit(parallel=T, cpus = 5, slaveOutfile="ErrorMessage.txt") sfExportAll() sfLibrary(rgdal) sfLibrary(raster) sfLibrary(sp) sfLibrary(rgeos) sfLibrary(snowfall) system.time( sfClusterApplyLB(1:10, function(k) { sfCat(paste("Iteration ", k),
2017 Dec 14
0
Xen PV DomU running Kernel 4.14.5-1.el7.elrepo.x86_64: xl -v vcpu-set <domU> <val> triggers domU kernel WARNING, then domU becomes unresponsive
On Mon, Dec 11, 2017 at 4:52 PM, Adi Pircalabu <adi at ddns.com.au> wrote: > Has anyone seen this recently? I couldn't replicate it on: > - CentOS 6 running kernel-2.6.32-696.16.1.el6.x86_64, > kernel-lt-4.4.105-1.el6.elrepo.x86_64 > - CentOS 7 running 4.9.67-1.el7.centos.x86_64 > > But I can replicate it consistently running "xl -v vcpu-set <domU>
2010 Aug 13
1
val.prob in the Design package - Calibrated Brier Score
Hello, I am using the val.prob function in the Design package. I understand how the Brier quadratic error score is calculated, but I do not know how the Brier score computed on the calibrated rather than raw predicted probabilities (B cal) is calculated. My question is: how are the calibrated probabilities calculated? Any explanation of this, or references to explanations of this, would be
2012 May 22
0
Interpreting output from the val.prob function in the rms package
Dear mail-list, I have used the val.prob function from the rms package to validate a logistic regression model. It is however not clear to me how to interpret the two different curves that are generated (logistic vs. nonparametric). The documentation doesn't enter into any detail on this point, and to a non-statistician like myself it isn't obvious. If I compare the output to that of the