Posts

javascript - how to add multiselect checkbox by clicking on button -

i want add multiselect checkbox clicking on button.i using bootstrap multiselect.if other bootstrap multiselect ok. functionalities not working mutiselct checkbox after clicking on button. $('#addsupplierbtn').click(function(){ $('#webhost').html($('#multiplesupplier').html()); }); <div id="multiplesupplier" > <select multiple="multiple" size="10" name="checked[]" id="chked" class='multiselect' > <option value="option1">option 1</option> <option value="option2">option 2</option> <option value="option3" selected="selected">option 3</option> <option value="option4">option 4</option> <option value="option5">option 5</option> <option value="option6" selected="selected">option 6</option> <...

why c++ does not accepts static keyword in function defnition? -

i have program class t has static function. static void t::func() { m_i=10; cout<<m_i<<endl; } when try add static in function definition, compiler throws error error: cannot declare member function ‘static void t::func()’ have static linkage. why not accepting static keyword in definition? the problem keyword static means different things depending on context. when declare member function static, in class t { ... static void func(); ... }; then static keyword means func class function, it's not bound specific object. when define function in source file, like static void t::func() { ... } then set function linkage different using static in declaration inside class. static when defining function function available in current translation unit , , contradicts declaration function available knows class. it's not possible make member function (declared static or not) have static linkage . if want "hide...

python - Concatenate required arguments and optional args in function? -

i want define function accepts , arbitrary number of dictionaries @ least 2 , want iterate on of them. i'm creating list of first 2 , append optional ones: def func(dict1, dict2, *dicts): dicts = [dict1, dict2] + list(dicts) d in dicts: # stuff but feel that's bit unnecessarily complicated. wondered if 1 alternative checking length of *dicts might better because don't need create new iterable: def func(*dicts): if len(dicts) < 2: raise valueerror('too few dictionaries, must give function @ least 2.') d in dicts: # stuff but still don't feel that's convenient since need explain somewhere because function signature looks accept arbitrary number of dicts (even 0 or 1). there way have signature of first option without having create complete new iterable in function? the first approach seems fine me, can simplify tiny bit using tuple instead of list first pair don't need list call: all_dicts...

java - "non-zero exit value 42" -

i having issue adding custom images app. when do,i gradle errors. searched on here , seen solution add: android: { usenewcruncher false } but didn't help. still getting "non-zero exit value 42 error". here gradle apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" aaptoptions { usenewcruncher false } defaultconfig { applicationid "net.androidbootcamp.techgadgets" minsdkversion 16 targetsdkversion 23 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.suppo...

Spring Swagger UI: what is difference between io.swagger, io.springfox, and com.mangofactory -

i working on integrating swagger ui spring boot mvc app , curious differences between these libraries. i looked @ each on mvnrepository.com , done different groups seem same thing. hoping clear idea of differences between these , if 1 recommended on others. notice swagger-core module io.swagger has usages. thanks! here an explanation of different libraries. springfox in sense v2 of swagger library used packaged mangofactory . happened transitioned using private repo creating github organization support development team. in short mangofactory evolved springfox supports 2.0 version of swagger spec (in addition 1.2). clear springfox , predecessor supports spring mvc. io.swagger mother ship if will. has great support spring , jax-rs. if you're looking support jax-rs based services using spring or otherwise that's great option.

c - Is it possible to treat a zip file as a documentRoot in apache? -

i trying modify apache source code in order let read files inside zip file instead of getting directly www folder. example: instead of having www/index.htm i want have zip file contains index.htm i've been working on days. possible or wasting time? you may indeed wasting time, doesn't mean it's not possible. apache doesn't have native capacity treat zipfile filesystem, there solutions can pursue. the simplest option use archivemount expose archive filesystem on host. let apache -- , else -- treat directory tree.

ruby on rails 4 - Kaminari : undefined method total_pages -

i have problem on kaminari rails 4. here renters_controller.rb def search @location = params[:search] @distance = params[:km] @renters = renter.near(@location, 30000).order("distance") @renters = @renters.page(params[:page]) if @renters.empty? @renters = renter.all search_map(@renters) else search_map(@renters) end end and view search.html.haml. .row = paginate @renters and error message started "/search?utf8=%e2%9c%93&search=" ::1 @ 2016-03-17 09:37:59 +0100 processing renterscontroller#search html parameters: {"utf8"=>"✓", "search"=>""} (0.5ms) select count(count_column) (select 1 count_column "renters" (false) limit 25 offset 0) subquery_for_count renter load (0.9ms) select "renters".* "renters" rendered renters/search.html.haml within layouts/application (8.2ms) completed 500 internal server error in 23ms (activerecord: 1.5ms) actionvi...