text:
function bladerf_get_device_list(devices::Ptr{Ptr{bladerf_devinfo}})
    ccall((:bladerf_get_device_list,libbladerf),Cint,(Ptr{Ptr{bladerf_devinfo}},),devices)
end

function bladerf_free_device_list(devices::Ptr{bladerf_devinfo})
    ccall((:bladerf_free_device_list,libbladerf),Void,(Ptr{bladerf_devinfo},),devices)
end

function bladerf_open_with_devinfo(device::Ptr{Ptr{bladerf}},devinfo::Ptr{bladerf_devinfo})
    ccall((:bladerf_open_with_devinfo,libbladerf),Cint,(Ptr{Ptr{bladerf}},Ptr{bladerf_devinfo}),device,devinfo)
end

function bladerf_open(device::Ptr{Ptr{bladerf}},device_identifier::Ptr{Uint8})
    ccall((:bladerf_open,libbladerf),Cint,(Ptr{Ptr{bladerf}},Ptr{Uint8}),device,device_identifier)
end

function bladerf_close(device::Ptr{bladerf})
    ccall((:bladerf_close,libbladerf),Void,(Ptr{bladerf},),device)
end

function bladerf_init_devinfo(info::Ptr{bladerf_devinfo})
    ccall((:bladerf_init_devinfo,libbladerf),Void,(Ptr{bladerf_devinfo},),info)
end

function bladerf_get_devinfo(dev::Ptr{bladerf},info::Ptr{bladerf_devinfo})
    ccall((:bladerf_get_devinfo,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_devinfo}),dev,info)
end

function bladerf_get_devinfo_from_str(devstr::Ptr{Uint8},info::Ptr{bladerf_devinfo})
    ccall((:bladerf_get_devinfo_from_str,libbladerf),Cint,(Ptr{Uint8},Ptr{bladerf_devinfo}),devstr,info)
end

function bladerf_devinfo_matches(a::Ptr{bladerf_devinfo},b::Ptr{bladerf_devinfo})
    ccall((:bladerf_devinfo_matches,libbladerf),Bool,(Ptr{bladerf_devinfo},Ptr{bladerf_devinfo}),a,b)
end

function bladerf_devstr_matches(dev_str::Ptr{Uint8},info::Ptr{bladerf_devinfo})
    ccall((:bladerf_devstr_matches,libbladerf),Bool,(Ptr{Uint8},Ptr{bladerf_devinfo}),dev_str,info)
end

function bladerf_backend_str(backend::bladerf_backend)
    ccall((:bladerf_backend_str,libbladerf),Ptr{Uint8},(bladerf_backend,),backend)
end

function bladerf_enable_module(dev::Ptr{bladerf},m::bladerf_module,enable::Bool)
    ccall((:bladerf_enable_module,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Bool),dev,m,enable)
end

function bladerf_set_loopback(dev::Ptr{bladerf},l::bladerf_loopback)
    ccall((:bladerf_set_loopback,libbladerf),Cint,(Ptr{bladerf},bladerf_loopback),dev,l)
end

function bladerf_get_loopback(dev::Ptr{bladerf},l::Ptr{bladerf_loopback})
    ccall((:bladerf_get_loopback,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_loopback}),dev,l)
end

function bladerf_set_sample_rate(dev::Ptr{bladerf},_module::bladerf_module,rate::Uint32,actual::Ptr{Uint32})
    ccall((:bladerf_set_sample_rate,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Uint32,Ptr{Uint32}),dev,_module,rate,actual)
end

function bladerf_set_rational_sample_rate(dev::Ptr{bladerf},_module::bladerf_module,rate::Ptr{bladerf_rational_rate},actual::Ptr{bladerf_rational_rate})
    ccall((:bladerf_set_rational_sample_rate,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{bladerf_rational_rate},Ptr{bladerf_rational_rate}),dev,_module,rate,actual)
end

function bladerf_set_sampling(dev::Ptr{bladerf},sampling::bladerf_sampling)
    ccall((:bladerf_set_sampling,libbladerf),Cint,(Ptr{bladerf},bladerf_sampling),dev,sampling)
end

function bladerf_get_sampling(dev::Ptr{bladerf},sampling::Ptr{bladerf_sampling})
    ccall((:bladerf_get_sampling,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_sampling}),dev,sampling)
end

function bladerf_get_sample_rate(dev::Ptr{bladerf},_module::bladerf_module,rate::Ptr{Uint32})
    ccall((:bladerf_get_sample_rate,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{Uint32}),dev,_module,rate)
end

function bladerf_get_rational_sample_rate(dev::Ptr{bladerf},_module::bladerf_module,rate::Ptr{bladerf_rational_rate})
    ccall((:bladerf_get_rational_sample_rate,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{bladerf_rational_rate}),dev,_module,rate)
end

function bladerf_set_correction(dev::Ptr{bladerf},_module::bladerf_module,corr::bladerf_correction,value::Int16)
    ccall((:bladerf_set_correction,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_correction,Int16),dev,_module,corr,value)
end

function bladerf_get_correction(dev::Ptr{bladerf},_module::bladerf_module,corr::bladerf_correction,value::Ptr{Int16})
    ccall((:bladerf_get_correction,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_correction,Ptr{Int16}),dev,_module,corr,value)
end

function bladerf_set_txvga2(dev::Ptr{bladerf},gain::Cint)
    ccall((:bladerf_set_txvga2,libbladerf),Cint,(Ptr{bladerf},Cint),dev,gain)
end

function bladerf_get_txvga2(dev::Ptr{bladerf},gain::Ptr{Cint})
    ccall((:bladerf_get_txvga2,libbladerf),Cint,(Ptr{bladerf},Ptr{Cint}),dev,gain)
end

function bladerf_set_txvga1(dev::Ptr{bladerf},gain::Cint)
    ccall((:bladerf_set_txvga1,libbladerf),Cint,(Ptr{bladerf},Cint),dev,gain)
end

function bladerf_get_txvga1(dev::Ptr{bladerf},gain::Ptr{Cint})
    ccall((:bladerf_get_txvga1,libbladerf),Cint,(Ptr{bladerf},Ptr{Cint}),dev,gain)
end

function bladerf_set_tx_gain(dev::Ptr{bladerf},gain::Cint)
    ccall((:bladerf_set_tx_gain,libbladerf),Cint,(Ptr{bladerf},Cint),dev,gain)
end

function bladerf_set_lna_gain(dev::Ptr{bladerf},gain::bladerf_lna_gain)
    ccall((:bladerf_set_lna_gain,libbladerf),Cint,(Ptr{bladerf},bladerf_lna_gain),dev,gain)
end

function bladerf_get_lna_gain(dev::Ptr{bladerf},gain::Ptr{bladerf_lna_gain})
    ccall((:bladerf_get_lna_gain,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_lna_gain}),dev,gain)
end

function bladerf_set_rxvga1(dev::Ptr{bladerf},gain::Cint)
    ccall((:bladerf_set_rxvga1,libbladerf),Cint,(Ptr{bladerf},Cint),dev,gain)
end

function bladerf_get_rxvga1(dev::Ptr{bladerf},gain::Ptr{Cint})
    ccall((:bladerf_get_rxvga1,libbladerf),Cint,(Ptr{bladerf},Ptr{Cint}),dev,gain)
end

function bladerf_set_rxvga2(dev::Ptr{bladerf},gain::Cint)
    ccall((:bladerf_set_rxvga2,libbladerf),Cint,(Ptr{bladerf},Cint),dev,gain)
end

function bladerf_get_rxvga2(dev::Ptr{bladerf},gain::Ptr{Cint})
    ccall((:bladerf_get_rxvga2,libbladerf),Cint,(Ptr{bladerf},Ptr{Cint}),dev,gain)
end

function bladerf_set_gain(dev::Ptr{bladerf},mod::bladerf_module,gain::Cint)
    ccall((:bladerf_set_gain,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Cint),dev,mod,gain)
end

function bladerf_set_bandwidth(dev::Ptr{bladerf},_module::bladerf_module,bandwidth::Uint32,actual::Ptr{Uint32})
    ccall((:bladerf_set_bandwidth,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Uint32,Ptr{Uint32}),dev,_module,bandwidth,actual)
end

function bladerf_get_bandwidth(dev::Ptr{bladerf},_module::bladerf_module,bandwidth::Ptr{Uint32})
    ccall((:bladerf_get_bandwidth,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{Uint32}),dev,_module,bandwidth)
end

function bladerf_set_lpf_mode(dev::Ptr{bladerf},_module::bladerf_module,mode::bladerf_lpf_mode)
    ccall((:bladerf_set_lpf_mode,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_lpf_mode),dev,_module,mode)
end

function bladerf_get_lpf_mode(dev::Ptr{bladerf},_module::bladerf_module,mode::Ptr{bladerf_lpf_mode})
    ccall((:bladerf_get_lpf_mode,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{bladerf_lpf_mode}),dev,_module,mode)
end

function bladerf_select_band(dev::Ptr{bladerf},_module::bladerf_module,frequency::Uint32)
    ccall((:bladerf_select_band,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Uint32),dev,_module,frequency)
end

function bladerf_set_frequency(dev::Ptr{bladerf},_module::bladerf_module,frequency::Uint32)
    ccall((:bladerf_set_frequency,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Uint32),dev,_module,frequency)
end

function bladerf_get_frequency(dev::Ptr{bladerf},_module::bladerf_module,frequency::Ptr{Uint32})
    ccall((:bladerf_get_frequency,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{Uint32}),dev,_module,frequency)
end

function bladerf_expansion_attach(dev::Ptr{bladerf},xb::bladerf_xb)
    ccall((:bladerf_expansion_attach,libbladerf),Cint,(Ptr{bladerf},bladerf_xb),dev,xb)
end

function bladerf_expansion_get_attached(dev::Ptr{bladerf},xb::Ptr{bladerf_xb})
    ccall((:bladerf_expansion_get_attached,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_xb}),dev,xb)
end

function bladerf_xb200_set_filterbank(dev::Ptr{bladerf},mod::bladerf_module,filter::bladerf_xb200_filter)
    ccall((:bladerf_xb200_set_filterbank,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_xb200_filter),dev,mod,filter)
end

function bladerf_xb200_get_filterbank(dev::Ptr{bladerf},_module::bladerf_module,filter::Ptr{bladerf_xb200_filter})
    ccall((:bladerf_xb200_get_filterbank,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{bladerf_xb200_filter}),dev,_module,filter)
end

function bladerf_xb200_set_path(dev::Ptr{bladerf},_module::bladerf_module,path::bladerf_xb200_path)
    ccall((:bladerf_xb200_set_path,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_xb200_path),dev,_module,path)
end

function bladerf_xb200_get_path(dev::Ptr{bladerf},_module::bladerf_module,path::Ptr{bladerf_xb200_path})
    ccall((:bladerf_xb200_get_path,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{bladerf_xb200_path}),dev,_module,path)
end

