Beispiel #1
0
	public static int Main ()
	{
		S? s = null;
		bool res = s > 1;
		if (res)
			return 1;

		S2 s2 = new S2 ();

		var b = s2 >> 3;
		if (b != 1250)
			return 2;

		var b2 = s2 >> s2;
		if (b2 != 0)
			return 3;

		var b3 = s2 + 1;
		if (b3 != 10001)
			return 4;

		var s3 = new S3 ();
		if ((s3 == null) != false)
			return 5;

		if ((s3 != null) != true)
			return 6;
		
		if (S3.counter != 2)
			return 7;

		Console.WriteLine ("ok");
		return 0;
	}
    public void Load(IPortalApplication portalApplication)
    {
      var settings = portalApplication.GetSettings<LarmSettings>("Larm");

      portalApplication.OnModuleLoaded += (o, args) =>
        {
          var mcm = args.Module as IMcmModule;

          if (mcm == null) return;

          var s3 = new S3(settings.Aws);
          var transcoder = new ElasticTranscoder(settings.Aws);

          portalApplication.MapRoute("/v6/Search", () => new Search(portalApplication));
          portalApplication.MapRoute("/v6/WayfProfile", () => new WayfProfile(portalApplication, mcm.McmRepository, settings));
          portalApplication.MapRoute("/v6/Upload", () => new Upload(portalApplication, mcm.McmRepository, s3, transcoder, settings));
          portalApplication.MapRoute("/v6/Annotation", () => new Annotation(portalApplication, mcm.McmRepository));
          portalApplication.MapRoute("/v6/RadioProgram", () => new RadioProgram(portalApplication, mcm.McmRepository));
          portalApplication.MapRoute("/v6/Profile", () => new Profile(portalApplication, mcm.McmRepository, settings));

          portalApplication.AddView(new SearchView(mcm.McmRepository), settings.Index.SearchCoreName);
          portalApplication.AddView(new AnnotationView(mcm.McmRepository), settings.Index.AnnotationCoreName);
          portalApplication.AddView(new UserSearchView(), settings.Index.UserSearchCoreName);
          portalApplication.AddView(new ObjectView(mcm.PermissionManager), mcm.Configuration.ObjectCoreName, true);

          portalApplication.AddBinding(typeof(ProfileResult), new JsonParameterBinding<ProfileResult>());
        };
    }
 public void TestStructVCall() {
     Func<string> f = () => {
         var s = new S3();
         return s.ToString();
     };
     this.Test(f);
 }
Beispiel #4
0
	static int Main ()
	{
		var s = new S1 ();
		if (s.Value != 17)
			return 1;

		var s2 = new S2 ();
		if (s2.Value != 23)
			return 2;

		var s3 = new S3 ();
		if (s3.Value != 5)
			return 3;

		var s4 = new S4 (5);
		if (s4.Value != 11)
			return 4;

		var s5 = new S5 (2);
		if (s5.Value != 9)
			return 5;

		Console.WriteLine ("ok");
		return 0;
	}
 public void TestPassStructWithRef() {
     Func<int> f = () => {
         var s3 = new S3 { l = new List<int>() };
         var r = MutateS3(s3);
         return r + s3.l.Count;
     };
     this.Test(f);
 }
Beispiel #6
0
        public FormSettings(S3 mainClass)
        {
            InitializeComponent();

            this.mainClass = mainClass;

            bucket.Text = mainClass.bucketName;
            AWSKey.Text = mainClass.AWSKey;
            AWSSecretKet.Text = mainClass.AWSSecretKey;
            prefix.Text = mainClass.prefix;
            checkPrivate.Checked = mainClass.isPrivate;
            shorten.Checked = mainClass.shorten;
            https.Checked = mainClass.https;
            appendext.Checked = mainClass.appendExt;
            expires.Value = mainClass.expires;

            int selIndex = 0;
            switch (mainClass.imageFormat.ToLower()) {
                case "png": selIndex = 0; break;
                case "jpg": selIndex = 1; break;
                case "gif": selIndex = 2; break;
            }
            comboFormat.SelectedIndex = selIndex;

            {
                string[] parts = mainClass.shortCutDragModifiers.Split('+');
                foreach (string part in parts) {
                    switch (part) {
                        case "Ctrl": checkDragModCtrl.Checked = true; break;
                        case "Alt": checkDragModAlt.Checked = true; break;
                        case "Shift": checkDragModShift.Checked = true; break;
                    }
                }
            }

            {
                string[] parts = mainClass.shortCutPasteModifiers.Split('+');
                foreach (string part in parts) {
                    switch (part) {
                        case "Ctrl": checkPasteModCtrl.Checked = true; break;
                        case "Alt": checkPasteModAlt.Checked = true; break;
                        case "Shift": checkPasteModShift.Checked = true; break;
                    }
                }
            }

            mainClass.PopulateKeysCombobox(comboDragKeys);
            mainClass.PopulateKeysCombobox(comboPasteKeys);

            comboDragKeys.SelectedItem = mainClass.shortCutDragKey;
            comboPasteKeys.SelectedItem = mainClass.shortCutPasteKey;
        }
        public void Write__ResponseWithAckFromS3()
        {
            var s3 = new S3(new LarmSettings.AwsSettings
                {
                    AccessKey = ConfigurationManager.AppSettings["AccessKey"],
                    SecretAccessKey = ConfigurationManager.AppSettings["SecretAccessKey"],
                    UploadBucket = "integrationtests"
                });

            var stream = new FileStream("Ballad_of_Serenity.mp3", FileMode.Open);

            s3.Write("larm/Ballad_of_Serenity.mp3", stream);
        }
        public void Transcode__ResponseWithAckFromS3()
        {
            var aws = new LarmSettings.AwsSettings
                {
                    AccessKey = ConfigurationManager.AppSettings["AccessKey"],
                    SecretAccessKey = ConfigurationManager.AppSettings["SecretAccessKey"], 
                    UploadBucket = "integrationtests",
                    PipelineId = "1402593766282-xnnqcd",
                    PresetId = "1351620000001-300040"
                };
            var s3 = new S3(aws);
            var transcode = new ElasticTranscoder(aws);
            var stream = new FileStream("Ballad_of_Serenity.mp3", FileMode.Open);
            s3.Write("larm/Ballad_of_Serenity.mp3", stream);

            transcode.Transcode("larm/Ballad_of_Serenity.mp3", "larm/result.mp3");
        }
Beispiel #9
0
	public static int Main ()
	{
		S1? s1 = new S1 ();
		switch (s1) {
		case 1:
			break;
		default:
			return 1;
		}

		S2? s2 = new S2 ();
		switch (s2) {
		case null:
			break;
		default:
			return 2;
		}

		S3? s3 = new S3 ();
		switch (s3) {
		case 2:
			break;
		default:
			return 3;
		}

		S4 s4 = new S4 ();
		switch (s4) {
		case 3:
			break;
		default:
			return 4;
		}

		return 0;
	}
Beispiel #10
0
    public static void ViaStruct3()
    {
        var s3 = new S3(new S2(new S1(new C())));

        s3.M();
    }
Beispiel #11
0
        public string StemWord(string W)
        {
            string Stem = "";

            W = W.Trim();
            // 1 + 2
            for (int i = 0; i < W.Length; i++)
            {
                string S = W[i].ToString();
                if (!D.Search(S))
                {
                    if ((W[i] == 'ئ') || (W[i] == 'ء') ||
                        (W[i] == 'ؤ'))
                    {
                        Stem += "أ";
                    }
                    else
                    {
                        Stem += S;
                    }
                }
            }
            // 3
            if (Stem.Length >= 6)
            {
                if (P3.Search2(Stem, true))
                {
                    Stem = Stem.Substring(3);
                }
            }
            else
            {
                if (Stem.Length >= 5)
                {
                    if (P2.Search2(Stem, true))
                    {
                        Stem = Stem.Substring(2);
                    }
                }
            }
            // 4
            if (Stem.Length >= 6)
            {
                if (S3.Search2(Stem, false))
                {
                    Stem = Stem.Substring(0, Stem.Length - 3);
                }
            }
            else
            {
                if (Stem.Length >= 5)
                {
                    if (S2.Search2(Stem, false))
                    {
                        Stem = Stem.Substring(0, Stem.Length - 2);
                    }
                }
            }
            // 5
            if ((Stem.Length >= 4) && (Stem[0] == 'و') &&
                (Stem[1] == 'و'))
            {
                Stem = Stem.Substring(1);
            }
            // 6
            Stem = Stem.Replace('أ', 'ا');
            Stem = Stem.Replace('آ', 'ا');
            Stem = Stem.Replace('إ', 'ا');
            // 7
            if (Stem.Length <= 3)
            {
                return(Stem);
            }
            // 8
            if (Stem.Length == 4)
            {
                Stem = Word_4(Stem);
            }
            else
            {
                if (Stem.Length == 5)
                {
                    Stem = Word_5(Stem);
                }
                else
                {
                    if (Stem.Length == 6)
                    {
                        Stem = Word_6(Stem);
                    }
                    else
                    {
                        if (Stem.Length == 7)
                        {
                            Stem = Short_Suffix(Stem);
                            if (Stem.Length == 6)
                            {
                                Stem = Word_6(Stem);
                            }
                            else
                            {
                                Stem = Short_Prefix(Stem);
                                if (Stem.Length == 6)
                                {
                                    Stem = Word_6(Stem);
                                }
                            }
                        }
                    }
                }
            }
            // 9
            return(Stem);
        }
Beispiel #12
0
 public S4(S3 f5) : this()
 {
     F5 = f5;
 }
 public S4(S3 f2) : this()
 {
     F2 = f2;
 }
Beispiel #14
0
 public static bool ValidateS3(S3 str1, S3 str2, string methodName)
 {
     int iflag = 0;
     if (str1.flag != str2.flag || str1.str != str2.str)
     {
         Console.WriteLine("\tFAILED! " + methodName + "did not recieve result as expected.");
         Console.WriteLine("\tThe Actual flag field is...");
         Console.WriteLine("\t{0}.flag = {1}", str1.ToString(), str1.flag);
         Console.WriteLine("\t{0}.str = {1}", str1.ToString(), str1.str);
         Console.WriteLine("\tThe Expected is...");
         Console.WriteLine("\t{0}.flag = {1}", str2.ToString(), str2.flag);
         Console.WriteLine("\t{0}.str = {1}", str2.ToString(), str2.str);
         return false;
     }
     for (int i = 0; i < 256; i++)
     {
         if (str1.vals[i] != str2.vals[i])
         {
             Console.WriteLine("\tFAILED! " + methodName + "did not recieve result as expected.");
             Console.WriteLine("\tThe Actual vals field is...");
             Console.WriteLine("\t{0}.vals[{1}] = {2}", str1.ToString(), i, str1.vals[i]);
             Console.WriteLine("\tThe Expected vals field is...");
             Console.WriteLine("\t{0}.vals[{1}] = {2}", str2.ToString(), i, str2.vals[i]);
             iflag++;
         }
     }
     if (iflag != 0)
     {
         return false;
     }
     Console.WriteLine("\tPASSED!");
     return true;
 }
