Posts

Showing posts from June, 2015

active directory - Azure AD multitenant non-admin cant login - requires consent from admin -

Image
i have azure ad multi-tenant application have assigned these graph permissions the permissions have added doesn't require admin, when try login non admin user different tenant, gives me following message- application needs permission access resources in organization admin can grant. please ask admin grant permission app before can use it. i aware of fact admin permissions require admin consent, here if gave permission "access directory signed in user", still have give admin consent. to enable normal user consent applications, please ensure admin have enable user consent figure below(azure active directory->user settings):

soap - Unable to decrypt MTOM/XOP attachment using SUDS (python) -

i have soap client downloads file server. request has body , attachment (the file) encrypted using 2 separate keys. both keys included in respective <xenc:encryptedkey> tags. can decrypt body no problem using 1 of keys, attachment giving me issues. my code: from crypto.cipher import aes crypto import random class aescipher: def __init__( self, key, bs = 16): self.key = key self.bs = bs def _pad(self, s): return s + (self.bs - len(s) % self.bs) * chr(self.bs - len(s) % self.bs) def _unpad(self, s): return s[:-ord(s[len(s)-1:])] def decrypt( self, enc ): enc = base64.b64decode(enc) iv = enc[:self.bs] cipher = aes.new(self.key, aes.mode_cbc, iv ) return self._unpad(cipher.decrypt( enc[self.bs:])) open('test/resp-down-file','rb') f: encfile = f.read() #...the key extracted elsewhere... cryptor = aescipher(key) cryptor.decrypt(encfile) at best i'm getting garbled res

MySQL update all values in column based on max date and group -

i'm trying use group clause update dt column based on column 'last' . need find last date group ' group hid,tid,tdate,fid,did,depid,acc ' , set 'dt' value record in group. for example: | id | hid | tid | tdate | fid | did | p2 | depid | acc | dt | last | |----------|-------|-----|------------|-----|-----|-------|-------|------|------|----------------------| | 3742030 | 12332 | 1 | 2017-09-02 | 1 | 1 | 9560 | 1 | 5334 | 1 | 2016-11-03t09:00:20z | | 3799297 | 2386 | 1 | 2017-08-29 | 1 | 1 | 8480 | 1 | 5352 | 1 | 2016-11-03t11:12:55z | | 4848877 | 2386 | 1 | 2017-08-29 | 1 | 1 | 8720 | 1 | 5352 | 2369 | 2016-12-17t16:59:22z | | 10706343 | 12332 | 1 | 2017-09-02 | 1 | 1 | 9660 | 1 | 5334 | 2065 | 2017-03-01t12:32:27z | | 14546682 | 2386 | 1 | 2017-08-29 | 1 | 1 | 11720 | 1 | 5352 | 4431 | 2017-05-12t10:24:09z | | 15824920 | 12332 | 1 | 2017-09-02 | 1

ios - Incomplete UIBezierPath Stroke -

Image
i'm creating split button on ios using 2 uibuttons placed next each other. so: as can see, there's small bite taken out of right button's top left corner undesirable. i'd part of stroke complete. the right button uses uibezierpath sublayer draw border around button: let borderwidth = cgfloat(4.0) let borderlayer = cashapelayer() var borderframe = button.bounds.insetby(dx: borderwidth/2.0, dy: borderwidth/2.0) borderlayer.frame = borderframe borderframe.origin = cgpoint.zero borderlayer.path = uibezierpath(roundedrect: borderframe, byroundingcorners: [.topright, .bottomright], cornerradii: radius).cgpath borderlayer.linewidth = borderwidth borderlayer.fillcolor = uicolor.white.cgcolor borderlayer.strokecolor = uicolor.green.cgcolor button.layer.addsublayer(borderlayer) if use borderlayer.path = cgpath(rect: borderframe, transform: nil) instead of uibezierpath, works fine. , if round top left corner of uibezierpath works fine. can me figure out ho

xlsxwriter on python, Using conditional_format function with '3_color_scale' -

Image
i have pandas dataframe write excel sheet. want format shows heatmap of dataframe. i figured best way go use worksheet.conditional_format() function {'type': '3_color_scale'} argument. however, noticed only colors in cells holds integers. wont color has float in it . know how fix issue? here sample of code. writer = pd.excelwriter(file_name, engine='xlsxwriter') df.to_excel(writer, sheet_name=selected_factor, startrow=row_location, startcol=col_location) worksheet = writer.sheets['sheet 1 testing'] worksheet.conditional_format('b8:e17',{'type': '3_color_scale'}) i on python 2.7 , using pandas version 0.15.2 . edit i figured out why giving me trouble, numbers being saved strings spread sheet not floats. i don't see issue when run following example. highlights integers , floats: import pandas pd # create pandas dataframe data. df = pd.dataframe({'data': [10, 20.5, 30, 40, 50.7, 62, 70]})

javascript - Search dynamically created HTML table for checked boxes -

i have 2-dimensional javascript array dynamically creating html table. each row has 3 checkboxes; "deny", "approve" , "more info". goal have user make checkbox selections , click button , have different tasks performed depending on checkboxes selected. here code create table. data coming mysql db: function load() { $.post( "returnsmedb.php", function(response) { var block = [] (var item in response) { var objectitem = response[item]; var firstname = objectitem.fname; var lastname = objectitem.lname; var username = objectitem.uname; var email = objectitem.email; var password = objectitem.password; var deny = document.createelement("input"); deny.type = "checkbox"; deny.class = "chk"; deny.name = "deny"; var approve = document.createelement("input"); approve.type = "chec

react native - How to get full screen background with a transparent statusbar? -

Image
i want show react-native-maps in full screen. header of stacknavigator (react native navigation) should shown on map. status bar too. want add small gradient on map make status bar , button (and maybe more buttons on right header side) more readable. at moment use of stacknavigator automatically limiting "fullscreen" map (flex: 1) bottom of navigation header. how solve this? react-native: 0.46 react-navigation: 1.0.0-beta.11 for want solve this, add following screen-component: static navigationoptions = { headerstyle: { position: 'absolute', top: 0, left: 0 }, headerbacktitlestyle: { opacity: 0, }, headertintcolor: '#fff' }; and add lineargradients (if want) , have this:

ios - NSKeyedUnarchiver returns nil - Could not cast value of type 'MyProj.Meal' (0x105373f68) to 'MyProj.Meal' (0x11f5ee928) -

i'm trying hang of archiving objects. i'm following apple's example project persistence here: https://developer.apple.com/library/content/referencelibrary/gettingstarted/developiosappsswift/persistdata.html basically there's meal class conforms nscoding protocol. when run tests archive/unarchive meal object, following error: could not cast value of type 'myproj.meal' (0x105373f68) 'myproj.meal' (0x11f5ee928) here's code produces error; error on third line: let meal = meal(name: "food", photo: nil, rating: 4)! let data = nskeyedarchiver.archiveddata(withrootobject: meal) let unarchivedmeal = nskeyedunarchiver.unarchiveobject(with: data) as! meal xctassertnotnil(unarchivedmeal) and here's meal class apple: // // meal.swift // foodtracker // // created jane appleseed on 11/10/16. // copyright © 2016 apple inc. rights reserved. // import uikit import os.log class meal: nsobject, nscoding { //mark: properties var nam

javascript - How to remove the minimum number from multiple arrays -

//here code: function removesmallest(arr) { var min = math.min.apply(null, arr); return arr.filter((e) => {return e != min}); } console.log(removesmallest([2,1,3,5,4], [5,3,2,1,4], [2,2,1,2,1])); /*the issue need third array output [2,2,2,1]. code doing telling removing smallest number in each array sake of problem, need take out 1 of ones(if makes sense). appreciate help! */ you need change logic slightly. find minimum number in array, use find first index of number, , remove specific number. function removesmallest(arr) { var min = math.min.apply(null, arr); arr.splice(arr.indexof(min), 1); return arr; }

matrix - Expand Table Size R -

i'm using table() , based off binned data, creates rows 9 25 , columns 4 25. i want compare table, need 1 25 on each axis. i've tried making empty matrix that's 25x25 add table to, of course doesn't work since don't match in size. i'm sure there's simple solution i've overlooked, appreciate help!

CSV Silently Not Reading All Lines on Python on Windows -

i'm trying read lines of tsv file list. however, tsv reader terminating , not reading whole file. know because data 1/6 of length of whole file. no errors thrown when happens. when manually inspect line terminates on (corresponding length of data , lines have tons of unicode symbols. thought catch unicodedecodeerror, instead of throwing error, quits out of reading whole file entirely. imagine it's hitting that's triggering end-of-file?? what's throwing me loop: error occurs when i'm using python 2.7 on windows server 2012. file reads 100% on unix implementations of python 2.7 using both code snippets below. i'm running inside anaconda on both. here's i've tried , neither works: data = [] open('data.tsv','r') infile: csvreader = csv.reader((x.replace('\0', '') x in infile), delimiter='\t', quoting=csv.quote_none) data = list(csvreader) i tried reading line line... with open('data.t

mongodb - finding values based on cartesian product of other values -

consider collection holding following: { "a": 0, "b": 0, "c": 8, "d": 7 } { "a": 0, "b": 0, "c": 10, "d": 2 } { "a": 1, "b": 0, "c": 2, "d": 4 } { "a": 1, "b": 0, "c": 5, "d": 9 } { "a": 0, "b": 1, "c": 4, "d": 11 } { "a": 0, "b": 1, "c": 12, "d": 4 } { "a": 1, "b": 1, "c": 3, "d": 2 } { "a": 1, "b": 1, "c": 0, "d": 1 } i query collection such following (or similar) returned { "_id" : { "a" : 0, "b" : 0 }, "out" : [{c: 8, d: 7}, {c: 10, d: 2}] } { "_id" : { "a" : 1, "b" : 0 }, "out" : [{c: 2, d: 4}, {c: 5, d: 9}] } { "_id" : { "a" : 0, "b" : 1 }, "o

windows - Problems getting correct output in Powershell -

i'm trying make powershell script ask user input service name, run through get-service , , show result user. for example, if user enter vmtools show: status name displayname ------ ---- ----------- running vmtools vmware tools this code: write-host "enter service name" $servicename = read-host $result = get-service $servicename write-output "$result" however, outputs: system.serviceprocess.servicecontroller that because when add quotation marks around types of variables, outputs variable type, not actual contents of variable. therefore, removing quotation marks on variable output fix problem. replace last line this: write-output $result

parallel processing - worse case scenario: launched two copies of a program which appends lines to a file -

i have python program performs simple operation on file: with open(self.cache_filename_url, "a", encoding="utf8") f: w = csv.writer(f, delimiter=',', quotechar='"', lineterminator='\n') w.writerow([cache_url, rpd_products]) as can see opens file , appends csv line it. lot, in loop. i accidentally ran 2 copies of program simultaneously, think have been appending file simultaneously. trying determine worst-case-scenario file corruption. do think writes @ least atomic operations in case? example wouldn't problem me: old line old line new line written instance 1 new line written instance 2 new line written 1 this would problem me: old line old line [half of new line written instance 1] [half of new line instance 2] etc to put way, possible 2 append operations "interfere" each other? edit: using windows 7 opening same file multiple times in shared write mode can problematic. and, if don&#

Finding XPath expression to data element in Workday -

is there mode or tool in workday can me determine xpath specific data element within larger xml blob? on project in need extract various attributes worker_data information, due technical limitations on client side, unable secure capable assistance task. i want know data type , identifier corresponds item on screen, , clues path element within larger item. i complete workday newbie no access working system.

process - What is a centralized or distributed approach to mutual exclusion? -

in distributed system may use either centralized or distributed approach mutual exclusion, impact experienced when have station crashes? if station crashes common, approach use? why? i concept of centralized or distributed systems not when comes mutual exclusion.

eclipse - porting java program from windows to linux: invisible java swing elements in main frame on linux only -

so trying port large java program windows linux (centos 7). program works fine on windows, in linux set main frame of application shows (title, maximize minimize exit buttons found on top bar of applications). java swing elements (buttons, tables, drop down menus) invisible @ frame (clicking on them bring invisible menu). again works fine on windows, isn't code. things i've tried: -attempt: trying run different program wrote has a java swing gui result: same problem. conclusions: not code problem -attempt: downloading simple gui example works on windows result: same problem conclusions: not code problem -attempt: downloading simpler gui example works on windows result: same problem conclusions: not code problem -attempt: reinstall java (yum remove, yum install) result: same problem conclusions: don't know draw this, not installation of java? -attempt: reconfigure build , classpaths result: same problem conlusions: don't kn

Docker build from Dockerfile with more memory -

how docker build dockerfile more memory? this different question allow more memory when docker build dockerfile when installing software natively, there enough memory build , install marian tool but when building docker image using dockerfile https://github.com/marian-nmt/marian/blob/master/scripts/docker/dockerfile.cpu , fails multiple memory exhausted errors virtual memory exhausted: cannot allocate memory [out]: step : run cmake $marianpath && make -j ---> running in 4867d166d17a -- c compiler identification gnu 5.4.0 -- cxx compiler identification gnu 5.4.0 -- check working c compiler: /usr/bin/cc -- check working c compiler: /usr/bin/cc -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- detecting c compile features -- detecting c compile features - done -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi in

json - post data to server on android -

i'm trying post data server using cakephp api. using postman api works fine on android got problem. i'm using asynctask think may have problem json post. got error message telling me that org.json.jsonexception: value <br of type java.lang.string cannot converted jsonobject this code ,could please tell me what's wrong ? public class asyctaskmanager { public static class addapplication extends asynctask<string, void, string> { string result ; @override protected string doinbackground(string... params) { string addflightplanurl = "http://xxx.xxx.xxx.xxx:8765/car/addapplication"; string token = "eyj0exaioijkv1qilcjhbgcioijiuzi1nij9.eyjzdwiiojisimv4cci6mtuwmtczotkynh0.5dwpuoscldi3ivkuj6afpmst6d5mwuoacozq0egblay"; string postdata ; url object = null; try { object = new url(addflightplanurl); httpurlconnection con = (h

App crash on android seven -

when run app on android 7 app crashes. android monitor throws : caused by: android.os.fileuriexposedexception: file:///storage/emulated/0/picture.jpg exposed beyond app through clipdata.item.geturi() and code is @override public void onrequestpermissionsresult(int requestcode, @nonnull string[] permissions, @nonnull int[] grantresults) { super.onrequestpermissionsresult(requestcode, permissions, grantresults); switch (requestcode) { case request_write_permission: if (grantresults.length > 0 && grantresults[0] == packagemanager.permission_granted) { takepicture(); } else { toast.maketext(mainactivity.this, "permission denied!", toast.length_short).show(); } } } @override protected void onactivityresult(int requestcode, int resultcode, intent data) {

time - Lua 4 script to convert seconds elapsed to days, hours, minutes, seconds -

i need lua 4 script converts seconds elapsed since seconds = 0 d:hh:mm:ss formatted string. methods i've looked @ try convert number calendar date , time, need elapsed time since 0 . it's okay if day value increments hundreds or thousands. how write such script? this similar other answers, shorter. return line uses format string in display result in d:hh:mm:ss format. function disp_time(time) local days = floor(time/86400) local hours = floor(mod(time, 86400)/3600) local minutes = floor(mod(time,3600)/60) local seconds = floor(mod(time,60)) return format("%d:%02d:%02d:%02d",days,hours,minutes,seconds) end

python - Py2app ignoring local packages -

i have following setup.py: https://github.com/pext/pext/blob/30384647024ad3474d2c955d642ad6f7f745ffb5/setup.py i trying build .app of this, py2app seems ignore listed packages. noticeably incorrect following output when running python3 setup.py py2app (and running app crashing due missing these imports): modules not found (unconditional imports): [...] * pext_base (/users/travis/build/pext/pext/pext/__main__.py, __main__) * pext_helpers (/users/travis/build/pext/pext/pext/__main__.py, __main__) however, pext_base.py , pext_helpers.py in pext/helpers, defined in https://github.com/pext/pext/blob/30384647024ad3474d2c955d642ad6f7f745ffb5/setup.py#l54 . i've spent many, many hours trying figure 1 out. have tried following (and more): - stating packages again in py2app options dict - renaming pext/helpers pext.helpers in setup.py - passing command line --packages=pext,pext/helpers,pext_dev (which makes py2app complain there no package named pext) - using includes inste

sql - Sort by parameter to backend database -

how sorting logic specified in rest api handled backend database? supposing rest api request https://<<some api>>/?sortby=-id,name is there easier way of converting above rest api sortby parameter without having regex seperate string commas, , check if first character contains dash form below sql request? select * students order id asc, name desc comma delimited strings don't have split regex.. following c# it, example: string sort = request["sortby"]; if(sort != null){ foreach(string s in sort.split(',')){ string direction = "desc"; if(s[0] == '-') direction = "asc"; if(permittedcolumnslist.contains(s.replace("-", "")) sql = sql + s.replace("-", "") + " " + direction + ","; } sql = sql.remove(sql.length - 1); // drop last comma this still parsing , looking first dash though, seem not want. if prepared store permi

android - error RecyclerView: No adapter attached; skipping layout when running program -

i have tried answer @ stackoverflow relate problem. wanna show data firebase in imageview , textview. there's error recyclerview: no adapter attached; skipping layout. coding : menumanajemenkendaraanfragment.java public class menumanajemenkendaraanfragment extends fragment { private recyclerview recyclerview; private menumanajemenkendaraanadapter adapter; private databasereference mdatabase; //private progressdialog progressdialog; private list<datakendaraan> datakendaraan; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { getactivity().settitle("manajemen kendaraan"); view v = inflater.inflate(r.layout.fragment_menu_manajemen_kendaraan, container, false); floatingactionbutton fab_tambah_kendaraan = (floatingactionbutton) v.findviewbyid(r.id.fab); mdatabase = firebasedatabase.getinstance().getreference(); recyclerview = (recyclerview) v.findviewbyid(r.id.listviewkendaraan);

Internal Working of Fabric Composer -

i want know how fabric composer works internally transforming .bna file chaincode , how key-value pairs stored in couch db/state db given assets, participants , transactions. thanks see links here. composer architecture: https://www.slideshare.net/simonstone8/hyperledger-composer-architecture this architecture deep dive shows internal workings, in terms of runtime architecture -> https://www.slideshare.net/dselman/hyperleger-composer-architecure-deep-dive this article useful see side-by-side comparison: https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/#more-901 on key/value - see here -> what relationship between assets created in composer network assets in fabric chaincode? finally, note called hyperledger composer , no longer called fabric composer, fyi.

php - Passing customerID with a feedback table in codeigniter? -

i have 2 tables in database: customer feedback a 'foreign key' in feedback table customerid . want know customer gives feedback through id. please help. in advance. select customerid customer customerid in (select distinct customerid feedback); hope these query want.

java - Using Zebra's jpos sdk in Spring boot application -

the application returns error: jpos.jposexception: service not exist in loaded jcl registry i'm writing java application should work zebra bar code scanners. use jpos sdk . application written on spring boot in conjunction java fx. testing @ start, i'm trying list of connected devices: in main method, run java fx launcher. after that, in start java fx method, run spring. i'm trying list of devices: scanner scannerobj = new scanner(); string defaultlogicalname = "zebrascannerusb"; scannerobj.open(defaultlogicalname); after line, exception thrown. understand due fact program can not find jpos.xml. put in src/main/resources, , in src/main/resources/jpos/res, , in code wrote path external file: system.setproperty(jpospropertiesconst.jpos_populator_file_prop_name, "c:"+file.separator + "program files" + file.separator + "zebra technologies" + file.separator + "barcode scanners" + file.separator + "scann

how to upload offline clicked photos ,after restarting mobile in android firebase -

i facing issue uploading photos in firebase storage in particular scenario. example, have clicked 10 photos in offline mode , mobile goes switched off when switched on mobile again lost photo path using uploading photos on firebase, when mobile didn't switch off photo uploading working fine. i doing way https://www.simplifiedcoding.net/firebase-storage-tutorial-android/ you need maintain persistent storage (e.g. sqlite database) store pending operations takes longer time , depends upon many circumstances (e.g. network availability, whether activity killed etc). can maintain flag there upload status is, example, set "pending" when user clicked photo , changed "done" on upload success (or can erased) in onsuccesslistener. and each time when device starts, application starts or dependent circumstances changes back, upload status database need checked whether there pending work. using dedicated service whole process reliable. have of handling fi

java - I want to show 3 different fragments for 3 different tabs in view-pager ,Tabbed activity Android -

i new android , time created view-pager tabbed activity looking video tutorial. problem or need show 3 different fragments if user slides position tab1(shows first fragment),tab2 (shows second fragment) tab3 (shows third fragment) showing 1 , fragment tabs this adapter class named datafragment package com.example.jaison.news; public class datafragment extends fragment { view view; viewpager viewpager; tablayout tablayout; @nullable @override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) { view= inflater.inflate(r.layout.sample,container,false); viewpager = (viewpager) view.findviewbyid(r.id.viewpager); viewpager.setadapter(new slideradapter(getchildfragmentmanager())); tablayout = (tablayout) view.findviewbyid(r.id.sliding_tabs); tablayout.post(new runnable() { @override public void run() { tablayout.setupwithviewpager(viewpager); } });

Regex pattern throws ANR on Android -

i developing android application email validation, using regex, attached below: it works in conditions, conditions, gives me app not responding errors. for example, if put text specific length, no @ , gives me anr. if email length below range gives me proper validation error. regex looks like: public static final string email_pattern ="(?:[a-za-z0-9!#$%&'*+-/=?^_`{|}~.]*)+(\\w[a-za-z0-9!#$%&'*+-/=?^_`{|}~.]+)@(?:[a-za-z0-9-.]*)"; // here gives proper validation error fgefjkbgjerk.com gives anr sjkfghhrghergfhfgfghkfgkfgkjkgergejkgrjekfghfghfg.com public static boolean checkemailvalidations(string regex,string email){ boolean patternstatus=false; pattern pattern= pattern.compile(regex); matcher matcher = pattern.matcher(email); if( matcher.matches()){ patternstatus=false; }else{ patternstatus=true; } return patternstatus; } is there problem regex or implementation? i believe should

node.js - Beforeremote for all api calls loopback -

is possible write common beforeremote hook api calls in loopback. able write beforeremote hook api's in particular model through models object like: modelobj.beforeremote('*', function (ctx, req, next) { //code next() }); likewise possible write 1 before remote api calls. appreciated! thankyou! i got answer , posting here use in same situation. in boot script file, use following code: module.exports = function(app) { var remotes = app.remotes(); remotes.before('**', function (ctx, next) { //code execute before api calls goes here next(); }); }; thats it!!!!

printf - stm32f4 sprintf don't accepts parameters -

i have problem sprintf function in stm32f4 discovery board. use win 10 32bit , ac6 version 1.14.1.201707031232 code in new project , in standard libraries. #include "stdio.h" #include "stm32f4xx.h" #include "stm32f4_discovery.h" char s[200]; int i; int main(void) { systeminit(); = 0; sprintf(s, "text :"); sprintf(s, "text :%d", i); sprintf(s, "text :"); for(;;); } in debug , normal execution (in bigger project same instructions) program stops infinite in second sprintf . if sprintf function has no parameters executes normally. try increase heap , stack in linker script no solution. missing in syscalls.c module? thank in advance.

Set selected words as default content in Atom's "fuzyy finder" input field? -

when press ctrl+f , word selected before default content in input field. but when press ctrl+p/ctrl+t find files, input field empty no matter if selected word before or not. need select word->ctrl+c->ctrl+p->ctrl+v , it's bothers me. is there setting option or package can this?

r - Generate an interpolated string n times so I get n different answers -

i trying create dummy data list of options: library('stringr') #generate load of strings line <- list(x1 = 10, x2 = 30,x3="there no intestinal metaplasia, dysplasia or malignancy",x4="no helicobacter seen",x5="there ulceration",x6="there no intercellular oedema in surface epithelium",x7="passtaining shows occasional spores, consistent candida",x8="no herpetic viral inclusions seen",x9="there no dysplasia , no invasive carcinoma",x10="there mild regenerative epithelial change, neither dysplasia nor malignancy seen",x11="the appearances consistent endoscopic diagnosis of barrett's oesophagus active chronic inflammation",x12="the biopsies of oesophageal squamous mucosa show surface erosion , active chronic inflammation",x13="numerous candida spores , hyphae present admixed ulcer slough",x14="there reactive basal cell hyperplasia , mild inflammatory epithe

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -

Image
each grid cell can have more 1 customtemplate loaded. have directive holds watcher on model_col_field listen cell updates on scroll when dom rows updated , recompile celltemplate . without watcher , $compile rows repeat on scroll, showing same set of rows. is there more angular way of approaching or way improve performance? relevant controller code: create gridoptions.data & gridoptions.columndefs : var customtemp = '<div ng-repeat="opt in grid.appscope.colvalueoptionsmodel" ng-init="tempstring=model_col_field.clazz+opt.key;"><comparison-directive dbo="model_col_field" attobj="opt" fff="grid.appscope.getattributetemplate(tempstring)" /></div>'; $scope.gridoptions.columndefs = [ { name:'yindex',pinnedleft:true,celltemplate: customtemp, displayname:'index'}, { name:'col1',celltemplate: customtemp}, { name:'col2',celltemplate: c

java - Why does `ScalaObject` exist? -

why scala classes inherit scalaobject although trait empty , has no (visible?) functionality compared anyref , define additional methods? won't slow down method calls equals() or hashcode() because need take class consideration (which might override methods)? isn't possible fold anyref , scalaobject 1 class? update: scalaobject was eradicated new 2.10 version of scala. scalaobject inserts $tag method, which, according comment in library source code 2.7 , "is needed optimizing pattern matching expressions match on constructors of case classes." since name starts $ , should of course considered "hidden" application programmers. in scala 2.8, it's entirely empty, guess it's there backward compatibility.

matplotlib - How to move a graph in a stack plot with the mouse in python -

Image
problem i want move single graph in stack plot mouse , update plot instantly. values shouldn't change in plot (graphical), list values should updated, can print them in file. question is possible implement in python matplotlib or recommend me else? implementation need in python. matplotlib recommended me, if it's not possible package or there better 1 please leave comment. when have code example feel free share it. example the x-axis represent time (from today future) , y-axis anmount of resources. isn't possible move graph past (left) when value cut of != 0. can move graph future (right), nothing get's cut. example can't move "o" left, can move "r" , "y" (only 1 time) left. in example used lists 6 entries, imagine long enought. values: x-ax = [0, 1, 2, 3, 4, 5] y-ax = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] r = [0, 1, 2, 1, 1, 1] y = [0, 2, 1, 2, 1, 0] o = [5, 2, 1, 1, 1, 1] after moving y 1 right r = [0, 1, 2,