Posts

ios - Assigning a value out of array of arrays, using section in Xcode -

this code: let servicebonnen = [[1,2,3],[4,5,6],[7,8,9]] //not real data func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("namecell", forindexpath: indexpath) cell.textlabel!.text = servicebonnen[section][indexpath.row] return cell } but gives me error @ "section" point in line of code: cell.textlabel!.text = servicebonnen[section][indexpath.row] does know why won't compile, , proper solution? you need use section indexpath : indexpath.section your line should this: cell.textlabel!.text = servicebonnen[indexpath.section][indexpath.row]

xamarin.ios - Xamarin(PCL) - Signal R - System.InvalidOperationExceptionConnection started reconnecting before invocation result was received -

i getting system.invalidoperationexceptionconnection started reconnecting before invocation result received exception signal r chat, using signal r client in pcl of xamarin project here chat service class- public class chatservice : ichatservice { private ihubproxy _hubproxy; private hubconnection _hubconnection; private readonly imobileserviceclient _mobileclient; private readonly iinsightsservice _insightsservice; private readonly ichatmessagerepository _chatrepository; public chatservice(imobileserviceclient mobileclient, iinsightsservice insightsservice, ichatmessagerepository chatrepository) { _insightsservice = insightsservice; _mobileclient = mobileclient; _chatrepository = chatrepository; } public event eventhandler<chatmessage> messagereceived; public async task connect(bool dismisscurrentconnection = false) { try { if (!crossconnectivity.current.isconnected) ...

r - XTS-File doesnt work for quantstrat -

i have created xts file out of csv file looks this: open high low close volume adjusted 2016-01-04 14:30:36 "4896,3818" "4896,4272" "4895,2363" "4895,8789" " 0" "0" 2016-01-04 14:31:56 "4892,3579" "4894,0259" "4891,752" "4894,0259" " 0" "0" 2016-01-04 14:32:57 "4894,1753" "4899,2466" "4894,1753" "4898,8589" " 0" "0" 2016-01-04 14:33:59 "4899,2227" "4899,2227" "4894,8281" "4896,5469" " 0" "0" 2016-01-04 14:34:59 "4896,2915" "4896,418" "4892,3838" "4893,4326" " 0" "0" 2016-01-04 14:35:59 "4893,1196" "4896,3301" "4893,1196" "4895,434...

javascript - How equal two objects and return this value to ng-show -

i have 2 objects (dates) {{vm.currentdate|date:'mediumdate'}} , {{vm.anotherdate|date:'mediumdate'}} how equal (if same) , value operation sent directive in button <button type="submit" ng-show="value_from_operation"></button> you check if equal this: +currentdate === +anotherdate

javascript - Website analyzer -

i'm having problem, page search products, has getting worse last time. wants display me products can delivered country - still want see of them. have check domins product manually (.com .ca .co.uk etc etc). want build small tool me. i have tried php way: $html=file_get_contents('https://www.ebay.com/sch/i.html?_ipg=200&_from=r40&_sacat=0&_nkw=book&_sop=10'); $dom = new domdocument(); @$dom->loadhtml(mb_convert_encoding($html,"utf8",mb_detect_encoding($html))); $x = new domxpath($dom); foreach($x->query("//li") $node){ $ignore=0; $itemid= $node->getattribute("listingid"); if($itemid >0){ //if (in_array($itemid,$itemsindb)){ echo "itemid=".$itemid."//////text: "; echo $node->nodevalue; echo "<br>"; } but problem is, nodevalue seems missing html tags, since ouput looks this: itemid=322582462268//////text: new listing wind in willows, grahame arthur ra...

vba - Invoicing in Word document -

i'm trying write vba script multiply figures exist in table in ms word. so far i've managed below value of b appears £11,000 in document , when message out returns 0. i'd value of b 11000 can multiply, ideas or written code great. private sub calculate_click() dim t1 table dim double dim m, b currency ' first table set t1 = activedocument.tables(1) = val(t1.cell(5, 3).range.text) = a/100 b = val(t1.cell(7, 4).range.text) 'b = ccur(t1.cell(7, 4).range.text) **i tried didn't work msgbox b m = * b t1.cell(5, 4).range.text = format(m, "currency") end sub your code perfect - until tried put icing on cake. :-) dim double, b double because don't want multiply apples oranges. m = * b gives correct result, converted currency divides 100. perhaps done in line, t1.cell(5, 4).range.text = format(m, "currency") . don't know. suggest declare m double , format result forma...

mesos - configure: error: cannot find libz -

building mesos 1.3.0 sources on linux-mint release 18.2 following message: configure: error: cannot find libz when try search packages starts libz* many packages names starting libz. 1 right package should install it? try installing zlib1g-dev . it's listed in the documentation linux mint 18.2 based on ubuntu 16.04. so, should follow instructions ubuntu 16.04. # update packages. $ sudo apt-get update # install few utility tools. $ sudo apt-get install -y tar wget git # install latest openjdk. $ sudo apt-get install -y openjdk-8-jdk # install autotools (only necessary if building git repository). $ sudo apt-get install -y autoconf libtool # install other mesos dependencies. $ sudo apt-get -y install build-essential python-dev python-six python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev

c++ - Undefined reference with a correctly linked library -

i'm having weird problem mbedtls security library. i've downloaded newest version of ( link download .tar.gz ) on ubuntu machine, compiled , copied header files /usr/include , shared library files /usr/lib . when i'm compiling c++ program calls function mbedtls_cipher_cmac_starts mbedtls/cmac.h, undefined reference error security.cpp:599: undefined reference 'mbedtls_cipher_cmac_starts' . however, have included , linked libraries correctly (at least think so, not ordering problem, right?). problem seems in mbedtls library itself, when nm -d libmbedcrypto.so , can't find needed function. checked libmbedtls.so no luck there. 0000000000020206 t mbedtls_cipher_auth_decrypt 0000000000020128 t mbedtls_cipher_auth_encrypt 000000000001ff17 t mbedtls_cipher_check_tag 0000000000020022 t mbedtls_cipher_crypt 0000000000264960 d mbedtls_cipher_definitions 000000000001fb49 t mbedtls_cipher_finish although seems in library makefile when compiling library. also, wei...

java - Why it is showing "String literal is not properly closed by a double-quote"? -

the line @ message.setcontent() trying put html code string argument showing error "string literal not closed double-quote". please me find out why showing that. try { // create default mimemessage object. mimemessage message = new mimemessage(mailsession); mimebodypart htmlpart = new mimebodypart(); %> <% message.setfrom(new internetaddress(from)); message.addrecipient(message.recipienttype.to, new internetaddress(to)); message.setsubject("thank using our service"); message.setcontent("<table><tr><td>full name</td><td><%= name %></td></tr><tr><td>address</td><td><%= addr %></td></tr><tr><td>age</td><td><%= age %></td></tr><tr><td>qualification</td><td><%= qual %></td></tr><tr><td...

How to install Android SDK only? -

Image
i have been installing android sdk in last couple of years without android studio, need same on new pc , there's no more .exe file zip file makes things complicated. before able access sdk manager after installing exe file, how can install zip file? as written in documentation. "if not need android studio, can download basic android command line tools below. you can use included sdkmanager download other sdk packages ." when download , extract zip file, inside bin folder find sdkmanager run download different versions of sdk , other tools.

xml parsing - Not able to parse XML in C# with default namespace -

i not able parse xml document default namespace. if remove namespace xmlns="http://java.sun.com/xml/ns/j2ee xml file, able values in nodelist. don't want use linq. xml: <?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>test - tomcat webapp</display-name> </web-app> c# code: string strfileusers = @"e:\\dot_net\\xml_parser\\demo\\web_org.xml"; xmldocument docusers = new xmldocument(); try { docusers.load(strfileusers); } catch (exception) { messagebox.show("cannot open file "); return; } try { xmlnodelist nodelist = docusers.selectnodes("//display-name"); console.writeline(nodelist...

Python reload, and IPython autoreload as well, is not working -

i using python + ipython data science. made folder contains modules wrote, organised in packages, like python_workfolder | |---a | |---__init__.py | |---a1.py | |---a2.py | |---b | |---__init__.py | |---b1.py | |---b2.py | |---c | |---__init__.py | |---c1.py | |---c2.py | | |---script1.py |---script2.py at beginning of each session ask ipython autoreload modules: %load_ext autoreload %autoreload 2 now... let's a1.py contains class, a1 , want call 1 of scripts. in __init__.p of package a import module import a1 then in script import class need from a.a1 import a1 if there error in class a1 , modify it, there no way have python reload without restarting kernel. i tried del a1 , del sys.modules['a1'] , del sys.modules['a'] . each time uses old version of class until don't restart kernel... can give me suggestions? this funny. seems problem not due ipython pyzo (the ide i'm using). added testclass a1: class te...

rdl - Change sorting in report services -

Image
i have report populated stored procedure. want change sorted column other 1 sorted in stored procedure. dont want change stored procedure. clicked on "tablix properties" -> "sorting" , added column want sort grid by. didn't worked. suggestions? check row group sorting property see if there sorting field or expression. in case exists, overrides sorting of tablix property. to check row group property, right click row group , menu choose row group --> group properties. group properties windows, choose sorting option

c# - Failing validation of Anti Forgery Token in Asp.net webform application -

i working on asp.net webforms application. trying implement anti forgery token functionality in application. i have test case application called script in different file (csrf issue) using xhr. solution have implemented works until change value of viewstate in script. following whole scenario. look @ "\r\n" blah blah blah... ; in below script. external script (csrf attack script): var xhr = new xmlhttprequest(); xhr.open("post", "myappdomain", true); xhr.setrequestheader("accept", "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8"); xhr.setrequestheader("accept-language", "en-us,en;q=0.5"); xhr.setrequestheader("content-type", "multipart\/form-data; boundary=---------------------------12421522427704"); xhr.withcredentials = true; var body = "-----------------------------12421522427704\r\n" + "content-disposition: f...

java - What does a "Cannot find symbol" compilation error mean? -

please explain following "cannot find symbol" error: what error mean? what things can cause error? how programmer go fixing error? this question designed comprehensive question "cannot find symbol" compilation errors in java. 1. "cannot find symbol" error mean? firstly, compilation error 1 . means either there problem in java source code, or there problem in way compiling it. your java source code consists of following things: keywords: true , false , class , while , , on. literals: 42 , 'x' , "hi mum!" . operators , other non-alphanumeric tokens: + , = , { , , on. identifiers: reader , i , tostring , processequibalancedelephants , , on. comments , whitespace. a "cannot find symbol" error identifiers. when code compiled, compiler needs work out each , every identifier in code means. a "cannot find symbol" error means compiler cannot this. code appears referring compiler does...

swift - Which one is best in "self.view.window?.addSubview()" or "UIApplication.shared.keyWindow?.addSubview()" in iOS -

i need display loaderview in top of viewcontroller let loaderview: uiview() self.view.window?.addsubview(loaderview) other type: let loaderview: uiview() uiapplication.shared.keywindow?.addsubview(loaderview) both line working fine, code best adding subview... in advance.... well if adding view (not loader view) in view controller on appdelegate window it's better go with uiapplication.shared.keywindow?.addsubview(loaderview) otherwise self.view.window?.addsubview(loaderview) is fine.

laravel - Polymorphic nested eager loading with constraints -

i have classes: students-----{id,profile_id,year} profiles-----{id} subjects-----{id}-is learnable groupssbj-----{id}-is learnable learnables----{profile_id,learnable_id,learnable_type,year} groupssbj_subject--{subject_id,groupsbj_id} i want load student id 5, , it's profile, , learnables of profile learnables.year=student.year go lazy loading $student = student::find(5); $student->load(['profile.subjects'=>function($query) use($student){ $query->wherepivot('year','=',$student->year); }],['profile.groupssbj'=>function($query) use($student){ $query->wherepivot('year','=',$student->year); }],'profile.groupssbj.subjects'); if call $student.profile.subjects subjects constrains, groups $student.profile.groupssbj not constrained, , if separate in 2 loads $student = student::find(5); $stude...

angular - Ionic2: Send Submit form data to service -

i using ionic2, want send data form web service using post request, every time print form data found empty , service send me not received data. html code: <div class="login-box"> <form #registerform="ngform"> <ion-row> <ion-col id="imagecontainer"> <button (click)="upload()" ion-button>take pic & upload </button> </ion-col> </ion-row> <ion-row> <ion-col> <ion-list inset> <ion-item> <ion-label floating>{{ 'username' | translate }}</ion-label> <ion-input type="text" name="username" #username required></ion-input> </ion-item> <ion-item> <ion-label floating>{{ 'mobilen...

Python Kivy: How to add multiple widgets in a loop -

i relativly new python , totaly new kivy strugling solve simple task. need main screen 2 buttons: button1 , button2. when press button, second screen should appear showing again number of buttons. numbers of buttons on second screen dynamic can assume simplicity know it. python code: from kivy.app import app kivy.uix.boxlayout import boxlayout buttons = {} buttons['button 1'] = ('a button 1', 'a button 2') buttons['button 2'] = ('b button 1', 'b button 2', 'b button 3') class selectbutton(boxlayout): def show_buttons(self, button): self.clear_widgets() # guess need #here question comes: how add button widgets buttons[button]? #shall in loop in python code or in .kv file? #for item in buttons[button]: # print (item) class testapp(app): pass if __name__ == '__main__': testapp().run() .kv file: selectbutton: <selectbutton>: orientation: ...

How to append array element with increasing the array count with key in PHP? -

i've array $a $a[1] = "a"; $a[2] = "b"; $a[3] = "c"; $a[4] = "d"; let's say, "x" new value want append middle position in array , want add 2nd array position $a[2] want increase count keys of array become like: $a[1] = "a"; $a[2] = "x"; $a[3] = "b"; $a[4] = "c"; $a[5] = "d"; in case, want implement within loop checking conditions if, tried slice , splice both not working do below:- <?php $a = array( 1=>'a', 2=>'b', 3=>'c', 4=>'d' ); $b = array( 'x' ); array_splice( $a, 1, 0, $b ); $a = array_combine(range(1, count($a)), array_values($a)); print_r($a); output:- https://eval.in/837366