Search Results

Search found 21356 results on 855 pages for 'check digit'.

Page 124/855 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • Should I use custom exceptions to control the flow of application?

    - by bonefisher
    Is it a good practise to use custom business exceptions (e.g. BusinessRuleViolationException) to control the flow of user-errors/user-incorrect-inputs??? The classic approach: I have a web service, where I have 2 methods, one is the 'checker' (UsernameAlreadyExists()) and the other one is 'creator' (CreateUsername())... So if I want to create a username, I have to do 2 roundtrips to webservice, 1.check, 2.if check is OK, create. What about using UsernameAlreadyExistsException? So I call only the 2. web service method (CrateUsername()), which contains the check and if not successfull, it throws the UsernameAlreadyExistsException. So the end goal is to have only one round trip to web service and the checking can be contained also in other web service methods (so I avoid calling the UsernameAlreadyExists() all the times..). Furthermore I can use this kind of business error handling with other web service calls completely avoiding the checking prior the call.

    Read the article

  • How to execute in javascriptfunction in asp.net c#

    - by shree-khanal
    i have a textarea which i want to disable when I check a checkbox. I made a working demo in plain html and javascript, but When I am migrating to Asp.net, neither the function is being executed nor I can keep the onselect event in my check box. <asp:CheckBox ID="ChkOthers" runat="server" Text="Others(Please Explain)" Width="205px" AutoPostBack="True" OnCheckedChanged="ChkOthers_CheckedChanged" /></td> <asp:TextBox ID="TxtOtherReason" runat="server" MaxLength="1024" TextMode="MultiLine" ></asp:TextBox></td> i want to create client side validation when check box is checked textbox is enable else disable.

    Read the article

  • How to hide a label for="x01" Checkbox using jQuery

    - by tonsils
    Hi, I am attempting to hide this checkbox, which is a check all checkbox in my table header, using jQuery but am not having much luck. The view source of the section I am trying to hide from the user is as follows: <th class="t12subheader" id="CHECK$01"><label for="x01" class="hideMe508">Check All</label><input type="checkbox" name="x02" value="1" onclick="checkAll(this)" /></th> I have tried both: $('#x01, label[for="x01"]').hide (); & $('#x01').hide (); to no avail. Any help using jQuery would be appreciated. Also, does it matter the positioning of hiding this chckbox? Thanks.

    Read the article

  • Is there a way to find out if an iPhone / iPad app is installed already?

    - by eerok512
    I'm writing a freeware version of an app and would like to check if a user already has the unfree version installed, and print a message whose contents are conditional on the results of the installation check... anybody know if this is possible? the closest I've come to a solution is to make use of the CFPreferencesSetValue API with a kCFPreferencesAnyUser / kCFPreferencesCurrentHost pairing... I haven't tried it, but based on the documentation it sounds possible. however in my current specific situation this API will not be able to solve my problem, because I want to check for the presence of an app I wrote 4 months ago that didn't write any data to the CFPrefs registry... because back then I didn't know of it nor did I foresee this situation arising... the only way CFPrefs can assist me is in future apps now that I know it exists :) so I'm wondering if there are other ways to do it? any help will be appreciated :)

    Read the article

  • Is it possible to exclude some files from checkin (TFS) ?

    - by Thomas Wanner
    We use configuration files within various projects under source control (TFS), where each developer has to make some adjustments in his local copy to configure his environment. The build process takes care about replacing the config files with the server configuration as a part of the deployment, so it doesn't actually matter what is in the repository. However, we would anyway like to keep some kind of a default non-breaking version of config files in the repository, so that e.g. people not involved in the particular project won't run into troubles because of local misconfiguration. We tried to resolve this by introducing the check-in policy that simply forbids to check-in the config files. This works fine, but just because we're lazy to always uncheck those checkboxes in the pending changes window, the question comes : is it possible to transparently disable the check-in of particular files without keeping them out of source control (e.g. locking their current version) ?

    Read the article

  • iPhone checklist app

    - by Brodie4598
    I am trying to create a simple app that displays a list of items with check boxes next to each item, then give the user to simply check each box. Nothing (aside from the checkbox image switching) needs to happen when the check box is touched. Each checklist is a seperate NSDictionary contained in a single master NSDictionary. The checklist dictionary contains arrays for different sections of each checklist. At the top of the view, the user selects which set (dictionary) of checklists they want to open then I want that checklist to display underneath the picker once a "select checklist" button is pressed. Any ideas on the best way to get this done?

    Read the article

  • How to execute in JavaScript function in ASP.NET using C#

    - by shree-khanal
    i have a textarea which i want to disable when I check a checkbox. I made a working demo in plain HTML and JavaScript , but When I am migrating to Asp.net, neither the function is being executed nor I can keep the OnSelect event in my check box. <asp:CheckBox ID="ChkOthers" runat="server" Text="Others(Please Explain)" Width="205px" AutoPostBack="True" OnCheckedChanged="ChkOthers_CheckedChanged" /> <asp:TextBox ID="TxtOtherReason" runat="server" MaxLength="1024" TextMode="MultiLine" /> i want to create client side validation when check box is checked textbox is enable else disable.

    Read the article

  • How does the "Remember my password" checkbox work?

    - by Veera
    There are numerous login forms with the little check box "Remember my password" so that the next time you visit the website, the browser automatically fills up the password field for you. But I have noticed a behavior in modern browsers, such as Chrome/Firefox, which shows up a notification bar to save the user name/passoword even though that particular web page does not have any "remember password" check box. so my questions are: If I have to put the "remember password" check box in a login form, what do I have to do when the user checks it? I mean, do I have to store the password in browser cookies (or Local Storage)? If so, should the password be encrypted or plain text? The "Save password" notification bar is a browser's functionality or is there any way to invoke it from the web page?

    Read the article

  • Best practices for using Hg with Grails?

    - by leeand00
    What should I check in/not check in? Since many of the files are sometimes auto-generated I'm not entirely sure how to handle this using version control...does it have something to do with tags? For instance in ANT, I know not to check-in my target/bin directories...but Grails adds another level of confusion to this...since some of code is generated and some of it is not. (It may become clearer as I go...but it seems to be that there needs to be some way of being able to tell what was just generated and what was modified by a developer so that it needs to be placed in version control)

    Read the article

  • Read from POS Devices

    - by Garhwali Bhai
    Hi Experts, What would be the best design for a Java web based application to read Check or Credit Card from POS Devices which are configured/installed at client machine? The design which I have decided is: When cashier selects payment mode as 'Check' or 'Credit Card' open a pop-up. From pop-up, I am calling an Applet through JNLP which implements JPOS API to communicate with POS devices at client machine. When cashier swipes or inserts check, Applet class read them and send the information back to the pop-up window. Pop up window call the parent window, populate all the required field and close the pop-up.

    Read the article

  • Can hitTestPoint be used with local coordinates at all?

    - by mars
    In AS3 I have a game where a vehicle rotates to the direction of the cursor, but when it "moves", its sprite stays stationary in the middle of the stage while the map layer below it actually moves, causing the illusion of movement of the vehicle on the map. There are obstacles on the map that the vehicle cannot pass. The obstacles are in a movie clip that is a part of the map layer and move with it. hitTestPoint seems only to be able to check if the obstacle clip is touching points on the stage rather than points on the map, meaning that I cannot feed it the same coordinates I use to check the map boundaries, which are points on the map. I don't think I can use localToGlobal because the function I use to check obstacle collisions does not have access to a reference to the obstacle movie clip. Is there a way in these conditions to force hitTestPoint to use its local coordinate system on the map? I have included a diagram:

    Read the article

  • php - upload script mkdir saying file already exists when same directory even though different filename

    - by neeko
    my upload script says my file already exists when i try upload even though different filename <?php // Start a session for error reporting session_start(); ?> <?php // Check, if username session is NOT set then this page will jump to login page if (!isset($_SESSION['username'])) { header('Location: index.html'); } // Call our connection file include('config.php'); // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/JPG", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // Just a short function that prints out the contents of an array in a manner that's easy to read // I used this function during debugging but it serves no purpose at run time for this example function showContents($array) { echo "<pre>"; print_r($array); echo "</pre>"; } // Set some constants // Grab the User ID we sent from our form $user_id = $_SESSION['username']; $category = $_POST['category']; // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "img/users/$category/$user_id/"; mkdir($TARGET_PATH, 0755, true); // Get our POSTed variables $fname = $_POST['fname']; $lname = $_POST['lname']; $contact = $_POST['contact']; $price = $_POST['price']; $image = $_FILES['image']; // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $fname == "" || $lname == "" || $image['name'] == "" ) { $_SESSION['error'] = "All fields are required"; header("Location: error.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "You must upload a jpeg, gif, or bmp"; header("Location: error.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "A file with that name already exists"; header("Location: error.php"); exit; } // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $imagename = $image['name']; $sql = "insert into people (price, contact, category, username, fname, lname, expire, filename) values (:price, :contact, :category, :user_id, :fname, :lname, now() + INTERVAL 1 MONTH, :imagename)"; $q = $conn->prepare($sql) or die("failed!"); $q->bindParam(':price', $price, PDO::PARAM_STR); $q->bindParam(':contact', $contact, PDO::PARAM_STR); $q->bindParam(':category', $category, PDO::PARAM_STR); $q->bindParam(':user_id', $user_id, PDO::PARAM_STR); $q->bindParam(':fname', $fname, PDO::PARAM_STR); $q->bindParam(':lname', $lname, PDO::PARAM_STR); $q->bindParam(':imagename', $imagename, PDO::PARAM_STR); $q->execute(); $sql1 = "UPDATE people SET firstname = (SELECT firstname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql1) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); $sql2 = "UPDATE people SET surname = (SELECT surname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql2) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); header("Location: search.php"); exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Could not upload file. Check read/write persmissions on the directory"; header("Location: error.php"); exit; } ?>

    Read the article

  • Test for external undefined references in Linux

    - by Charles
    Is there a built in linux utility that I can use to test a newly compiled shared library for external undefined references? Gcc seems to be intelligent enough to check for undefined symbols in my own binary, but if the symbol is a reference to another library gcc does not check at link time. Instead I only get the message when I try to link to my new library from another program. It seems a little silly to get undefined reference messages in a library when I am compiling a different project so I want to know if I can do a check on all references internal and external when I build the library not when I link to it. Example error: make -C UnitTests debug make[1]: Entering directory `~/projects/Foo/UnitTests` g++ [ tons of objects ] -L../libbar/bin -lbar -o UnitTests libbar.so: undefined reference to `DoSomethingFromAnotherLibrary` collect2: ld returned 1 exit status make[1]: *** [~/projects/Foo/UnitTests] Error 1

    Read the article

  • Android SQLiteConstraintException: error code 19: constraint failed

    - by Tom D
    I've seen other questions about this exception, but all of them seem to be resolved with the solution that a row with the primary key specified already exists. This doesn't seem to be the case for me. I have tried replacing all single quotes in my strings with double quotes, but the same problem occurs. I'm trying to insert a row into the Settings table of the SQLite database I've created by doing the following: db.execSQL("DROP TABLE IF EXISTS "+Settings.SETTINGS_TABLE_NAME + ";"); db.execSQL(CREATE_MEDIA_TABLE); db.execSQL(CREATE_SETTINGS_TABLE); Cursor c = getAllSettings(); //If there isn't already a settings row, create a row full of defaults if(c.getCount()==0){ ContentValues cv = new ContentValues(); cv.put(Settings.SETTING_UNIQUE_ID, "'"+Settings.uniqueID+"'"); cv.put(Settings.SETTING_DEVICE_ID, Settings.SETTING_DEVICE_ID_DEFAULT); cv.put(Settings.SETTING_CONNECTION_PREFERENCE, Settings.SETTING_CONNECTION_PREFERENCE_DEFAULT); cv.put(Settings.SETTING_AD_HOC_ENABLED, Settings.SETTING_AD_HOC_ENABLED_DEFAULT); cv.put(Settings.SETTING_SERVER_ADDRESS, Settings.SETTING_SERVER_ADDRESS_DEFAULT); cv.put(Settings.SETTING_RECORDING_MODE, Settings.SETTING_RECORDING_MODE_DEFAULT); cv.put(Settings.SETTING_PREVIEW_ENABLED, Settings.SETTING_PREVIEW_ENABLED_DEFAULT); cv.put(Settings.SETTING_PICTURE_RESOLUTION_X, Settings.SETTING_PICTURE_RESOLUTION_X_DEFAULT); cv.put(Settings.SETTING_PICTURE_RESOLUTION_Y, Settings.SETTING_PICTURE_RESOLUTION_Y_DEFAULT); cv.put(Settings.SETTING_VIDEO_RESOLUTION_X, Settings.SETTING_VIDEO_RESOLUTION_X_DEFAULT); cv.put(Settings.SETTING_VIDEO_RESOLUTION_Y, Settings.SETTING_VIDEO_RESOLUTION_Y_DEFAULT); cv.put(Settings.SETTING_VIDEO_FPS, Settings.SETTING_VIDEO_FPS_DEFAULT); cv.put(Settings.SETTING_AUDIO_BITRATE_KBPS, Settings.SETTING_AUDIO_BITRATE_KBPS_DEFAULT); cv.put(Settings.SETTING_STORE_TO_SD, Settings.SETTING_STORE_TO_SD_DEFAULT); cv.put(Settings.SETTING_STORAGE_LIMIT_MB, Settings.SETTING_STORAGE_LIMIT_MB_DEFAULT); this.db.insert(Settings.SETTINGS_TABLE_NAME, null, cv); } The CREATE_SETTINGS_TABLE string is defined as the following: private static String CREATE_SETTINGS_TABLE = "CREATE TABLE IF NOT EXISTS " + Settings.SETTINGS_TABLE_NAME + "(" + Settings.SETTING_UNIQUE_ID + " TEXT NOT NULL PRIMARY KEY, " + Settings.SETTING_DEVICE_ID + " TEXT NOT NULL , " + Settings.SETTING_CONNECTION_PREFERENCE + " TEXT NOT NULL CHECK("+Settings.SETTING_CONNECTION_PREFERENCE+" IN("+Settings.SETTING_CONNECTION_PREFERENCE_ALLOWED+")), " + Settings.SETTING_AD_HOC_ENABLED + " TEXT NOT NULL CHECK("+Settings.SETTING_AD_HOC_ENABLED+" IN("+Settings.SETTING_AD_HOC_ENABLED_ALLOWED+")), " + Settings.SETTING_SERVER_ADDRESS + " TEXT NOT NULL, " + Settings.SETTING_RECORDING_MODE + " TEXT NOT NULL CHECK("+Settings.SETTING_RECORDING_MODE+" IN("+Settings.SETTING_RECORDING_MODE_ALLOWED+")), " + Settings.SETTING_PREVIEW_ENABLED + " TEXT NOT NULL CHECK("+Settings.SETTING_PREVIEW_ENABLED+" IN("+Settings.SETTING_PREVIEW_ENABLED_ALLOWED+")), " + Settings.SETTING_PICTURE_RESOLUTION_X + " TEXT NOT NULL, " + Settings.SETTING_PICTURE_RESOLUTION_Y + " TEXT NOT NULL, " + Settings.SETTING_VIDEO_RESOLUTION_X + " TEXT NOT NULL, " + Settings.SETTING_VIDEO_RESOLUTION_Y + " TEXT NOT NULL, " + Settings.SETTING_VIDEO_FPS + " TEXT NOT NULL, " + Settings.SETTING_AUDIO_BITRATE_KBPS + " TEXT NOT NULL, " + Settings.SETTING_STORE_TO_SD + " TEXT NOT NULL CHECK("+Settings.SETTING_STORE_TO_SD+" IN("+Settings.SETTING_STORE_TO_SD_ALLOWED+")), " + Settings.SETTING_STORAGE_LIMIT_MB + " TEXT NOT NULL )"; However, when I execute my insert, I always get: 03-19 19:37:36.974: ERROR/Database(386): Error inserting server_address='0.0.0.0' storage_limit='-1' connection='none' preview_enabled='0' sd_enabled='1' video_fps='15' audio_bitrate='96' device_id='-1' recording_mode='none' picture_resolution_x='-1' picture_resolution_y='-1' unique_id='000000000000000' adhoc_enable='0' video_resolution_x='320' video_resolution_y='240' 03-19 19:45:34.284: ERROR/Database(446): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed It seems as if all the columns in my insert are not null. The row's primary key HAS to be unique, because it's the only row in the table. Therefore, the only thing I can think of is my CHECK conditions aren't true. Here are the predefined strings I'm using: public static final String SETTING_UNIQUE_ID = "unique_id"; public static final String SETTING_DEVICE_ID = "device_id"; public static final String SETTING_DEVICE_ID_DEFAULT = "'-1'"; public static final String SETTING_CONNECTION_PREFERENCE = "connection"; public static final String SETTING_CONNECTION_PREFERENCE_3G = "'3g'"; public static final String SETTING_CONNECTION_PREFERENCE_WIFI = "'wifi'"; public static final String SETTING_CONNECTION_PREFERENCE_NONE = "'none'"; public static final String SETTING_CONNECTION_PREFERENCE_ALLOWED = SETTING_CONNECTION_PREFERENCE_3G+","+SETTING_CONNECTION_PREFERENCE_WIFI+","+SETTING_CONNECTION_PREFERENCE_NONE; public static final String SETTING_CONNECTION_PREFERENCE_DEFAULT = SETTING_CONNECTION_PREFERENCE_NONE; public static final String SETTING_AD_HOC_ENABLED = "adhoc_enable"; public static final String SETTING_AD_HOC_ENABLED_ALLOWED = TRUE+","+FALSE; public static final String SETTING_AD_HOC_ENABLED_DEFAULT = FALSE; public static final String SETTING_SERVER_ADDRESS = "server_address"; public static final String SETTING_SERVER_ADDRESS_DEFAULT = "'0.0.0.0'"; public static final String SETTING_RECORDING_MODE = "recording_mode"; public static final String SETTING_RECORDING_MODE_VIDEO = "'video'"; public static final String SETTING_RECORDING_MODE_AUDIO = "'audio'"; public static final String SETTING_RECORDING_MODE_PICTURE = "'picture'"; public static final String SETTING_RECORDING_MODE_NONE = "'none'"; public static final String SETTING_RECORDING_MODE_ALLOWED = SETTING_RECORDING_MODE_VIDEO+","+SETTING_RECORDING_MODE_AUDIO+","+SETTING_RECORDING_MODE_PICTURE+","+SETTING_RECORDING_MODE_NONE; public static final String SETTING_RECORDING_MODE_DEFAULT = SETTING_RECORDING_MODE_NONE; public static final String SETTING_PREVIEW_ENABLED = "preview_enabled"; public static final String SETTING_PREVIEW_ENABLED_ALLOWED = TRUE+","+FALSE; public static final String SETTING_PREVIEW_ENABLED_DEFAULT = FALSE; public static final String SETTING_PICTURE_RESOLUTION_X = "picture_resolution_x"; public static final String SETTING_PICTURE_RESOLUTION_X_DEFAULT = "'-1'"; public static final String SETTING_PICTURE_RESOLUTION_Y = "picture_resolution_y"; public static final String SETTING_PICTURE_RESOLUTION_Y_DEFAULT = "'-1'"; public static final String SETTING_VIDEO_RESOLUTION_X = "video_resolution_x"; public static final String SETTING_VIDEO_RESOLUTION_X_DEFAULT = "'320'"; public static final String SETTING_VIDEO_RESOLUTION_Y = "video_resolution_y"; public static final String SETTING_VIDEO_RESOLUTION_Y_DEFAULT = "'240'"; public static final String SETTING_VIDEO_FPS = "video_fps"; public static final String SETTING_VIDEO_FPS_DEFAULT = "'15'"; public static final String SETTING_AUDIO_BITRATE_KBPS = "audio_bitrate"; public static final String SETTING_AUDIO_BITRATE_KBPS_DEFAULT = "'96'"; public static final String SETTING_STORE_TO_SD = "sd_enabled"; public static final String SETTING_STORE_TO_SD_ALLOWED = TRUE+","+FALSE; public static final String SETTING_STORE_TO_SD_DEFAULT = TRUE; public static final String SETTING_STORAGE_LIMIT_MB = "storage_limit"; public static final String SETTING_STORAGE_LIMIT_MB_DEFAULT = "'-1'"; public static final String SETTING_CLIP_LENGTH_SECONDS = "clip_length"; public static final String SETTING_CLIP_LENGTH_SECONDS_DEFAULT = "'300'"; Does anyone see what could be going on? I'm stumped. Thanks in advance.

    Read the article

  • Detect whether certain IIS features are present from InstallScript

    - by Christian Hayter
    I have an InstallScript project written in InstallShield 2010, which, amongst other things, shells out to several .NET MSI installers that install web apps. If any of these web apps are selected for installation by the end user, I need to check for the following optional IIS features from InstallScript code before allowing the install to proceed: ASP.NET (IIS 6+) WCF HTTP Activation (IIS 7+) IIS Metabase and IIS 6 configuration compatibility (IIS 7+) Can anyone point me in the right direction please? Ideally I'm looking for registry values that I can check directly from InstallScript code, but I guess some kind of WMI or COM check would be OK as well. PS: In case it's relevant, we need to support all versions of IIS from 5.1 onwards at this time. If 5.1 support is a problem, we may consider dropping it if we have to.

    Read the article

  • jQuery event trigger - cancelable event

    - by Dismissile
    I have created a jquery plugin which is triggering an event: $.fn.myplugin = function(options) { this.on("foo.myplugin", options.foo); this.on("bar.myplugin", options.bar); }; I want to check if foo has been canceled by a user and prevent bar from being triggered: // trigger foo this.trigger("foo.myplugin"); // how do I check if foo was canceled if( !fooCanceled ) { this.trigger("bar.myplugin"); } How can I check if foo was canceled to prevent bar from being triggered? jQuery UI does something similar to this, but it did not work when I tried: if (this._trigger("search", event) === false) { return; } I tried something similar to this: if( this.trigger("foo.myplugin") === false ) { return; } this.trigger("bar.myplugin"); But bar was still being triggered.

    Read the article

  • Unnecessary 'else' statement

    - by Vitalii Fedorenko
    As you know, in Eclipse you can turn on "Unnecessary 'else' statement" check that will trigger on if-then-else with premature return. And, from my experience, there are two most possible situations when use such statement: 1) Pre-check: if (validate(arg1)) { return false; } doLotOfStuff(); 2) Post-check: doLotOfStuff(); if (condition) { return foo; } else { return bar; } In the second case, if the trigger is on, Eclipse will suggest you to change the code to: doLotOfStuff(); if (condition) { return foo; } return bar; However, I think that the return with else statement is more readable as it is like direct mapping of business logic. So I am curios if this "Unnecessary 'else' statement" code convention is widespread or else statement is more preferable?

    Read the article

  • How can I require an attribute on a class definition?

    - by spoulson
    Is there a way to enforce a compile requirement for certain attributes on a class or interface implementation? For example, let's say my application uses a series of static classes that contain const int resource values. I'd like to decorate the class in a Description attribute to describe its contents. In concept, I'd like to apply this attribute requirement to an interface, then each static class would implement it with its required Description. I could write a run-time check or a unit test to check compliance. But really a compile-time check would be best. Is there such a thing?

    Read the article

  • Checking if parsed date is within a date range

    - by Brett Powell
    So I am using a scripting language with c++-like syntax, and I am trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing. Here is what my code looks like: if(iMonth >= iStartMonth && iMonth <= iEndMonth) { if(iDay >= iStartDay && iDay <= iEndDay) { if(iYear >= iStartYear && iYear <= iEndYear) { bEnabled = true; return; When I have something like this: Start date: 3 27 2010 End Date: 4 15 2010 Current Date: 3 31 2010 The day check fails because if (iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I can't compare timestamps because I'm allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. I'm assuming I am just not thinking straight and missing an easy fix.

    Read the article

  • Searching a 2D array for a range of values in java

    - by Paige O
    I have a 2^n size int array and I want to check if an element exists that is greater than 0. If the element exists, I want to divide the array by 4 and check if the coordinates of the found element are in the 1st, 2nd, 3rd or 4th quadrant of the array. For example, logically if the element exists in the first quadrant it would look something like this: If array[][] 0 && the row of that coordinate is in the range 0-(grid.length/2-1) && the column of that coordinate is in the range 0-(grid.length/2-1) then do something. I'm really not sure how to check the row and column index of the found element and store those coordinates to use in my if statement. Help!

    Read the article

  • Test for undefined references in Linux

    - by Charles
    Is there a built in linux utility that I can use to test a newly compiled shared library for external undefined references? Gcc seems to be intelligent enough to check for undefined symbols in my own binary, but if the symbol is a reference to another library gcc does not check at link time. Instead I only get the message when I try to link to my new library from another program. It seems a little silly to get undefined reference messages in a library when I am compiling a different project so I want to know if I can do a check on all references internal and external when I build the library not when I link to it. Example error: make -C UnitTests debug make[1]: Entering directory `~/projects/Foo/UnitTests` g++ [ tons of objects ] -L../libbar/bin -lbar -o UnitTests libbar.so: undefined reference to `DoSomethingFromAnotherLibrary` collect2: ld returned 1 exit status make[1]: *** [~/projects/Foo/UnitTests] Error 1

    Read the article

  • How to run an SQL stored procedure through C# at a specific time?

    - by yishai neeman
    I am building a website now for a library and i need to check every day at the same time if there are people who need to return their books in the next five days and to send them a reminder via email. My question is what will be the correct way to do that? What i need to accomplish is when the specific time of day comes i need to run an sql stored procedure and check either through visual studio 2010 or any other way if the stored procedure has returned any results to which i need to email. Is there a way to maybe check the system time constantly on C# and not as a triggered event?

    Read the article

  • C Builder TForm not allocated or created properly all its controls

    - by ergey
    Hi, I would know how i can check that all the controls on the form is created and initialized. I have form i am showing when user presses the 'update' button. It have only TProgressBar control. The handle is not NULL for this control and at random stages it can or can't set the Position/Max values. When i set TProgressBar-Max value to some integer it remains 0 after. So the question is: 1) How to really create the form and all controls on it (i am currently using just Form-Show() method, which as i can check calls the constructor) 2) How to check that all controls on the form is created and PAINTED (showed) Thanks

    Read the article

  • sfConfig::get is not returning constants defined in app.yml

    - by morpheous
    I have an interesting problem. I am using Symfony 1.3.2. I have defined some constants in project/apps/frontend/config/app.yml and project/config/app.yml When I use the constant (correct spelling) in a piece of code like this $test=sfConfig::get('app_foobar'); the variable $test is assigned a null value. This is what I have checked so far: CHECK: cache files generated? (YES) CHECK: Do the cache files (config_app.yml.php) in the cache directory contain the constants defined in the app.yml file (YES) CHECK: Constant names used in the code matches the array keys found in config_app.yml? (YES) At this stage, I have run out of ideas. I dont want to supply a default value as a hack, because when I need to change the value of the constant, I will have to replace this in potentially hundreds of instances (too error prone). Is there anything that I have missed?. What could be causing this?

    Read the article

  • js object problem

    - by haltman
    Hi everybay! I use an object to check that a group of radio buttons have a precise value like set on "rule" object. Here is an example: arr = {a:"1", b:"1", c:"1", c:"2"}; //that's my object rule var arr2={}; //here I create my second array with charged value $("#form_cont input:checked").each(function() { arr2[$(this).attr("name")]=$(this).val(); }); //here I make the check for (k in arr2) { if (typeof arr[k] !== 'undefined' && arr[k] === arr2[k]) { $("#form_cont li[name$='"+k+"']").css('background-color', ''); } else { $("#form_cont li[name$='"+k+"']").css('background-color', 'pink'); } } The problem is when I have to check the "c" key I get last the one (2) and not the right value how that may e 1 or 2 thanks in advance ciao, h.

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >