what’s the easiest way to put space between 2 side-by-side buttons in asp.net

I have 2 buttons side by side, and I would like to have some inbetween them. Following code will have 2 buttons right next to each other. I have tried margin for the div, and just couldn’t get some nice space between the two. <div style=”text-align: center”> <asp:Button ID=”btnSubmit” runat=”server” Text=”Submit” Width=”89px” OnClick=”btnSubmit_Click” /> <asp:Button … Read more

Converting a sentence string to a string array of words in Java

I need my Java program to take a string like: “This is a sample sentence.” and turn it into a string array like: {“this”,”is”,”a”,”sample”,”sentence”} No periods, or punctuation (preferably). By the way, the string input is always one sentence. Is there an easy way to do this that I’m not seeing? Or do we really … Read more

How can I find whitespace in a String?

How can I check to see if a String contains a whitespace character, an empty space or ” “. If possible, please provide a Java example. For example: String = “test word”; Answer For checking if a string contains whitespace use a Matcher and call its find method. Pattern pattern = Pattern.compile(“\\s”); Matcher matcher = … Read more

Auto-convert tab to 4 spaces in TextWrangler?

Is there a preference in Textwrangler to redefine a tab as 4 spaces? In Vim this is set expandtab in the vimrc, but I don’t know how to set it in TW besides clicking “Detab” when I’m done editing the document. Thanks, Kevin Answer Go to “Preferences” -> “Editor Defaults” -> “Auto-expand tabs,” and then … Read more

Is there an algorithm for color mixing that works like mixing real colors?

The common mixing of RGB colors is very different from mixing colors for paintings, it’s mixing of light instead mixing of pigments. For example: Blue (0,0,255) + Yellow (255,255,0) = Grey (128,128,128) (It should be Blue + Yellow = Green) Is there any known algorithm for color mixing that works like mixing real colors? My … Read more

setting tabwidth to 4 in git show / git diff

At work we are several developers and don’t have a code style guide, and some developers indent with tabs, and some others with 4 spaces (luckily noone of the indent with spaces people uses different than 4 spaces). In general this is no (big) problem because in our editors we set tabwidth=4 and all the … Read more