default

Set ORACLE table fields default value to a formular

爷,独闯天下 提交于 2020-01-21 09:02:13
问题 I have an oracle table like this: create table tms_transaction_tbl ( trans_id number primary key, location_id number, trans_date date, resource_id number, ts_id number, max_value number, booked_units number default 0, remaining number default (select max_value-booked_units), booked number not null , user_id number, trans_time timestamp ); as you can see I tried to set default value of remaining to (max_value-booked_units) remainging number default (select max_value-booked_units), but it gives

How to modify the default button state in Android without affecting the pressed and selected states?

ぃ、小莉子 提交于 2020-01-20 08:37:29
问题 I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states. Is there any way to set an ImageButton's background default state's drawable without affecting the pressed and selected states? I've tried to do this with a selector, but it does not appear to allow you to use the default drawables for some states

How to modify the default button state in Android without affecting the pressed and selected states?

烂漫一生 提交于 2020-01-20 08:37:28
问题 I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states. Is there any way to set an ImageButton's background default state's drawable without affecting the pressed and selected states? I've tried to do this with a selector, but it does not appear to allow you to use the default drawables for some states

Is it really impossible to skip template parameters with default arguments in C++, why does syntax suggest otherwise?

南笙酒味 提交于 2020-01-16 04:10:07
问题 I've been trying to find a way to skip a template parameter not located at the end of the template parameter list, in a derived class that has been assigned a default in its base class. I've done some research on this topic, also here on SO. While similar questions have been discussed on SO - many answers basically suggesting it doesn't work were related to very special cases like the hash map case here. Also I found this answer by "Potatoswatter", which in my opinion contradicts the

Can't I define defaults if I define multiple overloaded constructors in Scala?

做~自己de王妃 提交于 2020-01-14 07:15:03
问题 I've defined multiple constructors, with some default argument values in all of them. Looks correct (I can't see any ambiguity), but Scala (2.8) compiler complains: multiple overloaded alternatives of constructor define default arguments Does it mean that I can't define default values for overloaded constructors at all? Let me illustrate the situation (primitivized, of course, but illustrative): class A(subject : Double, factor : Int = 1, doItRight : Boolean = true) { def this (subject : Int,

Can't I define defaults if I define multiple overloaded constructors in Scala?

南笙酒味 提交于 2020-01-14 07:13:17
问题 I've defined multiple constructors, with some default argument values in all of them. Looks correct (I can't see any ambiguity), but Scala (2.8) compiler complains: multiple overloaded alternatives of constructor define default arguments Does it mean that I can't define default values for overloaded constructors at all? Let me illustrate the situation (primitivized, of course, but illustrative): class A(subject : Double, factor : Int = 1, doItRight : Boolean = true) { def this (subject : Int,

How to page multiple plots in R in separate jpeg files?

妖精的绣舞 提交于 2020-01-13 10:24:09
问题 I'd like to plot multiple plots in separate bitmap files using the file name pattern (for example, for JPEG) file.%03d.jpg in R. I tried using something like: somevar <- 1 jpg(paste(sep='',filename,'.%03d.jpg')) while(somevar <= n) { plot(data[somevar]) dev.new() somevar <- somevar + 1 } dev.off() but it creates one .jpg file and several Rplotnnn.pdf files. How can I change the default device to jpg , and use the custom file name pattern? 回答1: I think this should work somevar <- 1 while

variables retaining values after app close

只谈情不闲聊 提交于 2020-01-11 13:49:07
问题 My app is retaining all of the variable values when it closes and this is effecting how it runs when reopened. Is there any way to reset them all upon app close? or is there a way to clean the app from memory when it is closed so to speak? For the moment I have just been setting all of the important variables "=0" in the last few lines of execution but I know there must be a correct way to doing this. EDIT: OK I thought that it would just be easier to reply here instead of individually to

Find default gateway ip address, rather than parsing proc filesystem

落爺英雄遲暮 提交于 2020-01-11 10:02:11
问题 How should I obtain the ip address of default gateway ? Rather than read entries from /proc , is there any standalone API useable ? 回答1: you can use libnl which is a library to communicate with the kernel via NETLINK sockets. a simple example to get the default route would be (please add error checking and the needed headers) void cb_route (struct nl_object *cb, void *arg) { struct rtnl_route *route = (struct rtnl_route*) cb; /* do what you need to do with rtnl_route object * e.g. copy it to

Get Default Value From select field Javascript

自作多情 提交于 2020-01-11 09:42:11
问题 I have a select field that have have present options and I have a php script check a mysql database and add a select tag to the one currently being used. I need to find a way to know if the user have changed the select field or not before submitting it. var Access = document.forms[UIDF]["Access"].value; var DAccess = document.forms[UIDF]["Access"].defaultIndex; <--- This is my problem. I just need to know how to get the selected option value as this keep changing with every user <select name=