Beispiel #15
0
    static C3 M3(S1 arg0, ulong[] arg1)
    {
        {
            bool[] var0 = new bool[] { true, true, true, false, false, false };
            {
                C2 var1 = new C2(1, '4', 2147483646, 1605208943, 'D');
                if (false)
                {
                    arg1[0] = arg0.F6;
                    M4((char)M4(var1.F1, new S2(new C0(-6681, 1UL, 12605652605657673485UL, -2095285428, 'h', 0, 0UL, 1, 0UL, 1), 1), new byte[] { 1 }, 0, arg1[0]), new S2(new C0(-32767, 0UL, 1UL, 2, 'P', -53, 807295309399610555UL, 334, 13085575555733661150UL, 163), 18161), new byte[] { 255, 53, 0, 1 }, arg0.F4, (ulong)M4(arg0.F0.F2.F4, new S2(new C0(1, 9619072829407376891UL, 6822972438119668528UL, 1, ';', 23, 0UL, 11963, 9882749002995409094UL, 1), 18393), new byte[] { 131, 254, 135, 3, 224, 212, 1 }, arg0.F4--, arg1[0]));
                    char[] var2 = new char[] { 'M', 'Q', '+', '4', 'O' };
                    M4('O', new S2(new C0(-2, 18126595159717551460UL, 18446744073709551614UL, -2147483648, '"', 83, 18446744073709551614UL, 0, 3778599652186309599UL, 254), 58957), new byte[] { 0, 0, 32, 1, 135 }, arg0.F2++, arg1[0]);
                }
                else
                {
                    S3 var3 = new S3(4229277489U, 'f');
                }
            }
        }

        arg1[0] = 0UL;
        if (true)
        {
            {
                arg0.F8 = (long)M4('=', new S2(new C0(2, 0UL, 15944214140810606133UL, 1900409735, 'P', -127, 1UL, 55976, 18446744073709551615UL, 234), 28679), new byte[] { 115, 0, 1, 0, 10, 83, 254, 112 }, 1, arg0.F6);
                {
                    arg0.F4++;
                    arg0.F0.F2.F2 = (ulong)M4(arg0.F0.F2.F4, new S2(new C0(0, 18446744073709551614UL, 18446744073709551614UL, 834809739, 'X', -128, 2086258136875020755UL, 34009, 0UL, 126), 65534), new byte[] { 38, 1, 8 }, arg0.F7, arg0.F0.F2.F6);
                    M4((char)M4(arg0.F3, new S2(new C0(28466, 18446744073709551614UL, 5120187938939349582UL, -502446869, 'j', 0, 8093839229559151667UL, 59501, 0UL, 111), 54693), new byte[] { 0, 254, 255, 70, 21, 159, 0, 1 }, arg0.F2, arg0.F0.F2.F2), new S2(new C0(-12229, 1UL, 13320157680035715733UL, -2034409068, 'P', 97, 18446744073709551614UL, 7421, 6319672947952100278UL, 216), 56290), new byte[] { 198 }, arg0.F2, 8938263323418343113UL);
                    arg0.F0.F2.F4 = 'G';
                    {
                        arg0.F0 = arg0.F0;
                        M4('z', new S2(new C0(-32768, 0UL, 15261994854668802338UL, 10, 'x', 71, 6138359865935800038UL, 1, 1UL, 40), 10509), new byte[] { 255, 229, 1, 158, 250, 1, 54 }, (short)M4(arg0.F3++, new S2(new C0(3136, 15636147768937577458UL, 1UL, 1317135260, '^', 0, 17868785797188314105UL, 65534, 18446744073709551614UL, 1), 47009), new byte[] { 24, 105, 236, 217, 255 }, arg0.F0.F2.F0++, arg0.F0.F2.F1), 9240269650645555196UL);
                    }

                    M4(arg0.F0.F2.F4, new S2(new C0(2757, 1UL, 8314915081645526154UL, 2147483647, '5', -121, 2UL, 0, 1UL, 215), 65535), new byte[] { 49, 135, 1, 0, 10, 87, 141, 12 }, arg0.F4, 1UL);
                }

                arg0.F7 = arg0.F2;
                if (true)
                {
                    if (true)
                    {
                        if (false)
                        {
                            if (true)
                            {
                                arg0.F0.F2.F0 = (short)((ushort)(arg0.F0.F2.F0 % (char)(arg0.F0.F2.F4 | 1)) & (byte)(arg0.F0.F2.F9 % (byte)(0 | 1)));
                                arg0.F0.F2.F7 = 36203;
                                M4(arg0.F0.F2.F4, M5(new C2[] { new C2(255, ',', 2147483646, -2014308140, 'j'), new C2(211, 'r', 1372710831, 1925729060, '?'), new C2(0, 'V', -248664270, -10, 'i'), new C2(254, 'p', 191634187, 0, ' '), new C2(0, 'p', -1274355445, 0, 'g'), new C2(255, 'T', -2147483647, -1, '4'), new C2(1, '8', 1613423818, 1, ' '), new C2(97, 'H', -1064786185, 1, '~'), new C2(177, '~', 1, -625789446, 'E'), new C2(205, '^', -2147483648, -1050575355, 'a') }, new S1[] { new S1(new S0(6417926660750614724L, 2, new C0(-1, 5027749257976005710UL, 18446744073709551615UL, 251945115, '\'', -127, 12423409843401216695UL, 32452, 0UL, 92)), 1, 1, 'Z', 21153, 1978480642, 18446744073709551615UL, 30259, 0L), new S1(new S0(1L, 0, new C0(-30804, 2UL, 10175646296462965019UL, 0, '(', 10, 3601497448586236786UL, 34935, 3398002675144817764UL, 0)), 1640, 14423, 'E', -32767, -231436017, 1UL, 25643, 0L), new S1(new S0(7658263917189757679L, 23769, new C0(1, 18446744073709551614UL, 14836233572246719876UL, -1096286249, 'Q', -47, 0UL, 0, 1UL, 36)), 36894, -32768, ';', 19405, -2147483648, 0UL, 0, 2L), new S1(new S0(1655075656682172646L, 0, new C0(32766, 1UL, 1UL, -1629249340, '3', 45, 10599245420790520518UL, 0, 652497314982780718UL, 0)), 1, 2, 'k', -31417, 228260455, 4810733465042760138UL, -16179, 1L), new S1(new S0(-10L, 0, new C0(-12277, 12651726400594048356UL, 0UL, -2147483647, 'L', 50, 9781377473822602657UL, 0, 18299060362984165919UL, 255)), 1, -26482, 's', 12398, -2147483648, 8752960431227224071UL, 32767, 0L), new S1(new S0(3945780785418645937L, 24031, new C0(-5620, 11306251591889911580UL, 3905798313620878055UL, 1027152623, 'c', -106, 1UL, 1, 18446744073709551614UL, 73)), 65535, -19357, 'u', 0, 644541349, 3706235341147371014UL, -11160, 9223372036854775806L), new S1(new S0(9223372036854775806L, 17985, new C0(1, 14334602880220786446UL, 1UL, 22964507, '=', 0, 7918632809608247318UL, 1, 0UL, 242)), 28473, 0, 'k', 32767, -1988358691, 14252978534961264732UL, 32767, -9223372036854775807L), new S1(new S0(2348149875993281715L, 7571, new C0(0, 14701169481091665436UL, 1UL, 1, 'N', -127, 482569791198400333UL, 39124, 15611154848414091909UL, 254)), 0, 18294, 'Y', -17181, 0, 16388736789113935410UL, -20223, -9223372036854775807L) }, 819822756U, true, new C0(-16271, 0UL, 10UL, -2147483648, '}', -57, 5088691081290631932UL, 29153, 8414658262501230786UL, 102)), new byte[] { 1, 0, 255, 0, 1, 1, 92, 196, 83 }, arg0.F0.F2.F0, arg0.F0.F2.F1);
                                arg0.F0.F2.F1 = arg0.F0.F2.F6;
                                M4(arg0.F0.F2.F4++, new S2(new C0(-10, 10UL, 9019040445509167923UL, 822107179, 'z', 1, 18446744073709551615UL, 2045, 18446744073709551614UL, 0), 7991), new byte[] { 0, 0, 0, 1, 1, 105 }, 0, arg0.F0.F2.F8);
                            }

                            arg0.F0.F0 = arg0.F8;
                            arg1[0]    = arg0.F0.F2.F2 ^ 559931060U;
                        }

                        C0 var4 = arg0.F0.F2;
                        arg0.F0.F2.F9 = arg0.F0.F2.F9;
                        arg0.F6       = arg0.F0.F2.F2;
                    }

                    M5(new C2[] { new C2(195, '.', -1459855855, 2147483647, 'C'), new C2(153, 'K', 2147483647, 0, 'h'), new C2(112, '>', 986539722, 2147483647, 'e'), new C2(0, 's', 1870306055, -2147483647, '"'), new C2(255, 'p', -2, 1406423661, 'N'), new C2(1, 'm', -2147483648, 735285890, '1'), new C2(91, 'B', 2062402290, -1510631436, 'z') }, new S1[] { new S1(new S0(-9223372036854775808L, 25528, new C0(-28364, 14851901817663743492UL, 1UL, 1191710357, 'y', 0, 0UL, 40392, 18446744073709551614UL, 255)), 16281, 32767, 'Y', -20540, 0, 5794101794507400348UL, 32766, -9223372036854775807L), new S1(new S0(0L, 0, new C0(-4680, 0UL, 1UL, -1268664835, 'W', 109, 11651940351818580089UL, 62391, 2412101461766041781UL, 158)), 0, 0, 'A', -23805, -1102260041, 7374159264449159774UL, 1, -9223372036854775808L), new S1(new S0(-5926646345157823034L, 19154, new C0(0, 18446744073709551614UL, 10294268037115562802UL, 1, '7', 126, 11372730670002156103UL, 1, 17085623925610415594UL, 254)), 15075, -32767, 'P', 25752, 2147483646, 18446744073709551615UL, 10, 10L), new S1(new S0(-2L, 52123, new C0(0, 13944816292098834410UL, 11048547855839157943UL, -1802951769, 'I', -96, 2890978605007889778UL, 1845, 1UL, 243)), 23859, 1, 'L', 1, -2147483648, 18446744073709551614UL, -32768, 0L), new S1(new S0(-9223372036854775808L, 0, new C0(0, 6987598490878044310UL, 5094857007495614911UL, 908806695, 'c', -41, 8714666877050348578UL, 1, 12137770927405141661UL, 246)), 10719, -14343, ':', -2, 1, 1UL, 10, -9223372036854775807L), new S1(new S0(8778032663487749352L, 59811, new C0(0, 18446744073709551614UL, 6280268999457138957UL, 311295925, 'V', -114, 7602767386644678890UL, 57582, 17274784660612017915UL, 1)), 19071, 5931, 'z', 1, -1143714958, 17931227879673120979UL, -7547, 7995146543078091402L), new S1(new S0(7854634411444771784L, 0, new C0(-8497, 17188555883371921993UL, 0UL, 2147483646, 'e', 100, 10385068912089429069UL, 0, 0UL, 77)), 1, 0, '|', 21963, 0, 2636628529737789632UL, 23037, -7536961027058437937L), new S1(new S0(7338864521660809969L, 0, new C0(32767, 6562087143344760776UL, 0UL, 0, '@', 107, 1UL, 65534, 0UL, 30)), 65535, -28823, '\'', 32766, -2147483648, 16246367893918248633UL, -26918, -2404837451567573420L), new S1(new S0(9223372036854775806L, 21014, new C0(0, 0UL, 10133789045287981650UL, 0, 'B', 115, 0UL, 56907, 1UL, 197)), 30494, 0, '|', -25598, 2147483646, 0UL, -32767, -10L) }, (uint)M4(arg0.F3, new S2(new C0(9245, 1UL, 0UL, -77166468, 'h', 118, 11082116394969142271UL, 1, 5470339951851928435UL, 0), 0), new byte[] { 0, 1, 255 }, arg0.F2, arg0.F0.F2.F6), false, arg0.F0.F2);
                    arg0.F0.F2.F8 = 10UL;
                    arg0.F0.F2.F9 = (byte)(716384909U ^ M4((char)M4('Y', new S2(new C0(20488, 11300739848363550453UL, 1UL, 0, 'l', 90, 8141785304205283944UL, 13864, 13984016275264771998UL, 209), 14151), new byte[] { 144, 0, 0, 142, 1, 229, 0, 182, 211 }, (short)M4(arg0.F3, new S2(new C0(1, 0UL, 813154856624680054UL, 1, 'r', 5, 8682599165583628217UL, 0, 1UL, 3), 24102), new byte[] { 2 }, arg0.F0.F2.F0, arg1[0]), arg0.F0.F2.F1), new S2(new C0(11976, 2407884626004811465UL, 3869535521035427579UL, -1944164490, 'S', 2, 15048644682862590765UL, 1083, 6885327157949684488UL, 0), 65534), new byte[] { 9, 103, 255 }, (short)M4('m', new S2(new C0(0, 90061887634974587UL, 0UL, 2147483646, '^', 1, 11958762780598700605UL, 19207, 0UL, 63), 2476), new byte[] { 203, 0, 0, 1, 0, 1, 121, 4, 1, 72 }, 3808, 5172488989043528241UL), (ulong)M4(arg0.F0.F2.F4++, M5(new C2[] { new C2(96, '9', -2147483647, 2147483646, '~'), new C2(255, '2', -2147483647, -276314600, 'b'), new C2(221, 'x', -251490129, 789717081, '&'), new C2(0, '4', 1298970565, 0, 'd'), new C2(2, ' ', -1, 1003612660, 'Z'), new C2(1, 'r', 1057976548, 2147483646, 'K'), new C2(254, ' ', 2147483647, -1085063272, 'F'), new C2(255, '\'', -459647025, 0, 'i') }, new S1[] { new S1(new S0(-1L, 0, new C0(21728, 5838897404070441582UL, 5895354342884310833UL, 538500921, '8', -125, 16886991882817363979UL, 65534, 1UL, 31)), 65534, 1, 'r', 1, 1, 3645182856991570493UL, 0, 2L), new S1(new S0(2L, 1, new C0(-20988, 1UL, 10469467882913155759UL, 58704011, 'j', -28, 0UL, 2109, 6270117205869621557UL, 216)), 45059, 2, '@', 0, 727036549, 18032812277303308061UL, 0, -8680574794140326517L), new S1(new S0(7202707946375382595L, 13803, new C0(-10, 0UL, 18446744073709551615UL, 10, 'H', -128, 14639049826309193333UL, 1, 0UL, 253)), 10, 32767, '^', 0, 1, 1UL, -1255, -2421968377720380064L), new S1(new S0(1217062132328453805L, 65535, new C0(-25682, 1UL, 12175104290411407347UL, -276148151, 'n', 39, 1UL, 0, 6173028799703885346UL, 1)), 46327, -32767, 'j', 18992, 1476428163, 13064185531932013979UL, 28320, 9223372036854775806L), new S1(new S0(9223372036854775806L, 23089, new C0(18884, 1UL, 14786177906651837828UL, 2147483646, '-', -128, 0UL, 34661, 11268505873104910136UL, 254)), 65534, 1, 'S', -17196, -2129252583, 7544528846801412513UL, 32766, -9223372036854775807L), new S1(new S0(0L, 0, new C0(-29988, 3873683991498164502UL, 1UL, -49427462, 'd', -128, 1UL, 1, 1740772538205438893UL, 162)), 0, 233, 'W', -10135, 2, 3518338209262832077UL, 0, 2L), new S1(new S0(0L, 14084, new C0(0, 18446744073709551614UL, 15465548552540867079UL, 748495548, '*', 109, 0UL, 65535, 7294822961394481244UL, 185)), 2, 1, 'D', -14776, 880521574, 0UL, 4272, 0L), new S1(new S0(-3040707471966610165L, 12850, new C0(-3952, 1276600678729471812UL, 11846854085653459718UL, 2062658474, 'q', -2, 5821081627374439182UL, 1, 10003831609543030690UL, 0)), 0, -2, '5', 32767, 1, 0UL, -10, 2300165558300260019L) }, 0U, true, arg0.F0.F2), new byte[] { 218, 25, 128 }, arg0.F2, arg0.F0.F2.F2)));
                }

                sbyte var5 = arg0.F0.F2.F5;
                M4(arg0.F3, new S2(new C0(5902, 3488378738179977276UL, 1UL, -2147483647, '0', 54, 9975979528143434852UL, 4497, 18446744073709551614UL, 40), 22840), new byte[] { 57 }, -14107, arg1[0]);
                arg0.F0.F2.F3 = 2147483647;
            }

            arg0.F0.F2.F0 = (short)M4(arg0.F0.F2.F4++, new S2(new C0(10, 18446744073709551614UL, 13085434241481993882UL, 2147483646, '}', 126, 0UL, 0, 1UL, 1), 59481), new byte[] { 0, 225, 20, 48, 0, 37 }, (short)M4(arg0.F0.F2.F4, M5(new C2[] { new C2(2, '-', 0, 2147483647, 'W'), new C2(110, 'I', 1409009647, 2100356020, 'g'), new C2(1, 'U', -2, -283328337, '}'), new C2(1, 'Q', -553696493, 0, 'g') }, new S1[] { new S1(new S0(-6533951131553757320L, 1, new C0(150, 5823764796866531006UL, 16617749698742528929UL, -2147483648, '?', 127, 10UL, 10, 0UL, 144)), 65535, 6137, '~', -10, 1510646440, 0UL, 18965, -2345861182033990062L), new S1(new S0(1L, 0, new C0(-10, 16748226594543116735UL, 1041993155581501856UL, 1163940869, 'c', 10, 1UL, 0, 1222468697410879051UL, 242)), 65534, 1, 'q', -27904, -1710784563, 0UL, 18492, -949103547526860204L), new S1(new S0(2L, 30550, new C0(0, 10UL, 0UL, -1, '=', 51, 18446744073709551615UL, 63052, 9294325117764612932UL, 0)), 12475, -18572, '_', 32767, 1, 0UL, 32766, -5703621557763781392L), new S1(new S0(1L, 25640, new C0(-2, 0UL, 18446744073709551615UL, -1344164448, 'I', -74, 0UL, 65535, 17610354904774605356UL, 11)), 54578, -29289, 'Y', 1, 378586861, 851055780618043157UL, 1, 9223372036854775807L), new S1(new S0(5777672567932379260L, 1, new C0(-32767, 1UL, 10084776733787827520UL, -1292546741, '~', -5, 16116798637303097449UL, 1, 18446744073709551614UL, 0)), 1, 10047, 'o', -24455, 731992311, 10UL, 32767, 3114651057132127506L), new S1(new S0(8404734071467448421L, 65535, new C0(14814, 18446744073709551615UL, 2605129616334647928UL, -10, '*', 1, 5123346458424621380UL, 51341, 1403948383236082144UL, 35)), 14246, -20547, 'R', 1, -1725884088, 7888604522206255190UL, 10, -3656200073736876233L), new S1(new S0(-9223372036854775807L, 34377, new C0(2, 2963009326744088142UL, 377252743285488041UL, -1, 'N', 127, 12884385142621023726UL, 1, 17726346959929878840UL, 254)), 0, 10, 'u', -1977, -1978027021, 1915727398880682814UL, -10, 0L), new S1(new S0(6924629286624047312L, 16156, new C0(1, 2UL, 1UL, 1, 'g', 126, 18446744073709551615UL, 65534, 9457102664766096783UL, 74)), 1, 23427, '!', -22883, 1536539315, 252676051281158006UL, 22562, 1L) }, 1914173589U, false, arg0.F0.F2), new byte[] { 2 }, (short)M4(arg0.F0.F2.F4, M5(new C2[] { new C2(0, ')', 2147483646, 873280528, '4'), new C2(2, 'f', -2147483648, 0, '9'), new C2(74, '4', 1, 2147483646, 'P') }, new S1[] { new S1(new S0(-2455935079996073852L, 65535, new C0(-32768, 18446744073709551615UL, 18446744073709551615UL, 344428249, 'm', 91, 0UL, 50398, 0UL, 1)), 1, -28276, '0', 32767, -1004484333, 4254548821345654339UL, -10407, 1L), new S1(new S0(-7203925006419114054L, 27716, new C0(-1, 4079272969676518248UL, 5207074161251784290UL, -2147483648, 'B', -44, 11932551260934625123UL, 48807, 3726921624058345283UL, 79)), 0, 28881, '*', -2, -1559033961, 11883992471310697721UL, -32768, -2958685210246701406L) }, 1U, false, arg0.F0.F2), new byte[] { 254, 69 }, arg0.F7, 1790824454095912054UL), arg0.F6), arg0.F0.F2.F6);
        }

        M4(arg0.F3, M5(new C2[] { new C2(255, '-', 1, -2147483647, ','), new C2(116, 'n', 1782789175, 1395771394, ']'), new C2(1, '#', -1188388473, -1248002984, 'z'), new C2(11, '_', 0, -478849226, 'C'), new C2(0, '@', 1474867045, 1, '}') }, new S1[] { new S1(new S0(-9223372036854775808L, 62942, new C0(-18668, 10251397750490614021UL, 0UL, 1, ']', 23, 1UL, 41387, 9155990776608495UL, 1)), 34874, 0, 't', -1039, -198197568, 16289021566328109483UL, 0, -9223372036854775807L), new S1(new S0(-9223372036854775807L, 61417, new C0(32766, 0UL, 18446744073709551615UL, 2147483646, 'b', 1, 10814119330177450130UL, 40817, 11870602412599164432UL, 89)), 30311, 32325, '{', 18887, -1, 10UL, 23047, 7408880709365525456L), new S1(new S0(7274925268859994021L, 58075, new C0(-1, 10UL, 17243536859458222542UL, -1600086563, '"', -10, 10UL, 65534, 9989643537180060650UL, 1)), 1534, -16952, 'h', -26519, 1919978551, 10292168467135897965UL, 1, 9223372036854775807L), new S1(new S0(3334232653558830060L, 60145, new C0(30785, 9412939569939517301UL, 18446744073709551614UL, 1694444800, '[', 0, 12157918628608901127UL, 65534, 0UL, 232)), 0, -1, '4', 1, 2, 2UL, 0, -1267252400948577403L), new S1(new S0(9223372036854775806L, 0, new C0(-10, 18446744073709551615UL, 18446744073709551615UL, 1, 'O', -100, 1960601850661433022UL, 1, 10UL, 0)), 17856, -29511, 'w', 1, 1642495857, 1UL, -10, -9223372036854775808L), new S1(new S0(1L, 3580, new C0(13687, 13887756097290014433UL, 8752357934194838187UL, -505188300, 'f', -128, 13039118772918570033UL, 1, 11229167141557805788UL, 210)), 46477, -32768, '_', 20443, 1, 18446744073709551615UL, 32337, 6172164423493262663L) }, 4294967295U, M6(), arg0.F0.F2), M7(s_3, new S1[] { new S1(new S0(-7416021277494959671L, 47073, new C0(22815, 1UL, 0UL, -1, 'i', -21, 0UL, 1, 18446744073709551615UL, 254)), 48676, 1, 'z', 16214, -2, 0UL, 11004, -5783130232997878328L), new S1(new S0(3669033602726771799L, 4936, new C0(14750, 17823380198283399709UL, 18446744073709551615UL, -2147483647, 'n', 0, 0UL, 65534, 18446744073709551615UL, 144)), 65534, -30944, 's', -5620, -2147483647, 3725491755459216026UL, 1, 9223372036854775806L), new S1(new S0(-5534449719114484055L, 1, new C0(-13141, 4907014865213100057UL, 4737155504678902721UL, 1, 'k', 10, 0UL, 0, 7669818296870984667UL, 0)), 45105, 26488, 'L', 0, 705549208, 5602127707167504356UL, -10383, 9223372036854775806L), new S1(new S0(-1L, 1, new C0(1, 10UL, 4377170215021715164UL, 2147483647, 'V', -96, 1UL, 0, 0UL, 136)), 50937, -20815, 'l', -32768, 2147483647, 0UL, -22374, 5582724800589214430L), new S1(new S0(8632433531752781540L, 65295, new C0(-32768, 1UL, 4219067446512663497UL, 10, 'y', 106, 1UL, 1, 14247910608490818599UL, 254)), 1, 8645, '{', 12545, 398237877, 18446744073709551615UL, 32766, -2418932404700869515L), new S1(new S0(-9223372036854775808L, 46971, new C0(0, 18446744073709551615UL, 15872705720800779199UL, 2147483646, 'L', 35, 18446744073709551615UL, 1, 3107368292990501883UL, 214)), 5262, 24415, 'P', -30381, 646643578, 10UL, -25852, 8246405919144997806L), new S1(new S0(-3349488694584564769L, 54219, new C0(-21364, 8486208041704342050UL, 0UL, 0, '*', 126, 16163718421403601313UL, 19480, 18057837529345112740UL, 0)), 60272, 0, 'm', 22190, -1, 0UL, 0, 7401598335178839635L), new S1(new S0(159193377756506376L, 65535, new C0(32767, 13436506452248357032UL, 0UL, -2147483648, 'H', 63, 16522103052287086516UL, 52998, 2UL, 1)), 9027, 16356, 'L', -15001, 0, 1200855939159076656UL, 14618, 8377207215194697717L) }), arg0.F2, s_2.F0.F8);
        return(new C3(200, 126, 313367043, new S0(-9223372036854775807L, 7109, new C0(5850, 15750240340314667596UL, 10UL, 0, '2', 120, 16910783491067245913UL, 0, 1UL, 173)), -2064689565, 182, 1, 1, 63909, 4901591406945084414L));
    }
