Fork me on GitHub

Updates from July, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • britg 4:12 pm on July 8, 2008 Permalink | Log in to leave a Comment  

    Sucks to be in the Virtual World Business Right Now 

    Just saw on TechCrunch that Google has just released a Virtual World, Lively.  Haven’t had time to process it all yet, but first reaction – sucks to be in the Virtual World Business (especially web-based VW).

    Second reaction – I’m having trouble relating this to their core business, but Schmidt and co. are a lot smarter than I am.

     
  • britg 5:58 pm on July 7, 2008 Permalink | Log in to leave a Comment
    Tags: , google data api, zend framework   

    Using the Zend Framework in CakePHP 

    What do you get when you combine the powers of CakePHP 1.2.x and the Zend Framework?

    No, not Captain Planet… something much more powerful – the ability to use the Google Data API PHP library! This is useful if you want to use Google Calendar or any of the other services supported by the data API.

    Loading the Zend Framework isn’t as straightforward as App::Import(…), since Zend’s libraries assume that the Zend Framework folder is in your include path. To get around this simply:

    1. Drop the Zend Framework Library folder into your vendors folder
    2. Create a script in your Vendors folder called something like zend_include_path.php with the following statement:
      ini_set('include_path', ini_get('include_path').dirname(__FILE__));
      
    3. In your action, just do the following, replacing Gdata.php with whatever library you wish to load (i.e. Loader.php):
      function myAction() {
           App::import('Vendor', 'zend_include_path');
           App::import('Vendor', 'Zend_Gdata', true, false, 'Zend/Gdata.php');
      
           ...
      }
      

    Voila! You should now be able to instantiate your loaded Zend Library Class and work with it normally.

     
    • David Spreekmeester 10:37 am on September 17, 2008 Permalink

      Hey there, thanks for the advice. Works great, adjusting the include path on the fly like this.

      However, my include path was not ending in a semicolumn, so I had to adjust this in zend_include_path.php:

      ini_set(‘include_path’, ini_get(‘include_path’).';'.dirname(__FILE__));

    • britg 12:43 pm on September 17, 2008 Permalink

      Interesting – i guess the most extensible solution would be to check if
      there is a semicolon and add it if there is not – like your case.
      Thanks for sharing

    • davidcm 7:10 am on October 1, 2008 Permalink

      In fact, is better to use the PATH_SEPARATOR constant to determine the character to use. And there is no need to check if the include path ends with it or not, because an empty entry should no affect.

      ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__));

    • davidcm 2:10 pm on October 1, 2008 Permalink

      In fact, is better to use the PATH_SEPARATOR constant to determine the character to use. And there is no need to check if the include path ends with it or not, because an empty entry should no affect.

      ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__));

    • JoshReedSchramm 10:35 pm on September 26, 2009 Permalink

      You good sir are a rockstar. Just found this post and it saved me a ton of headache. *tips hat*

    • Alexmbarton 9:37 am on June 30, 2010 Permalink

      It's been a while since you posted here but i'm having an issue with it.

      I'm getting Warning: require_once(Zend/Gdata/App.php) failed to open stream.

      Fatal error: require_once() [function.require]: Failed opening required 'Zend/Gdata/App.php' (include_path='/Applications/MAMP/bin/php5/lib/php/Users/dir/Sites/student/app/vendors') in /Users/dir/Sites/student/app/vendors/Zend/Gdata.php on line 27

      Any ideas?

      Thanks

      AB

    • kavoreo 1:40 pm on September 12, 2010 Permalink

      Thanks for the advice. This is spiffy! Best of both worlds.

      By the way, does anybody know if convention prefers placing the zend lib files in /vendors or /app/vendors? I have them in /vendors and it seems to work (found out the hard way that it doesn't if you put them in both).

    • skybear 12:31 am on April 5, 2012 Permalink

      I have a web application by zend framework.
      I want to convert to cakephp framework this.
      By the way, do you think I can use this application without converting ?

  • britg 3:33 pm on July 7, 2008 Permalink | Log in to leave a Comment
    Tags: snow crash   

    My Favorite Line from Snow Crash 

    Yeah, I’m reading Neal Stephenson’s Snow Crash for the first time.  All I have to say is if you haven’t read it and are even remotely interested in Sci-fi/Cyberpunk, or your friend’s ex-boyfriend’s mom’s weird yoga teacher knows a guy who’s interested in Sci-fi/Cyberpunk you need to go buy this book immediately.

    My favorite line so far:

    After that–after Hiro gets onto his motorcycle, and the New South Africans get into their all-terrain pickups, and The Enforcers get into their slick black Enforcer mobiles, and they all go screaming out onto the highway –after that it’s just a chase scene.

    Ok, so taken out of context it’s pretty lame – this line ends an intense, minutely detailed sword fight and subsquent escape by Hiro.  Eh, you’ll just have to read the damn book, but hopefully it gives you a good dose of the satire and black humor that pervaids this masterfully written novel.

     
  • britg 7:13 am on July 5, 2008 Permalink | Log in to leave a Comment
    Tags: , location based gaming   

    Location Based Gaming and the iPhone 

    Location based gaming isn’t anything new.  Take a look at the wikipedia page for location-based game to see a wide variety of games dating back to around the turn of this century.  But, what are all these games missing?  Hint: it starts with an i and rhymes with dry scone.

    (More …)

     
    • Muhahahahaz 3:21 am on August 15, 2008 Permalink

      All I can say is, TF2!!

      Ok, maybe not exactly like it, but you know…

      TF2 already has a very good method of capturing/defending points and stuff, so I would suggest looking there for help.

      The game could even keep track of team mates, and allow you to aim and “shoot” the opposing team if you are close enough.

      There could even be spies that appear like they are on your team!

      Ok, I'll stop now… lol. But having a large amount of virtual features, in addition to real-world movement, would be awesome.

    • britg 5:50 am on August 15, 2008 Permalink

      Haha, yes I agree that would be amazing – I guarantee something like that will be released soon. Possibly after this next iphone update, when the GPS SDK is supposed to be a lot more accurate.

    • Muhahahahaz 10:21 am on August 15, 2008 Permalink

      All I can say is, TF2!!

      Ok, maybe not exactly like it, but you know…

      TF2 already has a very good method of capturing/defending points and stuff, so I would suggest looking there for help.

      The game could even keep track of team mates, and allow you to aim and “shoot” the opposing team if you are close enough.

      There could even be spies that appear like they are on your team!

      Ok, I'll stop now… lol. But having a large amount of virtual features, in addition to real-world movement, would be awesome.

    • britg 12:50 pm on August 15, 2008 Permalink

      Haha, yes I agree that would be amazing – I guarantee something like that will be released soon. Possibly after this next iphone update, when the GPS SDK is supposed to be a lot more accurate.

  • britg 2:39 pm on July 1, 2008 Permalink | Log in to leave a Comment  

    Paginating MySQL Fulltext Searches in CakePHP 

    # query comes from GET request parameter 'q'
    $input = $this->params['url']['q'];
    
    # sanitize the query
    uses('sanitize');
    $sanitizer = new Sanitize();
    $q = $sanitizer->clean($input);
    
    # now the pagination options hack to perform a fulltext search
    # we are searching a table called 'listings' with a fulltext index on
    # `title` and `description`
    $options['conditions'] = array(
       '1' => "1 AND MATCH(Listing.title,Listing.description)
              AGAINST('$q' IN BOOLEAN MODE)"
    );
    
    $this->set('results' => $this->paginate('Listing', $options);
    
     
  • britg 6:43 am on July 1, 2008 Permalink | Log in to leave a Comment
    Tags: , , search, yahoo   

    Searchable SWFs – Game Changing 

    Adobe just dropped a bomb as far as I’m concerned.  They’ve announced a collaboration between Google and Yahoo to bring fully searchable SWFs.  Ted on Flex reveals the best part:

    The cool part is that this also covers dynamic data loaded in from requests to a server, these are typically ignored in both AJAX and SWF applications.

    This is going to open the door for a lot of the cool and useful things we’ve been wanting to do for clients at Figaro, but have had reservations about because of SEO implications, and  I’m sure many RIA houses out there feel the same.

    Combine this news with a tool like swfaddress to provide deep linking into your applications and BAM! you have a killer combo.  Let’s just remember to keep our apps classy and tasteful, guys and gals.  This news isn’t cause to go hog wild with flash like the late 90s, early 2000s restaurant site debacle.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel