#Build: Synplify Pro J-2015.03M-SP1-2, Build 266R, Dec 14 2015 #install: C:\Microsemi\Libero_SoC_v11.7\Synplify #OS: Windows 8 6.2 #Hostname: DESKTOP-B8QPEOE #Implementation: synthesis Synopsys HDL Compiler, version comp201503sp1p1, Build 240R, built Dec 1 2015 @N: : | Running in 64-bit mode Copyright (C) 1994-2015 Synopsys, Inc. This software and the associated documentation are proprietary to Synopsys, Inc. This software may only be used in accordance with the terms and conditions of a written license agreement with Synopsys, Inc. All other use, reproduction, or distribution of this software is strictly prohibited. Synopsys VHDL Compiler, version comp201503sp1p1, Build 240R, built Dec 1 2015 @N: : | Running in 64-bit mode Copyright (C) 1994-2015 Synopsys, Inc. This software and the associated documentation are proprietary to Synopsys, Inc. This software may only be used in accordance with the terms and conditions of a written license agreement with Synopsys, Inc. All other use, reproduction, or distribution of this software is strictly prohibited. @N:CD720 : std.vhd(146) | Setting time resolution to ns @N: : Top.vhd(20) | Top entity is set to Top. VHDL syntax check successful! @N:CD231 : std1164.vhd(890) | Using onehot encoding for type mvl9plus ('U'="1000000000") @N:CD630 : Top.vhd(20) | Synthesizing work.top.rtl @N:CD630 : spi_slave.vhd(145) | Synthesizing work.spi_slave.rtl @W:CD604 : spi_slave.vhd(427) | OTHERS clause is not synthesized Post processing for work.spi_slave.rtl @N:CD630 : RAM.vhd(8) | Synthesizing work.ram.def_arch @N:CD630 : igloo.vhd(2967) | Synthesizing igloo.ram512x18.syn_black_box Post processing for igloo.ram512x18.syn_black_box @N:CD630 : igloo.vhd(2722) | Synthesizing igloo.vcc.syn_black_box Post processing for igloo.vcc.syn_black_box @N:CD630 : igloo.vhd(1787) | Synthesizing igloo.gnd.syn_black_box Post processing for igloo.gnd.syn_black_box @N:CD630 : igloo.vhd(1996) | Synthesizing igloo.mx2.syn_black_box Post processing for igloo.mx2.syn_black_box @N:CD630 : igloo.vhd(1934) | Synthesizing igloo.inv.syn_black_box Post processing for igloo.inv.syn_black_box @N:CD630 : igloo.vhd(1379) | Synthesizing igloo.dfn1.syn_black_box Post processing for igloo.dfn1.syn_black_box @N:CD630 : igloo.vhd(2198) | Synthesizing igloo.or2.syn_black_box Post processing for igloo.or2.syn_black_box @N:CD630 : igloo.vhd(2852) | Synthesizing igloo.buff.syn_black_box Post processing for igloo.buff.syn_black_box @N:CD630 : igloo.vhd(1472) | Synthesizing igloo.dfn1e1c0.syn_black_box Post processing for igloo.dfn1e1c0.syn_black_box @N:CD630 : igloo.vhd(2206) | Synthesizing igloo.or2a.syn_black_box Post processing for igloo.or2a.syn_black_box Post processing for work.ram.def_arch @W:CL168 : RAM.vhd(432) | Pruning instance MX2_12 -- not in use ... @W:CL168 : RAM.vhd(420) | Pruning instance MX2_14 -- not in use ... @W:CL168 : RAM.vhd(416) | Pruning instance MX2_1 -- not in use ... @W:CL168 : RAM.vhd(405) | Pruning instance MX2_13 -- not in use ... @W:CL168 : RAM.vhd(401) | Pruning instance MX2_7 -- not in use ... @W:CL168 : RAM.vhd(393) | Pruning instance MX2_2 -- not in use ... @W:CL168 : RAM.vhd(381) | Pruning instance READEN_BFF1[1] -- not in use ... @W:CL168 : RAM.vhd(373) | Pruning instance MX2_8 -- not in use ... @W:CL168 : RAM.vhd(369) | Pruning instance MX2_15 -- not in use ... @W:CL168 : RAM.vhd(357) | Pruning instance MX2_5 -- not in use ... @W:CL168 : RAM.vhd(337) | Pruning instance MX2_4 -- not in use ... @W:CL168 : RAM.vhd(329) | Pruning instance AFF1[0] -- not in use ... @W:CL168 : RAM.vhd(296) | Pruning instance MX2_10 -- not in use ... @W:CL168 : RAM.vhd(288) | Pruning instance MX2_3 -- not in use ... @W:CL168 : RAM.vhd(281) | Pruning instance ORA_READ_EN_GATE[0] -- not in use ... @W:CL168 : RAM.vhd(270) | Pruning instance ORA_READ_EN_GATE[1] -- not in use ... @W:CL168 : RAM.vhd(266) | Pruning instance ORB_READ_EN_GATE[1] -- not in use ... @W:CL168 : RAM.vhd(229) | Pruning instance MX2_6 -- not in use ... @W:CL168 : RAM.vhd(221) | Pruning instance MX2_11 -- not in use ... @W:CL168 : RAM.vhd(209) | Pruning instance MX2_0 -- not in use ... @W:CL168 : RAM.vhd(206) | Pruning instance BUFF_1 -- not in use ... @W:CL168 : RAM.vhd(202) | Pruning instance MX2_9 -- not in use ... @W:CL168 : RAM.vhd(187) | Pruning instance BUFF_3 -- not in use ... @N:CD630 : Modulator.vhd(9) | Synthesizing work.modulator.architecture_modulator Post processing for work.modulator.architecture_modulator @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal mod_addr[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal bit_idx[3:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal sig_o -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal packet_cntr[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timB_rld[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timB_mch[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal ppm_slot_idx[7:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timA_ctr[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timA_ms_ctr[14:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal recv_addr[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timA_mod_ms -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_6[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_5[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_4[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_3[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_2[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_1[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal registers_0[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timB_ctr[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal timA_rld[15:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal ctrl_reg[3:0] -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @A:CL282 : Modulator.vhd(90) | Feedback mux created for signal spi_dvld_handled -- possible set/reset assignment for signal missing. Specifying a reset value will improve timing and area. @N:CD630 : igloo.vhd(13) | Synthesizing igloo.and2.syn_black_box Post processing for igloo.and2.syn_black_box Post processing for work.top.rtl At c_vhdl Exit (Real Time elapsed 0h:00m:01s; CPU Time elapsed 0h:00m:01s; Memory used current: 83MB peak: 94MB) Process took 0h:00m:01s realtime, 0h:00m:01s cputime # Fri Nov 11 11:40:55 2016 ###########################################################] Synopsys Netlist Linker, version comp201503sp1p1, Build 240R, built Dec 1 2015 @N: : | Running in 64-bit mode At syn_nfilter Exit (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 68MB peak: 69MB) Process took 0h:00m:01s realtime, 0h:00m:01s cputime # Fri Nov 11 11:40:55 2016 ###########################################################] @END At c_hdl Exit (Real Time elapsed 0h:00m:01s; CPU Time elapsed 0h:00m:01s; Memory used current: 3MB peak: 4MB) Process took 0h:00m:01s realtime, 0h:00m:01s cputime # Fri Nov 11 11:40:55 2016 ###########################################################] Synopsys Netlist Linker, version comp201503sp1p1, Build 240R, built Dec 1 2015 @N: : | Running in 64-bit mode At syn_nfilter Exit (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 68MB peak: 69MB) Process took 0h:00m:01s realtime, 0h:00m:01s cputime # Fri Nov 11 11:40:56 2016 ###########################################################] Pre-mapping Report Synopsys Microsemi Technology Pre-mapping, Version mapact, Build 1659R, Built Dec 10 2015 09:42:41 Copyright (C) 1994-2015, Synopsys, Inc. This software and the associated documentation are proprietary to Synopsys, Inc. This software may only be used in accordance with the terms and conditions of a written license agreement with Synopsys, Inc. All other use, reproduction, or distribution of this software is strictly prohibited. Product Version J-2015.03M-SP1-2 Mapper Startup Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 99MB peak: 99MB) Linked File: Top_scck.rpt Printing clock summary report in "C:\Users\Abdullah\Projects\FPGA\Workplace\ModBulb_modulation_FPGA\synthesis\Top_scck.rpt" file @N:MF248 : | Running in 64-bit mode. @N:MF667 : | Clock conversion disabled Design Input Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 101MB peak: 103MB) Mapper Initialization Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 101MB peak: 103MB) @N:BN362 : spi_slave.vhd(237) | Removing sequential instance di_req_o_reg of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @N:BN362 : spi_slave.vhd(236) | Removing sequential instance di_req_o_D of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @N:BN362 : spi_slave.vhd(235) | Removing sequential instance di_req_o_C of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @N:BN362 : spi_slave.vhd(234) | Removing sequential instance di_req_o_B of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @N:BN362 : spi_slave.vhd(231) | Removing sequential instance di_req_o_A of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @N:BN362 : spi_slave.vhd(221) | Removing sequential instance di_req_reg of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs Finished netlist restructuring (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 108MB peak: 110MB) @S |Clock Summary ***************** Start Requested Requested Clock Clock Clock Frequency Period Type Group ------------------------------------------------------------------------------ Top|CLK 20.0 MHz 50.000 inferred Inferred_clkgroup_0 Top|spi_sck_i 20.0 MHz 50.000 inferred Inferred_clkgroup_1 ============================================================================== @W:MT530 : modulator.vhd(90) | Found inferred clock Top|CLK which controls 307 sequential elements including Modulator_0.bit_idx[3:0]. This clock has no specified timing constraint which may adversely impact design performance. @W:MT530 : spi_slave.vhd(331) | Found inferred clock Top|spi_sck_i which controls 41 sequential elements including spi_slave_0.do_buffer_reg[15:0]. This clock has no specified timing constraint which may adversely impact design performance. Finished Pre Mapping Phase. @N:BN225 : | Writing default property annotation file C:\Users\Abdullah\Projects\FPGA\Workplace\ModBulb_modulation_FPGA\synthesis\Top.sap. Pre-mapping successful! At Mapper Exit (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 46MB peak: 110MB) Process took 0h:00m:01s realtime, 0h:00m:01s cputime # Fri Nov 11 11:40:57 2016 ###########################################################] Map & Optimize Report Synopsys Microsemi Technology Mapper, Version mapact, Build 1659R, Built Dec 10 2015 09:42:41 Copyright (C) 1994-2015, Synopsys, Inc. This software and the associated documentation are proprietary to Synopsys, Inc. This software may only be used in accordance with the terms and conditions of a written license agreement with Synopsys, Inc. All other use, reproduction, or distribution of this software is strictly prohibited. Product Version J-2015.03M-SP1-2 Mapper Startup Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 99MB peak: 99MB) @N:MF248 : | Running in 64-bit mode. @N:MF667 : | Clock conversion disabled Design Input Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 99MB peak: 101MB) Mapper Initialization Complete (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 99MB peak: 101MB) Starting Optimization and Mapping (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 108MB peak: 110MB) Available hyper_sources - for debug and ip models None Found @N:BN362 : spi_slave.vhd(224) | Removing sequential instance wr_ack_reg of view:PrimLib.dff(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @A:BN291 : spi_slave.vhd(224) | Boundary register wr_ack_reg packed into a complex cell. To disable register packing, set syn_keep=1 on net between register and complex cell. @N:BN362 : spi_slave.vhd(307) | Removing sequential instance wren of view:PrimLib.sdffse(prim) in hierarchy view:work.spi_slave(rtl) because there are no references to its outputs @A:BN291 : spi_slave.vhd(307) | Boundary register wren packed into a complex cell. To disable register packing, set syn_keep=1 on net between register and complex cell. Finished RTL optimizations (Real Time elapsed 0h:00m:00s; CPU Time elapsed 0h:00m:00s; Memory used current: 108MB peak: 110MB) @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst mod_addr[15:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst ppm_slot_idx[7:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst packet_cntr[15:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst recv_addr[15:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst timA_ms_ctr[14:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst timB_ctr[15:0] @N: : modulator.vhd(90) | Found counter in view:work.Modulator(architecture_modulator) inst reg_addr[3:0] @N:MF179 : modulator.vhd(141) | Found 16 bit by 16 bit '<' comparator, 'un64_spi_dvld' @N:MF176 : | Default generator successful @N:MF239 : modulator.vhd(112) | Found 16-bit decrementor, 'un15_spi_dvld[15:0]' @N:MF239 : modulator.vhd(221) | Found 17-bit decrementor, 'un22_mod_enabled[16:32]' @N:MF239 : modulator.vhd(306) | Found 17-bit decrementor, 'un328_mod_enabled[16:32]' @N:MF179 : modulator.vhd(306) | Found 17 bit by 17 bit '<' comparator, 'un331_mod_enabled' @N:MF179 : modulator.vhd(310) | Found 17 bit by 17 bit '<' comparator, 'un340_mod_enabled' @N: : spi_slave.vhd(324) | Found counter in view:work.spi_slave(rtl) inst state_reg[4:0] Finished factoring (Real Time elapsed 0h:00m:02s; CPU Time elapsed 0h:00m:02s; Memory used current: 124MB peak: 125MB) Finished gated-clock and generated-clock conversion (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 118MB peak: 125MB) Finished generic timing optimizations - Pass 1 (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 119MB peak: 128MB) Starting Early Timing Optimization (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 120MB peak: 128MB) Finished Early Timing Optimization (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 120MB peak: 128MB) Finished generic timing optimizations - Pass 2 (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 119MB peak: 128MB) Finished preparing to map (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:02s; Memory used current: 119MB peak: 128MB) Finished technology mapping (Real Time elapsed 0h:00m:03s; CPU Time elapsed 0h:00m:03s; Memory used current: 124MB peak: 128MB) High Fanout Net Report ********************** Driver Instance / Pin Name Fanout, notes ------------------------------------------------------- Modulator_0.mem_wen / Q 26 Modulator_0.mod_active / Q 29 Modulator_0.un1_reset_n_inv_2_i_0 / Y 45 Modulator_0.timB_mch_0_sqmuxa / Y 32 Modulator_0.sig_o_1_15_i / Y 34 Modulator_0.un2_timb_en / Y 32 ======================================================= @N:FP130 : | Promoting Net CLK_c on CLKBUF CLK_pad @N:FP130 : | Promoting Net spi_sck_i_c on CLKBUF spi_sck_i_pad Finished technology timing optimizations and critical path resynthesis (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 124MB peak: 128MB) Replicating Combinational Instance Modulator_0.un2_timb_en, fanout 32 segments 2 Replicating Combinational Instance Modulator_0.sig_o_1_15_i, fanout 34 segments 2 Replicating Combinational Instance Modulator_0.timB_mch_0_sqmuxa, fanout 32 segments 2 Replicating Combinational Instance Modulator_0.un1_reset_n_inv_2_i_0, fanout 45 segments 2 Replicating Sequential Instance Modulator_0.mod_active, fanout 29 segments 2 Replicating Sequential Instance Modulator_0.mem_wen, fanout 26 segments 2 Buffering RESET_N_c, fanout 25 segments 2 Added 1 Buffers Added 6 Cells via replication Added 2 Sequential Cells via replication Added 4 Combinational Cells via replication Finished restoring hierarchy (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 124MB peak: 128MB) #### START OF CLOCK OPTIMIZATION REPORT #####[ Clock optimization not enabled 2 non-gated/non-generated clock tree(s) driving 339 clock pin(s) of sequential element(s) 0 gated/generated clock tree(s) driving 0 clock pin(s) of sequential element(s) 0 instances converted, 0 sequential instances remain driven by gated/generated clocks =============================== Non-Gated/Non-Generated Clocks =============================== Clock Tree ID Driving Element Drive Element Type Fanout Sample Instance ---------------------------------------------------------------------------------------------- ClockId0001 CLK port 299 spi_slave_0.do_valid_A ClockId0002 spi_sck_i port 40 spi_slave_0.sh_reg[15] ============================================================================================== ##### END OF CLOCK OPTIMIZATION REPORT ######] Start Writing Netlists (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 121MB peak: 128MB) Writing Analyst data base C:\Users\Abdullah\Projects\FPGA\Workplace\ModBulb_modulation_FPGA\synthesis\synwork\Top_m.srm Finished Writing Netlist Databases (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 122MB peak: 128MB) Writing EDIF Netlist and constraint files J-2015.03M-SP1-2 Finished Writing EDIF Netlist and constraint files (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 124MB peak: 128MB) Start final timing analysis (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 122MB peak: 128MB) @W:MT420 : | Found inferred clock Top|CLK with period 50.00ns. Please declare a user-defined clock on object "p:CLK" @W:MT420 : | Found inferred clock Top|spi_sck_i with period 50.00ns. Please declare a user-defined clock on object "p:spi_sck_i" @S |##### START OF TIMING REPORT #####[ # Timing Report written on Fri Nov 11 11:41:02 2016 # Top view: Top Library name: IGLOO Operating conditions: COMWCSTD ( T = 70.0, V = 1.42, P = 1.85, tree_type = balanced_tree ) Requested Frequency: 20.0 MHz Wire load mode: top Wire load model: IGLOO Paths requested: 5 Constraint File(s): @N:MT320 : | Timing report estimates place and route data. Please look at the place and route timing report for final timing. @N:MT322 : | Clock constraints cover only FF-to-FF paths associated with the clock. Performance Summary ******************* Worst slack in design: 15.179 Requested Estimated Requested Estimated Clock Clock Starting Clock Frequency Frequency Period Period Slack Type Group ---------------------------------------------------------------------------------------------------------------------- Top|CLK 20.0 MHz 28.7 MHz 50.000 34.821 15.179 inferred Inferred_clkgroup_0 Top|spi_sck_i 20.0 MHz 60.6 MHz 50.000 16.513 16.744 inferred Inferred_clkgroup_1 ====================================================================================================================== Clock Relationships ******************* Clocks | rise to rise | fall to fall | rise to fall | fall to rise ---------------------------------------------------------------------------------------------------------------------- Starting Ending | constraint slack | constraint slack | constraint slack | constraint slack ---------------------------------------------------------------------------------------------------------------------- Top|CLK Top|CLK | 50.000 15.179 | No paths - | No paths - | No paths - Top|spi_sck_i Top|CLK | Diff grp - | No paths - | No paths - | No paths - Top|spi_sck_i Top|spi_sck_i | 50.000 40.355 | No paths - | 25.000 16.744 | No paths - ====================================================================================================================== Note: 'No paths' indicates there are no paths in the design for that pair of clock edges. 'Diff grp' indicates that paths exist but the starting clock and ending clock are in different clock groups. Interface Information ********************* No IO constraint found ==================================== Detailed Report for Clock: Top|CLK ==================================== Starting Points with Worst Slack ******************************** Starting Arrival Instance Reference Type Pin Net Time Slack Clock ------------------------------------------------------------------------------------------------------- Modulator_0.registers_0[0] Top|CLK DFN1E1 Q registers_0[0] 0.885 15.179 Modulator_0.registers_0[1] Top|CLK DFN1E1 Q registers_0[1] 0.885 15.339 Modulator_0.registers_0[2] Top|CLK DFN1E1 Q registers_0[2] 0.885 15.411 Modulator_0.registers_0[4] Top|CLK DFN1E1 Q registers_0[4] 0.885 15.479 Modulator_0.registers_0[5] Top|CLK DFN1E1 Q registers_0[5] 0.885 15.551 Modulator_0.registers_0[3] Top|CLK DFN1E1 Q registers_0[3] 0.885 15.578 Modulator_0.registers_0[8] Top|CLK DFN1E1 Q registers_0[8] 0.885 16.427 Modulator_0.registers_0[7] Top|CLK DFN1E1 Q registers_0[7] 0.885 16.586 Modulator_0.registers_0[6] Top|CLK DFN1E1 Q registers_0[6] 0.885 16.743 Modulator_0.registers_0[10] Top|CLK DFN1E1 Q registers_0[10] 0.885 17.718 ======================================================================================================= Ending Points with Worst Slack ****************************** Starting Required Instance Reference Type Pin Net Time Slack Clock ---------------------------------------------------------------------------------------------------- Modulator_0.bit_idx[3] Top|CLK DFN1 D bit_idx_RNO[3] 49.311 15.179 Modulator_0.bit_idx[2] Top|CLK DFN1 D bit_idx_RNO[2] 49.311 16.747 Modulator_0.bit_idx[1] Top|CLK DFN1 D bit_idx_RNO[1] 49.311 17.488 Modulator_0.timA_ctr[15] Top|CLK DFN1 D timA_ctr_RNO[15] 49.353 19.244 Modulator_0.bit_idx[0] Top|CLK DFN1 D bit_idx_RNO[0] 49.311 19.641 Modulator_0.timA_ctr[14] Top|CLK DFN1 D timA_ctr_RNO[14] 49.353 20.311 Modulator_0.timA_ctr[13] Top|CLK DFN1 D timA_ctr_RNO[13] 49.353 20.389 Modulator_0.timA_ctr[11] Top|CLK DFN1 D timA_ctr_RNO[11] 49.353 20.894 Modulator_0.timA_ctr[12] Top|CLK DFN1 D timA_ctr_RNO[12] 49.353 21.456 Modulator_0.timA_ctr[10] Top|CLK DFN1 D timA_ctr_RNO[10] 49.353 21.961 ==================================================================================================== Worst Path Information View Worst Path in Analyst *********************** Path information for path number 1: Requested Period: 50.000 - Setup time: 0.689 + Clock delay at ending point: 0.000 (ideal) = Required time: 49.311 - Propagation time: 34.132 - Clock delay at starting point: 0.000 (ideal) = Slack (critical) : 15.179 Number of logic level(s): 19 Starting point: Modulator_0.registers_0[0] / Q Ending point: Modulator_0.bit_idx[3] / D The start point is clocked by Top|CLK [rising] on pin CLK The end point is clocked by Top|CLK [rising] on pin CLK Instance / Net Pin Pin Arrival No. of Name Type Name Dir Delay Time Fan Out(s) ---------------------------------------------------------------------------------------------------------------- Modulator_0.registers_0[0] DFN1E1 Q Out 0.885 0.885 - registers_0[0] Net - - 1.969 - 8 Modulator_0.un15_spi_dvld.I_10 OR3 A In - 2.854 - Modulator_0.un15_spi_dvld.I_10 OR3 Y Out 0.587 3.441 - DWACT_FDEC_E[0] Net - - 1.833 - 7 Modulator_0.un15_spi_dvld.I_30 OR3 A In - 5.275 - Modulator_0.un15_spi_dvld.I_30 OR3 Y Out 0.587 5.861 - DWACT_FDEC_E[6] Net - - 1.537 - 5 Modulator_0.un15_spi_dvld.I_36 OR3 A In - 7.398 - Modulator_0.un15_spi_dvld.I_36 OR3 Y Out 0.587 7.985 - N_4_3 Net - - 0.386 - 1 Modulator_0.un15_spi_dvld.I_37 XNOR2 A In - 8.371 - Modulator_0.un15_spi_dvld.I_37 XNOR2 Y Out 0.587 8.958 - I_37_1 Net - - 1.537 - 5 Modulator_0.mod_addr_RNIBPUK2[13] XOR2 A In - 10.495 - Modulator_0.mod_addr_RNIBPUK2[13] XOR2 Y Out 0.491 10.986 - N_161_i Net - - 0.386 - 1 Modulator_0.mod_addr_RNI3BIU3[7] NOR3A C In - 11.372 - Modulator_0.mod_addr_RNI3BIU3[7] NOR3A Y Out 0.860 12.232 - un15_last_bit_sent_13 Net - - 0.386 - 1 Modulator_0.mod_addr_RNI1T7I7[15] XA1A C In - 12.618 - Modulator_0.mod_addr_RNI1T7I7[15] XA1A Y Out 0.775 13.393 - un15_last_bit_sent_16 Net - - 0.386 - 1 Modulator_0.mod_addr_RNI8OUOJ[11] NOR3C C In - 13.779 - Modulator_0.mod_addr_RNI8OUOJ[11] NOR3C Y Out 0.800 14.579 - un15_last_bit_sent Net - - 0.386 - 1 Modulator_0.registers_0_RNIDHQJR[6] AO1 C In - 14.965 - Modulator_0.registers_0_RNIDHQJR[6] AO1 Y Out 0.787 15.753 - un5_last_bit_sent Net - - 2.053 - 10 Modulator_0.ctrl_reg_RNI02DIS[2] OR3 A In - 17.805 - Modulator_0.ctrl_reg_RNI02DIS[2] OR3 Y Out 0.432 18.238 - N_122 Net - - 0.464 - 2 Modulator_0.ctrl_reg_RNIRAEJT[0] OR2 A In - 18.701 - Modulator_0.ctrl_reg_RNIRAEJT[0] OR2 Y Out 0.436 19.137 - N_135 Net - - 1.422 - 4 Modulator_0.ctrl_reg_RNINJA433[0] NOR2A B In - 20.560 - Modulator_0.ctrl_reg_RNINJA433[0] NOR2A Y Out 0.464 21.023 - ppm_slot_idx_0_sqmuxa_3 Net - - 2.053 - 10 Modulator_0.mod_enabled_RNI0OCN24 OR3A B In - 23.076 - Modulator_0.mod_enabled_RNI0OCN24 OR3A Y Out 0.858 23.934 - un1_ppm_slot_idx_1_sqmuxa_1 Net - - 0.969 - 3 Modulator_0.timA_en_RNI212F34 OA1C A In - 24.903 - Modulator_0.timA_en_RNI212F34 OA1C Y Out 1.119 26.022 - N_201 Net - - 1.422 - 4 Modulator_0.registers_4_RNIGFTG59[0] AO1 A In - 27.444 - Modulator_0.registers_4_RNIGFTG59[0] AO1 Y Out 0.624 28.068 - un1_registers_4_1[3] Net - - 0.464 - 2 Modulator_0.un1_bit_idx.ADD_4x4_slow_I0_un1_CO1 NOR2B A In - 28.532 - Modulator_0.un1_bit_idx.ADD_4x4_slow_I0_un1_CO1 NOR2B Y Out 0.587 29.119 - I0_un1_CO1 Net - - 0.464 - 2 Modulator_0.un1_bit_idx.ADD_4x4_slow_I1_CO1 MAJ3 B In - 29.582 - Modulator_0.un1_bit_idx.ADD_4x4_slow_I1_CO1 MAJ3 Y Out 1.182 30.764 - N76 Net - - 0.464 - 2 Modulator_0.un1_bit_idx.ADD_4x4_slow_I2_un1_CO1 MAJ3 B In - 31.228 - Modulator_0.un1_bit_idx.ADD_4x4_slow_I2_un1_CO1 MAJ3 Y Out 1.182 32.410 - I2_un1_CO1 Net - - 0.386 - 1 Modulator_0.bit_idx_RNO[3] XA1B A In - 32.796 - Modulator_0.bit_idx_RNO[3] XA1B Y Out 0.950 33.746 - bit_idx_RNO[3] Net - - 0.386 - 1 Modulator_0.bit_idx[3] DFN1 D In - 34.132 - ================================================================================================================ Total path delay (propagation time + setup) of 34.821 is 15.468(44.4%) logic and 19.353(55.6%) route. Path delay compensated for clock skew. Clock skew is added to clock-to-out value, and is subtracted from setup time value ==================================== Detailed Report for Clock: Top|spi_sck_i ==================================== Starting Points with Worst Slack ******************************** Starting Arrival Instance Reference Type Pin Net Time Slack Clock ----------------------------------------------------------------------------------------------------- spi_slave_0.state_reg[1] Top|spi_sck_i DFN1C1 Q state_reg[1] 0.697 16.744 spi_slave_0.state_reg[2] Top|spi_sck_i DFN1C1 Q state_reg[2] 0.697 16.967 spi_slave_0.state_reg[3] Top|spi_sck_i DFN1C1 Q state_reg[3] 0.697 17.132 spi_slave_0.state_reg[4] Top|spi_sck_i DFN1C1 Q state_reg[4] 0.697 19.149 spi_slave_0.sh_reg[15] Top|spi_sck_i DFN1 Q sh_reg[15] 0.885 22.000 spi_slave_0.state_reg[0] Top|spi_sck_i DFN1C1 Q state_reg[0] 0.885 42.431 spi_slave_0.sh_reg[0] Top|spi_sck_i DFN1 Q sh_reg[0] 0.885 47.089 spi_slave_0.sh_reg[1] Top|spi_sck_i DFN1 Q sh_reg[1] 0.885 47.089 spi_slave_0.sh_reg[2] Top|spi_sck_i DFN1 Q sh_reg[2] 0.885 47.089 spi_slave_0.sh_reg[3] Top|spi_sck_i DFN1 Q sh_reg[3] 0.885 47.089 ===================================================================================================== Ending Points with Worst Slack ****************************** Starting Required Instance Reference Type Pin Net Time Slack Clock ---------------------------------------------------------------------------------------------------------- spi_slave_0.tx_bit_reg Top|spi_sck_i DFN0 D tx_bit_next 24.144 16.744 spi_slave_0.do_transfer_reg Top|spi_sck_i DFN1E0 D wr_ack_next9 49.353 40.355 spi_slave_0.do_buffer_reg[0] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[1] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[2] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[3] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[4] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[5] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[6] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 spi_slave_0.do_buffer_reg[7] Top|spi_sck_i DFN1E1 E wr_ack_next9 49.478 40.480 ========================================================================================================== Worst Path Information View Worst Path in Analyst *********************** Path information for path number 1: Requested Period: 25.000 - Setup time: 0.856 + Clock delay at ending point: 0.000 (ideal) = Required time: 24.144 - Propagation time: 7.400 - Clock delay at starting point: 0.000 (ideal) = Slack (non-critical) : 16.744 Number of logic level(s): 2 Starting point: spi_slave_0.state_reg[1] / Q Ending point: spi_slave_0.tx_bit_reg / D The start point is clocked by Top|spi_sck_i [rising] on pin CLK The end point is clocked by Top|spi_sck_i [falling] on pin CLK Instance / Net Pin Pin Arrival No. of Name Type Name Dir Delay Time Fan Out(s) ------------------------------------------------------------------------------------------------- spi_slave_0.state_reg[1] DFN1C1 Q Out 0.697 0.697 - state_reg[1] Net - - 1.710 - 6 spi_slave_0.state_reg_RNI19L1[2] NOR3 C In - 2.408 - spi_slave_0.state_reg_RNI19L1[2] NOR3 Y Out 0.821 3.228 - N_32_mux Net - - 2.664 - 17 spi_slave_0.tx_bit_reg_RNO OA1A A In - 5.893 - spi_slave_0.tx_bit_reg_RNO OA1A Y Out 1.121 7.014 - tx_bit_next Net - - 0.386 - 1 spi_slave_0.tx_bit_reg DFN0 D In - 7.400 - ================================================================================================= Total path delay (propagation time + setup) of 8.256 is 3.495(42.3%) logic and 4.761(57.7%) route. Path delay compensated for clock skew. Clock skew is added to clock-to-out value, and is subtracted from setup time value ##### END OF TIMING REPORT #####] Finished final timing analysis (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 122MB peak: 128MB) Finished timing report (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:03s; Memory used current: 122MB peak: 128MB) -------------------------------------------------------------------------------- Target Part: AGLN060V5_VQFP100_STD Report for cell Top.rtl Core Cell usage: cell count area count*area AND2 27 1.0 27.0 AND2A 4 1.0 4.0 AND3 8 1.0 8.0 AO1 48 1.0 48.0 AO1A 8 1.0 8.0 AO1B 2 1.0 2.0 AO1C 16 1.0 16.0 AOI1 2 1.0 2.0 AOI1A 8 1.0 8.0 AOI1B 1 1.0 1.0 AX1 15 1.0 15.0 AX1A 1 1.0 1.0 AX1B 1 1.0 1.0 AX1C 10 1.0 10.0 AX1D 6 1.0 6.0 AXOI3 1 1.0 1.0 AXOI4 1 1.0 1.0 BUFF 5 1.0 5.0 GND 4 0.0 0.0 INV 4 1.0 4.0 MAJ3 2 1.0 2.0 MX2 111 1.0 111.0 MX2A 2 1.0 2.0 MX2B 3 1.0 3.0 MX2C 6 1.0 6.0 NOR2 28 1.0 28.0 NOR2A 53 1.0 53.0 NOR2B 47 1.0 47.0 NOR3 15 1.0 15.0 NOR3A 24 1.0 24.0 NOR3B 29 1.0 29.0 NOR3C 21 1.0 21.0 OA1 5 1.0 5.0 OA1A 25 1.0 25.0 OA1B 2 1.0 2.0 OA1C 4 1.0 4.0 OAI1 1 1.0 1.0 OR2 62 1.0 62.0 OR2A 57 1.0 57.0 OR2B 11 1.0 11.0 OR3 85 1.0 85.0 OR3A 2 1.0 2.0 OR3B 1 1.0 1.0 OR3C 3 1.0 3.0 VCC 4 0.0 0.0 XA1 21 1.0 21.0 XA1A 29 1.0 29.0 XA1B 11 1.0 11.0 XA1C 14 1.0 14.0 XNOR2 64 1.0 64.0 XO1 25 1.0 25.0 XO1A 2 1.0 2.0 XOR2 129 1.0 129.0 DFN0 1 1.0 1.0 DFN0P1 1 1.0 1.0 DFN1 43 1.0 43.0 DFN1C0 2 1.0 2.0 DFN1C1 5 1.0 5.0 DFN1E0 10 1.0 10.0 DFN1E0C0 2 1.0 2.0 DFN1E1 261 1.0 261.0 DFN1E1C0 10 1.0 10.0 RAM512X18 2 0.0 0.0 ----- ---------- TOTAL 1407 1397.0 IO Cell usage: cell count CLKBUF 2 INBUF 3 OUTBUF 3 ----- TOTAL 8 Core Cells : 1397 of 1536 (91%) IO Cells : 8 RAM/ROM Usage Summary Block Rams : 2 of 4 (50%) Mapper successful! At Mapper Exit (Real Time elapsed 0h:00m:04s; CPU Time elapsed 0h:00m:04s; Memory used current: 48MB peak: 128MB) Process took 0h:00m:04s realtime, 0h:00m:04s cputime # Fri Nov 11 11:41:03 2016 ###########################################################]