function bladerf_init_stream(stream::Ptr{Ptr{bladerf_stream}},dev::Ptr{bladerf},callback::bladerf_stream_cb,buffers::Ptr{Ptr{Ptr{Void}}},num_buffers::Csize_t,format::bladerf_format,samples_per_buffer::Csize_t,num_transfers::Csize_t,user_data::Ptr{Void})
    ccall((:bladerf_init_stream,libbladerf),Cint,(Ptr{Ptr{bladerf_stream}},Ptr{bladerf},bladerf_stream_cb,Ptr{Ptr{Ptr{Void}}},Csize_t,bladerf_format,Csize_t,Csize_t,Ptr{Void}),stream,dev,callback,buffers,num_buffers,format,samples_per_buffer,num_transfers,user_data)
end

function bladerf_stream(stream::Ptr{bladerf_stream},_module::bladerf_module)
    ccall((:bladerf_stream,libbladerf),Cint,(Ptr{bladerf_stream},bladerf_module),stream,_module)
end

function bladerf_submit_stream_buffer(stream::Ptr{bladerf_stream},buffer::Ptr{Void},timeout_ms::Uint32)
    ccall((:bladerf_submit_stream_buffer,libbladerf),Cint,(Ptr{bladerf_stream},Ptr{Void},Uint32),stream,buffer,timeout_ms)
end

function bladerf_deinit_stream(stream::Ptr{bladerf_stream})
    ccall((:bladerf_deinit_stream,libbladerf),Void,(Ptr{bladerf_stream},),stream)
end

function bladerf_set_stream_timeout(dev::Ptr{bladerf},_module::bladerf_module,timeout::Uint32)
    ccall((:bladerf_set_stream_timeout,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Uint32),dev,_module,timeout)
end

function bladerf_get_stream_timeout(dev::Ptr{bladerf},_module::bladerf_module,timeout::Ptr{Uint32})
    ccall((:bladerf_get_stream_timeout,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{Uint32}),dev,_module,timeout)
end

function bladerf_sync_config(dev::Ptr{bladerf},_module::bladerf_module,format::bladerf_format,num_buffers::Uint32,buffer_size::Uint32,num_transfers::Uint32,stream_timeout::Uint32)
    ccall((:bladerf_sync_config,libbladerf),Cint,(Ptr{bladerf},bladerf_module,bladerf_format,Uint32,Uint32,Uint32,Uint32),dev,_module,format,num_buffers,buffer_size,num_transfers,stream_timeout)
end

function bladerf_sync_tx(dev::Ptr{bladerf},samples::Ptr{Void},num_samples::Uint32,metadata::Ptr{bladerf_metadata},timeout_ms::Uint32)
    ccall((:bladerf_sync_tx,libbladerf),Cint,(Ptr{bladerf},Ptr{Void},Uint32,Ptr{bladerf_metadata},Uint32),dev,samples,num_samples,metadata,timeout_ms)
end

function bladerf_sync_rx(dev::Ptr{bladerf},samples::Ptr{Void},num_samples::Uint32,metadata::Ptr{bladerf_metadata},timeout_ms::Uint32)
    ccall((:bladerf_sync_rx,libbladerf),Cint,(Ptr{bladerf},Ptr{Void},Uint32,Ptr{bladerf_metadata},Uint32),dev,samples,num_samples,metadata,timeout_ms)
end

function bladerf_get_serial(dev::Ptr{bladerf},serial::Ptr{Uint8})
    ccall((:bladerf_get_serial,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8}),dev,serial)
end

function bladerf_get_vctcxo_trim(dev::Ptr{bladerf},trim::Ptr{Uint16})
    ccall((:bladerf_get_vctcxo_trim,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint16}),dev,trim)
end

function bladerf_get_fpga_size(dev::Ptr{bladerf},size::Ptr{bladerf_fpga_size})
    ccall((:bladerf_get_fpga_size,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_fpga_size}),dev,size)
end

function bladerf_fw_version(dev::Ptr{bladerf},version::Ptr{bladerf_version})
    ccall((:bladerf_fw_version,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_version}),dev,version)
end

function bladerf_is_fpga_configured(dev::Ptr{bladerf})
    ccall((:bladerf_is_fpga_configured,libbladerf),Cint,(Ptr{bladerf},),dev)
end

function bladerf_fpga_version(dev::Ptr{bladerf},version::Ptr{bladerf_version})
    ccall((:bladerf_fpga_version,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_version}),dev,version)
end

function bladerf_device_speed(dev::Ptr{bladerf})
    ccall((:bladerf_device_speed,libbladerf),bladerf_dev_speed,(Ptr{bladerf},),dev)
end

function bladerf_flash_firmware(dev::Ptr{bladerf},firmware::Ptr{Uint8})
    ccall((:bladerf_flash_firmware,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8}),dev,firmware)
end

function bladerf_load_fpga(dev::Ptr{bladerf},fpga::Ptr{Uint8})
    ccall((:bladerf_load_fpga,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8}),dev,fpga)
end

function bladerf_flash_fpga(dev::Ptr{bladerf},fpga_image::Ptr{Uint8})
    ccall((:bladerf_flash_fpga,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8}),dev,fpga_image)
end

function bladerf_erase_stored_fpga(dev::Ptr{bladerf})
    ccall((:bladerf_erase_stored_fpga,libbladerf),Cint,(Ptr{bladerf},),dev)
end

function bladerf_device_reset(dev::Ptr{bladerf})
    ccall((:bladerf_device_reset,libbladerf),Cint,(Ptr{bladerf},),dev)
end

function bladerf_jump_to_bootloader(dev::Ptr{bladerf})
    ccall((:bladerf_jump_to_bootloader,libbladerf),Cint,(Ptr{bladerf},),dev)
end

function bladerf_strerror(error::Cint)
    ccall((:bladerf_strerror,libbladerf),Ptr{Uint8},(Cint,),error)
end

function bladerf_version(version::Ptr{bladerf_version})
    ccall((:bladerf_version,libbladerf),Void,(Ptr{bladerf_version},),version)
end

function bladerf_log_set_verbosity(level::bladerf_log_level)
    ccall((:bladerf_log_set_verbosity,libbladerf),Void,(bladerf_log_level,),level)
end

function bladerf_alloc_image(_type::bladerf_image_type,address::Uint32,length::Uint32)
    ccall((:bladerf_alloc_image,libbladerf),Ptr{bladerf_image},(bladerf_image_type,Uint32,Uint32),_type,address,length)
end

function bladerf_alloc_cal_image(fpga_size::bladerf_fpga_size,vctcxo_trim::Uint16)
    ccall((:bladerf_alloc_cal_image,libbladerf),Ptr{bladerf_image},(bladerf_fpga_size,Uint16),fpga_size,vctcxo_trim)
end

function bladerf_free_image(image::Ptr{bladerf_image})
    ccall((:bladerf_free_image,libbladerf),Void,(Ptr{bladerf_image},),image)
end

function bladerf_image_write(image::Ptr{bladerf_image},file::Ptr{Uint8})
    ccall((:bladerf_image_write,libbladerf),Cint,(Ptr{bladerf_image},Ptr{Uint8}),image,file)
end

function bladerf_image_read(image::Ptr{bladerf_image},file::Ptr{Uint8})
    ccall((:bladerf_image_read,libbladerf),Cint,(Ptr{bladerf_image},Ptr{Uint8}),image,file)
end

function bladerf_si5338_read(dev::Ptr{bladerf},address::Uint8,val::Ptr{Uint8})
    ccall((:bladerf_si5338_read,libbladerf),Cint,(Ptr{bladerf},Uint8,Ptr{Uint8}),dev,address,val)
end

function bladerf_si5338_write(dev::Ptr{bladerf},address::Uint8,val::Uint8)
    ccall((:bladerf_si5338_write,libbladerf),Cint,(Ptr{bladerf},Uint8,Uint8),dev,address,val)
end

function bladerf_si5338_set_tx_freq(dev::Ptr{bladerf},freq::Uint32)
    ccall((:bladerf_si5338_set_tx_freq,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,freq)
end

function bladerf_si5338_set_rx_freq(dev::Ptr{bladerf},freq::Uint32)
    ccall((:bladerf_si5338_set_rx_freq,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,freq)
end

function bladerf_lms_read(dev::Ptr{bladerf},address::Uint8,val::Ptr{Uint8})
    ccall((:bladerf_lms_read,libbladerf),Cint,(Ptr{bladerf},Uint8,Ptr{Uint8}),dev,address,val)
end

function bladerf_lms_write(dev::Ptr{bladerf},address::Uint8,val::Uint8)
    ccall((:bladerf_lms_write,libbladerf),Cint,(Ptr{bladerf},Uint8,Uint8),dev,address,val)
end

function bladerf_lms_set_dc_cals(dev::Ptr{bladerf},dc_cals::Ptr{bladerf_lms_dc_cals})
    ccall((:bladerf_lms_set_dc_cals,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_lms_dc_cals}),dev,dc_cals)
end

function bladerf_lms_get_dc_cals(dev::Ptr{bladerf},dc_cals::Ptr{bladerf_lms_dc_cals})
    ccall((:bladerf_lms_get_dc_cals,libbladerf),Cint,(Ptr{bladerf},Ptr{bladerf_lms_dc_cals}),dev,dc_cals)
end

function bladerf_config_gpio_read(dev::Ptr{bladerf},val::Ptr{Uint32})
    ccall((:bladerf_config_gpio_read,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint32}),dev,val)
end

function bladerf_config_gpio_write(dev::Ptr{bladerf},val::Uint32)
    ccall((:bladerf_config_gpio_write,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,val)
end

function bladerf_expansion_gpio_read(dev::Ptr{bladerf},val::Ptr{Uint32})
    ccall((:bladerf_expansion_gpio_read,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint32}),dev,val)
end

function bladerf_expansion_gpio_write(dev::Ptr{bladerf},val::Uint32)
    ccall((:bladerf_expansion_gpio_write,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,val)
end

function bladerf_expansion_gpio_dir_read(dev::Ptr{bladerf},val::Ptr{Uint32})
    ccall((:bladerf_expansion_gpio_dir_read,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint32}),dev,val)
end

function bladerf_expansion_gpio_dir_write(dev::Ptr{bladerf},val::Uint32)
    ccall((:bladerf_expansion_gpio_dir_write,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,val)
end

function bladerf_get_timestamp(dev::Ptr{bladerf},mod::bladerf_module,value::Ptr{Uint64})
    ccall((:bladerf_get_timestamp,libbladerf),Cint,(Ptr{bladerf},bladerf_module,Ptr{Uint64}),dev,mod,value)
end

function bladerf_dac_write(dev::Ptr{bladerf},val::Uint16)
    ccall((:bladerf_dac_write,libbladerf),Cint,(Ptr{bladerf},Uint16),dev,val)
end

function bladerf_xb_spi_write(dev::Ptr{bladerf},val::Uint32)
    ccall((:bladerf_xb_spi_write,libbladerf),Cint,(Ptr{bladerf},Uint32),dev,val)
end

function bladerf_calibrate_dc(dev::Ptr{bladerf},_module::bladerf_cal_module)
    ccall((:bladerf_calibrate_dc,libbladerf),Cint,(Ptr{bladerf},bladerf_cal_module),dev,_module)
end

function bladerf_erase_flash(dev::Ptr{bladerf},erase_block::Uint32,count::Uint32)
    ccall((:bladerf_erase_flash,libbladerf),Cint,(Ptr{bladerf},Uint32,Uint32),dev,erase_block,count)
end

function bladerf_read_flash(dev::Ptr{bladerf},buf::Ptr{Uint8},page::Uint32,count::Uint32)
    ccall((:bladerf_read_flash,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8},Uint32,Uint32),dev,buf,page,count)
