Jump to content

joe92

Members
  • Posts

    304
  • Joined

  • Last visited

Posts posted by joe92

  1. You forgot to end the code tag after the encapsulation section, but aside from that the examples definitely help, cheers

     

    I read two pieces of yours. First I read your review about Google+, as I didn't notice you provided a link to an opinion piece ::). It's a few month old but again, I quite liked it... apart from the fact you posted it a tad early. If you'd waited till you'd had the chance to test the Hangouts yourself you would have been able to review all aspects of them, like video lag for instance, as well as just the concept.

     

    Next I read the article you posted about spotify. It was good though I don't think it has been properly proof read, there were some grammatical errors and a few spelling mistakes too (the paragraph beginning 'Spokesman' mainly). There was also an obvious argument you missed out, that being that users of Spotify are physically bound to listen to music at their computers unless they purchase the music from a store such as iTunes or walk into a shop to buy the music. Hence, the money still gets spent as the digital age includes the mobile age; everyone wants to listen to music on the go on their mp3 players (on trains, planes, even walking) so will still need to buy tracks to fulfill this need.

     

    Aside from the missing argument and the grammatical errors, it was a good read and you structured it well. Keeping both sides of the argument seperate and avoiding unnecessary tangents is something any reader appreciates, especially me :D Nice work

  2. It works for me. I just ran the following code:

    <?php
    
    $testing = '20-11-2011';
    
    echo $testing.'<br/><br/>';
    
    if(!preg_match('/^[\d]{2}-[\d]{2}-[\d]{4}$/', $testing)){
    echo 'no match';
    }
    else{
    echo 'match';
    }
    ?>

     

    And it displayed:

    20-11-2011
    
    match

     

    Indicating that the regex works fine. The problem must lie elsewhere.

  3. How is the date getting posted to the validation script? Can you give an example of how it looks just before it hits the preg_match.. i.e. after any html_entities etc. It may be a case of the anchors around your pattern messing things up for you.

     

    If it helps, I have this uk date validation working on my site:

    preg_match("~[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,4}~", $startDate)

  4. Otherwise, someone will enter April 12, 2011 as 12-04-2011.

    ...that's the desired format ;)

     

    Place the digit character set in character classes if you are looking for repetition;

    <?php
            if(!preg_match('/^[\d]{2}-[\d]{2}-[\d]{4}$/', $expiryDate)) {
    	$issue = "9";
    	return $issue;
    }
            if(!preg_match('/^[\d]{2}-[\d]{2}-[\d]{4}$/', $startDate)) {
    	$issue = "9";
    	return $issue;
    }
    ?>

     

    Also, thats two if's returning the same result that could be executed on the same line;

    <?php
            if(!preg_match('/^[\d]{2}-[\d]{2}-[\d]{4}$/', $expiryDate) or !preg_match('/^[\d]{2}-[\d]{2}-[\d]{4}$/', $startDate)) {
    	$issue = "9";
    	return $issue;
    }
    ?>

     

    Furthermore, you might want to allow for people entering the date as dd/mm/yyyy or dd.mm.yyyy so you might want to include another character set for the separation sections instead of just a dash, e.g. [./\-].

     

    Hope this helps,

    Joe

  5. First note, finding the tutorials. It took me a good while to locate the tutorials. I had no idea that 'Category' was referring to the navigation of the site :shrug:

     

    I did find them though and I read through this one as it is a topic I am currently getting my head round properly:

    http://blackscorner.me/2011/11/13/doing-object-oriented-programming-right/

     

    It was very easy to read, for me, and I enjoyed the many comparisons to real life things as it is my preferred learning style. I found it good that there were headings to structure the tutorial too. My only gripe is that there were no examples. I was hoping that there would be some examples, no matter how basic, to show me what you were talking about.

     

    Other than that, good work and I like your writing style.

  6. The 'Read More' link and the 'View this Bounty' link are far too close to each other and do exactly the same thing. There should be a line break between them.

     

    Furthermore, the read more button should not direct the user away from the page and should instead just show the rest of the description like I thought it would. The 'View this Bounty' already takes them away from the page.

     

    When you view the bounty there is a column to the left that has nothing in it. You should make the bounty page stretch out to cover that empty space, or keep the featured bounties in it.

     

    The nav bar at the top could do with a css hover class attached to it so it shows to the user that they are hovering.

     

    When you search for a bounty using the 'Find Bounties' bar, as the ajax is loading up your loading indicater spans across the screen and out beyond the right hand side of it. That could do with being made neater.

     

    Other than that, its a nice clean site, nice work :)

  7. I have done. Take the bookmark function I mentioned. The only one I found that seems to work ok (still has problems) wants a licence fee of $25 per website to use and it's not very dynamic :(

     

    After exhausting my researching and testing, I wondered about forced key submissions as that would solve all my problems haha. Thanks for letting me know.

  8. Using JavaScript, is there a way to force the submission of a key combination?

     

    Reason I ask is because there are a few functions I would like to be able to offer but can't currently find a good/working way to do them, or they have really bad cross browser compatibility issues. E.g. A button to copy the current selection to the clipboard by forcing Ctrl + C, another would be an undo button by forcing Ctrl + Z, and a button to bookmark the current page by forcing Ctrl + D.

     

    Thanks for any help,

    Joe

  9. I just tested the alteration of the code that I provided earlier and it does exactly what you want... I enter postcode 'AB12 3CD' and it outputs, 'Postcode1 AB12, <br/> Postcode2 3CD'. I enter postcode 'AB1 3CD' and it outputs 'Postcode1 AB1, <br/> Postcode2 3CD'. FYI, you could make those 5 echo's one echo using the '.' operator to join the sections together:

     

    echo "Postcode1 ".substr($postcode, 0, 3)."<br>Postcode2 ".substr($postcode, 3);

  10. Its too square. Look up how to apply rounded corners in css, they make a whole world of difference.

     

    You should add some padding to the content divs as well, it's hard to read text that sits hard on the edge of a box.

     

    Your header and footer should also be separated from the main body to indicate navigation, not content.

     

    I don't have time to look through all your pages but theres some starting points :)

  11. I'm not entirely sure what you are trying to achieve, if you could elaborate on that please. But, good practice is change your function to return the result rather than echo, then call it in a variable afterwards;

     

    $postcode=$_GET['postcode'];
    
    function countchar ($string) { 
        
    $resultpostcode = strlen ($string)  -   substr_count($string, ' '); 
    return $resultpostcode;  
    } 
    
    $resultpostcode = countchar ($postcode);
    
    
    if ( $resultpostcode == 6 ) {
    
    	echo "Postcode1 ";
    	echo substr($postcode, 0, 3);
    	echo "<br>";
    	echo "Postcode2 ";
    	echo substr($postcode, 3);
    
    } elseif( $resultpostcode == 7 ){
    
    	echo "Postcode1 ";
    	echo substr($postcode, 0, 4);
    	echo "<br>";
    	echo "Postcode2 ";
    	echo substr($postcode, 4);
    
    }else {
    echo "error";
    }
    
    

  12. You might want to consider placing a 'zero or more' quantifier on the vowels rather than a 'one or more' quantifier on everything. As it is usually the vowel which makes the word sound derogatory. This will censor most variations of the word (without the substitution of letters for symbols);

     

    s+h+i+t(ting|er|e|ing|s|)

    becomes

    shi*t(ting|er|e|ing|s|)

     

    That will censor shit, shiiiiiiit and sht. It should speed up your regex too as it has less quantifiers to use.

     

    But you will always have problems with censorship. Take fuck for example, rearrange the u to become fcuk and you've got a brand name which you cannot censor. You might want to try arguing to your client that he should not waste his time worrying about censorship, and should instead just cover his ass with a simple clause in his terms and conditions that words will not be censored and instead users who repeatedly swear will be 'silenced' or banned.

  13. The ironic thing is though, if your database has been compromised I think the least of your worries is the hacker getting a hold of your users passwords ;)

    Having your own database breached is generally a bad thing, but if your database security is so poor that you end up revealing your user's plaintext passwords (which they might use for online banking or email) then you have a whole other problem.

     

    Yup, I was merely making a joke. I would never actually advise any one to not salt passwords :) It's very basic security and it's not hard to implement.

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