working on it ...

## Filters

Sort by

Found 611 snippets matching: boolean

### 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;
}```

### 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;
}```

### 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;
}```

### 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;
}```

### 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;
}```

### 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;
}```

### 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;
}```

### 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;
}```

### 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()

### 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