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
#!/usr/bin/python3 | |
import os | |
import dbus | |
import dbus.service | |
import dbus.mainloop.glib | |
import serial | |
from gi.repository import GLib | |
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
# replace Octopus variables in host.json | |
$octoVariableRegEx = [regex]"#\{([A-Za-z0-9_]+)\}" | |
$matchEvaluator = { | |
$varName = $args[0].Groups[1] | |
$octoValue = $global:OctopusParameters[$varName] | |
if ($null -ne $octoValue) { $octoValue } else { "$varName NOT DEFINED!" } | |
} | |
$hostJsonFiles = Get-ChildItem -Recurse $functionPackage -Filter 'host.json' | |
if ($hostJsonFiles.Count -gt 0) { | |
$hostJsonFile = $hostJsonFiles[0].FullName |
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-Module PowerHTML -Cmdlet ConvertFrom-Html | |
Add-Type -AssemblyName System.Web | |
# Constants | |
Set-Variable S_IAUName 'IAU Name' -Option Constant | |
Set-Variable S_IAUNameId 'IAUName' -Option Constant | |
Set-Variable S_ConstId 'ID' -Option Constant | |
Set-Variable S_ConstName 'Const.' -Option Constant | |
Set-Variable S_ConstNameId 'Constellation' -Option Constant | |
Set-Variable S_StarComp '#' -Option Constant |
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
function Invoke-MercuryCompiler { | |
param ( | |
[String] $mercuryHome | |
) | |
$env_Orig = Get-Environment | |
try { |
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
#define __STDC_WANT_LIB_EXT1__ 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define _GNU_SOURCE | |
#include <string.h> | |
#if _WIN32 || _WIN64 | |
# define CDECL __cdecl | |
# define WIN32_LEAN_AND_MEAN | |
# include <windows.h> |
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
static int BitCount(uint value) | |
{ | |
value = value - ((value >> 1) & 0x55555555); // reuse input as temporary | |
value = (value & 0x33333333) + ((value >> 2) & 0x33333333); // temp | |
value = ((value + (value >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; // count | |
return unchecked((int)value); | |
} |
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 defined(__POPCNT__) && defined(__GNUC__) && (__GNUC__> 4 || (__GNUC__== 4 && __GNUC_MINOR__> 1)) | |
#define HAVE_BUILTIN_POPCOUNTLL | |
#endif | |
static uint64_t bitcount64(uint64_t b) { | |
b -= (b >> 1) & 0x5555555555555555; | |
b = (b & 0x3333333333333333) + ((b >> 2) & 0x3333333333333333); | |
b = (b + (b >> 4)) & 0x0f0f0f0f0f0f0f0f; | |
return (b * 0x0101010101010101) >> 56; | |
} | |
/* For 32-bit, an 8-bit table may or may not be a little faster */ |
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
@echo off | |
rem | |
rem **************************************************************************** | |
rem | |
rem Copyright (c) Microsoft Corporation. All rights reserved. | |
rem This code is licensed under the Microsoft Public License. | |
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | |
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | |
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | |
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. |
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
Here a solution without using negation, instead the universe of seasons is | |
specified. | |
<!-- language-all: prolog --> | |
season(summer). | |
season(winter). | |
now(winter). |
NewerOlder