working on it ...

Filters

Explore Public Snippets

Sort by

Found 35 snippets matching: separators

    public by cghersi modified Jan 31, 2014  474463  4  7  0

    C#: Parse a comma separated string into a collection of numeric items

    This method can be used with any separator you need, just setting the 'separator' input
    public static List<long> ParseIntoListOfLongs(string content, char separator = ',')
    {
        List<long> ids = new List<long>();
    
        if (string.IsNullOrEmpty(content))
            return ids;
    
        string[] strIds = content.Split(separator);
        foreach (string str in strIds)
        {
            long id = -1;
            if (long.TryParse(str, out id))
            {
                if (id > 0)
                    ids.Add(id);
            }
        }
    
        return ids;
    }
    

    public by Geometry modified Jul 31, 2016  1089  0  4  0

    Split: Splits the specified string using whitespace(input) as separators.

    Splits the specified string using whitespace(input) as separators. The input string. List of input.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using HelixToolkit;
    using System.IO;
    using HelixToolkit.Wpf;
    using System.Windows.Media.Media3D;
    using System.Globalization;
    using System.Windows.Threading;
    using System.Windows.Media;
    
    /// <summary>
    /// Splits the specified string using whitespace(input) as separators.
    /// </summary>
    /// <param name="input">
    /// The input string.
    /// </param>
    /// <returns>
    /// List of input.
    /// </returns>
    private static IList<double> Split(string input)
    {
        input = input.Trim();
        var fields = input.SplitOnWhitespace();
        var result = new double[fields.Length];
        for (int i = 0; i < fields.Length; i++)
        {
            result[i] = DoubleParse(fields[i]);
        }
    
        return result;
    }

    external by htzfun modified Nov 4, 2014  148  0  2  0

    iOS 8. Separators for table view - how to make a line separator

    iOS 8. Separators for table view - how to make a line separator: separatorsAddition
    - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
        // This code makes separators in ios 8.x without left insets
        if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
            [cell setSeparatorInset:UIEdgeInsetsZero];
        }
        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
            [cell setLayoutMargins:UIEdgeInsetsZero];
        }
    }
        
    - (void)viewDidLayoutSubviews {
        // This code makes separators in ios 8.x without left insets
        if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.tableView setSeparatorInset:UIEdgeInsetsZero];
        }
        if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
            [self.tableView setLayoutMargins:UIEdgeInsetsZero];
        }
    }
    
    

    external by buguibu modified Oct 8, 2014  80  0  1  0

    Table cell separators no left margin iOS8

    Table cell separators no left margin iOS8: cell_no_left_margin_ios8
    -(void)viewDidLayoutSubviews
    {
        if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.tableView setSeparatorInset:UIEdgeInsetsZero];
        }
        
        if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
            [self.tableView setLayoutMargins:UIEdgeInsetsZero];
        }
    }
    
    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
            [cell setSeparatorInset:UIEdgeInsetsZero];
        }
        
        if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
            [cell setLayoutMargins:UIEdgeInsetsZero];
        }
    }
    
    

    external by Andrew Hills modified Sep 16, 2014  80  0  1  0

    Function to convert (long long) integers to strings with thousand comma separators

    Function to convert (long long) integers to strings with thousand comma separators: PrettyNumbers.c
    C
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <math.h>
    
    char *PrettyNumbers(long long int inputBytes)
    {
        double tempVar = log10((double) inputBytes);
        int noElements = (int) floor(tempVar / 3.0), n, remn = (int) (tempVar + 1) % 3;
        char *output, tempString[4];
        
        if (remn == 0)
            remn = 3;
        
        output = malloc(sizeof(char) * ((int) ceil(tempVar) + 1 + noElements));
        memset(output, 0, (int) floor(tempVar) + 2);
        
        for (n = noElements - 1; n >= 0; n--)
        {
            sprintf(tempString, ",%03i", (long long int) floor((double) inputBytes / pow(1000.0, n)) % 1000);
            memcpy(&output[remn + 4 * (noElements - n - 1)], &tempString[0], 4);
        }
        sprintf(tempString, "%3i", (int) floor((double) inputBytes / pow(1000.0, noElements)) % 1000);
        memcpy(&output[0], &tempString[3 - remn], remn);
        return output;
    }
    
    

    external by Jeffrey Starke modified Sep 22, 2016  68  1  1  0

    A robust TextWatcher that groups input into the specified group sizes, with separators between them.

    A robust TextWatcher that groups input into the specified group sizes, with separators between them.: android-GroupedInputFormatWatcher.java
    /**
     * Formats the watched EditText to groups of characters, with separators between them.
     */
    public class GroupedInputFormatWatcher implements TextWatcher {
        private char separator;
        private String separatorString;
        private int groupSize;
    
        /**
         * Breakdown of this regex:
         * ^             - Start of the string
         * (\\d{4}\\s)*  - A group of four digits, followed by a whitespace, e.g. "1234 ". Zero or more
         * times.
         * \\d{0,4}      - Up to four (optional) digits.
         * (?<!\\s)$     - End of the string, but NOT with a whitespace just before it.
         * <p>
         * Example of matching strings:
         * - "2304 52"
         * - "2304"
         * - ""
         */
        private final String regex = "^(\\d{4}\\s)*\\d{0,4}(?<!\\s)$";
        private boolean isUpdating = false;
        private final EditText editText;
    
        public GroupedInputFormatWatcher(@NonNull EditText editText) {
            this(editText, 4, ' ');
        }
    
        public GroupedInputFormatWatcher(@NonNull EditText editText, int groupSize, char separator) {
            this.editText = editText;
            this.groupSize = groupSize;
            this.separator = separator;
            this.separatorString = String.valueOf(separator);
        }
    
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
    
        }
    
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    
        }
    
        @Override
        public void afterTextChanged(Editable s) {
            String originalString = s.toString();
    
            // Check if we are already updating, to avoid infinite loop.
            // Also check if the string is already in a valid format.
            if (isUpdating || originalString.matches(regex)) {
                return;
            }
    
            // Set flag to indicate that we are updating the Editable.
            isUpdating = true;
    
            // First all whitespaces must be removed. Find the index of all whitespace.
            LinkedList<Integer> spaceIndices = new LinkedList<Integer>();
            for (int index = originalString.indexOf(separator); index >= 0; index = originalString.indexOf(separator, index + 1)) {
                spaceIndices.offerLast(index);
            }
    
            // Delete the whitespace, starting from the end of the string and working towards the beginning.
            Integer spaceIndex = null;
            while (!spaceIndices.isEmpty()) {
                spaceIndex = spaceIndices.removeLast();
                s.delete(spaceIndex, spaceIndex + 1);
            }
    
            // Loop through the string again and add whitespaces in the correct positions
            for (int i = 0; ((i + 1) * groupSize + i) < s.length(); i++) {
                s.insert((i + 1) * groupSize + i, separatorString);
            }
    
            // Finally check that the cursor is not placed before a whitespace.
            // This will happen if, for example, the user deleted the digit '5' in
            // the string: "1234 567".
            // If it is, move it back one step; otherwise it will be impossible to delete
            // further numbers.
            int cursorPos = editText.getSelectionStart();
            if (cursorPos > 0 && s.charAt(cursorPos - 1) == separator) {
                editText.setSelection(cursorPos - 1);
            }
    
            isUpdating = false;
        }
    }
    
    

    external by Thomas Guyot-Sionnest modified Feb 26, 2015  68  0  1  0

    Convert CSV to TSV, properly handling intra-field commas, newlines and quoted double-quotes, as per rfc4180 section 2. Also convert TSV separators to C-style escapes.

    Convert CSV to TSV, properly handling intra-field commas, newlines and quoted double-quotes, as per rfc4180 section 2. Also convert TSV separators to C-style escapes.: csv2tsv.py
    #!/usr/bin/env python
    #
    # Convert CSV to TSV, properly handling intra-field commas, newlines and
    # quoted double-quotes, as per rfc4180 section 2. Also convert TSV separators
    # to C-style escapes.
    #
     
    from __future__ import print_function
    import sys, csv
     
    with sys.stdin as f:
        reader = csv.reader(f, strict=True)
        for row in reader:
            for col in row:
                # Replace TSV delimiters with C-style escapes.
                col = col.replace('\n', '\\n')
                col = col.replace('\t', '\\t')
                print(col, end='\t')
            print()
    
    
    

    external by Zen Linux modified Feb 28, 2016  2584  8  3  0

    Xmonad.hs works with lemonbar( xft+slant ) version from https://github.com/neeasade/bar/tree/slant-xft. The setup below works great but if I try to use "powerline symbols" like this "" # Powerline separators it wont work.

    Xmonad.hs works with lemonbar( xft+slant ) version from https://github.com/neeasade/bar/tree/slant-xft. The setup below works great but if I try to use "powerline symbols" like this "" # Powerline separators it wont work.: xmonad.hs
    import XMonad hiding ( (|||) )
    import Data.List                   -- clickable workspaces
    import Graphics.X11.ExtraTypes.XF86
    import System.IO (hPutStrLn)
    --import XMonad.Actions.CycleWS      -- nextWS, prevWS
    import XMonad.Actions.FloatKeys
    import XMonad.Actions.TagWindows
    import XMonad.Actions.WindowGo
    import XMonad.Actions.WithAll
    import XMonad.Hooks.DynamicLog hiding (xmobar, xmobarPP, xmobarColor, sjanssenPP, byorgeyPP)
    import XMonad.Hooks.EwmhDesktops hiding (fullscreenEventHook)
    import XMonad.Hooks.ManageDocks
    import XMonad.Hooks.ManageHelpers
    import XMonad.Hooks.Minimize       -- for minimizeEventHook
    import XMonad.Hooks.SetWMName
    import XMonad.Hooks.UrgencyHook
    import XMonad.Hooks.XPropManage
    import XMonad.Layout.BoringWindows
    import XMonad.Layout.Fullscreen 
    import XMonad.Layout.Gaps
    import XMonad.Layout.Grid
    import XMonad.Layout.LayoutCombinators
    import XMonad.Layout.Maximize (maximize, maximizeRestore)
    import XMonad.Layout.Minimize (minimize, minimizeWindow, MinimizeMsg(RestoreNextMinimizedWin))
    import XMonad.Layout.Named
    import XMonad.Layout.NoBorders
    -- import XMonad.Layout.PerWorkspace
    import XMonad.Layout.ResizableTile
    import XMonad.Layout.SimplestFloat
    import XMonad.Layout.Spacing
    import XMonad.Layout.Tabbed 
    import XMonad.Layout.WindowNavigation
    import XMonad.ManageHook
    import XMonad.Prompt
    import XMonad.Prompt.Input
    import XMonad.Prompt.RunOrRaise
    import XMonad.Prompt.Window
    import XMonad.Util.Dmenu
    import XMonad.Util.EZConfig
    import XMonad.Util.Font(Align(AlignCenter))
    import XMonad.Util.Loggers
    import XMonad.Util.NamedScratchpad
    import XMonad.Util.Run(spawnPipe,safeSpawn)
    import qualified XMonad.Actions.FlexibleResize as FlexibleResize
    import qualified XMonad.StackSet as W
    
    -- namedscratchpad 
    -- Most important feature of Xmonad for me.
    
    scratchpads = [
      NS "mHtop" "xterm -e htop" (title =? "htop") defaultFloating,
      NS "notes" "gvim --role notes ~/notes.txt" (role =? "notes") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)),
      NS "mEmacs" "emacs" (className =? "Emacs" ) nonFloating,
      NS "mTerminator" "terminator" (className =? ".terminator-wrapped" ) nonFloating
      ] where role = stringProperty "WM_WINDOW_ROLE"
    
    -- Theme for tabs
    myTabTheme = defaultTheme {
      activeColor             = "#2199ee"
      , inactiveColor         = "grey"
      , urgentColor           = "red"
      , activeBorderColor     = "#2199ee"
      , inactiveBorderColor   = "white"
      , activeTextColor       = "black"
      , inactiveTextColor     = "black"
      , fontName              = "xft:Century Gothic-10"
      }
    
    
    -- Theme for Prompt
    myPromptTheme :: XPConfig
    myPromptTheme = defaultXPConfig { 
      font = "xft:Inconsolata-11"
      , height = 30
      , position = Bottom
      , promptBorderWidth = 0
      , promptKeymap = emacsLikeXPKeymap
      -- more fuzzy searching, match anywhere
      , searchPredicate = isInfixOf
      -- always highlight a result, so I can hit enter any time
      , alwaysHighlight = True
      }
    -- shell prompt theme
    mySP = defaultXPConfig {
      font = "xft:Inconsolata-11:pixelsize=14"
      --font = "xft:DejaVu Sans Mono:pixelsize=14"
      , bgColor           = "#0c1021"
      , fgColor           = "#f8f8f8"
      , fgHLight          = "#f8f8f8"
      , bgHLight          = "steelblue3"
      , borderColor       = "DarkOrange"
      , promptBorderWidth = 1
      , position          = Top
      , height            = 22
      , defaultText       = []
      }
    
    myAutoSP = mySP { autoComplete       = Just 1000 }
    myWaitSP = mySP { autoComplete       = Just 1000000 }
    
    myLayoutPrompt = inputPromptWithCompl myAutoSP "Layout"
                     (mkComplFunFromList' ["1.mtabbed", "2.mtiled", "3.mfullscreen", "4.mgrid"]) ?+ \l ->
                         sendMessage $ JumpToLayout $ drop 2 l
    
    --
    -- DECLARE WORKSPACES RULES
    --
    myLayout = maximize . minimize $
               windowNavigation $
               boringWindows $
               smartBorders (
                 aTiled |||
                 aFullScreen |||
                 aGrid  |||
                 aFullScreen |||
                 aTabbed  |||
                 aFullScreen )
            where
    	        aTabbed     = named "mtabbed" ( avoidStruts $ gaps [(U, 12), (R, 8), (L, 8), (D, 8)] $ tabbed shrinkText myTabTheme )
    	        aGrid       = named "mgrid"   ( gaps [(U, 12), (R, 8), (L, 8), (D, 8)] $ avoidStruts $ spacing 8 $ Grid)
                    aTiled      = named "mtiled"  ( gaps [(U, 12), (R, 8), (L, 8), (D, 8)] $ avoidStruts $ spacing 8 $ ResizableTall nmaster delta ratio [] )
                    aFullScreen = named "mfullscreen" (noBorders(fullscreenFull Full))
                    -- Default number of windows in master pane
                    nmaster = 1
                    -- Percent of the screen to increment when resizing
                    delta   = 5/100
                    -- Default proportion of the screen taken up by main pane
                    ratio   = toRational (2/(1 + sqrt 5 :: Double))
    
    -- WORKSPACE DEFINITIONS
    --myWorkspaces = clickable $ [
    --  " 1:Term "
    --  ," 2:Vim "        
    --  ," 3:Files "      
    --  ," 4:Pdf "        
    --  ," 5 "
    --  ," 6:Gimp "
    --  ," 7:Inkscape "
    --  ," 8 "
    --  ," 9 "]     
    --  where clickable l = [ "^ca(1,xdotool key alt+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    --                        (i,ws) <- zip [1..] l,
    --                        let n = i ]
    
    myWorkspaces = [
      " 1:Term "
      ," 2:Vim "        
      ," 3:Files "      
      ," 4:Pdf "        
      ," 5 "
      ," 6:Gimp "
      ," 7:Inkscape "
      ," 8 "
      ," 9 "]     
    -- APPLICATION SPECIFIC RULES
    myManageHook = composeAll [
      resource =? "dmenu" --> doFloat
      , resource =? "skype"   --> doFloat
      , resource =? "feh"     --> doIgnore
      , resource =? "dzen2"   --> doIgnore
      , className =? "dzen2"   --> doIgnore
      , resource =? "dzen"   --> doIgnore
      , resource =? "lemonbar"   --> doIgnore
      , resource =? "bar"   --> doIgnore
      , className =? "lemonbar"   --> doIgnore
      , className =? "bar"   --> doIgnore
      , className =? "Pcmanfm"  --> doShift (myWorkspaces !! 2)
      , resource =? ".zathura-wrapped"--> doShift (myWorkspaces !! 3)
      , className =? "Gimp"   --> doShift (myWorkspaces !! 5)
      , className =? ".inkscape-wrapped"   --> doShift (myWorkspaces !! 6)
      , className =? "Filezilla"   --> doShift (myWorkspaces !! 7)
      , resource =? "transmission"    --> doShift (myWorkspaces !! 7)
      , resource =? "mplayer" --> doShift (myWorkspaces !! 8)
      , className =? "mplayer2" --> doShift (myWorkspaces !! 8)
      , manageDocks
      ]
    
    xPropMatches :: [XPropMatch]
    xPropMatches = [ 
      ( [ (wM_CLASS, any ("Firefox" `isInfixOf`))], pmX(setTags (words("be bt"))))
      ,( [ (wM_CLASS, any (".terminator-wrapped" ==))], pmX(addTag "bt"))
      ,( [ (wM_CLASS, any ("emacs" ==))], pmX(addTag "be"))
      ,( [ (wM_CLASS, any ("Emacs" ==))], pmX(addTag "be"))
      ]
    
    newManageHook = xPropManageHook xPropMatches <+> myManageHook <+> manageHook defaultConfig
    
    --
    -- DZEN LOG RULES for workspace names, layout image, current program title
    --
    myLogHook h = dynamicLogWithPP ( defaultPP {
       ppCurrent           =  wrap "%{R}" "%{R}"  . pad 
      , ppVisible          = wrap " " " " . pad
      , ppHidden           = wrap "%{+u}" "%{-u}"  . pad 
      , ppHiddenNoWindows  = wrap "%{F#ecff22}" "%{F#2199ee}" . pad
      , ppWsSep            = "%{-u}  "
      , ppSep              = " "
    --  , ppTitle = wrap "%{F#00ff00}" "%{r}" . shorten 70 . pad
      , ppTitle = wrap "%{F#00ff00}" "%{r}" .
          (\x -> case x of
              ""   -> "ZenRatio"
              _    -> x
              )
      , ppLayout              = wrap " " " " .
          (\x -> case x of
          "Maximize Minimize mfullscreen"  -> "   %{B#00ff00}%{F#000000}  full  %{B#000000}%{F#2199ee}   "
          "Maximize Minimize mgrid"        -> "   %{B#00ff00}%{F#000000}  grid  %{B#000000}%{F#2199ee}   "
          "Maximize Minimize mtabbed"      -> "   %{B#00ff00}%{F#000000}  tabb  %{B#000000}%{F#2199ee}   "
          "Maximize Minimize mtiled"       -> "   %{B#00ff00}%{F#000000}  tile  %{B#000000}%{F#2199ee}   "
          _                                -> "%{B#00ff00}%{F#000000}" ++ x ++ "%{B#000000}%{F#2199ee}"
          ) 
    --  , ppOrder       =  \(ws:l:t:x) -> [" "] ++ x ++ [l, ws, t]
    --  , ppOrder       =  \(ws:l:t:x) -> x ++ [l, ws, t]
      , ppOrder       =  \(ws:l:t:x) -> [l, ws, "           " , t] ++ x
      , ppOutput      =   hPutStrLn h
      , ppExtras      =  [ date "%a %b %d %H:%M "]
      })
    
    --
    -- Spawn pipes and menus on boot, set default settings
    --
    -- select font with xfontsel 
    --myXmonadlemonbar = "bar -p -f \"-gbdfed-creep-*-*-*-*-16-*-*-*-*-*-*-*\" -B \"#FF2B2B2B\" | bash "
    myXmonadlemonbar = "/home/ronin/bin/lemonbar -g 1332x30+14+14 -d -p -f \"Century Gothic:size=11\" -F \"#2199ee\" -f \"Monofur for Powerline:size=11\" -B \"#000000\" -u 4 -U \"#00ff00\" | bash "
    
    main = do
      lemonbar <- spawnPipe myXmonadlemonbar
      xmonad $ ewmh defaultConfig {
        terminal                = myTerminal
        , borderWidth           = 8
        , normalBorderColor     = "#000000"
        , focusedBorderColor    = "#2199ee"
        , modMask               = mod1Mask
        , layoutHook            = avoidStruts $ myLayout
        , workspaces            = myWorkspaces
        , manageHook            = newManageHook
        , handleEventHook       = docksEventHook <+> fullscreenEventHook  <+> minimizeEventHook
        , startupHook           = return () >> checkKeymap defaultConfig myKeyConfig >> setWMName "LG3D"
        , logHook               = myLogHook lemonbar 
        }
    
    --
    -- Keyboard options
    --
                `additionalKeysP` myKeyConfig
    
    myKeyConfig :: [([Char], X ())]
    myKeyConfig = [
      ("M1-S-a", withFocused (keysResizeWindow (-20,0)(0,0)))
      ,("M1-S-c", return())
      ,("M1-S-d", withFocused (keysResizeWindow (0,-20)(0,0)))
      ,("M1-S-f", withFocused (keysResizeWindow (20,0)(0,0)))
      ,("M1-S-h", sendMessage MirrorExpand)
      ,("M1-S-l", sendMessage MirrorShrink)
      ,("M1-S-m", namedScratchpadAction scratchpads "mEmacs") 
      ,("M1-S-n", namedScratchpadAction scratchpads "mTerminator")
      ,("M1-S-s", withFocused (keysResizeWindow (0,20)(0,0)))
      ,("M1-S-t", spawn "urxvt -e tmux")
      ,("M1-S-x", kill)
      ,("M1-a", withFocused (keysMoveWindow (-20,0)))
      ,("M1-b", raiseMaybe (safeSpawn "firefox" []) (className =? "Firefox"))
      ,("M1-d", withFocused (keysMoveWindow (0,-20)))
      ,("M1-f", withFocused (keysMoveWindow (20,0)))
      ,("M1-g", raiseMaybe (safeSpawn "gimp" []) (className =? "Gimp"))
      ,("M1-i", raiseMaybe (safeSpawn "inkscape" []) (className =? ".inkscape-wrapped"))
      ,("M1-m", raiseMaybe (safeSpawn "emacs" []) (className =? "Emacs"))
      ,("M1-n", raiseMaybe (safeSpawn "terminator" []) (className =? ".terminator-wrapped"))
      ,("M1-q", spawn "killall lemonbar; killall bar; killall dzen2; cd ~/.xmonad; ghc -threaded xmonad.hs; mv xmonad xmonad-x86_64-linux; xmonad --restart" )
      ,("M1-s", withFocused (keysMoveWindow (0,20)))
      ,("M1-t", withFocused $ windows . W.sink)
      ,("M1-w", raiseMaybe (safeSpawn "pcmanfm" []) (className =? "Pcmanfm"))
      ,("M1-z", raiseMaybe (safeSpawn "filezilla" []) (className =? "Filezilla"))
      ,("M4-C-s", tagPrompt myPromptTheme (\s -> withTaggedGlobalP s shiftHere))
      ,("M4-S-b", windowPromptBring myPromptTheme )
      ,("M4-S-g", windowPromptGoto myPromptTheme)
      ,("M4-S-n", sendMessage RestoreNextMinimizedWin)
      ,("M4-S-s", tagPrompt myPromptTheme (\s -> withFocused (addTag s)))
      ,("M4-S-t", tagPrompt myPromptTheme (\s -> focusUpTaggedGlobal s ))
      ,("M4-n", withFocused minimizeWindow)
      ,("M4-o f", sendMessage $ JumpToLayout "mfullscreen")
      ,("M4-o l", sendMessage $ JumpToLayout "mtiled")
      ,("M4-o t", sendMessage $ JumpToLayout "mtabbed")
      ,("M4-p", myLayoutPrompt)
      ,("M4-t", sinkAll)
      -- ,("M4-j", windows focusDown)
      -- ,("M4-k", windows focusUp)
      ]
    
    -- Define constants
    myTerminal      = "urxvt"
    -- myBitmapsDir    = "~/.xmonad/dzen2/"
    
    
    

    external by Github modified Jul 19, 2014  11  0  1  0

    UITableView remove additional separators

    UITableView remove additional separators: gistfile1.txt
    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
        return 0.01f;
    }
    
    - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
        return [UIView new];
    }
    
    

    external by Blake modified Dec 21, 2014  11  0  1  0

    Python pretty print with thousands separators

    Python pretty print with thousands separators: gistfile1.py
    import locale
    locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
    
    def pp(num):
      return locale.format("%d", num, grouping=True)
    
    # test print
    print pp(10000)
    
    
    • Public Snippets
    • Channels Snippets