Beispiel #16
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (Bars == null)
            {
                return;
            }
            if (!Bars.BarsType.IsIntraday && Bars.Period.Id != PeriodType.Day)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && pivotRangeType == PivotRange.Daily)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && Bars.Period.Value > 1)
            {
                return;
            }

            // pivots only work for
            // - intraday
            // - 1 day chart with PivotRange Weekly or Monthly

            if (!isDailyDataLoaded)
            {
                if (priorDayHLC == HLCCalculationMode.DailyBars && Bars.BarsType.IsIntraday)
                {
                    Enabled = false;
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetBarsNow));
                    return;
                }

                existsHistDailyData = false;
                isDailyDataLoaded   = true;
            }

            IBar dailyBar;

            if (existsHistDailyData)
            {
                sessionDateDaily = GetLastBarSessionDate(Time[0], Bars, PivotRange.Daily);
                dailyBar         = dailyBars.Get(dailyBars.GetBar(sessionDateDaily));

                if (dailyBar.Time.Date > sessionDateDaily.Date)
                {
                    for (DateTime i = sessionDateDaily; i >= dailyBars.GetTime(0); i = i.AddDays(-1))
                    {
                        dailyBar = dailyBars.Get(dailyBars.GetBar(i));
                        if (dailyBar.Time.Date == i.Date)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                dailyBar = null;
            }

            double high  = existsHistDailyData ? dailyBar.High : High[0];
            double low   = existsHistDailyData ? dailyBar.Low : Low[0];
            double close = existsHistDailyData ? dailyBar.Close : Close[0];

            DateTime lastBarTimeStamp = GetLastBarSessionDate(Time[0], Bars, pivotRangeType);

            if ((currentDate != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Daily && lastBarTimeStamp != currentDate) ||
                (currentWeek != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Weekly && lastBarTimeStamp != currentWeek) ||
                (currentMonth != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Monthly && lastBarTimeStamp != currentMonth))
            {
                pp           = (currentHigh + currentLow + currentClose) / 3;
                s1           = 2 * pp - currentHigh;
                r1           = 2 * pp - currentLow;
                s2           = pp - (currentHigh - currentLow);
                r2           = pp + (currentHigh - currentLow);
                s3           = pp - 2 * (currentHigh - currentLow);
                r3           = pp + 2 * (currentHigh - currentLow);
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : high;
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : low;
            }
            else
            {
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : Math.Max(currentHigh, high);
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : Math.Min(currentLow, low);
            }

            if (pivotRangeType == PivotRange.Daily)
            {
                currentDate = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Weekly)
            {
                currentWeek = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Monthly)
            {
                currentMonth = lastBarTimeStamp;
            }

            if ((pivotRangeType == PivotRange.Daily && currentDate != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Weekly && currentWeek != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Monthly && currentMonth != Cbi.Globals.MinDate))
            {
                PP.Set(pp);
                R1.Set(r1);
                S1.Set(s1);
                R2.Set(r2);
                S2.Set(s2);
                R3.Set(r3);
                S3.Set(s3);
            }
        }
 private static byte[] GetS3Object(string filename, S3Token token, string name, RestClient rest)
 {
     return(S3.GetObject(token.BucketName, token.ObjectPrefix + filename, token.Credentials, rest));
 }
 public static extern S3 InvokeCallback3R(MyCallback3 callback, S3 s);
 public static extern void InvokeCallback3(MyCallback3 callback, S3 s);
Beispiel #20
0
        public ActionResult Index(S1 s1, S2 s2, S3 s3, S4 s4, Agirlik a)
        {
            //Karar Matrisi
            double[,] KararMatris = new double[, ] {
                { s1.S1_K1, s1.S1_K2, s1.S1_K3, s1.S1_K4, s1.S1_K5, s1.S1_K6, s1.S1_K7 },
                { s2.S2_K1, s2.S2_K2, s2.S2_K3, s2.S2_K4, s2.S2_K5, s2.S2_K6, s2.S2_K7 },
                { s3.S3_K1, s3.S3_K2, s3.S3_K3, s3.S3_K4, s3.S3_K5, s3.S3_K6, s3.S3_K7 },
                { s4.S4_K1, s4.S4_K2, s4.S4_K3, s4.S4_K4, s4.S4_K5, s4.S4_K6, s4.S4_K7 },
            };

            // Seçenekler
            List <string> secenekler = new List <string>();

            secenekler.Add(s1.Sec1);
            secenekler.Add(s2.Sec2);
            secenekler.Add(s3.Sec3);
            secenekler.Add(s4.Sec4);
            TempData["Secenekler"] = secenekler;

            // Ağırlıklar
            double[] Agirliklar = new double[] {
                Convert.ToDouble(a.K1),
                Convert.ToDouble(a.K2),
                Convert.ToDouble(a.K3),
                Convert.ToDouble(a.K4),
                Convert.ToDouble(a.K5),
                Convert.ToDouble(a.K6),
                Convert.ToDouble(a.K7)
            };

            double top = 0;

            for (int i = 0; i < Agirliklar.Length; i++)
            {
                top = top + Agirliklar[i];
            }

            if (top > 1)
            {
                TempData["hata"] = "Agirlik değerlerinin toplamı 0 ile 1 arasında olmalıdır.";
                return(RedirectToAction("Index"));
            }

            Topsis topsis = new Topsis();

            // Karar Matrisi
            TempData["KararMatrisi"] = KararMatris;

            //1.Adım : Standart Karar Matrisi
            topsis.StandartKararMatrisiHazirla(KararMatris);
            double[,] StandartKararMatris    = topsis.StandartKararMatrisiGoster();
            TempData["StandartKararMatrisi"] = StandartKararMatris;

            //2.Adım : Ağırlıklı standart Karar Matrisi
            topsis.agirlikliStandartKararMatrisiHazirla(Agirliklar);
            double[,] agirlikliStandartKararMatrisi   = topsis.agirlikliStandartKararMatrisiGoster();
            TempData["agirlikliStandartKararMatrisi"] = agirlikliStandartKararMatrisi;

            //3.Adım : ideal ve negatif ideal çözüm setleri
            topsis.idealVeNegatifİdealCozumDegerleriHesapla();
            double[] IdealcozumDegerler         = topsis.idealCozumDegerleriGoster();
            double[] negatifİdealcozumDegerleri = topsis.negatifİdealcozumDegerleriGoster();
            TempData["IdealcozumDegerler"]         = IdealcozumDegerler;
            TempData["negatifİdealcozumDegerleri"] = negatifİdealcozumDegerleri;

            //4.Adım : ideal ve negatif ideal noktalara olan uzaklık - ideal ayrım
            topsis.uzakliklarinHesabi();
            double[] idealUzaklik        = topsis.idealUzaklik;
            double[] negatifİdealUzaklik = topsis.negatifİdealUzaklik;
            TempData["idealUzaklik"]        = idealUzaklik;
            TempData["negatifİdealUzaklik"] = negatifİdealUzaklik;

            //5.Adım : İdeal çözüme gerekli yakınlık değeri
            topsis.idealCozumHesabi();
            double[] idealCozumSirali = topsis.idealCozumSiralaVeGoster();
            double   idealCozum       = topsis.idealCozum;

            TempData["idealCozumSirali"] = idealCozumSirali;
            TempData["idealCozum"]       = idealCozum;

            // Secenek degerleri
            double S1 = topsis.s1;
            double S2 = topsis.s2;
            double S3 = topsis.s3;
            double S4 = topsis.s4;

            TempData["Ss1"] = S1;
            TempData["Ss2"] = S2;
            TempData["Ss3"] = S3;
            TempData["Ss4"] = S4;

            return(RedirectToAction("Result"));
        }
Beispiel #21
0
 ///
 /// <summary>Begins the call to f4.</summary>
 ///
 public S3 Myf4(
     S3 v
     )
 {
     return(v);
 }
Beispiel #22
0
 public S3 p_object_struct(S3 a)
 {
     return(a);
 }
Beispiel #23
0
 public static Stream GetStream(this S3 s3)
 {
     return(string.IsNullOrEmpty(s3.Key) ? null : Repository.Get(s3.Bucket, s3.Key).Result);
 }
Beispiel #24
0
    static byte M7()
    {
        {
            {
                s_3 = s_3;
            }

            s_2.F1 = s_2.F1;
            {
                s_4    = s_4;
                s_2.F1 = M8();
            }

            s_2.F1.F8 = s_5[0].F1.F0;
        }

        s_2.F1.F2 = s_5[0].F1.F8;
        M8();
        M11();
        {
            if (s_2.F1.F9)
            {
                s_2 = s_5[0];
                S1 var0 = new S1(s_1[0], M8(), s_5[0].F1.F9, new S0(4059571437U, -18, 0U, 53300, 1, 0L, '?', 88, 175440329U, false));
                {
                    ulong var1 = 14546393804997823379UL;
                    var0.F1.F2 = s_5[0].F1.F0--;
                }
            }
            else
            {
                M9();
                S0 var2 = s_2.F1;
                s_5 = new S2[] { new S2(1, new S0(10U, 60, 0U, 10, -17875, 9039893305331936734L, '5', 48, 3810996533U, true)), new S2(0, new S0(2468814284U, -94, 1851821760U, 0, 32767, 8651667610527208293L, '*', 6, 1581466127U, true)) };
                S3 var3 = new S3(new S1(-1, new S0(0U, 64, 2990431291U, 1, 32767, 1L, ' ', 86, 3041780527U, true), false, new S0(4294967294U, 51, 1394453618U, 26904, -26407, -2L, 'k', 17, 1U, true)));
                if (var3.F0.F1.F9)
                {
                    s_2.F1 = M8();
                    s_3    = M10();
                    s_6    = var3.F0.F1.F7;
                    M11();
                    var3.F0.F3.F9 = var2.F9;
                    s_5[0].F0     = s_2.F1.F3;
                    s_2.F1.F7     = var3.F0.F1.F7;
                    ulong var4 = (ulong)M10();
                    S2    var5 = new S2(65535, new S0(274356392U, 126, 4294967294U, 0, -20210, -1298564306871414171L, '%', -128, 676267418U, true));
                    S0    var6 = var5.F1;
                    var5 = var5;
                }
                else
                {
                    s_6 = 1;
                }

                S3 var7 = new S3(new S1(-128068049, new S0(4294967294U, 126, 0U, 1, -3971, -1L, 'w', 76, 2750805929U, false), true, new S0(0U, -51, 1U, 61335, -32768, 0L, '@', 10, 4103604074U, true)));
                M8();
            }

            if (false)
            {
                M9();
                {
                    s_5[0].F1.F3 = (ushort)M9();
                    s_5[0].F1.F2 = (uint)(s_5[0].F1.F7 | s_2.F1.F6);
                }

                s_5[0].F0 = s_5[0].F0;
                s_7       = new S0(4294967295U, -31, 4227779564U, 5259, 0, 1L, 'e', 108, 0U, false);
                M11();
                M9();
            }
        }

        s_8 = s_2.F1.F7++;
        {
            s_7.F9 ^= true;
            s_5     = new S2[] { new S2(1, new S0(1U, 0, 1U, 0, -13302, 2366387621547808198L, '(', 109, 2828946408U, true)), new S2(11676, new S0(738454998U, -65, 10U, 52741, 27455, -8938048675518914187L, 'Z', -128, 1359190151U, true)), new S2(53433, new S0(1U, 0, 1U, 17260, 0, -1567042488291829689L, 'M', 41, 4024714093U, true)), new S2(15742, new S0(1843261556U, 1, 1U, 0, -7859, -274613808391189139L, 'P', -66, 0U, false)), new S2(0, new S0(2983698361U, 0, 2007911572U, 1, 0, 9223372036854775807L, '(', 111, 0U, true)), new S2(61007, new S0(10U, 127, 362281334U, 1, 29769, 8455699012887345024L, 'c', 126, 2978422199U, true)) };
            s_9     = s_7.F9;
        }

        s_2.F0    = s_5[0].F0;
        s_2.F1.F4 = 745;
        {
            if (true)
            {
                sbyte[, ] var8 = new sbyte[, ] {
                    { 61, 92, 86, 47, 59, -127, -13, 89 }, { 10, -116, 31, -128, -127, 126, -127, -44 }, { -10, -2, 59, 1, 126, 127, 33, 11 }, { 10, -5, -93, 25, 1, -96, -75, 0 }, { -127, -10, -3, 3, 18, 0, -1, 1 }, { 127, 0, -46, 0, -65, -98, 97, -69 }, { -36, -16, 45, 80, -10, 25, 126, -35 }, { 0, -10, -8, 106, 16, 0, -127, -94 }, { 127, -128, 0, 83, -128, 127, -37, -105 }
                };
            }
        }

        return(0);
    }
Beispiel #25
0
        /// <summary>
        /// This generates a honeycomb by reflecting in 4 mirrors of the fundamental simplex.
        /// This "new" method is now old.
        /// </summary>
        public static void OneHoneycombNew(HoneycombDef imageData)
        {
            int p = imageData.P;
            int q = imageData.Q;
            int r = imageData.R;

            double thickness           = 0.05;
            double thicknessSpherical  = Spherical2D.s2eNorm(thickness);
            double thicknessHyperbolic = R3.Math.DonHatch.h2eNorm(thickness);
            double threshold           = 1;

            H3.Cell.Edge[] edges            = null;
            H3.Cell[]      cellsToHighlight = null;
            Sphere[]       simplex          = null;
            Vector3D       vertex           = new Vector3D();

            Geometry g = Util.GetGeometry(p, q, r);

            if (g == Geometry.Spherical)
            {
                thickness = thicknessSpherical /*.07 for 333*/  /* 0.05for 433*/  /*.025 for 533,335*/;
                threshold = 10000;

                simplex = SimplexCalcs.MirrorsSpherical(p, q, r);
                vertex  = SimplexCalcs.VertexSpherical(p, q, r);

                // Ugly special casing for 333, since it has a vertex project to infinity.
                if (p == 3 && q == 3 && r == 3)
                {
                    SpecialCase333();
                }
            }
            else if (g == Geometry.Euclidean)
            {
                thickness = thickness / 2;
                threshold = 1 /*20*/;

                //SimplexCalcs.CalcEScale();
                simplex = SimplexCalcs.MirrorsEuclidean();
                Vector3D[] verts = SimplexCalcs.VertsEuclidean();
                vertex = verts[2];
            }
            else
            {
                thickness = thicknessHyperbolic;
                threshold = 0.01;

                simplex = SimplexCalcs.Mirrors(p, q, r);
                Vector3D[] verts = SimplexCalcs.VertsBall(p, q, r);
                vertex = verts[2];

                //Vector3D[] simplexVerts = SimplexCalcs.VertsBall( p, q, r );
                //H3.Cell.Edge edge = new H3.Cell.Edge( simplexVerts[2], simplexVerts[3] );
                //H3.Cell.Edge edge = SimplexCalcs.HoneycombEdgeBall( p, q, r );
                //H3.Cell.Edge[] startingEdges = new H3.Cell.Edge[] { edge };

                //H3.Cell.Edge[] edges = Recurse.CalcEdgesSmart2( simplex, startingEdges );

                // Vertex Centered.
                bool vertexCentered = false;
                if (vertexCentered)
                {
                    Vector3D v = SimplexCalcs.VertexPointBall(p, q, r);
                    v = H3Models.BallToUHS(v);
                    double scale = 1.0 / v.Abs();
                    edges = edges.Select(e =>
                    {
                        Vector3D start = H3Models.UHSToBall(H3Models.BallToUHS(e.Start) * scale);
                        Vector3D end   = H3Models.UHSToBall(H3Models.BallToUHS(e.End) * scale);
                        return(new H3.Cell.Edge(start, end));
                    }).ToArray();
                }

                // Code to show endpoints of 535

                /*using( StreamWriter sw = File.CreateText( "535_points.pov" ) )
                 * {
                 *      HashSet<Vector3D> verts = new HashSet<Vector3D>();
                 *      foreach( H3.Cell.Edge e in edges )
                 *      {
                 *              verts.Add( Sterographic.SphereToPlane( e.Start ) );
                 *              verts.Add( Sterographic.SphereToPlane( e.End ) );
                 *      }
                 *
                 *      foreach( Vector3D vert in verts )
                 *              if( !Infinity.IsInfinite( vert ) )
                 *                      sw.WriteLine( PovRay.Sphere( new Sphere() { Center = vert, Radius = 0.01 } ) );
                 * }*/
            }

            // Recurse
            bool dual = false;
            {
                H3.Cell.Edge[] startingEdges = null;
                if (dual)
                {
                    startingEdges = new H3.Cell.Edge[] { SimplexCalcs.DualEdgeBall(simplex) }
                }
                ;
                else
                {
                    //startingEdges = new H3.Cell.Edge[] { SimplexCalcs.HoneycombEdgeBall( simplex, vertex ) };
                    Vector3D[] verts  = SimplexCalcs.VertsEuclidean();
                    Vector3D   v1     = verts[0] + 2 * verts[2];             // adjacent cube center
                    Vector3D   corner = verts[3];

                    startingEdges = new H3.Cell.Edge[] { new H3.Cell.Edge(v1, corner) };
                }

                edges = Recurse.CalcEdges(simplex, startingEdges, new Recurse.Settings()
                {
                    G = g, Threshold = threshold
                });

                edges = edges.Where(e =>
                {
                    int sum = e.Depths.Count(d => d == 0);
                    return(true);
                }).ToArray();

                //CullHalfOfEdges( ref edges );

                // No need to cull edges in spherical case.
                // This was just to generate some images for 350-cell paper.
                //edges = Cull120Cell( edges );

                Simplex tet = new Simplex();
                tet.Facets = simplex;

                if (dual)
                {
                    H3.Cell.Edge[] oneDualCell = edges.Where(e => e.Depths[2] == 0).ToArray();
                    simplex = simplex.Skip(1).ToArray();
                    edges   = Recurse.CalcEdges(simplex, oneDualCell, new Recurse.Settings()
                    {
                        G = g, Threshold = threshold
                    });

                    int[]   polyMirrors  = new int[] { 0, 1, 3 };
                    H3.Cell startingCell = HoneycombGen.PolyhedronToHighlight(g, polyMirrors, tet, new Vector3D());
                    cellsToHighlight = Recurse.CalcCells(simplex, new H3.Cell[] { startingCell });
                    //cellsToHighlight = new H3.Cell[] { startingCell };
                    //cellsToHighlight = cellsToHighlight.Skip( 7 ).ToArray();
                }
                else
                {
                    int[]   polyMirrors  = new int[] { 1, 2, 3 };
                    H3.Cell startingCell = HoneycombGen.PolyhedronToHighlight(g, polyMirrors, tet, vertex);
                    //cellsToHighlight = Recurse.CalcCells( simplex, new H3.Cell[] { startingCell } );
                    cellsToHighlight = new H3.Cell[] { startingCell };
                }

                // Include just one cell?
                bool includeOne = false;
                if (includeOne)
                {
                    edges = edges.Where(e => e.Depths[0] == 0).ToArray();
                    //cellsToHighlight = cellsToHighlight.Where( c => c.Depths[0] == 0 ).ToArray();
                }
            }

            // Rotate
            bool rotate = false;

            if (rotate)
            {
                CompoundOfFive24Cells(ref edges);
            }

            // Write the file
            bool pov = true;

            if (pov)
            {
                string filename = string.Format("{0}{1}{2}.pov", p, q, r);
                PovRay.WriteEdges(new PovRay.Parameters()
                {
                    AngularThickness = thickness
                }, g, edges,
                                  filename, append: false);
                //File.Delete( filename );
                //PovRay.AppendFacets( cellsToHighlight, filename );

                HashSet <Vector3D> verts = new HashSet <Vector3D>();
                foreach (H3.Cell.Edge e in edges)
                {
                    verts.Add(e.Start);
                    verts.Add(e.End);
                }

                /*foreach( Vector3D v in verts )
                 * {
                 *      Vector3D t = v;
                 *      t.Normalize();
                 *      t *= 0.9;
                 *      System.Diagnostics.Trace.WriteLine( string.Format( "light_source {{ <{0},{1},{2}> White*.2 }}", t.X, t.Y, t.Z ) );
                 * }*/


                /*
                 * // Include the standard pov stuff, so we can batch this.
                 * string fileName = imageData.FormatFilename( string.Empty );
                 * using( StreamWriter sw = File.CreateText( fileName + ".pov" ) )
                 * {
                 *      sw.WriteLine( "#include \"C:\\Users\\hrn\\Documents\\roice\\povray\\paper\\H3.pov\"" );
                 * }
                 *
                 * bool dummy = true;	// Doesn't matter for Pov-Ray, just Shapeways meshes.
                 * H3.SaveToFile( fileName, edges, dummy, append: true );
                 */
            }
            else
            {
                if (g == Geometry.Spherical)
                {
                    edges = edges.Where(e => e.Start.Valid() && e.End.Valid() && !Infinity.IsInfinite(e.Start) && !Infinity.IsInfinite(e.End)).ToArray();
                    S3.EdgesToStl(edges);
                }
                else
                {
                    throw new System.NotImplementedException();
                }
            }
        }
Beispiel #26
0
 public static S3 NewS3(bool flag, string str, int[] vals)
 {
     S3 str1 = new S3();
     str1.flag = flag;
     str1.str = str;
     str1.vals = vals;
     return str1;
 }
 static extern bool MarshalStructAsParam_AsSeqByVal7(S3 str1);
Beispiel #28
0
        public virtual void Coding()
        {
            #region
            string primer = "";

            primer = S;
            primer = primer.Insert(0, "X").Insert(1, "X");

            Sk     = S;                               // для вывода
            S      = S.Insert(0, "0").Insert(1, "0"); // вставка нулей в 0, 2^0
            NumBit = 2;                               //отсчет начинается с двух, так как первый два бита мы уже добавили

            for (int i = 4, j = 3; i < S.Length; i = (int)Math.Pow(2, j), j++)
            {
                NumBit++;
                S      = S.Insert(i - 1, "0");
                primer = primer.Insert(i - 1, "X");
            }
            listBox1.Items.Add("Кол-во контрольных бит:  " + NumBit);
            listBox1.Items.Add("-----------------------------");
            listBox1.Items.Add("До вычисления самих контрольных бит, мы присвоили им значение ноль : " + S);
            listBox1.Items.Add("-----------------------------");
            listBox1.Items.Add("Х - места куда мы подставляем проверочные биты :  " + primer);
            listBox1.Items.Add("-----------------------------");
            listBox1.Items.Add("         Матрица");

            string[] tem = new string[NumBit];
            int      x   = S.Length;

            //Строим подобие матрицы,зависящее от количества контрольных бит
            // Контрольные биты , которые контролирует другие биты помечаються 1 , которые не контролируються 0
            // Первая строчка  отвечает за 1,3,5,7,9 и так далее бит тоесть через один
            for (int i = 0; i < S.Length / 2; i++)
            {
                S1 += "0";
            }
            for (int i = 0; i < S.Length; i = i + 2)
            {
                S1 = S1.Insert(i, "1");
            }
            listBox1.Items.Add(S1);
            //Если контрольных бит >= 1 то вторая строчка отвечает за 2,3 6,7 тоесть через за 2 через два начиная со 2рого бита
            if (NumBit >= 1)
            {
                for (int i = 0; i < S.Length / 2; i++)
                {
                    S2 += "0";
                }
                for (int i = 1; i < S.Length; i = i + 4)
                {
                    S2 = S2.Insert(i, "11");
                }
                if (S2.Length > S1.Length)
                {
                    S2 = S2.Remove(S2.Length - 1);
                }
                else if (S2.Length < S1.Length)
                {
                    S2 += "0";
                }
                listBox1.Items.Add(S2);
            }
            //Если контрольных бит >= 3 то вторая строчка отвечает за 4.5.6.7 тоесть за 4 бита через 4 бита
            if (NumBit >= 3)         // это костыль костылей :)
            {
                S3 = S;
                S3 = S3.Replace('1', '0');

                for (int i = 3; i < S.Length; i = i + 8)
                {
                    S3 = S3.Insert(i, "1111");
                }
                if (S3.Length > S2.Length)
                {
                    int raznica = S3.Length - S2.Length;
                    S3 = S3.Remove(S3.Length - raznica);
                }
                listBox1.Items.Add(S3);
            }
            // За 8 бит , через 8
            if (NumBit >= 4)         // это костыль костылей :)
            {
                S4 = S;
                S4 = S4.Replace('1', '0');

                for (int i = 7; i < S.Length; i = i + 16)
                {
                    S4 = S4.Insert(i, "11111111");
                }
                if (S4.Length > S3.Length)
                {
                    int raznica = S4.Length - S3.Length;
                    S4 = S4.Remove(S4.Length - raznica);
                }
                listBox1.Items.Add(S4);
            }

            if (NumBit >= 5)         // это костыль костылей :)
            {
                S5 = S;
                S5 = S5.Replace('1', '0');

                for (int i = 15; i < S.Length; i = i + 32)
                {
                    S5 = S5.Insert(i, "1111111111111111");
                }
                if (S5.Length > S4.Length)
                {
                    int raznica = S5.Length - S4.Length;
                    S5 = S5.Remove(S5.Length - raznica);
                }
                listBox1.Items.Add(S5);
            }

            // ---------- Вычисление контрольных бит ----------
            //берём каждый контрольный бит и смотрим сколько среди контролируемых им битов единиц,
            //получаем некоторое целое число и, если оно чётное, то ставим ноль,
            //в противном случае ставим единицу.

            // заносим в масивы числа из строчек
            int[] sBoss = S.Select(ch => int.Parse(ch.ToString())).ToArray();         //массив из целых чисел


            // заносим в масивы числа из строчек
            if (NumBit > 0)
            {
                sBoss1 = S1.Select(ch => int.Parse(ch.ToString())).ToArray();
            }
            if (NumBit >= 1)
            {
                sBoss2 = S2.Select(ch => int.Parse(ch.ToString())).ToArray();
            }
            if (NumBit >= 3)
            {
                sBoss3 = S3.Select(ch => int.Parse(ch.ToString())).ToArray();
            }
            if (NumBit >= 4)
            {
                sBoss4 = S4.Select(ch => int.Parse(ch.ToString())).ToArray();
            }
            if (NumBit >= 5)
            {
                sBoss5 = S5.Select(ch => int.Parse(ch.ToString())).ToArray();
            }

            listBox1.Items.Add("-----------------------------");
            listBox1.Items.Add("       Контрольные биты");

            // читать описание выше что тут происходит
            int temp = 0;
            for (int i = 0; i < S.Length; i++)
            {
                temp += sBoss[i] * sBoss1[i];         //массив с изначальными значениями и массив 1ой строчки в матрице
            }
            if (temp > 1)
            {
                tem[0] = Convert.ToString(temp % 2);
            }
            else
            {
                tem[0] = Convert.ToString(temp);
            }
            listBox1.Items.Add("r1 =  " + tem[0]);       // первый проверочный бит
                                                         //дальше по анологии
            int temp2 = 0;
            if (NumBit >= 1)
            {
                for (int i = 0; i < S.Length; i++)
                {
                    temp2 += sBoss[i] * sBoss2[i];
                }
                if (temp2 > 1)
                {
                    tem[1] = Convert.ToString(temp2 % 2);
                }
                else
                {
                    tem[1] = Convert.ToString(temp2);
                }
                listBox1.Items.Add("r2 =  " + tem[1]);
            }

            int temp3 = 0;
            if (NumBit >= 3)
            {
                for (int i = 0; i < S.Length; i++)
                {
                    temp3 += sBoss[i] * sBoss3[i];
                }
                if (temp3 > 1)
                {
                    tem[2] = Convert.ToString(temp3 % 2);
                }
                else
                {
                    tem[2] = Convert.ToString(temp3);
                }
                listBox1.Items.Add("r3 =  " + tem[2]);
            }

            int temp4 = 0;
            if (NumBit >= 4)
            {
                for (int i = 0; i < S.Length; i++)
                {
                    temp4 += sBoss[i] * sBoss4[i];
                }
                if (temp4 > 1)
                {
                    tem[3] = Convert.ToString(temp4 % 2);
                }
                else
                {
                    tem[3] = Convert.ToString(temp4);
                }
                listBox1.Items.Add("r4 =  " + tem[3]);
            }

            int temp5 = 0;
            if (NumBit >= 5)
            {
                for (int i = 0; i < S.Length; i++)
                {
                    temp5 += sBoss[i] * sBoss5[i];
                }
                if (temp5 > 1)
                {
                    tem[4] = Convert.ToString(temp5 % 2);
                }
                else
                {
                    tem[4] = Convert.ToString(temp5);
                }
                listBox1.Items.Add("r5 =  " + tem[4]);
            }

            //подставляем получиные значения в контрольные биты
            for (int i = 1, j = 1, k = 0; i < Sk.Length; i = (int)Math.Pow(2, j), j++, k++)
            {
                Sk = Sk.Insert(i - 1, tem[k]);
            }
            listBox1.Items.Add("-----------------------------");
            listBox1.Items.Add("Полученная последовательность вычисление контрольных бит");
            listBox1.Items.Add(Sk);
            #endregion
        }
 static extern bool MarshalStructAsParam_AsSeqByRef7(ref S3 str1);
Beispiel #30
0
 public S4(S3 f0) : this()
 {
     F0 = f0;
 }
 static extern bool MarshalStructAsParam_AsSeqByRefOut7(out S3 str1);
Beispiel #32
0
 public IEnumerable <string> ListBuckets()
 {
     return(Enumerable.ToList <string>(S3.ListBuckets().Buckets.Select(bucket => bucket.BucketName)));
 }
Beispiel #33
0
 [MethodImpl(MethodImplOptions.NoInlining)] static void TestS3_2(ref S3 s)
 {
     var _ = s.a2;
 }
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;

            Write("S3 "); S3.ShowOperationTableColored(); WriteLine();

            foreach (var a in S3.Set)
            {
                foreach (var b in S3.Set)
                {
                    WriteLine("{0}{1}{2}{3} -> {4}",
                              S3.Lookup(a),
                              S3.Lookup(b),
                              S3.Lookup(S3.Inverse(a)),
                              S3.Lookup(S3.Inverse(b)),
                              S3.Lookup(S3.Op_(a, b, S3.Inverse(a), S3.Inverse(b))));
                }

                //foreach (var b in S3.Set)
                //{
                //    WriteLine("{5}{6}{5}⁻¹{6}⁻¹ -> {0}{1}{2}{3} -> {4}",
                //        lookup(a),
                //        lookup(b),
                //        lookup(S3.Inverse(a)),
                //        lookup(S3.Inverse(b)),
                //        lookup(S3.Op_(a, b, S3.Inverse(a), S3.Inverse(b))),

                //        lookup(a),
                //        lookup(b));
                //}

                WriteLine();
            }

            WriteLine();

            foreach (var a in S3.Set)
            {
                foreach (var b in S3.Set)
                {
                    Write("{0} ", S3.Lookup(S3.Op_(a, b, S3.Inverse(a), S3.Inverse(b))));
                }

                WriteLine();
            }

            WriteLine();

            void ShowCommutators <T>(Group <T> G)
            {
                WriteLine("commutators:\n");

                var width = G.Set.Select(elt => G.Lookup(elt).Count()).Max();

                var color_thunks = new List <Action>()
                {
                    () => { ForegroundColor = ConsoleColor.White; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Red; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Yellow; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Green; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Blue; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Cyan; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.Magenta; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.DarkRed; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.DarkBlue; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.DarkGreen; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.DarkMagenta; BackgroundColor = ConsoleColor.Black; },
                    () => { ForegroundColor = ConsoleColor.DarkYellow; BackgroundColor = ConsoleColor.Black; }
                };

                void pick_color(T elt)
                {
                    var i = G.Set.ToList().IndexOf(elt);

                    color_thunks[i % color_thunks.Count()]();
                }

                Write("{0}|", "".PadLeft(width));

                foreach (var elt in G.Set)
                {
                    pick_color(elt); Write("{0} ", G.Lookup(elt).PadLeft(width));
                }

                WriteLine();


                color_thunks[0](); WriteLine(new String('-', (G.Set.Count() + 1) * (width + 1)));

                foreach (var x in G.Set)
                {
                    pick_color(x); Write("{0}", G.Lookup(x).PadLeft(width)); color_thunks[0](); Write("|");

                    foreach (var y in G.Set)
                    {
                        // var elt = G.Op(x, y);

                        var elt = G.Op_(x, y, G.Inverse(x), G.Inverse(y));

                        pick_color(elt);

                        Write("{0} ", G.Lookup(elt).PadLeft(width));
                    }

                    WriteLine();
                }

                ForegroundColor = ConsoleColor.White;
                BackgroundColor = ConsoleColor.Black;
            }

            ShowCommutators(S3);

            WriteLine();

            // S3.Commutators -> ε β σ

            var H = S3.Subgroup(new[] { ε, β, σ });

            foreach (var elt in S3.CosetGrouping(H, "H"))
            {
                WriteLine("{0}   {1}",
                          String.Join(" ", elt.Select(item => String.Format("{0} =", item.ToString()))),
                          elt.Key.ConvertAll(S3.Lookup));
            }

            WriteLine();

            Write("S3/H ");

            S3.QuotientGroup(H, "H").ShowOperationTableColored();
        }
        public async void InsertPurchase(object sender, EventArgs e)
        {
            if (!IsFormValid())
            {
                await DisplayAlert("Fehler", "Bitte geben Sie ein Titel und ein gültigen Preis an.", "Ok");

                return;
            }


            // create username list from selected users in collection view CollectionView_purchase_involved_users
            List <String> _usersInvolved = new List <String>();

            foreach (var item in CollectionView_purchase_involved_users.SelectedItems)
            {
                User selectedUser = (User)item;
                _usersInvolved.Add(selectedUser.Name);
            }

            // add payed users to involved
            //if (!_usersInvolved.Contains(((User)Picker_purchase_payed_by.SelectedItem).Name))
            //{
            //    _usersInvolved.Add(((User)Picker_purchase_payed_by.SelectedItem).Name);
            //}

            // add payed users to payed list
            List <string> _usersInvolvedPayed = new List <string>();

            _usersInvolvedPayed.Add(((User)Picker_purchase_payed_by.SelectedItem).Name);

            // get image
            Receipt receipt = new Receipt();

            try
            {
                ImageSource img = Image_purchase_receipt.Source;
                if ((viewModel.ReceiptImageLocalPath != null || viewModel.ReceiptImageLocalPath != "") &&
                    (viewModel.Image_ReceiptImage != null))
                {
                    viewModel.ReceiptImageS3Path = await S3.Upload(viewModel.ReceiptImageLocalPath, viewModel.Image_ReceiptImage.Id.ToString());

                    receipt.ImageUrl = $"{viewModel.ReceiptImageS3Path}";
                }
            }
            catch (Exception)
            {
            }


            Purchase newPurchase = new Purchase()
            {
                Title              = Entry_purchase_title.Text,
                Price              = double.Parse(Entry_purchase_price.Text),
                Date               = DatePicker_purchase_day.Date,
                UserPayed          = ((User)Picker_purchase_payed_by.SelectedItem).Name,
                UsersInvolved      = _usersInvolved,
                UsersInvolvedPayed = _usersInvolvedPayed,
                Receipt            = receipt
            };
            HaushaltsplanerDB db = new HaushaltsplanerDB();

            // sync session with database
            Session.Household = db.Household.FindByHouseholdId(Session.Household.HouseholdId);
            // add new purchase to session
            Session.Household.AddPurchase(newPurchase);
            // update database with session
            db.Household.Update(Session.Household);

            // Send message to Purchase Page
            // updates listview with new purchase
            MessagingCenter.Send(this, "AddPurchase", newPurchase);

            CollectionView_purchase_involved_users.SelectedItem  = null;
            CollectionView_purchase_involved_users.SelectedItems = null;
            Navigation.PopAsync();
        }
