<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://turecki.net"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Michał Turecki - programming</title>
 <link>https://turecki.net/tags/programming</link>
 <description></description>
 <language>en</language>
<item>
 <title>SQL Server useful but less known features</title>
 <link>https://turecki.net/content/sql-server-useful-less-known-features</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;ol&gt;
&lt;li&gt;
&lt;h4&gt;Checking who is connected to the database&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;sp_who&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SELECT&lt;br /&gt;
    NULL as [Connections by Database],&lt;br /&gt;
    [host_name] AS [Client Machine],&lt;br /&gt;
    db.name AS [Database],&lt;br /&gt;
    [program_name] AS [Client Program],&lt;br /&gt;
    COUNT(*) AS [Open Connections]&lt;br /&gt;
FROM sys.dm_exec_sessions s (nolock)&lt;br /&gt;
LEFT JOIN sys.dm_exec_requests r (nolock) ON r.session_id = s.session_id&lt;br /&gt;
LEFT JOIN sys.databases db (nolock) ON db.database_id = r.database_id&lt;br /&gt;
WHERE s.session_id &amp;gt;= 50 -- Ignore SQL Server processes&lt;br /&gt;
GROUP BY [host_name], db.name, [program_name]&lt;br /&gt;
ORDER BY [Client Machine], [Database], [Client Program]&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Adjusting connection pooling settings&lt;/h4&gt;
&lt;p&gt;By default pool size is 100 per database with a command timeout (effectively a connection timeout) of 15 seconds. To increase add following to the connection string:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Connection Timeout=30;Pooling=&#039;true&#039;;Max Pool Size=200&lt;/code&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Checking the size of column&#039;s contents&lt;/h4&gt;
&lt;p&gt;To check how much data the column contains:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SELECT *, DATALENGTH([column]) AS ColumnSizeInBytes FROM table&lt;/code&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;Using SQL Server profiler&lt;/h4&gt;
&lt;p&gt;Profiler is a powerful way to debug application performance problems, to check query execution time. If you&#039;re developing any application using SQL Server as a database, running it at least once for every application release can help with pinpointing possible performance issues. Remember the rule - &lt;em&gt;there should be a constant number of queries regardless of the amount of records fetched&lt;/em&gt; - that way application will scale better. Sometimes it&#039;s better to replace a single complex query with more simpler queries because for each result row, columns shared by joins are repeated and delivered to client for processing many times.
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/sql&quot;&gt;SQL&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/databases&quot;&gt;databases&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/sql-server&quot;&gt;sql-server&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 02 Nov 2016 11:43:56 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">39 at https://turecki.net</guid>
 <comments>https://turecki.net/content/sql-server-useful-less-known-features#comments</comments>
</item>
<item>
 <title>Online encode and decode base64, hex,  url</title>
 <link>https://turecki.net/content/online-encode-and-decode-base64-hex-url</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
&lt;!--//--&gt;&lt;![CDATA[// &gt;&lt;!--

&lt;!--

function urlDecode(s)
{
    return decodeURIComponent(s);
}

function urlEncode(s)
{
    return encodeURI(s);
}

function base64Decode(s)
{
    return window.atob(s);
}

function base64Encode(s)
{
    return window.btoa(s);
}

function hexDecode(s)
{
    var r = &#039;&#039;;
    for(var i = 0; i &lt; s.length; i += 2)
    {
        r += String.fromCharCode(parseInt(s.substr(i, 2), 16));
    }
    return r;
}

function hexEncode(s)
{
    var hex;
    var r = &#039;&#039;;
    for(var i = 0; i &lt; s.length; i++)
    {
        r += s.charCodeAt(i).toString(16);
    }
    return r;
}

//--&gt;
//--&gt;&lt;!]]&gt;
&lt;/script&gt;&lt;form name=&quot;encoder&quot; onsubmit=&quot;return false;&quot; id=&quot;encoder&quot;&gt;
&lt;textarea name=&quot;text&quot; rows=&quot;10&quot; style=&quot;width:80%;&quot;&gt;&lt;/textarea&gt;
&lt;table style=&quot;width: auto&quot;&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input value=&quot;Encode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=urlEncode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;td&gt;URL&lt;/td&gt;
&lt;td&gt;&lt;input value=&quot;Decode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=urlDecode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input value=&quot;Encode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=base64Encode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;td&gt;Base 64&lt;/td&gt;
&lt;td&gt;&lt;input value=&quot;Decode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=base64Decode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input value=&quot;Encode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=hexEncode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;td&gt;Hex&lt;/td&gt;
&lt;td&gt;&lt;input value=&quot;Decode&quot; type=&quot;button&quot; onclick=&quot;document.encoder.text.value=hexDecode(document.encoder.text.value)&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;3&quot;&gt;&lt;input type=&quot;reset&quot; value=&quot;Clear&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/decode&quot;&gt;decode&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/encode&quot;&gt;encode&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/online&quot;&gt;online&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 09 May 2016 08:19:08 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">38 at https://turecki.net</guid>
 <comments>https://turecki.net/content/online-encode-and-decode-base64-hex-url#comments</comments>
</item>
<item>
 <title>On Protobuf.Net, using AsReference and multiple instances of object which should be deserialized only once.</title>
 <link>https://turecki.net/content/protobufnet-using-asreference-and-multiple-instances-object-which-should-be-deserialized</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;There is a ProtoBuf.Net fact regarding using AsReference which somehow I missed when digging into why [ProtoAfterDeserialization] attribute is not applied for some objects.&lt;br /&gt;
The truth is that it is applied for some but not other objects even if I used AsReference attribute in some places.  The AsReference attribute should be applied to ALL REFERENCES TO THE OBJECT, both collections and navigational properties, NOT JUST REFERENCES OTHER THAN THE REFERENCE WE CONSIDER MAIN ONE.&lt;/p&gt;
&lt;p&gt;A simple test to prove it is below:&lt;/p&gt;
&lt;pre&gt;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using NUnit.Framework;
using ProtoBuf;

