Jump to content

seventheyejosh

Members
  • Posts

    641
  • Joined

  • Last visited

Everything posted by seventheyejosh

  1. <?php $array = array( array( 1,2,3,4), array(1,2,3,4,-1,-2)); // loop over the outer foreach( $array as $innerKey => $innerArray ) { // assume it's positive by default $isPositive = true; // loop over the inner foreach( $innerArray as $k=>$v ) { // if value is negative if( $v < 0 ) { $isPositive = false; break; } } echo " Key #" . $innerKey . " is " . ( $isPositive ? "positive" : "not positive\n" ); } ?> Output: Key #0 is positive Key #1 is not positive
  2. #import <Foundation/Foundation.h> int main(int argc, char *argv[]) { @autoreleasepool { NSString *firstString = @"Test"; NSString *stringTwo = [NSString stringWithFormat:@"my %@ text", firstString]; NSLog(@"New String: %@", stringTwo); } }
  3. Hmm I can't seem to find a list of what is enabled. Is there not a list like: --a-b --c-d, etc? Or do I have to go down the list and find the flags for each of the things like posix, Reflection, etc? Sorry, I've never compiled php, always used tasksel. Thanks - Josh
  4. Here are some promo codes for my first ever app - Net Worth Pro. It's my baby, so please let me know of any issues that you encounter. I've set up a bug bounty form on my website: http://networthproapp.com/ (Go to Bug Bounty). & itms://itunes.apple.com/nz/app/net-worth-pro/id402098167?mt=8 If these codes get used up, and if you guys are interested in it, I can maybe post some more. Please post if you take one, and please review if you take one. Have a great day! - Josh E9TXXKT9J3WX LRF3MKYTAWP9 LPXMP3JLEEMY YMAJEL6PJLJL M7AFFLK4MA6N
  5. Do you have a mockup link? It sounds like you either want to use a simple Javascript toggle, if it is static content, or use some AJAX to populate it, if it is dynamic. - Josh
  6. Quick question. I installed PHP / Apache / MySQL on Ubuntu 10.04 using tasksel (chose LAMP). I now need to use a specific php extension (pcntl), that is not enabled by default. So, I need to compile php, etc. I know I use: ./configure --enable-pcntl , make , make install. My question is, though, what other configure flags to I need to set so that I get the same functionality as the one that tasksel gave me? Like, don't I need to set a flag to get MySQL support? Finally, once it is compiled fine, and I did already, but am now worrying about the other flags, how do I tell the existing Apache install to use my new binary instead of the current one? Compiling put the new binary in /usr/local/bin, and running php -m from the command line shows that the module is indeed enabled, but using phpinfo(); on a page on the existing site on the server shows that the module isn't enabled, hence it is the wrong binary. If there isn't an easy way to do it, I don't mind reinstalling, but I'd still like to know what flags to set to get the same default behavior, etc. Thanks a lot, Josh
  7. Plus your inner query is using the same $result and $row variables as your outer query, so it'll never kick back out...
  8. Well I threw this up there, and it gave me a 500 error: <IfModule mod_alias.c> Alias /forum /home/lifecode/public_html/rmbforum </IfModule> Googling reveals that Alias can't be used in .htaccess, only in a <VirtualHost> in httpd.conf, and since my friend's site is on hostgator shared hosting, I'm not able to use that. Is there a way to do something similar through .htaccess? Or just a different method altogether? Thanks! - Josh
  9. Quick question. If I have the following: site.com/forum/ & forum.web.com How can I, by using one or both of the .htaccess files for those roots, make it so when a user goes to site.com/forum/ it goes to forum.web.com, but the url stays the same? I know I can make it redirect to the subdomain, but I want the user to think they are still at the same url. I also want it to make all the requests look normal: site.com/forum/ucp.php?v=1&s=2 . Is there some kind of proxying or reverse proxying I can do? Thanks so much, Josh
  10. http://erkie.github.com/
  11. I was literally JUST thinking about this movie last night before bed and couldn't remember its name!!!
  12. I use OOP, so I have written lots of classes. If I need to use one, just add it to the application. If it isn't large enough to yield a worthwhile class, but is still useful, I have a snippet library, nice and sorted. I try to avoid having to go back and rip out a few lines of code, as that isn't really re-useability. Sometimes it's unavoidable though. - Josh
  13. Use Terminal, or a Terminal emulator and type in: telnet towel.blinkenlights.nl It will telnet into that url, which hosts a full text and ascii version of Star Wars IV
  14. This is mind boggling! http://www.thewildernessdowntown.com/
  15. Oh my god, this is epic! telnet towel.blinkenlights.nl - Josh
  16. I really like the look of the Zend standards, they seem quite clean. Does anyone else have a preference or thought on the matter? ( Daniel0 ) Thanks! - Josh
  17. Hey guys, my coworker and I have decided to start coding our code to a standard. We are given pretty free roam on most everything, so up to this point we've kind of just coded whatever. Now that our application is getting to be quite sizeable, we want to rectify our past ways and adopt a standard. I figured that we'd just go for the PEAR standard: http://pear.php.net/manual/en/standards.php , but one of the comments on there, or somewhere, mentioned the phpBB standard. So I had a looky at that, and I think it is a little cleaner looking: http://area51.phpbb.com/docs/coding-guidelines.html . My question is, would it be bad to learn a whole standard such as the phpBB which is not 'official' as opposed to a more popular one such as PEAR? In your experiences, would an employer want you to code to 'A' standard, or code to 'THE' standard? If that is too confusing, firstly my bad, secondly the simple question is should I learn PEAR, phpBB, or some other standard? And, should I learn the SQL standard? Or just learn the SQL standard for the standard I learn ( I saw phpBB had one, not sure about PEAR). Thanks! - Josh
  18. Yup, the comment in the mcrypt was breaking it. Solved.
  19. Hi! My cron is giving me a headache. I first started by doing a simple cron. * * * * * /usr/bin/php /var/cron.php If I run it manually, it works great. It doesn't seem to be running. I made another one, this time, mycron.php, which merely echos 'made it: date'. I edited /etc/crontab to set MAILTO = root, which is who I'm logged in as, and set my email as the work and home email of root, but I've gotten no mail. So I found a test one online that is merely * * * * * root echo 'here' This does nothing. I'm entering my cron with 'crontab -e' and it seems to be syntactically correct: * * * * * /usr/bin/php /var/cron.php * * * * * /usr/bin/php /var/mycron.php * * * * * root echo "just ran" Thoughts? I have php in my /usr/bin/ folder, but there is also a php5. Should I point to that instead? I did a apt-get install php5-cli, then a tasksel to get the lamp stack. I'm on Ubuntu 10.04 Desktop. Thanks so much! EDIT: Actually, if I try running my new cron, as /usr/bin/php /var/mycron.php, I get a "PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0" EDIT 2: Deleting the # comment from the file lets it run in terminal, Checking others now. - Josh
  20. "Obscurity is not Security" Don't remember where I first heard that, but it is true. I feel like Daniel0 may have said it a few times around here... EDIT: This is a good read: http://en.wikipedia.org/wiki/Security_through_obscurity EDIT 2: Especially the "For" and "Against" arguments.
  21. http://www.phpfreaks.com/forums/index.php/topic,58799.0.html
  22. Are you saying his wife is a dummy!?
  23. Is there a reason why it is php5-cli: Depends: php5-common (= 5.3.2-1ubuntu4) but 5.3.2-1ubuntu4.2 is to be installed instead of a >= 5.3.2-1 ? And if it is a bug, how can it be remedied? Thanks, Josh
×
×
  • Create New...

Important Information

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.