216 Posted Topics
Re: You can use the [DateTime::diff()](http://php.net/manual/en/datetime.diff.php) function to get a [DateInterval](http://php.net/manual/en/class.dateinterval.php) object which contains the time difference in properties. For example: $datetime1 = new DateTime('2009-10-11'); $datetime2 = new DateTime('2009-10-13'); $interval = $datetime1->diff($datetime2); would get you a difference object in `$interval`. In order to get the days you would call the intervals … | |
Re: There's a nifty little [css-only hide/show toggle](http://cssdeck.com/labs/css-only-showhide) snippet which uses a checkbox as a button to change the css of other elements when its state changes. That is if you want to avoid JavaScript, although I reckon you have a lot more riding on the JS than just that show/hide. … | |
Re: Well you're probably going to need several components worked out. 1. A database where users, "items liked", images etc. are stored in, probably easiest to use [phpMyAdmin](http://www.phpmyadmin.net/home_page/index.php) for testing/developping. 2. PHP code for simple interaction with the database, i.e. [Create/Read/Update/Delete](http://www.startutorial.com/articles/view/php-crud-tutorial-part-1) to have users manage their information. 3. PHP code for … | |
Re: Because of something missing in the `//some code here` part. You can do `long[] newToken` or `long newToken[]`to get an uninitialized array. `long[] newToken[]` would give you a multidimensional array. For instance: long[] newToken = new long[] {123,456,789}; long oldToken[] = new long[] {987,654,321}; long[] midlifeToken[] = new long[2][2]; midlifeToken[0][0] … | |
Re: But how will anyone know it was updated if you delete it first? In case you meant delete **or** update, then For update: 1. Read the file [line by line ](https://www.google.com/search?q=php+read+file+line+by+line) 2. [Manipulate](https://www.google.com/search?q=php+string+functions) the line 3. [Write back to file](https://www.google.com/search?q=php+write+to+file) For deletion: 1. Read the file [line by line ](https://www.google.com/search?q=php+read+file+line+by+line) … | |
Re: That's because [Contains](http://msdn.microsoft.com/en-us/library/dy85x1sa%28v=vs.110%29.aspx) checks for an exact occurrence of the substring. I'm not very familiar with VB.NET so I'm sure there are better solutions out there than the ones I'm posting, especially length and time wise. But the problem itself could be solved in several ways (not a complete list … | |
Re: If you just reinstalled and you think there's something on it then reinstall again. If by "something called Crypto" you mean CryptoLocker then the key that was used to encrypt your files may have been recovered during [Operation Tovar](http://en.wikipedia.org/wiki/Operation_Tovar). You can check the [FireEye and Fox-IT page](https://www.decryptcryptolocker.com/) for instructions on … | |
Re: The alert is triggering, are you getting a response at all on that ajax? One of the more common problems is making [cross-domain](http://en.wikipedia.org/wiki/Same-origin_policy) ajax calls. Try running your pages from a (i.e. both pages on the same) server (localhost will do) and see if the problem persists. If you want … | |
Re: Passwords [shouldn't](http://php.net/manual/en/faq.passwords.php) be stored in the database at all, nor should it be allowed to check if passwords exist. Usernames are a different story. You could check your db for the entered name (triggered on focus lost or something) and warn the user that the name is taken. The only … | |
Re: It's working fine here. I can however reproduce that exact print by renaming the php file to html. PHP code can't be inserted into an html file, you'll have to make it a php file instead (in other words, rename it so the file ends on `.php`). Keep in mind … | |
Re: Could it be that when you're showing the top time from `top5Time` in `render()` that you haven't read the new data from the file yet? A part of the code seems missing so it's hard to tell, but when you are setting the high score with `HeighScoreState()` you are not … | |
Re: Check Antonio Conte's posts on [here](http://www.larryullman.com/forums/index.php?/topic/1155-generate-multiple-usernames-and-passwords/). #7 might be close to what you want as far as generating goes. | |
Re: You could use [max()](http://php.net/manual/en/function.max.php) to set a bottom limit of 0. `$tplaunch = max(0,($tplaunch - $tpsold));` | |
Re: Since `if (!old.Contains("Designator"))` will skip the header line it will not be included in the new output that you build in ` outputText += String.Join("\t", newTokens) + Environment.NewLine;`. You could add it separately in the else, something like: if (!old.Contains("Designator")){ // Split by \t (tab) and remove blank space var … | |
Re: Well you never seem to set the `hours_worked` to anything other than 0. Also, keep in mind that when you write if(hours_worked == 40 * 120) total_deductions = calGrossF(gross_pay, deductions); extra_time = calGrossH(hours_worked, pay_rate); totalsales = calGrossC(fixed_salary, commission); It will be interpreted as if(hours_worked == 40 * 120){ total_deductions = … | |
Re: You'll want to define a [foreign key constraint](http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html) on the `acc1` and `acc2` tables with a reference to the movie id. Something along the likes of CREATE TABLE MovieList( id int NOT NULL, title varchar(255) NOT NULL, PRIMARY KEY(id) ) CREATE TABLE acc1_mywatchlist( movie_id int NOT NULL, FOREIGN KEY(movie_id) REFERENCES … | |
Re: Aside from the usage of pete, the compiling issue could just be the missing `{` after `public class ICMA42`. | |
Re: Hi, You are referring to a `jquery-1.11.0` folder in your script tag but in the zip file you provided there is only a `jquery-ui-1.11.0 folder`. Using your code snippet, and the zip you provided (after removing the "- copy" part from the folder name) changing <script type="text/javascript" src='js/jquery-1.11.0/external/jquery/jquery.js'></script> to <script … | |
Re: Apart from the `Hide()` it's working here. You're making a clone of clone though, and `var target = $(".guests-tbody");` is technically a list of elements, so it will append to all the elements with that class. Not sure if `clone.attr('id','style', '');` is doing what you think it's doing; it sets … ![]() | |
Re: You have a CartItem object with a ProductId, a ProductName, a ProductPrice ..and a Product? Could it be that you are mixing your CartItem and Product entities? That you are looking for a ProductName in CartItem when CartItem only has a reference to ProductId in Product? What would be the … | |
Re: Your table is being echoed in a `while` loop though, so it's not impossible to have it show up more than once, if there is more than one item in the array. $sqle = "select * from helpconfig where cid = '1'"; if ( !( $resulte = mysql_query( $sqle ) … | |
Re: You're not adding any balls. for(Balls bb:ball){ ball.add(new Balls(xPos,yPos)); } That means: for each ball in the list of balls, add a new ball. The list is empty at first, so how can it ever add new balls this way? Furthermore, apart from the terribly confusing naming for balls and … | |
Re: Not familiar with the game, but it sounds fun. If you're not feeling at home with java perhaps try a simple solution first, like heading towards the one with the highest calories. Once that works you can implement better solutions. I noticed on the video that whenever a food item … | |
Re: For a fun, practical way to get started with neural networks (or other types of machine learning) you could have a look at [NetLogo](http://ccl.northwestern.edu/netlogo/index.shtml). It's a modelling environment in which you can create and run a ton of different kinds of simulations. It has a large sample [library](http://ccl.northwestern.edu/netlogo/models/index.cgi), which includes … | |
Re: echo round(((47.60 * 554.82) / 100), 2); Gives me 264.09, you're rounding on two decimals so it will never be 264, but it shouldn't give you 263.7 either. However, if you do `(47.60 * 554) / 100)` (and not 554.82) you will get 263.704. So my guess is that by … | |
Re: It's working fine here, after adding <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> above your script. Did you include jQuery on your page? The `$.trim()` method is working as well, I get the alert when leaving the field blank and also after entering a series of whitespaces. Word of warning, if you were to move … ![]() | |
Re: You could use `System.out.format` to achieve that result. It requires a format string and variables. A format string is built up as follows. String contentFormat = "%-15s %-8d %-15s %n"; In the `%-15s` for instance: a `%` indicates a new "column". The `-` means that writing starts from the left, … | |
Re: You can validate the user input before creating the object. Store the inputs in variables, validate them as they come in (so you can warn the user and have him/her retry). Then when you have all the info you can create the Customer object and pass all the input as … | |
Re: You could post the data to your controller using JSON, then save it to a database using an SQL connection. [Click Here](http://www.c-sharpcorner.com/UploadFile/c4cfca/how-to-save-data-into-database-using-jquery-and-json-in-asp/) You might also want to look into the Entity Framework if you're looking for easier binding between your model and your database, if you don't like using jQuery … | |
Re: `document.getElementById('txtMenuInfo').innerHTML=txt;` and `<div id="textMenuInfo"></div>` are not the same element, change one or the other `t="<td>"</td>";` should not contain the middle " `t="<td></td>";` `var text,x,xx,i;` should be `var txt,x,xx,i;` and `txt=text+ "</tr>";` should be `txt=txt+ "</tr>";` `for(i=o;i<x.length;i++)` should be a 0 so `for(i=0;i<x.length;i++)` `x=xmlhttp.responseXML.documentElement.getElementsbyTagName("food");` should have a capital B in getElementsByTagName … | |
Re: You could give jsTree a look: [Click Here](http://www.jstree.com/) It has a move_node event which contains old parent and old position information and a move_node method which you could use to move nodes programmatically. Might be easier to modify the existing code to suit your needs instead of writing it entirely … | |
Re: If you are using an IDE like Eclipse or Netbeans you can see that, by simply hovering over line 68, the error reads "The constructor Worker() is undefined". It means that you do not have an empty constructor in your Worker class. You only have one that requires paramaters: `public … | |
Re: Well at first glance, in `insert into deals (dealname,productid)` you are using `dealname` and not `deal_name`. Also, where you are using `SELECT productid FROM products WHERE productid = '".$id."'");` you are twice referring to a column `productid` while the table `products` only has `id`, according to your description of the … | |
Re: Hi, It's actually just an extension to your new queue length print. If the current line length is bigger than the current max it becomes the new max. Once all the customers are done you print it where you already are printing it; outside the loop. | |
Re: Hi, I take it this is some sort of assignment, in which case my bet would be that they want you to find the url's using BFS and DFS and not simply dumping all link elements in an array. You could traverse the DOM in search for links with BFS … | |
Re: Hi, In the if-conditions you are comparing an empty variable `cameraImage` to the camera names, try changing the lines that say: if(cameraImage == "Canon_20d.jpg") to if(imageFileName == "Canon_20d.jpg") assuming you are passing the same camera image names in `function showImage(imageFileName)`. Traevel | |
Re: Hi, If what you mean is how you can dynamically change the image size with javascript, try something like this: function changeImgSize(id,width,height){ var em = document.getElementById(id); if (em && em.style){ em.style.width=width; em.style.height=height; } } Which you would call with something like `changeImgSize('imgID,400,400')`. Traevel | |
Re: Hi, According to http://php.net/manual/en/function.md5.php > Returns the hash as a 32-character hexadecimal number. The number in the confirmation e-mail is 32 characters, the number above it is not, so I'm guessing the correct one is in the e-mail and the code you have circled is not. I was reading up … ![]() | |
Re: Hi, Correct me if I'm wrong but from what I understand the problem only occurs in `showFullSize()`, and not the `nextPic()` or `prevPic()` function. My first hunch would be a variable scope issue. You used the name `imgNum` for your global variable to keep track of the current image, but … | |
Re: Hi, If I am understanding it correctly you only want the ordered products to show up in your `shoppingBox`. However, by hard coding all the products, names and print results referring to them will be cumbersome. Firstly, your array `quant` misses the first element (0) and has an eleventh element … | |
Re: > href="1hot.php"?pg= "2">' try changing that to `href="1hot.php?pg=2"` or escape the quotation marks if you don't want to use POST | |
Re: If building X is east of building Y it means that building Y is to the west of building X. [icode]nextdoor(X,Y) :- west(X,Y) ; west(Y,X).[/icode] | |
Re: The CSS equivalent to the [icode]wrap[/icode] attribute would be [icode]white-space[/icode]. My guess for [icode]wrap="hard"[/icode] would be [icode]white-space:pre-line;[/icode]. | |
Re: Hi there, You're on the right track, but you'll have to add a variable to the sky clause in order to receive a correct result. [CODE]sky(blue):-weather(Day,fair).[/CODE] ...should be written as [CODE]sky(Day,blue):-weather(Day,fair).[/CODE] Then you can ask prolog for [icode]sky(X,blue).[/icode] to receive all the days (X) for which the sky color is … | |
Re: Hi there, I'm not really sure what you meant, but I think this is what you were looking for. [code=JavaScript] document.getElementById('banner').style.visibility="hidden"; [/code] This doesn't hide the image, but the entire div. If you'd like to hide the background image however, you could change its url to ' '. [code=JavaScript]document.getElementById('banner').style.backgroundImage="url(' ')";[/code] … | |
Re: Hi there, Apart from the issues Cragdo mentioned above, line 463 has an unnecessary [icode]<p>[/icode] tag. To answer your question: the "white space" is being caused in line 456 [icode]<div class="luke" style="position: relative; top: -929px; [/icode] It could be because of the png-image (IE doesn't really like them) but a … | |
Re: Hi there, Perhaps this might get you started. [code=HTML and CSS] <html> <head> <title>Multicolor table</title> <style type="text/css"> #sheet{ width:563px; border-collapse:collapse; border:1px solid #000000; } #sheet .title{ text-transform:uppercase; font-size:14pt; text-align:center; } #sheet th{ padding:5px; background-color:#CDCDCD; border-top:1px solid #000000; border-bottom:1px solid #000000; text-align:center; font-weight:normal; font-size:9pt; width:33%; } #sheet td{ padding:5px; background-color:#FFFFFF; text-align:center; … | |
Re: Hi there, Just at first glance... your variable [icode]net[/icode] has not been initialized, try assigning a default value to it and see if that fixes the problem. Though, next time try to be a little more specific about the errors you are receiving. "The local variable net may not have … | |
Re: Hi there, I think the script you wrote is being executed before any of the elements are actually created. Perhaps modifying it like this will have a better effect. [code=javascript]window.onload = function(){ for(var i=0;i<document.all.length;i++) { document.all[i].removeAttribute("title"); } }[/code] I replaced the [icode]document.all[/icode] with [icode]i[/icode] by the way. Hope this helps, … | |
Re: Hi there, If you had scrolled down a little further on the [url=http://www.w3schools.com/js/js_form_validation.asp]w3schools[/url] page you probably would have noticed the full example which shows you exactly that. :D Try using [icode]<form action="validate.php" onsubmit="validate(this)" method="post">[/icode] Good luck, Traevel |
The End.