Jump to content
xisto Community

kvarnerexpress

Members
  • Content Count

    413
  • Joined

  • Last visited

Everything posted by kvarnerexpress

  1. I am developing a GUI using Netbeans...(Definitely recommended!)...and have a JComboBox which is populated from data from a MySQL database. I would like to do know two things really... 1. In Netbeans is there somewhere on the properties of the JComboBox where I can point to a method I have that returns a resultset so it automatically knows what I want to be the items within the JComboBox. I guess I am looking for an option very similar to what exists in Macromedia Dreamweaver and the way you select a textfield for example, point to your recordset/query, and then specify it's default values (possibly a surname from the query) If someone has come across something like that in Netbeans and could tell me... 2. I have listed my code below, it works so not asking for people to fix it, I just wanted to know if this is the correct way to go about populating the combo box with data. I am new to Java and obviously wery about whether or not I am doing things right. (Did not include all my GUI stuff) Code: import java.sql.Connection;import java.sql.ResultSet;import java.sql.SQLException;import java.util.ArrayList;public class preadvisorLogon extends javax.swing.JFrame { /** Creates new form preadvisorLogon */ public preadvisorLogon() throws Exception{ mdbc=new MyDBConnection(); mdbc.init(); Connection conn=mdbc.getMyConnection(); stmt= conn.createStatement(); ResultSet rs = getAgents(); //THIS BUILDS MY GUI, MUCH CODE TAKEN OUT initComponents(); //Fill JComboBox with values from query updateJComboBox(rs); } public ResultSet getAgents() { ResultSet rs=null; try{ rs=stmt.executeQuery("SELECT `Agent ID`,`Description` FROM `aar"); } catch(SQLException e){} return rs; } public void updateJComboBox(ResultSet rs) throws SQLException { while(rs.next()) { jcmbAgents.addItem(rs.getString("Description")); } } } thanks,kvarnerexpress
  2. Hi everybody, I have to do an excercise in C for my Operating Systems course and I am having some problems. The excercise is as follows: Write a C program P0, which creates 9 other processes P1, P2, ..., P9 where P0 is the father of P1, P1 the father of P2, and so on. All the processes are to contain an infinite loop. When all the processes are created P9 is to execute the command "ps". Then P9 is to kill P8, execute "ps", then kill P7, execute "ps", and so on till only the process P0 and P9 remain. What i've done is to create the nine processes. P0 does a fork. The child process executes p1 and the parent process enters and infinite loop. p1 to p8 do the same thing. p9 then executes ps. Up to here there are no problems, ps is executed and everything seems to be working fine, the PID and PPID are correct, and all the processes are marked as running. The problem I have is how to kill the parents of p9. I use the kill function, but for this I need the PID of the processes to kill. How can this be found? To see at least if the kill process does what's it supposed to do, I use the getppid() function to retrive the PID of process p9 and loop it back from there (not very elegant but should work in theory). With this pid I then use the kill function with the SIGKILL signal and the pid of the process to be killed. The problem here is that only p8 gets killed while the rest of the processes keep running! Therefore the process p9 does something like this: Code: int main() { execute_ps() kill_parents()}void execute_ps() { pid = fork(); if (fork != 0) wait(); else execl("/bin/ps","",0)}void kill_parents() { parent = getppid(); for (i=0; i<8; i++) { kill(parent, SIGKILL); parent--; execute_ps(); } execute_ps();} Any help/suggestions are welcome! Thanks a lot.kvarnerexpress
  3. Im having a strange problem and Im sure its some thing that ive over looked. A fresh set of eyes and suggestions would be great. Simple form to pass data to a function. On submit the function is accessed, but the data doesnt seem to get in to the check_status() I know the check_status is working, when i type in the data ... PHP Code: $checkform = "<form method=\"post\" action=\"test.php\"> <table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"> <tr> <td><strong>Messenger Service : </strong></td> <td><select name=\"ms\"> <option selected>Select</option> <option value=\"yim\">YIM</option> <option value=\"msn\">MSN</option> <option value=\"aim\">AIM</option> </select></td> </tr> <tr> <td><strong>User ID : </strong></td> <td><input name=\"id\" type=\"text\"></td> </tr> <tr> <td> </td> <td><div align=\"right\"> <input type=\"hidden\" name=\"opi\" value=\"docheck\"> <input type=\"reset\" name=\"Reset\" value=\"Reset\"> <input type=\"submit\" name=\"Submit\" value=\"IM Check\"> </div></td> </tr> </table> </form>";if ($opi != "docheck") { echo "$checkform"; } elseif ($opi == "docheck") { check_status('$ms', '$id', 0);} If I do PHP Code: check_status('blah' , 'blah' 0);Everything is fine ...... ideas? Thanks,kvarnerexpress
  4. I am trying to create margins for text placed in a div with a background image. The margin on the right doesn't work at all and the margin on the left works but creates a weird repetition of the left side of the image outside of the div. here is the html Code: <div id="maincontent"> <img src="../../images/pol_header.jpg"> <div class="politics"> <span class="robthought">Friday, October 15, 2005</span> <!--- This is where the story title gif goes --> <br><img src="../../images/article_image.png" alt=" Iraq result delay over fraud fear"> <br><a href="http://news.bbc.co.uk/1/hi/world/middle_east/4351680.stm" target="_blank">BBC News</a> <br><span class="body3"> Iraqi election officials say the formal result of the country's vote on a new constitution will be delayed, amid accusations of fraud. Officials said turnout from some areas seemed abnormally high and ballots needed to be double-checked. Some Sunni Arab politicians have alleged that corrupt practices were allowed to boost the Yes vote.</span> </div><!-- Politics --><img src="../../images/pol_footer.jpg"></div><!-- Main Content --> and here is my css Code: #maincontent {float:left; width:500px; clear:right;}.politics {width:500px; background-image:url(imagespol_back.jpg); padding:0 50px 0 45px; text-align:left;} so if anyone could tell me what i am doing wrong or why the code is acting like this that would be a great help. thanks!kvarnerexpress
  5. I'm trying to do random numbers... I use Randomize() ; and then run Random() ; several times in a loop the only trouble is that each time I run the program the output is the same each pass through the loop.. ie... it's supposed to output a random number on each of three passes through the loop... it's actuall.. Code: function RandomFunction(): Integer;var x: Integerbegin x := Random(12) + 1; Result := x;end;procedure Main;var i: Integer;begin Randomize(); for i := 1 to 3 do showmessage(IntToStr(CallMyFunction()));end; so... it'll output 4 three times, and then i'll run it again and it'll output 7 three times... grrrrr i'm pretty sure i remember something about the Randomize() function being linked to the system clock, but I don't remember how... or necessarily all the implications of it... though I do remember that I'm not supposed to call it in the loop... thanks,kvarnerexpress
  6. I've got the following function, that has a function inside of it, when I run it I get the followin error: PHP Code: Fatal error: Call to a member function on a non-object in See the code below where I get the error message. I'm guessing the scope of my varaibles is messed up, but I'm not sure how to fix it. I've abbreviated the code so as to make it easier to read. PHP Code: function getMemberRegistrationForm( &$tpl, &$db ){ function displayRegistrationForm( $action, &$db, $defaults = NULL, $id = NULL ) { global $registrationForm; $registrationForm = new HTML_QuickForm('registrationForm'); $registrationForm->addElement('text', 'lname', 'Last Name:', array('size' => 40, 'maxlength' => 255 )); } if( $registrationForm->validate() ) // <-This is where I get an error { $registrationForm->freeze(); } else { displayForm( $registrationForm, $tpl, 'additional_content'); }}getMemberRegistrationForm( $tpl, $db); Thanks,kvarnerexpress
  7. I am working on a program to control Pan/Tilt/Zoom cameras. I have determined that these cameras require 6 bytes of information in hex format. I wrote a program to listen to an RS485 port in my PC and was able to sniff out some commands from another controller. The commands consist of a start string, a cameras id, three command bytes, and a parity byte. Since the camera id can be many different values, I believe the parity value will also change. The folks who make the camera were kind enough to provide me with some information. Specifically, they provided me with a function written in C to calculate the parity byte. However, I'm writing this program in Delphi. Is there anyone who can explain what this code is doing or maybe how to easily get it into another language, like Delphi? Code: void parity(unsigned char *cmd){ unsigned int temp0, temp1, temp2; temp0 = cmd[0] ^ cmd[3]; temp1 = cmd[1] ^ cmd[4]; temp2 = cmd[2] ^ cmd[5]; temp1 <<= 2; temp2 <<= 1; temp0 ^= temp1 ^ temp2; temp1 = temp0 & 0x07; temp0 >>= 3; temp1 ^= temp0 & 0x07; temp0 >>= 3; temp1 ^= temp0 & 0x07; temp0 >>= 3; temp1 ^= temp0 & 0x01; temp1<<=5; cmd[5] |= (temp1 & 0xe0); return;} I would greatly appreciate any help. As always, I appologize if I have posted this in the wrong forum Thanks,kvarnerexpress
  8. I've come across a weird problem that I just can't seem to solve. Internet Explorer will not go to http://de.norton.com/. I get a 500 Server Error that reads:Server ErrorThe following error occurred:Could not connect to the serverI have checked trusted/restricted sites and my HOSTS file, and everything in them is normal - nothing that would cause a problem. Now the strange thing is that I can ping it fine, tracert it fine, AND connect to the website fine with FireFox. While I try to use IE as little as possible (I'm using FireFox more and more), I still do so and this strange error is really causing me to scratch my hair.Does any one have any ideas as to what this problem could be?Thanks,kvarnerexpress
  9. First, I'm aware that IE does have some type of issue displaying transparent PNG's (though from what I've read, it just confuses me more than helps me understand).My site (a hurricane tracking site) has (or will soon) several hundred images. What I'm trying to do is have two base images, black and white, and color. Then I have storm tracks drawn on the transparent PNG. Now, both of these images (either the bw or color) and the PNG are displayed with the PNG being offset the height of the base image. The reason I'm doing this is because the user has the ability to switch between color and b/w views. By doing it this way, I can have ~500 images of the tracks or ~1000 images (if I were to draw them on both the b/w and color maps). Plus, if I choose to change the base images, I only have two images to update as opposed to 500-1000 (if not more).Now, FF, Net, and Opera handle the transparency fine (though Opera offsets the PNG to the right, but I'm not worried about Opera right now). IE does not, therefore it shows just the storm tracks on a white background (though, at least when I refresh, I can see the base image in the background so I know it's there, but it gets covered by the PNG).Like I said, I know IE has issues with transparency and I wouldn't be asking this except for one thing: My header and logo are transparent and IE handles them fine. I know because I changed the bg color of my page. So, that leads me to believe that it's something in the formatting of the image. But I haven't done anything differently with the map PNG that I've done with the logo and header.If anyone could take a look at it or provide some suggestions, I would certainly appreciate it. I have to admit I'm not familiar with the differences between 8/16/24-bit PNGs and whatever else, so bear with me. I just really would like to figure it out why this is happening.Thanks in advance.kvarnerexpress
  10. Hi, Never hapened to me since HTML was invented. I've got a webpage ( h.shtml - I've also tryed .htm, .html ) with the following code: Code: <html><head><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Horoscope</title></head><body><div align="center"> <center> <table border="0" cellpadding="2" cellspacing="4" style="border-collapse: collapse" bordercolor="#FFFFFF" width="500" id="AutoNumber1"> <tr> <td width="100%" colspan="2"> <p align="center"><img border="0" src="pic_01.gif" width="500" height="540"></td> </tr> <tr> <td width="50%"> </td> <td width="50%"> </td> </tr> <tr> <td width="50%"> </td> <td width="50%"> </td> </tr> </table> </center></div></body></html> pic_01.gif is in the same directory. But the browser doesn't show it - it stays in "download mode", as if it was fetching the image from another server instead of my local computer... If I use another image, everything's allright. Is there a logical explanation for this?
  11. I think I have nearly managed to create a JNLP file and get my application running successfully. Unfortunately I am having a problem connecting to a MySQL database when using Java Webstart, the error that I get is shown below which incidently works fine when I run the app from eclipse. Has anyone successfully managed to connect to MySQL using Java Web Start, if so could you please explain why the regular doesn't work in more detail or perhaps post an example of simple connection java file so I can edit it so it works with what I have already developed. Thanks in advance guys/gals Code: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 192.0.0.18:3306 connect,resolve)** BEGIN NESTED EXCEPTION ** java.net.SocketExceptionMESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 192.0.0.18:3306 connect,resolve)STACKTRACE:java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 192.0.0.18:3306 connect,resolve) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:143) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:225) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1805) at com.mysql.jdbc.Connection.<init>(Connection.java:452) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at ResultSetTableModelFactory.<init>(ResultSetTableModelFactory.java:23) at PreAdvisor.main(PreAdvisor.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source)** END NESTED EXCEPTION ** at com.mysql.jdbc.Connection.createNewIO(Connection.java:1875) at com.mysql.jdbc.Connection.<init>(Connection.java:452) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at ResultSetTableModelFactory.<init>(ResultSetTableModelFactory.java:23) at PreAdvisor.main(PreAdvisor.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) thanks,kvarnerexpress
  12. I want to call a C routine from Perl program. For this I understand that, I should use XS interface language & write some layer between Perl and C. Can anyone tell me the following:1. What are development tools & settings I need to have for this development?2. What are the steps to carryout for developing the interface and connect to Perl?Please note that, I am new to this kind of work. However, I have experience on C & to some extent Perl.I am in hurry..please help me.Thanks in advance,kvarnerexpress
  13. Just for fun, I made my own encryption system. I was wondering if people had any suggestions or could write code to break it. Code for encryption system, use amfrencrypt() to encrypt and amfrdecrypt() to decrypt PHP Code: function amfrencrypt($string, $password){ $password = md5($password); $encnum = 0; for($k = 0; $k < strlen($password); $k++) { if(is_string($password{$k})) { $encnum += ord($password{$k}); } } if($encnum == 0) { die('Invlaid password!'); } for ($i = 0; $i < strlen($string); $i++) { $str[] = $string{$i}; } $count = count($str); for($j = 0; $j < $count; $j++) { $encstr[] = ord($str[$j]) * $encnum; } $return = implode(':', $encstr); return $return;}function amfrdecrypt($string, $password){ $password = md5($password); $str = explode(':', $string); $encnum = 0; for($k = 0; $k < strlen($password); $k++) { if(is_string($password{$k})) { $encnum += ord($password{$k}); } } if($encnum == 0) { die('Invlaid password!'); } $count = count($str); for($j = 0; $j < $count; $j++) { $encstr[] = chr($str[$j] / $encnum); } $return = implode('', $encstr); return $return;} I am not planning to use this encryptions system, and if you do, please dont sue me if someone decrypts all your data! kvarnerexpress
  14. I am attempting the following for a real estate website. I want to list the agents for the office all of whom have a unique identifier with an Auto Number type. As I loop through the recordset, I also want to open another table called listings. This table has a field called agent whose value is a number and corresponds to an agent in the agent table. If there is a listing in the listing table, I want to insert a link to "View Listings", if not, no link. I am having a hard time doing this and if someone could point me in the right direction I'd appreciate it. I tried the Find method but to no success.kvarnerexpress
  15. Is there a way to make the text on a page stay the same size, even if the user clicks on the 'Enlarge text size' button or the 'Decrease text size' button within browsers.I know you can use an image, but that makes the site too big.I also am aware of the need to give the user control, but for particular reasons a particular section of text on the site needs to stay the same size. It doesn't matter if the text around it is enlarged or decreased. It is just a particular section. Any suggestions appreciated.Also, as an aside, is there a way you can completely disable the function, just like you can disable the right mouse click, etc.Thanks.kvarnerexpress
  16. hi,I am fairly familiar with .NET and ASP.NET environment. I amnew to Java world, and have been told that the work will bein Apache webserver, Tomcat, and will be using jsp/servlets.So far, I have installed Apache webserver and Java 2 EE. Howdo I get started with servlets and jsp pages? Are servlets andjsp pages same? I am able to code/compile/run java programs.I can't seem to find more information about how to proceed.Most of java docs on sun website seems to concentrate onWeb Services. Is jsp an obsolete technology, and that Ishould concentrate more on web services?Any help to get me started is much appriciated.Thanks,kvarnerexpress
  17. I've been given a working document to update with some new info. So, no problems I thought, but, when I'm editing it, I need to hightlight some parts by either changing the font, and either bolding it or putting the text in italics. Here lies the problem, when I try that, it changes the whole document, not just the highlighted text. Anybody know what's wrong with it ??I have a feeling whoever wrote it or edited it last has buggered the formatting and I can't seem to get this fixed out. Is there anway to remove this other than re-writing the whole document ??Cheers for any ideas on this guys.kvarnerexpress
  18. Up until now I have never had a problem with Dreamweaver templates. I use a 2 layer nested table to control most of my site..The master template includes the website header and footer and master navigation bar..My nested templates include a context sensitive secondary navigration element.This templates allow me to change all aspects of the site rapidly.Recently, I have been adding multiple levels of site security using Coldfusion. This requires me to include some security directives in the header so my idea was to create a second editable region in the master template that was located in the <head> section.I added the region, which worked and then I added the various directives to each nested template.However, when I create a new page from a nested template the code in the <head> section remains editable - when in fact it should be uneditable - and worse still the code does not update when the template is altered.I know this sounds very long winded but I was wondering if anybody else has noticed problems incorporating editable regions into the <head> tage using Dreamweaver templates..kvarnerexpress
  19. I'm using Delphi6 and IBObjects 4.0 and I'm trying to import data into my firebird databasefrom a dbf file using IB_Import and i'm notsucceeding.I managed to import data from an ordinarytext file and from an exported text file from a dbf fileusing foxpro, but not from a regular dbf file.Couldyou give me a little help on this.I would begreatfull!kvarnerexpress
  20. I just have a really simple annoyin prob with my site which I have only just noticed. If i view the site in IE the alignment is fine but when in Firefox it isnt properly aligned. The user searches the db and it returns a table with the results.. PHP Code: echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter. '<th><table border="1" width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';IE reads this as the echo "Artists.. " bit within the table but Firefox puts the "Artists.." part outside and so then its tight against the left side instead of indented. I have tried CSS but it doesnt seem to b working..all my other css works fine just not this. Can anyone suggest a way round it? Thanks,kvarnerexpress
  21. Im trying to search a linked list to delete a record which is in a file that works. But im now trying to match only part of the string partial string matching. Im using strstr but i cant seem to get it working i get too few arguments error. And i also would like to know if im on the right track as to how im coding it. Any hints and tips would be greatly appreciated thanks. Code: /***************************************************************************** Menu option #3: Delete Record* Allows the user to remove one or more records from the customer and/or* stock linked lists. Partial string matching is implemented.****************************************************************************/void deleteRecord(TennisStoreType* ts){ StockNodeType* curStock; StockNodeType* prevStock; CustomerNodeType* curCust; CustomerNodeType* prevCust; char inputString[DESCRIPTION_MAX + 1]; char *description; char tmpsurname[SURNAME_MAX]; char *surname; char answerInput; char *firstName; char *subDesc; int finished; do { printf("\n\nInput String (1-40 characters) "); fgets(inputString, DESCRIPTION_MAX +2 , stdin); /* check if the input is longer then the buffer (40 chars) Validating input of 40 characters for string*/ if(inputString[strlen(inputString) -1] != '\n') { printf("\nProduct description too delete less then 40 chars!\n"); readRestOfLine(); /* flush the buffer */ } if(inputString[0] == '\n') { printf("Returning back to main menu\n"); finished = FAILURE; } }while(inputString[strlen(inputString) -1 ] != '\n'); /* tokenize the data fields to be searched*/ description = strtok(inputString, "\n"); surname = strtok(inputString, "\n"); firstName = strtok(inputString, "\n"); curStock = ts -> headStock; prevStock = NULL; curCust = ts -> headCust; prevCust = NULL; printf("Are you sure you want to delete\n"); do { answerInput = fgetc(stdin); if(answerInput == 'y') { printf("you pressed yes!\n"); } else if(answerInput == 'n') { printf("You pressed no!\n"); return; } } while (answerInput != '\n'); strcpy(inputString, subDesc); if(subDesc = strstr(("Slazenger Classic Racquet"), ("Slazenger")) != NULL) { printf("found a match %s", inputString); } else { printf("no match!"); } while((curStock != NULL) && ((curCust != NULL) && strcmp(inputString,curStock->description) && strcmp(inputString, curCust -> surname) && strcmp(inputString, curCust -> firstName)!= MIN_INPUT)) { prevStock = curStock; curStock = curStock->nextStock; /* searching through the customer nodes if not null keep getting the next node for searching*/ prevCust = curCust; curCust = curCust -> nextCust; } if ((curStock == NULL) || (curCust == NULL)) { printf("This item is not listed! \"%s\" .\n", inputString); printf("Try again\n"); return; } else if ((prevStock == NULL) || (prevCust == NULL)) { ts->headStock = curStock->nextStock; ts->headCust = curCust -> nextCust; } else { prevStock->nextStock = curStock->nextStock; prevCust ->nextCust = curCust -> nextCust; } ts-> stockCount --; ts-> customerCount--; printf("\nTotal stock or customer after deletion: %d\n" , ts -> stockCount); printf("%s", inputString); } Thanks,kvarnerexpress
  22. Norton's System Works Predicament.... Does anyone have any ideas how to COMPLETELY remove NORTON from the system, W2K Pro. I have gone into the system and removed every trace of Norton and Symantec and anything else that looks like them. I have gone to Norton's web site and downloaded and used all of their prescribed cleaning tools and suggestions and still to no avail, I can't get rid of it. It says its' gone but it's NOT..... What happened is this, I inadvertently uninstalled too much of Norton's Systems Works originally. All I wanted to do was remove the virus portion and later found files on the system and started deleting. That is what got me in trouble, too much too quick..... Now, I cannot reinstall any part of Norton's System Works. The attempted reinstallation tells me that the selection of programs I want to install are already installed and the one selection that it will let me install, I get a message, (Windows window) ?Please insert the disk DJS shared licensing? and of course I do NOT have such a disk..... Can anyone shed some light on my predicament ?Thanks,kvarnerexpress
  23. I created an html page using Dreamweaver with encoding set to gb2312 to display chinese charracters. While I am working on the website I uploaded all files to a free host and everything is fine. The characters are displayed properly. After I finished the site, I uploaded all files to the actual host and the characters are not displayed properly. The only thing these two hosts is different in is that the actual server (where the character are not displayed properly) is in passive mode. Do you think this (passive mode) is why the characters are not displayed properly? Thanks for your help.kvarnerexpress
  24. I've recently acquired DelphiX and have gone through multiple tutorials on how to use it efficiently. However, through programming, I've come across code from a tutorial that was discontinued and I'd like to finish it for learning. The code's for an isometric tiling engine for a game, but the problem is that the FPS rate is EXTREMELY slow come rendering extremely large maps. It crawls at a rate of 5-7FPS, even on pretty powerful machines. (I'll include the code below.) Now, the code itself draws out at each interval of the timer (which I know is a bad way to do things) but there are animated tiles (6 frames each tile), so I don't know any alternative method to bypass the drawing of unupdated tiles. I know that it should only redraw when it needs to, but this is for a game so it should be redrawing quite often. I have looked elsewhere, but found no solutions and I have probed at the code for a few days now. Any suggestions/fixes/sample code would be nice. Code: unit uGame;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, DXDraws, StdCtrls, ExtCtrls, DXInput, DXClass;const TileHeight=15;type TTile = Record TileImage:Integer; Marked:Boolean; end;type TTileMap = Record Map:array[1..50,1..50]of TTile; end;type TMainForm = class(TDXForm) DXDraw: TDXDraw; TileMaps: TDXImageList; DXTimer: TDXTimer; DXInput: TDXInput; Panel: TPanel; Markers: TDXImageList; procedure DXTimerTimer(Sender: TObject; LagCount: Integer); procedure FormCreate(Sender: TObject); procedure DrawTiles(StartX,StartY:Integer); procedure CheckTiles(X,Y:Integer; var XTile, YTile: Integer); procedure DXDrawMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private { Private declarations } public { Public declarations } end;var Frame:Integer; MainForm: TMainForm; Map:TTileMap; StartX,StartY:Integer; TileX,TileY:Integer;implementation{$R *.DFM}procedure TMainForm.DrawTiles(StartX,StartY:Integer);var PosX,PosY,LoopX,LoopY,XTile,YTile,NumOfTilesY,TileImage:Integer;begin PosY:=0; PosX:=1; NumOfTilesY := 0; for LoopY := 1 to 49 do begin NumOfTilesY := NumOfTilesY + 1; XTile:=1; YTile:=LoopY; for LoopX := 1 to NumOfTilesY do begin TileImage:=Map.Map[XTile,YTile].TileImage; TileMaps.Items[TileImage].Draw(DXDraw.Surface,StartX+PosX+LoopX*64,StartY+LoopY*15,Frame); if Map.Map[XTile,YTile].Marked then begin //Markers.Items[0].Draw(DXDraw.Surface,StartX+PosX+LoopX*64,StartY+LoopY*15,0); end; XTile:=XTile+1; YTile:=YTile-1; end; PosX:=PosX-32; PosY:=PosY+15; end; for LoopY := 1 to 50 do begin XTile:=LoopY; YTile:=50; for LoopX := 1 to NumOfTilesY do begin TileImage:=Map.Map[XTile,YTile].TileImage; TileMaps.Items[TileImage].Draw(DXDraw.Surface,StartX+PosX+LoopX*64,StartY+PosY+LoopY*15,Frame); if Map.Map[XTile,YTile].Marked then begin //Markers.Items[0].Draw(DXDraw.Surface,StartX+PosX+LoopX*64,StartY+PosY+LoopY*15,0); end; XTile:=XTile+1; YTile:=YTile-1; end; NumOfTilesY:=NumOfTilesY-1; PosX:=PosX+32; end; // draw map marker here, above all tiles... //Markers.Items[0].Draw(DXDraw.Surface,StartX+PosX+LoopX*64,StartY+PosY+LoopY*15,0); end;procedure TMainForm.DXTimerTimer(Sender: TObject; LagCount: Integer);begin if not DXDraw.CanDraw then Exit; DXDraw.Surface.Fill(0); Panel.Caption:='FPS: '+IntToStr(DXTimer.FrameRate) +' TileX: '+IntToStr(TileX) +' TileY: '+IntToStr(TileY); DrawTiles(StartX,StartY); DXDraw.Flip; DXInput.Update; { Check for mouse input here } If isLeft in DXInput.States then StartX:=StartX+16; If isRight in DXInput.States then StartX:=StartX-16; If isUp in DXInput.States then StartY:=StartY+8; If isDown in DXInput.States then StartY:=StartY-8; If (Frame=5) then Frame:=0 else Frame:=Frame+1;end;procedure TMainForm.FormCreate(Sender: TObject);var i,ii: integer;begin Frame:=0; StartX:=0; StartY:=0; for i := 1 to 50 do for ii := 1 to 50 do Map.Map[i,ii].TileImage := Random(16); // 0-12 DXTimer.Enabled:=True;end;procedure TMainForm.CheckTiles(X,Y:Integer; var XTile,YTile:Integer);var LoopX,LoopY:Integer;begin for LoopY := 1 to 50 do begin if (Y-((0.46875)*(X-StartX)+StartY+(LoopY*30))<15) and (Y-((0.46875)*(X-StartX)+StartY+(LoopY*30))>(-15)) then begin YTile:=LoopY; end; end; for LoopX := 1 to 50 do begin if (-(0.46875)*(X-StartX)+StartY+(LoopX*30)-Y<15) and ((-0.46875)*(X-StartX)+StartY+(LoopX*30)-Y>(-15)) then begin XTile:=LoopX; end; end;end;procedure TMainForm.DXDrawMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin Map.Map[TileX,TileY].Marked:=False; CheckTiles(X-96,Y,TileX,TileY); Map.Map[TileX,TileY].Marked:=True;end;procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin if key = 27 then Application.Terminate();end;end. Note: I've added the onKeyDown method for exiting. There used to be two buttons on the form, but that messed the control up when it came to scrolling with the keys. Note2: If anyone knows how to scroll with the mouse, I'd really like to learn that. Thanks to anyone that helps! kvarnerexpress
  25. Hi I have used vb to link to an access 2003 database using the adodc component- (connection string etc etc). Right I am now working with mysql (which I would like to say I am loving it) and I have migrated the access 2003 db's into mysql using the migration toolkit . How can I link to mysql db in a similar fashion. Please reply.Thanx.kvarnerexpress
×
×
  • 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.