Posts

javascript to external .js file -

can't figure out proper syntax place javascript code .js file. <script type='text/javascript' src='http://hostedusa3.whoson.com:8080/include.js?domain=www.yourdomain.com'></script> <script type='text/javascript' > if(typeof swotrackpage=='function')swotrackpage(); </script> if want inline code inside separate file, have move contents of second script tag .js file. then, set src attribute second <script> reference new file's url (relative or absolute).

javascript - Disable option values in one select dropdown depending on value selected in another -

i have form 2 select dropdowns. first opening times , second closing times. when user selects opening time closing time cannot earlier this. my jquery instead disables second drop down values instead of times earlier can seen here: jsfiddle . $('#open').change(function(){ if($('#close').val()<$('#open').val()){ $('#close').prop('disabled', true); }; }) how can behaviour want? try (here updated jsfiddle ): $('#open').change(function(){ var = $(this); $('#close option').each(function() { if($(this).val() < that.val()) { $(this).prop('disabled',true); } else { $(this).prop('disabled',false); } }); }); it works on chrome 36, not on firefox (haven't tested browsers besides two). since behavior unreliable, might try dynamically adding options second select element b...

How to fix the need to use sudo before starting Meteor? -

i have no clue why seem need use 'sudo mrt' everytime start meteor. need use sudo when installing mrt packages otherwise permission denied errors. i inspected folder on mac , seems have full read & write permission. i tried command sudo chown -rv [username] [directory] and still no luck, need keep using sudo meteor. how can take full ownership of folder , not have use sudo anymore when doing meteor? i guess installed meteorite local node module (this create node_modules directory in folder typed install command). you need install mrt globally using command : sudo npm install -g meteorite this install mrt users on system , won't need sudo run mrt. you can try reset ownership of meteor folder (i had issue 1 time). sudo chown -r $user:$user ~/.meteor if you're out of luck, try uninstall both mrt , meteor start scratch , detect procedurally problem is.

SQL database tag request -

i have photo table looks this: id title rating photopath 1 myself 7.0 /photopath1.jpg 2 cat 8.0 /photopath2.jpg 3 dog 6.0 /photopath3.jpg 4 girlfriend 5.0 /photopath4.jpg and tag table: id tag_name photo_id 1 selfie 1 2 sun 1 3 nature 2 4 relax 2 5 loyal 3 6 journal 3 7 selfie 4 8 sun 4 9 problems 4 and want call photos have tags "selfie" , "sun". how do that? select p.* photo p join (select p.id photo p join tag t on p.id = t.photo_id t.tag_name in ('selfie', 'sun') group p.id having count(*) = 2) x on p.id = x.id fiddle: http://sqlfiddle.com/#!2/5c95c2/2/0 output: | id | title | rating | photograph | |----|------------|--------|------------------| | 1 | myself | 7 | /photograph1.jpg | | 4 | girlfriend | 5 | /photograph4....

html - Open a different page for a download link -

hi have link on portfolio website downloads .exe file people can check out of work. the link <a href="downloads/project.exe">download here!</a> the problem have want open link. when person presses "download here!" download .exe , open html page have. any idea's on how this? thanks in advance <a href="javascript:opennew()">link</a> <script type="text/javascript"> function opennew(){ console.log("lets begin"); window.open("http://www.facebook.com"); window.location.href = "http://www.google.com"; } </script>

python 3.4 - Antlr4 Python3 target visitor not usable? -

i try follow antlr4 reference book , python3 target, got stuck in calculator example. on antlr4 docs says the python implementation of antlr close possible java one, shouldn't find difficult adapt examples python but don't yet. the java code visitor has .visit method , in python don't have method. think it's because in java visit method had parameter overloads of tokens. in python have visitprog() , visitassign() , visitid() etc. can't write value = self.visit(ctx.expr()) because don't know visit call? or missing instruction somewhere? the python2/3 targets not yet have visitor implemented. tried implement myself, , pull request send antlr guy see if did correctly. follow pull request here: https://github.com/antlr/antlr4-python3/pull/6

xcode - How to get NSTextFieldCell StringValue from NSTableView in cocoa -

i'm developing nstableview (cell based) app based in xcode5 , want each nstextfieldcell's cell determining row's height code far - (cgfloat)tableview:(nstableview *)tableview heightofrow:(nsinteger)row{ if (tableview == _tableview) { nstablecolumn *column = [_tableview tablecolumnwithidentifier:@"consecutivo"]; nstextfieldcell *cell = [column datacellforrow:row]; nsinteger occurences = [functions findoccurencesoftext:@"\n" inwholetext:cell.stringvalue]; if (occurences > 0) { return occurences * 17; } else { return 17; } } else { return 17; } } but cant string's cell value even if put nslog(@"text: %@", cell.stringvalue); all is text: any i'll appreciate