Beispiel #36
0
 public S4(S3 s) => _s = s;
Beispiel #37
0
        private static string Edge(Parameters parameters, Geometry g, H3.Cell.Edge edge)
        {
            Vector3D v1 = edge.Start, v2 = edge.End;

            Vector3D[] points = null;
            Func <Vector3D, Sphere> sizeFunc = v => new Sphere()
            {
                Center = v, Radius = H3Models.SizeFuncConst(v, parameters.Scale)
            };

            //double minRad = 0.0005;
            double minRad = 0.0004;

            //double minRad = 0.0017;

            // STL
            //minRad = 0.8 / 100;

            if (parameters.Halfspace)
            {
                //v1 = H3Models.BallToUHS( v1 );
                //v2 = H3Models.BallToUHS( v2 );

                points = H3Models.UHS.GeodesicPoints(v1, v2);
                if (!parameters.ThinEdges)
                {
                    sizeFunc = v =>
                    {
                        // XXX, inexact
                        return(new Sphere()
                        {
                            Center = v, Radius = Math.Max(H3Models.UHS.SizeFunc(v, parameters.AngularThickness), minRad)
                        });
                    }
                }
                ;
            }
            else
            {
                if (g == Geometry.Hyperbolic)
                {
                    points = H3Models.Ball.GeodesicPoints(v1, v2, edge.Color.Z);
                }
                else if (g == Geometry.Spherical)
                {
                    points = S3.GeodesicPoints(v1, v2);
                    //points = points.Select( p => { p.Normalize(); return p; } ).ToArray();
                }
                else
                {
                    //points = new Vector3D[] { v1, v2 };
                    List <Vector3D> interpolated = new List <Vector3D>();
                    int             count        = 20;
                    for (int i = 0; i <= count; i++)
                    {
                        interpolated.Add(v1 + (v2 - v1) * ((double)i / count));
                    }
                    points = interpolated.ToArray();
                }

                if (!parameters.ThinEdges)
                {
                    sizeFunc = v =>
                    {
                        Vector3D c;
                        double   r;
                        H3Models.Ball.DupinCyclideSphere(v, parameters.AngularThickness / 2, g, out c, out r);
                        return(new Sphere()
                        {
                            Center = c, Radius = Math.Max(r, minRad)
                        });
                    }
                }
                ;
            }

            //if( g == Geometry.Euclidean )
            //	return EdgeCylinder( points, sizeFunc );

            return(EdgeSphereSweep(points, sizeFunc, edge.Color));
        }