namespace ProtoBufAsReferenceTest
{
    [ProtoContract]
    public class Office
    {
        public static int DeserializationCounter = 0;

        [ProtoMember(1)]
        public Collection&amp;lt;Computer&amp;gt; Computers { get; private set; }

        [ProtoMember(2)]
        public Collection&amp;lt;Person&amp;gt; People { get; private set; }

        public Office()
        {
            Computers = new Collection&amp;lt;Computer&amp;gt;();
            People = new Collection&amp;lt;Person&amp;gt;();
        }

        [ProtoAfterDeserialization]
        protected void OnDeserialize()
        {
            DeserializationCounter++;
            foreach(var computer in Computers)
            {
                computer.Office = this;
            }
            foreach(var person in People)
            {
                person.Office = this;
            }
        }
    }

    [ProtoContract]
    public class Computer
    {
        public static int DeserializationCounter = 0;

        [ProtoMember(1, AsReference = true)]
        public Person Person { get; set; }

        [ProtoIgnore]
        public Office Office { get; set; }

        [ProtoAfterDeserialization]
        protected void OnDeserialize()
        {
            DeserializationCounter++;
        }
    }

    [ProtoContract]
    public class Person
    {
        public static int DeserializationCounter = 0;

        [ProtoMember(1, AsReference = true)]
        public Computer Computer { get; set; }

        [ProtoIgnore]
        public Office Office { get; set; }

        [ProtoAfterDeserialization]
        protected void OnDeserialize()
        {
            DeserializationCounter++;
        }
    }

    [TestFixture]
    public class TestClasses
    {
        [Test]
        public void TestAsReference()
        {
            // 3 instances are created 1 of each type
            var office = new Office();
            var computer = new Computer();
            var developer = new Person();

            office.Computers.Add(computer);
            office.People.Add(developer);
            computer.Person = developer;
            developer.Computer = computer;

            using(var ms = new MemoryStream())
            {
                Serializer.NonGeneric.Serialize(ms, office);
                ms.Position = 0;
                Check(Serializer.Deserialize&amp;lt;Office&amp;gt;(ms));
            }
        }

        private void Check(Office office)
        {
            Assert.AreEqual(1, Office.DeserializationCounter);
            Assert.AreEqual(1, Person.DeserializationCounter); // fails - 2
            Assert.AreEqual(1, Computer.DeserializationCounter); // fails - 2
            var computer = office.People.First().Computer;
            Assert.IsNotNull(computer.Office); // fails - Office is null
        }
    }
}
&lt;/pre&gt;&lt;p&gt;
Office class contains collections of Computers and Peoople without AsReference attribute. Person reference to the Computer for a change uses AsReference attribute. In the end 2 instances of Computer and 2 instances of Person are created.&lt;/p&gt;
&lt;p&gt;Only change necessary to fix this problem is adding AsReference to the Office class collections:&lt;/p&gt;
&lt;pre&gt;
        [ProtoMember(1, AsReference = true)]
        public Collection Computers { get; private set; }

        [ProtoMember(2, AsReference = true)]
        public Collection People { get; private set; }
&lt;/pre&gt;&lt;p&gt;
I am not sure if this is common mistake people make when using ProtoBuf.Net but I suspect this might be the case as none of the questions on &lt;a href=&quot;http://stackoverflow.com/&quot;&gt;StackOverflow&lt;/a&gt; I&#039;ve seen in the past mention this.&lt;br /&gt;
Or maybe it is only me who when using word &quot;reference&quot; thinks of references to the actual object which implies having at least a single copy of the actual object marked without &quot;AsReference&quot;.&lt;br /&gt;
Bottom line is if you use AsReference, use it everywhere the object is referenced.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/c&quot;&gt;c#&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/protobuf&quot;&gt;protobuf&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/serialization&quot;&gt;serialization&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 27 Nov 2014 14:13:47 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">23 at https://turecki.net</guid>
 <comments>https://turecki.net/content/protobufnet-using-asreference-and-multiple-instances-object-which-should-be-deserialized#comments</comments>
</item>
<item>
 <title>FlowDocument from a different thread - &quot;The calling thread cannot access this object because a different thread owns it.&quot;</title>
 <link>https://turecki.net/flowdocument-from-a-different-thread</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;The FlowDocument along with most of the elements it contains inherits from DispatcherObject class. This means when constructed, it becomes linked to the thread in which it was constructed and causes several implications.&lt;/p&gt;
