Posts

pyqt - python match files from two different list -

i learning python , programing in general , need assistance. i wrote python script reads 1 file, unique values, opens second file , and uses unique values makes calculation(script long upload) created gui using pyqt4 allowed user browse clicking qpushbutton , stored file path in qlineedit set file in script f1 = self.lineedit.text() , f2 = self.lineedit2.text worked however, need allow user select multiple files , match every file 1 corresponding file 2 since dependent on each other here updates made widget functions accept multiple files: def first_file_set(self): dlg = qfiledialog() files = dlg.getopenfilenames() self.listwidget.additems(list(files)) def second_file_set(self): dlg = qfiledialog() filenames = dlg.getopenfilenames() self.listwidget_2.additems(list(filenames)) def clearf(self): item in self.listwidget2.selecteditems(): self.listwidget.clear() def clears(self): item in self.listwidget.selecteditems(): ...

html - ckeditor not showing in JavaScript insertRow() table -

this javascript function insertrow() in table: <script> function myfunction() { var table = document.getelementbyid("mytable"); var row = table.insertrow(0); var cell1 = row.insertcell(0); var cell2 = row.insertcell(1); var cell3 = row.insertcell(2); var cell4 = row.insertcell(3); cell1.innerhtml = '{{ form::text('title_detail[]', '', array('class' => 'form-control','placeholder' => 'detail title','required' => 'required')) }}'; cell2.innerhtml = '{{ form::textarea('description_detail[]', '', array('class' => 'form-control ckeditor','placeholder' => 'detail deskripsi','required' => 'required')) }}'; cell3.innerhtml = '{{ form::number('sort_order_detail[]', '', array('class' => 'form-control','placeholder' => ...

javascript - What do querySelectorAll, getElementsByClassName and other getElementsBy* methods return? -

do getelementsbyclassname (and similar functions getelementsbytagname , queryselectorall ) work same getelementbyid or return array of elements? the reason ask because trying change style of elements using getelementsbyclassname . see below. //doesn't work document.getelementsbyclassname('myelement').style.size = '100px'; //works document.getelementbyid('myidelement').style.size = '100px'; your getelementbyid() code works since ids have unique , function returns 1 element (or null if none found). however, getelementsbyclassname() , queryselectorall() , , other getelementsby* methods return array-like collection of elements. iterate on real array: var elems = document.getelementsbyclassname('myelement'); for(var = 0; < elems.length; i++) { elems[i].style.size = '100px'; } if prefer shorter, consider using jquery : $('.myelement').css('size', '100px');

Python utility fails to successfully run a non-Python script that uses relative paths -

my python3 utility has function doesn't work (unless it's placed within selected directories, can run non-python pdflatex scripts successfully). want run utility set location on of template.tex files have, stored in various other locations. the python utility prompts user select pdflatex template file absolute path using tkinter.filedialog gui, runs user's selected pdflatex script using, example: os.system("pdflatex /afullpath/a/b/c/mytemplate.tex") python's os.system runs pdflatex , runs mytemplate.tex script. mytemplate.tex has numerous inputs written relative paths ./d/another.tex . so, python utility works fine long it's in exact same path /afullpath/a/b/c/mytemplate.tex user selects. otherwise pdflatex can't finds own input files. pdflatex delivers error message like: ! latex error: file ./d/another.tex not found because execution path relative python script , not pdflatex script. [ pdflatex needs use relative paths be...

openssl - How to extract public key from certificate in Mac? -

i given certificate , tried extract public key out of it. my certificate like -----begin certificate----- snfmfgfdgiig .... -----end certificate----- and saved test.cer . i have looked online , tried extract public key. i tried: openssl x509 -inform pem -in test.cer -pubkey -noout > publickey.pem but getting unable load certificate 56091:error:0906d06c:pem routines:pem_read_bio:no start line:/buildroot/library/caches/com.apple.xbs/sources/openssl098/openssl098-59.60.1/src/crypto/pem/pem_lib.c:648:expecting: trusted certificate i not familiar process , hoping here can me out. much!

c# - Discord Add Guild Member 401 Error Despite Apparently Valid Acces Token -

i new discord's api, , working project needs able add guild member programmatically. i've learned how authorization code (with identify , guilds.join scopes), redeem access token, , user's id. last step use access code , user id add guild. command detailed here: https://discordapp.com/developers/docs/resources/guild#add-guild-member it seems need send put request url: https://discordapp.com/api/guilds/[guildid]/members/[userid] but results in response: {"code": 0, "message": "401: unauthorized"} i have tried including access token in authorization header: authorization: bearer [redacted] i've tried adding json body request: {"access_token":"[redacted]"} neither has worked. unsurprisingly, using both @ same time hasn't worked either. i wondered if permissions issue, discord confirms have guilds.join scope. json receive when exchanging authorization code access token: {...

c# - Passing List of Data to Other Controller -

so have action method in controller data csv file uploaded through web i want pass data insert controller data csv automatically inserted tables in db , pass view i'm using csv helper, mvc public actionresult importcsv(httppostedfilebase file, int compid) { var compname = db.couriercompanies.find(compid); string path = null; list<myviewmodel> csvd = new list<myviewmodel>(); try { if(file.contentlength > 0) { var filename = path.getfilename(file.filename); path = appdomain.currentdomain.basedirectory + "upload\\" + filename; file.saveas(path); var csv = new csvreader(new streamreader(path)); var invocsv = csv.getrecords<importcsv>(); foreach(var in invocsv) { myviewmodel...