Posts

javascript - marionette control from backbone controls -

i want create mariontte control consists of 3 backbone controls. first date picker, second numeric stepper , third 1 again date picker. idea first date initial date , numeric stepper adds days , result shown in second date picker. anyway don't know how create marionette view when not child items same. how should approach this? i think can create compositeview(or layout can work) having 3 divs , render 3 different itemviews in 3 divs explicitly adding el of itemviews in divs e.g. if following compositeview template <div id="first-datepicker"></div> <div id="numeric-stepper"></div> <div id="second-datepicker"></div> then in compositeview js can render itemviews follows ui:{ firstdatepicker: "#first-datepicker", numericstepper: "#numeric-stepper", seconddatepicker: "#second-datepicker" }, onrender: function(){ this.ui.firstdatepicker.html(new dat...

wordpress - How to display block or trigger the style on Woocommerce if !is_in_stock -

i trying display block or div when product out of stock condition not appear work add_action( 'woocommerce_get_availability', 'display_welcome', 10); function display_welcome() { global $_product; if ( ! $_product->is_in_stock() ) { ?> <style> #hello {display:block } </style> <? } } html <div id="hello">try product instead</div> add_action('woocommerce_get_availability', 'display_welcome', 10, 2); function display_welcome($availability_class, $_product) { if ($availability_class['availability'] == 'out of stock') { $availability_class['class'] = $availability_class['class'] . ' my-customclass'; add_action('woocommerce_single_product_summary', 'hooks_add_div', 33); function hooks_add_div() { echo '<div id="helllo">mujeebu rahma...

jquery - open full calendar based on selected month -

i using foundation datepicker , full calendar. requiement is, 1) if select date in calendar, for example, current month july 2016. if select date in november or other month in foundation datepicker, full calendar should start selected month. please @ fiddle.one datepicker , 1 full calendar there. please @ following fiddle. jsfiddle defaultly full calendar in july month. @ starting 1 mor datepicker there. if change date on datepicker, @ time fullcalendar should opn on selected month. var nowtemp = new date(); var = new date(nowtemp.getfullyear(), nowtemp.getmonth(), nowtemp.getdate(), 0, 0, 0, 0); var checkin = jquery('#startdate').fdatepicker({ format: "dd.mm.yyyy", }).data('datepicker'); var checkout = jquery('#enddate').fdatepicker({ format: "dd.mm.yyyy", }).on('changedate', function (ev) { }).data('datepicker'); ...

string - append or replace last char by dynamic number in C without libraries (avr-gcc) -

i'm programming microcontroller , dynamically generate string. basically desire following: char * string = "app"; for(uint8_t i=0;i<max;i++){ char * newstring = app + i; printf("%s \n",newstring); } and should print app1, app2, app3, ... know there libraries manipulate strings, i'm working on microcontroller avr-gcc , keep code size minimal. i've been messing around pointers , arrays, can't work. edit: tried like: char * path = "application/app "; path[2]=(char) '1'; rest_activate_resource(&coap_app_res[coap_app_res_nb], path); but prints "aplication/app " (without 2nd p). to manipulate strings, first of strings must modifiable. string literals aren't modifiable. the first example can implemented this: char string[] = "appx"; /* x used placeholder */ for(uint8_t i=0;i<max;i++){ string[3] = + '0'; /* assign character x */ printf("%s \n...

html - Customise stripe button -

im using stripe checkout in rails app. have been following thier tutorial here . basic , have payment process working. what i'm having trouble styling button in following code. script contains button (im not sure if said right), brings in default button: <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="<%= rails.configuration.stripe[:publishable_key] %>" data-description="a month's subscription" data-amount="500" data-locale="auto"></script> iv tried applying styles strip-button class have no luck, have looked within doc provided cant find nothing within suggest how style default button. any suggestions or thier better way in styling button? i made little code pen i think you'll have use selector in stylesheet: .stripe-button-el { width: 100px; # ... } here's dom part want style: <b...

android - InflateException DatePicker -

i trying show datepickerdialog in fragment when user clicks edittext //initialise calendar newcalendar = calendar.getinstance(); datepickerdialog = new datepickerdialog(getactivity(), new datepickerdialog.ondatesetlistener() { public void ondateset(datepicker view, int year, int month, int day) { etdate.settext(day + "/" + month + "/" + year); } },newcalendar.get(calendar.year), newcalendar.get(calendar.month), newcalendar.get(calendar.day_of_month)); //show on click datepickerdialog.show(); the problem is ends with: fatal exception: main process: tvfriends.kolio.com.tvproba, pid: 26562 android.view.inflateexception: binary xml file line #18: binary xml file line #18: error inflating class android.widget.datepicker caused by: android.view.inflateexception: binary xml file line #18: error inflating class android.widget.datepicker caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.ne...

ios - Which of the following will set the font of UISegmentedControl? -

uifont font = [uifont boldsystemfontofsize: 12.0f]; nsdictionary attributes = [nsdictionary dictionarywithobject: font forkey: uitextattributefont]; [segmentedcontrol settitletextattributes: attributes forstate: uicontrolstatenormal]; [[uisegmentedcontrol appearance] settitletextattributes:[nsdictionary dictionarywithobjectsandkeys:[uifont fontwithname:@"stheitisc-medium" size:13.0], uitextattributefont, nil] forstate:uicontrolstatenormal]; segmentedcontrol.transform = cgaffinetransformmakescale(.6f, .6f); none of these. uifont font = [uifont boldsystemfontofsize: 12.0f]; nsdictionary attributes = [nsdictionary dictionarywithobject: font forkey: uitextattributefont]; [segmentedcontrol settitletextattributes: attributes forstate: uicontrolstatenormal]; the above code change font 1 particular segmentcontrol whereas below code change font segmentcontrol in app. [[uisegmentedcontrol appearance] settitletextattributes:[nsdictionary dictionarywithobjectsandkey...