woensdag 29 augustus 2018

"Which" in powershell

Welke Java gebruik je in powershell?

Get-Command java

donderdag 23 augustus 2018

Visual Studio 2017 nieuwe projectstructuur

Visual Studio 2017 ondersteunt een nieuwe csproj structuur die veel compacter en netter is.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>net452</TargetFrameworks>
    <Version>1.0.0</Version>
    <Authors>Auteur</Authors>
    <Company>Bedrijf</Company>
    <Description>Commentaar</Description>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="11.0.0.2" />
  </ItemGroup>

</Project>

Het voordeel van de nieuwe structuur is dat er automatisch een nuget package wordt aangemaakt, die je kunt uploaden naar je asset repository (wellicht nexus):
nuget push -src http://nexus.place.local/repository/bla-publish/  ThePackage.1.1.3.nupkg

deleten met:
nuget delete ThePackage 1.1.3 -src http://nexus.place.local/repository/bla-publish/

Vergeet niet dat de packages gecached worden. Die cache kun je ook weet legen:
nuget locals all -list
nuget locals all -clear

dinsdag 7 augustus 2018

ffmpeg compile x64 visual studio 2017

I managed to compile ffmpeg 64-bit using visual studio 2017:

This page helps, but some info is not copy/pasted correctly. Here is my corrected version:

* Download "MSYS2 x86_64" from "http://msys2.github.io" and install into "C:\workspace\windows\msys64" 

* Open the "x64 Native Tools prompt" from the Visual Studio 2017 folder.

* C:\workspace\windows\msys64\msys2_shell.cmd -mingw64 -use-full-path
(this will open a new window)

(inside the MSYS2 shell install the following packages)
* pacman -S make gcc diffutils mingw-w64-{i686,x86_64}-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-yasm

* Rename C:\workspace\windows\msys64\usr\bin\link.exe to C:\workspace\windows\msys64\usr\bin\link_orig.exe, in order to use MSVC link.exe
(or use mv /usr/bin/link.exe /usr/bin/link_old.exe in the shell)

### optionally install and compile x264
* git clone http://git.videolan.org/git/x264.git
* cd x264
* CC=cl ./configure --enable-static --prefix=/usr/local --disable-cli
* make
* make install

### ffmpeg
### Download sources from "http://www.ffmpeg.org/download.html"
# cd ffmpeg
* export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

(the next step can take quiet a while. Please wait)
* ./configure --toolchain=msvc --arch=x86_64 --enable-yasm  --enable-asm --enable-shared --disable-static --disable-programs --enable-avresample --enable-libx264 --enable-gpl --prefix=./install
* make

* make install

donderdag 2 augustus 2018

Lua: predictable Garbage Collection

http://kalogirou.net/2011/07/23/predictable-garbage-collection-with-lua/#disqus_thread

Update 22-12-2018: Je kan beter http://www.squirrel-lang.org/ gebruiken i.p.v. lua. Squirrel heeft reference counting als geheugenbeheer. Veel beter voor realtime toepassingen.