
Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Help testing my site for vulnerabilities
Philip replied to greens85's topic in Beta Test Your Stuff!
If you're still looking for admin verification - please PM me. -
Yeah, the main thing it fails to mention is once you have a king of a genre... you better have a damn good idea / website that sets you apart to even think about it
-
$string = preg_replace_callback('~([a-z]+)(\d+)(?:-[a-z]*(\d+))?~i',create_function('$m','return (isset($m[3]))?($m[1].implode(\',\'.$m[1],range($m[2],$m[3]))):$m[0];'),$string);
-
I know what you are saying for strings and such, but I don't think it is really necessary. <?php class String { protected $_string = ''; protected $_length = 0; public function __construct($string) { $this->_string = $string; $this->_length = strlen($this->_string); } public function __get($property) { $property = '_' . $property; if(isset($this->$property)) return $this->$property; } public function __toString( ) { return $this->_string; } } echo (new String('testing'))->length; // '7' echo (new String('testing')); // 'testing' // vs... echo 'testing'; echo strlen('testing'); In any case, hopefully you've gotten it through your head that OOP is NOT a one-size fits all solution.
-
Please wrap tags around your code next time. Also, if you want help it is highly suggested to post relevant code only.
-
Since I do a lot more JS work, I commonly use debuggers that let me step through the code (such as chrome/IE's dev tools, firebug + omnibug (specific to web analytics.) We also use packet sniffers like Charles proxy / Fiddler2 (my favorite) to inspect the urls / use local files on live sites to test against client sites where we don't have access to upload / push new files.
-
Please see http://www.phpfreaks.com/forums/index.php?topic=360081.msg1702782#msg1702782 to continue this thread.
-
Yeah, this is a case of lawmakers sticking their noses where they don't belong without consulting the proper experts. I still have yet to understand what people complain about with cookies. "Oh noes, sites track me so I get more relevant ads! Nooooo!"
-
$str1 = new String("This is a String"); $str2 = new String(" and a concatenated one at that!"); $string = $str1->append($str2); $system->output($string ->toupper()); // "This is a String and a concatenated one at that!" It's the way of the future man.
-
Interesting - I have not heard of them before. I will need to check this out, cheers!
-
Yeah, I've used Selenium before. nifty stuff!
-
Yeah, it's in the works
-
I very well could be missing the point. In my humble opinion I don't see how his scales any better than mine. Actually, I do; when a site does not have consistent layouts or html markup his method comes in a lot more handy. I'd be curious to see what he has to say though
-
I guess the impression I get is that my 'normal' way of implementing something is "wrong" according to him. This is an example of my normal markup for a news article on page: <article class="news"> <header> <hgroup> <h3>Article Title</h3> <h4>Article Subtitle</h3> </hgroup> <time datetime="2012-05-12" pubdate>Tuesday, May 22<sup>nd</sup>, 2012</time> </header> <p>Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price.</p> <figure> <img src="foobar.jpg" alt="Foo bar"> <figcaption>Foo bar</figcaption> </figure> <p>You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.</p> <footer> <section class="vcard"> <header> <h4>Author</h4> </header> <address> <a href="/user/foobar">Philip Lawrence</a> </address> <p>In facilisis scelerisque dui vel dignissim. Sed nunc orci, ultricies congue vehicula quis, facilisis a orci. In aliquet facilisis condimentum.</p> </section> <nav> <header> <h4>Relevant Articles</h4> </header> <ul> <li><a href="/goo">Foo about goo</a></li> <li><a href="/foo">Goo about foo</a></li> <li><a href="/boo">Boo about goo</a></li> </ul> </nav> </footer> </article> With that HTML, I'd use something like the following CSS for it: .news > header { background-color: #aaa; } .news > footer { background-color: #888; } .news .vcard > header { border-bottom-color: #999; } /* LATER */ .vcard { /* general vcard info */ } .vcard > header { border-bottom: 1px solid #333; } However, I feel like he would want a lot more classes throughout my html, to the point of something like this: <article class="news"> <header class="news-header"> <hgroup> <h3>Article Title</h3> <h4>Article Subtitle</h3> </hgroup> <time datetime="2012-05-12" pubdate class="news-time">Tuesday, May 22<sup>nd</sup>, 2012</time> </header> <p>Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price.</p> <figure class="news-figure"> <img src="foobar.jpg" alt="Foo bar"> <figcaption>Foo bar</figcaption> </figure> <p>You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.</p> <footer class="news-footer"> <section class="vcard article-vcard"> <header class="article-vcard-header"> <h4>Author</h4> </header> <address class="article-profile> <a href="/user/foobar">Philip Lawrence</a> </address> <p class="article-bio">In facilisis scelerisque dui vel dignissim. Sed nunc orci, ultricies congue vehicula quis, facilisis a orci. In aliquet facilisis condimentum.</p> </section> <nav class="news-footer-nav"> <header> <h4>Relevant Articles</h4> </header> <ul class="news-footer-relevant"> <li><a href="/goo">Foo about goo</a></li> <li><a href="/foo">Goo about foo</a></li> <li><a href="/boo">Boo about goo</a></li> </ul> </nav> </footer> </article> Which would in return, change my CSS to something like: .news-header { background-color: #aaa; } .news-footer { background-color: #888; } .article-vcard-header { border-bottom: 1px solid #999; } /* LATER */ .vcard { /* general vcard info */ } Of course, I'm likely over exaggerating this but I feel like my way makes the user write clean HTML and his makes the user write clean CSS. Personally, I think HTML should be cleaner since: a) usually there is a lot more HTML than CSS over a website (thus from a size perspective, 3kb extra per each page to add in extra classes < 3kb extra per CSS file for longer selectors) and.. b) CSS is an addition to HTML - just like pictures are additions to a novel I do see where he is coming from, in that it allows for more extensibility - but with correctly written HTML you do not need to worry about this.
-
Mmm, I have to disagree with some of the code practices / thoughts butttttt ... I'm lazy atm to write a full-on comment on it. Maybe later tonight after a few beers
-
This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=359652.0
-
Which directory structure / naming convention do you prefer?
Philip replied to trq's topic in Miscellaneous
I agree, I like the current more than the original -
A bit can be an object?
-
I think she means this thread that went downhill because of a reply like that.
-
Added
-
Anyone have any ideas for short projects/assignments?
Philip replied to RORJACK's topic in Miscellaneous
I put up a sticky on this, feel free to add ideas: http://www.phpfreaks.com/forums/index.php/topic,359109 -
With the flurry of new posts lately asking for ideas on what to program... it is time for a sticky to show up! Below is a list of common ideas (most of which taken from previous PHPF contest suggestions.) Do you have an idea? Post a reply and if it is good, we'll update the table below Idea Description Genre Source AI Bot Create a bot that you can have a conversation with AI @mattd8752 Unix converter Create a tool that allows users to convert unix timestamps to custom date/time formats. Applications Blog Create a fully functional blog that you can post to, have comments, etc. Applications @fert Planner / Address Book An address book that stores contacts / important dates Applications @The Little Guy CMS Create a CMS (Content Management System) that allows for custom pages, designs, etc. to be created/edited from the backend Applications @steelmanronald06 News System A news system that allows for "breaking news", comments, etc. Applications @coolcoolm Arcade Create an arcade system (to host games) with a high score database Applications @coolcoolm Tutorial site Tutorial Site With Coments Applications @coolcoolm Statistics program Create a program that will allow you to find trends within data Applications Jaysonic Analytics Tool Create an application that is similar to Google Analytics or Piwik Applications @xyph Media gallery Create a media gallery to host images, videos, etc. Applications Jaysonic Member Management System Create a member management system Applications Jaysonic Topsite / Link exchange Create a website that allows for linkbacks, referrals, etc. Applications Jaysonic Calendar Create a calendar that uses PHP / MySQL as a backaned Applications Jaysonic RSS reader Create a program that can grab and parse an RSS feed Applications @Streety Search Engine Create a search engine for a small to mid-sized website Applications @Streety Web Mail Interface Create a web interface to a mailbox (think squirrelmail) Applications @ToonMariner Forum Create a forum that implements many other ideas on this list Applications @NArc0t1c Weather Forecaster Create a weather forecaster system that pulls data from RSS feeds Applications @heckenschutze Web chat interface Create an online chat system, similar to (or using IRC) Applications @phpSensei File tracking system Create a file tracker system to share (legal) files Applications @stuffradio "HackThis" Create a site similar to http://hackthissite.org Applications Graphic Calculator Similar to our first contest, create a graphic calculator Applications [/td] Syntax Highlighter Create a syntax highlighter Development Tools @play_ Code Prettifier Create a tool that parses and prettifies other languages Development Tools @Philip Code Minifier Create a tool that minifies other languages Development Tools @Philip Chess Create the common game, chess Games @Milbea Blackjack Create the common game, blackjack Games @Milbea RPG Similar to our second contest, create a text-based RPG Games Create a sudoku generator Games @Philip Typing Game Create a game to see how fast people can type Games @Philip Crossword Puzzle Generator Create a crossword puzzle generator Games @Philip Word-Find Puzzle Generator Create a word-find (word-search) puzzle generator Games @Philip Mad Libs Generator Create a mad-libs generator Games @Philip Mastermind Create a Mastermind game, with difficulty levels, etc. Games Translator Translates text from one language to another (note: languages can be simple like "leet speak") Text reddit to the rescue with even more ideas!
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=359106.0