We're sorry but d2-advance doesn't work properly without JavaScript enabled. Please enable it to continue.
Loading...


Class HystrixCircuitBreaker
The default production implementation of IHystrixCircuitBreaker.
Inheritance
Implements
Inherited Members
Namespace: NHystrix
Assembly: NHystrix.dll
Syntax
public class HystrixCircuitBreaker : IHystrixCircuitBreaker
Properties
| Improve this Doc View SourceIsOpen
Whether the circuit is currently open (tripped).
Declaration
public bool IsOpen { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
ShouldAllowRequest
Every HystrixCommand<TRequest, TResult> requests asks this if it is allowed to proceed or not. It is idempotent and does not modify any internal state, and takes into account the half-open logic which allows some requests through after the circuit has been opened.
Declaration
public bool ShouldAllowRequest { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
ShouldAttemptExecution
Invoked at start of command execution to attempt an execution. This is non-idempotent - it may modify internal state.
Declaration
public bool ShouldAttemptExecution { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Methods
| Improve this Doc View SourceGetInstance(HystrixCommandKey, CircuitBreakerOptions, HystrixCommandMetrics)
Get the IHystrixCircuitBreaker instance for a given key.
Declaration
public static IHystrixCircuitBreaker GetInstance(HystrixCommandKey commandKey, CircuitBreakerOptions properties, HystrixCommandMetrics metrics)
Parameters
| Type | Name | Description |
|---|---|---|
| HystrixCommandKey | commandKey | The HystrixCommandKey for the command using this circuit breaker. |
| CircuitBreakerOptions | properties | The HystrixCommandProperties for the command using this circuit breaker. |
| HystrixCommandMetrics | metrics | The HystrixCommandMetrics for the command using this circuit breaker. |
Returns
| Type | Description |
|---|---|
| IHystrixCircuitBreaker | A singleton instance of IHystrixCircuitBreaker for the given HystrixCommandKey |
MarkNonSuccess()
Invoked on unsuccessful executions from HystrixCommand<TRequest, TResult> as part of feedback mechanism when in a half-open state.
Declaration
public void MarkNonSuccess()
MarkSuccess()
Invoked on successful executions from HystrixCommand<TRequest, TResult> as part of feedback mechanism when in a half-open state.
Declaration
public void MarkSuccess()
Trip()
Trips the circuit breaker.
Declaration
public void Trip()


""" Defines ArrayPlotData.
"""
import six
import six.moves as sm
from numpy import array, ndarray
# Enthought library imports
from traits.api import Dict
# Local, relative imports
from .abstract_plot_data import AbstractPlotData
from .abstract_data_source import AbstractDataSource
class ArrayPlotData(AbstractPlotData):
""" A PlotData implementation class that handles a list of Numpy arrays
(or a 2-D Numpy array).
By default, it doesn't allow its input data to be modified by downstream
Chaco components or interactors.
"""
#-------------------------------------------------------------------------
# Public traits
#-------------------------------------------------------------------------
#: Map of names to arrays. Although there is no restriction on the array
#: dimensions, each array must correspond to a single plot item; that
#: is, a single name must not map to a multi-dimensional array unless
#: the array is being used for an image plot or for something that can handle
#: multi-dimensional input data.
arrays = Dict
#: Consumers can write data to this object (overrides AbstractPlotData).
writable = True
def __init__(self, *data, **kw):
""" ArrayPlotData can be constructed by passing in arrays.
Keyword arguments can be used to give certain arrays specific names;
unnamed arrays are given a generic name of the format 'seriesN', where
N is its position in the argument list.
For example::
ArrayPlotData(array1, array2, index=array3, foo=array4)
This call results in the creation of four entries in self.arrays::
'series1' -> array1
'series2' -> array2
'index' -> array3
'foo' -> array4
If any names in the keyword parameter list collide with the
auto-generated positional names "series1", "series2", etc., then those
arrays are replaced.
Note that this factor means that keyword traits are *not* set using the
keyword parameters in the constructor. This strategy defies some
conventions, but was it chosen for convenience, since the raison d'etre
of this class is convenience.
"""
super(AbstractPlotData, self).__init__()
self._update_data(kw)
data = dict(sm.zip(self._generate_names(len(data)), data))
self._update_data(data)
#------------------------------------------------------------------------
# AbstractPlotData Interface
#------------------------------------------------------------------------
def list_data(self):
""" Returns a list of the names of the arrays managed by this instance.
"""
return list(self.arrays.keys())
def get_data(self, name):
""" Returns the array associated with *name*.
Implements AbstractDataSource.
"""
return self.arrays.get(name, None)
def del_data(self, name):
""" Deletes the array specified by *name*, or raises a KeyError if
the named array does not exist.
"""
if not self.writable:
return None
if name in self.arrays:
del self.arrays[name]
self.data_changed = {'removed': [name]}
else:
raise KeyError("Data series '%s' does not exist." % name)
def set_data(self, name, new_data, generate_name=False):
""" Sets the specified array as the value for either the specified
name or a generated name.
If the instance's `writable` attribute is True, then this method sets
the data associated with the given name to the new value, otherwise it
does nothing.
Parameters
----------
name : string
The name of the array whose value is to be set.
new_data : array
The array to set as the value of *name*.
generate_name : Boolean
If True, a unique name of the form 'seriesN' is created for the
array, and is used in place of *name*. The 'N' in 'seriesN' is
one greater the largest N already used.
Returns
-------
The name under which the array was set.
See Also
--------
update_data: Use if needing to set multiple ArrayPlotData entries at
once, for example because new arrays' dimensions change and
updating one at a time would break an existing Plot.
"""
if not self.writable:
return None
if generate_name:
names = self._generate_names(1)
name = names[0]
self.update_data({name: new_data})
return name
def update_data(self, *args, **kwargs):
""" Updates any number of arrays before triggering a `data_changed`
event.
Useful to set multiple ArrayPlotData entries at once, for example
because new arrays' dimensions change and updating one at a time would
break an existing Plot.
Note: Implements AbstractPlotData's update_data() method. This method
has the same signature as the dictionary update() method.
See Also
--------
set_data: Simpler interface to set only 1 entry at a time.
"""
if not self.writable:
return None
data = dict(*args, **kwargs)
event = {}
for name in data:
if name in self.arrays:
event.setdefault('changed', []).append(name)
else:
event.setdefault('added', []).append(name)
self._update_data(data)
self.data_changed = event
def set_selection(self, name, selection):
""" Overrides AbstractPlotData to do nothing and not raise an error.
"""
pass
#------------------------------------------------------------------------
# Private methods
#------------------------------------------------------------------------
def _generate_names(self, n):
""" Generate n new names
"""
max_index = max(self._generate_indices())
names = ["series{0:d}".format(n) for n in range(max_index+1, max_index+n+1)]
return names
def _generate_indices(self):
""" Generator that yields all integers that match "series%d" in keys
"""
yield 0 # default minimum
for name in self.list_data():
if name.startswith('series'):
try:
v = int(name[6:])
except ValueError:
continue
yield v
def _update_data(self, data):
""" Update the array, ensuring that data is an array
"""
# note that this call modifies data, but that's OK since the callers
# all create the dictionary that they pass in
for name, value in list(data.items()):
if not isinstance(value, (ndarray, AbstractDataSource)):
data[name] = array(value)
else:
data[name] = value
self.arrays.update(data)


Prompt for Monday, February 26
More Histograms, making arguments
Take another look at
538's Oscar predictions
. Look particularly at annotations, typography, colors, text, and other guides.
Data sets from
Andy Kirk
and
Rachael Tatman
.
Which
dog should you have?
Player data from
Basketball Reference
Wrap-up: Can we reverse-engineer human perception?
Data: grouping.
Context: Boring distributions


Picture Printer - Instructions
Uploading images
You can upload images by clicking in the + icon in the centre of an empty placeholder. Select your image from the dialog that opens and it should appear
Linking from online
You can drag and drop any image from online. You need to be sure that the image you are dragging over is the source, however. If you drag an image that isn't the base URL an alert will pop-up. When this happens you can usually right-click the image you want and "open in a new tab". Drag this image over
You can use the image below to try it out
Removing images
Images should be persistent once added. This means you can open new tabs, close the extension, etc, without losing the images. To remove them all you need to do is click. To get it back you will need to repeat the process how you put it there originally.
Rotating Images
There are currently two ways of dealing with vertical pictures:
- Rotate the image - the image will be rotated within the placeholder
- Rotate the placeholder (avoid) - the placeholder will be rotated to fit the image. This currently does not extend to printing.
This seting is global and will ultimitely apply to all images.
Printing
There is no API for the Chrome Printer Page so you will need to marry up the settings:
- Remove Margins
- Add background graphics if you want black bars
- Set the page size
- Set the page orientation
Further help
Use Chrome to submit a request to me and I will get bak to you. I'm more than happy to fix any issues you have improve the tool further


Interactive map with Leaflet.js
Interactive map with Leaflet.js
D3 Graphs and Visualization
Extended Kalman Filter Implementation
Vehicle Detection for Self-Driving Car
Advanced Lane Finding for Self-Driving Car
Basic Lane Finding for Self-Driving Car
YouTube-8M Video Understanding Challenge
Toxic Comment Classification Challenge


Input.css
Forms
AL
CA
IL
Remember me
Columns
Date
Birthday:
Time
Select a time:
Date/Time
Birthday (date and time):
Color
Select your favorite color:
Date time local
Birthday (date and time):
File
Select a file:
Hidden
Define a hidden field (not visible to a user).
Image
Month
Birthday (month and year):
Number
Quantity (between 1 and 5):
Radio
Male
Female
Range
0
10
Search
Search website:
Telephone
Telephone:
Url
Add your homepage:
Week
Select a week:
Input disabled


Uglifier
Ruby wrapper for UglifyJS JavaScript compressor.
Installation
Uglifier is available as ruby gem.
$ gem install uglifier
Ensure that your environment has a JavaScript interpreter supported by ExecJS. Usually, installing therubyracer gem is the best alternative.
Usage
require 'uglifier' Uglifier.new.compile(File.read("source.js")) # => js file minified # Or alternatively Uglifier.compile(File.read("source.js"))
When initializing UglifyJS, you can tune the behavior of UglifyJS by passing options. For example, if you want top-level variable names to be mangled:
Uglifier.new(:toplevel => true).compile(source) # Or Uglifier.compile(source, :toplevel => true)
Available options and their defaults are
{ :mangle => true, # Mangle variable and function names, use :variables to skip function mangling :toplevel => false, # Mangle top-level variable names :except => [], # Variable names to be excluded from mangling :max_line_length => 32 * 1024, # Maximum line length :squeeze => true, # Squeeze code resulting in smaller, but less-readable code :seqs => true, # Reduce consecutive statements in blocks into single statement :dead_code => true, # Remove dead code (e.g. after return) :lift_vars => false, # Lift all var declarations at the start of the scope :unsafe => false, # Optimizations known to be unsafe in some situations :copyright => true, # Show copyright message :ascii_only => false, # Encode non-ASCII characters as Unicode code points :inline_script => false, # Escape </script :quote_keys => false, # Quote keys in object literals :beautify => false, # Ouput indented code :beautify_options => { :indent_level => 4, :indent_start => 0, :space_colon => false } }
Submitting an issue
Uglifier uses the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn’t already been submitted. You can indicate support for an existing issuse by voting it up. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, MultiJSON engine and ExecJS runtime. Ideally, a bug report should include a pull request with failing specs.
Contributing to uglifier
- Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
- Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
- Fork the project
- Start a feature/bugfix branch
- Commit and push until you are happy with your contribution
- Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Hello dear My name is shrouk raslan I am a new freelancer here, but i most experienced with making perfect websites in the field of web designing .
I will copy and save business logo images and attach them as PNG for you. and you will see great work. I will be happy to work with you Skills that i can offer are:
-I have a knowledge of languages HTML, CSS, JavaScript, jquery.
-Responsive websites using bootstrap.
-I can complete the required work on time. I provide 100% support after the contracts ends.
.
Design a responsive web site for you .. With Html5 , CSS3 , Javascript , JQ and Bootstrap
If You Have a Website And Want to Create A new Desgin For It I Can do That Easliy and In a Perfect Way
Solve Your UI/UX Problems ..
Make Your Website a responsive Website , With All devices


Gemma Collins pressures James Argent to propose in tense on air ultimatum
Gemma Collins announced on Good Morning Britain that she wanted James Argent to propose soon
by Verity Sulway, https://www.mirror.co.uk/authors/verity-sulway/Gemma Collins issued a firm ultimatum to her on/off boyfriend James 'Arg' Argent live on TV this morning.
The TOWIE star appeared on Good Morning Britain, where she announced to hosts Susanna Reid and Piers Morgan that she would not be sticking around much longer if her beau didn't get down on one knee soon.
She told Piers and Susanna she was happy, and Piers replied: "Any wedding bells?"
"Well I'm waiting aren't I", said the GC.
"Has he never asked you?", questioned Piers.
"No!" Gemma, 38, exclaimed, adding that she didn't know why.
Piers suggested to James, 31, that he should propose over the festive season.
"I can't wait much longer", Gemma said.
"It's either soon, or I'm out of here."
She added: "I am getting a little older now I need the big bling on my finger.
"If it’s meant to be…I don’t lose sleep out of it.
"I need to be made an honest woman."
She then looked directly to the camera and demanded to James, who was most likely still asleep at the early hour: "Call De Beers diamonds now James, wakey wakey!"
She went on to give James crystal clear instructions that she wants a ring "like Elizabeth Taylor's".
Piers joked: "It can’t get more direct than that, James."
Gemma and Arg have been together on and off for ten years, and their tumultuous relationship has grabbed headlines since it began.
According to Heat, Gemma has vowed to have a child with James within the next couple of years, but plans to have fun until he is fully "back on his feet".
It appeared the TOWIE love birds were done for good when Arg moved back to his mum's in October after Gemma called 999 amid concerns for his welfare when he failed to return her calls.
Gemma, who feared Arg had overdosed, was said to have decided to call it off for good over after the scare.
News of the smitten pair's new 'baby promise' has added a new dimension to their confusing relationship.
The insider also told the publication: "Gemma's going to try anything she can to get Arg back on his feet.
The ultimate goal is for them to become parents and she's vowed to Arg that she'll make it happen."


Class: Thread::Future
- Inherits:
-
Object
- Object
- Thread::Future
- Defined in:
- thread-0.2.2/lib/thread/future.rb
Overview
A future is an object that incapsulates a block which is called in a different thread, upon retrieval the caller gets blocked until the block has finished running, and its result is returned and cached.
Constant Summary
- Cancel =
Class.new(Exception)
Class Method Summary collapse
Instance Method Summary collapse
-
#cancel ⇒ Object
Cancel the future, #value will yield a Cancel exception.
-
#cancelled? ⇒ Boolean
Check if the future has been cancelled.
-
#delivered? ⇒ Boolean
(also: #realized?)
Check if the future has been called.
-
#exception ⇒ Object
Return the raised exception.
-
#exception? ⇒ Boolean
Check if an exception has been raised.
-
#initialize(pool = nil, &block) ⇒ Future
constructor
Create a future with the passed block and optionally using the passed pool.
-
#value(timeout = nil) ⇒ Object
(also: #~)
Get the value of the future, if it's not finished running this call will block.
-
#value!(timeout = nil) ⇒ Object
(also: #!)
Do the same as #value, but return nil in case of exception.
Constructor Details
#initialize(pool = nil, &block) ⇒ Future
Create a future with the passed block and optionally using the passed pool.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'thread-0.2.2/lib/thread/future.rb', line 21 def initialize(pool = nil, &block) raise ArgumentError, 'no block given' unless block @mutex = Mutex.new task = proc { begin deliver block.call rescue Exception => e @exception = e deliver nil end } @thread = pool ? pool.process(&task) : Thread.new(&task) ObjectSpace.define_finalizer self, self.class.finalizer(WeakRef.new(@thread)) end |
Class Method Details
Instance Method Details
#cancel ⇒ Object
Cancel the future, #value will yield a Cancel exception
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'thread-0.2.2/lib/thread/future.rb', line 78 def cancel return self if delivered? @mutex.synchronize { if @thread.is_a? Thread @thread.raise Cancel else @thread.terminate! Cancel end @exception = Cancel.new } self end |
#cancelled? ⇒ Boolean
Check if the future has been cancelled
95 96 97 98 99 |
# File 'thread-0.2.2/lib/thread/future.rb', line 95 def cancelled? @mutex.synchronize { @exception.is_a? Cancel } end |
#delivered? ⇒ Boolean Also known as: realized?
Check if the future has been called.
69 70 71 72 73 |
# File 'thread-0.2.2/lib/thread/future.rb', line 69 def delivered? @mutex.synchronize { instance_variable_defined? :@value } end |
#exception ⇒ Object
Return the raised exception.
62 63 64 65 66 |
# File 'thread-0.2.2/lib/thread/future.rb', line 62 def exception @mutex.synchronize { @exception } end |
#exception? ⇒ Boolean
Check if an exception has been raised.
55 56 57 58 59 |
# File 'thread-0.2.2/lib/thread/future.rb', line 55 def exception? @mutex.synchronize { instance_variable_defined? :@exception } end |
#value(timeout = nil) ⇒ Object Also known as: ~
Get the value of the future, if it's not finished running this call will block.
In case the block raises an exception, it will be raised, the exception is cached and will be raised every time you access the value.
An optional timeout can be passed which will return nil if nothing has been delivered.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'thread-0.2.2/lib/thread/future.rb', line 108 def value(timeout = nil) raise @exception if exception? return @value if delivered? @mutex.synchronize { cond.wait(@mutex, *timeout) } if exception? raise @exception elsif delivered? return @value end end |
#value!(timeout = nil) ⇒ Object Also known as: !
Do the same as #value, but return nil in case of exception.
127 128 129 130 131 132 133 |
# File 'thread-0.2.2/lib/thread/future.rb', line 127 def value!(timeout = nil) begin value(timeout) rescue Exception nil end end |


|
Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A collection of BlockAllocators binned to size classes. More...
#include <BinnedAllocator.h>
Public Types | |
| using | AllocatorVector = gts::Vector< BlockAllocator, OsHeapAllocator< BlockAllocator, GTS_NO_SHARING_CACHE_LINE_SIZE > > |
Public Member Functions | |
| ~BinnedAllocator () | |
| bool | init (MemoryStore *pMemoryStore) |
| void | shutdown () |
| void * | allocate (size_t size) |
| void | deallocate (void *ptr) |
| AllocatorVector const & | getAllAllocators () const |
| GTS_INLINE bool | isInitialized () const |
| GTS_INLINE uint32_t | binCount () const |
| GTS_INLINE uint32_t | calculateBin (uint32_t size) |
| GTS_INLINE uint32_t | calculateBin (void *ptr) |
Friends | |
| class | DistributedSlabAllocator |
A collection of BlockAllocators binned to size classes.
| gts::BinnedAllocator::~BinnedAllocator | ( | ) |
Destructs the allocator. Frees all BlockAllocator.
| void* gts::BinnedAllocator::allocate | ( | size_t | size | ) |
|
inline |
|
inline |
|
inline |
| void gts::BinnedAllocator::deallocate | ( | void * | ptr | ) |
Frees the memory in ptr.
| AllocatorVector const& gts::BinnedAllocator::getAllAllocators | ( | ) | const |
| bool gts::BinnedAllocator::init | ( | MemoryStore * | pMemoryStore | ) |
Initialize the BinnedSlabAllocator. This must happen before calling allocate.
|
inline |
| void gts::BinnedAllocator::shutdown | ( | ) |
Returns all allocated memory back to the OS and checks for memory leaks.


{% comment %} @name skills-list @include {String} title @include {String} icon @include {Array} skills @include {String} [empty] {% endcomment %} {% if include.skills and include.skills != empty %} {% include home/_core/title-with-icon.html title=include.title icon=include.icon %}


Microservices
+
Nameko
Welcome everyone, thank you for coming
Talk is about microservices .
And nameko , an open-source framework for writing them in Python
Matt Bennett, head of platform engineering at stealth-company; being filmed
Previously senior engineer at onefinestay , where nameko was born.
How many people know the term microservices?
How many of you did this time two years ago ? Big difference
Microservices is the hot new buzzword , suddenly they seem to be everywhere
History Lesson
November 2014
Martin Fowler & James Lewis published "microservices"
http://martinfowler.com/articles/microservices.html
In Nov 2014, Martin Fowler , James Lewis published "microservices"
Considered to be the seminal paper on the topic
Highly recommend. Accessible, not very long, lots of information
It's also very recent . They didn't invent the term, but gave it a concrete definition , propelled it into vocabulary
At onefinestay, we discovered the paper and realised it described what we had been building.
This was really exciting , now we had a common language to share ideas
Definition
Microservice architectural style is an approach to developing a single application as a suite of small services , each running in its own process and communicating with lightweight mechanisms
For uninitiated , what is the microservices architecture?
Martin Fowler's definition. Read
Monolith vs Microservices
Single process application
e.g. a Django site
Application divided into "services"
Deployed as separate processes
It's helpful to contrast to a monolith - probably the default way to build an app - as a single process
Typical django site good example . Would probably separate your site into "apps", but they run in the same process and memory space
Whereas in microservices, your "apps" become entirely separate programs
In essense: extension of good old fashioned decoupling and encapsulation , applied at the process level .
Forces you to consider the boundaries of services or seams that run through application
Common response to hype: "should be doing that anyway! just good design "; which is true
But with microservices, can't be lazy or bend rules e.g. cross-component import; not there to import
There are also other benefits to using separate processes
Reasons to Adopt Microservices
"Maintainability at Scale"
Primary reason for adopting any software architecture is scale
Or rather, maintainability at scale
Not scale as in serving '00s of millions req/sec. Rather in the complexity of the problem you're trying to solve , the team solving it
There is an analogy for this . Alan Kay (smalltalk, oop) used in 1997 Keynote (video of, was 13 in 1997)
It goes like this: if someone asked you to build a doghouse out of wooden planks and nails...
When society starting building massive structures, like cathedrals... used stone arches
Lightbulb moment: "architecture" etymology, literally application of arches
How can microservices help you achieve maintainability at scale ?
Already said it's about decoupling and isolation. What else?
Independently Deployable
As separate programs , they are independently deployable
Separate release cycles , deployment processes for different part of application
Guardian newspaper: microservices allowed them start using continual delivery in some parts , without risking
Independently Scalable
Separate programs are also independently scalable
Now I do '00s of millions of req/sec
To scale a monolith you have no choice but to deploy another instance
You have to replicate the whole thing
Microservices are much more granular ; therefore composable
e.g. CPU-bound service, deploy more of these to more CPUs without having to drag the rest of the application along
Freedom of Technology
Being good pythonistas , sure we all want to use Python3
Sometimes get stuck using old lib, not updated. Monolith, lowest common denominator
Microservices use most suitable interpreter: py2, py3, pypy. Up to you.
Not too loudly at python conference , but extends to language. Experiment with functional , write service in that lang
Not "Monolithic"
Forgive circular reference; not monolithic
Outside software architecture : big, imposing and impenetrable (think monolith in 2001)
Microservices: small, nimble, easy to grok.
A smaller codebase means shorter on-boarding for new devs
There is lower cognitive overhead . It is inherently more maintainable
Microservices: small, nimble, easy to grok.
A smaller codebase means shorter on-boarding for new devs
There is lower cognitive overhead . It is inherently more maintainable
Conway's Law
organizations which design systems... are constrained to produce designs which are copies of the communication structures of these organizations
And then there's conway's law . ThoughtWorks talk about this a lot.
Who's heard of Conway's Law?
Chap called Melvin Conway, 1968! Not sure any new ideas on software architecture.
Regular 3-tier application (DB, App Logic, UI); likely employ specialists in these fields.
I have worked in this kind of team . As member of middle tier , would talk to app logic peers every day; easy to communicate .
UI folks, different language . Later of friction. That is conway's law in action .
ThoughtWorks recommend: small, multi-discliplinary team ; separate based on natural divisions in the org you're serving
Get an app that better reflects the organisation rather than tech boundaries
Implications of Microservices
"You must be this tall to ride"
Wonderful benefits all well and good . What does it cost ?
Kind of a grown up architecture. Have to have a lot of things in place before you can make it work for you...
If you want to avoid the architectural doghouse
DevOps overhead
"Post CD Architecture"
There is a devops overhead
Increasing by 10 or 20 times things to be built, deployed, looked after
Massive burdon for ops. Only way to cope , leverage automation - tests, deployment, machine management
Another insight from ThoughtWorks: Microservices are "post-CD" .
What they mean is: enabled by automation , without which impossible
I think, this is why microserivices seem to surround us now. Same good ideas of decoupling and isolation, new dimension enabled by devops tech
Domain Knowledge
As well as devops overhead, you must embrace the domain in which you're operating
Sufficient complex app, should be doing anyway; worked places that didn't
Wht I mean is, you have to really understand the business requirements . i.e. the problem you're trying to solve for your org
So you can decide where to draw the lines between services
You can't just build a webapp and tack things on. Microservices force you to do it upfront.
Decentralisation
ACID → BASE
Basically Available
Soft-state
Eventually Consistent
Then there's the decentralised aspect
No longer have a single source of truth like the traditional database layer
Relinquish ACID guarantees, embrase BASE . Which stands for...
Really awkward backronym; good chemistry joke
What this means , is you can't apply transactions across calls to multiple services
Instead you apply it in one place and wait for it to eventually be reflected in the other places
OFS mistake: abstract calendaring service, called by others. Kind of a rookie error. Explicitly delete. Race condition.
Decentralised aspect means you have to think about these things
Complexity
Be aware you're introducing complexity
Collection of microserices fundamentally more complex than a monolith
More moving parts, connected by a network. Inherently less reliable than in-memory calls
In a complex system, failures rarely exactly one reason
Usually commulative effect : network slows down, backlog of requests, combined with recent code change, out of disk space
To mitigate , you need monitoring and telemetry. And analysis of the data that generates
So you can figure out what went wrong (preferably before)
Are Microservices for Me?
Are you fighting a monolith?

By now you may be asking yourself whether microservices are for you. If so here are some questions to consider
Codebase large enough that no one person understands it?
Are dev and release cycles slow because of chains of dependent changes?
Do your tests take forever to run?
If so you might be fighting a monolith
If that is the case, are you ready to support a distributed system ?
Are you leveraging automation for tests, deployment + machine mgt?
Do you have suffient monitoring and analysis in place?
If your answers are "yes" and "no", fear not . Maybe you can build a multi-lith
What About A Multi-lith?
"Sliding Scale"
There is a sliding scale between tens of entirely independent services, and a single monolith
You may choose to augment your existing monolith with one or two satelite micoservices : multi-lith (not sure it'll stick)
This way, some of the benefits (diff interpreter, try out CD) without most of the cost
Nameko
A microservices framework that lets service developers concentrate on application logic and encourages testability.
Assuming we're all emboldened and ready to embrace microservices (or a multilith). Talk about nameko
Open source (apache 2) framework designed for writing microservices
It's named after the Japanese mushroom , grow in clusters like this
Kinda like microservices, many individuals making up the larger thing
Botanist friend, "why do they grow like that?". He shrugged and said "'cause there's not mush-rum?". True story . I told him he's a fun-guy
Nameko Concepts
Entrypoints
To interact with a service
Dependencies
For the service to interact with external things
Couple of important concepts that I need to introduce to explain design principals
Entrypoints: how you request something from the service or get it to do something ; its interface/boundary
Dependencies: how the service talks to something external that it may need to communicate with e.g. database, other serv
Example I
class HelloWorld(object):
name = “hello”
@http("GET", "/greet/<string:friend>")
def greet(self, friend):
return “Hello {}!”.format(friend)
https://github.com/mattbennett/nameko-europython-demo
Jump into some code . Code in the following examples is in a repo
Nameko service is written as a python class
Has a name, declared with name attr. Has some business logic in methods
Methods are exposed with an entrypoint . http decorator calls the greet method on GET req to URL.
Example II
class HelloWorld(object):
name = “hello”
cache = CacheClient() # dependency declaration
@rpc
def greet(self, friend):
greeting = self.cache.get(friend)
if greeting is None:
greeting = “Hello {}!”.format(friend) # expensive
self.cache.put(friend, greeting)
return greeting
Let's expand the example. Pretend for a minute string formatting is expensive; cache greetings
Also changed the entrypoint to a Remote Procedure Call impl
First thing to notice : Business logic unchanged by entrypoint change.
We've added logic to deal with the cache, but it's isolated from anything to do with HTTP or RPC
In other words: declarative change, no impact on procedural code in the method
Second thing to point out: line "cache = CacheClient" is declaring a dependency
Dependency Injection
class HelloWorld(object):
name = “hello”
cache = CacheClient()
@rpc
def greet(self, friend):
print(HelloWorld.cache) # DependencyProvider
print(self.cache) # injected dependency
greeting = self.cache.get(friend)
if greeting is None:
greeting = “Hello {}!”.format(friend) # expensive
self.cache.set(friend, greeting)
return greeting
<CacheClient [unbound] at 0x10cbb2750> # DependencyProvider
<memcache.Client object at 0x10cbd25d0> # injected dependency
Dependencies are special. You declare them on the service class
But the class level attribute is different from the instance level attribute that the method sees when it executes
That's because the DependencyProvider, which is the declaration of a dependency , injects the actual dependency at runtime
Hack our method to print, we see that they are different . One is the DependencyProvider. The other is actually a memcache.Client, which the method uses to access the cache
Using dependency injection means only the relevant interface is exposed to the service method (and dev)
All the "plumbing" of that dep like managing a connection pool or handing reconnections is hidden away
Extensible
"Built-in" Extensions
HTTP GET & POST
AMQP RPC
AMQP Pub-Sub
Timer
Websockets (experimental)
Emphasis on entrypoints and dependencies make nameko very extensible
All Entrypoints and DependencyProviders are implemented as "extensions" to nameko
Even the ones that ship with the library (which are included so that it's useful out of the box)
Intention is that you free free build your own , or through wonders of open-source , someone may have already built
This is the full list of built-in extensions
The rpc decorator we've seen is AMQP based RPC implementation for Req-Resp over message bus
There is also publish-subscribe impl for async messaging over AMQP
And timer for cron-like periodic actions and experimental websockets
Worth explaining why we have this AMQP stuff in here
HTTP is a natural starting place for microservices. Lots of great, lightweight web frameworks
HTTP is ubiquitous. Great tooling around API explorers, caching and so on
You are likely to need HTTP on the outside of your services, for clients to communicate with them
But for service-to-service interaction (where you control both sides of comms) probably want something different
In particular, pub-sub is a killer app for microservices
Because all kinds of patterns in distributed systems rely on it
Test Helpers
from mock import call
from nameko.testing.services import worker_factory
hello_svc = worker_factory(HelloWorld)
hello_svc.cache.get.return_value = None
assert hello_svc.greet("Matt") == "Hello Matt!"
assert hello_svc.cache.get.call_args_list == [call("Matt")]
import mockcache
from nameko.testing.services import worker_factory
fake_cache = mockcache.Client()
hello_svc = worker_factory(HelloWorld, cache=fake_cache)
assert hello_svc.greet("Matt") == "Hello Matt!"
assert fake_cache.get("Matt") == "Hello Matt!"
Nameko also ships with some nice test helpers
Already seen how injecting dependencies keeps service interface clean and simple
But it also makes it really easy to pluck them out during testing
Snippet here, using a helper called worker_factory , useful when unit testing services.
Pass it your service class, get an instance with deps replaced by mocks . No real memcache cluster.
Exercise methods, verify mocks called appropriately
worker_factory has another mode of operation where you can provide an alternative dependency.
In this case Mockcache; much nicer interface than a plain mock for this situation; no need to setup return value
There are similar helpers for integration testing -- let you run services with mocked dependencies and disabled entrtpoints
So you can limit the integration points between services
Summary - Microservices
Application divided into services
Running in their own processes
Maintainability at scale
Independently deployable
Independently scalable
Freedom of technology
Team structure
In microservices architecture, split your application into services running as independent processes
Way to achieve maintainability at scale , so you can build cathedrals of software
And comes with a host of other benefits, like freedom of technology, decoupled release cycles, even team structure if you want, for each component part .
Summary - Microservices
"Grown up" architecture. Complex, distributed system
Need to automate your DevOps, monitor, analyse and overall be aware of distributed tradeoffs
But also you can adopt incrementally with a "multi-lith" by adding one or two microservices alongside existing stack
Summary - Nameko
Made for microservices
Encourages you to write clean, highly testable code
Useful "built-in" extensions
Designed to be extended
If you want to go on this microservices adventure , there is an open-source library that can help
Made for writing services
Encourages you to write clean, highly testable code
Several built-in extensions so it's useful out-of-the-box
But is designed to be extended
Want to know more? Read the docs, fork the repo


We offer free airport transfers
We offer free car hire for one day if you have stayed with us for more than 3 nights
Normal care hire is Ksh/2500 per day exclusive of petrol charges
Taxi hire will vary depending on distance and time needed to reach destination


Try to resize the window!
The ggf-half class uses 50% of the parent container.
On screens smaller than 601 pixels it resizes to 100%.


<equation-inline>
Use the <equation-inline> element to represent an equation that is presented inline within a paragraph or similar context. Inline equations are not intended to be numbered.
Category: Equation domain elements


public class FastBufferedInputStream extends MeasurableInputStream implements RepositionableStream
This class provides buffering for input streams, but it does so with
purposes and an internal logic that are radically different from the ones
adopted in BufferedInputStream
. The main features follow.
There is no support for marking. All methods are unsychronized.
As an additional feature, this class implements the RepositionableStream
and MeasurableStream
interfaces.
An instance of this class will try to cast
the underlying byte stream to a RepositionableStream
and to fetch by
reflection the FileChannel
underlying the given
output stream, in this order. If either reference can be successfully
fetched, you can use position(long)
to reposition the stream.
Much in the same way, an instance of this class will try to cast the
the underlying byte stream to a MeasurableStream
, and if this
operation is successful, or if a FileChannel
can
be detected, then position()
and length()
will work as expected.
Due to erratic and unpredictable behaviour of InputStream.skip(long)
,
which does not correspond to its specification and which Sun refuses to fix
(see bug 6222822;
don't be fooled by the “closed, fixed” label),
this class peeks at the underlying stream and if it is System.in
it uses
repeated reads instead of calling InputStream.skip(long)
on the underlying stream; moreover,
skips and reads are tried alternately, so to guarantee that skipping
less bytes than requested can be caused only by reaching the end of file.
This class keeps also track of the number of bytes read so far, so
to be able to implement MeasurableStream.position()
independently of underlying input stream.
This class has limited support for “reading a line” (whatever that means) from the underlying input stream. You can choose the set of line terminators that delimit lines.
Warning: Since fastutil
6.0.0, this class detects
a implementations of MeasurableStream
instead of subclasses MeasurableInputStream
(which is deprecated).
| Modifier and Type | Class and Description |
|---|---|
static class |
FastBufferedInputStream.LineTerminator
An enumeration of the supported line terminators.
|
| Modifier and Type | Field and Description |
|---|---|
static java.util.EnumSet<FastBufferedInputStream.LineTerminator> |
ALL_TERMINATORS
A set containing all available line terminators.
|
protected int |
avail
The number of buffer bytes available starting from
pos . |
protected byte[] |
buffer
The internal buffer.
|
static int |
DEFAULT_BUFFER_SIZE
The default size of the internal buffer in bytes (8Ki).
|
protected java.io.InputStream |
is
The underlying input stream.
|
protected int |
pos
The current position in the buffer.
|
protected long |
readBytes
The number of bytes ever read (reset upon a call to
position(long) ). |
| Constructor and Description |
|---|
FastBufferedInputStream(java.io.InputStream is)
Creates a new fast buffered input stream by wrapping a given input stream with a buffer of
DEFAULT_BUFFER_SIZE bytes. |
FastBufferedInputStream(java.io.InputStream is,
byte[] buffer)
Creates a new fast buffered input stream by wrapping a given input stream with a given buffer.
|
FastBufferedInputStream(java.io.InputStream is,
int bufferSize)
Creates a new fast buffered input stream by wrapping a given input stream with a given buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
flush()
Resets the internal logic of this fast buffered input stream, clearing the buffer.
|
long |
length()
Returns the length of the underlying input stream, if it is measurable.
|
protected boolean |
noMoreCharacters()
Checks whether no more bytes will be returned.
|
long |
position()
Returns the current stream position.
|
void |
position(long newPosition)
Sets the current stream position.
|
int |
read() |
int |
read(byte[] b,
int offset,
int length) |
int |
readLine(byte[] array)
Reads a line into the given byte array using all terminators.
|
int |
readLine(byte[] array,
java.util.EnumSet<FastBufferedInputStream.LineTerminator> terminators)
Reads a line into the given byte array.
|
int |
readLine(byte[] array,
int off,
int len)
Reads a line into the given byte-array fragment using all terminators.
|
int |
readLine(byte[] array,
int off,
int len,
java.util.EnumSet<FastBufferedInputStream.LineTerminator> terminators)
Reads a line into the given byte-array fragment.
|
void |
reset()
|
long |
skip(long n)
Skips over and discards the given number of bytes of data from this fast buffered input stream.
|
public static final int DEFAULT_BUFFER_SIZE
public static final java.util.EnumSet<FastBufferedInputStream.LineTerminator> ALL_TERMINATORS
protected java.io.InputStream is
protected byte[] buffer
protected int pos
protected long readBytes
position(long)
).
In particular, this will always represent the index (in the underlying input stream)
of the first available byte in the buffer.public FastBufferedInputStream(java.io.InputStream is, byte[] buffer)
is
- an input stream to wrap.buffer
- a buffer of positive length.public FastBufferedInputStream(java.io.InputStream is, int bufferSize)
is
- an input stream to wrap.bufferSize
- the size in bytes of the internal buffer (greater than zero).public FastBufferedInputStream(java.io.InputStream is)
DEFAULT_BUFFER_SIZE
bytes.is
- an input stream to wrap.protected boolean noMoreCharacters() throws java.io.IOException
This method will refill the internal buffer.
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int readLine(byte[] array) throws java.io.IOException
array
- byte array where the next line will be stored.array
, or -1 at end of file.java.io.IOException
readLine(byte[], int, int, EnumSet)
public int readLine(byte[] array, java.util.EnumSet<FastBufferedInputStream.LineTerminator> terminators) throws java.io.IOException
array
- byte array where the next line will be stored.terminators
- a set containing the line termination sequences that we want
to consider as valid.array
, or -1 at end of file.java.io.IOException
readLine(byte[], int, int, EnumSet)
public int readLine(byte[] array, int off, int len) throws java.io.IOException
array
- byte array where the next line will be stored.off
- the first byte to use in array
.len
- the maximum number of bytes to read.array
, or -1 at end of file.java.io.IOException
readLine(byte[], int, int, EnumSet)
public int readLine(byte[] array, int off, int len, java.util.EnumSet<FastBufferedInputStream.LineTerminator> terminators) throws java.io.IOException
Reading lines (i.e., characters) out of a byte stream is not always sensible (methods available to that purpose in old versions of Java have been mercilessly deprecated). Nonetheless, in several situations, such as when decoding network protocols or headers known to be ASCII, it is very useful to be able to read a line from a byte stream.
This method will attempt to read the next line into array
starting at off
,
reading at most len
bytes. The read, however, will be stopped by the end of file or
when meeting a line terminator. Of course, for this operation
to be sensible the encoding of the text contained in the stream, if any, must not generate spurious
carriage returns or line feeds. Note that the termination detection uses a maximisation
criterion, so if you specify both FastBufferedInputStream.LineTerminator.CR
and
FastBufferedInputStream.LineTerminator.CR_LF
meeting a pair CR/LF will consider the whole pair a terminator.
Terminators are not copied into array or included in the returned count. The
returned integer can be used to check whether the line is complete: if it is smaller than
len
, then more bytes might be available, but note that this method (contrarily
to read(byte[], int, int)
) can legitimately return zero when len
is nonzero just because a terminator was found as the first character. Thus, the intended
usage of this method is to call it on a given array, check whether len
bytes
have been read, and if so try again (possibly extending the array) until a number of read bytes
strictly smaller than len
(possibly, -1) is returned.
If you need to guarantee that a full line is read, use the following idiom:
int start = off, len; while((len = fbis.readLine(array, start, array.length - start, terminators)) == array.length - start) { start += len; array = ByteArrays.grow(array, array.length + 1); }
At the end of the loop, the line will be placed in array
starting at
off
(inclusive) and ending at start + Math.max(len, 0)
(exclusive).
array
- byte array where the next line will be stored.off
- the first byte to use in array
.len
- the maximum number of bytes to read.terminators
- a set containing the line termination sequences that we want
to consider as valid.array
, or -1 at end of file.
Note that the returned number will be len
if no line termination sequence
specified in terminators
has been met before scanning len
byte,
and if also we did not meet the end of file.java.io.IOException
public void position(long newPosition) throws java.io.IOException
RepositionableStream
position
in interface RepositionableStream
newPosition
- the new stream position.java.io.IOException
public long position() throws java.io.IOException
RepositionableStream
position
in interface MeasurableStream
position
in interface RepositionableStream
java.io.IOException
public long length() throws java.io.IOException
length
in interface MeasurableStream
java.lang.UnsupportedOperationException
- if the underlying input stream is not measurable and
cannot provide a FileChannel
.java.io.IOException
public long skip(long n) throws java.io.IOException
As explained in the class documentation, the semantics
of InputStream.skip(long)
is fatally flawed. This method provides additional semantics as follows:
it will skip the provided number of bytes, unless the end of file has been reached.
Additionally, if the underlying input stream is System.in
this method will use
repeated reads instead of invoking InputStream.skip(long)
.
skip
in class java.io.InputStream
n
- the number of bytes to skip.n
only if the end of file has been reached.java.io.IOException
InputStream.skip(long)
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void flush()
All buffering information is discarded, and the number of bytes read so far (and thus, also the current position) is adjusted to reflect this fact.
This method is mainly useful for re-reading files that have been overwritten externally.
@Deprecated public void reset()
fastutil
5.0.4, replaced by flush()
. The old
semantics of this method does not contradict InputStream
's contract, as
the semantics of reset()
is undefined if InputStream.markSupported()
returns false. On the other hand, the name was really a poor choice.reset
in class java.io.InputStream
Copyright © 2019. All rights reserved.