optional

Coding stored procedure for search screen with multiple, optional criteria

I've got a search screen on which the user can specify any combination of first name, last name, semester, or course. I'm not sure how to optimally code the SQL Server 2005 stored procedure to handle these potentially optional parameters. What's the most efficient way? Separate procedures for each combination? Taking the items in as null...

Optional characters in a regex

The task is pretty simple, but I've not been able to come up with a good solution yet: a string can contain numbers, dashes and pluses, or only numbers. ^[0-9+-]+$ does most of what I need, except when a user enters garbage like "+-+--+" I've not had luck with regular lookahead, since the dashes and pluses could potentially be anywhe...

Optional series in a SSRS chart?

Hi, is it possible to make a series in a chart optional (i.e. only rendered when the user clicks a checkbox, in case the corresponding query takes a while and may not be required)? Or are there any alternative solutions where users can incrementally select the data series/charts they would like to see? ...

Real world examples of @optional protocol methods

I'm learning Objective-C at the moment and have come across optional methods in Protocols. My background is C# and can see a Protocol as something similar to a C# Interface. Where a C# Interface represents a contract, by advertising an Interface you are saying that you will implement the methods defined. With this in mind I'm confused ...

Sybase ASA 9 Stored procedure, use default parameter

I have a stored procedure'test' in Sybase ASA with for example 4 parameters. par1 INT = 0, par2 VARCHAR(50) = NULL, par3 VARCHAR(100) = NULL, par4 VARCHAR(10) = '' Now I want to execute this stored procedure with par1 as its default value. call test(NULL, 'test') But the actual value of par1 i not 0, but 1! I also tried call t...

Optional Readonly Property in VB.Net Interface

I am trying to develop a simple interface for allowing quick lists to be generated from classes. Basically, the interface needs to return an ID and a Name. However, some classes have a calculated name property which is read only, others just use a read/write name property. Basically, all I care is that it has a getter, it does not matter...

[C++] Optional parameter for reference to pointer?

Hi, how do I the second parameter become optional? template <typename T> inline void Delete (T *&MemoryToFree, T *&MemoryToFree2 = ){ delete MemoryToFree; MemoryToFree = NULL; delete MemoryToFree2; MemoryToFree2 = NULL; } I tried several things after the = operator, like NULL, (T*)NULL etc can this be done? the only way the c...

How can I make sure a boost::optional<T> object is initialized in release-build?

When trying to get the value of a boost::optional object, BOOST_ASSERT is used to make sure the object is indeed initialized. But what I would like when dereferencing an uninitialized optional is for an exception to be thrown - is there any way to get this behaviour in a release build? If not, is there any other similar library which h...

emacs interactive function with optional numeric prefix

hello How do I specify a function which has optional numeric prefix, if not, it prompts for a number? basically how goto-line behaves? (defun my-function(&optional n) ; I have tried (interactive "N") ; reads string, no prompt (interactive "p") ; defaults to one (interactive (if (not n) (read-number "N: "))) ; runtime error ...

How can I use an optional array argument in a VBA procedure?

I've got a private procedure in a VBA script for MS Access: Private Sub drawLineDiagram(chartSpace As Variant, title As String, caption As String, x_val() As Variant, y_val() As Variant, Optional y_val2() As Variant = ????) As you see, I want to have an optional last parameter for an array of values. What kind of default parameter mu...

Android: parameters in strings.xml possible?

Hello Folks In my android app i'am going to implement my strings with Internationalization. So currently i got a problem with the grammar and the way sentences build in different languages. For example: "5 minutes ago" - english "vor 5 Minuten" - german So my first question is, can i do smth like this in strings.xml: <stri...

preg_match to match an optional string, but not match all of the string

Take for example the following regex match. preg_match('!^publisher/([A-Za-z0-9\-\_]+)/([0-9]+)/([0-9]{4})-(january|february|march|april|may|june|july|august|september|october|november|december):([0-9]{1,2})-([0-9]{1,2})/([A-Za-z0-9\-\_]+)/([0-9]+)(/page-[0-9]+)?$!', 'publisher/news/1/2010-march:03-23/test_title/1/page-1', $matches); p...

How to make a parameter optional in WSDL?

I have a WebService API which needs 2 of its parameters to be optional in the WSDL public wsProxy[] Insert(wsProxy[] proxies, string loginname, string password, bool returnNewData) { //code here } I need to a way to show loginname and password as optional in the WSDL. Is there any way to do this in C#. Can I maybe add an tag in fr...

How to get SQL Function run a different query and return value from either query?

I need a function, but cannot seem to get it quite right, I have looked at examples here and elsewhere and cannot seem to get this just right, I need an optional item to be included in my query, I have this query (which works): SELECT TOP 100 PERCENT SKU, Description, LEN(CONVERT(VARCHAR (1000),Description)) AS LenDesc FROM tblItem WHER...

SQL optional parameters through VB.net

I've a document search page with three listboxes that allow multiple selections. They're: Category A Year Category B Only category A is mandatory, the others are optional parameters and might be empty. Each document can belong to multiple options in Category A and multiple options Category B but each document only has one year assoc...

F# Optional Record Field

I have a F# record type and want one of the fields to be optional: type legComponents = { shares : int<share> ; price : float<dollar / share> ; totalInvestment : float<dollar> ; } type tradeLeg = { id : int ; tradeId : int ; legActivity : LegActivityType ; actedOn : DateTime ; estimates : legComponents ;...

Regex optional match in python fails

tickettypepat = (r'MIS Notes:.*(//p//)?.*') retype = re.search(tickettypepat,line) if retype: print retype.group(0) print retype.group(1) Given the input. MIS Notes: //p// Can anyone tell me why group(0) is MIS Notes: //p// and group(1) is returning as None? I was originally using regex because, before I ran into problems ...

Makefile: ignore prerequisite if does not exist

Is there any way to say that if prerequisite for the given target doesn't exist then ignore that target? For instance, I have the following set of folders chrome_src_folders := $(chrome_src_folder)/content/* \ $(chrome_src_folder)/locale/* $(chrome_src_folder)/skin/* This is where I use it $(jar_path): $(chrome_sr...

HTML: Include, or exclude, optional closing tags?

Some HTML1 closing tags are optional, i.e.: </HTML> </HEAD> </BODY> </P> </DT> </DD> </LI> </OPTION> </THEAD> </TH> </TBODY> </TR> </TD> </TFOOT> </COLGROUP> Note: Not to be confused with closing tags that are forbidden to be included, i.e.: </IMG> </INPUT> </BR> </HR> </FRAME> </AREA> </BASE> </BASEFONT> </COL> </ISINDEX> </LINK> </...

reading optional attributes from optional setting in javascript

What is the most efficient way of reading optional attributes in an optional setting argument. I'm using something like: f = func(var1, optionalsettings) { var2 = (optionalsettings === undefined ? 0 : (optionalsettings['var2'] == null ? 0 : optionalsettings['var2'])); }; But I've the feeling it can be done more efficient...