public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider) { Bx.Configure(serviceProvider); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHsts(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseSession(); app.UseAuthentication(); app.UseSignalR(routes => { routes.MapHub <BlockchainHub>("/blockchainhub"); }); app.UseMvc(routes => { routes.MapRoute("default", "{controller=connection}/{action=connect}"); }); serviceProvider.RegisterEntity <NexusNodeEndpoint>(); serviceProvider.RegisterEntity <Asset>(); serviceProvider.RegisterEntity <Token>(); }
public static int Main() { B b = new B(); b.TestB(); if (b.a != 2) { return(1); } Bx bx = new Bx(); bx.A(); if (b.a != 2) { return(2); } bx.B(); Console.WriteLine("a=" + bx.a); if (bx.a != 4) { return(3); } return(0); }
public void clear() { Bx.fromInt(0L); X.fromInt(0L); Y.fromInt(0L); Z.fromInt(0L); T.fromInt(0L); }
public static int Main() { // Would like to be able to late devirtualize the call to F // here after inlining Get exposes the exact type of the // object, but since the return type of Get is a (shared) // interface type, we need the exact context for F to do so // safely. // // Unfortunately we lose track of that context, because when // we import the call to F, it is not an inline candidate. string s = new Bx().Get().F(); return((int)s[0] + 32); }
public static int Main () { B b = new B (); b.TestB (); if (b.a != 2) return 1; Bx bx = new Bx (); bx.A (); if (b.a != 2) return 2; bx.B (); Console.WriteLine ("a="+bx.a); if (bx.a != 4) return 3; return 0; }
public static void Main(string[] args) { BuildWebHost(args).Build().Run(); Bx.Start(); }
public void ConfigureServices(IServiceCollection services) { Bx.ConfigureServices <DotNexusApp>(services); services.AddDistributedMemoryCache(); services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => { options.ExpireTimeSpan = TimeSpan.FromMinutes(10); options.LoginPath = "/"; options.LogoutPath = "/"; options.Cookie.HttpOnly = true; options.Cookie.SameSite = SameSiteMode.Strict; options.Cookie.Name = ".DotNexus.App.Auth"; }); services.AddSession(options => { options.IdleTimeout = TimeSpan.FromMinutes(10); options.Cookie.HttpOnly = true; options.Cookie.IsEssential = true; options.Cookie.SameSite = SameSiteMode.Strict; options.Cookie.Name = ".DotNexus.App.Session"; }); services.AddSingleton(x => { var config = x.GetService <CookieConfig>(); return(new CookieConstants { GenesisIdKey = config.GenesisIdKey, NodeAuthClaimResult = config.NodeAuthClaimResult, NodeAuthClaimType = config.NodeAuthClaimType, SessionIdKey = config.SessionIdKey, UsernameKey = config.UsernameKey, NodeIdClaimType = config.NodeIdClaimType }); }); services.AddMvc(); //services.AddSingleton<NexusNodeEndpoint>(new NexusNodeEndpoint //{ // Url = "http://serves:8080/;", // Username = "******", // Password = "******", // ApiSessions = true, // IndexHeight = true //}); // Factorys services.AddTransient <INexusServiceFactory, NexusServiceFactory>(); services.AddTransient <IJobFactory, JobFactory>(); // Connection services.AddHttpClient <INexusClient, NexusClient>(); services.AddTransient <NexusNode>(); services.AddTransient <INodeManager, NodeManager>(); services.AddTransient <IUserManager, UserManager>(); // Repositories services.AddTransient <INexusEndpointRepository, NexusEndpointRepository>(); services.AddTransient <IRepository <NexusNodeEndpoint>, Repository <NexusNodeEndpoint> >(); services.AddTransient <IRepository <Asset>, Repository <Asset> >(); services.AddTransient <IRepository <Token>, Repository <Token> >(); // Hubs services.AddSingleton <BlockhainHubMessenger>(); #if DEBUG services.AddSignalR(o => { o.EnableDetailedErrors = true; }); #else services.AddSignalR(); #endif }
public void swap() { Bx.fromLocation(X); X.fromLocation(Y); Y.fromLocation(Bx); }
public void storeBx() { Bx.fromLocation(X); }
public void decode() { /*************************** SPECIAL CASES ****************************/ // SWI CASE if (Extras.isSWIInstruction(currentInstruction)) { return; } // MUL CASE if (Extras.isMulInstruction(currentInstruction)) { mul_instruct = new Mul(memory, registers, currentInstruction, currentInstAddress); mul_instruct.decodeMul(); return; } // BX CASE if (Extras.isBX(currentInstruction)) { bx_instruct = new Bx(memory, registers, currentInstruction, currentInstAddress); bx_instruct.decodeBx(); return; } /*************************** NORMAL CASES ******************************/ // get instruction type currentInstructionType = Extras.getNormalInstructionType(currentInstruction); // NORMAL CASES: create an instruction according to its type // and decode the instruction switch (currentInstructionType) { case 0: // if Data Processing (00x) case 1: // if Data Processing (00x) data_processing_instruct = new DataProcessing(memory, registers, currentInstruction, currentInstAddress); data_processing_instruct.decodeDP(); break; case 2: // if Load/Store (01x) case 3: // if Load/Store (01x) load_store_instruct = new LoadAndStore(memory, registers, currentInstruction, currentInstAddress); load_store_instruct.decodeLaS(); break; case 4: // if Load/Store (100) Load/Store Multiple FD variant load_store_mul_instruct = new LoadAndStoreMul(memory, registers, currentInstruction, currentInstAddress); load_store_mul_instruct.decodeLaSMul(); break; case 5: // if Branch (101) branch_instruct = new Branch(memory, registers, currentInstruction, currentInstAddress); branch_instruct.decodeB(); break; default: instDisLst.Add("Special Instruction"); Debug.WriteLine("ERROR in CPU.execute(): Type is Special or Non-valid instruction."); Debug.WriteLine("ERROR in CPU.decode(): Type is Special or Non-valid instruction."); break; } }