Beispiel #38
0
 public static string Upload(this S3 s3, byte[] bytes)
 {
     return(Upload(s3, s3.Bucket ?? BucketName, bytes));
 }
Beispiel #39
0
 public static extern void InvokeCallback3(MyCallback3 callback, S3 s);
Beispiel #40
0
 public static string Upload(this S3 s3, Stream stream)
 {
     return(Upload(s3, s3.Bucket, stream, null));
 }
Beispiel #41
0
/* These tests are not working on non Windows CoreCLR.  Enable this when GH Issue #2076 is resolved.
 *
 *      [DllImport("jitstructtests_lib")]
 *      public static extern S28 InvokeCallback28R(MyCallback28 callback, S28 s);
 *
 *      [DllImport("jitstructtests_lib")]
 *      public static extern S29 InvokeCallback29R(MyCallback29 callback, S29 s);
 * Enable this when GH Issue #2076 is resolved. */
        static public int Main1()
        {
            Program3 p  = new Program3();
            S1       s1 = new S1();

            s1.x = 1;
            s1.y = 2;
            s1.z = 3;
            s1.w = 4;

            InvokeCallback1((par) => {
                Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s1);

            S2 s2;

            s2.x = 1;
            s2.y = 2;
            s2.z = 3;
            InvokeCallback2((par) => {
                Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s2);

            S3 s3;

            s3.x = 1;
            s3.y = 2;
            s3.z = 3;
            InvokeCallback3((par) => {
                Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s3);

            S4 s4;

            s4.x = 1;
            s4.y = 2;
            InvokeCallback4((par) => {
                Console.WriteLine("S4: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s4);

            S5 s5;

            s5.x = 1;
            s5.y = 2;
            InvokeCallback5((par) => {
                Console.WriteLine("S5: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s5);

            S6 s6;

            s6.x = 1;
            s6.y = 2;
            s6.z = 3;
            s6.w = 4;
            InvokeCallback6((par) => {
                Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s6);

            S7 s7;

            s7.x = 1;
            s7.y = 2;
            s7.z = 3;
            InvokeCallback7((par) => {
                Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s7);

            S8 s8;

            s8.x = 1;
            s8.y = 2;
            InvokeCallback8((par) => {
                Console.WriteLine("S8: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s8);

            S9 s9;

            s9.x = 1;
            s9.y = 2;
            s9.z = 3;
            s9.w = 4;
            InvokeCallback9((par) => {
                Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s9);

            S10 s10;

            s10.a = 1;
            s10.b = 2;
            s10.c = 3;
            s10.d = 4;
            s10.e = 5;
            s10.f = 6;
            s10.g = 7;
            s10.h = 8;
            InvokeCallback10((par) => {
                Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
                {
                    throw new System.Exception();
                }
            }, s10);

            S11 s11;

            s11.a = 1;
            s11.b = 2;
            s11.c = 3;
            s11.d = 4;
            s11.e = 5;
            InvokeCallback11((par) => {
                Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
                {
                    throw new System.Exception();
                }
            }, s11);

            S12 s12;

            s12.a = 1;
            s12.b = 2;
            s12.c = 3;
            s12.d = 4;
            s12.e = 5;
            s12.f = 6;
            s12.g = 7;
            s12.h = 8;
            s12.i = 9;
            InvokeCallback12((par) => {
                Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
                {
                    throw new System.Exception();
                }
            }, s12);

            S13 s13;

            s13.hasValue = 1;
            s13.x        = 2;
            InvokeCallback13((par) => {
                Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
                if (par.hasValue != 1 || par.x != 2)
                {
                    throw new System.Exception();
                }
            }, s13);

            S14 s14;

            s14.x = 1;
            s14.y = 2;
            InvokeCallback14((par) => {
                Console.WriteLine("S14: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s14);

            S15 s15;

            s15.a = 1;
            s15.b = 2;
            s15.c = 3;
            s15.d = 4;
            s15.e = 5;
            s15.f = 6;
            s15.g = 7;
            s15.h = 8;
            s15.i = 9;
            InvokeCallback15((par) => {
                Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
                {
                    throw new System.Exception();
                }
            }, s15);

            S16 s16;

            s16.x = 1;
            s16.y = 2;
            InvokeCallback16((par) => {
                Console.WriteLine("S16: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s16);

            S17 s17;

            s17.x = 1;
            s17.y = 2;
            InvokeCallback17((par) => {
                Console.WriteLine("S17: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s17);

            S18 s18;

            s18.x = 1;
            s18.y = 2;
            s18.z = 3;
            InvokeCallback18((par) => {
                Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s18);

            S19 s19;

            s19.x = 1;
            s19.y = 2;
            s19.z = 3;
            s19.w = 4;
            InvokeCallback19((par) => {
                Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s19);

            S20 s20;

            s20.x = 1;
            s20.y = 2;
            s20.z = 3;
            s20.w = 4;
            InvokeCallback20((par) => {
                Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s20);

/* These tests are not working on non Windows CoreCLR.  Enable this when GH Issue #2076 is resolved.
 *          TestClass testClass = new TestClass();
 *          S28 s28;
 *          s28.x = null;
 *          s28.y = 1;
 *
 *          InvokeCallback28((par) => {
 *              Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
 *              if (par.x != null || par.y != 1)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s28);
 *
 *          s28.x = testClass;
 *          s28.y = 5;
 *
 *          InvokeCallback28((par) => {
 *              Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
 *              if (par.x != testClass || par.y != 5)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s28);
 *
 *          S29 s29;
 *          s29.x = 1;
 *          s29.y = null;
 *
 *          InvokeCallback29((par) => {
 *              Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
 *              if (par.x != 1 || par.y != null)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s29);
 *
 *          s29.x = 5;
 *          s29.y = testClass;
 *
 *          InvokeCallback29((par) => {
 *              Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
 *              if (par.x != 5 || par.y != testClass)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s29);
 * Enable this when GH Issue #2076 is resolved. */
            S30 s30;

            s30.x = 1;
            s30.y = 2;

            S30 s30_2;

            s30_2.x = 3;
            s30_2.y = 4;

            S30 s30_3;

            s30_3.x = 5;
            s30_3.y = 6;

            // Program p = new Program();
            InvokeCallback30(p.Test30, s30, s30_2, s30_3);
            S1 s1r = InvokeCallback1R((par) => {
                Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s1);

            Console.WriteLine("S1R: {0}, {1}, {2}, {3}", s1r.x, s1r.y, s1r.z, s1r.w);
            if (s1r.x != 1 || s1r.y != 2 || s1r.z != 3 || s1r.w != 4)
            {
                throw new System.Exception();
            }

            S2 s2r = InvokeCallback2R((par) => {
                Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s2);

            Console.WriteLine("S2R: {0}, {1}, {2}", s2r.x, s2r.y, s2r.z);
            if (s2r.x != 1 || s2r.y != 2 || s2r.z != 3)
            {
                throw new System.Exception();
            }

            S3 s3r = InvokeCallback3R((par) => {
                Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s3);

            Console.WriteLine("S3R: {0}, {1}, {2}", s3r.x, s3r.y, s3r.z);
            if (s3r.x != 1 || s3r.y != 2 || s3r.z != 3)
            {
                throw new System.Exception();
            }

            S4 s4r = InvokeCallback4R((par) => {
                Console.WriteLine("S4: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s4);

            Console.WriteLine("S4R: {0}, {1}", s4r.x, s4r.y);
            if (s4r.x != 1 || s4r.y != 2)
            {
                throw new System.Exception();
            }

            S5 s5r = InvokeCallback5R((par) => {
                Console.WriteLine("S5: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s5);

            Console.WriteLine("S5R: {0}, {1}", s5r.x, s5r.y);
            if (s5r.x != 1 || s5r.y != 2)
            {
                throw new System.Exception();
            }

            S6 s6r = InvokeCallback6R((par) => {
                Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s6);

            Console.WriteLine("S6R: {0}, {1}, {2}, {3}", s6r.x, s6r.y, s6r.z, s6r.w);
            if (s6r.x != 1 || s6r.y != 2 || s6r.z != 3 || s6r.w != 4)
            {
                throw new System.Exception();
            }

            S7 s7r = InvokeCallback7R((par) => {
                Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s7);

            Console.WriteLine("S7R: {0}, {1}, {2}", s7r.x, s7r.y, s7r.z);
            if (s7r.x != 1 || s7r.y != 2 || s7r.z != 3)
            {
                throw new System.Exception();
            }

            S8 s8r = InvokeCallback8R((par) => {
                Console.WriteLine("S8: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s8);

            Console.WriteLine("S8R: {0}, {1}", s8r.x, s8r.y);
            if (s8r.x != 1 || s8r.y != 2)
            {
                throw new System.Exception();
            }

            S9 s9r = InvokeCallback9R((par) => {
                Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s9);

            Console.WriteLine("S9R: {0}, {1}, {2}, {3}", s9r.x, s9r.y, s9r.z, s9r.w);
            if (s9r.x != 1 || s9r.y != 2 || s9r.z != 3 || s9r.w != 4)
            {
                throw new System.Exception();
            }

            S10 s10r = InvokeCallback10R((par) => {
                Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
                {
                    throw new System.Exception();
                }
            }, s10);

            Console.WriteLine("S10R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", s10r.a, s10r.b, s10r.c, s10r.d, s10r.e, s10r.f, s10r.g, s10r.h);
            if (s10r.a != 1 || s10r.b != 2 || s10r.c != 3 || s10r.d != 4 ||
                s10r.e != 5 || s10r.f != 6 || s10r.g != 7 || s10r.h != 8)
            {
                throw new System.Exception();
            }

            S11 s11r = InvokeCallback11R((par) => {
                Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
                {
                    throw new System.Exception();
                }
            }, s11);

            Console.WriteLine("S11R: {0}, {1}, {2}, {3}, {4}", s11r.a, s11r.b, s11r.c, s11r.d, s11r.e);
            if (s11r.a != 1 || s11r.b != 2 || s11r.c != 3 || s11r.d != 4 || s11r.e != 5)
            {
                throw new System.Exception();
            }

            S12 s12r = InvokeCallback12R((par) => {
                Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
                {
                    throw new System.Exception();
                }
            }, s12);

            Console.WriteLine("S12R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s12r.a, s12r.b, s12r.c, s12r.d, s12r.e, s12r.f, s12r.g, s12r.h, s12r.i);
            if (s12r.a != 1 || s12r.b != 2 || s12r.c != 3 || s12r.d != 4 ||
                s12r.e != 5 || s12r.f != 6 || s12r.g != 7 || s12r.h != 8 || s12r.i != 9)
            {
                throw new System.Exception();
            }

            S13 s13r = InvokeCallback13R((par) => {
                Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
                if (par.hasValue != 1 || par.x != 2)
                {
                    throw new System.Exception();
                }
            }, s13);

            Console.WriteLine("S13R: {0}, {1}", s13r.hasValue, s13r.x);
            if (s13r.hasValue != 1 || s13r.x != 2)
            {
                throw new System.Exception();
            }

            S14 s14r = InvokeCallback14R((par) => {
                Console.WriteLine("S14: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s14);

            Console.WriteLine("S14R: {0}, {1}", s14r.x, s14r.y);
            if (s14r.x != 1 || s14r.y != 2)
            {
                throw new System.Exception();
            }

            S15 s15r = InvokeCallback15R((par) => {
                Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
                if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
                    par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
                {
                    throw new System.Exception();
                }
            }, s15);

            Console.WriteLine("S15R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s15r.a, s15r.b, s15r.c, s15r.d, s15r.e, s15r.f, s15r.g, s15r.h, s15r.i);
            if (s15r.a != 1 || s15r.b != 2 || s15r.c != 3 || s15r.d != 4 ||
                s15r.e != 5 || s15r.f != 6 || s15r.g != 7 || s15r.h != 8 || s15r.i != 9)
            {
                throw new System.Exception();
            }

            S16 s16r = InvokeCallback16R((par) => {
                Console.WriteLine("S16: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s16);

            Console.WriteLine("S16R: {0}, {1}", s16r.x, s16r.y);
            if (s16r.x != 1 || s16r.y != 2)
            {
                throw new System.Exception();
            }

            S17 s17r = InvokeCallback17R((par) => {
                Console.WriteLine("S17: {0}, {1}", par.x, par.y);
                if (par.x != 1 || par.y != 2)
                {
                    throw new System.Exception();
                }
            }, s17);

            Console.WriteLine("S17R: {0}, {1}", s17r.x, s17r.y);
            if (s17r.x != 1 || s17r.y != 2)
            {
                throw new System.Exception();
            }

            S18 s18r = InvokeCallback18R((par) => {
                Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
                if (par.x != 1 || par.y != 2 || par.z != 3)
                {
                    throw new System.Exception();
                }
            }, s18);

            Console.WriteLine("S18R: {0}, {1}, {2}", s18r.x, s18r.y, s18r.z);
            if (s18r.x != 1 || s18r.y != 2 || s18r.z != 3)
            {
                throw new System.Exception();
            }

            S19 s19r = InvokeCallback19R((par) => {
                Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s19);

            Console.WriteLine("S19R: {0}, {1}, {2}, {3}", s19r.x, s19r.y, s19r.z, s19r.w);
            if (s19r.x != 1 || s19r.y != 2 || s19r.z != 3 || s19r.w != 4)
            {
                throw new System.Exception();
            }

            S20 s20r = InvokeCallback20R((par) => {
                Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
                if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
                {
                    throw new System.Exception();
                }
            }, s20);

            Console.WriteLine("S20R: {0}, {1}, {2}, {3}", s20r.x, s20r.y, s20r.z, s20r.w);
            if (s20r.x != 1 || s20r.y != 2 || s20r.z != 3 || s20r.w != 4)
            {
                throw new System.Exception();
            }

/* These tests are not working on non Windows CoreCLR.  Enable this when GH Issue #2076 is resolved.
 *          s28.x = null;
 *          S28 s28r = InvokeCallback28R((par) => {
 *              Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
 *              if (par.x == null || par.y != 5)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s28);
 *          Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
 *          if (s28r.x == null || s28r.y != 5)
 *          {
 *              throw new System.Exception();
 *          }
 *
 *          s28.x = testClass;
 *          s28.y = 5;
 *
 *          s28r = InvokeCallback28R((par) => {
 *              Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
 *              if (par.x != testClass || par.y != 5)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s28);
 *          Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
 *          if (s28r.x != testClass || s28r.y != 5)
 *          {
 *              throw new System.Exception();
 *          }
 *
 *          s29.y = null;
 *          S29 s29r = InvokeCallback29R((par) => {
 *              Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
 *              if (par.x != 5 || par.y == null)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s29);
 *          Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
 *          if (s29r.x != 5 || s29r.y == null)
 *          {
 *              throw new System.Exception();
 *          }
 *
 *          s29.x = 5;
 *          s29.y = testClass;
 *          s29r = InvokeCallback29R((par) => {
 *              Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
 *              if (par.x != 5 || par.y != testClass)
 *              {
 *                  throw new System.Exception();
 *              }
 *          }, s29);
 *          Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
 *          if (s29r.x != 5 || s29r.y != testClass)
 *          {
 *              throw new System.Exception();
 *          }
 * Enable this when GH Issue #2076 is resolved. */
            return(100);
        }
Beispiel #42
0
    static C2[] M18(int[] arg0, C0 arg1)
    {
        if (false)
        {
            s_2.F0.F7 = s_3.F0.F7;
            {
                ushort[] var0 = new ushort[] { 1, 1, 3280, 31231, 0 };
                s_7.F0.F9 = 254;
            }
        }
        else
        {
            M19(new S1(new S0(1L, 31052, new C0(32767, 8689794931907939077UL, 0UL, -1471088852, 'b', 2, 7884328208457578018UL, 65535, 4462759410735541703UL, 1)), 33523, -22431, 'f', 32767, 1, 18446744073709551614UL, 19641, 1L));
            if (true != false)
            {
                M20();
                s_7.F0.F5 = (sbyte)(0 - s_5);
                S3 var1 = new S3(312241514U, 'd');
            }

            {
                {
                    if (false)
                    {
                        s_7.F1 = s_7.F1;
                    }

                    if (M20())
                    {
                        s_4 = 2936004801U;
                        M20();
                    }
                    else
                    {
                        if (true)
                        {
                            s_2.F0.F9 = s_3.F0.F9;
                            s_7.F0.F6 = s_3.F0.F1;
                        }

                        s_2.F0.F1 <<= s_7.F0.F3;
                    }
                }
            }

            C0 var2 = new C0(3091, 9312669472752188759UL, 0UL, -120687945, 'k', -99, 10869481355052590375UL, 16606, 0UL, 0);
            if (s_5 == s_2.F1)
            {
                S0 var3 = new S0(0L, 1, new C0(19763, 18446744073709551615UL, 1UL, -1112437058, ')', 1, 0UL, 59794, 11316827099246307445UL, 254));
            }

            ++var2.F0;
            if (false)
            {
                arg1.F2 = var2.F1;
                M21();
                s_2.F0.F7 = arg1.F7;
                s_3.F0.F6 = var2.F8;
            }

            {
                if (true)
                {
                    int var4 = var2.F3;
                }
                else
                {
                    s_6[0] = s_2.F0.F9;
                    if (M20())
                    {
                        s_3 = s_2;
                        {
                            sbyte var5 = (sbyte)(s_7.F1 - arg1.F7);
                        }

                        uint[] var6 = new uint[] { 532659772U, 793830358U, 1421280132U };
                        if (false)
                        {
                            M20();
                            s_9 = s_9;
                        }
                        else
                        {
                            M20();
                            char[] var7 = new char[] { 'r', 'p' };
                        }

                        var2 = s_7.F0;
                        if (false)
                        {
                            s_3.F0.F7 = 0;
                        }
                        else
                        {
                            s_9.F3 = s_3.F0.F3;
                            if (M20())
                            {
                                C0 var8 = var2;
                            }
                            else
                            {
                                var2.F0 = arg1.F0;
                                arg1.F2 = 18425111865219931067UL;
                            }
                        }
                    }
                    else
                    {
                        s_3.F0.F6 = s_7.F0.F2;
                        M21();
                        arg1.F2 = 18446744073709551614UL;
                    }

                    bool var9 = false;
                    s_3.F0 = arg1;
                }

                s_3.F0.F2 = s_3.F0.F1;
                arg1.F8   = 10UL;
            }
        }

        {
            s_7.F0.F6 = s_2.F0.F1;
            s_3.F1    = s_3.F1;
            C2 var10 = s_9;
            arg1.F2 = s_3.F0.F1;
            if (false)
            {
                s_2     = s_2;
                arg1.F9 = s_9.F0;
                long var11 = s_5;
                s_3 = new C1(new C0(7691, 0UL, 0UL, -673665955, '`', 127, 18446744073709551614UL, 1, 18446744073709551615UL, 44), 1U, 'U');
            }
            else
            {
                s_9.F4 = (char)(1 | s_3.F0.F4);
                M19(new S1(new S0(1363662326421710951L, 1, new C0(-32768, 0UL, 2279838957909634204UL, 0, ',', -27, 16041583023307330818UL, 43117, 13570045561281923782UL, 64)), 0, 0, ';', -8621, 2147483646, 0UL, 24258, 0L));
                char var12 = s_2.F2;
                s_2.F0.F9 = s_7.F0.F9;
                {
                    s_9.F1    = 'H';
                    s_3.F0.F6 = 15100661097371994958UL;
                    M21();
                }

                var10.F2 = s_9.F3;
            }

            s_3.F0 = new C0(-23269, 12017284153806925872UL, 18446744073709551614UL, 1445863592, 'K', 0, 10875902746159351983UL, 23297, 1UL, 106);
            M19(new S1(new S0(-2L, 36017, new C0(1, 0UL, 1UL, -2, 'M', 30, 4876203557431311804UL, 65534, 10304610685074071783UL, 1)), 46240, -28870, 'b', 0, -1907704643, 1UL, 16572, 3647622028936790053L));
            s_2.F0.F1 = s_7.F0.F1;
        }

        return(new C2[] { new C2(232, 'E', -2147483648, 1655557545, '$'), new C2(236, '*', 1656576560, -431774528, '9'), new C2(255, '-', 2, 2049595995, '3') });
    }
 public override void Start()
 {
     lock (_locker)
     {
         _s3 = new S3(_accessKey, _secretKey);
         base.Start();
     }
 }
Beispiel #44
0
 public LinkInfo(string bucketName, string key, string region)
 {
     if (bucketName == null) throw new ArgumentNullException("bucketName");
     if (key == null) throw new ArgumentNullException("key");
     if (String.IsNullOrEmpty(region))
     {
         region = null;
     }
     s3 = new S3(bucketName, key, region);
 }
Beispiel #45
0
    static S2[] M1()
    {
        long var0 = 9223372036854775806L;

        if ((ulong)(1 * (sbyte)(4881041256388805757UL * (uint)(-652771952257756382L & (byte)(-117 / (sbyte)((sbyte)(32539 & (ulong)((sbyte)('6' % (int)((2120 % (byte)((byte)(-1425092406 / (short)((short)(0 ^ M2(0UL)) | 1)) | 1)) | 1)) + 125)) | 1))))) >= (byte)M2(3105710406803882997UL))
        {
            {
                if (true)
                {
                    var0--;
                }

                {
                    var0 = var0;
                }

                if (false)
                {
                    var0 = -9223372036854775808L;
                    ++var0;
                }
                else
                {
                    if (true)
                    {
                        var0 = 8412910432672057470L;
                    }
                }

                if (false)
                {
                    if (true)
                    {
                        M3('\\');
                    }
                    else
                    {
                        var0 ^= var0;
                    }

                    var0 = var0;
                    M4();
                    S2[] var1 = M5();
                    s_1.F7 = -25149;
                    s_1.F6 = var1[0].F1.F4.F6;
                }

                if (true)
                {
                    M3((char)M2(10UL));
                    s_1.F3 = 9223372036854775807L;
                    if (true)
                    {
                        M5();
                    }

                    s_1.F0 = s_1.F0++;
                    var0   = var0;
                }
                else
                {
                    s_1.F0 = s_1.F0;
                    if (false)
                    {
                        s_1.F1 = (ushort)M4();
                        s_1.F1 = s_1.F1;
                        s_2    = new S3(s_2.F1, 1UL, s_2.F7.F4.F1, s_2.F7.F4.F5++, s_2.F7.F4.F7, s_2.F5++, s_2.F1, s_2.F7, s_1.F0++);
                        uint var2 = 1U;
                        s_2.F4       = M4();
                        s_2.F7.F4.F4 = -115;
                    }

                    M2(s_2.F6);
                    s_2.F2 = (ushort)(s_2.F7.F4.F4 | s_2.F7.F4.F2);
                }

                s_2.F6 = 0UL;
                M5();
                if (false || s_2.F7.F5)
                {
                    s_1.F5 = (uint)M4();
                }
                else
                {
                    sbyte var3 = (sbyte)M2((ulong)M3('9'));
                    s_2.F7.F4.F2 = -76;
                    {
                        s_2.F7.F4.F7 -= -14511;
                        s_2.F0        = (ulong)(s_2.F7.F4.F5 ^ s_2.F4);
                        ushort var4 = s_2.F7.F4.F1--;
                    }

                    s_2.F7 = s_2.F7;
                    --s_2.F7.F2;
                    if (s_2.F7.F5)
                    {
                        if (true)
                        {
                            s_1.F6 = s_2.F7.F4.F5;
                            M2(s_2.F0);
                            s_2.F7.F4.F3 ^= var0;
                            long var5 = s_2.F7.F3--;
                            s_2.F6 = s_2.F1;
                        }
                        else
                        {
                            s_2.F7.F1 /= (sbyte)(s_1.F2 | 1);
                        }

                        s_2.F7.F4.F6 = s_2.F3;
                        s_2.F8       = s_1.F0;
                    }
                    else
                    {
                        S1 var6 = new S1(1, -32768, false);
                    }

                    if (true)
                    {
                        M2((ulong)M3(s_2.F7.F6--));
                        s_2.F5 = s_2.F5;
                    }
                    else
                    {
                        M4();
                    }
                }

                if (false)
                {
                    {
                        s_3 ^= true;
                        --s_1.F6;
                    }

                    if (s_2.F7.F5 == s_2.F7.F5)
                    {
                        s_2    = s_2;
                        s_4    = s_2.F7.F3;
                        s_1.F0 = s_2.F8;
                    }

                    s_2.F7.F4.F3 = -9223372036854775808L;
                    s_5          = s_5;
                }

                {
                    s_5.F1.F4.F7 = s_1.F7;
                }
            }
        }
        else
        {
            s_5.F1.F4.F6 = 4294967294U;
            s_2.F7.F5    = s_2.F7.F5;
        }

        return(new S2[] { new S2(-15362, new S0(10L, 1, 1120596581864683771UL, 1680261055609308325L, new C0(0, 2, -54, -9223372036854775807L, -89, 1U, 3233216608U, 0), false, 'p'), new S1(68, 26113, false), 1U), new S2(-9574, new S0(7281418493759100199L, -76, 4253162082827946584UL, 0L, new C0(2147483646, 46219, -128, 1L, 10, 4178136832U, 1983514074U, 32767), true, 'm'), new S1(1, 2872, false), 2932506632U), new S2(32767, new S0(-9223372036854775808L, -54, 3749194867443705826UL, 5527379121696930330L, new C0(0, 3256, 101, 9009839897718980696L, -54, 10U, 10U, -23927), true, 'X'), new S1(19, 32767, false), 2790814108U), new S2(28003, new S0(4285518269053901222L, 126, 18446744073709551615UL, 0L, new C0(1, 65534, -127, 3752779421837877913L, 63, 2899631950U, 4075983233U, 23974), false, ';'), new S1(221, 0, true), 3399407913U), new S2(1, new S0(-9223372036854775808L, 65, 1UL, -10L, new C0(-521919876, 0, 50, -5229545954764276630L, 1, 1007418458U, 4294967294U, 2103), true, 'w'), new S1(102, -24412, false), 2732496105U), new S2(0, new S0(-6342780279217139084L, 0, 15974841648307346826UL, 819988354701414220L, new C0(-2057545315, 1, -106, 7369172328001586383L, 0, 4294967295U, 1251133022U, 1), true, 'B'), new S1(10, 1, false), 0U), new S2(1, new S0(-10L, 1, 0UL, -1279973530256724405L, new C0(1, 0, 1, 5418060812524529618L, -22, 1U, 2U, 32767), false, '\''), new S1(92, -13563, false), 3143028206U), new S2(10053, new S0(6617394084142883900L, 0, 1UL, 1500461592417180798L, new C0(1, 9664, -2, -1728415248964552926L, -43, 2262505058U, 2841916827U, 32766), false, 't'), new S1(180, 32766, true), 4294967295U) });
    }
Beispiel #46
0
 public static void PrintS3(S3 str1, string name)
 {
     Console.WriteLine("\t{0}.flag = {1}", name, str1.flag);
     Console.WriteLine("\t{0}.flag = {1}", name, str1.str);
     for (int i = 0; i < str1.vals.Length; i++)
     {
         Console.WriteLine("\t{0}.vals[{1}] = {2}", name, i, str1.vals[i]);
     }
 }
Beispiel #47
0
        public static void Main(string[] args)
        {
            string reportType = ParseStringArg(args, "/type");

            List <string> filePathsList            = new List <string>();
            StringBuilder sbDeletedDataSourcesInfo = new StringBuilder();

            switch (reportType)
            {
            case "listing":
                StartListingReport(ref filePathsList);
                break;

            case "roster":
                StartRosterReport(ref filePathsList);
                break;

            case "rdclisting":
                StartRDCListingReport(ref filePathsList, ref sbDeletedDataSourcesInfo);
                break;

            case "rdcaotherlisting":
                StartRDCOtherListingReport(ref filePathsList, ref sbDeletedDataSourcesInfo);
                break;

            case "rdcroster":
                StartRDCRosterReport(ref filePathsList, ref sbDeletedDataSourcesInfo);
                break;

            case "rdcnontcslisting":
                StartRDCNonTCSListingReport(ref filePathsList);
                break;

            case "rdcnontcsroster":
                StartRDCNonTCSRosterReport(ref filePathsList);
                break;

            case "openhouse":
                StartOpenHouseReport(ref filePathsList, ref sbDeletedDataSourcesInfo);
                break;

            default:
                StartListingReport(ref filePathsList);
                break;
            }

            if (filePathsList.Count > 0)
            {
                //create aws object
                S3 s3 = new S3(accessKey, secretAccessKey, serviceUrl);

                foreach (var filePath in filePathsList)
                {
                    Console.WriteLine("Uploading the file {0}", filePath);
                    string newFileName = Path.GetFileName(filePath);
                    // Create new FileInfo object and get the Length.
                    FileInfo fInfo = new FileInfo(filePath);
                    if (fInfo.Length < 500)
                    {
                        Decimal fileSize = fInfo.Length;
                        SendEmail(SUBJECT2, String.Format("<h1>Notification Email</h1> <p>This <b>{0}</b> file report of {1:##.##} bytes length must be empty and will not be loaded in S3 bucket until it has been fixed.</p>", newFileName, fileSize), MailFrom, MailTo, MailCC);
                        break;
                    }
                    s3.UploadFile(filePath, s3Bucket, newFileName, false);
                }
            }

            // notify for deleted data sources
            if (!string.IsNullOrWhiteSpace(sbDeletedDataSourcesInfo.ToString()))
            {
                SendEmail(SUBJECT1, sbDeletedDataSourcesInfo.ToString(), MailFrom, MailTo, MailCC, BODYHEADER, TABLEHEADER, TABLEFOOTER);
            }

            //clean up the logs
            //Array.ForEach(Directory.GetDirectories(string.Format(@"{0}\SpeedUp\", ConfigurationManager.AppSettings["Drive"])), delegate(string path) { Array.ForEach(Directory.GetFiles(path), delegate(string pathFile) { try { File.Delete(pathFile); } catch {}  }); });
        }
Beispiel #48
0
 public static extern S3 InvokeCallback3R(MyCallback3 callback, S3 s);
Beispiel #49
0
        private void rbtnsave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataTable dtg1 = RCS.Toggle();
                DataTable DT21 = RCS.roomno();
                if (S1 != null)
                {
                    string X = S1.ToString();
                    X1 = X.Split(',');
                }
                else
                {
                }
                if (S2 != null)
                {
                    string W = S2.ToString();
                    W1 = W.Split(',');
                }
                else
                {
                }
                if (S3 != null)
                {
                    string Y = S3.ToString();
                    Y1 = Y.Split(',');
                }
                else
                {
                }
                if (S4 != null)
                {
                    string U = S4.ToString();
                    U1 = U.Split(',');
                }
                else
                {
                }

                string N = String.Concat(S1 + ',' + S3);
                N1 = N.Split(',');
                Array.Sort(N1);

                DataTable dtt = new DataTable();
                dtt.Columns.Add("mycol");
                if (N1 != null)
                {
                    foreach (string val in N1)
                    {
                        dtt.Rows.Add(val);
                    }
                }
                else
                {
                }
                R = 0;
                if (rbtnsave.Content.ToString() == "Save")
                {
                    for (int i = 0; i < DT21.Rows.Count; i++)
                    {
                        for (int j = 0; j < N1.Length; j++)
                        {
                            RCS.ROOM_NO = DT21.Rows[i]["ROOM_NO"].ToString();
                            bool exists1 = dtt.Select().ToList().Exists(row => row["mycol"].ToString().ToUpper() == RCS.ROOM_NO);
                            if (exists1 == true)
                            {
                                RCS.STATUS = "1";
                            }
                            else
                            {
                                RCS.STATUS = "0";
                            }
                            RCS.INSERT();
                            i++;
                        }
                        T = i--;
                        for (int k = T; k < DT21.Rows.Count; k++)
                        {
                            RCS.ROOM_NO = DT21.Rows[k]["ROOM_NO"].ToString();
                            bool exists = dtt.Select().ToList().Exists(row => row["mycol"].ToString().ToUpper() == RCS.ROOM_NO);
                            if (exists == true)
                            {
                                RCS.STATUS = "1";
                            }
                            else
                            {
                                RCS.STATUS = "0";
                            }
                            RCS.INSERT();
                        }
                        break;
                    }
                    MessageBox.Show("Inserted successfully");
                }
                else
                {
                    if (S1 != null)
                    {
                        for (int i = 0; i < X1.Length; i++)
                        {
                            rcs1.rm = X1[i];
                            RCS.UPDATE();
                            RCS.UPDATEHOME();
                        }
                    }
                    else
                    {
                    }
                    if (S2 != null)
                    {
                        for (int j = 0; j < W1.Length; j++)
                        {
                            rcs1.rmm = W1[j];
                            RCS.UPDATE0();
                            RCS.UPDATEBLUE();
                        }
                    }
                    if (S4 != null)
                    {
                        for (int k = 0; k < U1.Length; k++)
                        {
                            rcs1.ru  = U1[k];
                            rcs1.STS = "0";
                            RCS.INSERTU();
                        }
                    }
                    MessageBox.Show("Updated successfully");
                    S1 = S2 = S4 = null;
                }
            }
            catch (Exception) { }
        }