Jump to content
xisto Community

kvarnerexpress

Members
  • Content Count

    413
  • Joined

  • Last visited

Everything posted by kvarnerexpress

  1. Im having trouble getting my PHP to work. Basically i have a form with a button linking to a php file. When i click submit it calls this file and is suppost to add the data to a database. Im using a my sql databse and it connects fine. Unfortunately when i click submit all i get is the "Inspection did not add". From this i know i have made a connection with the database and im absolutely 100% sure that all field names are correct on the forms and database. Any ideas? Heres the script.... PHP Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> </body> <?php $host="localhost"; $username="***"; $password="***"; $db_name="***"; $tbl_name="InspectionRequest"; // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row mysql_query("INSERT INTO `InspectionRequest` (JobRef, ContactNam, ContactTel, Location, InspcType, Date, TimePref) VALUES ($JobRef, $ContactNam, $ContactTel, $Location, $InspcType, $Date, $TimePref )"); if($count==1){ session_register("AddInspection"); header("location:/Index.html"); } else { echo "Inspection did not add."; } ?> </html>
  2. I've been working on this asp project for a few days now and i finally got it to a point where i wanted to put it up on my server to have a few other people hit against it and see what they could break. I ran a clean all and published the files then placed them on the server. When i hit the page i received this error: Code: Server Error in '/' Application.--------------------------------------------------------------------------------Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30456: 'Culture' is not a member of 'ASP.index_aspx'.Source Error: Line 1: <%@ page language="VB" autoeventwireup="false" inherits="_Default, App_Web_index.aspx.cdcab7d2" culture="en-US" %>Line 2: Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/; Source File: D:\SITE\WEBPAGES\index.aspx Line: 1 My asp.net framework is up to date, and IIS has been set to the 2.0 framework. I've been banging my head for many many hours trying to get this to work. If anyone see's something that would not make this work. Help would be grand.
  3. I'm making a program which uses several windows. I thought I'd reduce the amount of coding in my program by making a function which does everything that is needed to open a window, since all of the windows I need are basically the same. In fact, the only way they really differ is that they all use different message procedures. The code below, therefore, accepts a window class which already has a value in the .lpszClassName variable and the .lpfnWndProc variable. The rest of the window class in then filled with default values, the class in registered, a window is created and then the window class is immediately unregistered. After that graphics are enabled and the window is scaled, but that's incidental to the problem (I think). The function returns a handle to the window that it has created. The problem is that the window classes aren't unregistering, so when I try to create the same window again the error message box pops up. You can see that I'm printing the return value of the UnregisterClass statement to the console, and the value that's printed out is always zero. I've read on msdn that this means that the statement has failed, for whatever reason. If anybody has any idea what is causing it to fail, I'd be extremely glad of any advice. HWND OpenWindow(HINSTANCE Instance, int CmdShow,HDC* DeviceContext, HGLRC* RenderContext,const int WindowWidth, const int WindowHeight, const char* WindowTitle,WNDCLASS WindowClass) {/* Definition of the window class */WindowClass.hInstance = Instance;WindowClass.style = CS_DBLCLKS; WindowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);WindowClass.hCursor = LoadCursor(NULL, IDC_ARROW); WindowClass.lpszMenuName = NULL; WindowClass.cbClsExtra = 0; WindowClass.cbWndExtra = 0; WindowClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); /* If the window class fails to register then display message box and exit */if(!RegisterClass(&WindowClass)) {MessageBox(HWND_DESKTOP, "Window registration failed", "Error", MB_OK | MB_ICONWARNING);return NULL;}/* Creation of window */HWND WindowHandle; WindowHandle = CreateWindow(WindowClass.lpszClassName, WindowTitle,WS_OVERLAPPEDWINDOW |WS_CLIPCHILDREN,CW_USEDEFAULT, CW_USEDEFAULT, WindowWidth, WindowHeight,HWND_DESKTOP, NULL, Instance, NULL);printf("%i, ", UnregisterClass(WindowClass.lpszClassName, Instance));/* Draws the window to the screen */ShowWindow(WindowHandle, CmdShow); /* Activates graphics for the window */EnableGraphics(WindowHandle, DeviceContext, RenderContext);/* Sets the viewport and viewing mode for the window */int WindowShape[4];glGetIntegerv(GL_VIEWPORT, WindowShape);ResizeWindow(WindowShape[2], WindowShape[3]);return WindowHandle;}
  4. In my application I have a custom tag that generates all the action buttons that the page needs. My problem is that in IE the space between the left side of the button and the image inside the button are not consistant. Some buttons have 3 or 4 more pixels of padding on the left side then others. This causes my buttons to be too large and hence the area the buttons are generated in stretches too far. I could wrap the buttons around to another line or add scroll bars.. but if it will fit in FF I think it should fit in IE as well. So my question is can I set the padding between the left side of the button and the image of the button? Code: <button title='Clear' onMouseOver="Clear_img.src='/images/actions/shadow/action_clear.png' onMouseOut="Clear_img.src='/images/actions/plain/action_clear.png' onClick='buttonClick(this)' id='button_Clear' name='Clear'value='Clear' type='submit'><img vspace='0' width='16' height='16' name='Clear_img'src='/images/actions/plain/action_clear.png'> Clear</button>
  5. Hello,I have developed a website that is specific to IE. The website looks great on my local machine. I then move it to my production environment. For some reason, the website now looks different when I view it from the production server.The strange thing is... I am using the same browser. I always believed that HTML was downloaded to the client and then it was up to the browser to render it. Considering I am viewing the webpage using the same browser from my machine... I should have received the same thing. Which lead me to believe that I didn't upload it properly. However, I verified that I did. Does anyone know what might be causing this?
  6. Hey all,I am having trouble keeping session variables. If a visitor comes to our website, has a session variable set, then leaves our website and comes back, without closing their browser, should they lose their session variables? This is what's happening to me, and I was under the impression that session variables lasted until the expiration/inactivity timeout, or until the browser was closed. Am I wrong?
  7. I have a form that people fill out. Depending on what they fill out on that form, they get different things on the page they're taken to after hitting "submit". Information from both pages goes into a database.However, I don't want to create a new row until the second page has been filled out and submitted (taking the user to a third page). Is there any easy way to pass all the variables from the first page through the second and to the third? I know I can stick it all in hidden inputs, but I have more than 60 form items to process, and I'd like to not have to code an entire page just to pass them as possible.
  8. I'm playing around wtih openGL and trying to get the hang of c/c++(very frustrating at times). I pass a pointer to an array from an object to my main via a get method. If I print out(cout) the pointer(p) and the value pointed to (*p) from main, *p prints the decimal equivilent of the memory address p, not the value that p should be pointing to. Within the object, everything is peachy, its just when I pass the pointer to to main that this happens. The arrays plist[] and vlist[] in meshloader are the ones im having trouble with. Any ideas? Thanks in advance. Feel free to tell me how bad my code is in general! Code: class MeshLoader{ public: MeshLoader(){}; ~MeshLoader(); float * loadMesh(); int getvsize(); int getpsize(); float * getvlist(); int * getplist(); private: int vsize; int psize; float vlist[]; int plist[];}; Code: #include <iostream>#include <fstream>#include <math.h>#include <stdlib.h>using namespace std;#include "meshloader.h"MeshLoader::~MeshLoader(){}float* MeshLoader::loadMesh(){ int i = 0; int j = 0; vsize = 0; psize = 0; vlist[100]; plist[100]; char line[255]; char tag[255]; ifstream fin("xml.x"); if(fin.is_open()) { while(fin.getline(line, 255) != NULL) { strcpy(tag, line); if(strcmp("<model>", strtok(tag, " ")) == 0) { } strcpy(tag, line); if(strcmp("<vlist>", strtok(tag, " ")) == 0) { vsize = atoi(strtok(NULL, " ")); for(i=0;i<vsize;i++) { fin.getline(line, 255); vlist[3*i+0] = (float) atof(strtok(line, " ")); vlist[3*i+1] = (float) atof(strtok(NULL, " ")); vlist[3*i+2] = (float) atof(strtok(NULL, " ")); } } strcpy(tag, line); if(strcmp("<plist>", strtok(tag, " ")) == 0) { psize = (int) atoi(strtok(NULL, " ")); for(i=0;i<psize;i++) { fin.getline(line, 255); plist[3*i+0] = (int) atoi(strtok(line, " ")); plist[3*i+1] = (int) atoi(strtok(NULL, " ")); plist[3*i+2] = (int) atoi(strtok(NULL, " ")); } } } } cout << &plist[0] << ":"; cout << *&plist[0] << ":"; return 0;}int MeshLoader::getvsize(){ return vsize;}int MeshLoader::getpsize(){ return psize;}float * MeshLoader::getvlist(){ return &vlist[0];}int * MeshLoader::getplist(){ cout << &plist[0] << ":"; cout << *&plist[0] << ":"; return &plist[0];} the relevant part of main: Code: #include <cstdlib>#include <iostream>#include <string>#include <sstream>#include <stdio.h>#include <math.h>#include <time.h>using namespace std;#include <GL/glut.h>#include "meshloader.h"MeshLoader myScene;int * p;float * v;int main(int argc, char **argv){ p = myScene.getplist(); v = myScene.getvlist(); cout << p << ":"; cout << * p << ":"; glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(300,100); glutInitWindowSize(640,320); glutCreateWindow("glutton"); glutDisplayFunc(render); glutIdleFunc(render); glutReshapeFunc(reshape); glutMouseFunc(processMouse); glutMotionFunc(processMouseActiveMotion); glutPassiveMotionFunc(Motion); glutEntryFunc(processMouseEntry); glutKeyboardFunc(processNormalKeys); glutSpecialFunc(processSpecialKeys); glEnable(GL_DEPTH_TEST); glutMainLoop(); return 0;}
  9. I have various divs flowing around in my page whereonkeydown event handlers are assigned.Is there any way I can set focus to a div or at leastcontrol who has focus when one looses it (blur ?). Inmy special case i present a list of database resultsafter the user entered some search data. To avoidusing the mouse I want the user to be able to selectthe record by siply hitting the Keybord. How can I movefocus form the textox to the table or div ??
  10. I have a textarea that displays text with special formatting code within it such as terms surrounded by square brackets or astericks, for example.How would it be possible to have a button that allows the user to cycle through the special characters highlighting them.An example might help. Say the text looked like:This is just an [[example]]. I might want something in **italics** or something in another &&format&&. There are many different %*%codes%*%.Would it be possible to have a button that, for instance, highlights [[ or ]] with each click similar to a "Find Next" function? There would be a different button for each format, like one that cycles through the textarea's ** codes.Thanks very much for any responses.
  11. Hi, What I am trying to achieve is when you have a form drop down menu, it displays all the categories from the directory, with all the indentations. Something like when you submit your site to a directory. Now I've got it almost working, but I can figure out how to indent it. The code below, I've used a spacer gif, but obviously that won't work! I've had a go at this, as you can see, but that does do the indentations, unless I'm doing something wrong here. Any help appreciated - thanks. PHP Code: function maketree($rootcatid,$level) { $sql="select catid,cat_name from tbl_name where parentid=$rootcatid order by cat_name"; $result=mysql_query($sql); while (list($DBcatid,$DBcatname)=mysql_fetch_row($result)) { $width=($level+1)*24; if ($width==48) $display=" "; if ($width==72) $display=" "; if ($DBcatid==1) { $display.="<option value=$DBcatid>"; } else { $display.="<option value=$DBcatid>"; } $display.="$DBcatname</option>"; echo $display; maketree($DBcatid,$level+1); } } ?> <table cellpadding="2" cellspacing="2" border="0" width="width="100%""> <tr> <td><select name=""> <? maketree(0,0);?> </select></td> </tr> </table>
  12. hi....i recently discovered that all the files in one of my folders, specifically (kazaa/my shared folder) have all vanished. also when i double click on the folder to open it, it takes about 3 seconds before it actually opens. and then there is nothing inside. but the funny thing is that when i open my kazaa, the transfer window is full of the files which i was downloading, meaning that the temp files are still in the folder and i'm pretty sure that the other files are there as well but how come they just suddenly vanished?? Notice from BuffaloHEP: Topic title must be specific. This is kazaa related therefore the topic title should too. Caution!
  13. Hey, I think this would be simple to html programmers.. but not to me. I got a website template to make it easy, and there are boxes at the side that i can just put text in. But what I put in these boxes I want to appear on every page of the site. So by doing that i put a piece of code in telling it to get the text content from an external file. How would I do this? Here is the string at the moment. Code: <TD COLSPAN=3 background="images/image_45.jpg"><div align="center"><font color="#FF8000" size="2" face="Verdana, Arial, Helvetica, sans-serif">insert here</font> </div></TD>
  14. . any help is appreciated. the code is supposed to give the index of elements in an array with a maxSum for any combination of elements in the array while the maxsum is still less than an allowedMax. See the example at the end of code. function maximum_subset_sum ($max, $candidate_array) {$working_array = array();while ($next = each($candidate_array)) {$candidate = $next['value'];$sums_to_date = array_keys($working_array);while ($marked_sum = each($sums_to_date)) {$known_sum = $marked_sum['value'];$possibly_new = $known_sum + $candidate;if(($possibly_new <= $max) &&!IsSet($working_array[$possibly_new])){$working_array[$possibly_new] = $candidate;}}if(($candidate <= $max) &&!IsSet($working_array[$candidate])){$working_array[$candidate] = $candidate;}}$max_sum = max(array_keys($working_array));$return_array = array($working_array[$max_sum]);while ($max_sum != $working_array[$max_sum]) {$max_sum = $max_sum - $working_array[$max_sum];array_push($return_array, $working_array[$max_sum]);}return($return_array);}// example use$best_sum = maximum_subset_sum(40, array(39,23,19,14,9,5,3,2,1));print("Largest sum is " . array_pop($best_sum));while ($value = array_pop($best_sum)) {print(" + $value");} // will print "Best sum is 23 + 14 + 3"
  15. I've been trying to get an answer from other forums but have had NO luck at all I'm trying to accomplish 2 additional things with the program I have. 1) My program has one window with a list box. The items that are added to the listbox are doneso in the code. When the user opens the program, these items are visible and have check marks next to their name. I want to be able to save the information so if they checked 5 of the 17 items available, and then CLOSE the program, I want them to be able to reopen the program and have those same items checked. Below is the code that I currently have. Everything works as it should. I'm trying to get everything to save so that when they reopen the program, it looks just like how they left it so if they want to use those same items, they can just run the program as soon as it opens. I've had a bunch of ideas from other people but they NEVER seem to work with the code I have or produce the results I'm looking for. 2) If you look at this line: Code: Open "C:\\Program Files\\America's Army\\System\\rand.txt" For Output As #1 The program currently uses a SET directory to place the TXT file in. How can I change this so the USER has to select the directory in which to put the file. The reason I ask is because some people install America's Army, like other programs, to a directory OTHER THAN the default which causes the program to stop working. I want to make it so they can select the directory themself and then have the file saved THERE instead. Any ideas on this one?? Here's the code I have (this does NOT include any option to save right now -- I'm trying to figure out where I can build it in & same with #2): Code: Private Sub createlist() Dim selectedGuns(1000) As String Dim guns(1000) As String Dim tmp As String Dim selectedCount As Integer Dim convertFullnameToShortname(17) As String Randomize ' Table that converts the names convertFullnameToShortname(0) = "m4a1auto" convertFullnameToShortname(1) = "sf" convertFullnameToShortname(2) = "g" convertFullnameToShortname(3) = "ar" convertFullnameToShortname(4) = "m9" convertFullnameToShortname(5) = "rpg" convertFullnameToShortname(6) = "SPR" convertFullnameToShortname(7) = "s24" convertFullnameToShortname(8) = "S82" convertFullnameToShortname(9) = "rct" convertFullnameToShortname(10) = "ak74su" convertFullnameToShortname(11) = "pso" convertFullnameToShortname(12) = "ak" convertFullnameToShortname(13) = "gp" convertFullnameToShortname(14) = "rpk" convertFullnameToShortname(15) = "v" convertFullnameToShortname(16) = "svd" ' Put the SELECTED gun name in an array selectedCount = 0 For x = 0 To List1.ListCount - 1 If List1.Selected(x) = True Then selectedGuns(selectedCount) = convertFullnameToShortname(x) selectedCount = selectedCount + 1 End If Next 'Put randomly select from the selected guns for each slot For x = 0 To 1000 i = Int(Rnd * selectedCount) guns(x) = selectedGuns(i) Next 'Print out the stuff to the file Open "C:\\Program Files\\America's Army\\System\\rand.txt" For Output As #1 Print #1, "admin message dotCOM's Random Guns!" For x = 0 To 1000 xPlusOne = x + 1 Print #1, "admin forceclass " & xPlusOne & " " & guns(x) Next Close #1End SubPrivate Sub About_Click()frmAbout.ShowForm1.HideEnd SubPrivate Sub Exit_Click()Unload MeEnd SubPrivate Sub Form_Load() List1.AddItem "M4A1" List1.AddItem "M4 SOPMOD (SF)" List1.AddItem "M16A2 (m203)" List1.AddItem "M249 SAW" List1.AddItem "M9" List1.AddItem "RoePG" List1.AddItem "SPR (Silenced Sniper)" List1.AddItem "M24" List1.AddItem "M82 Barrett" List1.AddItem "Recruit" List1.AddItem "AKS-74U (VIP Gun)" List1.AddItem "AKS-74U-UBN (VIP MODDED)" List1.AddItem "AK47" List1.AddItem "AK103 (E 203)" List1.AddItem "RPK" List1.AddItem "VSS" List1.AddItem "Dragunov" cmdRun.Caption = "START" Timer1.Enabled = False Timer1.Interval = 5000End SubPrivate Sub Timer1_Timer() createlistEnd SubPrivate Sub cmdRun_Click() If cmdRun.Caption = "START" Then Timer1.Enabled = True cmdRun.Caption = "STOP" Else Timer1.Enabled = False cmdRun.Caption = "START" End IfEnd Sub Thanks again for ANY help
  16. I have been wrestling with this issue some time now and can't figure it out.I have a dropdownmenu with some data (pulled from a database using php, but that's unimportant).Now when one selects a item form that menu I want the page to which that item links to be opened in a layer.There are 2 things Going on:1. I use javascripts include('layer','content.php'); function to load a page in a layer. Works like a charme.2. the dropdown menu CAN open the page to which the items link in the same page using:<SELECT NAME="SelectURL" onChange="document.location.href=document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value">Works great too.WHAT I DID TO COMBINE THIS:<SELECT NAME="albums" id="albums" class="table" onChange="include('thumbnaillayer', 'document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value ');">seemed logical to me. only what happens in real is this error:Not FoundThe requested URL /ghbstoernooi/document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value was not found on this server.--------------------------------------------------------------------------------Apache/1.3.29 Server at localhost Port 80What is going on here?I can't be too far away form the solution since steps 1 and 2 work great. But I need a little push in the right direction....Please, any help would be awesome! Thanks a lot in advance!
  17. I'm just putting the finishing touches on a first draft of a Video Tutorial on using PHP to create a basic Content Management System. I'm hoping to find a couple of new coders to have a look. The tutorial is split into 4 sections1. Introduction and LayoutThis section goes over the assumptions I make about the person watching the tutorial. For Example. Don't know alot about PHP, but do have a system up and running and understand how to upload pages to there server, whether on their Development box or through a hosting company. It also goes over how I will be doing layout of the CMS. (Using Tables this time around. CSS is for another tutorial.). No PHP is used in the introduction.2. Using includes to split up pages, and pass variable from page to page, create an admin side/back endA. This section shows how to split up the basic template page and have PHP piece it back together again to be served.B. Show basic Variable syntax, then use that skill to pass information back and forth between pages (page titles etc). C. Create a backend that is password protected (very basic). The Login Script is the first Form and shows a little about arraysD. Introduction to if(){ }else{ }, introduction to trim(), strtolower(), var_dump(), session_start(), $_SESSION.3. The Image Script/Creating a basic Image GalleryA. More indepth look at variables. When to concantonate, using single and double quotes.B. More indepth look at arrays.C. When to access PHP specific Arrays ($_POST, $_SERVER, $_GET, $_FILES)D. Using the above information to build an image galleryE. In the process learn readdir(), opendir(), unlink(), and move_uploaded_file() and while(){}.4. Using MYSQLA. Create connection.B. Use the connection.C. mysql_query(), mysql_fetch_array(), and looping through results.D. Using above information to populate our CMS with content.In anycase it is a first draft and the first 3 sections are complete. I should be finished with the 4th one in a few more hours. I'm hoping to also have someone who knows what they are doing to take a look at it and give me any opinions they may have on what I'm teaching when and why.Right now the tutorials are in WMV format, so window$ is a must. I haven't bought the Quicktime Plug In yet to get the file sizes real small. Private Message me or whatever if you are interested. Notice from BuffaloHELP: Editing title from "Calling All Newbies, Try My Video Tutorial, Maybe". Please take topic title AND description seriously.
  18. I am having a problem with a windows console application on an NMR imaging instrument. The software is a console that takes control of the user?s screen. The problem is that the saving of the data we need causes crashes commonly. The program is not open source and specific to the scanner. I cannot replace the computer or change the operating system ? it is an instrument used by others too who do not use the same imaging technique that I do. What works is taking screenshots every so many seconds and processing them, although this is a horrible time consuming method. I already have written a converter that reads the part of a BMP which contains data and convert to a workable format and store it in a separate file.What I think will work is the following:Automatically make a screenshot just as if the key has been pressed every so many secondsAccess the image in the clipboard (.BMP I suppose, hence the data is accessible easily)Append to file (I already have the code that will do this)However, I do not use windows so much and have no idea how to make screenshots from software and access the clipboard other than pressing ctrl-v in the paint program. Can anyone help me out here?
  19. Here is the situation. I turned on shadow copy on my file server and it used to work when the file server is also a DC. Now that it is no longer a DC and only a file server, the shadow copy doesn't seems to work. When I right click on the shared folder on my client workstation and go to properpties, I do not see the previous version tab available anymore. I went to check the add/remove to verify if the previous version client has been uninstalled and it is still there. So why isn't shadow copy work no more after we switch to a new domain. I would think that it shouldn't interrupt the shadow copy procedure but it did. Help is appreciated.
  20. I have a menu page that consists of links to other pages. The page has a background image of a globe. The globe is divided into seperate sections for each menu item. As a user hovers over each section I change the background image(The same globe with that section highlighted.)That is what I have so far except that they have to hover over a small anchor tag that I put in not the whole section. I want to change it so that they can actually hover over all of the section they are selecting.I found usemap online but haven't found any examples where it will actually change the background image.. only allows you to set a link for certain shapes.Can anyone point me in the right direction?
  21. Does anyone know how can i "emulate" a click on a link in Internet Explorer. I want it to be closest to a user-like click posible. I know that IE knows if one real user clicks the link or it's just a script that does that. Is it posible to "fool" IE with a script (HTML, Java, PHP, Actionscript, etc) ? Or maybe, can you tell me how does IE knows that it's not a real user behind the click?
  22. We have just set up a Windows Server 2003 x64 system for the purposes of being a dedicated web server/media streaming server. Up to this point, we have been using Windows Server 2003 x86 environment and everything is running well.I have migrated the IIS settings over to the new server and all appears to be going well when tested except that I have now lost all DB connectivity to the 3 small Access databases that I have in the server. All permissions and set ups are the same. Based on past experience, I thought that it had to do with my Jet 4.0 drivers not being up to date, but a check of those against that on the service pack 8 indicates that my versions are the same as those in that Service pack...but to be sure, I downloaded the x64 version of the software and the install says that while the version is valid, it is not for the correct machine type ???? So I downloaded the x86 software, and that also did not work (of course). I then checked my Jet 4.0 drivers on my x86 machine...and they are OLDER than the ones on my x64 machine...I am totally confused and do not understand...Here is the code that I use to call the databases:strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\Star Thrower Website\forum.mdb"ANY help to figure out why it works in on one server and not the other would be most helpful.....THANKS!
  23. Hi, I stambled into strange rendereng problem in firefox 1.0.7(on windows xp) when using border-collapse:collapse and direction:rtl css styles. here is a little test-case html file (see how firefox renders table in first case): Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://forums.xisto.com/no_longer_exists/; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>border-collapse and rtl</title> <style type="text/css"> body{padding:50px;} table td{ padding:5px; border-width:1px;border-color:#ccc;border-style:solid; } #tblrtl{border-collapse:collapse; direction:rtl;} #tbl{border-collapse:collapse;} #tblnospcing{direction:rtl;} </style> </head> <body> <div><b>case 1:</b> with rtl and with border-spacing</div> <table id="tblrtl" cellspacing="0"> <tr><td>תא 1</td><td>כאן יש הרבה יותר טקסט</td><td>קצר ולעיניין</td></tr> </table> <br><br> <div><b>case 2:</b> without rtl and border-spacing</div> <table id="tbl" cellspacing="0"> <tr><td>תא 1</td><td>כאן יש הרבה יותר טקסט</td><td>קצר ולעיניין</td></tr> </table> <br><br> <div><b>case 3:</b> with rtl but without border-spacing</div> <table id="tblnospcing" cellspacing="0"> <tr><td>תא 1</td><td>כאן יש הרבה יותר טקסט</td><td>קצר ולעיניין</td></tr> </table> </body> </html> notice that in case 3 when ommiting border-collapse firefox renders table fine. by the way opera renders exactly like firefox does... do you understand why ff renders it like that? thanks
  24. I'm having trouble getting my applet's layout set up properly. I can't get any layout other then GridLayout to work, and GridLayout doesn't look all that great because I would like to make the graph bigger then the buttons, etc. I've tried using other layout managers, but I couldn't get any of them to work... so then I continued researching, and I found mention of a way to arrange things using setLocation? I tried it... but it just won't work! I use it... and theres no differance in location, although the code doesnt error. So now I'm stuck. Please, any help would be appreciated... the project is due on Friday, and I've gotten stuck on such a small part... thanks again! Code we've got so far: Code: import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.table.DefaultTableModel;import java.util.*;import java.io.*;public class CPT extends JPanel implements ActionListener{ JButton ModifyEntriesButton, ViewEntriesButton, SearchEntriesButton, SaveButton, BackButton; private final static String newline = "\n"; private DefaultTableModel model; public CPT () { super (new GridLayout (3, 0)); model = new PropertiesModel ("entries.data"); ModifyEntriesButton = new JButton ("Modify Entries"); ModifyEntriesButton.setVerticalTextPosition (AbstractButton.TOP); ModifyEntriesButton.setHorizontalTextPosition (AbstractButton.LEFT); ModifyEntriesButton.setToolTipText ("Click this button to modify database entries."); ModifyEntriesButton.setMnemonic (KeyEvent.VK_M); ModifyEntriesButton.setActionCommand ("ModifyEntries"); ModifyEntriesButton.addActionListener (this); ViewEntriesButton = new JButton ("View Entries"); ViewEntriesButton.setVerticalTextPosition (AbstractButton.CENTER); ViewEntriesButton.setHorizontalTextPosition (AbstractButton.LEFT); ViewEntriesButton.setToolTipText ("Click this button to add view all database entries."); ViewEntriesButton.setMnemonic (KeyEvent.VK_V); ViewEntriesButton.setActionCommand ("ViewEntries"); ViewEntriesButton.addActionListener (this); SearchEntriesButton = new JButton ("Search Entries"); SearchEntriesButton.setVerticalTextPosition (AbstractButton.BOTTOM); SearchEntriesButton.setHorizontalTextPosition (AbstractButton.LEFT); SearchEntriesButton.setToolTipText ("Click this button to search through all database entries."); SearchEntriesButton.setMnemonic (KeyEvent.VK_S); SearchEntriesButton.setActionCommand ("SearchEntries"); SearchEntriesButton.addActionListener (this); SaveButton = new JButton ("Save"); SaveButton.setVerticalTextPosition (AbstractButton.TOP); SaveButton.setHorizontalTextPosition (AbstractButton.RIGHT); SaveButton.setToolTipText ("Click this button to save database entries."); SaveButton.setMnemonic (KeyEvent.VK_S); SaveButton.setActionCommand ("Save"); SaveButton.addActionListener (this); BackButton = new JButton ("Back"); BackButton.setVerticalTextPosition (AbstractButton.BOTTOM); BackButton.setHorizontalTextPosition (AbstractButton.RIGHT); BackButton.setToolTipText ("Click this button to return to the main menu."); BackButton.setMnemonic (KeyEvent.VK_B); BackButton.setActionCommand ("Back"); BackButton.addActionListener (this); add (ModifyEntriesButton); add (ViewEntriesButton); add (SearchEntriesButton); } class PropertiesModel extends DefaultTableModel { public PropertiesModel (String filename) { addColumn ("Item Number"); addColumn ("Description"); addColumn ("Price"); //Fill model with data from property file Properties props = readFile (filename); if (props != null) { Enumeration coll = props.keys (); while (coll.hasMoreElements ()) { String property = (String) coll.nextElement (); String value = props.getProperty (property, ""); addRow (new Object[] { property, value } ); } } } } private Properties readFile (String filename) { try { Properties props = new Properties (); props.load (new FileInputStream (filename)); return props; } catch (IOException ioe) { return null; } } private boolean saveFile (String filename) { try { Properties props = new Properties (); for (int i = 0; i < model.getRowCount (); i++) props.put (model.getValueAt (i, 0), model.getValueAt (i, 1)); props.store (new FileOutputStream (filename), null); return true; } catch (IOException ioe) { return false; } } private void ModifyEntriesFunction () { removeAll (); add (new JScrollPane (new JTable (model))); //add (new JScrollPane (new JTable (model)), BorderLayout.CENTER); add (SaveButton); add (BackButton); invalidate (); updateUI (); } public void actionPerformed (ActionEvent e) { if ("ModifyEntries".equals (e.getActionCommand ())) { ModifyEntriesFunction (); } if ("ViewEntries".equals (e.getActionCommand ())) { removeAll (); add (BackButton); invalidate (); updateUI (); } if ("SearchEntries".equals (e.getActionCommand ())) { removeAll (); add (BackButton); invalidate (); updateUI (); } if ("Back".equals (e.getActionCommand ())) { removeAll (); add (ModifyEntriesButton); add (ViewEntriesButton); add (SearchEntriesButton); invalidate (); updateUI (); } if ("Save".equals (e.getActionCommand ())) { if (saveFile ("entries.data")) JOptionPane.showMessageDialog (null, "File saved successfully."); else JOptionPane.showMessageDialog (null, "File could not be saved!"); } } // Create the GUI and show it. For thread safety, // this method should be invoked from the // event-dispatching thread. private static void createAndShowGUI () { //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated (true); //Create and set up the window. JFrame frame = new JFrame ("Swisha Computer House"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. JComponent newContentPane = new CPT (); newContentPane.setOpaque (true); //content panes must be opaque frame.setContentPane (newContentPane); //Display the window. frame.pack (); frame.setSize (300, 300); frame.setVisible (true); } public static void main (String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater (new Runnable () { public void run () { createAndShowGUI (); } } ); }}Attached Images proj.JPG (31.9 KB, 2 views)
  25. hi! i'm having problem reading 16 bit wav files with php and it is starting to drive me crazy! i have written a small and simple script that will read wav file and create graph from it. now, it works as it should with 8 bit wav files. i'm getting all data as i'm supose to, but when it comes to 16 bit files i'm getting crap. i thought that in wav file you read chuncks as it is marked in header - so at 8 bit wav chunck is 8 bit long, at 16 bit wav 16 bit... anyway, here is part of the script where i read wav and put that in array: PHP Code: $filename = $_GET['wav']; $handle = fopen ($filename, "r"); //dohvačanje zaglavlja wav datoteke //here i read wav headers $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 2)); $zaglavlje[] = bin2hex (fread ($handle, 2)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 2)); $zaglavlje[] = bin2hex (fread ($handle, 2)); $zaglavlje[] = bin2hex (fread ($handle, 4)); $zaglavlje[] = bin2hex (fread ($handle, 4)); //bitrate wav datoteke //this is wav bitrate $peek = hexdec(substr($zaglavlje[10], 0, 2)); //provjera da li se radi o mono ili stereo wavu //here i check if it's stereo or mono wav $kanala = hexdec(substr($zaglavlje[6], 0, 2)); if($kanala == 2){ $omjer = 20; } else{ $omjer = 40; } //čitanje podataka iz datoteke - čita se samo 600 elemenata za mono wav ili 1200 za stereo radi utede na memoriji i procesorskom vremenu while(!feof($handle)){ //read number of bytes determend by bitrate $bps = fread($handle, $peek / 8); if(strlen($bps) == 0){ break; } //put value of wav chunk in array $data[] = hexdec(bin2hex($bps)); //skip some chunks for memory optimization fread($handle, ($peek / 8) * $omjer); } fclose ($handle); i'm doing something wrong with reading wavs just i don't knaw what! thanx for any help!
×
×
  • 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.