Posts

python - Is it possible to create a canvas inside of a class -

i working on project have have grid made of points... seems code of class ok because there no error message. can't create canvas inside of class? helping me. here code: from tkinter import * root = tk() class grid(): def createcanvas(self, master, width, height): self.canvas = canvas(master, width=width, height=height) return(self.canvas) def createlabel(self, master, textu): self.l = label(self.c, text=textu) self.l.pack() def createpoints(self, master, gridsize): # gridsize format '8x8' gridsize = gridsize.split('x') in range(len(gridsize)): gridsize[i] = int(gridsize[i]) #[8,8] example --> x,y coordinates spx = 0 spy = int(canvas['height']) in range(gridsize[1]): j in range(gridsize[0]): master.create_oval(spx, spy, spx+5, spy+5) spx = spx + (int(canvas['height'])/gridsize[0]) spx = ...

javascript - How to override the background color in material ui select field dropdown menu? -

Image
i have been working materialui time , impressed library - however, there times customizability sorely lacking. instance, trying style selectfield dropdown menu unable change several div styles. from have seen, select field contains dropdownmenu, in turn contains menu component. can see in image below, design close implementation, several issues. however, these issues causing problems right now. main issue can't theme div between paper element , menu element, unfortunately div white background applied to. if can style element able give top padding, simulate spacing between menu , selectfield . is there way style element? have used dropdownmenuprops of selectfield component pass menustyle override menu styles, allows me give menu border radius , green border, , doesn't allow me style parent div . has else had luck doing this? p.s. know theme.menu rather not use unless absolutely necessary, have override everywhere else menu component used. edit: ha...

api - Domain nameservers change in godaddy -

i using godaddy api change domain nameservers , errors: {"code":"failed_name_server_validation","message":"failed update nameserversduplicate ip address","name":"apierror"} or {"code":"failed_name_server_validation","message":"failed update nameserversduplicate nameservers","name":"apierror"} tried google it, not found useful. means , how fix this? thank in advance. i interpret validation on string failing, sure there no new lines or invalid characters in string submitting?

html/javascript: Hiding link destination and opening link in new tab -

i using following javascript (provided m59 in this previous answer) hide destination of link shows @ bottom of browser window when hovering on link: <div> <a data-href="http://www.google.com/"> link </a> <script type="text/javascript"> var anchors = document.queryselectorall('a[data-href]'); (var i=0; i<anchors.length; ++i) { var anchor = anchors[i]; var href = anchor.getattribute('data-href'); anchor.addeventlistener('click', function() { window.location = href; }); } </script> </div> this works fine, link open in new tab well. how have change script in order so? i tried using window.open('href','_blank'); instead of window.location = href; did not work. unless im missing something, obvious thing add target anchor: <a data-href="http://www.google.com/" target=...

Group by multiple columns in R's dplyr -

i group data frame multiple columns names elements of vector names_vec : df %>% group_by(names_vec) i error message: "column names_vec unknown". because there no 1 column called names_vec . how achieve this? use rlang::syms() coupled !!! : library(rlang) df %>% group_by(!!!syms(names_vec))

javascript - GA send event, not working with custom dimensions -

i'm trying include list of custom dimensions when sending ga click event. this code works: ga('send', 'event', category, action, label, { 'hitcallback': function () { //some code goes here } }); but when adding custom dimensions: ga('send', 'event', category, action, label, customdimensions.dimensionstosend, { hitcallback': function () { //some code }, 'hitcallbackfail': function () { alert("unable send google analytics data"); } }); neither hitcallback nor hitcallbackfail gets fired. read in few places ( like here ) should able add custom dimensions ga send event function, maybe i'm doing wrong. the problem second code block custom dimensions not being set appropriately. can't pass custom dimensions in further argument main ga() function. instead, need pass them in through fieldsobject (as part of object you're sending last argument), this: ga('s...

linux - What does the first star (*) mean in visudo command restriction -

restriction example in visudo : (all) nopasswd: (all) /bin/cp * /var/www/html/* i understand of it, first star driving me nuts. best guess , either command options or source path. thanks! it both options , source argument. command line starts /bin/cp , includes /var/www/html match. however rule might not what's intended. rather dangerous . can misuse rule bypass destination restriction.