end

function bladerf_write_flash(dev::Ptr{bladerf},buf::Ptr{Uint8},page::Uint32,count::Uint32)
    ccall((:bladerf_write_flash,libbladerf),Cint,(Ptr{bladerf},Ptr{Uint8},Uint32,Uint32),dev,buf,page,count)
end


text:
check: examples
	go test ./...

example_source := $(wildcard example/*.go)
example_binaries := $(patsubst %.go,%,$(example_source))

# Clean up binaries.
clean:
	$(RM) $(example_binaries)

# Reformat the source files to match our layout standards.
format:
	gofmt -w .

# Invoke gofmt's "simplify" option to streamline the source code.
simplify:
	gofmt -w -s .

# Build the examples (we have no tests for them).
examples: $(example_binaries)

%: %.go
	go build -o $@ $<

.PHONY: check clean format examples simplify

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: Miranda - Riley Wedding
date: 2016-05-24
author: Joan Cabrera
tags: weekly links, java
status: published
summary: Cum sociis natoque penatibus et magnis.
banner: images/banner/office-01.jpg
booking:
  startDate: 03/18/2016
  endDate: 03/22/2016
  ctyhocn: TOLTOHX
  groupCode: MRW
published: true
---
Nulla nisl augue, varius ac accumsan nec, molestie sed nulla. Quisque sit amet venenatis turpis. Duis mauris justo, ullamcorper eget pellentesque ut, dignissim ac enim. Maecenas varius rhoncus posuere. Donec finibus vehicula porttitor. Curabitur justo ipsum, consequat id accumsan vel, varius eget nulla. Cras orci turpis, lobortis nec lectus sed, ornare condimentum augue.

* Sed at quam fringilla, rhoncus tellus nec, pulvinar velit
* Vestibulum sit amet arcu eget tortor finibus malesuada malesuada nec diam
* Phasellus vitae diam commodo erat sollicitudin mollis vitae ac lacus
* Donec maximus mauris id justo ultricies, vel rhoncus nulla ornare.

Sed gravida pretium purus, sed hendrerit urna dignissim a. Fusce eu dolor ligula. Sed nec rhoncus augue. Sed libero nulla, luctus vel libero eget, facilisis facilisis sem. Fusce feugiat neque ut est dictum placerat. Maecenas arcu lacus, finibus eu blandit non, pharetra eu libero. Nulla sed sagittis nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.


text:
=encoding utf-8

=head1 NAME

ngx_stream_ssl_preread_module - Module ngx_stream_ssl_preread_module

=head1

The C<ngx_stream_ssl_preread_module> module (1.11.5) allows
extracting information from the
L<ClientHello|https://tools.ietf.org/html/rfc5246#section-7.4.1.2>
message without terminating SSLE<sol>TLS,
for example, the sever name requested through
L<SNI|https://tools.ietf.org/html/rfc6066#section-3>.
This module is not built by default, it should be enabled with the
C<--with-stream_ssl_preread_module>
configuration parameter.

=head1 Example Configuration

    map $ssl_preread_server_name $name {
        backend.example.com      backend;
        default                  backend2;
    }

    upstream backend {
        server 192.168.0.1:12345;
        server 192.168.0.2:12345;
    }

    upstream backend2 {
        server 192.168.0.3:12345;
        server 192.168.0.4:12345;
    }

    server {
        listen      12346;
        proxy_pass  $name;
        ssl_preread on;
    }

=head1 Directives

=head2 ssl_preread

B<syntax:> ssl_preread I<C<on> E<verbar> C<off>>

B<default:> I<off>

B<context:> I<stream>

B<context:> I<server>

Enables extracting information from the ClientHello message at
the L<preread|stream_processing> phase.

=head1 Embedded Variables

=over

=item C<$ssl_preread_server_name>

returns the server name requested through SNI

=back


text:
package validation

import (
	"k8s.io/apimachinery/pkg/util/validation/field"
	"k8s.io/kubernetes/pkg/api/validation"

	buildvalidation "github.com/openshift/origin/pkg/build/apis/build/validation"
	"github.com/openshift/origin/pkg/build/controller/build/overrides/api"
)

func ValidateBuildOverridesConfig(config *api.BuildOverridesConfig) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, buildvalidation.ValidateImageLabels(config.ImageLabels, field.NewPath("imageLabels"))...)
	allErrs = append(allErrs, buildvalidation.ValidateNodeSelector(config.NodeSelector, field.NewPath("nodeSelector"))...)
	allErrs = append(allErrs, validation.ValidateAnnotations(config.Annotations, field.NewPath("annotations"))...)

	return allErrs
}


text:
import inspect
import sys

from .unic import unic

def printable_name(string, code_style=False):
    """Generates and returns printable name from the given string.

    Examples:
    'simple'           -> 'Simple'
    'name with spaces' -> 'Name With Spaces'
    'more   spaces'    -> 'More Spaces'
    'Cases AND spaces' -> 'Cases AND Spaces'
    ''                 -> ''

    If 'code_style' is True:

    'mixedCAPSCamel'   -> 'Mixed CAPS Camel'
    'camelCaseName'    -> 'Camel Case Name'
    'under_score_name' -> 'Under Score Name'
    'under_and space'  -> 'Under And Space'
    'miXed_CAPS_nAMe'  -> 'MiXed CAPS NAMe'
    ''                 -> ''
    """
    if code_style and '_' in string:
        string = string.replace('_', ' ')
    parts = string.split()
    if not parts:
        return ''
    if code_style and len(parts) == 1:
        parts = _splitCamelCaseString(parts[0])
    return ' '.join(part[0].upper() + part[1:] for part in parts if part != '')

def _splitCamelCaseString(string):
    parts = []
    current_part = []
    string = ' ' + string + ' '  # extra spaces make going through string easier
    for i in range(1, len(string)-1):
        # on 1st/last round prev/next is ' ' and char is 1st/last real char
        prev, char, next = string[i-1:i+2]
        if _isWordBoundary(prev, char, next):
            parts.append(''.join(current_part))
            current_part = [char]
        else:
            current_part.append(char)
    parts.append(''.join(current_part))   # append last part
    return parts

def _isWordBoundary(prev, char, next):
    if char.isupper():
        return (prev.islower() or next.islower()) and prev.isalnum()
    if char.isdigit():
        return prev.isalpha()
    return prev.isdigit()

def plural_or_not(item):
    count = item if isinstance(item, (int, long)) else len(item)
    return '' if count == 1 else 's'

def seq2str(sequence, quote="'", sep=', ', lastsep=' and '):
    """Returns sequence in format 'item 1', 'item 2' and 'item 3'"""
    quote_elem = lambda string: quote + unic(string) + quote
    if not sequence:
        return ''
    if len(sequence) == 1:
        return quote_elem(sequence[0])
    elems = [quote_elem(s) for s in sequence[:-2]]
    elems.append(quote_elem(sequence[-2]) + lastsep + quote_elem(sequence[-1]))
    return sep.join(elems)

def seq2str2(sequence):
    """Returns sequence in format [ item 1 | item 2 | ... ] """
    if not sequence:
        return '[ ]'
    return '[ %s ]' % ' | '.join(unic(item) for item in sequence)

def getdoc(item):
    doc = inspect.getdoc(item) or u''
    if isinstance(doc, unicode):
        return doc
    try:
        return doc.decode('UTF-8')
    except UnicodeDecodeError:
        return unic(doc)

# On IronPython sys.stdxxx.isatty() always returns True
if sys.platform != 'cli':

    def isatty(stream):
        return hasattr(stream, 'isatty') and stream.isatty()

else:

    from ctypes import windll

    _HANDLE_IDS = {sys.__stdout__ : -11, sys.__stderr__ : -12}
    _CONSOLE_TYPE = 2

    def isatty(stream):
        if stream not in _HANDLE_IDS:
            return False
        handle = windll.kernel32.GetStdHandle(_HANDLE_IDS[stream])
        return windll.kernel32.GetFileType(handle) == _CONSOLE_TYPE


text:
require "isolation/abstract_unit"
require "rails/command"
require "rails/commands/secrets/secrets_command"

class Rails::Command::SecretsCommandTest < ActiveSupport::TestCase
  include ActiveSupport::Testing::Isolation

  def setup
    build_app
  end

  def teardown
    teardown_app
  end

  test "edit without editor gives hint" do
    assert_match "No $EDITOR to open decrypted secrets in", run_edit_command(editor: "")
  end

  test "edit secrets" do
    # Runs setup before first edit.
    assert_match(/Adding config\/secrets\.yml\.key to store the encryption key/, run_edit_command)

    # Run twice to ensure encrypted secrets can be reread after first edit pass.
    2.times do
      assert_match(/external_api_key: 1466aac22e6a869134be3d09b9e89232fc2c2289…/, run_edit_command)
    end
  end

  private
    def run_edit_command(editor: "cat")
      Dir.chdir(app_path) { `EDITOR="#{editor}" bin/rails secrets:edit` }
    end
end


text:
package org.apache.camel.itest.karaf;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;

@RunWith(PaxExam.class)
public class CamelSpringRedisTest extends AbstractFeatureTest {

    public static final String COMPONENT = extractName(CamelSpringRedisTest.class);

    @Test
    public void test() throws Exception {
        testComponent(COMPONENT);
    }

    @Configuration
    public static Option[] configure() {
        return configure(COMPONENT);
    }

}


text:
@interface Auth0User : NSData {
    NSString * _auth0AccessToken;
    NSString * _idToken;
    NSDictionary * _profile;
}

@property (readonly) NSString *Auth0AccessToken;
@property (readonly) NSString *IdToken;
@property (readonly) NSDictionary *Profile;

+ (Auth0User *)auth0User:(NSDictionary *)accountProperties;

@end


text:
package com.tngtech.jgiven.report.model;

final class ExecutionStatusCalculator extends ReportModelVisitor {
    private int failedCount;
    private int pendingCount;
    private int totalCount;
    private ExecutionStatus status;

    @Override
    public void visit( StepModel stepModel ) {
        if( stepModel.isFailed() ) {
            failedCount++;
        } else if( stepModel.isPending() ) {
            pendingCount++;
        }
        totalCount++;
    }

    public ExecutionStatus executionStatus() {
        if( status != null ) {
            return status;
        }

        if( failedCount > 0 ) {
            return ExecutionStatus.FAILED;
        }

        if( pendingCount > 0 ) {
            if( pendingCount < totalCount ) {
                return ExecutionStatus.SOME_STEPS_PENDING;
            }
            return ExecutionStatus.SCENARIO_PENDING;
        }

        return ExecutionStatus.SUCCESS;
    }
}


text:
namespace serialize
{
	class input
	{
	public:
		input( const std::string &fileName ): fileStream( fileName,
			        std::ifstream::binary ) {}

		template<typename T>
		T read()
		{
			T data;
			fileStream.read( reinterpret_cast<char *>( &data ), sizeof( T ) );
			return data;
		}

		template<typename T>
		void read( T &data )
		{
			fileStream.read( reinterpret_cast<char *>( &data ), sizeof( T ) );
		}

		template<typename T>
		void read( T *data, unsigned int size )
		{
			fileStream.read( reinterpret_cast<char *>( data ), sizeof( T ) * size );
		}

		bool exists() const
		{
			return fileStream.good();
		}

		void close()
		{
			fileStream.close();
		}

	private:
		std::ifstream fileStream;
	};

	class output
	{
	public:
		output( const std::string &fileName ): fileStream( fileName,
			        std::ofstream::binary ) {}

		template<typename T>
		void write( T data )
		{
			fileStream.write( reinterpret_cast<char *>( &data ), sizeof( T ) );
		}

		template<typename T>
		void write( T *data, unsigned int size )
		{
			fileStream.write( reinterpret_cast<char *>( data ), sizeof( T ) * size );
		}

		void close()
		{
			fileStream.close();
		}

	private:
		std::ofstream fileStream;
	};
}

#endif


text:
This is the source code used in this video: [Getting started with Firebase Authentication on the web](https://youtu.be/rbuSx1yEgV8).

## Prerequisites

* Install the Firebase CLI tools and the Firebase Emulator suite ([instructions](https://firebase.google.com/docs/emulator-suite/install_and_configure))

## How to use

1. Clone the repository
2. Navigate into the root folder of this project
3. Install the dependencies

    ```bash
    $ npm install
    ```

4.  Run webpack to bundle your code:

    ```bash
    $ npx webpack
    ```

5. Run the Firebase Emulator to host your app locally:

    ```bash
    $ firebase emulators:start
    ```

6. Open `http://localhost:5001` in your browser
  ![](images/login.png)
7. Sign up using an email address and password of your choice (e.g. `me@awesomekittens.test`)
8. You should now be signed in
  ![](images/loggedin.png)
9. Navigate to `http://localhost:4000/auth` to see the newly created user in the Firebase Authentication Emulator UI
  ![](images/auth_emulator_ui.png)
10. Go back to the app, and sign out
11. Sign in using the credentials you used to create the test account


text:
package org.jetbrains.ether;

import org.jetbrains.jps.model.JpsModuleRootModificationUtil;
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
import org.jetbrains.jps.model.java.compiler.JavaCompilers;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration;
import org.jetbrains.jps.model.module.JpsModule;

/**
 * @author: db
 */
public class FieldPropertyTest extends IncrementalTestCase {
  public FieldPropertyTest() {
    super("fieldProperties");
  }

  public void testConstantChain() {
    doTest();
  }

  public void testConstantChain1() {
    doTest();
  }

  public void testConstantChain2() {
    doTest();
  }

  public void testConstantChainMultiModule() {
    JpsModule moduleA = addModule("moduleA", "moduleA/src");
    JpsModule moduleB = addModule("moduleB", "moduleB/src");
    JpsModule moduleC = addModule("moduleC", "moduleC/src");
    JpsModuleRootModificationUtil.addDependency(moduleB, moduleA);
    JpsModuleRootModificationUtil.addDependency(moduleC, moduleB);
    doTestBuild(1).assertSuccessful();
  }

  public void testConstantRemove() {
    doTest();
  }

  public void testConstantRemove1() {
    doTest();
  }

  public void testDoubleConstantChange() {
    doTest();
  }

  public void testFloatConstantChange() {
    doTest();
  }

  public void testInnerConstantChange() {
    doTest();
  }

  public void testIntConstantChange() {
    doTest();
  }

  public void testIntNonStaticConstantChange() {
    doTest();
  }

  public void testLongConstantChange() {
    doTest();
  }

  public void testNonCompileTimeConstant() {
    doTest();
  }

  public void testStringConstantChange() {
    doTest();
  }

  public void testStringConstantChangeWithECJ() {
    setupInitialProject();
    final JpsJavaCompilerConfiguration config = JpsJavaExtensionService.getInstance().getCompilerConfiguration(myProject);
    config.setJavaCompilerId(JavaCompilers.ECLIPSE_ID);

    doTestBuild(1);
  }

  public void testStringConstantLessAccessible() {
    doTest();
  }

  public void testTypeChange() {
    doTest();
  }

  public void testTypeChange1() {
    doTest();
  }

  public void testTypeChange2() {
    doTest();
  }

  public void testNonIncremental1() {
    doTest();
  }

  public void testNonIncremental2() {
    doTest();
  }

  public void testNonIncremental3() {
    doTest();
  }

  public void testNonIncremental4() {
    doTest();
  }

  public void testMutualConstants() {
    doTest();
  }
}


text:
package org.springframework.boot.test.autoconfigure.web.reactive.webclient;

import reactor.core.publisher.Mono;

import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Example {@link Controller} used with {@link WebFluxTest} tests.
 *
 * @author Stephane Nicoll
 */
@RestController
public class ExampleController1 {

	@GetMapping("/one")
	public Mono<String> one() {
		return Mono.just("one");
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item name="swipeRefreshLayout" type="id" />
    <item name="flLazyLoadContainer" type="id" />
</resources>


text:
namespace boost {
namespace asio {

namespace detail
{
  template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition>
  std::size_t read_at_buffer_sequence(SyncRandomAccessReadDevice& d,
      uint64_t offset, const MutableBufferSequence& buffers,
      const MutableBufferIterator&, CompletionCondition completion_condition,
      boost::system::error_code& ec)
  {
    ec = boost::system::error_code();
    boost::asio::detail::consuming_buffers<mutable_buffer,
        MutableBufferSequence, MutableBufferIterator> tmp(buffers);
    while (!tmp.empty())
    {
      if (std::size_t max_size = detail::adapt_completion_condition_result(
            completion_condition(ec, tmp.total_consumed())))
      {
        tmp.consume(d.read_some_at(offset + tmp.total_consumed(),
              tmp.prepare(max_size), ec));
      }
      else
        break;
    }
    return tmp.total_consumed();;
  }
} // namespace detail

template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
    typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec)
{
  return detail::read_at_buffer_sequence(d, offset, buffers,
      boost::asio::buffer_sequence_begin(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
}

template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read_at(
      d, offset, buffers, transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read_at");
  return bytes_transferred;
}

template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers,
    boost::system::error_code& ec)
{
  return read_at(d, offset, buffers, transfer_all(), ec);
}

template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read_at(d, offset, buffers,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read_at");
  return bytes_transferred;
}

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)

template <typename SyncRandomAccessReadDevice, typename Allocator,
    typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition, boost::system::error_code& ec)
{
  ec = boost::system::error_code();
  std::size_t total_transferred = 0;
  std::size_t max_size = detail::adapt_completion_condition_result(
        completion_condition(ec, total_transferred));
  std::size_t bytes_available = read_size_helper(b, max_size);
  while (bytes_available > 0)
  {
    std::size_t bytes_transferred = d.read_some_at(
        offset + total_transferred, b.prepare(bytes_available), ec);
    b.commit(bytes_transferred);
    total_transferred += bytes_transferred;
    max_size = detail::adapt_completion_condition_result(
          completion_condition(ec, total_transferred));
    bytes_available = read_size_helper(b, max_size);
  }
  return total_transferred;
}

template <typename SyncRandomAccessReadDevice, typename Allocator>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read_at(
      d, offset, b, transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read_at");
  return bytes_transferred;
}

template <typename SyncRandomAccessReadDevice, typename Allocator>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
    boost::system::error_code& ec)
{
  return read_at(d, offset, b, transfer_all(), ec);
}

template <typename SyncRandomAccessReadDevice, typename Allocator,
    typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read_at(d, offset, b,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read_at");
  return bytes_transferred;
}

#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)

namespace detail
{
  template <typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  class read_at_op
    : detail::base_from_completion_cond<CompletionCondition>
  {
  public:
    read_at_op(AsyncRandomAccessReadDevice& device,
        uint64_t offset, const MutableBufferSequence& buffers,
        CompletionCondition& completion_condition, ReadHandler& handler)
      : detail::base_from_completion_cond<
          CompletionCondition>(completion_condition),
        device_(device),
        offset_(offset),
        buffers_(buffers),
        start_(0),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
    {
    }

#if defined(BOOST_ASIO_HAS_MOVE)
    read_at_op(const read_at_op& other)
      : detail::base_from_completion_cond<CompletionCondition>(other),
        device_(other.device_),
        offset_(other.offset_),
        buffers_(other.buffers_),
        start_(other.start_),
        handler_(other.handler_)
    {
    }

    read_at_op(read_at_op&& other)
      : detail::base_from_completion_cond<CompletionCondition>(
          BOOST_ASIO_MOVE_CAST(detail::base_from_completion_cond<
            CompletionCondition>)(other)),
        device_(other.device_),
        offset_(other.offset_),
        buffers_(BOOST_ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
        start_(other.start_),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
    {
    }
#endif // defined(BOOST_ASIO_HAS_MOVE)

    void operator()(const boost::system::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      std::size_t max_size;
      switch (start_ = start)
      {
        case 1:
        max_size = this->check_for_completion(ec, buffers_.total_consumed());
        do
        {
          device_.async_read_some_at(
              offset_ + buffers_.total_consumed(), buffers_.prepare(max_size),
              BOOST_ASIO_MOVE_CAST(read_at_op)(*this));
          return; default:
          buffers_.consume(bytes_transferred);
          if ((!ec && bytes_transferred == 0) || buffers_.empty())
            break;
          max_size = this->check_for_completion(ec, buffers_.total_consumed());
        } while (max_size > 0);

        handler_(ec, buffers_.total_consumed());
      }
    }

  //private:
    typedef boost::asio::detail::consuming_buffers<mutable_buffer,
        MutableBufferSequence, MutableBufferIterator> buffers_type;

    AsyncRandomAccessReadDevice& device_;
    uint64_t offset_;
    buffers_type buffers_;
    int start_;
    ReadHandler handler_;
  };

  template <typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void* asio_handler_allocate(std::size_t size,
      read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
  {
    return boost_asio_handler_alloc_helpers::allocate(
        size, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_deallocate(void* pointer, std::size_t size,
      read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_alloc_helpers::deallocate(
        pointer, size, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline bool asio_handler_is_continuation(
      read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
  {
    return this_handler->start_ == 0 ? true
      : boost_asio_handler_cont_helpers::is_continuation(
          this_handler->handler_);
  }

  template <typename Function, typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(Function& function,
      read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename Function, typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(const Function& function,
      read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void start_read_at_buffer_sequence_op(AsyncRandomAccessReadDevice& d,
      uint64_t offset, const MutableBufferSequence& buffers,
      const MutableBufferIterator&, CompletionCondition& completion_condition,
      ReadHandler& handler)
  {
    detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
      MutableBufferIterator, CompletionCondition, ReadHandler>(
        d, offset, buffers, completion_condition, handler)(
          boost::system::error_code(), 0, 1);
  }

  template <typename AsyncRandomAccessReadDevice>
  class initiate_async_read_at_buffer_sequence
  {
  public:
    typedef typename AsyncRandomAccessReadDevice::executor_type executor_type;

    explicit initiate_async_read_at_buffer_sequence(
        AsyncRandomAccessReadDevice& device)
      : device_(device)
    {
    }

    executor_type get_executor() const BOOST_ASIO_NOEXCEPT
    {
      return device_.get_executor();
    }

    template <typename ReadHandler, typename MutableBufferSequence,
        typename CompletionCondition>
    void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
        uint64_t offset, const MutableBufferSequence& buffers,
        BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
    {
      // If you get an error on the following line it means that your handler
      // does not meet the documented type requirements for a ReadHandler.
      BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;

      non_const_lvalue<ReadHandler> handler2(handler);
      non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
      start_read_at_buffer_sequence_op(device_, offset, buffers,
          boost::asio::buffer_sequence_begin(buffers),
          completion_cond2.value, handler2.value);
    }

  private:
    AsyncRandomAccessReadDevice& device_;
  };
} // namespace detail

#if !defined(GENERATING_DOCUMENTATION)

template <typename AsyncRandomAccessReadDevice,
    typename MutableBufferSequence, typename MutableBufferIterator,
    typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
    detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
    MutableBufferIterator, CompletionCondition, ReadHandler>,
    Allocator>
{
  typedef typename associated_allocator<ReadHandler, Allocator>::type type;

  static type get(
      const detail::read_at_op<AsyncRandomAccessReadDevice,
      MutableBufferSequence, MutableBufferIterator,
      CompletionCondition, ReadHandler>& h,
      const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT
  {
    return associated_allocator<ReadHandler, Allocator>::get(h.handler_, a);
  }
};

template <typename AsyncRandomAccessReadDevice,
    typename MutableBufferSequence, typename MutableBufferIterator,
    typename CompletionCondition, typename ReadHandler, typename Executor>
struct associated_executor<
    detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
    MutableBufferIterator, CompletionCondition, ReadHandler>,
    Executor>
{
  typedef typename associated_executor<ReadHandler, Executor>::type type;

  static type get(
      const detail::read_at_op<AsyncRandomAccessReadDevice,
      MutableBufferSequence, MutableBufferIterator,
      CompletionCondition, ReadHandler>& h,
      const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT
  {
    return associated_executor<ReadHandler, Executor>::get(h.handler_, ex);
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

template <typename AsyncRandomAccessReadDevice,
    typename MutableBufferSequence, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_at_buffer_sequence<
        AsyncRandomAccessReadDevice>(d),
      handler, offset, buffers,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
    uint64_t offset, const MutableBufferSequence& buffers,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_at_buffer_sequence<
        AsyncRandomAccessReadDevice>(d),
      handler, offset, buffers, transfer_all());
}

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)

namespace detail
{
  template <typename AsyncRandomAccessReadDevice, typename Allocator,
      typename CompletionCondition, typename ReadHandler>
  class read_at_streambuf_op
    : detail::base_from_completion_cond<CompletionCondition>
  {
  public:
    read_at_streambuf_op(AsyncRandomAccessReadDevice& device,
        uint64_t offset, basic_streambuf<Allocator>& streambuf,
        CompletionCondition& completion_condition, ReadHandler& handler)
      : detail::base_from_completion_cond<
          CompletionCondition>(completion_condition),
        device_(device),
        offset_(offset),
        streambuf_(streambuf),
        start_(0),
        total_transferred_(0),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
    {
    }

#if defined(BOOST_ASIO_HAS_MOVE)
    read_at_streambuf_op(const read_at_streambuf_op& other)
      : detail::base_from_completion_cond<CompletionCondition>(other),
        device_(other.device_),
        offset_(other.offset_),
        streambuf_(other.streambuf_),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        handler_(other.handler_)
    {
    }

    read_at_streambuf_op(read_at_streambuf_op&& other)
      : detail::base_from_completion_cond<CompletionCondition>(
          BOOST_ASIO_MOVE_CAST(detail::base_from_completion_cond<
            CompletionCondition>)(other)),
        device_(other.device_),
        offset_(other.offset_),
        streambuf_(other.streambuf_),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
    {
    }
#endif // defined(BOOST_ASIO_HAS_MOVE)

    void operator()(const boost::system::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      std::size_t max_size, bytes_available;
      switch (start_ = start)
      {
        case 1:
        max_size = this->check_for_completion(ec, total_transferred_);
        bytes_available = read_size_helper(streambuf_, max_size);
        for (;;)
        {
          device_.async_read_some_at(offset_ + total_transferred_,
              streambuf_.prepare(bytes_available),
              BOOST_ASIO_MOVE_CAST(read_at_streambuf_op)(*this));
          return; default:
          total_transferred_ += bytes_transferred;
          streambuf_.commit(bytes_transferred);
          max_size = this->check_for_completion(ec, total_transferred_);
          bytes_available = read_size_helper(streambuf_, max_size);
          if ((!ec && bytes_transferred == 0) || bytes_available == 0)
            break;
        }

        handler_(ec, static_cast<const std::size_t&>(total_transferred_));
      }
    }

  //private:
    AsyncRandomAccessReadDevice& device_;
    uint64_t offset_;
    boost::asio::basic_streambuf<Allocator>& streambuf_;
    int start_;
    std::size_t total_transferred_;
    ReadHandler handler_;
  };

  template <typename AsyncRandomAccessReadDevice, typename Allocator,
      typename CompletionCondition, typename ReadHandler>
  inline void* asio_handler_allocate(std::size_t size,
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return boost_asio_handler_alloc_helpers::allocate(
        size, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice, typename Allocator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_deallocate(void* pointer, std::size_t size,
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_alloc_helpers::deallocate(
        pointer, size, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice, typename Allocator,
      typename CompletionCondition, typename ReadHandler>
  inline bool asio_handler_is_continuation(
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return this_handler->start_ == 0 ? true
      : boost_asio_handler_cont_helpers::is_continuation(
          this_handler->handler_);
  }

  template <typename Function, typename AsyncRandomAccessReadDevice,
      typename Allocator, typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(Function& function,
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename Function, typename AsyncRandomAccessReadDevice,
      typename Allocator, typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(const Function& function,
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename AsyncRandomAccessReadDevice>
  class initiate_async_read_at_streambuf
  {
  public:
    typedef typename AsyncRandomAccessReadDevice::executor_type executor_type;

    explicit initiate_async_read_at_streambuf(
        AsyncRandomAccessReadDevice& device)
      : device_(device)
    {
    }

    executor_type get_executor() const BOOST_ASIO_NOEXCEPT
    {
      return device_.get_executor();
    }

    template <typename ReadHandler,
        typename Allocator, typename CompletionCondition>
    void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
        uint64_t offset, basic_streambuf<Allocator>* b,
        BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
    {
      // If you get an error on the following line it means that your handler
      // does not meet the documented type requirements for a ReadHandler.
      BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;

      non_const_lvalue<ReadHandler> handler2(handler);
      non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
      read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
        CompletionCondition, typename decay<ReadHandler>::type>(
          device_, offset, *b, completion_cond2.value, handler2.value)(
            boost::system::error_code(), 0, 1);
    }

  private:
    AsyncRandomAccessReadDevice& device_;
  };
} // namespace detail

#if !defined(GENERATING_DOCUMENTATION)

template <typename AsyncRandomAccessReadDevice, typename Allocator,
    typename CompletionCondition, typename ReadHandler, typename Allocator1>
struct associated_allocator<
    detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
      Allocator, CompletionCondition, ReadHandler>,
    Allocator1>
{
  typedef typename associated_allocator<ReadHandler, Allocator1>::type type;

  static type get(
      const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
        Allocator, CompletionCondition, ReadHandler>& h,
      const Allocator1& a = Allocator1()) BOOST_ASIO_NOEXCEPT
  {
    return associated_allocator<ReadHandler, Allocator1>::get(h.handler_, a);
  }
};

template <typename AsyncRandomAccessReadDevice, typename Executor,
    typename CompletionCondition, typename ReadHandler, typename Executor1>
struct associated_executor<
    detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
      Executor, CompletionCondition, ReadHandler>,
    Executor1>
{
  typedef typename associated_executor<ReadHandler, Executor1>::type type;

  static type get(
      const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
        Executor, CompletionCondition, ReadHandler>& h,
      const Executor1& ex = Executor1()) BOOST_ASIO_NOEXCEPT
  {
    return associated_executor<ReadHandler, Executor1>::get(h.handler_, ex);
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

template <typename AsyncRandomAccessReadDevice,
    typename Allocator, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
      handler, offset, &b,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

template <typename AsyncRandomAccessReadDevice, typename Allocator,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
    uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
      handler, offset, &b, transfer_all());
}

#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)

} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_IMPL_READ_AT_HPP


text:
'use strict';

/**
 * @ngdoc service
 * @name frontendApp.dataService
 * @description
 * # dataService
 * Factory in the frontendApp.
 */
angular.module('frontendApp')
  .factory('dataService', function ($http, $q) {
    // Service logic
    // ...

    // create the service to be returned by the factory
    var dataService = {};

    //list of examples
    dataService.exampleList = [];
    dataService.model = {selected: null, highlighted: []};
    dataService.getExampleList = function(callback) {

      var delay = $q.defer();

      $http.get('data/metadata.json')
        .then(function (response) {
          dataService.exampleList.length = 0;
          response.data.datasets.forEach(function(d) {
            dataService.exampleList.push(d);
          });

          delay.resolve(response);
      })
        .then(callback);

      return delay.promise;
    };

    //initially, there is no data
    dataService.data = null;

    //initially, there are no representations in data
    dataService.available = {
      representationTypes: [],
      dimensionalityReductionTypes: [],
      synergyTypes: [],
      activityTypes: []
    };

    //initially, there is no active spaces
    dataService.current = {
      representationType: null,
      dimensionalityReductionType: null,
      synergyType: null,
      activityType: null
    };

    //
    // api for changing the data
    //

    // doesn't touch the data directly, calls setDimensionalityReductionType to actually change the data
    dataService.setRepresentationType = function (newRepresentationType) {

      console.log('Set representation to ' + newRepresentationType);
      dataService.current.representationType = newRepresentationType;

      // empty the dimredtype array
      dataService.available.dimensionalityReductionTypes.length = 0;

      // refill the dimeredtype array with new data
      Object.keys(dataService.data.coordinates[this.current.representationType])
        .forEach(function(d) { dataService.available.dimensionalityReductionTypes.push(d); });

      // if the previous dimensionality reduction technique has been applied to the new representation, keep.  Otherwise set to new.
      if (dataService.available.dimensionalityReductionTypes.indexOf(dataService.current.dimensionalityReductionType) > -1) {

        // leave the space as is, change the data
        dataService.setDimensionalityReductionType(dataService.current.dimensionalityReductionType);
      }
      else {
        // set the space to the current
        dataService.setDimensionalityReductionType(dataService.available.dimensionalityReductionTypes[0]);
      }
    };

    //
    dataService.setDimensionalityReductionType = function (newDimRedType) {

      console.log('Set dim red type:' + newDimRedType);

      // should check if is a member of available
      this.current.dimensionalityReductionType = newDimRedType;

      //cache the rep to load the coordinates from
      var rep = this.data.coordinates[this.current.representationType][this.current.dimensionalityReductionType];

      //change data
      this.data.compounds.forEach(function(d) {
        d.x = rep[d.id].x;
        d.y = rep[d.id].y;
      });
    };

    dataService.setSynergyType = function (newSynergyType) {
      console.log('Set synergy type:', newSynergyType);

      // should check if is a member of available
      dataService.current.synergyType = newSynergyType;

      // change synergy to new type on all combinations
      dataService.data.combinations.forEach(function(d) {
        d.value = d.synergies[newSynergyType];
        d.synergistic = d.value > 0;
      });

    };

    // use to change the activity type
    dataService.setActivityType = function (newActivityType) {

      console.log('Set activityType:', newActivityType);

      // should check if is a member of available
      dataService.current.activityType = newActivityType;

      dataService.data.compounds.forEach(function(d) {
        d.value = d.activities[newActivityType];
      });

    };

    // link the edges of the data up
    dataService.linkUp = function () {

      var compObj = {};

      this.data.compounds.forEach(function(d) {
        d.combinations = [];
        compObj[d.id] = d;
      });

      this.data.combinations.forEach(function(d) {

        d.source = compObj[d.ColId];
        d.target = compObj[d.RowId];

      });

      return this;
    };

    //remove all the data
    dataService.empty = function () {
      this.available.representationTypes.length = 0;
      this.available.dimensionalityReductionTypes.length = 0;
      this.available.synergyTypes.length = 0;
      this.available.activityTypes.length = 0;
      this.current.representationType = null;
      this.current.dimensionalityReductionType = null;
      this.current.synergyType = null;
      this.current.activityType = null;
      return this;
    };

    dataService.initializeData = function () {

      // remove old representation types if any previously existed
      this.empty();

      // add metadata for each option
      this.metadata = {};

      // add representation types
      this.data.metadata.representationTypes.forEach(function(d) {
        dataService.metadata[d.name] = d.metadata;
        dataService.available.representationTypes.push(d.name); });

      //
      // set current representation type to be first in the list
      // (also sets the dimRedType and current dimredtype as these are dependent)
      //

      this.data.metadata.dimensionalityReductionTypes.forEach(function(d) {
        dataService.metadata[d.name] = d.metadata;
      });

      this.setRepresentationType(this.available.representationTypes[0]);

      // add activity types
      this.data.metadata.activityTypes.forEach(function(d) {
        dataService.available.activityTypes.push(d.name);
        dataService.metadata[d.name] = d.metadata;
      });
      // set current activity type to be first in the list
      this.setActivityType(this.available.activityTypes[0]);

      // add synergy types
      this.data.metadata.synergyTypes.forEach(function(d) {
        dataService.metadata[d.name] = d.metadata;
        dataService.available.synergyTypes.push(d.name);
      });

      // set current synergy type to be first in the list
      this.setSynergyType(this.available.synergyTypes[0]);

      // set first in list to be active
      this.linkUp();

      return this;
    };

    // load up an example dataset
    dataService.loadExample = function(name, callback) {

      var delay = $q.defer();

      $http.get('data/' + name + '/data.json')
        .then(function(response) {
          //retrieve the data as a property
          dataService.datasetName = name;
          dataService.data = response.data;
          //process the data
          dataService.initializeData();

          return delay.resolve(response);
        })
        .then(callback);

      return delay.promise;
    };

    return dataService;
  });


text:
from django.conf import settings  # noqa
from django.utils.translation import ugettext_lazy as _  # noqa

from appconf import AppConf

class TextPluginConf(AppConf):

    REDACTOR_OPTIONS = {
        'buttons': ('formatting', 'bold', 'italic', 'deleted', 'underline',
                    'unorderedlist', 'orderedlist', 'link', 'alignment', 'html', ),
        'direction': 'ltr',
        'plugins': ('bufferbuttons', ),
        'formatting': ('h1', 'h2', 'h3', 'h4', 'h5', 'p', 'blockquote',),
        'pastePlainText': True,
        'cleanOnPaste': True,
        'focusEnd': True,
    }

    class Meta:
        prefix = 'textplugin'


text:
{% extends '_layouts/base.html' %}
{% load i18n %}

{% block title %}{% trans 'Register Pet' %}{% endblock %}

{% block content %}
  <div class="row">
    {% include 'meupet/_pet_form.html' %}
  </div>
{% endblock %}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Package com.microsoft.windowsazure.mobileservices.table.sync.synchandler</title>
<meta name="date" content="2014-08-12">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
com.microsoft.windowsazure.mobileservices.table.sync.synchandler

Packages that use com.microsoft.windowsazure.mobileservices.table.sync.synchandler

Package
Description

com.microsoft.windowsazure.mobileservices.table.sync

com.microsoft.windowsazure.mobileservices.table.sync.synchandler

Classes in com.microsoft.windowsazure.mobileservices.table.sync.synchandler used by com.microsoft.windowsazure.mobileservices.table.sync

Class and Description

MobileServiceSyncHandler

Handles table operation errors and push completion results.

Classes in com.microsoft.windowsazure.mobileservices.table.sync.synchandler used by com.microsoft.windowsazure.mobileservices.table.sync.synchandler

Class and Description

MobileServiceSyncHandler

Handles table operation errors and push completion results.

MobileServiceSyncHandlerException

Class that represents an exception during sync handling

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import kfp.deprecated.dsl as dsl
import kfp.deprecated.components as comp

# Advanced function
# Demonstrates imports, helper functions and multiple outputs
from typing import NamedTuple

@comp.create_component_from_func
def markdown_visualization() -> NamedTuple('VisualizationOutput', [('mlpipeline_ui_metadata', 'UI_metadata')]):
    import json

    # Exports a sample tensorboard:
    metadata = {
        'outputs': [
            {
                # Markdown that is hardcoded inline
                'storage': 'inline',
                'source': '''# Inline Markdown

* [Kubeflow official doc](https://www.kubeflow.org/).
''',
                'type': 'markdown',
            },
            {
                # Markdown that is read from a file
                'source': 'https://raw.githubusercontent.com/kubeflow/pipelines/master/README.md',
                # Alternatively, use Google Cloud Storage for sample.
                # 'source': 'gs://jamxl-kfp-bucket/v2-compatible/markdown/markdown_example.md',
                'type': 'markdown',
            }]
    }

    from collections import namedtuple
    divmod_output = namedtuple('VisualizationOutput', [
                               'mlpipeline_ui_metadata'])
    return divmod_output(json.dumps(metadata))

@dsl.pipeline(
    name='markdown-pipeline',
    description='A sample pipeline to generate markdown for UI visualization.'
)
def markdown_pipeline():
    # Passing a task output reference as operation arguments
    # For an operation with a single return value, the output reference can be accessed using `task.output` or `task.outputs['output_name']` syntax
    markdown_visualization_task = markdown_visualization()


text:
<?php
namespace FDT\MetadataBundle\Document\Attributi;

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Translatable\Translatable;

/**
 * @MongoDB\Document(collection="option", repositoryClass="FDT\MetadataBundle\Document\Attributi\OptionRepository"))
 * @Gedmo\TranslationEntity(class="FDT\MetadataBundle\Document\Attributi\OptionTranslation")
 */
class Option
{
    /**
     * @MongoDB\Id
     */
    protected $id;

    /**
    * @MongoDB\String
    * @Gedmo\Translatable
    * @Assert\NotBlank()
    *
    */
    protected $name;

    /**
     * @MongoDB\String
     * @Gedmo\Translatable
     * @Gedmo\Slug(fields={"name"}, updatable=false)
     */
    protected $slug;

    /**
     * @mongodb\String
     * @var string
     */
    protected $value;

    /**
    * @MongoDB\Int
    * @Assert\Type("int")
    */
    private $ordine = 0;

    /**
     * @Gedmo\Locale
     */
    private $locale;

    public function  __toString()
    {
        return (string) $this->getValue();
    }

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @return Option $this
     */
    public function setValue($value)
    {
        $this->value = $value;

        return $this;
    }

    /**
     * @return string
     */
    public function getSlug()
    {
        return $this->slug;
    }

    /**
     *
     * @param int $ordine
     * @return void
     * @author Lorenzo Caldara
     */
    public function setOrdine($ordine)
    {
        $this->ordine = $ordine;
    }

    /**
     * @return int
     */
    public function getOrdine()
    {
        return $this->ordine;
    }

}


text:
<?php

namespace AdamBrett\Spider\Processor;

/**
 * Processor Interface
 *
 * Defines methods that Crawler instances expect to be able to call
 *
 * @category   AdamBrett
 * @package    Spider
 * @subpackage Processor
 * @author     Adam Brett <adam@adambrett.co.uk>
 * @license    http://adambrett.co.uk/license/new-bsd New BSD License
 * @link       tbc.
 */
interface ProcessorInterface extends \Iterator
{
    /**
     * Add Method
     *
     * Used to add new pages to the Processor
     *
     * @param array|string $page URL or array or URLs to add
     *
     * @return void
     */
    public function add($page);

    /**
     * Fetch Method
     *
     * Required expected to return a Processor\Response object
     *
     * @param string $page URL to fetch
     *
     * @return Processor\Response the formatted response
     */
    public function fetch($page);
}


text:
<?php

namespace Prelude\Tests;

use function Prelude\toString;

class ToStringTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @test
     */
    public function shouldReturnTrue()
    {
        $this->assertTrue(is_string(toString(10)));
        $this->assertTrue(is_string(toString(1.0)));
    }
}


text:
title: "Making Pompom Bunnies"
location-display-name: Needham Market Library
category: crafts
service: youtube
link: WkA71ffNhnc
format: recording
---


text:
from django.conf import settings
from manager import PublisherManager

__all__ = ('PublisherManager', 'VERSION')

VERSION = (0, 4, 'sintab')


text:
import fsspec
from fsspec.implementations.tests.test_archive import archive_data, temparchive

def test_cache(ftp_writable):
    host, port, username, password = "localhost", 2121, "user", "pass"

    with temparchive(archive_data) as archive_file:
        with fsspec.open(
            "ftp:///archive.7z",
            "wb",
            host=host,
            port=port,
            username=username,
            password=password,
        ) as f:
            f.write(open(archive_file, "rb").read())
        of = fsspec.open(
            "libarchive://deeply/nested/path::ftp:///archive.7z",
            ftp={
                "host": host,
                "port": port,
                "username": username,
                "password": password,
            },
        )

        with of as f:
            readdata = f.read()

        assert readdata == archive_data["deeply/nested/path"]


text:
<?php

declare(strict_types=1);

namespace Respect\Validation\Rules;

use function ctype_alpha;

/**
 * Validates whether the input contains only alphabetic characters.
 *
 * @author Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
 * @author Henrique Moody <henriquemoody@gmail.com>
 * @author Nick Lombard <github@jigsoft.co.za>
 */
final class Alpha extends AbstractFilterRule
{
    /**
     * {@inheritDoc}
     */
    protected function validateFilteredInput(string $input): bool
    {
        return ctype_alpha($input);
    }
}


text:
Angular Tryton
==============

![](example/images/ng-tryton-logo.png)

An [AngularJS](https://github.com/angular/angular.js) module that makes tryton JSONRPC
working in the *Angular Way*. Contains two services `tryton`, `session` and one
filter `urlTryton`.

Documentation
-------------

Documentation is auto generated from the code using `grunt ngdocs`.
Hosted version of the documentation can be seen at
[openlabs.github.io/angular-tryton](http://openlabs.github.io/angular-tryton/)

Install
-------

```bash
bower install angular-tryton
```

Usage
-----

### Require `openlabs.angular-tryton` and Inject the Services

```javascript
angular.module('app', [
    'openlabs.angular-tryton'
]).controller('Ctrl', function(
    $scope,
    tryton,
	session
){});
```

How to contribute
-----------------

If you're still convinced that angular-tryton needs to be modified in order to handle
your problem and you have an idea on how to do that, well here's how to turn that idea
into a commit (or two) in easy steps:

1. [Fork Angular Tryton](http://github.com/openlabs/angular-tryton) into your very
   own GitHub repository

2. Install git pre-commit hook `cp .hooks/pre-commit.sh .git/hooks/pre-commit`

3. Modify code as required.

4. Once you're satisfied with the changes and you want the rest of the Angular Tryton
   developers to take a look at them, push your changes back to your own repository and
   send us a Pull request to develop branch. Don't forget to add test with minimum 100%
   test coverage.

Authors and Contributors
------------------------

This module was built at [Openlabs](http://www.openlabs.co.in).

Professional Support
--------------------

This module is professionally supported by [Openlabs](http://www.openlabs.co.in).
If you are looking for on-site teaching or consulting support, contact our
[sales](mailto:sales@openlabs.co.in) and [support](mailto:support@openlabs.co.in) teams.


text: {{formatDate start "MM/DD/YYYY"}}


text: @PowerShell.exe -ExecutionPolicy Bypass -File scripts\ci-package-artifacts.ps1


text:
package characteristic

type Revision struct {
	*String
}

func NewHardwareRevision(revision string) *Revision {
	return newRevision(revision, CharTypeHardwareRevision)
}

func NewSoftwareRevision(revision string) *Revision {
	return newRevision(revision, CharTypeSoftwareRevision)
}

func NewFirmwareRevision(revision string) *Revision {
	return newRevision(revision, CharTypeFirmwareRevision)
}

func newRevision(revision string, charType CharType) *Revision {
	str := NewString(revision)
	str.Type = CharType(charType)
	str.Permissions = PermsRead()

	return &Revision{str}
}

func (r *Revision) SetRevision(revision string) {
	r.SetString(revision)
}

func (r *Revision) Revision() string {
	return r.StringValue()
}


text:
Avaliações

Avaliações Futuras:

	{% for templateAvaliacao in avaliacoes_futuras %}

{{ templateAvaliacao.titulo }}

		Turma: {{templateAvaliacao.turma}}

		Inicio: {{templateAvaliacao.data_inicio|date:"d/m/y  H:i"}}

		Termino: {{templateAvaliacao.data_termino|date:"d/m/y  H:i"}}

	{% endfor %}

Avaliações para Iniciar:

	{% for templateAvaliacao in avaliacoes_comecar %}

{{ templateAvaliacao.titulo }}

		Turma: {{templateAvaliacao.turma}}

		Inicio: {{templateAvaliacao.data_inicio|date:"d/m/y  H:i"}}

		Termino: {{templateAvaliacao.data_termino|date:"d/m/y  H:i"}}

	{% endfor %}

Avaliações Em Andamento:

	{% for avaliacao in avaliacoes_andamento %}

{{ avaliacao.titulo }}

		Turma: {{avaliacao.templateAvaliacao.turma}}

		Inicio: {{avaliacao.templateAvaliacao.data_inicio|date:"d/m/y  H:i"}}

		Termino: {{avaliacao.templateAvaliacao.data_termino|date:"d/m/y  H:i"}}

	{% endfor %}

Avaliações Terminadas:

	{% for avaliacao in avaliacoes_passadas %}

{{ avaliacao.titulo }}

	{% endfor %}


text:
layout: doc_es
title: Ejecutando Rubinius
previous: Construyendo Rubinius
previous_url: getting-started/building
next: Resolviendo problemas
next_url: getting-started/troubleshooting
---

Una vez que usted ha seguido los pasos para la construcción (y
posiblemente la instalación) de Rubinius, puede comprobar que funciona
correctamente:

    rbx -v

Rubinius generalmente se comporta como Ruby en la línea de comandos. Por ejemplo:

    rbx -e 'puts "Hello!"'

Para ejecutar un archivo de Ruby llamado 'code.rb':

    rbx code.rb

Para ejecutar IRB:

    rbx

Si ha añadido el directorio bin de Rubinius a su PATH, Rubinius debe
comportarse tal como usted lo esperaría de MRI. Hay comandos para `ruby`,
`rake`, `gem`, `irb`, `ri`, y `rdoc`.

Usted puede agregar el directorio bin de Rubinius al PATH sólo en el
momento en que desea utilizar Rubinius. De esta manera, no va a
interferir con su instalación normal de Ruby cuando no deseé utilizar Rubinius.


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/aiplatform/v1/metadata_store.proto

package com.google.cloud.aiplatform.v1;

public interface MetadataStoreOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.MetadataStore)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Output only. The resource name of the MetadataStore instance.
   *

   *
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The name.
   */
  java.lang.String getName();
  /**
   *
   *
   *

   * Output only. The resource name of the MetadataStore instance.
   *

   *
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for name.
   */
  com.google.protobuf.ByteString getNameBytes();

  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the createTime field is set.
   */
  boolean hasCreateTime();
  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The createTime.
   */
  com.google.protobuf.Timestamp getCreateTime();
  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the updateTime field is set.
   */
  boolean hasUpdateTime();
  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The updateTime.
   */
  com.google.protobuf.Timestamp getUpdateTime();
  /**
   *
   *
   *

   * Output only. Timestamp when this MetadataStore was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder();

  /**
   *
   *
   *

   * Customer-managed encryption key spec for a Metadata Store. If set, this
   * Metadata Store and all sub-resources of this Metadata Store are secured
   * using this key.
   *

   *
   * .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5;
   *
   * @return Whether the encryptionSpec field is set.
   */
  boolean hasEncryptionSpec();
  /**
   *
   *
   *

   * Customer-managed encryption key spec for a Metadata Store. If set, this
   * Metadata Store and all sub-resources of this Metadata Store are secured
   * using this key.
   *

   *
   * .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5;
   *
   * @return The encryptionSpec.
   */
  com.google.cloud.aiplatform.v1.EncryptionSpec getEncryptionSpec();
  /**
   *
   *
   *

   * Customer-managed encryption key spec for a Metadata Store. If set, this
   * Metadata Store and all sub-resources of this Metadata Store are secured
   * using this key.
   *

   *
   * .google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 5;
   */
  com.google.cloud.aiplatform.v1.EncryptionSpecOrBuilder getEncryptionSpecOrBuilder();

  /**
   *
   *
   *

   * Description of the MetadataStore.
   *

   *
   * string description = 6;
   *
   * @return The description.
   */
  java.lang.String getDescription();
  /**
   *
   *
   *

   * Description of the MetadataStore.
   *

   *
   * string description = 6;
   *
   * @return The bytes for description.
   */
  com.google.protobuf.ByteString getDescriptionBytes();

  /**
   *
   *
   *

   * Output only. State information of the MetadataStore.
   *

   *
   *
   * .google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the state field is set.
   */
  boolean hasState();
  /**
   *
   *
   *

   * Output only. State information of the MetadataStore.
   *

   *
   *
   * .google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The state.
   */
  com.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState getState();
  /**
   *
   *
   *

   * Output only. State information of the MetadataStore.
   *

   *
   *
   * .google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreStateOrBuilder getStateOrBuilder();
}


text:
package com.geishatokyo.smartmerger

import com.geishatokyo.smartmerger.injection.Injection
import org.scalatest.{Matchers, FlatSpec}
import com.geishatokyo.codegen.util.RichFile._
import com.geishatokyo.codegen.util.RichFile

/**
 * Created by takeshita on 2014/06/17.
 */
class UsageTest extends FlatSpec with Matchers {

  "holdMerge" should "be used as such" in {

    val f = RichFile.fromPath("src/test/resources/UsageSampleForHoldMerge.scala")
    val copied = f.copyTo("target/temp/sample1.scala")

    val newCode =
      """
        |class ChangedClass{
        |  //@hold[block1]
        |  //@end
        |}
        |
        |
        |//@hold[block2]
        |//@end
        |
        |class ChangedClass2{
        |}
        |
      """.stripMargin

    val merger = Merger.forScala
    val mergedCode = merger.holdMerge(copied,newCode)

    println(mergedCode)
    val mergedFileContent = copied.readAsString()
    assert(mergedFileContent.contains("HandMadeClass"))
    assert(mergedFileContent.contains("ChangedClass"))
    assert(mergedFileContent.contains("ChangedClass2"))
    assert(mergedFileContent == mergedCode)
  }
  "replaceMerge" should "be used as such" in {
    val f = RichFile.fromPath("src/test/resources/UsageSampleForReplaceMerge.scala")
    val copied = f.copyTo("target/temp/sample2.scala")

    val merger = Merger.forScala

    import com.geishatokyo.smartmerger.dsl.Implicits._

    val mergedCode = merger.replaceMerge(copied,
      List(
        Injection("field", "val replaced1 = 39023"),
        Injection("field", "val replaced2 = 2932") ifNotContain "replaced2",
        Injection("method","def thisIsNotInjected = {}") ifNotContain "methodAlreadyExists",
        Injection("method","def newMethod1 = {}") ifNotContain "newMethod",
        Injection("method","def newMethod2 = {}")
    ))

    println(mergedCode)
    val mergedFileContent = copied.readAsString()
    assert(mergedFileContent.contains("replaced1"))
    assert(mergedFileContent.contains("replaced2"))
    assert(mergedFileContent.contains("methodAlreadyExists"))
    assert(mergedFileContent.contains("newMethod1"))
    assert(mergedFileContent.contains("newMethod2"))

    assert(!mergedFileContent.contains("thisIsNotInjected"))
    assert(mergedFileContent == mergedCode)
  }

}


text:
package org.apache.ignite.internal.processors.hadoop.v1;

import org.apache.hadoop.mapred.*;
import org.apache.hadoop.util.*;
import org.apache.ignite.*;
import org.apache.ignite.internal.processors.hadoop.*;
import org.apache.ignite.internal.processors.hadoop.v2.*;

/**
 * Hadoop reduce task implementation for v1 API.
 */
public class HadoopV1ReduceTask extends HadoopV1Task {
    /** {@code True} if reduce, {@code false} if combine. */
    private final boolean reduce;

    /**
     * Constructor.
     *
     * @param taskInfo Task info.
     * @param reduce {@code True} if reduce, {@code false} if combine.
     */
    public HadoopV1ReduceTask(HadoopTaskInfo taskInfo, boolean reduce) {
        super(taskInfo);

        this.reduce = reduce;
    }

    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    @Override public void run(HadoopTaskContext taskCtx) throws IgniteCheckedException {
        HadoopJob job = taskCtx.job();

        HadoopV2TaskContext ctx = (HadoopV2TaskContext)taskCtx;

        JobConf jobConf = ctx.jobConf();

        HadoopTaskInput input = taskCtx.input();

        HadoopV1OutputCollector collector = null;

        try {
            collector = collector(jobConf, ctx, reduce || !job.info().hasReducer(), fileName(), ctx.attemptId());

            Reducer reducer = ReflectionUtils.newInstance(reduce ? jobConf.getReducerClass() : jobConf.getCombinerClass(),
                jobConf);

            assert reducer != null;

            try {
                try {
                    while (input.next()) {
                        if (isCancelled())
                            throw new HadoopTaskCancelledException("Reduce task cancelled.");

                        reducer.reduce(input.key(), input.values(), collector, Reporter.NULL);
                    }
                }
                finally {
                    reducer.close();
                }
            }
            finally {
                collector.closeWriter();
            }

            collector.commit();
        }
        catch (Exception e) {
            if (collector != null)
                collector.abort();

            throw new IgniteCheckedException(e);
        }
    }
}


text:
package controllers;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static play.test.Helpers.DELETE;
import static play.test.Helpers.GET;
import static play.test.Helpers.POST;
import static play.test.Helpers.PUT;
import static play.test.Helpers.contentAsString;
import static play.test.Helpers.fakeApplication;
import static play.test.Helpers.route;
import static play.test.Helpers.running;

import java.util.List;

import org.junit.Test;

import com.fasterxml.jackson.databind.JsonNode;

import models.Project;
import models.WorkItem;
import play.libs.Json;
import play.mvc.Result;
import play.mvc.Http.RequestBuilder;

public class ProjectsTest {
    int projectId = 10;
    int factoryId = 20;
    int stationId = 40;
    int nonExistantId = 44444;

    @Test
    public void testList() {
        running(fakeApplication(), new Runnable() {
            @SuppressWarnings("unchecked")
            public void run() {
                Result result = route(new RequestBuilder().method(GET).uri("/api/projects"));
                assertEquals(play.mvc.Http.Status.OK, result.status());
                JsonNode node = Json.parse(contentAsString(result));
                List<Project> projects = Json.fromJson(node, List.class);
                assertTrue(projects.size() == 3);
            }
        });
    }

    @Test
    public void testRead() {
        running(fakeApplication(), new Runnable() {
            public void run() {
                Result result = route(new RequestBuilder().method(GET).uri("/api/projects/" + projectId));
                assertEquals(play.mvc.Http.Status.OK, result.status());
                JsonNode node = Json.parse(contentAsString(result));
                Project project = Json.fromJson(node, Project.class);
                assertEquals(projectId, project.id.intValue());

                // test bad read
                result = route(new RequestBuilder().method(GET).uri("/api/projects/" + nonExistantId));
                assertEquals(play.mvc.Http.Status.NOT_FOUND, result.status());
            }
        });
    }

    @Test
    public void testCreate() {
        running(fakeApplication(), new Runnable() {
            @SuppressWarnings("unchecked")
            public void run() {
                // read initial number of objects
                Result result = route(new RequestBuilder().method(GET).uri("/api/projects"));
                JsonNode node = Json.parse(contentAsString(result));
                int size = Json.fromJson(node, List.class).size();

                // add a new object
                Project project = new Project();
                project.name = "new";
                result = route(new RequestBuilder().method(POST).uri("/api/projects").bodyJson(Json.toJson(project)));
                assertEquals(play.mvc.Http.Status.CREATED, result.status());

                // should be one additional object
                result = route(new RequestBuilder().method(GET).uri("/api/projects"));
                node = Json.parse(contentAsString(result));
                List<Project> projects = Json.fromJson(node, List.class);
                assertEquals(size + 1, projects.size());
            }
        });
    }

    @Test
    public void testUpdate() {
        running(fakeApplication(), new Runnable() {
            public void run() {
                // create initial object
                Result result = route(new RequestBuilder().method(GET).uri("/api/projects/" + projectId));
                JsonNode node = Json.parse(contentAsString(result));
                Project project = Json.fromJson(node, Project.class);
                project.name = "updated";

                // now update object
                result = route(new RequestBuilder().method(PUT).uri("/api/projects/" + projectId)
                        .bodyJson(Json.toJson(project)));
                assertEquals(play.mvc.Http.Status.OK, result.status());

                // now read the updated object
                result = route(new RequestBuilder().method(GET).uri("/api/projects/" + projectId));
                node = Json.parse(contentAsString(result));
                project = Json.fromJson(node, Project.class);
                assertEquals("updated", project.name);
            }
        });
    }

    @Test
    public void testDelete() {
        running(fakeApplication(), new Runnable() {
            @SuppressWarnings("unchecked")
            public void run() {
                // read initial object
                Result result = route(new RequestBuilder().method(GET).uri("/api/projects"));
                JsonNode node = Json.parse(contentAsString(result));
                int size = Json.fromJson(node, List.class).size();

                // delete object
                result = route(new RequestBuilder().method(DELETE).uri("/api/projects/" + projectId));
                assertEquals(play.mvc.Http.Status.OK, result.status());

                // should now be one fewer object
                result = route(new RequestBuilder().method(GET).uri("/api/projects"));
                node = Json.parse(contentAsString(result));
                List<Project> projects = Json.fromJson(node, List.class);
                assertEquals(size - 1, projects.size());
            }
        });
    }

    @Test
    public void testAssign() {
        running(fakeApplication(), new Runnable() {
            @SuppressWarnings("unchecked")
            public void run() {
                // read workitems at first station before project assigned
                Result result = route(new RequestBuilder().method(GET).uri("/api/workItems?stationId=" + stationId));
                JsonNode node = Json.parse(contentAsString(result));
                int size = Json.fromJson(node, List.class).size();

                // assign project to factory
                result = route(new RequestBuilder().method(POST)
                        .uri("/api/projects/" + projectId + "/assign?factoryId=" + factoryId));
                assertEquals(play.mvc.Http.Status.OK, result.status());

                // read workitems at first station after project assigned
                result = route(new RequestBuilder().method(GET).uri("/api/workItems?stationId=" + stationId));
                node = Json.parse(contentAsString(result));
                List<WorkItem> stationWorkItems = Json.fromJson(node, List.class);
                assertEquals(size + 2, stationWorkItems.size());

                // unassign project
                result = route(new RequestBuilder().method(POST).uri("/api/projects/" + projectId + "/assign"));
                assertEquals(play.mvc.Http.Status.OK, result.status());

                // read workitems at first station after project unassigned
                result = route(new RequestBuilder().method(GET).uri("/api/workItems?stationId=" + stationId));
                node = Json.parse(contentAsString(result));
                stationWorkItems = Json.fromJson(node, List.class);
                assertEquals(size, stationWorkItems.size());
            }
        });
    }

}


text:
@interface DoraemonUIProfileViewController () <DoraemonSwitchViewDelegate>

@property (nonatomic, strong) DoraemonCellSwitch *switchView;

@end

@implementation DoraemonUIProfileViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = DoraemonLocalizedString(@"UI层级");

    _switchView = [[DoraemonCellSwitch alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, kDoraemonSizeFrom750(104))];
    [_switchView renderUIWithTitle:DoraemonLocalizedString(@"UI层级检查开关") switchOn:[DoraemonUIProfileManager sharedInstance].enable];
    [_switchView needTopLine];
    [_switchView needDownLine];
    _switchView.delegate = self;
    [self.view addSubview:_switchView];
}

- (BOOL)needBigTitleView{
    return YES;
}

#pragma mark -- DoraemonSwitchViewDelegate
- (void)changeSwitchOn:(BOOL)on sender:(id)sender{
    [DoraemonUIProfileManager sharedInstance].enable = on;
    [[DoraemonHomeWindow shareInstance] hide];
}

@end


text:
package org.xlrnet.datac.commons.util;

/**
 * Custom preconditions for easier checks. All checks throw runtime exceptions if a given condition is not met.
 */
public class Preconditions {

    private Preconditions() {

    }

    /**
     * Checks if the given condition is true. If not, a new {@link ConfigurationException} will be raised.
     * @param condition The condition to check.
     * @param messageTemplate The message template to output. Uses String.format().
     * @param parameters The parameters for the template.
     */
    public static void checkConfiguration(boolean condition, String messageTemplate, Object... parameters ) {
        if (!condition) {
            throw new ConfigurationException(String.format(messageTemplate, parameters));
        }
    }
}


text:
package cl.injcristianrojas.spring.data.service;

import java.util.List;

import cl.injcristianrojas.spring.data.model.Message;

public interface MessageService {
	public void insertMessage(Message message);
	public List<Message> getAllMessages();
}


text:
using namespace std;

AbstractClass::AbstractClass(){}
AbstractClass::~AbstractClass(){}
void AbstractClass::TemplateMethod()
{
	this->PrimitiveOperation1();
	this->PrimitiveOperation2();
}
ConcreteClass1::ConcreteClass1(){}
ConcreteClass1::~ConcreteClass1(){}
void ConcreteClass1::PrimitiveOperation1()
{
	cout << "ConcreteClass1::PrimitiveOperation1..." << endl;
}
void ConcreteClass1::PrimitiveOperation2()
{
	cout << "ConcreteClass1::PrimitiveOperation2..." << endl;
}

ConcreteClass2::ConcreteClass2(){}
ConcreteClass2::~ConcreteClass2(){}
void ConcreteClass2::PrimitiveOperation1()
{
	cout << "ConcreteClass2::PrimitiveOperation1..." << endl;
}
void ConcreteClass2::PrimitiveOperation2()
{
	cout << "ConcreteClass2::PrimitiveOperation2..." << endl;
}