Match text between two words with grep on multiple lines
grep'ping files for multiple strings (not necessarily on the same line)
Settings API enable default settings on theme install? I am still learning settings API so please forgive my noob question. I have three fields: a checkbox, colorpicker and text field (they are working), but I would like to do this: when the theme is installed add "checked" state to my checkbox but allow user to "unchecked" it ,and if empty add default color to my colorpicker... I have no idea how to do this so please help me!  My code looks like this now (thanks to @Chip Bennett! ) :  &lt;?php add_action('admin_menu','create_theme_options_page'); function create_theme_options_page(){ add_options_page('Theme Options','Theme Options','administrator',__FILE__,'build_options_page'); }    function build_options_page(){    ?&gt;    &lt;div id="theme-options-wrap"&gt;    &lt;div style="float:left;margin-top:19px;position:absolute;" class="icon32" id="icon-tools"&gt;&lt;br/&gt;&lt;/div&gt;    &lt;h2&gt;My options page&lt;/h2&gt;    &lt;form method="post" action="options.php"&gt;    &lt;?php settings_fields('plugin_options');?&gt;    &lt;?php do_settings_sections(__FILE__); ?&gt;    &lt;p class="submit"&gt;    &lt;input name="Submit" type="submit" class="button-primary" value="&lt;?php esc_attr_e('Save changes');?&gt;"/&gt;    &lt;/p&gt;    &lt;/form&gt;    &lt;/div&gt;    &lt;?php    }       add_action('admin_init','register_and_build_fields');      function register_and_build_fields(){      register_setting('plugin_options','plugin_options','validate_setting');      add_settings_section('main_section','&lt;br/&gt;&lt;br/&gt;Main Settings','section_cb',__FILE__);      add_settings_field('banner_heading','Banner Heading:','banner_heading_setting',__FILE__,'main_section');      add_settings_field('display_sidebar','Display Sidebar:','display_sidebar_setting',__FILE__,'main_section');      add_settings_field('display_colorpicker','Display Colorpicker:','display_colorpicker_setting',__FILE__,'main_section');      }        //Install Iris colorpicker        add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );        function mw_enqueue_color_picker( $hook_suffix ) {        // first check that $hook_suffix is appropriate for your admin page        wp_enqueue_style( 'wp-color-picker' );        wp_enqueue_script( 'my-script-handle', get_template_directory_uri() . '/js/my-script.js', array( 'wp-color-picker' ), false, true );        }           //Colorpicker          //Now how to add a default color on theme install?          function display_colorpicker_setting(){          $options = get_option('plugin_options');          echo"&lt;input type='text' id='color1' name='plugin_options[display_colorpicker]' value='{$options['display_colorpicker']}'/&gt;";          }            //Sidebar checkbox           //Now how to add a default state "checked" on theme install?           function display_sidebar_setting(){           $options = get_option('plugin_options');           echo "&lt;input type='checkbox' name='plugin_options[display_sidebar]' {$options['display_sidebar']} id='display_sidebar' /&gt;";           }              //Banner Heading             function banner_heading_setting(){             $options = get_option('plugin_options');             echo "&lt;input name='plugin_options[banner_heading]' type='text' value='{$options['banner_heading']}'/&gt;";             }               //Validate our settings here               function validate_setting($plugin_options){                  return $plugin_options;               }                 function section_cb(){                } ?&gt; How to disable the skype ads (advertisement)? Allow only alphanumeric characters for a UITextField Is it safe to use oil at its smoking point? Teflon toxicity and second degree burns aside, are there any health issues related to cooking with oil at or past its smoking point? Googling a bit I found one article that went so far as to say you should always "discard oil that's reached its smoke point, along with any food with which it had contact". Other searches showed pages suggesting cancer risks.  I've never given it a thought before and I often use peanut oil at smoking point to brown meat. What is god for religious people? In order to discuss with religious friends about god, I would like to know if there's some accepted objective definitions of God for main religions, even if belief is subjective.   For example, is he "a person who..."? In that case I would address features of a person, as capabilities and limitations. Is he "an entity..."? In that case I would use systems theory.   I feel lost on this, being agnostic from a religious family, where I was taught that God is a mess of things, including a beautiful bearded face, omnipotence and a mix of human defects and metaphysical powers. Why does the find command blow up in /run/? I used the following command to check python versions as given by . It does work except for one error, shown below. Can any one explain why?  $ sudo find / -type f -executable -iname 'python*' -exec file -i '{}' \; \     | awk -F: '/x-executable; charset=binary/ {print $1}' \     | xargs readlink -f | sort -u | xargs -I % sh -c 'echo -n "%: "; % -V'   Error:  find: ‘/run/user/1000/gvfs’: Permission denied I have two raster files that are the same cell size but I cannot get them to align properly. (I want the black to line up with the pink)    When creating the black raster file (from using polyline to raster), I imported the pink raster in the Snap Raster section in the Environments setting. I thought that Snap Raster was supposed to make it line up?  Am I doing something wrong or is it a bug in Arc (I remember reading that this was a problem about two years ago), and if it is a bug is there a work around?  I have also read there is a Raster Shift, but I'm not sure what to enter in the X Coordinate and Y Coordinate. Since I only want the black raster to shift down, I know that the X Coor = 0 and the Y Coor should be negative something, but what are the units?  Thanks. "Have you seen her?" or "Did you see her?" I already knew that we use the present perfect for an action in the past with a result now. Consider the following questions:   "I'm looking for Paula. Have you seen her?" "I'm looking for Paula. Did you see her?"   Is there any difference between these two questions for this specific action (verb)? What is the result of "seeing" action which can't be represented by simple past? GBM vs XGBOOST? Key differences? I am trying to understand the key differences between GBM and XGBOOST. I tried to google it, but could not find any good answers explaining the differences between the two algorithms and why xgboost almost always performs better than GBM. What makes XGBOOST so fast? Error reading from file: Input/output error I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an ON clause in C#.  How do you represent the following in LINQ to SQL:  select DealerContact.* from Dealer  inner join DealerContact on Dealer.DealerID = DealerContact.DealerID Would this hypothetical rule change ever matter? One of  is     104.3f If a player would both win and lose the game simultaneously, he or she loses the game.   . However, it seems to me like it "ought to be" the case that if there are only 2 players and  [A loses] ​ [B loses] ​ [B wins]  would occur simultaneously, then B should win, since  win-and-lose-simultaneously should be better than just-lose.  For that reason, it seems like the     Proposed Alternative : ​ ​ ​ If, simultaneously, all players would lose the game and      some players would win the game, then the players who would not win the game      lose the game, and the game is a draw between the remaining players. ​ Otherwise,      if a player would both win and lose the game simultaneously, he or she loses the game.   would make more sense. ​ However, I can't think of any situations in which that would matter.  Are there any possible situations in which my proposed alternative  would yield a different result from the actual rule? OpenVPN restriction Ive set up an OpenVPN server at my place and handed out a certificate to a client who has an openvpn client at his place.  I need require that he should be able to connect to the vpn server only from one IP address (his current one).  How can I do this? If I close (is delete an option ?) my Gmail account, will somebody be able to register using my email address and read my mails?  I want to close my Gmail account but I don't want anybody to impersonate me with my old address.  Same question with Yahoo! Mail. Do they allow addresses to be re-used? Eclipse error: "The import XXX cannot be resolved" Compact space and Hausdorff space A continuous map from a compact space to a Hausdorff space is closed. Why this is true?  Help me please I want to learn why this is correct. Virtual box ubuntu: Internet not detected on guest(Ubuntu) in host(winXp) Intuition of the meaning of homology groups I was editing my mesh and I wanted to only see a part of my mesh, so I pressed alt+B to only show a selected area. However, I did ctrl+B and created a red rectangle on my screen (I don't know what it does). Does anybody know how to get it off? Schedule to open website I'd like to open a website at regular intervals per day, i.e., the browser should open and automatically navigate towards a pre-set URL.  I looked at options like scheduling to open browser, but I can't figure out how to open it with a default URL. (No I do not want to make this my start page)  Any help is appreciated