Jump to content

johnrcornell

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Posts posted by johnrcornell

  1. Hi Guys,

     

    I promise I read through the Zend site on this, but I'm pretty confused, about the overlap and relationship between these things:

     

    Zend Core

    Zend Web Server Debugger

    Zend Executable Debugger

    Zend Platform

    PDT

     

    Basically, I have Zend Studio and I want to be able to debug my code on my remote Linux server. It *seems* like php-devel package comes with Zend Debugger (?????) but

     

    # yum install php-devel

     

    gets

     

    Error: Missing Dependency: php = 5.1.6-3.7.fc6 is needed by package php-devel

     

    Well I've got PHP 5.2.5 installed, so I don't know how an outdated version of PHP could be a dependency. Then there's xdebug, which seems to be an alternative to Zend Debugger, which you can install by

     

    #pecl install xdebug

     

    But

     

    #pecl install zenddebugger

     

    does nothing. So I can't use yum, pecl (and obviously not pear) to install Zend Debugger? And Executable debugger? Web Server debugger?

     

    I'm so confused. Please help. Thank you.

  2. Here's my JS in the HEAD section:

     

    <script language="Javascript">
    
    function toggleclock(clock) {
    
    if (clock.state = 'on') {
    	clock.src = 'includes/png/clock_color.png'
    	clock.state = 'off'
    }
    
    else if (clock.state = 'off') {
    	clock.src = 'includes/png/clock_bw.png'
    	clock.state = 'on'
    }
    
    }
    </script>
    

     

    And here's in the BODY section:

     

    <img src="includes/png/clock_bw.png" border=0 onload="this.state='off'" onclick="toggleclock(this)" style="cursor: pointer;" />

     

    The script seems perfectly logical, I never have problems like this in PHP this is why I hate JavaScript. I can never get even simple things to work let alone complicated things. I'm sure I'm just misunderstanding. Does anyone see what's wrong? The results are that it'll toggle the image initially from clock_bw.png to clock_color.png, but once it's toggled to color it will not toggle back to black and white.

     

    Thanks for anyone with insight. This is holding up the show on this project!

     

    Ricky

  3. Hi Guys!

     

    I'm hoping one of you smart cookies out there understands regex better than I do.

     

    $street2 = "Unit 1 A";

    $street2 = preg_replace('/(?<=(?:Unit|Apt)\s.)\s/','',$street2);

     

    I expect $street2 to now equal, "Unit 1A"

     

    Instead, I get, "Warning: preg_replace() [function.preg-replace]: Compilation failed: lookbehind assertion is not fixed length at offset 19"

     

    I barely got the regex where it's at, I cannot figure out where to apply * here in order to give me an arbitrary lookbehind length. Since the target could be:

    Apt 1 A

    Apt 23 A

    Unit 1 A

    Unit 23 A

    Unit 234 BF

     

    etc

     

    Any ideas anyone?

  4. So the object definitions are collectively the "model"

    All that class-external instantiation and logic is the "controller"

    And the easiest to understand, the system output is the "view"

     

    I think I've got it. Thank you!

  5. There's nothing wrong with MS Bob as long as you have it configured correctly. It's resource overhead is actually very low. I've been working on some OS-based multi-threaded processing with it, between the two it's surprisingly a pretty agile web platform. Parallel to the strengths of NetBSD.

  6. Hey, thank you for your response! I think I've got a little better grip on it now. I have a rephrase of the question-

     

    Is it correct to say that in a properly-designed MVC implementation, no instantiation would occur in the model outside of a class?

  7. If you're looking to search through the contents of an array with permutations of natural language or anything like that you'll have to write some regex. It looks intimidating at first but it's fun once you figure it out. Sorry for the vague answer, just trying to provide a next-step jumping off point if you find out that you mean something more ambitious by "search."

  8. You're welcome!

     

    What you do with the images is a matter of how much time you have on your hands. I personally like the effect of PNG's alpha channels on my backgrounds so much that I create two sets if images, one set in PNG and the other in GIF. I have the files the same name, just with different extensions. Then I have JavaScript look to see if they're using IE, and if they are change the "img src" path to .gif, and if they're not use .png.

     

    If you don't have the time to make two sets of images, and write JavaScript to detect the browser, you'll have to just use GIF images. If I can figure out how to build a time machine, I will go back to Bill Gate's garage and abduct him and then you will be able to use only PNGs.

     

    Hope this helps.

     

    John

  9. Apparently __get() and __set() are useful in the implementation of singleton patterns whilst avoiding factory methods.

     

    class Singleton {
    private static $props = array();
    
    public function __construct() { }
    public function __get($name) {
    	if(array_key_exists($name, self::$props)) {
    		return self::$props[$name];
    	} //if
    } // __get
    
    public function __set($name, $value) {
    	self::$props[$name] = $value;
    } //__set
    
    }
    
    $a = new Singleton;
    $b = new Singleton;
    $a->property = "hello world";
    print $b->property; // hello world
    

  10. PNG is king-of-web graphics in my opinion, because of its alpha channel properties (in other words, an opacity gradient in the image if you want it.) Unfortunately, Microsoft has fucked us again by providing no support for that, although promising support for it since 1994. Technically, the alpha channel is an optional part of the PNG specification, so this is the grounds that Microsoft uses to defend their laziness.

     

    GIF has transparency, but it is not a channel, it is on or off. With GIF, you specify a "matte" color, which is used for anti-aliasing so it blends into the transparency as much as possible. However, when you're using a background that isn't a solid color this isn't so-great of a solution.

  11. The best solution for this is probably a product called SitePal, http://www.sitepal.com which uses a TTS-engine called NeoSpeech. I've actually done a lot of research in this area, and NeoSpeech is, in my opinion, the best TTS-engine by far. It makes AT&T TrueVoice or whatever it's called sound like Microsoft Sam. Of course there's money involved in this. If you want the voice to sound like Automatron-3000 I think the AT&T engines have non-commercial free licneses available.

  12. Hi,

     

    Seeing the frequency of this on this board I hope no one is rolling their eyes at my topic. I posted this at comp.lang.php and got 0 responses, so I'm thinking it was the wrong place to ask. Reading some of the explanations here http://www.phpfreaks.com/forums/index.php/topic,138169.0.html it sounds like the model is just where your database abstraction/ORM takes place. Here was my original post:

     


     

    Greetings All,

     

    I had a question about OO implementation in the MVC pattern that is

    directed at anyone who feels experienced with it.

     

    My fuzziness comes from trying to learn OOP and MVC at the same time,

    coming from a procedural background where I used neither. I promise

    I'm not a dummy, and my logic skills are very strong, but this really

    is a whole new world for me.

     

    From my study of MVC the role of the controller component is most

    confusing to me. Traditionally, it seems that the controller was used

    in os-based software to manage input from the user, the actual data

    type handling, etc, where on a statically typed language or os-based

    software that is more of an issue. Reading a Developer's Library book

    called "Advanced PHP Programming" by a guy named George Schlossnagle

    (who seems like a fairly bright programmer) the assertion is made that

    the controller is irrelevant to the web because the browser handles

    all the input. Obviously that's not the stance of a big part of the

    community, as frameworks like Symfony, etc make a big deal out of the

    controller. The PHP-framework implementation of a controller seems to

    be more abstract than in os-software.

     

    So my question is, if I were to implement a controller, what I gather

    is basically that the model component would be comprised of only

    classes with no procedural execution, and that the controller would

    primarily be responsible for all instantiation of the model's business-

    logic classes? Is that the idea? I realize I may be asking for an

    answer that involves personal preference but if you have one, please

    let me know. Thank you in advance!

     

    Ricky

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