1,038 Posted Topics
Re: Well, my opinion, which is probably insanely misguided is that it is much like the magnetic charge on a floppy disk's magnetic tape. Which would take a bit more than a fridge magnet to wipe it out but then again memory is exponentially more volatile then the aforementioned floppy disk. … | |
I ran across the need to view a specific line of a file so I wrote this up. You can view a line or a range of lines for a file or compare two files. Check the command for the syntax. Drop it in /usr/bin/sln and enjoy. | |
So you've got this big long function chain and PHP's oh-so-helpful [B]Fatal Error[/B] messages aren't helping at all. Here's a quick example of how to do a function backtrace without throwing exceptions. [B]Output[/B]: [code] =>[0] => Array ( [file] => someFile.php [line] => 4 ) => Hello World [/code] | |
This is a recursive function I made to draw purely CSS bar graphs. You pass it an array of data and the total amount, example: [code=php]$someData = array('Oranges'=>4, 'Apples'=>10); $total = 14; echo drawCSSGraph($someData, $total);[/code] Also, you can pass it options in the form of an array or as space … | |
Re: I think you mean capitalize. If you capitolize it you turn it into money. I wasn't aware PHP was the philosopher's stone of the 21st century | |
Re: A caeser cypher with a shift of 13 is known as ROT13 just incase you didn't know that and it's the easiest cypher I know of to code besides an XOR | |
Re: If your function is defined above main you don't need the prototype. | |
Re: It is true '\0' means the end of a string but that is because it is the ASCII NULL code. A string can contain an '\0' before the actual end of the array though nothing after it will be seen when printing the string and there will be another NULL … | |
This program was inspired by my college math 1 class. It takes the values of a1, a2, b1, b2, c1, c2 and solves, displays the equation and shows the work. It also stops if the equation is dependant or inconsistent (Zero division) Cramer's Rule if a1x+b1y=c1 and a2x+b2y=c2 then x=((c1*b2)-(c2*b1))/((a1*b2)-(a2*b1)) … | |
I created a bowling game, Which for the most part works correctly. I toiled for hours trying to figure out how to do the scoring so i gave up. Its fairly simple code so not much of a description needed. | |
Well its fairly self explanatory, its a program that shows that calculates the hypotenuse using the pythagorean theorum, It displays the values of the sides and shows a crappy ascii art right triangle with the values input and the later found values | |
Ok I greatly modified a tutorial to have a completely different interface, a highscore list and a little tiny really rare easter egg. to get the highscore list. I want to figure out how to sort the highscore list if it is possible. And dont worry about it freaking out, … | |
This is the first program I wrote, well besides Hello world. I put about a lot of hours into this code, it started as a divisional calculator than i evolved it so it would ask your name and calculate your average and i was messing around with the system ("") … | |
Re: system ("cls") and other system commands are handy to get a list of all possible system lines that i know of just go Start>run>cmd>help, it gives a list of all commands that you could use some usefull ones are color ie. system("color A") would change the text on the console … | |
| |
Re: Well you have an unclosed/broken tag here on line 62 that may be causing issues [code=html] <div <!--Div class added by Damion -->[/code] Aside from that grab firebug([url]http://getfirebug.com[/url]) for firefox and toy around with the CSS until you get it where you want it then just copy into your file. | |
Re: Your php configuration probably has error_reporting set to 0, set it to 30719 and you'll start seeing errors instead of white screens | |
Re: You might want to use google before we spoonfeed you homework help. | |
![]() | Re: Javascript strings don't have a trim function, to add one you can do something like [code=javascript] String.prototype.trim = function () { return this.replace(/^\s+|\s+$/, ''); }; somevar = "I have a string with trailing spaces "; somevar_trimmed = somevar.trim(); // "I have a string with trailing spaces" // So yours will … |
Re: [QUOTE=Susan.LK;966249]Hi, I think i am missing something obvious. The popup should bring up a page passing an id. Currently nothing happens but i can see the id is being passed into the varaiable when hovering over Link, how can this be chnaged. Below is part of the code thanks[/QUOTE] A) … | |
![]() | Re: Is there some absolutely halting reason that the joomla stuff can't be hosted on the same server? It's not like its that hard to port a database and rsync code ![]() |
Re: PHP has built-in constructs that make it look like a templating language so you don't need the bloat of another templating class. I also prefer this method as people dealing with the files don't have to know what braces mean but its obvious what endwhile means. [code=php] <?php while($row=mysql_fetch_array($result)): ?> … | |
Re: Don't try to mix creating your own json strings [code=php] $objJSON = array('sample' => null); // whatever $objJSON['sample'] = $arr; $objJSON = json_encode($objJSON); echo '<script type="text/javascript">var myJSON = ' . $objJSON . ';</script>[/code] | |
Re: Looks like you have carriage returns in the data do [code=php] fwrite($fp, str_replace("\n", '', (date('d M - H:i') . '||' . $route_dept . '||' . $route_dest . '||' . $route_dist . '||' . $route_demd) . "\n");[/code] | |
Re: Some tips for your code cwarn: Don't use preg_* functions unless absolutely necessary, if you're comparing a static string use strpos or stripos. Define reused regular expressions in one place (you use [icode]/(.*)[.]([^.\?]+)(\?(.*))?/[/icode] three times in the same script, define it once in a variable and use it that way, … | |
Re: Resource #1 search the forums before posting, Resource #2, use google Resource #3, php.net *quietly ponders how many people will get the hidden PHP joke* | |
Re: [QUOTE=crazy4fun;953692]I'm new to this technology. I'd be glad if somebody help me in starting this and guiding me where to start? and how to start? to learn this new technology.[/QUOTE] A) Wrong forum, B) Google is your friend, along with php.net and pretty much any of the first million results … | |
Re: [code=c++]somestring = "this is a \"string with \" quotes";[/code] | |
Re: mysql and php with xampp is exactly the same as mysql and php on their own. All XAMPP does is put it in an easy-to-install package | |
Re: [QUOTE=crazy4fun;953704]I'm new to this technology. I'd be glad if somebody help me in starting this and guiding me where to start? and how to start? to learn this new technology.[/QUOTE] I already answered this in the other forum where you posted. | |
Re: The problem is that get_browser returns an array, not an object. use [icode]$b['parent'][/icode], not [icode]$b->parent[/icode] | |
Re: divRef probably doesn't exist, show the whole code not just one line. | |
Re: well show us the current code so we can help you out, not a lot we can do right now. | |
Re: Did you try, maybe, [url]http://php.net/xml[/url]? | |
Re: [QUOTE=revatijadhav;952761]i want source code for chat in php and mysql[/QUOTE] Cool, how's that working out for you? | |
Re: Strange, I tested it and it works fine for me. O'Reilly matches, Smith matches, Smith-Jacobs matches. The only thing that doesn't match is stuff like @#$%@# | |
Re: Your example should work the way you want it. There is no dimensioning of arrays in PHP, space is allocated as necessary. | |
Re: The easiest way is method 2. Frankly, there would be very little overhead in comparison to the first method, they're both function calls except one (the magic method... method) doesn't have to do a check to see if __get/set exist since it knows you're calling a function. Now, given that … | |
Re: %3C and the link are url encoded, use url_decode to decode them. | |
Re: A) we can tell you're new, you didn't read that you should use code tags. B) You're missing all of your closing tags. [code=php] } } } }[/code] should go right before the end tag | |
Re: Well for both files you aren't ending your option tag when you generate them, it may not be what's causing the problem but it's incorrect nonetheless | |
Re: Yeah, don't use both mootools and jquery. If you want a lightbox use Thickbox which uses jQuery, I'm not sure what mootabs is so I can't suggest a replacement for that. | |
Re: [QUOTE=cwarn23;948795]Although I'm not sure how you want the surrounding data split, the data mentioned in post #1 would be matched like the following: [CODE=php]<? $string = '"yZoomedDataMax":82060000,"time":"1980","sizeOption":"_UNISIZE","xLambda":1,"xZoomedDataMin":20273,"yZoomedDataMin":1353355,"stateVersion":3,"xAxisOption":"3","playDuration":15,"iconKeySettings":[{"trailStart":"1980","key":{"dim0":"Netherlands"}},{"trailStart":"1980","key":{"dim0":"Switzerland"}},{"trailStart":"1980","key":{"dim0":"Austria"}}],"yAxisOption":"4","yZoomedIn":false,"xZoomedIn":false,"orderedByY":false,"colorOption":"2"}'; //echo $string; preg_match_all('/\{"([^"]+)":"([^"]+)","([^"]+)":\{"([^"]+)":"([^"]+)"\}\}/',$string,$array); echo '<xmp>'; print_r($array); echo '</xmp>'; ?>[/CODE][/QUOTE] This is marked as solved but it wasn't solved correctly. This just just JSON … | |
Re: You use . to concatenate so [icode]echo ucwords($_SESSION['fname'] . ' ' . $_SESSION['lname']);[/icode] | |
Re: You can't, the form fields must have separate names. If you have a bunch of Select1=blah in the URL only the last one will actually assign the value. | |
Re: The same exact way you did with Person except replace Person with Patient [code=c++]class Patient : public Person {}; class StudentPatient : public Patient {};[/code] [url]http://www.cprogramming.com/tutorial/lesson20.html[/url] | |
Re: [QUOTE=BestJewSinceJC;934811]php is not a programming language it is a scripting language.[/QUOTE] Scripting languages are programming languages. | |
Re: > Can someone please conver the following code into a sequence diagram for me? the 4 instances and classes with the life lines are: `theUI:UserInterface`, `theCashPoint:CashPoint`, `theActiveAccount:BankAccount` and `transactions:TransactionList` void CashPoint::m4_produceStatementForBankAccount() const { string statement( p_theActiveAccount_->prepareFormattedStatement()); theUI_.showStatementOnScreen( statement); } string BankAccount::prepareFormattedStatement() const { ostringstream os; //account details os << prepareFormattedAccountDetails(); … | |
Re: [QUOTE=brizhou;947127]Please can you help me with the following question? An iterative version of the C++ function TransactionList::getTransactionsForDate is given below. It can be applied to any list of transactions and returns the list of all the transactions for the given date. It only works when the date given is valid. … |
The End.