This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json | |
import datetime | |
yesterday = datetime.date.today() - datetime.timedelta(days=1) | |
url = "https://onemocneni-aktualne.mzcr.cz/api/v1/covid-19/osoby.json" | |
data = json.loads(requests.get(url).content) | |
filterdata = [x for x in data["data"] if ( | |
(x["OkresKodBydliste"] == "CZ0422") and #laud kod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if $(PlatformName) == x86 ( | |
echo "Copy dll for x86" | |
xcopy "$(ProjectDir)MyFolder\FolderForX86\mylib.dll" /Y | |
) else ( | |
echo "Copy dll for x64" | |
xcopy "$(ProjectDir)MyFolder\FolderForX64\mylib.dll" /Y | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------- Drag side ----------------------- | |
// ----------------------------------------------------- | |
Point StartPosition; | |
private void PLC_PreviewMouseMove(object sender, MouseEventArgs e) | |
{ | |
if (e.LeftButton == MouseButtonState.Pressed) | |
{ | |
Point mousePos = e.GetPosition(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Flat ComboBox --> | |
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" /> | |
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" /> | |
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate"> | |
<Grid> | |
<Grid.ColumnDefinitions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prototype server for SNMP | |
Socket socket; | |
EndPoint ep; | |
byte[] buffer; | |
ManualResetEvent manualevent = new ManualResetEvent(false); | |
private void btnListener_Click(object sender, RoutedEventArgs e) | |
{ | |
// Construct a socket and bind it to the trap manager port 162 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create tasks, must use Task.Run() not new Task() | |
Task expireTask = Task.Run(()=> { ExpireCheck(); }); | |
Task agingTask = Task.Run(() => { AgingCheck(); }); | |
Task fifoTask = Task.Run(() => { FIFOCheck(); }); | |
Task novalidTask = Task.Run(() => { NoValidCheck(); }); | |
Task nolifeTask = Task.Run(() => { NoLifeCheck(); }); | |
// Add them to list | |
List<Task> tasks = new List<Task>(); | |
tasks.Add(expireTask); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Example of conditional styling --> | |
<Label Grid.Row="2" Grid.Column="1" Text="{Binding Material.ITEM_STATE_FORMAT}" HorizontalOptions="Center" Style="{StaticResource detailText}"> | |
<Label.Triggers> | |
<DataTrigger Binding="{Binding Material.State}" TargetType="Label" Value="B"> | |
<Setter Property="Style" Value="{StaticResource detailText}" /> | |
</DataTrigger> | |
<DataTrigger Binding="{Binding Material.State}" TargetType="Label" Value="N"> | |
<Setter Property="Style" Value="{StaticResource detailTextError}" /> | |
</DataTrigger> | |
</Label.Triggers> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Color x:Key="Primary">#0b5ed7</Color> | |
<Color x:Key="GridBackground">#4F000000</Color> | |
<Color x:Key="NexenColor">#9d1c9d</Color> | |
<Color x:Key="SomaDarkDark">#22272e</Color> | |
<Color x:Key="SomaDarkLight">#434c57</Color> | |
<Color x:Key="GithubDark">#24292f</Color> | |
<Color x:Key="GithubLight">#f6f8fa</Color> | |
<Color x:Key="GithubRed">#cf222e</Color> | |
<Color x:Key="GithubGreen">#2da44e</Color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyWpfProject.MainWindow mw = new MyWpfProject.MainWindow(); | |
ElementHost.EnableModelessKeyboardInterop(mw); | |
mw.Show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PrimeViewModel : INotifyPropertyChanged | |
{ | |
protected bool SetProperty<T>(ref T backingStore, T value, | |
[CallerMemberName] string propertyName = "", | |
Action onChanged = null) | |
{ | |
if (EqualityComparer<T>.Default.Equals(backingStore, value)) | |
return false; | |
backingStore = value; |
OlderNewer