Skip to content

Instantly share code, notes, and snippets.

View tiesmaster's full-sized avatar

Thijs Brobbel tiesmaster

View GitHub Profile
#% text_encoding = iso8859_1
_package user
$
remex(:rowcol_display_tree)
$
def_slotted_exemplar(:rowcol_display_tree,
{
@tiesmaster
tiesmaster / ci-9989_reproduces_exhausing_ui_resources.magik
Created January 31, 2013 15:56
Reproduces the UI problems in Smallworld, raises the weird "**** Error: Throw to unknown tag try_tag with values", caused by 1310724(create_failure).invoke()... [1]. This illustrates exhausting the hash_table EXTERNAL_REF.ID_TABLE, which can only hold 2^14 elements. [1] CI-9989: Gui Control creation failed
_block
_for i _over 1.upto(100)
_loop
_local f, rc, img
f << frame.new("hoi")
rc << rowcol.new(f)
img << smallworld_product.get_raster_image(:goto_object, :ui_resources)
_over 1.upto(100)
_loop
image_button_item.new(rc, img)
@tiesmaster
tiesmaster / easy_compressor.magik
Created February 4, 2013 07:59
easy_compressor.magik
#% text_encoding = iso8859_1
_package user
$
def_slotted_exemplar(:easy_compressor,
{
{:target_dir, _unset, :writable, :read_only},
{:source_concurrency_mode, _unset, :writable, :read_only}
})
@tiesmaster
tiesmaster / ReproduceCloneBugExtension.cs
Created July 17, 2013 12:44
Delta.Iris.ReproduceCloneBug
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using log4net;
using ESRI.ArcGIS.Desktop.AddIns;
@tiesmaster
tiesmaster / ReproduceSchematicsBug.cs
Last active December 20, 2015 06:59
Reproduces the "UI thread schematics" bug. This happens when ISchematicDiagramContainer.get_SchematicDiagramByName() is called on a worker thread, instead of the UI thread.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
@tiesmaster
tiesmaster / Version.Targets
Created March 7, 2014 19:37
Example how to ensure the AssemblyVersion, and AssemblyInformationalVersion get valid values.
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Version>1.2.3</Version>
<SnapshotVersion>1.2.3-SNAPSHOT</SnapshotVersion>
<JiraVersion>PROSNDCHK-404</JiraVersion>
<PomVersion>$(Version)</PomVersion>
</PropertyGroup>
@tiesmaster
tiesmaster / cut_lines_and_areas.magik
Created March 17, 2014 21:09
Knippen van lijnen met vlakken
w2 << rope
.new_from_iter(weg, :sections_clipped_by|()|, vlakje)
.map(_proc(sec) >> sec.as_sector_rope() _endproc)
.select(predicate.using(_proc(sr) >> sr.within?(vlakje).not _endproc)).ae
w2.intersections_with_boundaries(vlakje).ae.bdraw()
@tiesmaster
tiesmaster / .gitignore
Last active August 29, 2015 14:05
Reproduce Heisenbug
# Created by http://www.gitignore.io
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
class InMiddleTruncator : ITruncator
{
public string Truncate(string value, int length, string truncationString, TruncateFrom truncateFrom = TruncateFrom.Right)
{
if(value.Length <= length)
return value;
const int MIN_POSTFIX_LENGTH = 3;
var prefix = value.Substring(0, length - truncationString.Length - MIN_POSTFIX_LENGTH);
return prefix + truncationString + value.Substring(value.Length - MIN_POSTFIX_LENGTH, MIN_POSTFIX_LENGTH);
@tiesmaster
tiesmaster / SysSlot.cs
Created October 31, 2014 14:35
sys!slot ;)
private TOut SysSlot<TOut, TIn>(object @object, string fieldName)
{
// ReSharper disable once PossibleNullReferenceException
return (TOut)typeof(TIn).GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance).GetValue(@object);
}