Search Results

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

Page 44/75 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • using dummy row with NOT NULL to solve DEFAUT NULL

    - by Tony38
    I know having DEFAULT NULLS is not a good practice but I have many optional lookup values which are FK in the system so to solve this issue here is what i am doing: I use NOT NULL for every FK / lookup valve field. I have the first row in every table which is PK id = 1 as a dummy row with just "none" in all the columns. this way I can use NOT NULL in my schema and if needed reference to the none row values which should be null. Is this a good design or any other work arounds?

    Read the article

  • need help in writing ant target

    - by magic1234
    I am new to writing ant targets. I've to pass 3 arguments from the command line to java program. All these can be optional and can have spaces. How can i do that using ant target. I tried using but if it delimits the arguments by space. So, if my first argument has space then it takes the word after space as second argument. I also tried using It takes spaces but makes the arguments mandatory. Im my java code, i've to set default values for these arguments if any of these is missing. How can i do that.

    Read the article

  • How to show vertical scrollbar only for iframe?

    - by Adham
    The following html code deosn't show the vertical scrollabr . why ? <style> #mapIframe{ min-height:300px; overflow:auto !important; direction:rtl !important; overflow-x:hidden !important; overflow-y:scroll !important; height:100%; //optional, but it can't hurt. } </style> <iframe id="mapIframe" src="aurl" width="300" height="800" frameBorder="0">Browser not compatible.</iframe>

    Read the article

  • Tool to maintain a Data Mapping between two systems

    - by ktaylorjohn
    We have XML interfaces between multiple systems. An Enterprise Domain Model is missing in the overall architecture, hence the terms Product/Customer/User means different things to different systems. We currently use excel sheets to map the elements in incoming XML to what the actual Field means within our system. Additionally, it contains the values of Mandatory/Optional and length of each field. We call this the Data Dictionary. Any changes to the XML go through rounds of deliberation and updates to Word and Excel documents. Is there a better way to do this? Any tool/GUI based approach which all systems and owners can view?

    Read the article

  • parsing command option with default values and range constrains in C

    - by agramfort
    Hi, I need to parse command line arguments in C. My arguments are basically int or float with default values and range constrains. I've started to implement something that look like this: option_float(float* out, int argc, char* argv, char* name, description, float default_val, int is_optional, float min_value, float max_value) which I call for example with: float* pct; option_float(pct, argc, argv, "pct", "My super percentage option", 50, 1, FALSE, 0, 100) however I don't want to reinvent the wheel ! My objective is to have error checking of range constrains, throw an error when the option is not optional and is not set. And generate the help message usually given by usage() function. The usage text would look like this: --pct My super percentage option (default : 50). Should be in [0, 100] I've started with getopt but it is too limited for what I want to do and I feel it still requires me to write too much code for a simple usecase like this. thanks

    Read the article

  • Hosting Private Git repos on my own server?

    - by Stoic
    Hey, I am looking for a way to host private git repos on my own server. I am using Github for Open source projects of mine, but I would prefer to use my own server for storing private git repos. Can someone suggest me on which script should I be using for this purpose. Trac is not what I am looking for, though. I want something that is, preferably PHP based solution (just optional) and esp. something that has an easier UI. Any help is appreciated here.

    Read the article

  • new MyClass(); vs new MyClass;

    - by Bytecode Ninja
    In some JavaScript code snippets (e.g. http://mckoss.com/jscript/object.htm) I have seen objects being created in this way: var obj = new Foo; However, at least at MDC, it seems that the parentheses are not optional when creating an object: var obj = new Foo(); Is the former way of creating objects valid and defined in the ECMA standard? Are there any differences between the former way of creating objects and the later? Is one preferred over the other? Thanks in advance.

    Read the article

  • Accessing CoreData relationships

    - by georgeliquor
    I have the following core data model with two entities: entity "item" which holds name, date, description and a to many relationship "image". image is optional. entity "image" holds url, name and relationship to one item. I load the executed Fetchrequest into this NSArray "entityArray" This is what I do to display my data in a UITableView for example to display title in main cell: NSManagedObject *object = (NSManagedObject *)[entityArray objectAtIndex:indexPath.row]; cell.textLabel.text=[object valueForKey:@"title"]; Now I have no clue how to access my relationship image ([object valueForKey:@"image"]), because it contains more than just a string.

    Read the article

  • In XHR, is it possible to distinguish network errors from cross-origin errors?

    - by greim
    http://www.w3.org/TR/access-control/ Reading the CORS spec linked above, it seems to be the case that it's impossible to reliably distinguish between a generic "network error" and a cross-origin access denied error. From the spec: If there is a network error Apply the network error steps. Perform a resource sharing check. If it returns fail, apply the network error steps. http://www.w3.org/TR/access-control/#simple-cross-origin-request0 In my testing, I couldn't locate any features of Firefox's implementation that seem to indicate that the resource sharing check definitely failed. It just switches readyState to 4 and sets status to 0. Ultimately I'd like the ability to pass a success callback, a general fail callback, and an optional cross-origin fail callback, to my function. Thanks for any help or insight.

    Read the article

  • Multiple column foreign key contraints

    - by eugene4968
    I want to setup table constraints for the following scenario and I’m not sure how to do it or if it’s even possible in SQL Server 2005. I have three tables A,B,C. C is a child of B. B will have a optional foreign key(may be null) referencing A. For performance reasons I also want table C to have the same foreign key reference to table A. The constraint on table C should be that C must reference its parent (B) and also have the same foreign key reference to A as its parent. Anyone have any thoughts on how to do this?

    Read the article

  • implement jquery Plugin add method Validation

    - by Eyla
    I have a problem to use jquery Plugin/Validation. I want to add a method and follow the documentation but I think I still missing some thing. First I add the method but I think I have a problem to implement it. please check my code and advice me. <script src="js/jquery-1.4.1.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { jQuery.validator.addMethod("domain", function(value, element) { return this.optional(element) || /^http:\/\/yahoo.com/.test(value); }, "Please specify the correct domain for your documents"); $("#aspForm").validate(); }); <asp:TextBox ID="TextBox1" runat="server" CssClass="domain" ></asp:TextBox> </script>

    Read the article

  • mysql PHP query question

    - by camran
    Ok, i have a problem here... I am sending values of drop down lists via ajax to this PHP file. Now I want to search a mysql database using these values, which I have managed to do, BUT, only if I set the values to something... Take a look: $query = "SELECT * FROM cars_db WHERE price BETWEEN '$cars_price_from' AND '$cars_price_to' AND year BETWEEN '$cars_year_from' AND '$cars_year_to' AND mileage BETWEEN '$cars_mileage_from' AND '$cars_mileage_to' AND gearbox = '$cars_gearbox' AND fuel = '$cars_fuel'"; now, what if the user doesnt select any "price_from" or "year_from"... The fields are only optional, so if the user doesnt enter any "price from" or "year from", then the user wants ALL cars to show... Do I have to write a query statement for each case or is there another way?

    Read the article

  • High performance distributed asynchronous RPC in java

    - by unludo
    I would like to do RPC to a list of clients with the following requirements: the server does not know the clients (implies a kind of broker?) and the cleints do not know the server there may be several clients - they share the load to treat the RPC The RPC is asynchronous very fast (round-trip < 1ms) optional : offers a fail-over mechanism. It can be done with underlying tools which are not really intended for that (Hazelcast is an example). What would you use for such requirements? Thanks!

    Read the article

  • Flattening hash into string in Ruby

    - by fahadsadah
    Is there a way to flatten a hash into a string, with optional delimiters between keys and values, and key/value pairs? For example, print {:a => :b, :c => :d}.flatten('=','&') should print a=b&c=d I wrote some code to do this, but I was wondering if there was a neater way: class Hash def flatten(keyvaldelimiter, entrydelimiter) string = "" self.each do |key, value| key = "#{entrydelimiter}#{key}" if string != "" #nasty hack string += "#{key}#{keyvaldelimiter}#{value}" end return string end end print {:a => :b, :c => :d}.flatten('=','&') #=> 'c=d&a=b' Thanks

    Read the article

  • Fluent-NHibernate: How does one translate composite-element tag to fnh?

    - by epitka
    How do we express this in FNH? <class name="Order" .... > .... <set name="PurchasedItems" table="purchase_items" lazy="true"> <key column="order_id"> <composite-element class="Purchase"> <property name="PurchaseDate"/> <property name="Price"/> <property name="Quantity"/> <many-to-one name="Item" class="Item"/> <!-- class attribute is optional --> </composite-element> </set>

    Read the article

  • How to convert searchTwitter results (from library(twitteR)) into a data.frame?

    - by analyticsPierce
    I am working on saving twitter search results into a database (SQL Server) and am getting an error when I pull the search results from twitteR. If I execute: library(twitteR) puppy <- as.data.frame(searchTwitter("puppy", session=getCurlHandle(),num=100)) I get an error of: Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class structure("status", package = "twitteR") into a data.frame This is important because in order to use RODBC to add this to a table using sqlSave it needs to be a data.frame. At least that's the error message I got: Error in sqlSave(localSQLServer, puppy, tablename = "puppy_staging", : should be a data frame So does anyone have any suggestions on how to coerce the list to a data.frame or how I can load the list through RODBC?

    Read the article

  • Perl: Greedy nature refuses to work

    - by faezshingeri
    I am trying to replace a string with another string, but the greedy nature doesn't seem to be working for me. Below is my code where "PERFORM GET-APLCY" is identified and replaced properly, but string "PERFORM GET-APLCY-SOI-CVG-WVR" and many other such strings are being replaced by the the replacement string for "PERFORM GET-APLCY". s/PERFORM $func[$i]\.?/# PERFORM $func[$i]\.\n $hash{$func[$i]}/g; where the full stop is optional during string match and replacement. Please help me understand what the issue could be. Thanks in advance, Faez

    Read the article

  • How do I check that an entity is unreferenced in JPA?

    - by Martin
    I have the following model @Entity class Element { @Id int id; @Version int version; @ManyToOne Type type; } @Entity class Type { @Id int id; @Version int version; @OneToMany(mappedBy="type") Collection<Element> elements; @Basic(optional=false) boolean disabled; } and would like to allow Type.disabled = true only if Type.elements is empty. Is there a way to do it atomically? I would like to prevent an insertion of an Element in a transaction while the corresponding Type is being disabled by an other transaction.

    Read the article

  • correct technical term for this pattern

    - by Oliver A.
    sometimes I use a pattern which is very similar to the singleton pattern: There is one default instance which and a static get method to aces it. But you may create other instances and pass it as optional parameter and if you want to and you can even replace the default instance with a instance from a child class. So it is NO SINGLETON at all but it is used like one singleton in most cases. Anyone got an idea who to call something like this ? Maybe half*** singleton? domiton?

    Read the article

  • jQuery click listener on <object> in IE failing

    - by Steve Meisner
    $("#listView object.modal").click(function(){ // Get the ID of the clicked link: var link = $(this).closest("h2").attr("title"); var id = $(this).closest("div").attr("id"); showDialog(link, id); return false; }); This fires a modal (jQuery UI). It it working in FF, Chrome/Safari but not in IE 7/8. Is there something I'm missing here? Big Picture: We're using a swf to render custom type and there is a link in the rendered (flash) content. We're hoping to catch the link action in the jQuery listener so we don't have to extend our swf have an optional param to return false on link click. We thought we got around it, until IE testing commenced... Let me know if any more info is needed. Thanks!

    Read the article

  • Optimal search queries

    - by Macros
    Following on from my last question http://stackoverflow.com/questions/2788082/sql-server-query-performance, and discovering that my method of allowing optional parameters in a search query is sub optimal, does anyone have guidelines on how to approach this? For example, say I have an application table, a customer table and a contact details table, and I want to create an SP which allows searching on some, none or all of surname, homephone, mobile and app ID, I may use something like the following: select * from application a inner join customer c on a.customerid = a.id left join contact hp on (c.id = hp.customerid and hp.contacttype = 'homephone') left join contact mob on (c.id = mob.customerid and mob.contacttype = 'mobile') where (a.ID = @ID or @ID is null) and (c.Surname = @Surname or @Surname is null) and (HP.phonenumber = @Homphone or @Homephone is null) and (MOB.phonenumber = @Mobile or @Mobile is null) The schema used above isn't real, and I wouldn't be using select * in a real world scenario, it is the construction of the where clause I am interested in. Is there a better approach, either dynamic sql or an alternative which can achieve the same result, without the need for many nested conditionals. Some SPs may have 10 - 15 criteria used in this way

    Read the article

  • Unit Testing Example, on a class with required fields?

    - by Mastro
    I'm new to developing Unit test and I can't find an example of how to test an existing class I have. The class has a save method which does an insert or update in the database when the user clicks Save in the UI. But the save method has required fields that need to be populated. And has other fields that do not. So how can I run this test properly? Was trying to write it out.. Give a user When user saves object Then Field1 is required then Field2 is required Then Field3 is required WhenUserSavesObject() object = new object object.field1 IsNot Nothing something like that right? And what about the other fields that are optional? How would I test the save method to make sure it takes all those values properly? Was trying to use BDD but not sure if I should try it or not. Can't find any example of classes with many properties that are needed when calling a test method.

    Read the article

  • Calling a method on a Object says "disallows late binding"

    - by Maury Markowitz
    I have a calls called DtaDate that stores an integer "key", a string name, a string for the date, and a Date object that is created from that string. I have some code that needs to accept a date-like object. I'd like the user to be able to pass in anything date like - a Date object which I'll extract the information from, another DtaDate, a string with the date in it, or even the key, which I'll use to look up the DtaDate from a collection. So I have this: Friend Sub New(NameIn As String, DateFormulaIn As String, Optional FromDateIn As Object = Nothing) [stuff that works] [check that we got a FromDateIn...] If TypeOf FromDateIn Is DtaDate Then fdk = FromDateIn.Key Ans.FromDate = fdk VB tells me that "Option Strict On disallows late binding". The other cases, where a string or integer is the TypeOf, I use CInt or CStr. But this is the first time I've actually run into a case where the casting is a non-base type. What's the trick?

    Read the article

  • Simple Communication between 2 instances of application

    - by KyleGobel
    I have a WPF application that can take a few optional command line arguments. This application is also a single instance application (using a mutex to close any instances if one is already open). What I want for it to do though, is if something tries to open the application with some cmd line args, that the application will do what it's suppose to do with those (in my application it opens different dialogs based on the cmd line). What is the easiest way to achieve this? In psedo code here is what i'm looking for protected override void OnStartup(StartupEventArgs e) { bool mutexIsNew; using (System.Threading.Mutex m = new System.Threading.Mutex(true, "MyApplication", out mutexIsNew)) { //if this is not the first instance of the app if (!mutexIsNew) { //if there is some cmd line args if (e.Args.Length > 0) { //send the args to the older instance so it can handle them SendToOtherInstance(e.Args); //shutdown this new instance Application.Current.Shutdown(); } } } base.OnStartup(e); }

    Read the article

  • what's the right way to do polymorphism with protocol buffers?

    - by user364003
    I'm trying to long-term serialize a bunch of objects related by a strong class hierarchy in java, and I'd like to use protocol buffers to do it due to their simplicity, performance, and ease of upgrade. However, they don't provide much support for polymorphism. Right now, the way I'm handling it is by having a "one message to rule them all" solution that has a required string uri field that allows me to instantiate the correct type via reflection, then a bunch of optional fields for all the other possible classes I could serialize, only one of which will be used (based on the value of the uri field). Is there a better way to handle polymorphism, or is this as good as I'm going to get?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >