Posts

MatplotLib (TKinter) + OpenCV crashing in Python 3 -

i trying run python 3 code first shows opencv window , when closes should plot using matplotlib. upon plt.show() call program crashes: python3.6 quit unexpectedly. import numpy np import matplotlib matplotlib.use("tkagg") # <== doesn't solve problem import matplotlib.pyplot plt import cv2 #cv2.ocl.setuseopencl(false) <== doesn't solve problem im = np.zeros((100,100,3)) cv2.imshow('test', im) cv2.waitkey(0) plt.plot(np.sin(np.linspace(0,20,200))) plt.show() # <== crashes on call in other stackoverflow posts found setting matplotlib backend tkagg should fix or setting setuseopencl(false) . both these potential fixes not work on macbook. i've tried several things, changing import order, trying swap matplotlib backend. has idea on how fix problem? macos sierra 10.12.3 python 3.6.0 tkinter version 8.5 opencv version 3.2.0 matplotlib version 2.0.0 the stacktrace of how crashes: libc++abi.dylib: terminat...

gorm - Discriminator multi-tenant setup with SpringSecurity plugin in Grails -

i'm trying setup discriminator-based multi-tenant system based on documentation found in gorm guide do determine tenant using system want use spring security plugin , show data depending on user id. this tenantresolver: class mytenantresolver implements alltenantsresolver { def springsecurityservice @override iterable<serializable> resolvetenantids() { return new detachedcriteria(user) .distinct('id') .list() } @override serializable resolvetenantidentifier() throws tenantnotfoundexception { return springsecurityservice.currentuser.id } } and add springsecurityservice in resources.groovy file: beans = { mytenantresolver(mytenantresolver) { springsecurityservice = ref("springsecurityservice") } } unfortunately causes circular dependency: the dependencies of of beans in application context form cycle: grailscachefilter ↓ (inner bean)#6...

javascript - How to select tr whose first and second td contains specific value? -

Image
i have table looks this: code follows: <table id="table1"> <tr> <td>hu</td> <td>bip</td> <td>pannon</td> </tr> <tr> <td>hu</td> <td>bip</td> <td>t-mobile</td> </tr> <tr> <td>hu</td> <td>bip</td> <td>vodafone</td> </tr> <tr> <td>hu</td> <td>fun</td> <td>pannon</td> </tr> <tr> <td>hu</td> <td>fun</td> <td>t-mobile</td> </tr> <tr> <td>hu</td> <td>fun</td> <td>vodafone</td> </tr> </table> how select last <tr> first <td> contains "hu" , second <td> contain...

git - checkin locally works, I have no server checkin enabled, files stay in changes -

i have visual studio 2017 solution 6 projects in. i right clicked on solution "add solution source control". i go team explorer / changes / commit all. works fine "commit abcde123 created locally. sync share changes server. (i don't want share changes server - i'm solo dev). the changes window still full of changes. offers take commit again - press - errors, presume because trying reach server isn't configured. "fatal: unexpected sequence in commit output.". the changes window still full. i have changed files - can't see changes made (e.g. right clicking , selecting "view history"). think may because checkin server failed. how can set git in visual studio work locally, not try , upload server , see local checkin having finished checking in? (i think has worked fine in past single project solutions).

r - How to effectively flatten nested lists and dataframes into a single dataframe? -

i have data formatted in way that's difficult use, i'm trying flatten out. minimum reproducible example here . > str(sampledata) list of 4 $ events :'data.frame': 2 obs. of 3 variables: ..$ cateringoptions:list of 2 .. ..$ :'data.frame': 1 obs. of 3 variables: .. .. ..$ agreed : logi true .. .. ..$ tnc :'data.frame': 1 obs. of 5 variables: .. .. .. ..$ identity : chr "spicyowing" .. .. .. ..$ schema : logi na .. .. .. ..$ elementid : chr "105031" .. .. .. ..$ elementtype : logi na .. .. .. ..$ elementversion: logi na .. .. ..$ address: chr "new york" .. ..$ :'data.frame': 1 obs. of 3 variables: .. .. ..$ agreed : logi true .. .. ..$ tnc :'data.frame': 1 obs. of 5 variables: .. .. .. ..$ identity : chr "baconeggs" .. .. .. ..$ schema : logi na .. .. .. ..$ elementid : chr "105032" .. .. .. ..$ el...

SUM on values of duplicate row in MYSQL -

i have burning question. running mysql query returns rows duplicate values in it. that's no problem because that's how saved data in past. want label stay same, value (int) must summed. have no clue how this. can me please? label |count | _________________ shelves |15 | pictures |39 | chairs |19 | tables |41 | shelves |49 | cabinets |16 | so want count summed in mysl when label duplicate. appreciated! thanks in advance! you can use group by sum , e.g.: select label, sum(`count`) table group label;

RabbitMQ security : how to prevent consumer from creating an exchange -

i have fanout exchange (named : test_exchange) allow users dynamically create queues. in order prevent them create whatever want have restricted access way: configure : test_exchange.* write : test_exchange.* read : test_exchange.* when creating queue bind exchange, have use following naming convention : test_exchange.(some guid), example : test_exchange.hjlgs6jrtzbuq48fywfizq this works fine. except can create exchanges if respect naming convention. according rabbitmq documentation queuedeclare : needs configure rights queuebind : needs write rights the problem create exchange need same configure rights. what solution allow consumer create queue, , bind specific exchange ? and no other access rights?