Posts

javascript - I have an svg element that i want to alter the color of with a button click. Involves, json, and csv -

what code create map projection using g.selectall("path)... assigns small circles perimeters of associated countries. want able create buttons in html file when pressed "select"/"deselect" or color/uncolor circles and/or associated countries. want able choose countries , circles colored. know how create buttons , reference them , such, calling functions them. hangup not sure how svg or g element redraw or reupdate canvas. if debug, shows call stack not going g.selectall more once method executes multiple times. first time writing js forgive inconsistencies or rough code outline.thanks! var svg = d3.select("#container").append("svg") .attr("width", width) .attr("height", height) .append("g"); //create secondary layer canvas svg var g = svg.append("g"); function buildmap() { d3.json("countries.geo.json", function(json) { d3.csv("map_of_the_gods...

tkinter - How to use .get() within a function. Python -

from tkinter import * import random def factorer(a,b,c): while true: random_a1=random.randint(-10,10) random_a2=random.randint(-10,10) random_c1=random.randint(-10,10) random_c2=random.randint(-10,10) if random_a1==0 or random_a2 == 0 or random_c1 == 0 or random_c2 == 0: pass elif (random_a1*random_c2) + (random_a2*random_c1) == b , random_a1/random_c1 != random_a2/random_c2 , random_a1*random_a2==a , random_c1*random_c2==c: break print "y=(%dx+(%d))(%dx+(%d))" % (random_a1,random_c1,random_a2,random_c2) root = tk() buttonsim1 = button(root, text="convert", command=lambda: factorer(entera.get(),enterb.get(),enterc.get())) buttonsim1.grid(row=2, column=3) entera = entry(root) entera.grid(row=1, column=1) enterb = entry(root) enterb.grid(row=1, column=2) enterc = entry(root) enterc.grid(row=1, column=3) root.mainloop() how can code run, every time click button crashes. works if re...

ruby on rails - How to include multiple resources in a tag? -

how can use tags when user clicks on tag takes him new page lists out posts tag in (in other words not 1 resource includes resources)? i played around creating tags scaffold, creates tags index, started getting error after error , i'm not sure if best route ;) routes.rb 'tags/:tag', to: 'tags#index' resources :habits resources :goals resources :valuations resources :quantifieds resources :results if route solving problem through creating tags_controller can offer me advice on can make work? or should work application controller , use partials did creating sidebar? i followed along episode start: http://railscasts.com/episodes/382-tagging thank time!

java - Parse.com whereDoesNotMatchKeyInQuery doesn't work -

i have relatively simple app shows quotes user. when user have seen quote, added "seenquote" relationship user table doesn't see again. when want retrieve new quotes user haven't seen still returns seenquotes. parseuser user = parseuser.getcurrentuser(); final parsequery<quote> newquotes = new parsequery<quote>(quote.class); final parserelation<parseobject> seenquotes = user.getrelation("seenquotes"); newquotes.wheredoesnotmatchkeyinquery("objectid", "objectid", seenquotes.getquery()); newquotes.findinbackground(new findcallback<quote>() { @override public void done(list<quote> quotes, parseexception e) { // still contains quotes have been seen } }); what doing wrong?

vb6 - eBay trading API run-time error when sending request -

i having problems sending getebaydetails request. use code (vb6, yes know) findpopularitems, getebaytime, etc, , works fine. private sub command1_click() dim httpcnct xmlhttp40 dim xmldoc freethreadeddomdocument40 dim ebayurl string dim devid string dim appid string dim certid string dim xmlstring string dim ebaytoken string dim title string dim itemid string dim price string ebayurl = "http://open.api.sandbox.ebay.com/shopping?" set httpcnct = createobject("msxml2.xmlhttp.4.0") httpcnct.open "post", ebayurl, false httpcnct.setrequestheader "x-ebay-api-app-id", appid httpcnct.setrequestheader "x-ebay-api-version", "857" httpcnct.setrequestheader "x-ebay-api-site-id", "3" httpcnct.setrequestheader "x-ebay-api-call-name", "findpopularitems" httpcnct.setrequestheader "x-ebay-api-request-encoding", "xml" xmlstring = "<?xml version=""1.0"...

javascript - Variable business hours in Fullcalendar -

i'm working fullcalendar , i'm using business has varying hours mon, tue, wed, fri 09:00 - 17:00. thu 09:00 - 19:00. businesshours: { start: '09:00', // start time (10am in example) end: '17:00', // end time (6pm in example) dow: [ 1, 2, 3, 5] // days of week. array of zero-based day of week integers (0=sunday) // (monday-thursday in example) } http://fullcalendar.io/docs/display/businesshours/ how can achieved? to use variable hours business hours, need use background events this: events: [ { id: 'available_hours', start: '2015-1-13t8:00:00', end: '2015-1-13t19:00:00', rendering: 'background' }, { id: 'available_hours', start: '2015-1-14t8:00:00', end: '2015-1-14t17:00:00', rendering: 'background' }, { id: 'work', start: ...

c++ - In MSVC there are such things as MFC custom controls (design time), is there a such thing as a win32 custom control? -

Image
in microsoft visual c++ (visual studio) 1 can create design time controls drag , drop on dialogs using mfc. for example http://www.codeproject.com/articles/521/creating-custom-controls my question is: can 1 develop win32 custom controls can drag , drop onto dialog @ design time, without using mfc? or win32 programming stuck controls win32 offers (i.e. edit, listbox, checkbox, etc.). does visual studio c++ ide allow create mfc custom controls @ design time, , win32 must create custom controls @ run time?