Search Results

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

Page 192/855 | < Previous Page | 188 189 190 191 192 193 194 195 196 197 198 199  | Next Page >

  • Can you make VB.NET compilation as strict as C#?

    - by pete the pagan-gerbil
    In VB.NET, it is entirely possible to pass an integer as a string parameter to a method without calling .ToString() - it's even possible to call .ToString without the ()'s. The code will run without a problem, VB will interpret the integer as a string without having been told to. In C#, these would cause compilation errors - you are required to call .ToString() and to call it correctly in that situation before it will compile. Is there a way to make the VB compilation process check for the same things as the C# compilation process? Would it be best practice in a mixed team to force this check?

    Read the article

  • PHP displaying error for already used Username and empty field

    - by Pixel Reaper
    I want PHP to make sure the username is not already used and also check to see if the field is empty. Sorry I am a huge noob when it comes to php. Here is my code: // Check for an Username: $dup = mysql_query("SELECT user_username FROM users WHERE user_username='".$_POST['user_username']."'"); if(mysql_num_rows($dup) >0){ $errors[] = 'Username already used.'; } else{ $un = mysqli_real_escape_string($dbc, trim($_POST['user_username'])); echo '<b>Congrats, You are now Registered.</b>'; } else { $errors[] = 'You forgot to enter your Username.'; }

    Read the article

  • Thread Code...anything wrong with this, must use java 1.4

    - by bmw0128
    I have a servlet automatically firing up when the app server starts, and in its init(), I'm making another thread: init(){ new FooThread() } in FooThread(), i want to periodically check the status of a DB value, then depending on the value, make a web service call. When these two tasks complete, I want the thread to sleep to wait a certain period then repeat. This cycle would just continue forever. FooThread: public class FooThread implements Runnable{ Thread t; FooThread(){ t = new Thread(this, "BBSThread"); logger.info("*** about to start " + t.getName()); t.start(); logger.info("*** started: " + t); } public void run() { try{ while(true){ //do the db check, then conditionally do the web services call logger.info("*** calling sleep() ***"); Thread.sleep(50000); logger.info("*** now awake ***"); } } catch (InterruptedException e) { System.out.println("*** FooThread interrupted"); } } }

    Read the article

  • How to Create a Multiple Question ?

    - by user537422
    Hi Guys, I need to retrieve 6 questions from a plist and check the answer if is correct from the plist itself?? i will use a QR code scanner api to scan for answer, the api will covert to a string and read from the plist to check if the answer is correct... is there any tutorial or references for me to look @ ?? In my plist there is: question ~ Dictionary with the following strings: NumberOfOption ~ which define if the question is a multiple choice or a QR code question Question ~ question itself Answer ~ Answer itself Option 1 ~ 4 ~ if it is a multiple choice question Thanks in advance for answering my questions, i appreciated it cheers Desmond

    Read the article

  • Strange hex formatting in NSString

    - by pseudopeach
    Try this: unsigned long long int N; = 23229877463LL; NSString* s = [NSString stringWithFormat:@"dec:%qi, hex:%qX",N,N]; NSLog(@"output: %@",s); output: dec:23229877460, hex:689BCCD400000005 What's up with the 00000005??? In mySQL, hex(23229877460) = 5689BCCD4. Also, every other language seems to do this correctly. A 16 digit long hex is like 4 gazillion (16^16), right? How can I get objective-c to format hex numbers that other languages can understand?

    Read the article

  • How to delete rows based on comparison from Data Flow Task in an SSIS?

    - by vikasde
    I have a DataFlow task with two OLE DB Source objects. This is the SQL I want to achieve using SSIS: Insert into server2.db.dbo.[table2] (...) Select col1, col2, col3 ... from Server1.db.dbo.[table1] where [table1.col1] not in (Select col5 from server2.db.dbo.[table2] Where ...) I am pretty new to SSIS and not sure how to achieve this. I thought I could do this using the Data Flow task and populating the first source with the data from server1.db.dbo.table1 and the second source with server2.db.dbo.[table2] and then do the conditional check before inserting it into server2.db.dbo.[table2]. I am not sure how to do the conditional check though. Any help is appreciated.

    Read the article

  • Using SVN alone or in small workgroups - workflow approach?

    - by Industrial
    Hi everybody, I have spent some months working on a web application and we're come close to production stage. It's soon time to expand the development group with 1-3 people on this project. I have not too much experience on working with SVN, but It's obviously the choice for a big part of the larger companies out there, so I am guessing that the pros of SVN without a doubt outweights the time spent on commit/check ins / check outs etc. The workflow seems to become a bit more complicated with SVN, and even though I have read Version Control with Subversion by O'Reilly Media and I am not sure yet if it's overkill to use SVN for any reasons besides backup when developing alone or in a small (1-3 people) workgroup? How do you do it? What's your workflow with version control while working alone or in small workgroups? Thanks!

    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

  • problme with javascript map/object

    - by akshay
    I am using javascript map to store keys and values.Later on I check if specified key is present in map or not, but it sometimes gives correct result but sometimes it dont.I tried to print the map using console.log(mapname), it shows all keys, but i i try to check if some specified key is presnt sometimes it gives wrong answer. Am using following code: //following code is called n times in loop with different/same vales of x myMap : new Object(); var key = x ; //populated dynamically actually myMap[key] ="dummyval"; if(myIdMap[document.getElementById("abc").value.trim()]!=null) alert('present' ); else alert('not present'); What can be the possible problem?

    Read the article

  • public (static) swap() method vs. redundant (non-static) private ones...

    - by Helper Method
    I'm revisiting data structures and algorithms to refresh my knowledge and from time to time I stumble across this problem: Often, several data structures do need to swap some elements on the underlying array. So I implement the swap() method in ADT1, ADT2 as a private non-static method. The good thing is, being a private method I don't need to check on the parameters, the bad thing is redundancy. But if I put the swap() method in a helper class as a public static method, I need to check the indices every time for validity, making the swap call very unefficient when many swaps are done. So what should I do? Neglect the performance degragation, or write small but redundant code?

    Read the article

  • please help me to implement such kind of sort

    - by davit-datuashvili
    hi i need to write sucj kind of sorting maybe it is similary to radix sort and also (this is not homework because i created it problem myself and please if anobody can help me) problem is like this suppose i have array int x[]=new int[]{4,5,3,2,1}; let write it into binary form 5 -0101 4- 0100 3-0011 2-0010 1-0001 i want to sort this elements by using bitwise operatos or check each bit and if less exchange it can anybody help me for example take 5 and 4 check first rightmost bit 0==0 so continue in the 1 index also 1==1 next the same 0=0 and last one 10 it means that first element is greater then second so exchange it please help me

    Read the article

  • Securing paths in PHP

    - by tjm
    I'm writing some PHP which takes some paths to different content directories, and uses these to include various parts of pages later. I'm trying to ensure that the paths are as they seem, and none of them break the rules of the application. I have PRIVATEDIR which must lie above DOCUMENT_ROOT (aka) PUBLICDIR. CONTENTDIR which must lie within PRIVATEDIR and not go back below PUBLICDIR and some other *DIR's which must remain within CONTENTDIR. Currently I set up some defaults, and then override the ones the user specifies and then sanity check them with the following. private function __construct($options) { error_reporting(0); if(is_array($options)) { $this->opts = array_merge($this->opts, $options); } if($this->opts['STATUS']==='debug') { error_reporting(E_ALL | E_NOTICE | E_STRICT); } $this->opts['PUBLICDIR'] = realpath($_SERVER['DOCUMENT_ROOT']) .DIRECTORY_SEPARATOR; $this->opts['PRIVATEDIR'] = realpath($this->opts['PUBLICDIR'] .$this->opts['PRIVATEDIR']) .DIRECTORY_SEPARATOR; $this->opts['CONTENTDIR'] = realpath($this->opts['PRIVATEDIR'] .$this->opts['CONTENTDIR']) .DIRECTORY_SEPARATOR; $this->opts['CACHEDIR'] = realpath($this->opts['PRIVATEDIR'] .$this->opts['CACHEDIR']) .DIRECTORY_SEPARATOR; $this->opts['ERRORDIR'] = realpath($this->opts['CONTENTDIR'] .$this->opts['ERRORDIR']) .DIRECTORY_SEPARATOR; $this->opts['TEMPLATEDIR' = realpath($this->opts['CONTENTDIR'] .$this->opts['TEMPLATEDIR']) .DIRECTORY_SEPARATOR; // then here I have to check that PRIVATEDIR is above PUBLICDIR // and that all the rest remain within private dir and don't drop // down into (or below) PUBLICDIR again. And die with an error if // they don't conform. } The thing is this seems like a lot of work to do, especially as it must be run, every time a page is accessed, before I can do anything else, e.g check for a cached version of the page I'm serving. Part of me is thinking, since all of these paths are predefined by the maintainer of the site, they SHOULD be aware of what paths they are allowing access to and ensuring they are secure. But, I think I'm thinking that because currently I am said maintainer, and I KNOW my paths conform to the rules. That said, I do want to secure this thing from any accidental errors by future maintainers (and I bet, now I've said above "I KNOW...", probably from myself somewhere down the line). This just feels like a suboptimal solution. I wonder how fast this would really be and what you would suggest to improve it or as an alternative? Thanks.

    Read the article

  • How to add Transparency information to a HEX color code?

    - by TK123
    I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the user change text color. It gives HEX values like so: #RRGGBB And there is a slider that allows the user to change a text's transparency. It runs from 0.1 to 1 Somehow I need to get a 2 digit letter from this transparency amount and append it to the HEX value for it to work. Does anyone know how to append Alpga information to HEX color codes? What is the math formula for it? I guess the question can also be answered if anyone knows how to concert RGBA color values with transparency into HEX: rgba(255, 255, 255, 0.6)

    Read the article

  • if specific row = null, execute query

    - by fusion
    how do i check if the value of a column is null, and only then execute the query? for example: col1 col2 col3 01 abc i run a query which first checks if the record exists or not; if it exists, it should execute the update query and if it doesn't exist, it executes the insert query. how do i check if col3 is null and if it is null, it should execute the update query. . $sql = "SELECT uid FROM `users` WHERE uid = '" . $user_id . "'"; $result = mysql_query($sql,$conn) or die('Error:' .mysql_error()); $totalrows = mysql_num_rows($result); if($totalrows < 1) { insertUser($user_id,$sk, $conn); } else { updateSessionKey($user_id,$sk,$conn); }

    Read the article

  • Sending an int from Java to C using sockets

    - by David Morris
    I was just wondering how to send an int from a Java application to a C application using sockets. I have got different C programs communicating with each other and have got the Java application retrieving data from the C application, but I can't work out sending. The C application is acting as database, the Java application then sends a user id (a 4 digit number) to the C application, if it exists it returns that record's details. In Java I have tried using a printWriter and DataOutputStream to send the data, printWriter produces weird symbols and DataOutputStream produces "prof_agent.so". Any help would be appreciated as I don't have a good grasp of sockets at the moment.

    Read the article

  • Trouble with SVN and Filename 'changes'.

    - by Stacey
    I am programming in Visual Studio 2010, using TortiseSVN and VisualSVN as my client to connect to SVN repositories. I am having a bit of a frequent problem though with the whole SVN thing in general. One thing that keeps cropping up is that if I make changes to files - namely filenames, or move them to new folders, etc, I end up getting all kinds of conflicts with the repository and it just causes all sorts of strange errors. I understand the importance of version control and check-in/check-out access like this, but what do most of you do to deal with this kind of thing? I mean, I've tried doing the whole 'Remove from Subversion', change my file, then 'Add to Subversion' thing, and it just doesn't seem to do the job very well. This is especially frustrating when working on web projects where filenames can change very frequently as a project evolves and becomes multifaceted. Are there any standard ways to deal with this kind of thing, or is it just one of the flaws of SVN in general?

    Read the article

  • Junit test that creates other tests

    - by Benju
    Normally I would have one junit test that shows up in my integration server of choice as one test that passes or fails (in this case I use teamcity). What I need for this specific test is the ability to loop through a directory structure testing that our data files can all be parsed without throwing an exception. Because we have 30,000+ files that that 1-5 seconds each to parse this test will be run in its own suite. The problem is that I need a way to have one piece of code run as one junit test per file so that if 12 files out of 30,000 files fail I can see which 12 failed not just that one failed, threw a runtimeexception and stopped the test. I realize that this is not a true "unit" test way of doing things but this simulation is very important to make sure that our content providers are kept in check and do not check in invalid files. Any suggestions?

    Read the article

  • test php disabled caching

    - by user1691389
    My site had a problem in that certain browsers (especially opera and gecko) were "over-caching" (caching far too much for my taste). I've just added the following PHP snippet to hopefully disable caching in all browsers: <?php header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> Question: How would you test this out, to make sure it actually works?

    Read the article

  • Access to Label value with Javascript

    - by streetparade
    I need to access to a value in a checkbox, the atribute value has content, so i need to place the id somewhere else i created a label, but i have not access to that value alert(check[i].label); // doesnt work where else can i place a value in checkbox. Please dont write that i can do this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue'> Hy Where can i place some other values ? I tryed with this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue' label='myothervalue'> Hy first i get all checkbox ect... and in the for loop i did this alert(check[i].label); // doesnt work How can i do that?

    Read the article

  • Is there any declare for toggle() that if its open do this, closed to that?

    - by Dejan.S
    Im doing some jquery stuff with toggle(), I'm doing different actions depending on if the current div is closing or showing, i know i can easy check if a div hasClass() or is(':visible') for what i want to do, but I'm thinking maybe there is somehow that i can reduce the amount of code or just do it more efficient? like declare the toggle() with two functions that this is for when its showing and this is for when its closing, is this possible? hope you get what i mean? like this, or check a jsfiddle $('#click_me').on('click', function() { $('#contain').toogle('blind', 300, function (){ alert('open'); }, function (){ alert('close'); }); });

    Read the article

  • Javascript Code For HTML5 Form Validation Not Working

    - by MistUnleashed
    I'm new to JavaScript so I have no idea why this code does not work and validate my HTML5 Form like it should. The JavaScript code which can be found below is supposed to check if the browser supports the required attribute and if it doesn't then it will validate the form and check for any empty spaces. I got the code from this website. In the body of the webpage containing my form I have this: Below is the contactvalidate.js file: $('#formTemplate').submit(function() { if (!attributeSupported("required") || ($.browser.safari)) { $("#formTemplate [required]").each(function(index) { if (!$(this).val()) { alert("Please fill all required fields."); return false; } }); } return false; }); Do I need to change anything in this code or should it work? As I've said I'm new to JavaScript so any help you guys could give me is greatly appreciated.

    Read the article

  • Do preconditions ALWAYS have to be checked?

    - by Pin
    These days I'm used to checking every single precondition for every function since I got the habit from an OS programming course back at uni. On the other hand, at the software engineering course we were taught that a common precondition should only be checked once, so for example, if a function is delegating to another function, the first function should check them but checking them again in the second one is redundant. I do see the redundancy point, but I certainly feel it's safer to always check them, plus you don't have to keep track of where they were checked previously. What's the best practice here?

    Read the article

  • How to let users with required permission download a file via php?

    - by Yegor
    I have a php file that acts as a gatekeeper for all the files I want people to download, who ahve sufficient privilages. The code I use throw the file to the user is header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header("Content-disposition: attachment; filename=\"".$public_filename."\""); header("Content-Transfer-Encoding: Binary"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("Content-length: ".$f_filesize); readfile($file_path); Most files are fairly large.... 400mb-10GB. What would be a good way to do this, and keep the true locations + filenames secret, so people cant just link to the files directly, but HAVE to link thru my download.php?file=ID gatekeeper? Thanks

    Read the article

< Previous Page | 188 189 190 191 192 193 194 195 196 197 198 199  | Next Page >