working on it ...

Filters

Explore Public Snippets

Sort by

Found 402k snippets matching: text

    public by WadeCantley  4690262  56  7  0

    iOS - Swift - Add a Done button to a Keyboard Tool Bar

    Adding a done button to the keyboard tool bar and working within the textField delegate to make that happen. In this situation the keyboard is a number pad which doesn't have its own done button.
    //MARK: - Helper Methods
        
    // This is called to remove the first responder for the text field.
    func resign() {
        self.resignFirstResponder()
    }
        
    // This triggers the textFieldDidEndEditing method that has the textField within it.  
    //  This then triggers the resign() method to remove the keyboard.
    //  We use this in the "done" button action.
    func endEditingNow(){
        self.view.endEditing(true)
    }
        
        
    //MARK: - Delegate Methods
        
    // When clicking on the field, use this method.
    func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
    
            
        // Create a button bar for the number pad
        let keyboardDoneButtonView = UIToolbar()
        keyboardDoneButtonView.sizeToFit()
            
        // Setup the buttons to be put in the system.
        let item = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Bordered, target: self, action: Selector("endEditingNow") )
        var toolbarButtons = [item]
            
        //Put the buttons into the ToolBar and display the tool bar
        keyboardDoneButtonView.setItems(toolbarButtons, animated: false)
        textField.inputAccessoryView = keyboardDoneButtonView
    
        return true
    }
        
    // What to do when a user finishes editting
    func textFieldDidEndEditing(textField: UITextField) {
            
        //nothing fancy here, just trigger the resign() method to close the keyboard.
        resign()
    }
        
        
    // Clicking away from the keyboard will remove the keyboard.
    override func touchesBegan(touches: (NSSet!), withEvent event: (UIEvent!)) {
        self.view.endEditing(true)
    }
        
    // called when 'return' key pressed. return NO to ignore.
    // Requires having the text fields using the view controller as the delegate.
    func textFieldShouldReturn(textField: UITextField!) -> Bool {
            
        // Sends the keyboard away when pressing the "done" button
        resign()
        return true
            
    }
    
    

    public by angelangel04  744797  42  6  0

    Puzzle And Dragons Hack Cheats Tool Android iOS

    Download Puzzle And Dragons Hack Cheats Tool Android iOS From Below Link
    Puzzle And Dragons Hack tool cheats Android/iOS:
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    DOWNLOAD -> http://bit.ly/puzzleanddragonshack
    
    
    
    
    Puzzle And Dragons Hack tool is finally out. We got hug number of requests to code a hack tool for this Puzzle And Dragons game. Accepting those requests our team has worked to code a Puzzle And Dragons Hack tool and finally got succeeded in it. This hack tool can add unlimited Coins and Magic Stones in the game. We have been beta testing this Puzzle And Dragons Hack tool for a week and achieved 95% success rate, that means it added Coins and Magic Stones to the game 19 times out of 20. This hack tool is compatible with Both Android and iOS phones. Root or Jailbreak is not required to use this hack.
    Our hack tool has a default Anti-ban script installed that ensures your safety while applying the hack. Proxy support gives an option to hide your ip and therefore making you stay anonymous.If you have any doubts on using this Puzzle And Dragons Hack tool you can refer to the guide that come with the hack tool. Or you can write to us by using Contact US option above or commenting below. Have fun playing this Puzzle And Dragons with unlimited Coins and Magic Stones.
    
     
    
    Puzzle And Dragons Hack tool Features:
    
    Unlimited Coins
    Unlimited Magic Stones
    Unlimited Mana
    No jailbreak needed
    100% safe and undetectable
    Easy to use
    
    Tags:
    puzzle and dragons hack
    puzzle and dragons hack android
    puzzle and dragons hack cydia
    puzzle and dragons hack no survey
    puzzle and dragons hack tool
    puzzle and dragons hack apk
    puzzle and dragons hack forum
    puzzle and dragons hack 6.5.2
    puzzle and dragons hack no download
    puzzle and dragons hack ios no survey
    puzzle and dragons hack android
    puzzle and dragons hack cydia
    puzzle and dragons hack no survey
    puzzle and dragons hack tool
    puzzle and dragons hack apk
    puzzle and dragons hack ios
    puzzle and dragons hack forum
    puzzle and dragons hack 6.5.2
    puzzle and dragons hack no download
    puzzle and dragons hack ios no survey
    puzzle and dragons hack android
    puzzle and dragons hack apk
    puzzle and dragons hack android no survey
    puzzle and dragons hack app
    puzzle and dragons hack android download
    puzzle and dragons hack android apk
    puzzle and dragons attack hack
    puzzle and dragons android hack 2014
    puzzle and dragons damage hack android
    puzzle and dragons hack tool android
    puzzle and dragons bin hack
    puzzle and dragons binary hack
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons ultimate hack ban
    puzzle and dragons hack cydia
    puzzle and dragons hack cheat tool
    puzzle and dragons hack cheat tool 2013
    puzzle and dragons hack cydia 2014
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons combo hack
    puzzle and dragons hack no computer
    puzzle and dragons hacks and cheats
    puzzle and dragons magic stone hack cydia
    can you hack puzzle and dragons
    puzzle and dragons hack download
    puzzle and dragons hack download no survey
    puzzle and dragons hack damage
    puzzle and dragons damage hack android
    puzzle and dragons hack tool download
    puzzle and dragons android hack download
    puzzle and dragons hack no download
    puzzle and dragons iphone hack download
    puzzle and dragons hack free download
    puzzles and dragons ultimate hack download
    puzzle and dragons hack exe
    puzzle and dragons english hack
    puzzle and dragons exp hack
    puzzle and dragons egg hack
    puzzle and dragons hack v1 .6.exe
    puzzle and dragons hack v1.6.exe no survey
    puzzle and dragons hack v2 .0.1.exe
    puzzle and dragons hack tool v3.20 exe
    puzzle and dragons ultimate evolution hack
    puzzle and dragons rare egg machine hack
    puzzle and dragons hack forum
    puzzle and dragons hack for android
    puzzle and dragons hack file
    puzzle and dragons hack free download
    puzzle and dragons hack for iphone
    puzzle and dragons hack for mac
    puzzle and dragons hack free
    puzzle and dragons hack fake
    puzzle and dragons hack for ipad
    puzzle and dragons hack free no survey
    puzzle and dragons gem hack
    puzzle and dragons gameplayer hack
    puzzle and dragons game hack
    puzzle and dragons hp hack
    puzzle and dragons health hack
    puzzle and dragons how to hack
    puzzle and dragons hack cheats tool 2013 by hmg
    how to download puzzle and dragons hack
    how to hack puzzle and dragons with ifile
    how to hack puzzle and dragons android
    how to hack puzzle and dragons with ifunbox
    how to hack puzzle and dragons no survey
    puzzle and dragons ultimate hack puzzle & dragons ultimate hack
    puzzle and dragons hack ios
    puzzle and dragons hack ios no survey
    puzzle and dragons hack ifile
    puzzle and dragons hack iphone no survey
    puzzle and dragons hack ipad
    puzzles and dragons hack ipod
    puzzle and dragons iap hack
    puzzle and dragons iphone hack download
    puzzle and dragons ipa hack
    puzzle and dragons magic stone hack iphone
    puzzle and dragons hack jailbreak
    puzzle and dragons hack japan
    puzzle and dragons hack japanese
    puzzle and dragons hack no jailbreak
    puzzle and dragons instant kill hack
    puzzle and dragons hack link
    puzzle and dragons level hack
    puzzle and dragons hack magic stones
    puzzle and dragons hack mac
    puzzle and dragons hack mod
    puzzle and dragons monster hack
    puzzle and dragons money hack
    puzzle and dragons hack tool mac
    puzzles and dragons hack no survey mac
    puzzles and dragons egg machine hack
    puzzle and dragons rare egg machine hack
    puzzle and dragons magic stone hack no survey
    puzzle and dragons hack no survey
    puzzle and dragons hack no jailbreak
    puzzle and dragons hack no download
    puzzle and dragons hack no survey 2014
    puzzle and dragons hack no computer
    puzzle and dragons hack no pc
    puzzles and dragons hack no survey mac
    puzzles and dragons hack no survey android
    puzzle and dragons hack iphone no survey
    free puzzle and dragons hack no survey
    puzzle and dragons hack online
    puzzle and dragons hack on iphone
    puzzle and dragons orb hack
    how to hack puzzle and dragons on android
    how to hack on puzzle and dragons
    puzzle and dragons hack password
    puzzles and dragons hack program
    puzzle and dragons hack tool password
    puzzle and dragons hack no pc
    puzzle and dragons hack tool v1.03 password
    puzzle and dragons pal points hack
    puzzles and dragons hack tool.zip password
    puzzle and dragons hack no survey no password
    puzzle and dragons hack tool v1.03.zip password
    password for puzzle and dragons hack tool v1.03.txt
    puzzle and dragons hack reddit
    puzzle and dragons hack rar
    puzzle and dragons hack review
    puzzle and dragons hack real
    puzzle and dragons hack root
    puzzle and dragons reroll hack
    puzzle and dragons gem hack
    puzzle and dragons hack tool.rar
    puzzle and dragons android root hack
    puzzles and dragons hack tool v1 .1.rar
    puzzle and dragons hack sinful
    puzzle and dragons hack sinfuliphone
    puzzle and dragons hack stones
    puzzle and dragons hack stamina
    puzzle and dragons stat hack
    puzzle and dragons hack no survey
    puzzle and dragons hack magic stones
    puzzle and dragons hack no survey no password
    puzzles and dragons hack no survey mac
    puzzles and dragons hack no survey android
    puzzle and dragons hack tool
    puzzle and dragons hack tool no survey
    puzzle and dragons hack tool without survey
    puzzle and dragons hack tool password
    puzzle and dragons hack tool download no survey
    puzzle and dragons hack tool v1.03 password
    puzzle and dragons hack tool download
    puzzle and dragons hack tool v1.03
    puzzle and dragons hack tool 2014
    puzzle and dragons hack tool v3.20 exe
    puzzle and dragons ultimate hack
    puzzle and dragons ultimate hack download
    puzzle and dragons ultimate hack zip
    puzzle and dragons ultimate hack rar
    puzzle and dragons ultimate hack ban
    puzzle and dragons ultimate hack dl
    puzzle and dragons ultimate hack v1.2
    puzzle and dragons ultimate hack android
    puzzle and dragons ultimate hack mac
    puzzle and dragons ultimate hack 知恵袋
    puzzle and dragons hack without survey
    puzzle and dragons hack with jailbreak
    puzzle and dragons working hack
    does puzzle and dragons hack work
    puzzle and dragons hack tool without survey
    do puzzle and dragons hacks work
    puzzle and dragons magic stone hack without survey
    how to hack puzzle and dragons with ifile
    how to hack puzzle and dragons with ifunbox
    world hack puzzle and dragons
    can you hack puzzle and dragons
    puzzles and dragons hack tool v1 .1.rar
    puzzles and dragons hack tool 1.2
    puzzles and dragons hack tool v1 .1
    puzzle and dragons ultimate hack 1.2
    puzzle & dragons hack 1.2
    puzzle and dragons cheats
    puzzle and dragons cheats android
    puzzle and dragons cheats ipad
    puzzle and dragons cheats cydia
    puzzle and dragons cheats 2014
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzle and dragons cheats ios
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats mac
    puzzle and dragons cheats android
    puzzle and dragons cheats ipad
    puzzle and dragons cheats cydia
    puzzle and dragons cheats 2014
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzle and dragons cheats ios
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats mac
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats android
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats apk
    puzzle and dragons cheat app
    puzzle and dragons cheat android download
    puzzle and dragons cheats and hacks
    puzzle and dragons hack tool and cheats
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats cydia
    puzzle and dragons cheat codes
    puzzle and dragons combo cheat
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheats download
    puzzle and dragons damage cheat
    puzzle and dragons cheat free download
    puzzle and dragons cheat tool download
    puzzle and dragons cheat android download
    puzzle dragons cheat hack download
    puzzle and dragons cheat engine
    puzzle and dragons cheat engine android
    puzzle and dragons english cheats
    puzzle and dragons rare egg glitch
    puzzle and dragons cheats for android
    puzzle and dragons cheats for iphone
    puzzle and dragons cheats free
    puzzle and dragons cheats for ipod
    puzzle and dragons cheats forum
    puzzle and dragons cheat free download
    puzzle and dragons cheat free no survey
    puzzle and dragons gem cheat
    puzzles and dragons game cheats
    puzzles and dragons gem glitch
    puzzle and dragons hack cheats tool 2013 by hmg
    puzzle and dragons hack cheat tool
    puzzle and dragons hack cheat tool 2013
    puzzle and dragons cheats and hacks
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzles & dragons cheat engine hack
    how to download puzzle and dragons cheats
    puzzle dragons cheat hack download
    puzzle and dragons cheats iphone
    puzzle and dragons cheats ipad
    puzzle and dragons cheats ipod
    puzzle and dragons cheats ifile
    puzzle and dragons cheats iphone no survey
    puzzles and dragons cheats jailbreak
    puzzles and dragons cheats no jailbreak
    puzzle and dragons japan cheat
    puzzle and dragons cheats mac
    puzzle and dragons cheat magic stone
    puzzles and dragons money cheat
    puzzles and dragons rare egg machine cheat
    puzzle and dragons cheats no pc
    puzzle and dragons cheats no survey
    puzzles and dragons cheats no jailbreak
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats iphone no survey
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat free no survey
    puzzle and dragons orb cheat
    cheats on puzzle and dragons
    puzzle and dragons cheats password
    puzzle and dragons cheats no pc
    puzzle and dragons cheat tool password
    puzzles and dragons cheats without pc
    puzzle and dragons pal points cheat
    puzzles and dragons cheats review
    puzzle and dragons cheats tool 2013.rar
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons stamina cheat
    puzzle and dragons screenshot cheat
    puzzle and dragons cheats no survey
    puzzle and dragons cheats without survey
    puzzle and dragons stamina glitch
    puzzle and dragons cheat magic stone
    puzzle and dragons cheats android no survey
    puzzle and dragons cheats iphone no survey
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat free no survey
    puzzle and dragons cheats tool v1.1
    puzzle and dragons cheats tool 2013 by hmg
    puzzle and dragons cheats tool 2013 by hmg.rar
    puzzle and dragons cheats tool
    puzzle and dragons cheats tool 2013
    puzzle and dragons cheats tool zip
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheats tool 2013.rar
    puzzle and dragons cheat tool no survey
    puzzle and dragons cheat tool password
    puzzle and dragons cheats tool unlock code. text
    puzzle and dragons cheat v7.0.3
    puzzle and dragons cheats without survey
    puzzles and dragons cheats without pc
    
    

    public by Alessio Felicioni  394397  1  4  1

    gammu huawei fix

    gammu huawei fix: gistfile1.txt
    ReceiveFrequency = 60
    StatusFrequency = 60
    CommTimeout = 60
    SendTimeout = 60
    LoopSleep = 10
    CheckSecurity = 0
    
    

    public by DavidEGrayson  351146  2  3  0

    Trying to install the cryptography pip in MSYS2 with mingw-w64-x86_64-python2-pip.

    Trying to install the cryptography pip in MSYS2 with mingw-w64-x86_64-python2-pip.: output.txt
    $ pip install -U cryptography
    Collecting cryptography
      Downloading cryptography-1.0.2.tar.gz (332kB)
    Collecting idna>=2.0 (from cryptography)
      Downloading idna-2.0-py2.py3-none-any.whl (61kB)
    Collecting pyasn1>=0.1.8 (from cryptography)
      Downloading pyasn1-0.1.9-py2.py3-none-any.whl
    Collecting six>=1.4.1 (from cryptography)
      Downloading six-1.10.0-py2.py3-none-any.whl
    Collecting setuptools (from cryptography)
      Downloading setuptools-18.4-py2.py3-none-any.whl (462kB)
    Collecting enum34 (from cryptography)
      Downloading enum34-1.0.4.tar.gz
    Collecting ipaddress (from cryptography)
      Downloading ipaddress-1.0.14-py27-none-any.whl
    Collecting cffi>=1.1.0 (from cryptography)
      Downloading cffi-1.2.1.tar.gz (335kB)
    Collecting pycparser (from cffi>=1.1.0->cryptography)
      Downloading pycparser-2.14.tar.gz (223kB)
    Installing collected packages: idna, pyasn1, six, setuptools, enum34, ipaddress, pycparser, cffi, cryptography
      Found existing installation: setuptools 18.3.2
        Uninstalling setuptools-18.3.2:
          Successfully uninstalled setuptools-18.3.2
      Running setup.py install for enum34
        Complete output from command D:/msys64/mingw64/bin/python2.exe -c "import setuptools, tokenize;__file__='c:/users/david/appdata/local/temp/pip-build-ojokdu/enum34/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\david\appdata\local\temp/pip-egkxlc-record/install-record.txt --single-version-externally-managed --compile:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "D:/msys64/mingw64/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
            from setuptools.extension import Extension
          File "D:/msys64/mingw64/lib/python2.7/site-packages/setuptools/extension.py", line 9, in <module>
            from . import msvc9_support
          File "D:/msys64/mingw64/lib/python2.7/site-packages/setuptools/msvc9_support.py", line 2, in <module>
            import distutils.msvc9compiler
          File "D:/msys64/mingw64/lib/python2.7/distutils/msvc9compiler.py", line 306, in <module>
            raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
        distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
    
        ----------------------------------------
    Command "D:/msys64/mingw64/bin/python2.exe -c "import setuptools, tokenize;__file__='c:/users/david/appdata/local/temp/pip-build-ojokdu/enum34/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\david\appdata\local\temp/pip-egkxlc-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:/users/david/appdata/local/temp/pip-build-ojokdu/enum34
    
    
    

    public by lbottaro  303309  31  7  0

    How to read and parse a txt file in python

    This code shows how to read a txt file and parse the data
    import os
    import sys
    
    myfile = open('/some/path/to/file.txt', "r")
    # EXAMPLE OF FILE FORMAT:
    # abc 123 234 456 678
    # def 122223 2333334 454446 611178
    # ghi 144423 211134 44456 61114478
    
    for line in myfile.readlines():
        name= ''
        numList = list()
    
        print line
        try:
            name = line.split()[0] # it will get 'abc'/'def'/'ghi'
            numList = line.split()[1:] # it will get all other stuff inline...
        except:
            print "Invalid file format"
            myfile.close()
            sys.exit(1)
        
        if not numList:
            print("Invalid numList format! name= " + str(name))
            myfile.close()
            sys.exit(1)
    
        print 'name='+str(name)
        print 'numList='+str(numList)
    
    myfile.close()

    public by cghersi  369761  4  6  3

    How to prettify a number with thousands or millions

    Prepares a pretty version of the given number, with the ability to match the right plural/singular form for English text
    public static string PaintNumber(int number, string followingText = "", bool numberInBold = false)
    {
      string content = String.Format("{0:N0}", number);
      if (number >= 10000)
      {
        double numberInThousands = number / 1000.0;
        if (numberInThousands < 100)
          content = String.Format("{0:N0}k", numberInThousands);
        else
          content = String.Format("{0:0.#}M", numberInThousands / 1000.0);
      }
      if (number >= 1000000)
      {
        double numberInMillions = number / 1000000.0;
        if (numberInMillions < 100)
          content = String.Format("{0:N0}M", numberInMillions);
        else
          content = String.Format("{0:0.#}B", numberInMillions / 1000.0);
      }
    
      if (numberInBold)
        content = "<b>" + content + "</b>";
    
      if (!string.IsNullOrEmpty(followingText))
        content += " " + followingText + (number != 1 ? "s" : "");
    
      return content;
    }
    

    public by JonahM  298465  2  6  4

    Responsive Type

    No Javascript required for responsive text! Pure CSS3
    /* Code Reference & Examples: http://mole.tk/1ymmXAv */
    
    
    /* 
    
    What Does vw and vm mean? 
        1vw = 1% of viewport width 
        1vh = 1% of viewport height 
        1vmin = 1vw or 1vh, whichever is smaller 
        1vmax = 1vw or 1vh, whichever is larger
    */
    
    body {
    	background-color:   #ff5442;
      font-family:        ‘Lato’, Arial, sans-serif; 
      margin:             2vw;
      
    }
    
    h1 {
    	color:              #fff;
    	font-size:          6vw;
    	font-weight:        900;
    	text-transform:     uppercase;
      line-height:        .3vw;
    	}
    
    h2 {
      color:              #fff;
      font-size:          4vw;
    }
    
    p {
      color:              #fff;
      font-size:          1em;
    }

    public by cghersi  283406  2  6  1

    Remove HTML tags from text

    Removes the given tag (and all its content) from the specified text.
    static public string RemoveHtmlTag(string pageString, string tagName)
    {
      string output = pageString;
      int exprIni = 0;
      int firstChar = 0;
      int lastChar = 0;
    
      // find html element
      exprIni = output.IndexOf("<" + tagName, 0, output.Length,
                                      StringComparison.InvariantCultureIgnoreCase);
      while (exprIni >= 0)
      {
        // extract the html
        firstChar = exprIni;
    
        // find <tag ... />
        lastChar = output.IndexOf("/>", (firstChar + 1)) + 1;
        int nextCloseTag = output.IndexOf('>', (firstChar + 1));
    
        // closed with </tag> marker..
        if ((lastChar <= 0) || (nextCloseTag < lastChar))
        {
          // find </tag>
          lastChar = output.IndexOf("</" + tagName, (firstChar + 1), (output.Length - firstChar - 1),
                                                          StringComparison.InvariantCultureIgnoreCase);
          lastChar = output.IndexOf('>', (lastChar + 1));
        }
    
        if ((firstChar < 0) || (lastChar <= 0) || (firstChar == lastChar))
          return output.Substring(0, firstChar);
        else
        {
          output = String.Format("{0} {1}",
                      output.Substring(0, firstChar).Trim(),
                      output.Substring((lastChar + 1), (output.Length - lastChar - 1)).Trim());
        }
        exprIni = output.IndexOf("<" + tagName, 0, output.Length,
                                    StringComparison.InvariantCultureIgnoreCase);
      }
    
      return output;
    }
    

    public by Ernest Murray  287796  19  3  0

    Put the censored text in the sentence.

    Put the censored text in the sentence.: censor.py
    #!/usr/bin/python
    # encoding: utf-8
    """
    Created: 01/07/15, 13:11
    Description:
    
    Write a function called censor that takes two strings, text and word, as input.
    It should return the text with the word you chose replaced with asterisks.
    
    For example: censor("this hack is wack hack", "hack") should return "this **** is wack ****"
    Assume your input strings won't contain punctuation or upper case letters.
    The number of asterisks you put should correspond to the number of letters in the censored word.
    
    You can use string.split() and  " ".join(list) to help you here.
    
    Remember: "*" * 4 equals "****"
    
    After splitting the string with string.split(), you can loop through the indices in the list and replace the words
    you are looking for with their asterisk equivalent. Join the list at the end to get your sentence!
    """
    
    def censor(text, word):
        empty_text = text.split()
        for item in empty_text:
            if item == word:
                new_word = len(word) * "*"
            for item2 in empty_text:
                if item2 == word:
                    new_sentence =
            # print new_word
        return new_word
    
    a = censor("here is a hacker", "hacker")
    print a
    
    
    

    public by JackLatanis  297956  7  6  -1

    Sending email via AuthMailer service using PHP

    //this code sends emails via AuthMailer service (www.authmailer.com)
    
    <?
    
    //install the Mail, Net_Socket and Net_SMTP with PEAR
    require_once "Mail.php";
     
    //mail headers and body
    $from = "Me";
    $to = "You";
    $subject = "Subject";
    $body = "Lorem Ipsum...";
    
    //server configuration, edit with your account details 
    $host = "authmailer.com";
    $port = "587";
    $user = "user";
    $pass = "pass";
     
    $headers = array('From' => $from,
    	'To' => $to,
    	'Subject' => $subject);
    
    $smtp = Mail::factory('smtp',
    	array('host' => $host,
    	'auth' => true,
    	'username' => $user,
    	'password' => $pass));
    
    //sending email
    $mail = $smtp->send($to, $headers, $body);
     
    if (PEAR::isError($mail)) 
    {
      //something went wrong
    	echo($mail->getMessage());
    } 
    else 
    {
      //OK
    	echo("Message was sent!");
    }
    
    ?>
    • Public Snippets
    • Channels Snippets