Jump to content

skaterdav85

Members
  • Posts

    874
  • Joined

  • Last visited

Everything posted by skaterdav85

  1. Thanks! I found a really good article that explains it in a little more detail too. http://abdussamad.com/archives/169-Apache-optimization:-KeepAlive-On-or-Off.html Basically I was wondering how to fine tune Apache for large spikes of traffic.
  2. Do Apache connections close once a server serves a web page for a given request? Also, if you are hosting all your static assets (JS, CSS, images, etc) on the same server as your site, how does that affect Apache connections? I was reading about the MaxClients Directive and these questions came to mind.
  3. you explained it much better JSG
  4. The code hasn't run through the PHP interpreter Save your file with a .php extension, and if you have a local web server with PHP installed, you will see the PHP code being interpreted.
  5. Interesting, thanks! I used the ReflectionMethod class instead of ReflectionProperty for my protected method, but it worked similarly.
  6. How would I use the setAccessible method in this case? Do all class members have a static method setAccessible so you can change it's access modifier on the fly?
  7. Yes, it is a logical OR. If args returns false, that expression will return arguments. If args returns true, args will be returned.
  8. Thanks JSG! I like your createDelegate method. Quite clever. In this situate I always just save this in a variable called that, which I'm sure you've seen before. It is kinda ugly especially if you have to do it in multiple methods.
  9. Well first off, why are you declaring a function called window? window is already a reserved object in the browser. Second, you will probably want to create all your instance properties/variables on the object. Right now you arent setting all those properties on your InitBuffer object. Move the following into InitBuffer and invoke it with new. this.xmlsource=objectsSource; this.indexbuffer = null; this.texelbuffer = null; this.initbuffer = InitBuffer;
  10. super interesting, thanks everyone for helping with this! EDIT: Just noticed, even though I can pass in $this using the 'use' statement, I can no longer call protected and private members. I have to make them public. I'm guessing it is because the context of the callback function is no longer in the class.
  11. In the code sample below, how do I access the value of $this inside the callback function in the hello() method? I also attached the class to this post if you want to execute it. I am getting the error: Fatal error: Using $this when not in object context I want $this to point to the current instance. class Person {public function hello() { $list = array(1, 2, 3, 4, 5); $this->iterate($list, function($num) { echo $this->multiply_by_100($num) . 'hello <br>'; });}public function iterate($list, $callback) { foreach ($list as $num) { call_user_func($callback, $num); }}public function multiply_by_100($num) { return $num * 100;}} $d = new Person();$d->hello(); php_closure.php
  12. Ya I saw that about PHP 5.4. This was one tricky bug to find out. Luckily there was an extra query string parameter that I could pass to Facebook to encode large ints as strings, which is what I wanted. All the other solutions I saw used tricky regular expressions which looked nasty.
  13. skaterdav85

    json_decode

    On my local MAMP stack (PHP V 5.3.6), json_decode is taking my JSON and converting long ints to strings. On my production server (PHP V 5.3.2), json_decode is converting long ints to floats. My long ints are Facebook page ID's that looks something like: 755509932534027 I found a workaround that tells Facebook to send me long ints encoded as strings, but how can json_decode behave differently on production? Is it possible to alter the default behavior of this function? Is this common? Thanks!
  14. I did a print_r on a simplexml object and I get the following: SimpleXMLElement Object( [@attributes] => Array ( [term] => Standards [scheme] => Responsible Organization ) ) How do I access @attributes? I want to get the array element [scheme]. $root->@attributes throws a syntax error because of the @ symbol.
  15. Thanks for the resources! I actually just installed Git on my work computer (a PC) and I noticed there was a Git GUI program along with Git Bash. I just used Git Bash since I am familiar with the terminal commands but maybe I should give the GUI version a shot. How do you like it? Easy to use? I guess for macs we're just left w the command line, which is fine i guess but it was a bit to learn when i first started. Thankfully, im over that hump now.
  16. It is a nice way to interact with GitHub, but it isnt a GUI for just using Git. Still, very useful since sometimes its hard to remember the commands for pushing to GitHub like "git push origin master"
  17. interesting! Im downloading it now. Might be a nice visual way to interact with GitHub. Thanks for sharing
  18. Woa, I havent heard of this. I have a mac and after you get used to the terminal, it's not all that hard to use. Looks like this is only for PC, which I may use whenever I'm on a PC. I've tried Tower before I was familiar with the terminal and I thought it was pretty good. Except you have to pay for it so I just went with learning the commands, which is probably a more valuable skill to have anyways.
  19. So I think the command is just: git add . Sound about right? I tried it and it looks like it staged just the files I modified or newly created files.
  20. Is there a way to stage all untracked and modified files using Git? I cant seem to find this anywhere. I know that if you do: git . it stages the entire folder I can stage each one individually but it is kind of a pain when the files are in different folders.
  21. When I first started web development, I bought DW because that was the only editor I knew. Several years later, I've been exposed to several other IDE's and I think I would still buy DW because of its Managing Sites feature. This makes FTPing files so much easier, especially if you have files in several different folders. With FileZilla or Fetch, I have to constantly open up the right folder and drag over my local copy of a file to update the new one on the server. In DW, I can just click that Put arrow and it figures out the proper folder for where to update the file.
  22. oh ok. thanks! i see it displaying the missing font types.
  23. i see the yellow exclamation points next to the text layers. How do I find out what font is missing? And how do I add new fonts?
  24. im not much of a PS guy, but i have to slice a psd. i got a psd from someone and when i open it up in PS on my computer, it says:"Some text layers contain fonts that are missing. These layers will need to have the missing fonts replaced before they can be used for vector output."Is there a quick fix to solve this? I googled a bit but i didnt find a direct answer.
  25. netbeans is really good, except what i hate about DW and Netbeans is the load time. neither are lightweight and sometimes lag a little depending on if other processes are running in the background whereas something like TextMate which has bundles and syntax highlighting is really lightweight and good enough for most of what i do.
×
×
  • Create New...