Search Results

Search found 1864 results on 75 pages for 'optional'.

Page 39/75 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Advanced command line argument parsing in Java?

    - by Bishop87
    Does anyone have any java examples for parsing a series of command line arguements in a robust way? I'm looking to be able to handle something like: java myapp [-l language] [-d int] [-f file1 file2 file3] I want to do this in a robust way so I can provide logical error messages to the user if they mistake a command line-option. Some of these options I'd like to make optional, etc, etc. Also, the -f file list should be able to handle a list of files. Is there some library out there to assist me in handling this?

    Read the article

  • Overriding events of excel sheet using VBA

    - by Rashmi Pandit
    Hi, I need to programmatically override the following events of a worksheet: BeforeDoubleClick SelectionChange BeforeRightClick I have been able to override the OnActivate event using the following code: sheet.OnSheetActivate = "MyOwn_Activate" Private Sub MyOwn_Activate() myForm.Show End Sub I have implemented BeforeDoubleClick on similar lines: sheet.OnDoubleClick = "My_BeforeDoubleClick" Private Sub My_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) ... End Sub However, an 'argument not optional' error is thrown at run-time when user double clicks a cell on the sheet. Can someone please suggest how should I pass the paramters? In addition, I am not able to find event names for SelectionChange & BeforeRightClick. I tried: sheet.BeforeRightClick = "My_BeforeRightClick" sheet.SelectionChange = "My_SelectionChange" But, both the above lines do not work. Any help/ suggestion is greatly appreciated. Thanks :)

    Read the article

  • MVC MapPageRoute and ActionLink

    - by Dismissile
    I have created a page route so I can integrate my MVC application with a few WebForms pages that exist in my project: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // register the report routes routes.MapPageRoute("ReportTest", "reports/test", "~/WebForms/Test.aspx" ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } This has created a problem whenever I use Html.ActionLink in my Views: <%: Html.ActionLink("Home", "Index", "Home") %> When I load the page in the browser the link appears like: http://localhost:12345/reports/test?action=Index&controller=Home Has anyone run into this before? How can I fix this?

    Read the article

  • Does Ivy's url resolver support transitive retrieval?

    - by Sean
    For some reason I can't seem to resolve the dependencies of my dependencies when using a url resolver to specify a repository's location. However, when using the ibiblio resolver, I am able to retrieve them. For example: <!-- Ivy File --> <ivy-module version="1.0"> <info organisation="org.apache" module="chained-resolvers"/> <dependencies> <dependency org="commons-lang" name="commons-lang" rev="2.0" conf="default"/> <dependency org="checkstyle" name="checkstyle" rev="5.0"/> </dependencies> </ivy-module> <!-- ivysettings file --> <ivysettings> <settings defaultResolver="chained"/> <resolvers> <chain name="chained"> <url name="custom-repo"> <ivy pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/ivy-[revision].xml"/> <artifact pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/> </url> <url name="ibiblio-mirror" m2compatible="true"> <artifact pattern="http://mirrors.ibiblio.org/pub/mirrors/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> </url> <ibiblio name="ibiblio" m2compatible="true"/> </chain> </resolvers> </ivysettings> <!-- checkstyle ivy.xml file generated from pom via ivy:install task --> <?xml version="1.0" encoding="UTF-8"?> <ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="checkstyle" module="checkstyle" revision="5.0" status="release" publication="20090509202448" namespace="maven2" > <license name="GNU Lesser General Public License" url="http://www.gnu.org/licenses/lgpl.txt" /> <description homepage="http://checkstyle.sourceforge.net/"> Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard </description> </info> <configurations> <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/> <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/> <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/> <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/> <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/> <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/> <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/> <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/> <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/> <conf name="optional" visibility="public" description="contains all optional dependencies"/> </configurations> <publications> <artifact name="checkstyle" type="jar" ext="jar" conf="master"/> </publications> <dependencies> <dependency org="antlr" name="antlr" rev="2.7.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-beanutils-core" rev="1.7.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-cli" rev="1.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-logging" rev="1.0.3" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="com.google.collections" name="google-collections" rev="0.9" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> </dependencies> </ivy-module> Using the "ibiblio" resolver I have no problem resolving my project's two dependencies (commons-lang 2.0 and checkstyle 5.0) and checkstyle's dependencies. However, when attempting to exclusively use the "custom-repo" or "ibiblio-mirror" resolvers, I am able to resolve my project's two explicitly defined dependencies, but not checkstyle's dependencies. Is this possible? Any help would be greatly appreciated.

    Read the article

  • Logic for controll concurrent in block or funciton

    - by Hlex
    1)My environment is web application, I accept large request from selvets. A) In some block/method i want to control concurrent to not greater than 5 B) if there are 5 request in that block , the new coming must wait up to 60 second then throws error C) if there are sleep/waiting request most then 30,throws error How I do this? 2)(Optional Question) from above I have to distribute control logic to all clustered host. I plan to use hazelcast to share the control logic (e.g. current counter) I see they provide BlockingQueue & ExectorService but I have no idea how to use in my case. Please recommend if you have idea.

    Read the article

  • Effects of the `extern` keyword on C functions

    - by Elazar Leibovich
    In C I did not notice any effect of the extern keyword used before function declaration. At first I thougth that when defining extern int f(); in a single file forces you to implement it outside of the files scope, however I found out that both extern int f(); int f() {return 0;} And extern int f() {return 0;} Compiles just fine, with no warnings from gcc. I used gcc -Wall -ansi, he wouldn't even accept // comments. Are there any effects for using extern before function definitions? Or is it just an optional keyword with no side effects for functions. In the latter case I don't understand why did the standard designers chose to litter the grammar with superfluous keywords. EDIT: to clarify, I know there's usage for extern in variables, but I'm only asking about extern in functions.

    Read the article

  • Custom tool error: Command.proto:11:18: "Message2" is not defined.

    - by cornerback84
    I am using the latest version of protobuf-net with VS2008 integration. I have created 2 messages (Message1 and Message2), 1 message in 1 proto file. When I try to reference Message2 in Message1 the code generator tool gives me error "Message2" is not defined and won't generate the code file. The package for both messages is same. It look like that because of the integration of the tool with VS2008 it expects all the messages in same .proto file to compile. Currently I have to paste an empty message with same name in Message1.proto file, like this: message Message1 { optional Message2 message2 = 1; } message Message2 { } And then later on remove the declaration of class Message2 from Message1.cs. Are there any settings that I need to do so to avoid this error, or is providing an empty declaration the only way?

    Read the article

  • Named arguments in Mathematica.

    - by dreeves
    What's the best/canonical way to define a function with optional named arguments? To make it concrete, let's create a function foo with named arguments a, b, and c, which default to 1, 2, and 3, respectively. For comparison, here's a version of foo with positional arguments: foo[a_:1, b_:2, c_:3] := bar[a,b,c] Here is sample input and output for the named-arguments version of foo: foo[] --> bar[1,2,3] foo[b->7] --> bar[1,7,3] foo[a->6, b->7, c->8] --> bar[6,7,8] It should of course also be easy to have positional arguments before the named arguments.

    Read the article

  • Distributing WPF apps to a legacy user base: How seamless is it?

    - by Christian Nunciato
    I'm considering developing a WPF application, to be hosted by a legacy Windows app (C++), and I'm trying to get a better sense of how feasible it'll be to do so, given the broad user base I'm targeting. Knowing WPF targets .NET 3.5, I'm looking for some insight as to what the field looks like right now -- who's already got the runtime, whether it's distributed by Windows Update, if so, how (e.g., as an optional or required download, to which operating systems, etc.), whether XP pre-XP2 supports it (and how), and so on. The current version's got many thousands of users, using all manner of Windows operating systems, and while I'd very much like to leverage WPF to breathe some life into their user experience, I want to make sure I'm not shutting anyone out by doing so, or burdening them with a download they might have to do manually. I realize most, or all, of this information's out there already, in various places, but I figured I'd ask here first, since I'm sure some of you've probably already gone down this road and have valuable experiences to share. Thanks in advance!

    Read the article

  • Click Once doesn't create StartMenu entry and Shortcut on Windows 7 x64

    - by MadBoy
    I've application that I deploy to share with ClickOnce so other users can install it and use it on their own machines. It worked fine till i noticed that when i install this app on my own machine (Windows 7 x 64) it doesn't add StartMenu (even thou it installs correctly and I have it in Control Panel / Programs). I didn't had that problem when my development machine was Windows XP. Application also deploys fine on other Windows XP computers. Also during installation (when i rerun setup) even thou I already have Net Framework 3.5 it always wants to install one (it starts that and terminates few seconds later - probably installer sees that it's already there). I can run application straigit from share just a bit of pain to do it. Are there some special settings I should do? Or some patches? I have Visual Studio 2008 and system with all optional updates installed. Application is written in C# and uses NET 3.5.

    Read the article

  • Windsor Container: How to specify a public property should not be filled by the container?

    - by George Mauer
    When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular dependency which causes my application to hang. How can I explicitly tell Castle Windsor that it should not be trying to satisfy a public property? I assume there must be an attribute to that extent. I can't find it however so please let me know the appropriate namespace/assembly. If there is any way to do this without attributes (such as Xml Configuration or configuration via code) that would be preferable since the specific library where this is happening has to date not needed a dependency on castle.

    Read the article

  • ruby on rails group by with null values problem

    - by winter sun
    I have an hour table in witch I store user time tracking information, the table consists from the following cells project_id task_id (optional can be null) worker_id reported_date working_hours each worker enters sevral records per day so generally the table is looking like this id project_id worker_id task_id reported_date working hours; == =========== ========= ========= ============= ============== 1 1 1 1 10/10/2011 4 2 1 1 1 10/10/2011 14 3 1 1 10/10/2011 4 4 1 1 10/10/2011 14 the task_id is not a must field so there can be times when the user is not selecting it and ther task_id cell is empty now i need to display the data by using group by clouse so the resualt will be somthing like this project_id worker_id task_id working hours ========== ========= ========= ============== 1 1 1 18 1 1 18 I did the folowing group by condition @group_hours=Hour.group('project_id,worker_id,task_id)').select('project_id, task_id ,worker_id,sum(working_hours)as working_hours_sum') My view looks like this <% @group_hours.each do |b| % <%= b.project.name if b.project % <%= b.worker.First_name if b.worker % <%= b.task.name if b.task % <%= b.working_hours_sum % <%end% This it is working but only if the task_id is not null when task id is null it present all the records without grouping them like this project_id worker_id task_id working hours =========== ========= ========= ============== 1 1 1 18 1 1 4 1 1 14 I will appreciate any kind of solution to this problem

    Read the article

  • Fabfiles With Command Line Arguments

    - by phasetwenty
    Is there a clean way to have your fabfile take command line arguments? I'm writing an installation script for a tool that I want to be able to specify an optional target directory via the command line. I wrote some code to test what would happen if I passed in some command line arguments: # fabfile.py import sys def install(): _get_options() def _get_options(): print repr(sys.argv[1:]) A couple of runs: $ fab install ['install'] Done. $ fab install --electric-boogaloo Usage: fab [options] <command>[:arg1,arg2=val2,host=foo,hosts='h1;h2',...] ... fab: error: no such option: --electric-boogaloo

    Read the article

  • ISBNdb Retrieving and Managing Info

    - by Pierre Sylvestre
    Given a set of databases how can one you get information on a book with given price first (which consist of the average of a hidden list of prices coming from different web site) and followed by an optional second option that shows the list of the different web site with their page? To take an example given a query for ISBN 9785554443331 - it returns "Chemistry the central science 11 edition" : new:$50 used good condition:$35 used poor condition:$20 If the return does not match with our product list an option to "click here to visit our partner" appears and which returns: Atextbook: $10 Btextbook: $10 Ctextbook: $9 Dtextbook: $8.50 I understand that the first search would be done simultaneous on the web and our database to determine whether or not we have the book and the web to get the average of the price of a given list of web site. Thank you in advance for the help

    Read the article

  • How sophisticated should be DAL?

    - by Andrew Florko
    Basically, DAL (Data Access Layer) should provide simple CRUD (Create/Read/Update/Delete) methods but I always have a temptation to create more sophisticated methods in order to minimize database access roundtrips from Business Logic Layer. What do you think about following extensions to CRUD (most of them are OK I suppose): Read: GetById, GetByName, GetPaged, GetByFilter... e.t.c. methods Create: GetOrCreate methods (model entity is returned from DB or created if not found and returned), Create(lots-of-relations) instead of Create and multiple AssignTo methods calls Update: Merge methods (entities list are updated, created and deleted in one call) Delete: Delete(bool children) - optional children delete, Cleanup methods Where do you usually implement Entity Cache capabilities? DAL or BLL? (My choice is BLL, but I have seen DAL implementations also) Where is the boundary when you decide: this operation is too specific so I should implement it in Business Logic Layer as DAL multiple calls? I often found insufficient BLL operations that were implemented in dozen database roundtrips because developer was afraid to create a bit more sophisticated DAL. Thank you in advance!

    Read the article

  • LinkedIn / Twitter / Facebook as OAuth and OpenId use

    - by monkeylee
    Firstly I understand OpenId is for authentication and OAuth is for authorisation and unlike other questions on the site I am not asking which should be used for which but if anyone can advise a solution for my issue. I want to allow users to login to my site via their LinkedIn/Twitter/Facebook account once logged in say via LinkedIn they could also then authorise their Twitter and Facebook account as a optional login method. This would allow the user to authenticate via any of the three but end up with their user account on my site as the end result. I also want to use the authorisation they have provided to get basic user details (profile pic/name etc) and post status updates. I don't want to ask a user to login with their account via openId then have to authorise the same account again via oauth to allow my site to publish to their service feed and have to do this for each of the 3 services. Any ideas or issues to this issue Lee

    Read the article

  • Core Data Null Relationship

    - by Dylan Copeland
    I have a to-one relationship in my data model with Core Data. I'm trying to set the value of the relationship but Core Data keeps thinking that it's nil. The "creatorUser" relationship is not optional, so when I go to save my managed object context, Core Data gives errors because it thinks the "creatorUser" is nil. Any help would be greatly advised. NSManagedObject *teamManagedObject = [NSEntityDescription insertNewObjectForEntityForName:@"DCTeam" inManagedObjectContext:_managedObjectContext]; // Creator Properties NSManagedObject *creator = [self userForID:[ticketInfo objectForKey:@"userid"]]; if (!creator) { creator = [NSEntityDescription insertNewObjectForEntityForName:@"DCUser" inManagedObjectContext:_managedObjectContext]; [creator setValue:[personInfo objectForKey:@"userid"] forKey:@"userid"]; [creator setValue:[personInfo objectForKey:@"creatorName"] forKey:@"name"]; } [teamManagedObject setValue:creator forKey:@"creatorUser"];

    Read the article

  • Why connection in Python's DB-API does not have "begin" operation?

    - by newtover
    Working with cursors in mysql-python I used to call "BEGIN;", "COMMIT;", and "ROLLBACK;" explicitly as follows: try: cursor.execute("BEGIN;") # some statements cursor.execute("COMMIT;") except: cursor.execute("ROLLBACK;") then, I found out that the underlying connection object has the corresponding methods: try: cursor.connection.begin() # some statements cursor.connection.commit() except: cursor.connection.rollback() Inspecting the DB-API PEP I found out that it does not mention the begin() method for the connection object, even for the extensions. Mysql-python, by the way, throws the Deprecation Warning, when you use the method. sqlite3.connection, for example, does not have the methd at all. And the question is why there is no such method in the PEP? Is the statement somehow optional, is it enough to invoke commit() instead?

    Read the article

  • How to define a varying length of the string in XSD pattern?

    - by infant programmer
    The input XML tag must be validated for a pattern which is like this: type : positive int / decimal, minimum length is 0, max length is 12(before decimal point), fraction digits are optional if exist then precision must be 2. This means both positive integer and Decimal numbers(2 digit precision) are allowed. so the acceptable values can be like, null, 0, 0.00, 1234567890, 123456789012, 123456789012.12, invalid values are: 0.000, 1234567890123(13 digits - invalid), The pattern I have designed is: <xs:pattern value="|([0-9]){12}|([0-9]){12}[.][0-9][0-9]"/> The problem with this pattern is, it doesn't allow the number with string-length less than 12, it says "1234567890" is an invalid value, where as it must be allowed!

    Read the article

  • How to set a reference from one object to another?

    - by Tzur Gazit
    Hi, Imagine the obvious model of employees and departments, where each employee must refer to a single department, and each department may have none to many employees. For Employee I have a pointer to Department, and I set its value to the address of the object of the relevant Department. When I try to save the Employee I get an error: 2010-04-07 10:05:22.491 CoreData2[1112:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: Department)' I tried, just for testing, to make the reference from Employee to Department optional, but I get the same result. I'm having my first steps in CoreData so please be as clear and simple as you can. Thanks, Tzur.

    Read the article

  • Can I remove the labels from the bibliography, while keeping them in citations?

    - by Tae
    I'm writing the bibliography of my report with thebibliography environment because I don't need a BibTeX database (or I don't have the time for learn how to customize or write a style). Well, using the optional argument [label] I can specify as I want the cite references are show, for example: \bibitem[PNUD1996]{PNUD1996} PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. So, if I write: in \cite{PNUD1996}. it produces: in [PNUD1996]. But the label also appear in the bibliography: [PNUD1996] PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. Can I to remove the label from the bibliography and keeping it in the reference? I mean, to get: in [PNUD1996]. and PNUD. Desarrollo Humano en Chile 1996. Santiago: PNUD, 1996. Thanks, and sorry for my English :(

    Read the article

  • Localization with separate Language folders within Views

    - by Adrian
    I'm trying to have specific folders for each language in Views. (I know this isn't the best way of doing it but it has to be this way for now) e.g. /Views/EN/User/Edit.aspx /Views/US/User/Edit.aspx These would both use the same controller and model but have different Views for each language. In my Global.asax.cs I have routes.MapRoute( "Default", // Route name "{language}/{controller}/{action}/{id}", // URL with parameters new { language = "en", controller = "Logon", action = "Index", id = UrlParameter.Optional }, // Parameter defaults new { language = @"en|us" } // validation ); This works ok but always points to the same View. If I put the path to the Lanagugage folder it works return View("~/Views/EN/User/Edit.aspx"); but clearly this isn't a very nice way to do it. Is there anyway to get MVC to look in the correct language folder? Thanks and again I know this isn't the best way of doing Localization but I can't use resource files.

    Read the article

  • What database works well with 200+GB of data?

    - by taw
    I've been using mysql (with innodb; on Amazon rds) because it's sort of universal default, but it's been ridiculously under-performing, and tweaking it only delays the inevitable. The data is mostly relatively short (<1kB of bytes each) blobs information about 100Ms of urls. There is (or should be, mysql cannot seem to handle it) very high amount of insert / update / retrieve but few complex queries - not that complex queries wouldn't be useful, but because mysql is so slow that it's far faster to get the data out, process it locally, and cache the results somewhere. I can keep tweaking mysql and throwing more hardware at it, but it seems increasingly futile. So what are the options? SQL/relational model/etc. optional - anything will do as long as it's fast, networked, and language-independent.

    Read the article

  • Limit the model data fields serialized by Web API based on the return type Interface

    - by Stevo3000
    We're updating our architecture to use a single object model for desktop, web and mobile that can be used in the MVVM pattern. I would like to be able to limit the data fields that are serialized through Web API by using interfaces on the controllers. This is required because the model objects for mobile are stored in HTML5 local storage so don't carry optional data while a thin desktop client would be able to store (and work with) more data. To achieve this a model will implement the different interfaces that define which data fields should be serialized and there will be a controller specific to the interface. The problem is that the Web API always serializes every field in the model even if it is not part of the interface being returned. How can we only serialize fields in the returned interface?

    Read the article

  • What is .htaccess RewriteRule best practice?

    - by Pablo
    Is it better to have a single RewriteRule with a bunch of RegEx or multiples Rules with fewer RegEx for the server to query? Will there be any performance differences? Heres is an example a single rule with almost all RegEx groups as optional: RewriteRule ^gallery/?([\w]+)?/?([\w]+)?/?([\d]+)?/?([\w]+)/?$ /gallery.php?$1=$2&start=$3&by=$4 [NC] Here are some of the rules lists that would replace the one above: RewriteRule ^gallery/category/([\w]+)/$ /gallery.php?category=$1& [NC] RewriteRule ^gallery/category/([\w]+)/([\d]+)/$ /gallery.php?category=$1&start=$2 [NC] RewriteRule ^gallery/category/([\w]+)/([\d]+)/([\w]+)/$ /gallery.php?category=$1&start=$2&by=$3 [NC] ... RewriteRule ^gallery/tag/([\w]+)/$ /gallery.php?category=$1& [NC] RewriteRule ^gallery/tag/([\w]+)/([\d]+)/$ /gallery.php?category=$1&start=$2 [NC] RewriteRule ^gallery/tag/([\w]+)/([\d]+)/([\w]+)/$ /gallery.php?category=$1&start=$2&by=$3 [NC] ... I'll be glad to hear your options or personal experiences.

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >