889 Posted Topics
Re: You will need a reference to the UserId in your VideoRental class, then when you assign the VideoRental to the User you update the VideoRental object's UserId to match. Here's how I would do it: [code] class User { public GUID Id { get; set; } private VideoRental m_rental; public … | |
Re: Hi reemhatim and welcome to DaniWeb :) There are some pretty strict rules at DaniWeb - we aren't allowed to just do it for you. Have a try yourself and feel free to post questions on specific problems you are having with your algorithm or code and we will try … | |
Re: Each node (Unit in your code) in a linked list knows what node follows it, that is the node knows it's "next" node. The lines of this code that you have indicated traverse the list from the start (head) node until we get to the end of the list (when … | |
Re: Instead of: [code] object.ReferenceEquals(ctrControl.GetType(), typeof(TextBox)) [/code] and the like, you can just do: [code] ctrControl.GetType() == typeof(TextBox) [/code] Also, where you call your function recursively, I would probably make that inside an else-if rather than a second if-statement. Like so: [code] if (object.ReferenceEquals(ctrControl.GetType(), typeof(TextBox))) { ((TextBox)ctrControl).Text = string.Empty; } else … | |
Re: Your syntax is not quite right in the SQL statement. You don't need so many quote marks. This will work for you I believe: [code=php] $sql = "SELECT DISTINCT Town FROM $Table_Name"; [/code] Then you actually need to run the query. What I normally do is use the PDO library … | |
![]() | Re: The default application for handling the http protocol is stored in the following registry key: HKEY_CLASSES_ROOT\http\shell\open\command You may also need to set the application for other protocols, such as https, perhaps doing some exploration using regedit.exe might provide some answers. To write to the registry key(s) you will need to … |
Re: Personally I think the best implementation is to use the Singleton design pattern and not the global keyword in this instance. So your code for MYSQLDB class would be: [code] class MYSQLDB { private static instance = null; // private constructor and clone methods private __construct() { // initialise any … | |
Re: Hi flamer_x86 and welcome to DaniWeb :) PHP can be run via IIS or Apache, however the IIS configuration can be very tricky (IMHO). If you are using Windows OS (I assume you are since you talk of IIS), I would suggest installing xampp which includes an Apache install, MySQL, … | |
Re: Interfaces are extremely useful, and there are many examples why. Taking your example one step further, you can then have another class that does this: [code] public class Copier { private ICopy copy; public Copier(ICopy copy) { this.copy = copy; } public void MakeCopy() { copy.CopyMethod(); } } [/code] Now … ![]() | |
Re: Could you write a small class that extends PdfContentByte and write a new method with the parameters that you want to pass that simply calls the original setCMYKColorFillF method followed by the showTextAligned method? Then you can call that new method as you need. | |
![]() | Re: First things first, you can set the version of your application in your Publish properties of the project. Then when you load your program you need to find the executable file (may or may not be in the default install location), then use the File or FileInfo class to check … ![]() |
Re: It would be easier if you could combine your ss_datestart and ss_timestart columns into one DATETIME column (and similar for end date and time), but you could do something like this in php: [code=php] // all timestamps are in seconds, so define the number of seconds in one hour define("SECONDS_PER_HOUR", … | |
Re: Not sure if there is an easier way, but you can use [icode]Convert.ToInt32(string)[/icode] method to convert your string to an integer. [URL="http://msdn.microsoft.com/en-us/library/sf1aw27b.aspx"]Here[/URL] is a link to the MSDN docs on this method which should provide some insight. | |
Re: The property setting line of [icode]_dateID = value[/icode] is correct, but you never actually set it in your LoadData function, and you should carefully check your Save function too, because sometimes you use [icode]_dateID[/icode] and sometimes you use [icode]dateID[/icode], which is the parameter to the function and not [icode]this.dateID[/icode] which … | |
Re: Hi shobhit25 and Welcome to DaniWeb :) What do you mean by a rich text box? I would like to help you out, please give me a little more information on what you are after. | |
Re: Really all you need is a text editor of some kind. You could try an IDE such as Eclipse PDT as this offers features such as code completion and syntax error highlighting, but you can develop in PHP using any text editor and there are many free ones out there. … | |
Re: Instead of: [code] else { echo "Invalid image type. Please Try again"; } [/code] Try this for more information on why the image is being rejected: [code] else { echo "Type: " . $visitorimage["type"] . "<br />"; echo "Size: " . ($visitorimage["size"] / 1024) . " Kb<br />"; echo "Invalid … | |
Re: Hi there aishaahmad and welcome to Daniweb, Sorry but we aren't allowed to just do your homework for you. Do you know what is meant by O(N) and why that loop is O(N)? Do you understand what the term time complexity means? Also, you have two loops that don't increment … | |
Re: You will need a solid understanding of assembler code and compiler construction theory. | |
Re: A simple Google search provides these links: [url]http://www.iopus.com/imacros/tutorials/foxpro.htm[/url] [url]http://social.msdn.microsoft.com/Forums/en/visualfoxprogeneral/thread/aa103203-e32b-4448-8f72-a505cd969d93[/url] as well as many others. | |
Re: I think you may be better off asking the course coordinator straight off rather than us, but in my opinion that course syllabus doesn't make a great deal of mention for why those courses are pre-requisites. I assume that you will be expected to write java code in your lab … | |
Re: Your problem is with this line: [code] for(x=0;x<sample.length();x++) [/code] If you enter something that is less than 52 characters (because sample.length() = 52 in your code), then when you do the enter.charAt for something past the end of what has been entered, you will receive an error. You need to … | |
Re: Hi Uma_fb and welcome to DaniWeb :) I have never tried to do this with a .doc file, but I'm guessing it is the same as opening/modifying a text file. Let me point you to the PHP Manual, [url]http://au.php.net/[/url] that has lots of great documentation on the php language including … | |
Re: Another way of doing this might be to load all usernames into an array, then "implode" the array using a comma separator. [CODE] $users = array(); while($user = mysql_fetch_array($result)) $users[] = $user; // ensure that there is something in the array if (is_array($users) && count($users) > 0) echo implode(",", $users); … ![]() | |
Re: Hi brookstone and welcome to DaniWeb :) You can simply add your where statement after the on statement. So something like this is ok: [code=mssql] SELECT * FROM A LEFT JOIN B ON A.ID=B.FK_ID_A WHERE A.STATUS = 'ACTIVE' AND B.FLAG = 'Y' -- you can also add an ORDER BY … | |
Re: Hi bmbvm5 and welcome to DaniWeb, Unfortunately we are not allowed to just do the work for you, we need to see some effort and then we can give pointers. What have you done so far? What problems are you having? Just giving us your assignment specification isn't enough sorry. | |
Re: If you google "javascript alert" you will find many examples of how to create a javascript alert box. Your algorithm should follow these steps: 1. Get the entered email address from the form. 2. Validate the email address has a valid format. 3. Use SQL statement to see if the … ![]() | |
Re: Your code looks ok to me, except I think you need to override the paintComponent method in the Tooopi class with the code you have in the tupi method? I can't see where the tupi method is being called at the moment... | |
Re: Hi PonAngel and welcome to DaniWeb :) What problems are you facing? That's a lot of code to go through without any hints as to what's wrong... | |
Re: Inside your php opening and closing tags you need to [icode]echo[/icode] the [icode]$_SERVER['HTTP_HOST'][/icode] or whatever, you can't just write it the way that you have. Also, you shouldn't use short tags for opening and closing php, use [icode]<?php ?>[/icode] instead. | |
Re: I'm sorry hidash_in but this is the second time you've posted this question and I'm still not sure what you are trying to do. Do you mean that you want a program written in java that opens another application (like word) and then quit the original java program? If that's … | |
Re: The answer to your question should always be "Whatever language is best suited to the task at hand." Try not to limit yourself to a single preferred language, instead try to understand that each language has pros and cons and thus are better suited to perform certain tasks than others. | |
Re: [QUOTE]The question is what is the best way to trach the ads. Should there be a seperate months table?[/QUOTE] One approach might be to have an ads_months table that links each advertisement to the month(s) it was run. This would require three columns, ads_months_id (numeric PK), ad_id (numeric FK), month_run … | |
Re: If you mean a new line, then in java it is often "\n". | |
Re: So is your setup like this: [code=java] String variableName = "aVariable"; int aVariable = 670; [/code] And you want to access aVariable through variableName? If that's the case, why do you need variableName? | |
Re: [QUOTE=andii_sfx;502648]what core subjucts would i need to be good at to find this subject not to challenging i.e maths, science etc.[/QUOTE] Certainly maths knowledge is an advantage (particularly algebra) and physics can be helpful (although I never studied physics after year 10 at school). There are actually a few philosophy … | |
Re: Not sure, but I think you need a third parameter in your call to insertString. The Java API says that insertString takes an int, a String and an AttributeSet parameter, so I would check that first. | |
Re: Hi lumbeelock and welcome to DaniWeb :) Your error message has been chopped, but the error relates to when you have tried to create a new Employee, the parameters you have passed in don't match the order of the available constructors. Double check your call to [icode]new Employee(...)[/icode] to see … | |
Re: Your problem is with your 1/4 and 3/4. In Java, both of these evaluate to 0, not 0.25 and 0.75 as you might be expecting. Division of integers in Java (and many other programming languages) always evaluates to an integer, and the decimal part is simply dropped. So the line: … | |
Re: Hi annietabio and welcome to DaniWeb :) [code] int i, j=0; [/code] All you have done here is tell the compiler that you have an int called i, you haven't given it a value. When you say i<=m, the compiler doesn't know whether this is true, because i could be … | |
Re: [code] if($value==(change here at kashmere gate ) || $value==(change here at rajiv chowk ) || $value==(change here at yamuna bank ) ) [/code] Is that your exact code? If it is, what does "change here at kashmere gate" mean? If it is supposed to be a string, enclose it in … | |
Re: Hi billmundry and welcome to DaniWeb :) Here's a MySQL solution to your problem: [URL="http://forums.mysql.com/read.php?10,257906,258154#msg-258154"]http://forums.mysql.com/read.php?10,257906,258154#msg-258154[/URL] Hope this helps you out. | |
Re: Hi jackieoh and welcome to DaniWeb :) Not sure exactly what your question means, but if you want to output "%" character to the console you do this: [code] System.out.print("%"); [/code] If that's not what your question meant, please let us know what you are trying to do. | |
Re: What do you mean by offload? | |
Re: The FIND_IN_SET function is used to search a list of strings for a specific string. I don't think you need to do this. Your query should look something like this I think: [code=php] $tag = $_GET[tag]; // NEED TO PERFORM SOME DATA CHECKS HERE... $search = mysql_query("SELECT * FROM threads … | |
Re: There are other options too, Ruby on Rails is hugely popular for example. BTW if you ask such a question ("Do you like PHP or ASP better?") in a PHP forum, you are likely to get a fairly biased answer :P | |
Re: Please use code tags. What line is the error reported on? I suspect the error has to do with the fact that you name your member variable numEggs but then refer to it as numOfEggs in the rest of your code. | |
Re: Actually the syntax would be along the lines of: [code] select * from users where phoneno is null [/code] | |
Re: Use the parent keyword like so: [code] class parentClass { // magic call to constructor -> __construct function __construct() { //... } } class childClass extends parentClass { function __construct() { parent::__construct(); // ... } } [/code] OR [code] class parentClass { function parentClass() { //... } } class childClass … | |
Re: I would do one query with two joins rather than the three queries you currently have. This allows you to sort on any column from any of the three tables as needed. Something like this would work: [code=sql] -- select all appropriate columns from the three tables select p.id, p.product_id, … |
The End.