working on it ...

Filters

Explore Public Snippets

Sort by

Found 615 snippets matching: boolean

    public by Geometry modified Sep 25, 2016  1063  0  4  0

    ToBoolean: Converts a jagged short integer array to a jagged boolean array.

    Converts a jagged short integer array to a jagged boolean array.
    /// <summary>
            ///   Converts a jagged short integer array to a jagged boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[][] ToBoolean(this short[][] value, bool[][] result)
            {
                for (int i = 0; i < value.Length; i++)
                    for (int j = 0; j < value[i].Length; j++)
                        result[i][j] = value[i][j] != 0;
                return result;            
            }

    public by Geometry modified Sep 25, 2016  1030  0  4  0

    ToBoolean: Converts a multidimensional single-precision floating point array to a multidimensional boolean array.

    Converts a multidimensional single-precision floating point array to a multidimensional boolean array.
    /// <summary>
            ///   Converts a multidimensional single-precision floating point array to a multidimensional boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[,] ToBoolean(this float[,] value, bool[,] result)
            {
                unsafe
                {
                    fixed (float* src = value)
                    fixed (bool* dst = result)
                    {
                        for (int i = 0; i < value.Length; i++)
                            dst[i] = src[i] != 0;
                    }
                }
    
                return result;
            }

    public by Geometry modified Sep 25, 2016  792  0  3  0

    ToBoolean: Converts a jagged single-precision floating point array to a jagged boolean array.

    Converts a jagged single-precision floating point array to a jagged boolean array.
    /// <summary>
            ///   Converts a jagged single-precision floating point array to a jagged boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[][] ToBoolean(this float[][] value, bool[][] result)
            {
                for (int i = 0; i < value.Length; i++)
                    for (int j = 0; j < value[i].Length; j++)
                        result[i][j] = value[i][j] != 0;
                return result;            
            }

    public by Geometry modified Sep 25, 2016  784  0  3  0

    ToBoolean: Converts a short integer array to a boolean array.

    Converts a short integer array to a boolean array.
    /// <summary>
            ///   Converts a short integer array to a boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[] ToBoolean(this short[] value, bool[] result)
            {
                for (int i = 0; i < value.Length; i++)
                    result[i] = value[i] != 0;
                return result;
            }

    public by Geometry modified Sep 25, 2016  757  0  3  0

    ToBoolean: Converts a multidimensional integer array to a jagged boolean array.

    Converts a multidimensional integer array to a jagged boolean array.
    /// <summary>
            ///   Converts a multidimensional integer array to a jagged boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[][] ToBoolean(this int[,] value, bool[][] result)
            {
                            for (int i = 0; i < result.Length; i++)
                    for (int j = 0; j < result[i].Length; j++)
                        result[i][j] = value[i, j] != 0;
                return result;
            }

    public by Geometry modified Sep 25, 2016  711  0  3  0

    ToBoolean: Converts a jagged integer array to a multidimensional boolean array.

    Converts a jagged integer array to a multidimensional boolean array.
    /// <summary>
            ///   Converts a jagged integer array to a multidimensional boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[,] ToBoolean(this int[][] value, bool[,] result)
            {
                            for (int i = 0; i < value.Length; i++)
                    for (int j = 0; j < value[i].Length; j++)
                        result[i, j] = value[i][j] != 0;
                return result;            
            }

    public by Geometry modified Sep 25, 2016  696  0  3  0

    ToBoolean: Converts a integer array to a boolean array.

    Converts a integer array to a boolean array.
    /// <summary>
            ///   Converts a integer array to a boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[] ToBoolean(this int[] value, bool[] result)
            {
                for (int i = 0; i < value.Length; i++)
                    result[i] = value[i] != 0;
                return result;
            }

    public by Geometry modified Sep 25, 2016  617  0  3  0

    ToBoolean: Converts a multidimensional short integer array to a multidimensional boolean array.

    Converts a multidimensional short integer array to a multidimensional boolean array.
    /// <summary>
            ///   Converts a multidimensional short integer array to a multidimensional boolean array.
            /// </summary>
            /// 
    #if NET45
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
    #endif
            public static bool[,] ToBoolean(this short[,] value, bool[,] result)
            {
                unsafe
                {
                    fixed (short* src = value)
                    fixed (bool* dst = result)
                    {
                        for (int i = 0; i < value.Length; i++)
                            dst[i] = src[i] != 0;
                    }
                }
    
                return result;
            }

    public by mprisznyak modified May 3, 2014  2300  0  6  4

    Boolean function

    The Bad, Ugly Villain and the Good, Handsome Hero
    import datetime
    
    # a big NOOOOO!!!!!
    def Weekend():
        if datetime.datetime.today().weekday() == 5 or datetime.datetime.today().weekday() == 6:
            return True
        else:
            return False
            
    # YES!!
    def is_weekend_today():
      """
      determine if it's weekend today or not
      returns: Boolean
      """
          today = datetime.datetime.today()
          return today.weekday() in [5, 6]

    public by justaskydiver modified Jan 23, 2014  2646  0  4  0

    IF Abfrage direkt in boolean Feld schreiben

    Bsp.: button.setEnabled(true); = Änderung von true in eine direkte Abfrage
    eingabe.addTextChangedListener(new TextWatcher(){
    
    			@Override
    			public void afterTextChanged(Editable s) {
    				// TODO Auto-generated method stub
    					button.setEnabled(s.length() > 0 && s.toString().trim().contains(" "));
    					
    			}
    
    			@Override
    			public void beforeTextChanged(CharSequence s, int start, int count,
    					int after) {
    				// TODO Auto-generated method stub
    				
    			}
    
    			@Override
    			public void onTextChanged(CharSequence s, int start, int before,
    					int count) {
    				// TODO Auto-generated method stub
    				
    			}
    			
    			
    		});
    • Public Snippets
    • Channels Snippets