Jump to content

seventheyejosh

Members
  • Posts

    641
  • Joined

  • Last visited

Posts 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. 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

     

  3. 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

  4. I have an iPhone app that I've just finished, but I need to get an icon set for. I have a mock of what I'd like to get at, but I'm not married to it.

     

    It is a finance app, I need all of the standard iPhone icon sizes (512,57,etc), and I need it done quickly.

     

    PM me with proposals, past work etc.

     

    I'll attach my sad sad mockup :P

     

    Thanks!

     

    - Josh

     

    [attachment deleted by admin]

  5. 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

     

  6. 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

  7. 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

  8. 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

  9. 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

  10. 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

     

  11. As the title suggests, I'd like a project that is around the $500 mark. Reason being, I'd like to buy my girlfriend an iPad for Christmas. And they are around there. Not that I couldn't just buy it with my regular salary, but I figured it'd be fun to do a bit of freelancing, as I have some free time.

     

    I'm a development programmer for a company located in the central US that primarily does agriculture work, be it GIS Mapping or conference handling. We also have a web division that handles all of the web jobs we get, obviously. This is where I'm primarily focused. I have ~3 years experience with PHP, Javascript, AJAX, HTML, CSS, MySQL, etc, etc and am starting to get big on Objective-C (iPhone / Mac).

     

    Let me know if you have any projects that you need done.

     

    You can contact me through either the PM system here, or email me at: admin@lifecoderdev.com .

     

    Thanks for your time and consideration,

     

    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.