Monday, May 4, 2015

Delete all between string From and TO

function delete_all_between($beginning, $end, $string)
    {
        $beginningPos = strpos($string, $beginning);
        $endPos = strpos($string, $end);
        if ($beginningPos === false || $endPos === false)
        {
            return $string;
        }

        $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos);

        return str_replace($textToDelete, '', $string);
    }

CAKEPHP Model validation of Complex Password

CAKEPHP Model validation 

'password' => array(
            'passlength' => array(
                'rule' => array('between', 6,15),
                'message' => 'Password should consist of 6-15 characters.'
            ),
            'passwordComplexity' => array(
                'rule' => array('passwordComplexity'),
                'message' => 'Must contain mixed-case letters, numbers and special characters @#!$&*_'
            ),
        ),

public function passwordComplexity($field = array())
    {
        if (isset($this->data[$this->alias]['password'])){
            $pattern = '/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s).{6,20}$/i';
            $subject = $this->data[$this->alias]['password'];
            if (!preg_match($pattern, $subject)){
                return false;
            }
        }
        return true;
    }


VALIDATION regex 

with 41 Step
/^(?=.*[A-Z])(?=.*[!@#$&*_])(?=.*[0-9])(?=.*[a-z])(?!.*\s).{6,20}$/i

with 38 Step
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s).{6,20}$/i

For More Help : 
http://www.rubular.com/r/pJRmWeFvKk
https://regex101.com/

Wednesday, November 12, 2014

Some Word About "Caption NEMO"


The League of Extraordinary Gentlemen is based on a comic-book miniseries by graphic-novel-writing legend Alan Moore and artist Kevin O’Neill, which chronicles the collective adventures of late-19th-century fictional “superheroes”: Mina Harker of Bram Stoker’s Dracula, Alan Quatermain of H. Rider Haggard’s King Solomon’s Mines, H.G. Wells’s Invisible Man, Robert Louis Stevenson’s dualistic protagonist from The Strange Case of Dr. Jekyll and Mr. Hyde and Jules Verne’s enigmatic Captain Nemo. Notably, the books depict Nemo—for the first time in pop culture—wearing Indian (specifically, Sikh) attire. Although disavowed by Moore and poorly received by critics, the film adaptation does feature the only Nemo played by an Indian actor, Naseeruddin Shah. Reviewers unfamiliar with Verne’s work declared Shah’s casting innovative.


Most adaptations depict Nemo as older than in the novels and more serious—except for the 1974 television cartoon The Undersea Adventures of Captain Nemo, which reimagines him as the heroic, conventionally handsome blond ocean researcher Mark Nemo. This is perhaps no worse a representation than those by celebrated English actors James Mason, Michael Caine and Patrick Stewart, all of whom played Nemo with a British accent—implying kinship with the nation Verne’s captain despises.


 Finally, Caption NEMO is best hero for me -- DHARMENDRA BAKRECHA

Friday, August 22, 2014

jQuery .find() on data from .ajax()

To answer your question specifically, it seems to be working correctly. You said that it returns [object Object], which is what jQuery will return with the find("#result") method. It returns a jQuery element that matches the find query.

Try getting an attribute of that object, like result.attr("id") - it should return result.


In general, this answer depends on whether or not #result is the top level element.

If #result is the top level element,
<!-- #result as top level element -->
<div id="result">
  <span>Text</span>
</div>
find() will not work. Instead, use filter():
var $result = $(response).filter('#result');
If #result is not the top level element,
<!-- #result not as top level element -->
<div>
  <div id="result">
    <span>Text</span>
  </div>
</div>
find() will work:
var $result = $(response).find('#result'); 

Thursday, August 14, 2014

Coding Freelancer – Bill Gates

Gates is the symbol of Microsoft, and you can’t work on a computer without using some piece of software created by him or his employees. The worldwide impact Bill Gates has is unquestionable. Although he was frequently listed as the richest man on Earth, Gates comes from a middle class family in Seattle.

At 13, he managed to sell some of his things at the school’s rummage sale and bought himself computer time on a General Electric monster (no, there weren’t any PCs back then) and a Teletype Model 33 ASR terminal to use the machine. He taught himself BASIC and became able to program the system.

White Hat Hacker

He was so good at it, he and 3 friends managed to hack another such system, the PDP-10 belonging to the Computer Center Corporation (CCC), through the same terminal and obtain free computer time. When the CCC finally noticed, they banned the students from their machine. Gates offered to sell his coding expertise, and find other bugs in the CCC’s system. He would get more computer time as part of the deal.

Bill Gates had officially become a coding freelancer.

He went on coding as a freelancer for Information Sciences, Inc., creating a payroll program in Cobol when he was 16. At 17, he was writing the computer programs for class distribution amongst students.
The same year, he and his close friend Paul Allen, created a business venture called Traf-O-Data, a real-world "traffic analytics" tool, which failed miserably. Undeterred, he and Allen contacted a major company, MITS, who at the time was producing a computer based on the Intel 8080 CPU.

Gates told them they were finalizing a software capable of running on the machine. In reality, there was no software, the duo were flat out lying. Nevertheless, MITS president Ed Roberts agreed to meet them, and so they started writing the code they lied about. The meeting was a success, and Gates came up with the name "Micro-Soft" for their company.

 DHARMENDRA BAGRECHA
Want to update about Bill Gates

Post Original by : Hongkiat

Friday, July 18, 2014

Change GIT commit username in for netbean

Change GIT commit username  in for netbean
// GIT COMMITER is the username and mailid combination
// which is shown in the commit detail who commit.

To change this in window 7
 find .gitconfig file in the <<username>> folder
 in c:\users\username
 and change with following

 [user]
        name = yourname
        email = youremail


-Dharmendra Bagrecha

Nathuram Godse - The Man Who Killed Gandhi

Nathuram Godse - The Man Who Killed Gandhi (The Other Side of The Story)