Jump to content

alexweber15

Members
  • Posts

    238
  • Joined

  • Last visited

Everything posted by alexweber15

  1. i started with Dreamweaver and the only thing i hate about it is the ancient api as far as autocompleting, function arg hinting and function coloring. yes, it can be customized, but it takes up too much time and i haven't gotten around to trying to do something about it yet recently I've been playing around with nusphere phped and it definitely has some more professional and powerful tools (like integrated validator, csv, debugging options, not to mention the up-to-date api) and I love having multiple projects per workspace so I can easily switch between the htdocs/public/www (whatever you wanna call it) folder and the "out of public reach" folder. BUT, i just find dreamweaver a lot easier and more comfortable to use for the HTML + CSS stuff (nusphere's approach, despite the feature list pimping all of its HTML capabilities, still hasn't clicked with me) and i've tried PHPEditor in the past but stopped when I installed Dreamweaver
  2. nice, interesting results, keep 'em coming! i use camelCase cause i started with Java (well VB 3.0) to be honest but consider Java the first "real" programming language I learned (no offense to all BASIC fans out there) and as far as the var goes i used to alternate between camelCase and this_case but for some reason I got into the habit of avoiding capitalization in DB-related stuff so all my Data objects started having the same variable naming style as my database columns and one thing just led to another but yeah corbin why the camelCase hate? I mean things starting with "camel" are usually kinda sweet; like "camel cigarettes" or "camel toe" oh and this is a shocker to me: Some_class; ??? i guess i'm just pedantic (except with capitalization when im posting this late at night) but my classes are 100% strict ProperCase (which hasn't caused any problems yet despite someone mentioning it (and i do my local dev with apache + windows and my remote hosting is more often than note apache + nix) so i guess thanks to the php team for default strtolower() in __autoload() which, this just crossed my mind, is unheard of according to your guys' poll votes strToLower() is so much more legible.... *sigh*
  3. Hey DarkWater, time to gain more OOP knowledge from you! I'm just trying to understand the nuances of this code (no comments on Corbin's, sorry!) - the DB Layer Factory as a singleton is a good idea? - the actual DB Layer shouldn't be a singleton (wouldn't this present problems having multiple DB Layers each using different adapters) ? - Storing the Config in a seperate location and passing the info as a parameter to the constructor is good? (i'm loosely using the terms good/bad here, just trying to learn a thing or two!)
  4. fantomel, your code has changed so much from PMs to the thread that I'm lost! Did you fix your problem? And if not please post the entire class and test code that generates the error and of course the error itself! I realize that there might be some hesitance in posting an entire class code here or anywhere for that matter (unless releasing under an open-source license) so if you must omit parts of your code try to omit the ones that aren't relevant to the problem at hand please! Anyway, waiting on a reply! Alex
  5. thanks for the code and thanks Acs for the link gonna run some tests and revisit my standard function
  6. Wish we could create multiple polls per post then I wouldn't have to create so many options! Anyway, here's to find out what conventions our fellow PHP coders use. (I realize that a lot of us are forced into conventions depending on a particular framework but just answer what you would usually use) My answers: camelCase for functions lowercase + underscore for variables I guess because i got into the habit of naming all database stuff lowercase + underscores I decided to do the same with variables to make persistence easier PS - Let me know if i'm missing any other options!
  7. in fact it does! (kind of) sanitize email filter but it doesn't actually validate whether the email is well-formed, just cleans it ("sanitizes"). and effigy i'm gonna have to get back to you on the example of it failing without the concatenation but i remember it happened once a long time ago and i never tried to remove it again!
  8. agreed on both statements! (rhodesa and corbin) i guess i just had a lapse where i got a little too concerned about who was going to use it rather than doing it properly. after all, i'm complete the documentation at the end and offer support so i should just focus on making it functional!
  9. lol good point im all for case-sensitivity as it makes you write more legible and less error-prone code (somehow) but this was a particular situation where i was trying to write a friendly api for a class by including multiple aliases for each function, etc come to think of it, screw it! i'm gonna remove all aliases and people should just RTFM if they wanna use my class
  10. lol i hope you're being ironic they should do the exact opposite and add the case insensitive param to const
  11. thanks for the link! ill put that on my "CSS Sprite" reading list (which is growing by the day...lol) can't keep pushing it away much longer...
  12. if im not mistaken its usually installed by default just run the following phpscript on your server: <?php phpinfo(); ?> and search for "gd" you should find something like this: GD Support: enabled
  13. thanks for the link, will look it up later no comments on my suggestion though?
  14. try this: smart image-resize class
  15. attached is a small script that tests SQL statements... its definitely not pretty and not optimized but its gets the job done which is: send a query and see the results. I've found it useful to debug sql-related errors by echoing my $sql variable and then copy and pasting it into the script to see what happens... easier than var_dumping everything im kind of tied up at work but if the OP is still having problems i'll be happy to check back and help later! -Alex [attachment deleted by admin]
  16. why not? seems silly to me that's why... i'd rather define an uppercase and lowercase version of the same constant =P const FOO = 'bar'; const foo = self::FOO; lol just kidding! really i'd rather just stick with all-uppercase convention instead, i just think it doesn't add up because I mean if you can declare case-insensitive constants outside a class then why the hell can't you do the same inside the class? seems like poor implementation to me...
  17. nice addition to the forums btw! just browsing through the "common expressions" and here's my uber email checking regex: mine: "^[a-z0-9]+[a-z0-9\?\.\+-_]*"."@[a-z0-9_-]+(\.[a-z0-9_-]+)*\.[a-z]+$" yours: "[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}" comparing them briefly side-by-side mine is more flexible in that it allows for dot dot domains (.com.br for brazil for example) and also enforces starting and ending rules i've used it for ages (adapted from an example someone showed me) and one thing i don't understand is the concatenation in the middle (but it doesnt work without it) also off the top of my head im not sure whether or not question marks (allowed in mine) and ampersands (not allowed in mine) are allowed or whether email addresses are allowed to start with underscores for example (too lazy to read up on this at the moment) I don't mean to be a dick or anything just throwing my idea out there to maybe help the community! Alex
  18. hey sorry don't mean to discourage you but there's already a "mysql" class (and a "mysqli" class and a "PDO" class for that matter!) definitely a good learning exercise to write a DB-interaction class but i'd read up on what's already available (maybe you just need to extend one of the existing classes?) and name it something different
  19. weird issue i ran into today... - its possible to define case-insensitive constants outside the scope of a class using: define('name', 'value', false); however, you cannot use define() for Class Constants. - to define a Class Constant you have to use (inside class scope): const 'name' = 'value'; So what happened to case-sensitivity here? how can i define a case-insensitive Class Constant???? thanks! Alex
  20. oh i see... well actually i don't im kinda confused now. regardless of sorting and adding into multiple lists you can always get each lists' items from the lists id and you can just serialize the list but iterating over its items and binding that to any list modification...
  21. oh i see take a look at the UI component "sortables", its just the thing: Sortables DEMO jQuery UI Home TIP: the entire UI library is kinda heavy so go to "create your own download" and get just the "core" and "sortables"
  22. F1Fan is right... I'm gonna throw you a bone though here's my quick and dirty (and prolly containing one or two typos) example on submitting a form using ajax http://www.phpfreaks.com/forums/index.php/topic,221116.0.html
×
×
  • 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.