Posts

javascript - foreignObject div transform not working D3 -

at moment, d3 code animates svg circles along path, have svg 'name' labels moving alongside each. when circle hovered over, div (which have created foreign object in same group 'g2' labels) appears comment inside. i want these tooltips. problem cannot div transform along path in same way name labels - stick top left-hand corner of page. i not sure if problem how grouping things, or whether foreignobject should directly appended svg. have tried various things , suggestions other questions no success, appreciated! also, interested in making work in chrome. here jsfiddle: http://jsfiddle.net/yumip/q5jag/1618/ var greetings = ["hello","hi","howdy"]; var names = ["person a","person b","person c"]; var width = 960, height = 500; var n = greetings.length, m = 12, degrees = 180 / math.pi; var bubbles = d3.range(n).map(function() { var x = math.random() * width, y = math.random() *...

c# - How does html decoding work? -

in app compare strings. have strings same of them contain white space, , other contain nbsp, when compare them different. however, represent same entity have issues when compare them. that's why want decode strings compare. way nbsp converted space in both of strings , treated equal when comparison. here's do: httputility.htmldecode(string1)[0] httputility.htmldecode(string2)[0] but still string1[0] has ascii code of 160, , string2[0] has ascii code of 32. obviously not understanding concept. doing wrong? you trying compare 2 different characters, no matter how resembling might seem you. the fact have different character codes enough make comparison fail. easiest thing replace non-breaking space regular space , compare them. bool c = html.replace('\u00a0', ' ').equals(regular);

Bitwise operation alternative in Neo4j cypher query -

Image
i need bitwise "and" in cypher query. seems cypher not support bitwise operations. suggestions alternatives? want detect ... example 268 (2^8 + 2^3 + 2^2) , can see 2^3 = 8 part of original number. if use bitwise , (100001100) & (1000) = 1000 way can detect if 8 part of 268 or not. how can without bitwise support? suggestions? need in cypher. another way perform type of test using cypher convert decimal values collections of decimals represent bits set. // convert binary number collection of decimal parts // create index size of number convert // create collection of decimals correspond bit locations '100001100' number , [1,2,4,8,16,32,64,128,256,512,1024,2048,4096] decimals number , range(length(number)-1,0,-1) index , decimals[0..length(number)] decimals // map bits decimal equivalents unwind index number, i, (split(number,''))[i] binary_placeholder, decimals[-i-1] decimal_placeholder // multiply decimal value bits set collect(decimal_pl...

javascript - Get text value using name attirbute one by one -

i have 3 elements of html <h3 contenteditable class="education" name="education[index][university]>1</h3> <span contenteditable class="education" name="education[index][time]>2</span> <p contenteditable class="education" name="education[index][description]>3</p> so want text value order h3-span-p 1 one using name attribute javascript.after every value how can have new line follow after this 1 2 3 thanks in advanced try this: $(function() { var output = $('[name^="education[index]"]').map(function() { return $(this).html(); }).get().join('\n'); alert(output); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <h3 contenteditable name="education[index][university]">1</h3> <span contenteditable name="education[index][time]">2</span>...

javascript - Using multiple selectors with each having different events -

this question has answer here: combining $('body').on('click') $(window).resize(function() in jquery 4 answers i need this: $("#household").children().change(function(){ alert("changed"); }); $('.ui-icon.ui-icon-closethick.delete').click(function(){ alert("changed"); }); turned this: $("#household").children().change || $('.ui-icon.ui-icon-closethick.delete').click(function(){ alert("changed"); }); i know bottom code isn't correct, hoping explains mean. want alert executed if #household.children() changed , .ui-icon.ui-icon-closethick.delete clicked, without writing code twice. you can achieve putting common logic in own function called both events: function changed() { console.log('changed') } $("#household").children().chan...

c# - ReSharper cannot resolve symbol -

Image
i'm building asp.net 5 (asp.net core 1.0) mvc application. i'm using visual studio 2015 resharper ultimate 10.0.2. i have 2-tier layer solution consists of www (web application) , services layer. www has reference services layer. when resharper suspended , classes within www layer able invoke objects services layer, shown here: however, when resharper enabled , following message: cannot resolve symbol 'services' , shown here: what i've tried: clearing caches tools -> options -> resharper ultimate -> options -> clear caches remove jetbrains folder %appdata% restarting visual studio 2015 reinstalling resharper suspending , resuming resharper adding , removing references rebuilding solution any appreciated. in visual studio 2017 solved in way: close solution delete ".vs" hidden folder reopen solution , rebuild it

nuget - Package Manager console ProjectItem.FileCodeModel returning null in VS 2015 but not in VS 2013 -

there seems there´s bug in package manager when using projectitem.filecodemodel property in vs 2015, returns null unlike vs 2013 expected object. we´re using vs 2013 ultimate update 3 when works , when using vs 2015 enterprise update 1 returns null. this how recreate problem. on vs 2013. file --> new --> project… choose templates --> visual c# --> web. pick asp.net web application. choose mvc template. open package manager console. insert package manager console: ((get-project).projectitems | foreach-object { $ .projectitems } | { $ .name -eq "routeconfig.cs" }).filecodemodel.codeelements this return codeelements expected. on vs 2015. file --> new --> project… choose templates --> visual c# --> web. pick asp.net web application. choose mvc template. open package manager console. insert package manager console: ((get-project).projectitems | foreach-object { $ .projectitems } | { $ .name -eq "routeconfig.cs" }).filec...