Posts

javascript - Make anchor tags behave like checkboxes and radio buttons -

i have unordered list like: <ul class="list-one"> <li><a href="#">hip hop</a></li> <li><a href="#">country</a></li> <li><a href="#">pop</a></li> <li class="selected"><a href="#">religious</a></li> </ul> i want anchors behave checkboxes. have similar list , want checkboxes there behave radio buttons. is there way using jquery? searched google couldnt find anything. you can work jquerys parent() , siblings() methods. check jsfiddle demo radios ! jquery radio: $(".list-one a").click(function(){ $(this).parent().addclass("selected").siblings().removeclass("selected"); }); jquery checkboxes : $(".list-one a").click(function(){ $(this).parent().toggleclass('selected'); }); if need radios form, can use label instead of ...

compilation - Building Vim .debs on Ubuntu -

from vim site: sudo apt-get install mercurial libssl-dev sudo apt-get build-dep vim hg clone http://hg.debian.org/hg/pkg-vim/vim cd vim hg checkout unstable debian/rules update-orig dpkg-buildpackage -i -i cd .. it looks there no commands called debian/rules on system. the wikia vim tips site not complete , ignores hard work of packagers of vim. standard way build debian or ubuntu binary package source package. using source packages far better solution people. pkg_basics.en.html#s-sourcebuild the upstream site https://code.google.com/p/vim/ indeed hosted mercurial , there github clone https://github.com/b4winckler/vim few people need bleeding edge sources. build-deps pretty significant. the debian vim maintainers use mercurial maintain packaging per debian/readme.source @ http://hg.debian.org/hg/pkg-vim/vim , debian developers commit access can packaging uses quilt maintain patches @ url ssh://hg.debian.org/hg/pkg-vim/vim information debian binary packages...

gfortran - Breakpoints are not hit when debugging Fortran using Eclipse. -

i have problem when debugging fortran using eclipse (i use gfortran compiler). can't set breakpoints, or, more precisely, "parallel breakpoints" type available (the green ones). when start debugging, program executed (whereas want stop, of course, whenever breakpoint hit). i'm used programming in matlab have started learning fortran, faster; got crazy debugging issue (matlab lot easier debug; doble-click set breakpoint , press f5, or f11 if want step in). it bug in ide, see bug 384187 . using latest photran version? @ how set breakpoints using photran ide in eclipse? claimed bug has been fixed. if works (which should), debugging in eclipse easy in matlab. fortran has long history in numerical computations why have such vast amount of legacy fortran code. however, if started learning new programming language either learn c or c++.

tcl - Can't pack a widget inside a sibling toplevel -

i'm trying pack (or place ) widget child of root toplevel . inside toplevel, child of . itself. is, % toplevel .tl .tl % frame .f .f % pack .f -in .tl can't pack .f inside .tl however, i've found code almost works: % frame .tl .tl % frame .f .f % pack .f -in .tl % wm manage .tl i said almost , because .f not visible. it's bit strange, because if put button inside .f , such as button .f.b -text foobar pack .f.b i see empty space reserved geometry manager, no widget visible. i'm sure i'm doing wrong, don't know , why, , pack , grid , place man pages don't help. edit: details i'm doing i'm trying build snit widget automates toplevel creation stuff. 1 thing putting ttk::frame inside every toplevel create, , managing using pack ... -fill both -expand true command. my snidget should it, i'd hide user perspective, change implementation wouldn't break existing code. the simple way this snit::widget toplevel ...

jquery - How to pass event to named function on.('click')? -

i have following trigger in jquery: $('.text').on('click', '.readless', contract); in contract, want use event.preventdefault() doesn't work in firefox, need pass event contract. how do this? you can this: $(function () { // attach event // new way (jquery 1.7+) - on(events, selector, handler); $('.text').on('click', '.readless', contract); function contract(e) { e.preventdefault(); alert(e.type); } // create elements dynamically $('.text').append('<div class="readless">click me</div>'); }); after adding reference of function contract on() method, event or e variable automatically passed function first argument. fiddle

iphone - IMvxResourceLoader: How to use it (MvvmCross v2) -

what steps need followed use imvxresourceloader (mvvmcross v2) in our project. tried follows public class aboutviewmodel : baseviewmodel, imvxserviceconsumer { private const string filename = "html/aboutapp.html"; public aboutviewmodel() { var resourceloader = this.getservice<imvxresourceloader>(); string helptext = resourceloader.gettextresource(filename); } } but failed. if remove lines inside aboutviewmodel(), app working fine. if use these lines, not able display view model. any suggestion? in advance. in addition this i trying initialise "resourceloader" plugin as private void initialiseplugins() { cirrious.mvvmcross.plugins.location.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.phonecall.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.sms.pluginloader.instance.ensureloaded(); cirrious.mvvmcross.plugins.email.pluginloader.instan...

database design - SQL - Linking two tables -

i have 2 tables, specifically, contain standard , specific parameters respectively. table1: pkparameter name unit 1 temperature k 2 length mm 3 pressure bar table2: pkspecparam name unit 1 weight kg 2 area m2 pkparameter ans pkspecparameter primary keys i combine these 2 tables third table keep track of primary keys can reference of parameters, regardless of table from. for example: pkcombined pkparameter pkspecparameter 1 1 null 2 2 null 3 3 null 4 null 1 5 null 2 now use pkcombined primary key reference parameter maybe there better way this, i've started meddling databases. select a.pkparameter , a.name,a.unit,b.pkspecparam , b.name,b.unit table1 outer join table2 b o...