Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. point of a function is for a bit of code to be encapsulated with its own scope. Without that, you cannot guarantee that your function will work and/or return what it is supposed to 100% of the time. The better thing to do would be to pass those variables as arguments and return when you are done. Also your function should also validate those vars, make sure they are what they are supposed to be. Or pass validation off to a separate function...for example, you have that $user_id directly in a query... where is that coming from? Is it being validated somewhere else? Can the user somehow change/influence its value at some point in time before that query?
  2. .josh

    Education

    right, I more or less agree. "Right tool for the right job" is always true, no argument there. My point was that doing quite fine without a degree still involves a lot of effort on someone's part, and I sort of got the impression that OP was just looking for a reason(s) not to pursue a degree, without considering that those reasons are only legit if you actually put in the alternative efforts involved in getting to the same point w/out one.
  3. .josh

    Education

    See IMO he's not necessarily caring at all whether xyz is specifically worth pursuing...I think he's just tired of his future in-laws hassling him and he wants to go back and tell them going through the effort to get some piece of paper is little more useful than having something to wipe your ass with. As I have mentioned, that's fine and dandy if you actually have a "Plan B" and are pursuing it.
  4. If you mean "show the user their computer's specs"... $_SERVER has a few things gleaned from the client request to the server that might be helpful like browser, OS, but you won't be able to get things like RAM, HDD space, etc... and even what you can get can easily be spoofed. So the short answer is no, you can't do that with php. You would need to make and have the user download and run something on their computer (like a java applet or activeX control) that can access that sort of stuff.
  5. .josh

    Education

    Okay comparing degrees is fine and dandy but I think the overall point here is whether a(ny) degree is worth pursuing in the first place.
  6. .josh

    Education

    If you have some decent people-skills, degrees are practically worthless. You can very easily learn what you need to on your own, claim you went to xyz university and land a job. Is that lying? Technically... but it's kinda hard to feel bad about it when Average Joe Company does not actually check your credentials. Universities do not offer you something you cannot get on your own. All they offer is a 3rd party seal of approval, to give a company reassurance that you can do what you say you can do. At the end of the day, companies don't give a shit about pieces of paper; they give a shit about the needed job being done. When you are sitting in an interview, they are looking for confidence. Your technical knowledge means jack shit if you aren't confident. Having some xyz paper in your hand means jack shit about whether you are a lazy bum, procrastinator, asshole, etc.. those things are just as important, and arguably MORE important than actual technical skills. That is not to say that you don't need technical knowledge. What that means is at the end of the day, it doesn't matter where you got it, if you can convince them of that. ...but I would not be so quick to tell them that getting a degree is not your style...a degree is a good way to get your foot in the door if you don't have the people skills and have gained the knowledge on your own. So telling your future in-laws that a degree is not necessary won't really work unless you do have the knowledge and know how to "work the room" - and have plans to actually put that to use (do you? have you told them?). Thing is, the very existence of this post and your thoughts within it and statement of in-laws bitching...makes me believe you don't have the people skills (..and do you even have the actual knowledge that going to college offers?). Bottom line is you aren't making as much money as they think you should be making. It sounds to me like you're working some min. wage job or not making enough money to pay the bills, or just not making the amount of money they consider to be "okay", so your in-laws are worried/bitching that you won't be able to provide for their daughter. It sounds to me you are inclined to believe that going to college is not a necessary step, but do you actually have an alternative plan? Because pointing out how others succeed w/out higher education means absolutely nothing: it does not somehow make YOU move up. It takes real effort and work just the same to do it w/out college.
  7. I don't think $(document).ready waits for images to completely load...
  8. You could write a script to scrape your Profile Info > Show Posts pages and use your own script to filter/search through them.
  9. I don't see anything wrong in the post thorpe made. He told you what the forum was there for, and what it was not there for. I think SA hit the nail on the head: you just think you deserve some kind of special treatment because you allegedly made a donation. This isn't our job, we don't get paid for it. We do not follow "the customer is always right" mantra around here. If you expect someone to cater to you and you're (supposedly) willing to pay for it, I suggest you hire a freelancer.
  10. ninjas don't talk about being ninjas.
  11. that's mostly because the script kiddies tainted it.
  12. shot in the dark, but maybe all the avatars are stored in same dir and the filename already exists. I know that was (dunno if it still is) an issue with uploading files in posts.
  13. Not sure you could hack your way out of a paper bag. I might if it was wet. Most guys strive to get in to wet things...
  14. .josh

    Lol @ pic

    yes, because you have to be clean-shaven and wear nice clothes to be able to code.
  15. many times, one does not know the answer because one does not know the question. IMO learning to ask questions properly will lead you to being able to answer them yourself, yes.
  16. hmm are you sure your card has a tv tuner installed on it? that s-video is probably just an out jack, not a tv tuner that actually takes it as input and descrambles the signal. I did a quick search on the model you listed and it seems to list the s-video as out. You need to buy a pc tv tuner card/usb device in order to watch tv on your pc. Some of the higher end graphics cards may have that built in but most do not.
  17. Different people have different ways that work best for them. Some people find it easiest to watch video tuts, some like to take snippets of code and poke at it, some are fine reading tuts online, some like having a physical book. There's no "one way" that works best for everybody. Trick is to find the way that works best for you. The thing that seems to universally not work / be acceptable is expecting people to spoon-feed you stuff. Hard fact to accept, but if you need to be spoon-fed, you obviously won't be able to make it on your own...maybe find something else out there that suits you better. Some other language, or some other thing altogether. Too many people out there think coding is some easy thing that can be picked up on the fly, but it's not. Just like not everybody can be a doctor or scientist. Just that...coding, especially something open-source like php, really easy for average joe to get access to it, and that makes average joe think easy access == easy learning.
  18. if I understand correctly, you are looping through a string and replacing matches, but if it finds a match, you don't want it to keep preg_replacing stuff, yes? Use a loop, preg_replacing one at a time (use the 4th argument in the preg_replace to limit to 1 replace) and if something is replace, break out of the loop.
  19. .josh

    Replace link

    Your problem is your stars are greedy. change .* to .*? though personally I'd probably suggest using a negative char class instead: [^|]* Also since you are replacing it with nothing, no reason to capture anything in there (get rid of the parenthesis) Also judging by your example, you may need to add the s modifier to your pattern.
  20. .josh

    PHP no nos

    With regards to the email filter presented, all that it does is run the value through a regular expression. Nothing magical nor complicated. well sir, that's where you are wrong. regex is magical.
  21. .josh

    PHP no nos

    overall I lean towards readability. I get off to regex but most people run away screaming even thinking about it. If I can accomplish the same thing using an strpos and an explode or some other similar thing, I'll usually go for that, as it would be easier for future people touching it to figure it out.
  22. .josh

    PHP no nos

    @roopurt: okay for your situation I can see how you would say doing it that way might work out better for you, so if that works for you, then more power to you Agreed. And to extend that, I hate how people liberally escape quotes to make up for stuff like that. How can having a long string of escaped quotes possibly help anybody? I've seen more than plenty of syntax errors posted on the forums that were due to people getting lost in their quoting endeavors. Agreed. At best, this does not help readability. At worst, it hurts error handling capabilities. yeah... I really don't see the point in this, with few exceptions, like for instance, a switch with a bunch of single line code blocks. I don't have issue with the break; being added to the end of them. To be fair though, this is kind of a hangup from the good old days. With high res monitors, 80 chars wide should not be a big deal, except catering to people who refuse to update their hardware...on the other hand...I guess trying to sort through shit from a command line might suck, but I'd counter that with..why are you messing with a script from a command line instead of a real editor anyways?
  23. sure, that would work, though opposite of what you're asking. If it finds anything that is not a-z or A-Z it will return true. So true means the string has more than just letters, false means that it IS only a-z or A-Z if you want to have it return true if the string is only case insensitive letters, you would need to do this: preg_match("/^[a-z]+$/i',$str);
  24. .josh

    PHP no nos

    Designers should not be making html "templates" to be handing to coders. Coders should be making a system that designers can use, so they can easily add new pages/content. It is pages/content that is constantly being added to a site, not code. Look at any CMS as an example. And yes, javascript generated content will not show up in the view source, and you are correct, you would need a live DOM inspector to see that...but I can take your argument and apply it to your own class. PHP kicks out the javascript etc... there is no way for php to know ahead of time what it's going to do with whatever you give javascript. Javascript is going to take what you give it and do its thing client-side, and you may or may not get errors (and they may or may not be browser (version)? specific, and php ain't gonna know anything about it.
  25. .josh

    PHP no nos

    eh... at the end of the day, if that works for you, then go for it. I personally don't see the benefit in swapping one syntax for another. Running a validator is IMO not that big a deal. Not to mention, I don't really see how that code maintains the spirit of MVC. If I were a designer just trying to focus on content and html, I'd have to learn to code to do it your way.
×
×
  • 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.