Search Results

Search found 2716 results on 109 pages for 'michael tanner'.

Page 92/109 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • php/mySQL error: mysql_num_rows(): supplied argument is not a valid MySQL result

    - by Michael Robinson
    I'm trying to INSERT INTO a mySQL database and I'm getting this error on: if (mysql_num_rows($login) == 1){ Here is the php, The php does add the user to the database. I can't figure it out. <? session_start(); require("config.php"); $u = $_GET['username']; $pw = $_GET['password']; $pwh = $_GET['passwordhint']; $em = $_GET['email']; $zc = $_GET['zipcode']; $check = "INSERT INTO family (loginName, email, password, passwordhint, location) VALUES ('$u', '$pw', '$pwh', '$em', '$zc')"; $login = mysql_query($check, $link) or die(mysql_error()); if (mysql_num_rows($login) == 1) { $row = mysql_fetch_assoc($login); echo 'Yes';exit; } else { echo 'No';exit; } mysql_close($link); ?> Thanks,

    Read the article

  • Is there anyway to "probe" a method in common lisp

    - by Michael Minerva
    My application allows the user to create their own methods indirectly and I later need to refer to these methods. I am wondering if there is a way (for error checking purposes) to test if a method exists without trying to execute it. If I just try and call the method and it doesn't exist this will crash my application.

    Read the article

  • Explaining a Ruby code snippet

    - by Michael Foukarakis
    I'm in that uncomfortable position again, where somebody has left me with a code snippet in a language I don't know and I have to maintain it. While I haven't introduced Ruby to myself some parts of it are quite simple, but I'd like to hear your explanations nonetheless. Here goes: words = File.open("lengths.txt") {|f| f.read }.split # read all lines of a file in 'words'? values = Array.new(0) words.each { |value| values << value.to_i } # looked this one up, it's supposed to convert to an array of integers, right? values.sort! values.uniq! diffs = Array.new(0) # this looks unused, unless I'm missing something obvious sum = 0 s = 0 # another unused variable # this looks like it's computing the sum of differences between successive # elements, but that sum also remains unused, or does it? values.each_index { |index| if index.to_i < values.length-1 then sum += values.at(index.to_i + 1) - values.at(index.to_i) end } # could you also explain the syntax here? puts "delta has the value of\n" # this will eventually print the minimum of the original values divided by 2 puts values.at(0) / 2 The above script was supposed to figure out the average of the differences between every two successive elements (integers, essentially) in a list. Am I right in saying this is nowhere near what it actually does, or am I missing something fundamental, which is likely considering I have no Ruby knowledge?

    Read the article

  • How much memory does a hashtable use?

    - by Michael
    Would a hashtable/hashmap use a lot of memory if it only consists of object references and int's? As for a school project we had to map a database to objects (that's what being done by orm/hibernate nowadays) but eager to find a good way not to store id's in objects in order to save them again we thought of putting all objects we created in a hashmap/hashtable, so we could easily retrieve it's ID. My question is if it would cost me performance using this, in my opinion more elegant way to solve this problem.

    Read the article

  • MYSQL Query using subquery

    - by Michael Quiles
    Cant get this to work can any one help. List the part number, part description, and on_hand value of each part whose number of units on hand is more than the average number of units onhand for all parts use a subquery? SELECT PART_NUM, DESCRIPTION, SUM(ON_HAND * PRICE) ON_HAND_VALUE FROM PART; WHERE MAX(ON_HAND); (AVG(ON_HAND) > ON_HAND);

    Read the article

  • How can I improve this regular expression?

    - by Michael Haren
    I want a regular expression to match valid input into a Tags input field with the following properties: 1-5 tags Each tag is 1-30 characters long Valid tag characters are [a-zA-Z0-9-] input and tags can be separated by any amount of whitespace Here's what I have so far--it seems to work but I'm interested how it could be simplified or if it has any major flaws: \s*[a-zA-Z0-9-]{1,30}(\s+[a-zA-Z0-9-]{1,30}){0,4}\s* // that is: \s* // match all beginning whitespace [a-zA-Z0-9-]{1,30} // match the first tag (\s+[a-zA-Z0-9-]{1,30}){0,4} // match all subsequent tags \s* // match all ending whitespace Preprocessing the input to make the whitespace issue easier isn't an option (e.g. trimming or adding a space). If it matters, this will be used in javascript. Any suggestions would be appreciated, thanks!

    Read the article

  • Forward traffic between two VLANs.

    - by Michael
    I have a small network with two VLANs. One is our internal network for basic file sharing, etc and the other is a public wifi network for our customers. The internal network is configured as 192.168.1.x and the public wifi is 192.168.11.x. We have one printer at 192.168.1.50. I would like to be able to have that printer available to our customer at 192.168.11.50. I suspect it can be done with iptables, but I'm brand new to it and I just can seem to work out the syntax. Can anyone offer any help? Oh, this is all running on a wrt54g router running Tomato.

    Read the article

  • (Java) Get value of string loaded into dynamic-type object?

    - by Michael
    I'm very new to Java (~10 days), so my code is probably pretty bad, but here's what I've got: ArgsDataHolder argsData = new ArgsDataHolder(); // a class that holds two // ArrayList's where each element // representing key/value args Class thisArgClass; String thisArgString; Object thisArg; for(int i=2; i< argsString.length; i++) { thisToken = argsString[i]; thisArgClassString = getClassStringFromToken(thisToken).toLowerCase(); System.out.println("thisArgClassString: " + thisArgClassString); thisArgClass = getClassFromClassString(thisArgClassString); // find closing tag; concatenate middle Integer j = new Integer(i+1); thisArgString = getArgValue(argsString, j, "</" + thisArgClassString + ">"); thisArg = thisArgClass.newInstance(); thisArg = thisArgClass.valueOf(thisArgString); argsData.append(thisArg, thisArgClass); } The user basically has to input a set of key/value arguments into the command prompt in this format: <class>value</class>, e.g. <int>62</int>. Using this example, thisArgClass would be equal to Integer.class, thisArgString would be a string that read "62", and thisArg would be an instance of Integer that is equal to 62. I tried thisArg.valueOf(thisArgString), but I guess valueOf(<String>) is only a method of certain subclasses of Object. For whatever reason, I can't seem to be able to cast thisArg to thisArgClass (like so: thisArg = (thisArgClass)thisArgClass.newInstance();, at which point valueOf(<String>) should become accessible. There's got to be a nice, clean way of doing this, but it is beyond my abilities at this point. How can I get the value of the string loaded into a dynamically-typed object (Integer, Long, Float, Double, String, Character, Boolean, etc.)? Or am I just overthinking this, and Java will do the conversion for me? :confused:

    Read the article

  • wordpress adnimistration page

    - by michael
    anyone know of a site that explains how wordpress created its appearances in wordpress (on the backend) i like how the navigation was created and i am trying to drill down to see what makes it tick but its a heck of a mess of code. has anyone launched anything online that you know of explaining how these peices were made? maybe something cleaner. thnx

    Read the article

  • JavaScript: Is there a better way to retain your array but efficiently concat or replace items?

    - by Michael Mikowski
    I am looking for the best way to replace or add to elements of an array without deleting the original reference. Here is the set up: var a = [], b = [], c, i, obj; for ( i = 0; i < 100000; i++ ) { a[ i ] = i; b[ i ] = 10000 - i; } obj.data_list = a; Now we want to concatenate b INTO a without changing the reference to a, since it is used in obj.data_list. Here is one method: for ( i = 0; i < b.length; i++ ) { a.push( b[ i ] ); } This seems to be a somewhat terser and 8x (on V8) faster method: a.splice.apply( a, [ a.length, 0 ].concat( b ) ); I have found this useful when iterating over an "in-place" array and don't want to touch the elements as I go (a good practice). I start a new array (let's call it keep_list) with the initial arguments and then add the elements I wish to retain. Finally I use this apply method to quickly replace the truncated array: var keep_list = [ 0, 0 ]; for ( i = 0; i < a.length; i++ ){ if ( some_condition ){ keep_list.push( a[ i ] ); } // truncate array a.length = 0; // And replace contents a.splice.apply( a, keep_list ); There are a few problems with this solution: there is a max call stack size limit of around 50k on V8 I have not tested on other JS engines yet. This solution is a bit cryptic Has anyone found a better way?

    Read the article

  • Are there Vi/Vim users who aren't touch typists?

    - by michael
    I'm trying to write a Vim tutorial and I'd like to start by dismissing a few misconceptions, as well as giving some recommendations. I don't know if I should dismiss touch-typing as a misconception, or include it as a recommended prerequisite. At the time I learned the editor, I had already been touch typing for a couple of years, so I have absolutely no idea what would be the experience of a two-fingered typist in Vim. Are you a vim two-fingered typist? what has your experience been like?

    Read the article

  • hiding file in address bar

    - by michael
    hi, i've created a php pagination system, but i want to hide the _GET variable in the address bar. atm mine looks like this http://address.com/images.php?page=1 but i've seen a few site that have http://address.com/images/1/. just wondering how they go about this? can anyone point me in the right direction, cheers

    Read the article

  • Queues And Wait Handles in C#

    - by Michael Covelli
    I've had the following code in my application for some years and have never seen an issue from it. while ((PendingOrders.Count > 0) || (WaitHandle.WaitAny(CommandEventArr) != 1)) { lock (PendingOrders) { if (PendingOrders.Count > 0) { fbo = PendingOrders.Dequeue(); } else { fbo = null; } } // Do Some Work if fbo is != null } Where CommandEventArr is made up of the NewOrderEvent (an auto reset event) and the ExitEvent (a manual reset event). But I just realized today that its not thread safe at all. If this thread gets interrupted right after the first (PendingOrder.Count 0) check has returned false. And then the other thread both enqueues an order and sets the NewOrderEvent before I get a chance to wait on it, the body of the while loop will never run. What's the usual pattern used with a Queue and an AutoResetEvent to fix this and do what I'm trying to do with the code above?

    Read the article

  • How to distribute the chance to display each SWF evenly among banner collection?

    - by Michael Mao
    Hi all: I am working on The ausdcf.org to try adding several banner ads in swf format to the top. Everything starts to work, but I've got several questions that need your help: The client chose not to go with Google AdManager, but prefer a "minimal approach" to do this task. What I am trying to do is sort of "mimicking" the way Google AdManager does for banners, that is, to split the chance of each particular swf to be shown to the visitor evenly among the banner collection. Definitely I can add some jQuery code to do this from client-side, a random number generator and if-else statement would work - just $.load() it! However, what if I'd like to make sure those disabled Javascript (is there any now btw?) still be able to see different swfs in each visit. Any suggestion on how to approach this? Many thanks in advance.

    Read the article

  • [C++] Start a thread using a method pointer

    - by Michael
    Hi ! I'm trying to develop a thread abstraction (POSIX thread and thread from the Windows API), and I would very much like it to be able to start them with a method pointer, and not a function pointer. What I would like to do is an abstraction of thread being a class with a pure virtual method "runThread", which would be implanted in the future threaded class. I don't know yet about the Windows thread, but to start a POSIX thread, you need a function pointer, and not a method pointer. And I can't manage to find a way to associate a method with an instance so it could work as a function. I probably just can't find the keywords (and I've been searching a lot), I think it's pretty much what Boost::Bind() does, so it must exist. Can you help me ?

    Read the article

  • When are temporaries created as part of a function call destroyed?

    - by Michael Mrozek
    Is a temporary created as part of an argument to a function call guaranteed to stay around until the called function ends, even if the temporary isn't passed directly to the function? There's virtually no chance that was coherent, so here's an example: class A { public: A(int x) : x(x) {printf("Constructed A(%d)\n", x);} ~A() {printf("Destroyed A\n");} int x; int* y() {return &x;} }; void foo(int* bar) { printf("foo(): %d\n", *bar); } int main(int argc, char** argv) { foo(A(4).y()); } If A(4) were passed directly to foo it would definitely not be destroyed until after the foo call ended, but instead I'm calling a method on the temporary and losing any reference to it. I would instinctively think the temporary A would be destroyed before foo even starts, but testing with GCC 4.3.4 shows it isn't; the output is: Constructed A(4) foo(): 4 Destroyed A The question is, is GCC's behavior guaranteed by the spec? Or is a compiler allowed to destroy the temporary A before the call to foo, invaliding the pointer to its member I'm using?

    Read the article

  • Cannot reach reach jQuery (in parent document ) from IFRAME

    - by Michael Joyner
    I have written a backup program for SugarCRM. My program sets a iframe to src=BACKUP.PHP My backup program sends updates to parent window with: echo "<script type='text/javascript'>parent.document.getElementById('file_size').value='".fileSize2human(filesize($_SESSION['archive_file_name']))."';parent.document.getElementById('file_count').value=".$_SESSION['archive_file_count'].";parent.document.getElementById('description').innerHTML += '".$log_entry."\\r\\n';parent.document.getElementById('description').scrollTop = parent.document.getElementById('description').scrollHeight;</script>"; echo str_repeat( ' ', 4096); flush(); ob_flush(); I have added a JQUERY UI PROGRESS BAR and I need to know how I update the progress bar on the parent window. I tried this: $percent_complete = $_SESSION['archive_file_count'] / $_SESSION['archive_total_files']; echo "<script type='text/javascript'>parent.document.jquery('#progressbar').animate_progressbar($percent_complete); </script>"; ......... and get this error in browser. Uncaught TypeError: Object [object HTMLDocument] has no method 'jquery' HOW CAN I UPDATE THE PROGRESS BAR IN PARENT DOCUMENT FROM THE IFRAME?

    Read the article

  • Form Closing help

    - by Michael Quiles
    How can I call the button1_Click event in the form closing event so I don't have to copy and paste the code from button1_Click? public void button1_Click(object sender, EventArgs e) { //Yes or no message box to exit the application DialogResult Response; Response = MessageBox.Show("Are you sure you want to Exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Response == DialogResult.Yes) // Exits the application Application.Exit(); } public void xGameThemeComboBox_SelectedIndexChanged(object sender, EventArgs e) { string folder = Application.StartupPath; string theme = (string)xGameThemeComboBox.Items[xGameThemeComboBox.SelectedIndex]; string path = System.IO.Path.Combine(folder, theme + ".jpg"); Image newImage = new Bitmap(path); if (this.BackgroundImage != null) this.BackgroundImage.Dispose(); { this.BackgroundImage = newImage; } } private void xGameForm_FormClosing(object sender, FormClosingEventArgs e) { // call button1_Click here }

    Read the article

  • How can specific the layout_width and layout_height of a Framelayout which fits an image

    - by michael
    Hi, I have an image which is 80px X 50 px, and I need to place that in one of the child of a FrameLayout, how can I specific the layout_width and layout_height of a Framelayout which fits an image without scaling it? I know there is a layout_height="wrap_content" layout_wight="wrap_content" for FrameLayout, but I can't use it, since that FrameLayout has other children. So I would like to hard code the FrameLayout width/height to match the dimension of the image? Should I use layout_width="80px" or layout_width="80dip"? Thank you.

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >