Posts

javascript - How to trigger different functions based on a radio button option? -

i'm having troubles trying trigger 2 different functions based on radio button option. i have autocomplete field, source must setted radiobutton option. can do? i have done this, far: var autocompleteone = [ "item 01", "item 02", "item 03", "item 04", "item 05" ]; var autocompletetwo = [ "item 01.2", "item 02.2", "item 03.2", "item 04.2", "item 05.2" ]; $('#options').blur(function(){ if(document.getelementbyid("optiona").attr(checked, true{ $("#autocompletecaseone").autocomplete({ source: autocompleteone }); } if(document.getelementbyid("optionb").attr(checked, true{ $("#autocompletecasetwo").autocomplete({ source: autocompletetwo }); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery...

datetime - PHP - Handling dates before and after christ -

im making biogram on site lists known historical figures. right now, im getting values database, , on many if statements, determine display. /* @var $bio \models\library\biography */ $birth = []; $death = []; $date = null; if($bio->getbirthmonth() != null) { if ($bio->getbirthday() != null) { $birth = [ $bio->getbirthday(), $bio->getbirthmonth(), $bio->getbirthyear(), ]; } else { $birth = [ $bio->getbirthmonth(), $bio->getbirthyear(), ]; } } else { $birth = [ $bio->getbirthyear(), ]; } if($bio->getdeathmonth() != null) { if ($bio->getdeathday() != null) { $death = [ $bio->getdeathday(), $bio->getdeathmonth(), $bio->getdeathyear(), ]; } else { $death = [ $bio->getdeathmonth(), $bio->getdeathyear(), ]; } } else { $death...

javascript - Functions In CoffeeScript -

i'm trying convert function javascript coffeescript. code: function convert(num1, num2, num3) { return num1 + num2 * num3; } but how can in coffeescript? i'm trying run function html source this: <script type="text/javascript" src="../coffee/convert.js"></script> <script type="text/javascript"> convert(6, 3, 10); </script> but won't work , error saying: referenceerror: can't find variable: convert how correct this? you need export convert function global scope. see how can coffescript access functions other assets? window.convert = (num1, num2, num3) -> num1 + num2 * num3

css - How to get Bootstrap Grid without gaps per row -

Image
attached screenshot of bootstrap grid. wondering how make divs in lower row sit underneath ones above without sitting on new row. this code snippet of each item <div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-xs-12 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="<?php echo $row['productimage']; ?>" width="100%" alt=""> <div class="postcontent"><h3><?php echo $row['productname']; ?></h3><br> <p><?php echo $row['producttext']; ?></p> </div> </a> </div> thanks heaps place ones want have aligned vertically in same col , make width 100% . wrap in columns then. might want add top margin @ top , bottom simulate gutter

android - What difference between static and non static viewholder in RecyclerView Adapter? -

what advantages of approach (using static nested class in class myadapter extends recyclerview.adapter): static class myvh extends recyclerview.viewholder {...} and approach (using member inner class): class myvh extends recyclerview.viewholder {...} or doesn't affect performance , both approaches used? it more java question android question. recommended use static inner classes avoid memory leaks if take instances out of class. can have @ this awesome post explains memory leaks on inner classes. basically nyx says: if declare viewholder static can reuse in other adapters. anyway, not recommend it, create new separated class , use multiple places, make more sense. 1 class 1 purpose. in case of view holders, classes used inside adapter, instances should not go fragment or activity or elsewhere definition. means having static or non-static, in case of view holders, same. answering performance question, can have @ this answer. static 1 take less memor...

Smooks: Outputting EDI from Java -

inspired proposed solution in smooks edi writer , have following java code: // creates minimal edi message 1 field populated edifactv3d98amedpid edi = new edifactv3d98amedpid(); unbinterchangeheader header = new unbinterchangeheader(); unbinterchangeheader.s002senderidentification s002senderidentification = new unbinterchangeheader.s002senderidentification(); s002senderidentification.sete0004senderidentification("test"); header.sets002senderidentification(s002senderidentification); edi.setunbinterchangeheader(header); smooks smooks = new smooks("edi-output-smooks-config.xml"); // sets access exports specified in smooks config executioncontext executioncontext = smooks.createexecutioncontext(); exports exports = exports.getexports(smooks.getapplicationcontext()); result[] results = exports.createresults(); smooks.filtersource(executioncontext, new javasource(edi), results); list<object> objects = exports.extractresults(results, exports); javaresult.re...

Speech to text, java speech API, where to find it? -

Image
so wanted create small application laboratory @ home, , need speech recognition java speech api seems pretty solution problem of finding suitable api. have tried sphinx-4 api couldn't find jar-files in prealpha.zip package downloaded, find header files c projects... looked freetts api that's text speech , not other way around! so if can find java speech api glad if send me download link , not link oracle's webpage because have given amount of time , still have not found download link bin/lib folder full of jar-files... thanks help! please excuse english, comment question if don't understand part of it! :) search sphinx , pick jars in sphinx4-data , sphinx4-core . have added screen clarification. on right bottom select artifact tab instead of maven download button.