This file contains hidden or 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
| using System; | |
| namespace FluentCassandra | |
| { | |
| /// <summary> | |
| /// Used for generating UUID based on RFC 4122. | |
| /// </summary> | |
| /// <seealso href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122 - A Universally Unique IDentifier (UUID) URN Namespace</seealso> | |
| public static partial class GuidGenerator | |
| { |
This file contains hidden or 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 RotateSprite(s as integer, ang as integer) | |
| if (ang < 0) or (ang >= 360) then ang = mod(abs(ang), 360) | |
| if not (mod(ang, 90) = 0) then ang = Trunc(ang / 90) * 90 | |
| cx as integer | |
| cy as integer | |
| select ang | |
| case 0 |
This file contains hidden or 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
| UsePNGImageDecoder() | |
| UsePNGImageEncoder() | |
| Global Dim imageColors.i(1, 128, 128) | |
| Procedure main() | |
| LoadImage(0, "clay_cut_128px_ta.png") | |
| LoadImage(1, "grass_cut_128_ta.png") |
This file contains hidden or 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
| unit ufMain; | |
| interface | |
| uses | |
| Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
| Dialogs, StdCtrls; | |
| type | |
| TForm1 = class(TForm) |
This file contains hidden or 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
| inpath = r"C:\develop\taric_work\taric_XML_v2\tot" | |
| midpath = inpath + r".uncrypt" | |
| outpath = inpath + r".unpack" | |
| from os import listdir, path, makedirs, remove, rename | |
| from os.path import isfile, join |
This file contains hidden or 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
| #Algorithm taken from here (+ cleaned + simplified + commented): | |
| #https://chinmaylokesh.wordpress.com/2011/03/08/algorithm-to-find-all-distinct-sums-using-numbers-from-a-list-that-add-up-to-a-specified-sum/ | |
| def tsum(currentIndex,total): | |
| if total==SUM : | |
| s = "" | |
| for i in xrange(0,L): | |
| if record[i]: | |
| s = s + str(NUMBERS[i]) + ", " | |
| print s[0:-2] #remove last comma from result |
This file contains hidden or 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
| getPixels = require 'get-pixels' | |
| decimalToHexString = (number) -> | |
| if number < 0 | |
| number = 0xFFFFFFFF + number + 1 | |
| return number.toString(16).toUpperCase() | |
| getPixels "16x16test2.png", (err, pixels) -> | |
| if err | |
| console.log "Bad image path" |
This file contains hidden or 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
| /* Atomic boolean for golang | |
| A process-atomic boolean that can be used for signaling between goroutines. | |
| Default value = false. (nil structure) | |
| */ | |
| package main | |
| import "sync/atomic" |
This file contains hidden or 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
| // | |
| // main.c | |
| // arrtest | |
| // | |
| // Created by Mattias (hz) Hansson on 9/2/12. | |
| // Public Domain. Credits/Bugfixes welcome. | |
| // | |
| #include <stdio.h> | |
| #include <stdlib.h> |