Posts

javascript - exceljs - Apply fill to cell range -

to apply fill particular cell exceljs doc helped me below code. worksheet.getcell('a1').fill = { type: 'pattern', pattern:'solid', fgcolor:{argb:'ff0'} }; but apply fill range of cells there no documentation , can't find google search. wiki

Embedding fonts in Editable PDF -

i have produced pdf document latex (a survey), used foxit phantompdf make pdf editable (so can send via mail). used 'form': 'text fiel'; , choose particular font in properties. sent file friend , completed survey, font saw different mine. can sees font want? (the font choose embeddable, , tried convert pdf ps , adobe distiller 7.0 convert pdf embedding font. these 2 sistems didn't work) phantompdf doesn't embed fonts use in form filling... @ least not correctly... , none i've ever tried. use adobe acrobat dc add fields. when select font can be embedded, will be embedded recipients of form able edit fields using same font specified. of course, need use pdf viewer capable of using embedded font specified. many... most... won't... adobe reader does. wiki

java - How to search for findElementBy.id in selenium webdriver -

i'm starting selenium webdriver. trying make simple example , button next on web: www.lot.com/pl/en. webdriver driver = new firefoxdriver(); string web = "https://www.lot.com/pl/en/"; driver.get(web); try{ driver.findelement(by.id("submit-booker") ); system.out.println("found"); }catch (exception e){ system.out.println("not found"); e.printstacktrace(); } but i'm not able work fine , gives me following error: org.openqa.selenium.nosuchelementexception: unable locate element: #submit-booker what doing wrong? how can fix it? as trying click() on next button have span tag can consider construct unique xpath follows: driver.findelement(by.xpath("//button[@id='submit-booker']/span") ); wiki

java - How to handle with Httpurlconnection exception in android -

i have trouble httpurlconnection exception. when app can't connect server i'm getting error "unfortunately, myapp has stopped". set timeout , after time elapsed doesn't work properly. here connection class code called in async task class in doinbackground method. public class httpurlreq { httpurlconnection conn; url url = null; inputstream inputstream; bufferedoutputstream os; public static final int connection_timeout = 15000; public static final int read_timeout = 10000; public string connhttp(jsonobject jsonuserdata, string dburl) { if(jsonuserdata != null) { try { url = new url(dburl); } catch (malformedurlexception e) { e.printstacktrace(); log.d(tag, "httpurl [url]" ); } //establishing connection try { conn = (httpurlconnection) url.openconnection(); conn.setreadtimeout(read_timeout); conn.setconnecttimeout(connection_ti...

list - Dictionary python -

1st text file format . cake,60 cake,30 tart,50 bread,89 2nd text file format . cake,10 cake,10 tart,10 bread,10 code have tried. from collections import defaultdict answer = defaultdict(int) recordnum = int(input("which txt files want read ")) count = 1 counter = 0 counst = 1 countesr = 0 while recordnum > counter: open('txt'+str(count)+'.txt', 'r') f: line in f: k, v = line.strip().split(',') answer[k.strip()] += int(v.strip()) count = count+1 counter = counter+1 print(answer) the problem. i want dictionary {'cake': '110', 'tart': '60', 'bread': '99'} prints {'cake': '30', 'tart': '50', 'bread': '89'} instead of "cake" value adding other cake values txt file 1 , 2 gets replaced latest value. how solve issue. tried make if write 3, open , add 3 txt files, named, txt1....

python - how to change matplotlibrc default directory -

i'm using anaconda , python 3.6 on windows bash. every time want use matplotlib have paste copy of matplotlibrc file working directory otherwise code won't run or plot , warning - /home/computer/anaconda3/lib/python3.6/site-packages/matplotlib/ init .py:1022: userwarning: not find rc file;returning defaults my matplotlibrc file located @ c:\users\user\appdata\local\lxss\home\puter\anaconda3\lib\python3.6\site-packages\matplotlib\mpl-data i thought fix edit .condarc file , set matplotlibrc in correct directory. tell me how this? it looks when anaconda or matplotlib installed it's created matplotlibrc file in c:\users\user\appdata\local\lxss\home\puter\anaconda3\lib\py‌​thon3.6\site-package‌​s\matplotlib\mpl-dat‌​a using windows environment. has caused file not recognised in wsl. to fix create matplotlibrc file in bash or whatever shell you're using. in directory listed above copy contents of created matplotlibrc file new matplotlibrc file. make sure do...

Mongodb aggregation quesry for message unread count group by group_id -

here problem : in mongodb database, have collection messages : { 'id': 1, 'message': 'message 1', 'groups': [1], 'readby': ['cust1','cust2'], 'status': '1' } { 'id': 2, 'message': 'message 2', 'groups': [1], 'readby': ['cust2'], 'status': '1' } { 'id': 3, 'message': 'message 3', 'groups': [2], 'readby': ['cust2','cust1'], 'status': '1' } { 'id': 4, 'message': 'message 4', 'groups': [2], 'readby': ['cust2'], 'status': '1' } { 'id': 5, 'message': 'message 5', 'groups': [2], 'readby': ['cust2'], 'status': '1' } i have collection customer, in have maintained groups ids. 'cust1' part of group id...