&lt;p&gt;   I&#039;m sure such link was created for a reason - so that FlowDocument objects presented using WPF are not modified in a background thread as the updating is probably not implemented. I also won&#039;t debate on why objects contained in FlowDocument have no common, shared way of visiting them (IAddChild interface is helping with adding but something like IHaveChildren is not implemented).&lt;/p&gt;
&lt;p&gt;   Back to the topic - FlowDocument created by one thread cannot be used in another nor any of each one&#039;s inner objects. Or can&#039;t it? &lt;/p&gt;
&lt;p&gt;   One solution includes serializing a document in one thread and deserializing it in another (see &lt;a href=&quot;http://chrismylonas.blogspot.co.uk/2007/12/flowdocument-and-multiple-threads.html&quot;&gt;this blog entry&lt;/a&gt;). This is a slow process as serialization is costly and serialization of a FlowDocument object with images and other graphical elements might not work at all unless XamlPackage format is used - and this one is even slower as requires ZIP compression/decompression.&lt;/p&gt;
&lt;p&gt;Another is to create all FlowDocument objects on UI thread (see &lt;a href=&quot;http://stackoverflow.com/questions/6890000/backgroundworker-and-wpf&quot;&gt;this SO article&lt;/a&gt;). Seems easy to do but what if there are thousand of objects which need to be added to a FlowDocument and at the same time user interface should stay responsive, even if it only needs to display a progress dialog ?&lt;/p&gt;
&lt;p&gt;I found out another way to solve this problem, it is kind of hackish but seems to do the job for my needs:&lt;/p&gt;
&lt;pre&gt;
public static void AttachToCurrentThread(this FlowDocument document)
{
	var dispatcher = Dispatcher.CurrentDispatcher;
	var field = typeof(DispatcherObject).GetField(&quot;_dispatcher&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
	if(field == null)
	{
		throw new InvalidOperationException(&quot;_dispatcher property missing on DispatcherObject&quot;);
	}
	SetDispatcher(document, field, dispatcher, FlowDocumentVisitors);
}

private static readonly Func&amp;lt;object, object&amp;gt;[] FlowDocumentVisitors =
{
	x =&amp;gt; (x is FlowDocument) ? ((FlowDocument) x).Blocks : null,
	x =&amp;gt; (x is Section) ? ((Section) x).Blocks : null,
	x =&amp;gt; (x is BlockUIContainer) ? ((BlockUIContainer) x).Child : null,
	x =&amp;gt; (x is InlineUIContainer) ? ((InlineUIContainer) x).Child : null,
	x =&amp;gt; (x is Span) ? ((Span) x).Inlines : null,
	x =&amp;gt; (x is AnchoredBlock) ? ((AnchoredBlock) x).Blocks : null,
	x =&amp;gt; (x is Paragraph) ? ((Paragraph) x).Inlines : null,
	x =&amp;gt; (x is Table) ? ((Table) x).RowGroups : null,
	x =&amp;gt; (x is Table) ? ((Table) x).Columns : null,
	x =&amp;gt; (x is Table) ? ((Table) x).RowGroups.SelectMany(rg =&amp;gt; rg.Rows) : null,
	x =&amp;gt; (x is Table) ? ((Table) x).RowGroups.SelectMany(rg =&amp;gt; rg.Rows).SelectMany(r =&amp;gt; r.Cells) : null,
	x =&amp;gt; (x is TableCell) ? ((TableCell) x).Blocks : null,
	x =&amp;gt; (x is TableCell) ? ((TableCell) x).BorderBrush : null,
	x =&amp;gt; (x is List) ? ((List) x).ListItems : null,
	x =&amp;gt; (x is ListItem) ? ((ListItem) x).Blocks : null
};
	
private static void SetDispatcher(object item, FieldInfo field, object value, params Func&amp;lt;object, object&amp;gt;[] selectors)
{
	if(item is DispatcherObject)
	{
		var currentDispatcher = field.GetValue(item);
		if(currentDispatcher != null &amp;amp;&amp;amp; currentDispatcher != value)
		{
			field.SetValue(item, value);
		}
	}
	if(item is IEnumerable)
	{
		foreach(var subItem in item as IEnumerable)
		{
			SetProperty(subItem, field, value, selectors);
		}
	}
	if(selectors != null)
	{
		foreach(var selector in selectors.Select(x =&amp;gt; x(item)).Where(x =&amp;gt; x != null))
		{
			SetProperty(selector, field, value, selectors);
		}
	}
}
&lt;/pre&gt;&lt;p&gt;
Basically it just traverses FlowDocument and it&#039;s objects searching for DependencyObject instances and using reflection updates the _dispatcher private variable. This variable name can change in the future, the FlowDocument structure also can change so this solution can be considered not elegant or not stable but having said that DispatcherObject didn&#039;t change since .Net 3.5 and AttachToCurrentThread function can be easily adapted to handle different types of FlowDocument blocks and it&#039;s inner objects when those inherit from DispatcherObject.&lt;/p&gt;
&lt;p&gt;If you are just reading this paragraph then feel free to leave some feedback, especially if I missed any important collections of DispatcherObject instances in the selectors array.&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;The previous code was expecting an IEnumerable as input and while this is fine and optimal (less calls) but not flexible enough to handle special cases well.&lt;br /&gt;
Unfortunately loading of a packed FlowDocument object, saved using XamlPackage format will fail on a non-STA thread (&quot;The calling thread must be STA, because many UI components require this&quot; exception  thrown when TextRange.Load is called on a non-UI thread). This is a show-stopper for me so I can&#039;t use the code above anymore but it might become handy for someone not using Images.&lt;br /&gt;
I also updated it to support tables and lists and commented out style handling which I did not need (Styles are usually not tied to a thread anyway).&lt;br /&gt;
Actually the code can be generalized to handle any object, just change AttachToCurrentThread document argument type to object.&lt;/p&gt;
&lt;p&gt;Update 2:&lt;br /&gt;
Some cosmetic changes and added a couple additional FlowDocument elements in a visitor.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/c&quot;&gt;c#&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/flowdocument&quot;&gt;flowdocument&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 07 Jul 2014 14:28:23 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">20 at https://turecki.net</guid>
 <comments>https://turecki.net/flowdocument-from-a-different-thread#comments</comments>
</item>
<item>
 <title>Delphi 2007 - error running on 64-bit Windows</title>
 <link>https://turecki.net/delphi-2007-on-64bit-windows</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Delphi 2007 is not new although it is the last non-unicode release of Delphi hence it is used frequently to maintain legacy code base.&lt;/p&gt;
&lt;p&gt;And it has bugs. Some of them can be fixed by &lt;a href=&quot;http://andy.jgknet.de/blog/bugfix-units/vclfixpack-10/&quot;&gt;VCLFixPack&lt;/a&gt; and affect only compiled binaries.&lt;/p&gt;
&lt;p&gt;Some are related to IDE and neither &lt;a href=&quot;http://www.cnpack.org/&quot;&gt;CnPack&lt;/a&gt; nor &lt;a href=&quot;http://www.gexperts.org/&quot;&gt;GExperts&lt;/a&gt; IDE extensions can fix them.&lt;/p&gt;
&lt;p&gt;One of such bugs is related to debugging on 64-bit Windows. The problem is that after debugging session has ended, following error appears:&lt;/p&gt;
&lt;pre&gt;Assertion failure: &quot;(!&quot;SetThreadContext failed&quot;)&quot; 
in ..\win32src\thread32.cpp at line 412 
Continue execution?&lt;/pre&gt;&lt;p&gt;
The error was thrown by bordbk105N.dll and it was discussed &lt;a href=&quot;http://www.monien.net/delphi-2009-windows-7-64-bit-debugger-crash-workaround&quot;&gt;here (1)&lt;/a&gt; and &lt;a href=&quot;http://anotherlab.rajapet.net/2009/08/work-around-for-delphi-20072009-with.html&quot;&gt;here (2)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Unfortunately in (1) original URL has changed and (2) download links are dead so I attached a fix below as there&#039;s never enough of mirroring of the Internet. The executable is a patch tool which needs to be started as Administrator. It will modify bordbk105N.dll and fix the problem.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;table class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;span class=&quot;file&quot;&gt;&lt;img class=&quot;file-icon&quot; alt=&quot;File&quot; title=&quot;application/x-msdos-program&quot; src=&quot;/modules/file/icons/application-octet-stream.png&quot; /&gt; &lt;a href=&quot;https://turecki.net/sites/default/files/Delphi_2007_2009_WOW64_Debugger_Fix.exe&quot; type=&quot;application/x-msdos-program; length=180224&quot; title=&quot;Delphi_2007_2009_WOW64_Debugger_Fix.exe&quot;&gt;Delphi_2007_2009_WOW64_Debugger_Fix.exe&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;176 KB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/delphi&quot;&gt;delphi&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/bug&quot;&gt;bug&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/download&quot;&gt;download&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 03 Apr 2013 08:40:53 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">18 at https://turecki.net</guid>
 <comments>https://turecki.net/delphi-2007-on-64bit-windows#comments</comments>
</item>
<item>
 <title>TortoiseMerge with better shortcuts, like WinMerge</title>
 <link>https://turecki.net/content/tortoisemerge-better-shortcuts-winmerge</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;TortoiseMerge is a useful 3-way merge tool yet it lacks proper keyboard shortcuts configuration and default shortcuts seem to be designed only for basketball players, with fingers stretched from arrow keys up to function keys.&lt;br /&gt;
Update: &lt;a href=&quot;https://code.google.com/p/tortoisegit/&quot;&gt;Current Version&lt;/a&gt; of TortoiseMerge included in TortoiseGit has the keyboard shortcuts fixed and easy to use&lt;/p&gt;
&lt;p&gt;Fortunately it is open source. Moreover, it uses standard accelerators embedded as resources in the executable so it can be easily modified to fit our needs using only a resource editor. I used &lt;a href=&quot;http://www.angusj.com/resourcehacker/&quot;&gt;ResourceHacker&lt;/a&gt; ( ResHack.exe ) and modified these while preserving existing shortcuts.&lt;/p&gt;
&lt;p&gt;Shortcuts are located in Accelerators -&amp;gt; 100 -&amp;gt; 1033 path.&lt;/p&gt;
&lt;pre&gt;100 ACCELERATORS
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
	VK_Q, 57665, NOINVERT, CONTROL, VIRTKEY
	VK_ESCAPE, 57665, NOINVERT, VIRTKEY
	VK_DOWN, 32831, NOINVERT, VIRTKEY
	VK_DOWN, 32831, NOINVERT, SHIFT, VIRTKEY
	VK_LEFT, 32829, NOINVERT, VIRTKEY
	VK_LEFT, 32829, NOINVERT, SHIFT, VIRTKEY
	VK_RIGHT, 32830, NOINVERT, VIRTKEY
	VK_RIGHT, 32830, NOINVERT, SHIFT, VIRTKEY
	VK_UP, 32832, NOINVERT, VIRTKEY
	VK_UP, 32832, NOINVERT, SHIFT, VIRTKEY
	VK_LEFT, 32833, NOINVERT, CONTROL, VIRTKEY
	VK_LEFT, 32833, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_RIGHT, 32834, NOINVERT, CONTROL, VIRTKEY
	VK_RIGHT, 32834, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F1, 57669, NOINVERT, SHIFT, VIRTKEY
	VK_C, 57634, NOINVERT, CONTROL, VIRTKEY
	VK_X, 57635, NOINVERT, CONTROL, VIRTKEY
	VK_F, 57636, NOINVERT, CONTROL, VIRTKEY
	VK_F3, 32790, NOINVERT, VIRTKEY
	VK_F3, 32818, NOINVERT, SHIFT, VIRTKEY
	VK_G, 32884, CONTROL, VIRTKEY
	VK_V, 57637, NOINVERT, CONTROL, VIRTKEY
	VK_INSERT, 57637, NOINVERT, SHIFT, VIRTKEY
	VK_BACK, 57643, NOINVERT, ALT, VIRTKEY
	VK_Z, 57643, NOINVERT, CONTROL, VIRTKEY
	VK_RIGHT, 32855, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_RIGHT, 32857, NOINVERT, ALT, CONTROL, SHIFT, VIRTKEY
	VK_LEFT, 32859, NOINVERT, ALT, CONTROL, SHIFT, VIRTKEY
	VK_RIGHT, 32822, NOINVERT, ALT, SHIFT, VIRTKEY
	VK_RIGHT, 32820, NOINVERT, ALT, VIRTKEY
	VK_LEFT, 32819, NOINVERT, ALT, VIRTKEY
	VK_LEFT, 32821, NOINVERT, ALT, SHIFT, VIRTKEY
	VK_UP, 32780, NOINVERT, ALT, VIRTKEY
	VK_DOWN, 32779, NOINVERT, ALT, VIRTKEY
	VK_UP, 32802, NOINVERT, ALT, SHIFT, VIRTKEY
	VK_DOWN, 32804, NOINVERT, ALT, SHIFT, VIRTKEY
	VK_S, 32808, NOINVERT, ALT, VIRTKEY
	VK_F10, 32822, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F10, 32820, NOINVERT, CONTROL, VIRTKEY
	VK_F9, 32819, NOINVERT, CONTROL, VIRTKEY
	VK_F9, 32821, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_O, 57601, NOINVERT, CONTROL, VIRTKEY
	VK_R, 32794, NOINVERT, CONTROL, VIRTKEY
	VK_F5, 32794, NOINVERT, VIRTKEY
	VK_S, 57603, NOINVERT, CONTROL, VIRTKEY
	VK_S, 57604, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F1, 57670, NOINVERT, VIRTKEY
	VK_F8, 32804, NOINVERT, VIRTKEY
	VK_F11, 32779, NOINVERT, VIRTKEY
	VK_F7, 32779, NOINVERT, VIRTKEY
	VK_F8, 32802, NOINVERT, SHIFT, VIRTKEY
	VK_F11, 32780, NOINVERT, CONTROL, VIRTKEY
	VK_UP, 32780, NOINVERT, CONTROL, VIRTKEY
	VK_DOWN, 32779, NOINVERT, CONTROL, VIRTKEY
	VK_F11, 32780, NOINVERT, SHIFT, VIRTKEY
	VK_F7, 32780, NOINVERT, SHIFT, VIRTKEY
	VK_F6, 57680, NOINVERT, VIRTKEY
	VK_F6, 57681, NOINVERT, SHIFT, VIRTKEY
	VK_D, 32775, NOINVERT, CONTROL, VIRTKEY
	VK_T, 32774, NOINVERT, CONTROL, VIRTKEY
	VK_INSERT, 57634, NOINVERT, CONTROL, VIRTKEY
	VK_DELETE, 57635, NOINVERT, SHIFT, VIRTKEY
	VK_INSERT, 57637, NOINVERT, SHIFT, VIRTKEY
	VK_A, 32883, NOINVERT, CONTROL, VIRTKEY
}&lt;/pre&gt;&lt;p&gt;
If you are too lazy to change the resources, you can download attached TortoiseMerge.exe v1.7.15.0 and use it with recent versions of TortoiseGIT/SVN.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;table class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;span class=&quot;file&quot;&gt;&lt;img class=&quot;file-icon&quot; alt=&quot;File&quot; title=&quot;application/x-msdos-program&quot; src=&quot;/modules/file/icons/application-octet-stream.png&quot; /&gt; &lt;a href=&quot;https://turecki.net/sites/default/files/TortoiseMerge.exe&quot; type=&quot;application/x-msdos-program; length=1729760&quot; title=&quot;TortoiseMerge.exe&quot;&gt;TortoiseMerge.exe&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;1.65 MB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/source-control&quot;&gt;source-control&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/hacking&quot;&gt;hacking&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/download&quot;&gt;download&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 18 Jan 2013 12:58:52 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">15 at https://turecki.net</guid>
 <comments>https://turecki.net/content/tortoisemerge-better-shortcuts-winmerge#comments</comments>
</item>
<item>
 <title>Simple themed TCheckComboBox control for Delphi - TComboBox with checkboxes</title>
 <link>https://turecki.net/content/simple-themed-tcheckcombobox-control-delphi-tcombobox-checkboxes</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Recently I needed to upgrade a piece of software to do some things easily done in modern user interface libraries say WPF or FireMonkey (which I don&#039;t use personally), but requiring more effort to implement in Delphi VCL.&lt;/p&gt;
&lt;p&gt;  The task in question was to add a drop down menu with TCheckBox controls to a TStringGrid. This has been done countless times and TCheckedComboBox, TCheckBoxComboBox and others alike can be found on the Internet easily. The problem is none have the features I needed:&lt;/p&gt;
&lt;p&gt;- separate Items and Values where Values can optionally be presented to a user instead of Items&lt;br /&gt;
  - custom aggregation of values depending on user selection - checking checkboxes should trigger the event which will return a text calculated based on selections and custom algorithm, which can be say: sum all values of selected items, take maximum, average etc.&lt;br /&gt;
  - optionally for ease of use, it should contain bitmask aggregation mode - where value can be set and retrieved by simply assigning to a string representation of integer and appropriate checked items will be translated to bit weights of items&lt;br /&gt;
  - checks should be completely optional, when checks are disabled, the control should behave exactly like a normal TComboBox&lt;br /&gt;
  - checks need to use windows themes and look alike all other checkboxes&lt;br /&gt;
  - it should be as simple as possible but not any simpler - no copy + paste from Controls.pas or StdCtrls.pas&lt;/p&gt;
&lt;p&gt;   The control may have some bugs as it was not heavily tested and for best experience depends on some settings in DFM:&lt;/p&gt;
&lt;pre&gt;AutoComplete = False
Style = csDropDownList&lt;/pre&gt;&lt;p&gt;   Having said that, for all those who seek a free TCheckComboBox which have all or some of aforementioned features, feel free to use it.&lt;/p&gt;
&lt;p&gt;The component is available to download from &lt;a href=&quot;https://github.com/t00/deltoo#tcheckcombobox&quot;&gt;https://github.com/t00/deltoo#tcheckcombobox&lt;/a&gt; .&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/delphi&quot;&gt;delphi&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 12 Dec 2012 10:52:02 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">14 at https://turecki.net</guid>
 <comments>https://turecki.net/content/simple-themed-tcheckcombobox-control-delphi-tcombobox-checkboxes#comments</comments>
</item>
<item>
 <title>Kalkulator wygranych amino lotto 2009 oraz 2010</title>
 <link>https://turecki.net/content/kalkulator-wygranych-amino-lotto-2009-oraz-2010</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;div&gt;Do końca roku &lt;a href=&quot;http://www.amino.pl&quot;&gt;Amino&lt;/a&gt; przygotowało ciekawą &lt;a href=&quot;http://www.aminolotto.pl/&quot;&gt;loterię&lt;/a&gt; - mozna wygrać wielokrotność 1000 złotych, ale nie więcej niż 10000 zł zbierając opakowania na przyprawy z zupek, na których jest jedna lub dwie kwoty, które należy sumować. Do tej żmudnej operacji przygotowałem narzędzie, które jest zdecydowanie łatwiejsze w użyciu niż kalkulator na stronie producenta.&lt;/div&gt;
&lt;a href=&quot;/sites/default/files/amino.png&quot;&gt;&lt;img src=&quot;/sites/default/files/amino_tn.png&quot; style=&quot;float: left; margin: 10px;&quot;&gt;&lt;/a&gt;
&lt;!--break--&gt;
Wiadomo, że szanse wygranej są na tyle duże, na ile drukowane liczby są spreparowane przez producenta tak, aby sumy dawały okrągłe liczby tylko dla pewnej części opakowań, a z tego co zdążyłem zauważyć pula liczb jest dość ograniczona dając bardzo przewidywalne ilości wygranych. Z mojej puli liczb, nawet powtórzonej kilkukrotnie, nie udało się uzyskać żadnej wygranej. Pomimo tego spróbować można, w końcu zupki Amino nie są takie złe :)
&lt;br&gt;&lt;br&gt;
Kalkulator korzysta ze słownika liczb umieszczonego w folderze z programem, o nazwie &quot;amino.txt&quot;, który wczytuje przy otwieraniu programu i zapisuje przy zamykaniu, aby ułatwić zarządzanie swoją indywidualną pulą liczb. Liczby wprowadza się w nowych liniach lub przez oddzielenie spacjami, a słowa które nie są liczbami są pomijane. Parametry wyliczania można zmienić, jeśli kiedyś powstanie inna podobna loteria. Przycisk wylicz powoduje wyszukanie wygranych, znajdywane są wszystkie kombinacje liczb (również wielokrotne wystąpienia tych samych) i wiadomo - lepiej wybrać najwyższą lub zebrać więcej opakowań i poczekać na jeszcze wyższą.
&lt;br&gt;&lt;br&gt;
Dołączam też źródła programu z licencją &quot;róbta co chceta&quot; w zamian za podziękowanie w komentarzu.
&lt;br&gt;&lt;br&gt;
&lt;!--
&lt;a href=&quot;http://www.allegro.pl/item799704229_amino_lotto_program_wspiera_szukanie_wygranych.html&quot;  onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;img src=&quot;/app/kuponima.gif&quot;&gt;&lt;/a&gt;
&lt;br&gt;&lt;br&gt; --&gt;
&lt;em&gt;Aktualizacja&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
Ponieważ program nie działał wystarczająco szybko przy dużej ilości wprowadzonych liczb, przerobiłem go tak aby używał HashSet i wyznaczał wartość hash dla szukanych sum:
&lt;br&gt;&lt;br&gt;
&lt;code&gt;
int hash = (nums.IndexOf(item) + 1) * num.Value;
int sumHash = hash1 ^ hash2;
&lt;/code&gt;
&lt;br&gt;&lt;br&gt;
&lt;em&gt;Aktualizacja&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
Na stronie &lt;a href=&quot;http://www.e-konkursy.info/forum/post-870037-cat-1-pg-20.html&quot;&gt;http://www.e-konkursy.info/forum/post-870037-cat-1-pg-20.html&lt;/a&gt; jest umieszczony wątek na temat konkursu. Z kwot uzbieranych przez forumowiczów jasno wynika, że gdy liczba znaleziona w opakowaniu jest podzielna przez 11 wygranej nie będzie, gdyż suma dowolnych liczb podzielnych przez 11 nie da wielokrotności liczby 1000 mniejszej niż 11000. Tak czy inaczej kalkulator pomoże znaleźć kombinację liczb dającą najwyższą wygraną, jeśli łut szczęścia dopisze i trafimy na liczbę niepodzielną przez 11. Powodzenia !
&lt;br&gt;&lt;br&gt;
&lt;em&gt;Aktualizacja 24.09.2009 (wersja 2.0)&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
Przygotowałem kolejną wersję programu, która w porównaniu z poprzednią nie pokazuje powtarzających się wygranych, liczy dużo pewniej niż poprzednia i zdecydowanie szybciej. Uaktualniony jest też kod źródłowy programu do pobrania (amino_source.zip). Wszystkich zgłoszonych błędów już nie ma, ale oczywiście do uruchomienia programu potrzebny jest .Net framework 3.5 &lt;b&gt;SP1&lt;/b&gt; - (&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;displaylang=pl&quot;&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;displaylang=pl&lt;/a&gt;)
&lt;br&gt;&lt;br&gt;
&lt;em&gt;Aktualizacja 15.10.2009 (wersja 2.5)&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
W związku z licznymi prośbami o szybsze działanie programu dziś powstała nowa wersja, która przed wyszukaniem kombinacji liczb szuka liczb podzielnych przez 11 i jeśli wszystkie liczby są podzielne przez 11, informuje, że nie znaleziono wygranej. Oczywiście liczbę 11 można zmienić lub nie wpisać jej wcale. W prawdzie jest to tylko ominięcie problemu, ale dla loterii jest całkiem skuteczne - jeśli masz dużo liczb i program się zawiesi przy liczeniu to prawdopodobnie masz wygraną :) &lt;br&gt;
Przyspieszenie liczenia kombinacji jest możliwe, ale wymaga stosowania bardziej złożonych technik liczenia kombinacji, a &quot;brutalne&quot; liczenie (prawie) wszystkich kombinacji użyte w programie jest bardzo czasochłonne stąd mała jego wydajność - ilość obliczeń dla każdej kolejnej ilości wygranych liczb wyznaczana jest według wzoru: &lt;a href=&quot;http://pl.wikipedia.org/wiki/Kombinacja_bez_powtórzeń&quot;&gt;http://pl.wikipedia.org/wiki/Kombinacja_bez_powtórzeń&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
&lt;em&gt;Aktualizacja 22.11.2009&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
Do sprawdzania podzielności kwot przez 11 i szukania potencjalnych wygranych przygotowałem kalkulator online, który we wprowadzonym tekście wyszukuje kwoty trzy i czterocyfrowe, które mogą dać wygraną. Zbieżność dnia i miesiąca dzisiejszej daty z podzielnością w loterii amino jest czysto przypadkowa :)
&lt;br&gt;&lt;br&gt;
&lt;em&gt;Aktualizacja 29.12.2009&lt;/em&gt;
&lt;br&gt;&lt;br&gt;
Ponieważ loteria dobiega końca, udostępniłem do pobrania kalkulator onima.exe, który 2-3 miesiące temu był wystawiony na allegro, a w międzyczasie został dopracowany. Kalkulator jest szybki i bezbłędny, polecam.
&lt;br&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Aktualizacja 18.07.2010&lt;/em&gt;&lt;/strong&gt;
&lt;br&gt;&lt;br&gt;
Witam wszystkich! Nie miałem możliwości śledzenia losów nowej loterii, więc aktualizuję stronę dopiero teraz. Tym razem loterię sponsoruje liczba 13, więc zrobiłem kilka zmian - szukanie liczb podzielnych przez 13 działa od dzisiaj na stronie w forumlarzu poniżej, można szybko sprawdzić czy mamy wygrywającą liczbę. W pobieralni wrzuciłem onima2010.exe, który liczy zgodnie z zasadami nowej loterii i znajduje kombinacje liczb dające wygraną. Niestety nie gwarantuję, że program działa poprawnie, gdyż piszę z wysp i nie widziałem loterii na oczy, sugeruję się tylko tym co piszecie poniżej. Powodzenia!
&lt;br&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Aktualizacja 20.07.2010&lt;/em&gt;&lt;/strong&gt;
&lt;br&gt;&lt;br&gt;
Jeszcze o licencji: kalkulator onima (2009 i 2010) jest i będzie darmowy, możecie go używać bez ograniczeń, jednak nie można go sprzedawać, modyfikować czy podszywać się pod autora. Jeśli ktoś z Was znajdzie onima2010 w sprzedaży na &lt;a href=&quot;http://www.allegro.pl&quot;&gt;Allegro&lt;/a&gt;, &lt;a href=&quot;http://www.ebay.pl&quot;&gt;Ebay&lt;/a&gt; lub innym serwisie aukcyjno-ogłoszeniowym, dajcie znać w komentarzach, a najlepiej od razu zgłoście do obsługi tego serwisu jako naruszenie regulaminu. Dzięki, pozdrawiam.
&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Wyszukiwarka liczb wygrywających&lt;/strong&gt;&lt;br&gt;
Wprowadź do pola poniżej liczby, oddzielone dowolnymi znakami i naciśnij Szukaj.
&lt;a href=&quot;/pl/node/6&quot;&gt;&lt;img src=&quot;/app/animsledz.gif&quot; style=&quot;float:right; margin: 2px;&quot;&gt;&lt;/a&gt;
&lt;textarea id=&quot;numbers&quot; style=&quot;width: 487px; height: 200px;&quot;&gt;&lt;/textarea&gt;
&lt;br&gt;&lt;br&gt;
&lt;button onclick=&quot;
        var numbers = document.getElementById(&#039;numbers&#039;).value.match(/\d{3,4}/g);
        if(numbers == null)
        {
            document.getElementById(&#039;result&#039;).innerHTML = &#039;Nie podano prawidłowych kwot&lt;br&gt;&#039;;
            return;
        }
        document.getElementById(&#039;numbers&#039;).value = numbers.join(&#039; &#039;);

        var winning = new Array();
        var missed = new Array();
        for(var n = numbers.length - 1; n &gt;= 0; n--)
        {
             if(numbers[n] % 13 == 0) continue;
             var target = (13 - (numbers[n] % 13)) * 1000;
             if(target &lt; numbers[n] || target &gt; 10000) missed.push(numbers[n]); else winning.push(numbers[n]);
        }

        var result = &#039;Ilość wprowadzonych kwot: &#039; + numbers.length + &#039;&lt;br&gt;&#039;;
        if(missed.length &gt; 0)
             result += &#039;Kwoty wygrywajace poza zakresem (wygrana mniejsza od samej kwoty lub większa od 10000): &#039; + missed.join(&#039; &#039;) + &#039;&lt;br&gt;&#039;;
        if(winning.length == 0)
              result += &#039;Brak wygranych, wszystkie kwoty podzielne przez 13.&lt;br&gt;&#039;;
        else
        {
			  for(var w = winning.length - 1; w &gt;= 0; w--)
              {
                    result += &#039;Wygrywająca kwota: &#039; + winning[w] + &#039; (wygrana &#039; +  (13 - (winning[w] % 13)) * 1000 + &#039; zł)&lt;br&gt;&#039;;
              }
        }

        document.getElementById(&#039;result&#039;).innerHTML = result;
&quot;&gt;Szukaj&lt;/button&gt;
&lt;br&gt;
&lt;br&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7061782024161962&quot;;
/* 468x60, created 9/21/09 */
google_ad_slot = &quot;2243263131&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;div style=&quot;width: 97%; min-height: 72px; padding: 10px; font: 11pt tahoma;&quot;&gt;
&lt;div id=&quot;result&quot; style=&quot;margin: 10px;&quot;&gt;
Wklej tekst do pola powyżej i naciśnij przycisk &quot;Wylicz&quot; ...
&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_s-xclick&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;encrypted&quot; value=&quot;-----BEGIN PKCS7-----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-----END PKCS7-----
&quot;&gt;
&lt;input type=&quot;image&quot; src=&quot;https://www.paypal.com/pl_PL/PL/i/btn/btn_donateCC_LG.gif&quot; border=&quot;0&quot; name=&quot;submit&quot; alt=&quot;PayPal — Płać wygodnie i bezpiecznie&quot;&gt;
&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://www.paypal.com/en_GB/i/scr/pixel.gif&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;
&lt;/form&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-upload field-type-file field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;table class=&quot;sticky-enabled&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Attachment&lt;/th&gt;&lt;th&gt;Size&lt;/th&gt; &lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;&lt;span class=&quot;file&quot;&gt;&lt;img class=&quot;file-icon&quot; alt=&quot;File&quot; title=&quot;application/x-msdos-program&quot; src=&quot;/modules/file/icons/application-octet-stream.png&quot; /&gt; &lt;a href=&quot;https://turecki.net/sites/default/files/onima.exe&quot; type=&quot;application/x-msdos-program; length=20480&quot; title=&quot;onima.exe&quot;&gt;onima.exe - wydajny kalkulator (loteria 2009)&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;20 KB&lt;/td&gt; &lt;/tr&gt;
 &lt;tr class=&quot;even&quot;&gt;&lt;td&gt;&lt;span class=&quot;file&quot;&gt;&lt;img class=&quot;file-icon&quot; alt=&quot;File&quot; title=&quot;application/x-msdos-program&quot; src=&quot;/modules/file/icons/application-octet-stream.png&quot; /&gt; &lt;a href=&quot;https://turecki.net/sites/default/files/onima2010.exe&quot; type=&quot;application/x-msdos-program; length=20480&quot; title=&quot;onima2010.exe&quot;&gt;onima2010.exe&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;20 KB&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/download&quot;&gt;download&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/c&quot;&gt;c#&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Sat, 29 Aug 2009 09:44:58 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">7 at https://turecki.net</guid>
 <comments>https://turecki.net/content/kalkulator-wygranych-amino-lotto-2009-oraz-2010#comments</comments>
</item>
<item>
 <title>Compilation of PostgreSQL 8.3.7 on Visual Studio 2008</title>
 <link>https://turecki.net/content/compilation-postgresql-837-visual-studio-2008</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Today I have encountered few problems while trying to compile PostgreSQL on Windows. PostgreSQL designed to work in *nix environments and it&#039;s native build system works flawlessly on Linux just as expected. Unfortunatelly on Windows this build system is used by minority of applications, partially using Microsoft&#039;s own version of make: nmake.&lt;/p&gt;
&lt;p&gt;In PostgreSQL only libpq.dll can be compiled using nmake in Visual Studio Command Prompt which sets all necessary environment variables for compiler and linker (INCLUDE, LIBPATH etc, type &lt;code&gt;set&lt;/code&gt; in command prompt to verify these paths).&lt;/p&gt;
&lt;p&gt;Make sure you have installed most recent version of the Windows SDK before compiling postgresql, current version is 6.1 and it&#039;s default installation path is C:\Program Files\Microsoft SDKs\Windows\v6.1. To compile only libpq.dll in command prompt type following:&lt;/p&gt;
&lt;p&gt; &lt;code&gt;nmake /f win32.mak&lt;/code&gt;&lt;br /&gt;
or optionally:&lt;br /&gt;
 &lt;code&gt;nmake /f win32.mak DEBUG=1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To build whole project you need to satisfy all requirements regarding win32 build, specified in PostgresSQL documentation ( &lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/install-win32-full.html&quot;&gt;http://www.postgresql.org/docs/8.3/interactive/install-win32-full.html&lt;/a&gt; ). I used ActiveState Perl, but as mentioned in documentation standard distribution would be sufficient, just be sure to update &lt;code&gt;src\tools\msvc\Mkvcbuild.pm&lt;/code&gt; if perl version differs from 5.8 ( replace &lt;code&gt;\lib\CORE\perl58.lib&lt;/code&gt; with valid perl library path ). When installing these requirements you can specify same folder for all installations, even ActiveState Perl, for example &lt;code&gt;C:\pgbuild&lt;/code&gt;, then only &lt;code&gt;bin&lt;/code&gt; directory in &lt;code&gt;C:\pgbuild folder&lt;/code&gt; must be added to PATH environment variable so all tools could be found by PostgreSQL build scripts.&lt;/p&gt;
&lt;p&gt;PostgreSQL 8.3.7 default win32 build scripts are prepared for Visual Studio 8 (2005) and Windows Platform SDK obsoleted by Windows SDK so few changes are necessary to build PostgreSQL:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Project.pm replace &lt;code&gt;ProjectType=&quot;Visual C++&quot; Version=&quot;8.00&quot;&lt;/code&gt; with &lt;code&gt;ProjectType=&quot;Visual C++&quot; Version=&quot;9.00&quot;&lt;/code&gt;
&lt;/li&gt;&lt;li&gt;In &lt;code&gt;src\include\port\win32.h&lt;/code&gt; replace &lt;code&gt;#define _WIN32_WINNT 0x0500&lt;/code&gt; with &lt;code&gt;#define _WIN32_WINNT 0x0501&lt;/code&gt; to satisfy requirement for IPPROTO_IPV6 conditionally defined in Windows SDK. Updating src\include\pg_config_os.h might be also necessary.
&lt;/li&gt;&lt;li&gt;To build libpq.dll I have needed to supply src\interfaces\libpq\libpq.rc file by copying it from src\interfaces\libpq\libpq.rc.in, elegant solution would be to add:&lt;br /&gt;
&lt;code&gt;&quot;libpq.rc&quot; :&lt;br /&gt;
	if not exist &quot;libpq.rc&quot; copy &quot;libpq.rc.in&quot; &quot;libpq.rc&quot;&lt;/code&gt;&lt;br /&gt;
to src\interfaces\libpq\win32.mak just before line beginning with: &lt;code&gt;CPP_PROJ=&lt;/code&gt;.
&lt;/li&gt;&lt;li&gt;Update paths in &lt;code&gt;src\tools\msvc\config.pl&lt;/code&gt; to match previously installed dependencies.
&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;To build PostgreSQL just type build in Visual Studio Command Prompt in src\tools\msvc folder. All possible problems would appear yellow and red and generally would be simple to solve by satisfying dependencies like include files (eg. zlib.h) or required libraries (zlib.lib and zdll.lib which need to be grabbed from the net).&lt;/p&gt;
&lt;p&gt;Take a look at other tools in &lt;code&gt;src\tools\msvc&lt;/code&gt;, clean would be your inseparable friend and install with destination folder passed as parameter will ease an installation of your fresh PostgreSQL build.&lt;/p&gt;
&lt;p&gt;Have fun hacking pg and feel free to comment your experiences.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/programming&quot;&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/db&quot;&gt;db&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/tags/c-0&quot;&gt;C&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/tags/windows&quot;&gt;windows&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Sun, 17 May 2009 11:39:21 +0000</pubDate>
 <dc:creator>Michał Turecki</dc:creator>
 <guid isPermaLink="false">3 at https://turecki.net</guid>
 <comments>https://turecki.net/content/compilation-postgresql-837-visual-studio-2008#comments</comments>
</item>
</channel>
</rss>
