Search Results

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

Page 95/855 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • Check if a pointer points to allocated memory on the heap.

    - by Ugo
    Ok, I know this question seems to have been asked many times on stackoverflow. but please read Well the answer for any address is "No you can't" but the question here is to know if a pointer points to a piece of memory allocated with malloc/new. Actually I think it could be easily implemented overriding malloc/free and keeping track of allocated memory ranges. Do you know a memory management library providing this specific tool ?

    Read the article

  • Way to check for foreign key references before deleting in MySQL?

    - by Chad Johnson
    I'm working with a content management system, and users are prompted with a confirmation screen before deleting records. Some records are foreign key referenced in other tables, and therefore they cannot be deleted. I would like to display a message beside a given record if it has foreign key references. To know whether I should display the message for a record, I could just query the referencing table and see if there are references. But the problem is, there are about a dozen tables with records potentially referencing this record, and a lookup could take a "long" time. Is there an easy way to tell whether the record is delete-ready (ie. has no foreign key references)?

    Read the article

  • C# wrapper of c++ dll; "Run-Time Check Failure #0 - The value of ESP was not properly saved across a

    - by Deveti Putnik
    Here is the code in C++ dll: extern "C" _declspec(dllexport) int testDelegate(int (*addFunction)(int, int), int a, int b) { int res = addFunction(a, b); return res; } and here is the code in C#: public delegate int AddIntegersDelegate(int number1, int number2); public static int AddIntegers(int a, int b) { return a + b; } [DllImport("tester.dll", SetLastError = true)] public static extern int testDelegate(AddIntegersDelegate callBackProc, int a, int b); public static void Main(string[] args) { int result = testDelegate(AddIntegers, 4, 5); Console.WriteLine("Code returned:" + result.ToString()); } When I start this small app, I get the message from the header of this post. Can someone help, please? Thanks in advance, D

    Read the article

  • binary quicksort

    - by davit-datuashvili
    hi i want implement Binary quicksort algorithm from robert sedgewick book it looks like this public class quickb{ public static final int bitsword=32; public static void quicksortB(int a[],int l,int r,int d){ int i=l; int j=r-1; if (r<=l || d>bitsword) return ; while (j!=i) { while (digit(a[i],d)==0 && (i<j)) i++; while (digit(a[j],d)==1 && (j>i)) j++; int t=a[i]; a[i]=a[j]; a[j]=t; } if (digit(a[r-1],d)== 0) j++; quicksortB(a,l,j-1,d+1); quicksortB(a,j,r,d+1); } public static void main(String[]args){ int a[]=new int[]{4,7,3,9,8,2}; quicksortB(a,0,a.length-1,0); for (int i=0;i<a.length;i++){ System.out.println(a[i]); } } public static int digit(int m,int d){ return (m>>d)&1; } } but it show me error: java.lang.ArrayIndexOutOfBoundsException: 6 at quickb.quicksortB(quickb.java:13) at quickb.main(quickb.java:32) what is wrong?

    Read the article

  • How to check if my string is equal to null?

    - by Roman
    I want to perform some action ONLY IF my string has a meaningful value. So, I tried this. if (!myString.eqauls("")) { doSomething } and this if (!myString.eqauls(null)) { doSomething } and this if ( (!myString.eqauls("")) && (!myString.eqauls(null))) { doSomething } and this if ( (!myString.eqauls("")) && (myString!=null)) { doSomething } and this if ( myString.length()>0) { doSomething } And in all cases my program doSomething in spite on the fact that my string IS EMPTY. It equals to null. So, what is wrong with that?

    Read the article

  • Should we or should we not check in the classes folder in WEB-INF directory into SVN?

    - by Vatsala
    I use SVN, and am learning how to use it along with eclipse IDE. The first time I add classes to my package, there is no problem, the generated class files get into SVN smoothly. The moment I edit them, I get this message - "WEB-INF/classes" is obstructed. I try the "clean-up" command and the clean up command says "WEB-INF/classes" folder is locked. I use TortoiseSVN as my SVN client. I know why this is happening. It probably because the Eclipse overwrites all the files while generating classes and then causes this - Is it inappropriate to commit the class files into SVN? If not, what should I do to commit these class files smoothly?

    Read the article

  • How to submit upon a check or uncheck of checkbox in form?

    - by user281180
    I have the following in my form <td><input id="Notifications_0__IssueCreate" name="Notifications[0].IssueCreate" type="checkbox" value="true" /><input name="Notifications[0].IssueCreate" type="hidden" value="false" /></td> <td><input id="Notifications_0__AllChanges" name="Notifications[0].AllChanges" type="checkbox" value="true" /><input name="Notifications[0].AllChanges" type="hidden" value="false" /></td> In the partial view it`s wrriten as : <%int count = 0; %> <%foreach (var item in Model.List) {%> <tr> <td><%=Html.CheckBox("Notifications[" + (count) + "].IssueCreate", item.IssueCreate)%></td> <td><%=Html.CheckBox("Notifications[" + (count++) + "].AllChanges", item.AllChanges)%></td> </tr> <%} %> I want to submit to the controller upon each and every click on any of the checkbox. i.e, if user checks the checkbox, it sends the name of the checkbox and if selected or not to the controller, using ajax post. How can I do that?

    Read the article

  • PHP memcache - check if any server is available in pool?

    - by Industrial
    Hi everyone, I have the following code: $cluster['local'] = array('host' => '192.168.1.1', 'port' => '11211', 'weight' => 50); $cluster['local2'] = array('host' => '192.168.1.2', 'port' => '11211', 'weight' => 50); $this->memcache = new Memcache; foreach ($this->cluster() as $cluster) { $this->memcache->addServer($cluster['host'], $cluster['port'], $this->persistent, $cluster['weight'], 10, 10, TRUE , 'failure' ); } I would like to make a function that checks if any of my servers in my memcache Pool is available. How could this be done?

    Read the article

  • How can I implement a 'select all' check-box on my CRM 4 custom form?

    - by Gryphoenix
    I am working on a custom CRM form with numerous checkboxes, organized by sections. I would like to implement a 'select all' feature to the form and am trying to understand how to format the JavaScript. My research thus far has pointed me to the possibility of using a FOR statement to iterate through all of the elements in the section I want to process, setting their values accordingly, but am unsure of which document.getElements ... method to utilize.

    Read the article

  • You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

    - by user1810442
    Hi I keep getting SQL syntax error when i'm running my code in php, however when i remove the variables and do it manually in MYSQL, not a problem. I've tried 2 different versions of query one with (') and other with (") and nothing. Could you please help? Thank you. $produpdateid = $_GET ['id']; $varcat = $_POST['category']; $vartitle = strip_tags($_POST['title']); $varoverview = strip_tags($_POST['overview']); $varfeatures = strip_tags($_POST['features']); $varspecification = strip_tags($_POST['specification']); $varmaker = strip_tags($_POST['maker']); $varsize = $_POST['size']; $varprice = $_POST['price']; $varstock = $_POST['stock']; $vartype = $_POST['stock']; $q = 'UPDATE products SET products_category_id=' . $varcat . ', title=' . $vartitle . ', overview=' . $varoverview . ', features=' . $varfeatures . ', specification=' . $varspecification . ', size=' . $varsize . ', size_type=' . $vartype . ', maker=' . $varmaker . ', image=' . $varimg . ', price=' . $varprice . ', stock=' . $varstock .' WHERE id=' .$produpdateid; /*$test = "UPDATE products SET products_category_id=" . $varcat . ", title=" . $vartitle . ", overview=" . $varoverview . ", features=" . $varfeatures . ", specification=" . $varspecification . ", size=" . $varsize . ", size_type=" . $vartype . ", maker=" . $varmaker . ", image=" . $varimg . ", price=" . $varprice . ", stock=" . $varstock ." WHERE id=" .$produpdateid;*/ $updateresult = mysqli_query($dbc,$q);

    Read the article

  • Why is this ajax call being made even though it shouldn't be

    - by user2921557
    i have this validation script im working on but cant see why im having an issue. You can see that i have a check = false / true, check before it runs the ajax call. However, even if a field is empty and check is set to false, it is still running the call. so: // JavaScript - Update Password AJAX $(document).ready(function () { // When the form is submitted $('.updatepasswordform').submit(function () { var check = true; // Get the values var password1 = $("input[name=password1]").val(); var password2 = $("input[name=password2]").val(); var newpassword = $("input[name=newpassword]").val(); /* Password Validation */ // If fields are empty if (password1 === '') { check = false; $("input[name=password1]").css('border', 'solid 2px red'); } // If fields are empty if (password2 === '') { check = false; $("input[name=password2]").css('border', 'solid 2px red'); } // If fields are empty if (newpassword === '') { check = false; $("input[name=newpassword]").css('border', 'solid 2px red'); } if (check = true) { $.ajax({ type: "POST", url: "process/updatepassword.php", data: $(".updatepasswordform").serialize(), dataType: "json", success: function (response) { /* Checks for database validation, removed for space saving */ } }); } return false; }); });

    Read the article

  • How do check if PDO object is connected properly inside a different class?

    - by tgun926
    I want to fetch some information from my mysql database in a class, so I'm passing in the PDO object into a __construct function, and working from there. However, what's an elegant way of checking to see if the PDO object was correctly created, and that the connection is open when the Table class is instantiated? class Table{ public function __construct(PDO $db, $week){ try{ $query = $db -> query ("SELECT * FROM `table1` where `day` = 'monday'"); } catch(PDOExeption $e){ echo 'error: '. $e->getMessage(); //die(); } } } I don't think this code does what I want.

    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

  • Most performant way to check how many objects are referenced by an to-many relationship in Core Data

    - by dontWatchMyProfile
    Lets say I have an employees relationship in an Company entity, and it's to-many. And they're really many. Apple in 100 years, with 1.258.500.073 employees. Could I simply do something like NSInteger numEmployees = [apple.employees count]; without firing 1.258.500.073 faults? (Well, in 100 years, the iPhone will easily handle so many objects, for sure...but anyways)

    Read the article

  • AJAX in ASP.NET - How do I check a checkbox and have the action reflected in the database?

    - by hamlin11
    This is about as beginner as it gets regarding AJAX, but here it goes. I want to have one checkbox somewhere on an ASP.NET web form (ASPX). When the user clicks the checkbox, I want one of those spinning indicators to show. While that spinning indicator is showing, I want an update operation to occur in the database to reflect that the user has intended for that checkbox to be checked. update MyTable set CheckboxChecked = 1 Then, as soon as the update operation has occurred, I want that to be reflected in the checkbox by removing the spinning indicator and replacing it with the standard checked checkbox. I'm guessing this is done with an UpdatePanel and possibly an update statement followed by a looped call to a select statement... but I have never used AJAX before and have no idea how to go about it. Thanks!

    Read the article

  • Why can I check some event handlers for null, some not?

    - by Inno
    Hi, I have a ugly piece of code that adds event handlers. The problem is, if the code is called multiple times, the event handlers are called multiple times. To solve the problem, I remove the event handler first and then add it. Now I've seen the following behaviour: Some event handlers can be checked like: if (object.event == null) { // // Code // } others of the form if (object.object.event == null) { // // Code // } I get a message like 'object.object.event' may only occur left of -= or +=. (Since I'm using a german version of visual studio, I don't know the correct translation to english). I have no idea why the behaviour looks this inconsequent so I would be grateful for some information on this. To be more specific: It's user control. if (myControl.Event == null) { // // works // } if (myControl.TreeView.NodeMouseClick == null) { // // doesn't work // }

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >