Skip to content

Instantly share code, notes, and snippets.

View wieslawsoltes's full-sized avatar

Wiesław Šoltés wieslawsoltes

View GitHub Profile
// http://en.cppreference.com/w/cpp/utility/variadic
#include <iostream>
#include <cstdarg>
#include <stdexcept>
void Format(const char* fmt...)
{
va_list args;
va_start(args, fmt);
@wieslawsoltes
wieslawsoltes / HTTPDownloader.h
Created December 11, 2017 17:31
libcurl downloader
#pragma once
#include <string>
#include <curl/curl.h>
#include <curl/easy.h>
#include <sstream>
#include <iostream>
#pragma comment(lib, "libcurl.a")
<#
.SYNOPSIS
This is a Powershell script to publish .NET Core projects.
.DESCRIPTION
This Powershell script will publish .NET Core projects.
.PARAMETER Path
The output path.
#>
[CmdletBinding()]
# .\Publish-All-Avalonia-Projects.ps1 -Path ".\_PUBLISH_" -RuntimeIdentifier "win7-x64"
# .\Publish-All-Avalonia-Projects.ps1 -Path ".\_PUBLISH_" -RuntimeIdentifier "ubuntu.14.04-x64"
# .\Publish-All-Avalonia-Projects.ps1 -Path ".\_PUBLISH_" -RuntimeIdentifier "osx.10.12-x64"
<#
.SYNOPSIS
This is a Powershell script to publish .NET Core projects.
.DESCRIPTION
This Powershell script will publish .NET Core projects.
.PARAMETER Path
Before linking (B) After linking (B) Size decrease
----------- ----------- ----------- -----------
Total size of assemblies 60,405,136 29,815,688 50.64 %
----------- ----------- ----------- -----------
Core2D.Avalonia.NetCore.dll 11,264 11,264 0.00 %
Autofac.dll 217,600 217,600 0.00 %
Avalonia.Animation.dll 10,240 10,240 0.00 %
Avalonia.Base.dll 91,136 91,136 0.00 %
Avalonia.Controls.dll 252,416 252,416 0.00
@wieslawsoltes
wieslawsoltes / MenuPage.xaml
Created August 9, 2017 13:50
Avalonia issue setting CheckBox.IsChecked does not update UI with .NET Framework 4.6.1, working on .NET Core
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Orientation="Vertical" Gap="4">
<TextBlock Classes="h1">Menu</TextBlock>
<TextBlock Classes="h2">A window menu</TextBlock>
<StackPanel Orientation="Horizontal"
Margin="0,16,0,0"
HorizontalAlignment="Center"
Gap="16">
PS C:\DOWNLOADS\GitHub\AvaloniaBehaviors\samples\BehaviorsTestApplication.NetCore> dotnet run
Unhandled Exception: OmniXaml.LoadException: Error loading XAML: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at OmniXaml.Builder.ConfiguredAssemblyWithNamespaces.Get(String typeName)
at OmniXaml.Builder.AddressPack.<>c__DisplayClass2_0.<Get>b__0(ConfiguredAssemblyWithNamespaces configuredAssemblyWithNamespaces)
at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
<XGroup Name="AND" State="Visible, Printable, Standalone" xmlns="https://github.com/Core2D" xmlns:sci="clr-namespace:System.Collections.Immutable;assembly=System.Collections.Immutable" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<XGroup.Connectors>
<XPoint State="Visible, Printable, Connector, None" X="15" Y="30">
<XPoint.Data>
<XContext />
</XPoint.Data>
<XPoint.Owner>
<x:Reference>AND</x:Reference>
</XPoint.Owner>
<XGroup Name="AND" State="Visible, Printable, Standalone" xmlns="https://github.com/Core2D" xmlns:sci="clr-namespace:System.Collections.Immutable;assembly=System.Collections.Immutable" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<XGroup.Connectors>
<sci:ImmutableArray x:TypeArguments="XPoint">
<XPoint State="Visible, Printable, Connector, None" X="15" Y="30">
<XPoint.Data>
<XContext />
</XPoint.Data>
<XPoint.Owner>
<x:Reference>AND</x:Reference>
</XPoint.Owner>
<XProject Name="Groups_Xaml" xmlns="https://github.com/Core2D" xmlns:sci="clr-namespace:System.Collections.Immutable;assembly=System.Collections.Immutable" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<XProject.CurrentContainer>
<XContainer Background="#FFFFFFFF" Height="600" Name="Page" Width="840">
<XContainer.CurrentLayer>
<XLayer IsVisible="True" Name="Layer1" Owner="{x:Reference Page}">
<sci:ImmutableArray x:TypeArguments="BaseShape">
<XGroup Name="AND" State="Visible, Printable, Standalone">
<XGroup.Connectors>
<sci:ImmutableArray x:TypeArguments="XPoint">
<XPoint State="Visible, Printable, Connector, None" Y="15">