Jump to content
xisto Community

kvarnerexpress

Members
  • Content Count

    413
  • Joined

  • Last visited

Everything posted by kvarnerexpress

  1. I am confused at how to make a linked list using recursion. I've been looking at the syntax and examples from the web for the past couple hours, but all seem to be based on an empty .java file. I need to put it in my code somehow. here's the code segment: public static boolean RecursiveTest (String s, int start, Node n) {// The linked listNode<char> bracket = new Node<char>();int size = s.length();char v = s.charAt(start);//String sElement = parens.top();boolean isGood = true;// ending "ifs"if (size == 0) { System.out.println("empty string"); return false; }if (start == size) return isGood;if (s.charAt(start) == '(' || s.charAt(start) == '[' ||s.charAt(start)== '{') {v.Push(sChar);System.out.println(sChar);return RecursiveTest(start+1, s.charAt(start));}else if (sChar.equals(")") && sElement.equals("(")) {parens.Pop();System.out.println(sChar);return RecursiveTest(start+1);}else if (sChar.equals("]") && sElement.equals("[")) {parens.Pop();System.out.println(sChar);return RecursiveTest(start+1);}else if (sChar.equals("}") && sElement.equals("{")) {parens.Pop();System.out.println(sChar);return RecursiveTest(start+1);}else if (sChar.equals(")") && !sElement.equals("(")) {System.out.println("bad");isGood = false;return isGood;}else if (sChar.equals("]") && !sElement.equals("[")) {System.out.println("bad");isGood = false;return isGood;}else if (sChar.equals("}") && !sElement.equals("{")) {System.out.println("bad");isGood = false;return isGood;}else return RecursiveTest(start+1);} // end of RecursiveTest I'm passing a string, 0, and a new node (i dunno about the last one there), from an above main class. This code is wrong, i know, but it's all I got done so far. How would I be able to make a linked list inside this method? NOTE: the Push() and Pop() are remnants from copy-paste from my stack method above that uses the same if and else-if statements. I need to replace them with the correct code for a working linked list Thanks,kvarnerexpress
  2. im having some trouble with this PHP Code: while ($checking = mysql_fetch_array($check)){ $usr = $checking['loguser']; $mail = $checking['logemail']; $error = ""; if ($mail == $email){ $erroremail = "the email address you have chose is already taken"; $error = 1; } if ($usr == $user) { $errorusername = 'the username you have chosen is already taken'; $error = 1; } } if (strlen($user) < '5') { $usernameerror = 'the username is too short'; $error = 1; } if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email)) { $emailerror = 'the email address isnt a valid email address'; $error = 1; } if (strlen($password) < '9') { $errorpass = 'the password is too short it must be at least 8 characters'; $error = 1; } if ($error == "") { $pass = md5($password); mysql_query("INSERT INTO login (loguser, logpass, logname, logsurname, logaddress, logarea, logcounty, logpostcode, logtelephone, logni, logemail, logcompanyid, logaccess) VALUES ('$user', '$pass', '$name', '$surname', '$address', '$area', '$county', '$postcode', '$telephone', '$ni' '$email', '$companyid', '".$_POST['access']."')") or die (mysql_error()); header("Location: ../index.php"); } For some reason the script is passing over the $error, if it does pass over $error == "" then it should display why the error has occured, but I cant get it to work :/ any idea, is there any better way to do this validation. Thanks,kvarnerexpress
  3. Can someone point me to an example in C# that does the following (I will use the Northwind database to explain), using a DataSet:1.) Add a Customer to the Customers table.2.) Add an Order to the Orders table with that new Customer's CustomerID.Basically, what I am not sure how to do, is figure out what the CustomerID is before adding the record to the Orders table. I thought I could do both 1 and 2 inside the DataSet, before calling Update, is this true? Or do I need to call Update after adding the customer in order for a CustomerID to be generated, and then do another Select statement to retrieve the CustomerID?I have seen a lot of examples of updating records in the Northwind database, but I haven't been able to find a sample that adds new records in both Customers and Orders.Thanks!kvarnerexpress
  4. This is my first time playing with cffile. I have the code working where the file gets uploaded to a folder on the server. Now I'd like to move it to a folder elsewhere where folks can access it. My problem is that I can't figure out how to reference the variable that holds the name of the file once it's been uploaded. I feel like an idiot because it should be something simple but it's not coming to me and nothing I try will work. How do you reference the filename once it's been uploaded? Thanks for any help! Here is the code on the submit page: Code: <FORM ACTION="UploadSubmit.cfm" METHOD="POST" name="UploadForm" enctype="multipart/form-data"><input type="file" name="UploadFile" id="UploadFile" size="40"><input type="submit" name="UploadSubmit" id="UploadSubmit" value="Submit"></FORM> And here is the code on the action page: Code: <cfif ISDEFINED("form.UploadSubmit")><cffile action="upload" filefield="UploadFile" destination="D:\DocLibrary\Docs" nameconflict="makeunique"> <cffile action="move" source="D:\DocLibrary\Docs\#????#" destination="F:\DocumentLibrary"></cfif> Thanks,kvarnerexpress
  5. I have a bit of code. I am sooo close to figuring out. The only thing I need it to do, is return back to the beginning of the if statement after the new input is entered to determine of the new input meets the requirements. Here is my code: Code: int input() //request input from user{ int size = 0, size_even = 0; cout << " Please enter an odd number between 3 and 25: "; cin >> size; size_even = size % 2; // if statement to determine if the number is between 3 and 25 if((size >= 3) && (size <= 25)) { // nested if statement to determine if the number is even or odd if(size_even == 0) { cout << " Invalid Entry! Please enter an ODD number between 3 and 25! "; cin >> size; } else cout << " This is an odd number. "; } else cout << " Invalid Entry! Please enter a number BETWEEN 3 and 25!"; cin >> size; return 0;} So for instance as it is now, if some one enters a number larger than 25, it prompts for a new number but that's it. I need it to prompt for the new number and then go back through the if statemtents to determine if it meets the conditions. Thanks for anyhelp provided. kvarnerexpress
  6. hello therewell i designed this image that includes text a logo i shall sayi am aware that i need to title it index.html when i upload the file i visit my website and it shows the file folder.now i only want that image i designed on there so when clients visit my site it only goes to that page the rest of my site isent done yet. i want it to be just like the sites you visit and it states underconstruction.programs ive tried: indesign, image ready, incopy cs2, dreamweaver.and i still dont understand please help meeh thanksoh and what classify's images html, css etc?kvarnerexpress
  7. I've stumbed across a problem where a database is designed so that the only way to get data in is to use a webpage. With a nice login page, frames, links, inputboxes, ect. Definitly a weird solution, and what's more, I wasn't able to talk the people into using something different.When a large amount of data is needed to be put there, I need some way to get html and send data back. I could go for sockets, but that simply seems a too low level approach. What I'm looking for is a library, of sorts, that allows to create a nice HTTP request, send it, get the data back, and a function to send some data, with specifying what goes into which form.The reason I'm posting in the C++ forum is, of course, that I want to code the app in C++.If anyone has any ideas on how that's done, I'll be thankful.kvarnerexpress
  8. i have a really old laptop running xp (meets the minium requirements)p3 at 500mhz192mb of ram5gb hdd (lol)so im trying toi wirelessly connect to the internet. i have been doing this for 2 years now with no problem, but all of a sudden it says it some issue with wireless zero configuration. so i goto support.ms.com and lo behold i have start a service called wireless zero config. so i goto start, BUT WAIT its not there. i ask my good friend command line to see if its running, but it says theres no service with the name!/helpedit: i think this happend more or less right after i installed sp2... i *think*kvarnerexpress
  9. I got a table with 1 row in it which shows a login form. The row should be displayed on 1 line. However, in IE this doesn't work. It seems to be spreading over 2 lines. html Code: <table class="tableBorder"><tr class="normalTableRow"> <td> Welcome, you are currently not logged in</td> <td align="right"> <form method="post" action="processing/login.php"> Username: <input type="text" name="name"> Password: <input type="password" name="password"> <input type="submit" name="subLogin" value="Login"> <input type="hidden" name="location" value="<?php echo currentLocation(); ?>"> </form> </td></tr></table> Is there anyway i can get a one line row in IE like i get in FF? Here are the relevant css classes: css Code: 1. .tableBorder { 2. width: 100%; 3. border-style: solid; 4. border-width: 0; 5. border-color: #BFACBF; 6. border-collapse: collapse; 7. border-spacing: 0px; 8. } 9. 10. .normalTableRow{ 11. border-style: solid; 12. border-width: 1px 1px 1px 1px; 13. border-color: #4D3D4D; 14. background-color: #BFACBF; 15. color: #4D3D4D; 16. vertical-align: top; 17. } 18. 19. .normalTableRow td{ 20. border-style: solid; 21. border-width: 0px; 22. border-color: #4D3D4D; 23. }
  10. I'm getting a error in my application, as below;EDBEngineError 'Unknown username or password'ORA-01017: invalid username/password; logon denied.Cause: My production server is Oracle 8i SE, with delphi 5 accessing backend and storing password using encoding and decoding function. It works fine in Oracle 8i SE or EE.Then i installed Oracle 9i EE in development server, and delphi 5 already exists, and I'm accessing my Oracle 8i SE from development server using front end application delphi 5, now i'm getting above error messages. It returns different PASSWORD charater.then again i reinstalled Oracle 8i in development server, that time my application runs fine.Now, we want to upgrade to Oracle 9i, there is any changes to be made in delphi code by which my application can run smoothly.Please help me out, kvarnerexpress.
  11. Hi all. I have some prob with log function. The code below is not working, it returns a false value. The value is not same with what I calculate using scientific calculator. Using my program: N=2 Na=1 log(N/Na)=0.6931 Using scientific calculator: N=2 Na=1 log(N/Na)=0.30102999566 Code: Na = 0temp = 0temp1 = 0rs.MoveFirstDo For column = 1 To rs.Fields.Count - 1 'If rs.Fields(column) <> Null Then If Not IsNull(rs.Fields(column).Value) Then Na = Na + 1 End If Next column N = rs.Fields.Count - 1 temp = Log(N / Na) temp1 = Format(temp, "0.0000") rs2.AddNew rs2!Na = temp1 rs2.UpdateNa = 0rs.MoveNextLoop Until rs.EOF kvarnerexpress
  12. As I know that setting has to be made to the application server to enable the class reloading features, so that the changes to the components (such as enterprise beans, servlets, and JSP files) to a running server can be deployed without having to stop the application server process and start it again.I'm just wondering, for those Web Hosting Company that offer JSP-compatible Web Servers services, are they forced to have the Class Reloading Feature enabled for their Web Server?? else how they can provided 7 x 24 service, as no downtime are allowed, please advise?kvarnerexpress
  13. I have just made a script that deletes a row in a mysql database using an image as a button. However it will only work in FireFox and not in IE. Can any one see away around this and help me root out the problem. This is the script in short: PHP Code: $query_products = "SELECT * FROM manufacturer ORDER BY name ASC";include('external_files/pagination.php'); // If the form was submitted, delete the items selected from the databaseif(isset($_POST['delete'])){ $query = 'DELETE FROM manufacturer WHERE manufacturer_id = '.(int)$_POST['delete']; // or die() doesn't go here $result = mysql_query($query) or print mysql_error();echo"{$row_products['manufacturer_id']}"; if ($result) { // If it ran OK. echo" <center><font color=\"#00CC00\">The manufacturer was Deleted!</font></center> "; $query_products = "SELECT * FROM manufacturer ORDER BY name ASC"; include('external_files/pagination.php'); } else { // If it did not run OK. // Send a message to the error log, if desired. echo"<div class='error'>The manufacturer could not be deleted due to a system error. We apologize for any inconvenience.</div>"; } }?><!-- Call your variables --> and: PHP Code: //.....etc etcdo { ?><form action="<?php echo $PHP_SELF; ?>" method="post"><? //Open all the items echo" <div class='item'> <div class='element'>{$row_products['name']}</div> <div class='element'>00/00/00</div> <div class='elementprimtool'>";?><input type="image" name="delete" src="images/delete.jpg" value="<?php echo $row_products['manufacturer_id'] ?>" /><?
  14. I really wasn't sure where to post this but here's my problem... I dowloaded what I thought was a CD image of a game I own (well I own the Playstation version so whatever I OWN IT!! ) but when I unzip it it's just some fool that copy pasted the root of the CD drive and zipped it. I don't want to waste my last CD-R's to burn them, and anyways I rather leave them on my HDD because it's faster than the CD drive... Which brings me to my question, is there a program I can use that converts a folder and all its subdirectories to a CD image format that I can mount in D-Tools or something? This game is old so I'm almost 100% sure no crappy kind of protection will get in my way...I can also try (and probably suceed) to hack the game's registry values to make it think my CD drive is some other folder but I would still like to know if such a program exists... Thanks.__________________My b0x:AMD XP Barton 2800+ @ Stock speed... too hot now2 x 512MB Kingston RAM for 1GB dual channel1 x 120GB HDD (soon another )SoundBlaster Audigy 2 ZS (0wN5!!!)ATI All-In-Wonder 9800 Pro (0wN5!!!)
  15. I have a form on my page. I do not have a submit button, but when I hit enter on my text field, it is like I am clicking on a submit button. My page refreshes to the original state, and my values are reset. I found this out because I made a submit button and tried it. Is there a way to get around this? I am trying to use a javascript that captures the key strokes. That works, but then the submit like event still fires after my code runs, nullifying any changes my code has made. html4strict Code: 1. <form name="FormPictureInfo"> 2. <table cellpadding="0" cellspacing="4" border="0" align="center"> 3. <tr> 4. <td align="center"><input type="text" name="ProductCode" size="22" maxlength="256" value="default" onFocus="clearBox(this);" /></td> 5. <td align="center"><div class="infotitle">Product:</div></td> 6. <td align="center"><div class="infotitle">Comments:</div></td> 7. <!--<td align="center"><div class="infotitle">Picture Date:</div></td>--> 8. <td valign="top" align="center"><div class="Descriptor" id="BagSize">Bag Size</div></td> 9. </tr> 10. <tr> 11. <td><table cellpadding="2" cellspacing="6" border="0"> 12. <tr> 13. <td valign="top" align="center"><input type="button" value="Display Picture" onclick="FillDataShowPic(document.FormPictureInfo.ProductCode.value);"/></td> 14. </tr> 15. <tr> 16. <td valign="top" align="center"><input name="ZoomButton" type="button" value="ZOOM" onclick="Zoom(document.getElementById('ProductCodeDisplay').innerHTML);"/></td> 17. </tr> 18. </table></td> 19. <td valign="top"><table cellpadding="0" cellspacing="2" border="0"> 20. <tr> 21. <td align="center"><div class="Descriptor" id="ProductName">Product Name</div></td> 22. </tr> 23. <tr> 24. <td align="center"><div class="Descriptor" id="ProductCodeDisplay">Product Code Display</div></td> 25. </tr> 26. <tr> 27. <td valign="top" align="center"><div class="Descriptor" id="PictureDate">Picture Date</div></td> 28. </tr> 29. </table></td> 30. <td valign="top" align="center"><div class="DescriptorArea" id="ProductComments">Product Comments</div></td> 31. <td><table cellpadding="0" cellspacing="2" border="0"> 32. <tr> 33. <td align="center"><div class="Descriptor" id="SetPoint">Set Point</div></td> 34. </tr> 35. <tr> 36. <td valign="top" align="center"><div class="Descriptor" id="Density">Density</div></td> 37. </tr> 38. <tr> 39. <td valign="top" align="center"><input type="button" value="Close" onclick="self.close();"/></td> 40. </tr> 41. </table></td> 42. </tr> 43. </table> 44. </form> Thanks,kvarnerexpress
  16. I whould like to write a program where users can have there own edit space. Now I use this app window and I placed a button. Next I scaled the screen so the button was out of sight. Now I scroll down to the button but... What happens is that before I release the mouse button I will not see the changing of scrolling so there is no button. After I released the button there will be however I like to see it real time.Does someone have an solution? Is there an other way to create such an edit space?Well I go search alone. But if someone could give me a push in the right direction I whould be verry greatfull.Greetings,kvarnerexpress
  17. I'm trying to write a program that reads all the messages from a Hotmail account, and then fowards to specific email accounts according to their "Subject". For exmaple the program will access my Hotmail account, read all the messages I have, and then forward the messages with the subject "billing support" to billing@mydomain.com or "technical support" to tech@mydomain.com.The last part of the program will be the easiest, but I'm stuck with the first part. How can I read/view email messages from my Hotmail or Yahoo account in a Visual Basic 6 appilcation??Thanks in advancekvarnerexpress
  18. Hi All, I am inplementing a preview function on a image file browser. The application displays a list of image file names, which the user can select (one at a time). The preview image is loaded into a JLabel. When an image file name is selected, the application creates a thumbnail image on the hard drive call "preview.jpg". The JLabel should then update itself with the newly created thumbnail "preview.jpg". For some reason I cannot get the Image in the JLabel to update. I have confirmed that "preview.jpg" is being rewritten, each time a new image file is selected from the list. It just wont update the JLabel image. I suspect the problem is due to the fact that the "preview.jpg" file name remains unchanged even though it has been rewritten (i.e. contains a new image). Is there some way I can force the JLabel to reload "preview.jpg" (Assuming that is the problem)? public void valueChanged(ListSelectionEvent e) { System.out.println("Selected Image Index: " + selectedFilesList.getSelectedIndex()); if (selectedFilesList.getSelectedIndex() == -1) { //Prevents an exception error caused when no item has been selected from the file list. System.err.println("Notice: returned index of -1!"); return; // Escapes from executing the rest of the method } File f = ((GalleryImage)imageFiles.elementAt(selectedFilesList.getSelectedIndex())).getImageFile(); System.out.println("Selected image: " + f.getPath()); try { Thumbnail.createImage(f, "preview.jpg", 90, 60); previewIcon = new ImageIcon("preview.jpg"); previewLabel.setIcon(previewIcon); previewLabel.repaint(); } catch(Exception e2) { // TODO Add Exception handling code. } } BY,kvarnerexpress
  19. Hi allI've been using XMLHttpRequest with PHP but the time has come where i need the features of perl! But i've fallen at the first hurdle....when using XMLHttpRequest with php you can send a response back by using "echo"I cant seem to find a way of sending a response back in perl, anyone know of something similar to echo? I've looked through LWP but couldnt find anything suitable??thankskvarnerexpress
  20. I know how to send back the check-boxes, so that's not the issue.I have a form that contains a group of 5 check-boxes.The user could select none, one, all, or any combination in between.I'm working on form validation right now and am doing most of it server side. The validation is set so that if the user has to go back all their data is retained.I'm using case statements, which work wonderfully, but in this circumstance I don't know what would be the best method that allows for a multitude of combinations. I think there is a possibility of something like 120 different combinations.What I want is for the check-boxes that were selected to be checked when it's sent back to the form.Would it be better to just send each box as its own separate entity and evaluate it that way?Thanks!kvarnerexpress
  21. This is a little confusing for me but:In my current configuration everytime I want to run a query on my db I create a new datasource. Should I be creating a new datasource every time that I wish to launch a query, or do I just create one (put it into the application scope) and have everyone use it? Would that cause problems with multiple users attempting to launch queries?Can someone explain the datasource a little better for me.kvarnerexpress
  22. i have a custom button on the local browser toolbar which points to a local html application (HTA). the browser launches the HTA when the custom button is clicked. i have to reference the parent browser window from the child HTA window.an instruction in the local HTAwindow.openersets or retrieves a reference to the window (the browser) that created the current window (the HTA).however, window.opener is returning null. the HTA is run under the mshta.exe process.how do i reference the browser from the HTA or javascript?i have winxp sp2 with ie6.0kvarnerexpress
  23. I'm working on sending some certain data to a server. Part of the process in gathering this data is done by using GetLocalTime() to get the current local time, this local time must then be converted to a FILETIME structure. I'm trying to get this done properly in Python, however my problem is that I do not know what my data will look like when the local time is converted to file time. I don't have the necessary compiler on my PC to test the code (for reasons I'm not going to waste time explaining, my main PC is temporarily unuseable and I'm using a much weaker PC). Can anyone show me an example of what value you would get if "2005/08/22 20:00:39" (which is local time) was converted to file time? I'm not necessarily asking you what the exact answer would be for this specific local time, but what would the value that that local time be converted to look like? Any help is appreciated.kvarnerexpress
  24. HiI need to setup failover on 2 NIC's on a Sunfire V240 running Solaris 9.I have researched the topic and it seems the best way is to have 3 IP's for the server. 2 deprecated physical IP's and logical 1 IP that the server is accesible by. You then group the interfaces into an IPMP group. The 2 physical links ping the gateway to check their status. The logical IP is used as normal.You setup the 2 deprecated physical links as fixed and then setup 1 logical floating IP. If all goes well, in case of a failure of a physical link, the floating IP will failover to the other physical link.I hope that makes sense? Anyway, my question is: Will the logical IP float back if the original failure is repaired?Doea anybody have experience with this? because I would like to discuss my configuration with them to see if Im doing it right.Thanks!kvarnerexpress
  25. I have a forum and just bought a domain. The forum is free and is hosted as a subdomain and has a relly long url. I wanted to make a index.html file for my domain and host it. I would like to make a frame in the index.html that would show the forum. I would like the index.html to look like the actual forum but is acutally just a frame. All i have is a text editor. How do i make a frame in the index.html that shows the forum?thankskvarnerexpress
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.