Posts

Showing posts from June, 2011

ios - Swift Network call with php Api endPoint -

can me following issue? i not able retrieve value id . the " id " alway empty when post ios network call. swift 3 network call : var request = urlrequest(url: url(string: "url here")!) request.httpmethod = "post" let poststring = "id=2" request.httpbody = poststring.data(using: .utf8) let task = urlsession.shared.datatask(with: request) { data, response, error in guard let data = data, error == nil else { // check fundamental networking error print("error=\(error)") return } if let httpstatus = response as? httpurlresponse, httpstatus.statuscode != 200 { // check http errors print("statuscode should 200, \(httpstatus.statuscode)") print("response = \(response)") } let responsestring = string(

Crystal Reports 2013 14.1 - How to suppress Group Header? -

Image
i have group header 2a & 2b 2a has empty text box cause line break, don't want render section whenever occurs first record on each page. able suppress on first page: supress -> pagenumber = 1, appears on other pages on top. please how stop this. i used variable. inside suppress function group, have: whileprintingrecords; shared numbervar isprintedonthispage; (isprintedonthispage = 0) ; then have function named gf2_printedonthispage code: whileprintingrecords; shared numbervar isprintedonthispage:=1; and in group footer both sections , b, have formula field inserted , it's suppressed, nothing prints. also have formula named ph_printed containing: whileprintingrecords; shared numbervar isprintedonthispage:=0; // reset page and copy of value in pageheader section, suppressed doesn't show/print.

java - How to get ArrayList<String> image URLs into ImageView of ListView getView method -

@override public view getview(int position, view convertview, viewgroup parent) { if(convertview == null){ convertview = inflater.inflate(resource, null); } imageview imageview; imageview = (imageview) convertview.findviewbyid(r.id.ivgallery); for(hospitalmodel.images images: hospitalmodellist.get(position).getimageslist()) { glide.with(getcontext()).load(images).into(imageview); } return convertview; } // image urls stored in string arraylist . defined getter , setter array list still don't know how use method showing arraylist images dynamically in listview extend class baseadapter override getcount() method , return here total amount of images need show. in getview load glide 1 url (remove loop), getview method called n times show in list "total" amount of images returned in getcount method, position parameter in getview method run 0 (total - 1). you should map 1 position 1 url, maybe need change way

c# - Could not find a part of the path 'C:\destPath\FileName.ext' when copying directories -

so, have logic looks following: private static void copytodestdirectory(string destdirectory, string srcdirectory) { if (!directory.exists(destdirectory)) { directory.createdirectory(destdirectory); } foreach (var file in directory.getfiles(srcdirectory)) { var filename = path.getfilename(file); var destpath = path.combine(destdirectory, filename); file.copy(file, destpath, true); } ... } usually works, every once in while not. times not work, have log file resembles following: 2016-12-22 15:49:21,670 [11] error: system.io.directorynotfoundexception: not find part of path 'c:\destpath\filename.ext'. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.file.internalcopy(string sourcefilename, string destfilename, boolean overwrite, boolean checkhost) @ system.io.file.copy(string sourcefilename, string destfilename, boolean overwrite) @ namespace.class.copytodestdirect

c++ - Why we are using static_cast to NULL -

when try study qp/cpp code came across below line. qtimeevt *t; // ... if (t == static_cast<qtimeevt *>(0)) { why doing static_cast of 0? if want check null can directly right? this source code can find out in http://www.state-machine.com/qpcpp/qf__time_8cpp_source.html yeah, that's unnecessary, though may mandated style guide "clarity", or may there silence overzealous static analysis tool. of course, nowadays, we'd write nullptr , leave @ that.

javascript - Static HTML or generate Dynamic HTML | performance -

Image
i want know method faster/better , why. i have web app. has lot of html tags like: <div id="info-view"> <h3 class="h3-title">info</h3> <div class="card"> <h4>version</h4> <div class="version"> <p class="list-item">app version: <span id="app-vr"></span> ...so on </div> </div> </div> <div id="import-view"> <h3 class="h3-title">import</h3> <div class="card"> <h4>import list</h4> <div id="import-container"> <div class="import-data"> <p class="import-name">data bla blabla</p> </div> <div class="import-data"> ... </div> ... </div> </div> </div> <!-- , lot

rest - What can go wrong if we do NOT follow RESTful best practices? -

tl;dr : scroll down last paragraph. there lot of talk best practices when defining restful apis: http methods support, http method use in each case, http status code return, when pass parameters in query string vs. in path vs. in content body vs. in headers, how versioning, result set limiting, pagination, etc. if determined make use of best practices, there lots of questions , answers out there best practice doing given thing. unfortunately, there appears no question (nor answer) why use best practices in first place. most of best practice guidelines direct developers follow principle of least surprise, which, under normal circumstances, enough reason follow them. unfortunately, rest-over-http capricious standard, best practices of impossible implement without becoming intimately involved it, , drawback of intimate involvement tend end application being tightly bound particular transport mechanism. so, people (like me) debating whether benefit of "least surprise"

osx - How to show a Default view or simply a white screen when the NSPageController arrangedObjects count goes from one to zero? -

mac app using xcode:7.3 on sierra 10.12.2 i have panel tabview has tab enables adding , deleting photos. there nspagecontroller in book mode allows navigation of photos. arrangedobjects of nspagecontroller contained in mutable array supports addition , deletion of photos. pagecontroller.view nsbox. _editrecipecontroller.pagecontroller.arrangedobjects = _mutphotoimagearray; i writing ask how should handle removal of last remaining photo. if mutable array has more 1 photo, when click on delete button, photo removed _mutphotoimagearray, , code navigates 1 of remaining photos in pagecontroller. when delete final photo, want last photo disappear , header "no photos found" what happens following click on delete button when 1 photo in pagecontroller, photo not disappear, forced display rather kludgy message, "press done button delete final photo." how make pagecontroller display blank screen? when want display no images, set arrangedobjects [&qu

How to download multiple files as zip in vb.net. Lost my extension while downloading in firefox -

i downloading multiple files zip file in vb.net. of browsers doesn't add zip file. my code is: if not ispostback if not session("x") = nothing dim x string = session("x").tostring dim path() string path = x.split("|"c) using zip new zipfile() zip.alternateencoding = encoding.utf8 zip.alternateencodingusage = zipoption.asnecessary = 0 ubound(path) if len(path(i)) > 0 dim filepath string = trim(path(i)) zip.addfile(filepath) end if next response.clear() response.bufferoutput = false dim zipname string = [string].format _ ("datas_{0}.zip", datetime.now.tostring("dd-mmm-yyyy")) response.contenttype = "application /zip"

Is there a way to set ssh options when using docker-machine on Windows? -

i behind firewall, need use proxy when connection outside. when use docker-machine create machine on aws. stop @ ssh step. after open debug mode, got following using ssh client type: external &{[-f /dev/null -o passwordauthentication=no -o stricthostkeychecking=no -o userknownhostsfile=/dev/null -o loglevel=quiet -o connectionattempts=3 -o connecttimeout=10 -o controlmaster=no -o controlpath=none ubuntu@ip -o identitiesonly=yes -i c:\users\frank\.docker\machine\machines\aws03\id_rsa -p 22] c:\frank\msys64\usr\bin\ssh.exe <nil>} run ssh command: exit 0 i tried set proxy in ~/.ssh/config proxycommand=/mingw64/bin/connect.exe -h , doesn't work.

installation - How to run custom actions while running the MSI installer in silent mode -

Image
i've created msi installer using installshield 2014. while running ui works fine when run in silent mode using below command custom actions not firing @ all: c:\>msiexec /i "myapplication.msi" /qn weburl=http://localhost/mywebapp /log out.txt weburl property required custom action. value of weburl passed c# class library method argument. c# method called custom action gets called when click on install button on begin installation wizard step. custom action gets executed i.e. i've kept condition execution of custom action 1 means executes under circumstances. in log file see value of weburl property getting correctly set. i'm not able stopping custom action fire while running installer in silent mode? update : suggested michael, after putting custom action in installexecutesequence starts getting executed in silent mode. problem starts getting executed twice in ui mode same action getting executed through button click on 1 of dialogs appears du

css - Table from Microsoft access to html -

i have table , want add (the 1 inside black squear) future web, manage table, entire code <!documentype html> <html> <head> <meta charset="utf-8"> <title>asuntos pendientes</title> <link rel="stylesheet" type="text/css" href="index_style.css"> </head> <body> <div class="main-body"> <div class="body-data"> <div class="tabla"> <table> <tr> <th>id</th> <th>fecha</th> <th>servicio</th> <th>asunto</th> <th>fecha controlar</th> <th>fecha de resolucion</th> </tr> <tr> <td></td> <td></td> <td></td> <td>&l

r - Selecting and filtering on the same variables in dplyr -

let's have matrix 3 columns , 100 rows. let column names a_dem , b_dem , c_blah . , let's imagine each cell can have value between 0 , 100. is there way use select() , filter() , %>% select observations end "_dem" , have value larger than, say, 50? i would've kinda imagined along these lines: dat %>% select(ends_with("dem")) %>% filter(>50) %>% summary() but doesn't work, obviously. so, there way kind of selection , filtering, or have resort more complicated? you this: library(dplyr) set.seed(2) a_dem <- runif(100,0,100) b_dem <- runif(100,0,100) c_blah <- runif(100,0,100) dat <- data.frame(a_dem, b_dem, c_blah) newdat1 <- dat %>% select(ends_with("_dem")) filtered <- sapply(newdat1, function(x) ifelse(x>50, x, na)) >head(filtered) a_dem b_dem [1,] na na [2,] 70.23740 na [3,] 57.33263 98.06000 [4,] na 82.8

How do I set current-directory in Vim to different Volumes, ex. USB drive, in macOS? -

i still new(er) user vim. switch between systems , rely on usb drive assist me. in linux can set default programs vim, can't in mac. the solution i've found :set path+=** as cross-platform utility w/ :find to me files opened in vim. however, since current-directory set current user, have difficulty using full potential. i have tried "cd" in ~/.vimrc w/ various following scripts $ cd ~/volume/volumes/usb $ cd ~/volumes/usb , etc., no luck. i'm still trying vim in vanilla thru "~/.vimrc" file , not looking plugins or gui-interface. there "cd" can place in macos , linux "~/.vimrc" files set secondary-drive current-directory? (apologies if answered, not find anywhere.) the volumes directory not in $home . it's in / have use right path: cd /volumes/usb this scheme specific mac os x, though: if want same behavior on linux have find out how distribution/de it. anyway, should consider using vim , c

ios - How to pause the application till the json data is downloaded using Alamofire? -

i trying build app using alamofire make request 3 rd party api. 1 of text fields needs show value response. i have function takes response json , returns value needs shown in textfield. how can delay textfield function, until value response. and can show progress bar or activity monitor while data being downloaded make sure user not think app doing nothing ?(during api being called , function being executed) you have number of options: use activity indicator suggested in comments question. use completion handler call func gettextfielddata(url: string, completion:(string) -> void){ alamofire.request(.post, " http://someurl.com/gettextfielddata ", parameters: ["queryvalue": username,], encoding:.json).responsejson { request, response, result in switch result { case .success(let json): let fieldvalue = string(data: json.datausingencoding(nsu

php - Testing File Updates and Improvements without showing to users -

i'm pretty new web development , build websites using apache server, wondering how prototype changes. example, i'm working on improving php file being displayed on site. how can test whether changes i'm implementing work when updated file put on server without disrupting users site if there error in new code? you should have local copy of site on machine can test codes, if works, add live website, simple!

python - ValueError: could not broadcast input array from shape (80,269,269) into shape (80,269,234) -

datai of shape (80,336,336) z= np.zeros([80,800,800], dtype= datai.dtype) v=np.zeros_like(z) centres = [(100,200),(400,100), (600,300), (500,400), (600,500)] zooms = [[1,1,1], [1,0.6,0.6], [1,0.7,0.7], [1,0.8,0.8], [1,0.9,0.9]] cent,zoom in zip(centres,zooms): dataz = scipy.ndimage.zoom(datai, zoom, order=3) dimz = dataz.shape off = [max(c-s//2,0) c,s in zip(cent,dimz)] z[0:dataz.shape[0],off[0]:off[0]+dimz[1],off[1]:off[1]+dimz[2]]=dataz i need place scaled data in big array z . giving center positions, need place data (if overlaps, take average of values) but following error: traceback (most recent call last): file "<stdin>", line 1, in <module> z[0:dataz.shape[0],off[0]:off[0]+dimz[1],off[1]:off[1]+dimz[2]]=dataz valueerror: not broadcast input array shape (80,269,269) shape (80,269,234) how solve error? the problem slicing can go beyond array extend, in case elements in extend of array returned: >>>

python - how part queryset in Temokate -

got code on python 2.7 user django how can parse dishs_list in template? userorder = userorder.objects.filter(user_id=self.request.user.id, is_closed=0) dishs = userorderitem.objects.filter(order_id=userorder[0].id).values('dish_id') \ .annotate(count=count('dish_id')) dishs_list = list() d in dishs: dish = dish.objects.filter(id=d['dish_id']) shop = shop.objects.filter(id=dish[0].shop_id) dishs_list.append([d, dish, shop]) have print(dishs_list) [[{'count': 8, 'dish_id': 1}, <queryset [<dish: Суши>]>, <queryset [<shop: Суши Ями>]>], [{'count': 5, 'dish_id': 2}, <queryset [<dish: Муши>]>, <queryset [<shop: Суши Ями>]>]] {% dash_item in dash_list %}{{dash_item.0.count}}{{dash_item.0.dash_id}}{{dash_item.1}}{{dash_item.2}}{% endfor %} here {{dash_item}} again list used {{dash_item.0}} first ele

react native - Swipable tags component on two lines -

Image
i trying implement that: where user can swipe right , @ time rest of tags should continue on second line no more 2 lines. make component swipable tags goes on 1 line no matter how many of them have. here code: render() { return ( <scrollview horizontal='true' style={styles.containerstyle} contentcontainerstyle={styles.list} > <tag /> <tag /> <tag /> <tag /> <tag /> </scrollview > ); } const styles = { containerstyle: { minheight: 40, marginleft: 8, marginright: 8, maxheight: 100, }, list: { flexdirection: 'row', flexwrap: 'wrap' } }; you can push tags array .that array should grouped.yo can use review following code.

ruby - How to select all children except x from a HTML node -

i have block of html need extract text: <div class="comment"> <span class="c00"> text <p>text</p> <p>text</p> <div class="reply">reply</div> </span> </div> note 'text' text node no html tags within span class="c00" . how select texts without div class="reply" ? i tried :not operator: .c00:not(.reply) but did not work. looks can't. set styles .c00 , overwrite in .reply : .c00 { color: #f00; font-weight: 700; font-style: italic; } .reply { color: #000; font-weight: 400; font-style: normal; } <div class="comment"> <span class="c00"> text <p>text</p> <p>text</p> <div class="reply">reply</div> </span> </div>

java - JPA orm.xml support for database index -

i not see option like, in orm.xml file, of jpa2 . <basic name="developer"> <index /> <column name="developer"/> </basic> i see there hbm.xml files, offers that, wonder if jpa 2.0 lacks feature part of standard. so can avoid transformation hbm.xml files... jpa 2.0 table xsd type looks this: <xsd:complextype name="table"> <xsd:sequence> <xsd:element name="unique-constraint" type="orm:unique-constraint" minoccurs="0" maxoccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="catalog" type="xsd:string"/> <xsd:attribute name="schema" type="xsd:string"/> </xsd:complextype> while jpa 2.1 looks follows: <xsd:complextype name="table"> <xsd:s

java - Jbehave 0 stories run -

i'm new in java , jbehave. wanted try bdd jbehave seems doing wrong - test run step not executed. pojo class: public class addition { public int result; public void addvalues(int a,int b){ result=a+b; } public int getresult(){ return result; } } steps class: public class additionstep { private addition calc; @given("open calc") public void opencalc(){ calc=new addition(); system.out.println("opened calc"); } @when("i add $number1 $number2") public void addition(@named("number1")int a,@named("number2")int b){ calc.addvalues(a, b); } @then("outcome $result") public void checksum(@named("result")int output){ assert.assertequals(output, calc.getresult()); system.out.println("sum : "+output); } } story runner: public class additionstory extends junitstories { @o

sql - a specific way to use max() -

i have datetime, total, material, , mix columns. this equipment runs mix x amount of hours, switches mix b x amount of hours. switches mix a. i have query just: select max(total), material, mix database group material, mix however need catch fact mix ran twice , 1 value recorded , wouldn't know how material used in 1 skipped. is there way @ max(total), new max every time mix or material changes? (not actual different mix / material when changes mix b mix a. edit show data looks like timestamp mix material tons 2017-02-08 07:49:25.000 mixa mat1 30.05 2017-02-08 07:50:25.000 mixa mat1 30.27 2017-02-08 07:51:25.000 mixa mat1 30.50 2017-02-08 07:52:25.000 mixa mat1 30.76 2017-02-08 07:53:25.000 mixa mat1 31.01 2017-02-08 07:58:25.000 mixb mat1 0.1 2017-02-08 07:59:25.000 mi

c - I am getting a value from a function without return -

this question has answer here: function returns value without return statement 5 answers i know happening in simple c code: #include <stdio.h> int something(int a, int b) { int c = * 3 + 4 * b; } int main() { int res = something(12, 54); printf("%d\n", res); return 0; } the function not have return , "res" stores value calculated in something . following show compilation command, execution , output: $ gcc main.c $ ./a.out 252 edited i have changed variables types int float, in relation @paul ogilvie comment, , seems return last int stored: #include <stdio.h> float something(int a, int b) { float res = * 3 + 4 * b * 1.0; } int main() { float res = something(12, 54); printf("%d\n", res); return 0; } $ gcc main.c $ ./a.out 54 it undefi

Start Cloudformation stacks in parallel from ansible -

i starting multiple cloudformation stacks in "with_items" loop in ansible this: - name: create cf stack in aws cloudformation: stack_name: "{{ item.name }}" state: "present" template: "{{ item.name }}.py.json" template_parameters: "{{ item.template_parameters }}" with_items: "{{ cf_template_items }}" can somehow make ansible start stacks in parallel? using asynchronous tasks in fire-and-forget scheme (and waiting them finish in separate task) should work since ansible 2.0: - name: create cf stack in aws async: 100 poll: 0 cloudformation: stack_name: "{{ item.name }}" state: "present" template: "{{ item.name }}.py.json" template_parameters: "{{ item.template_parameters }}" with_items: "{{ cf_template_items }}" register: cf_stack_async_results - async_status: jid: "{{item.ansible_job_id}}" with_item

How to logon SAP silencely with Python using win32com -

i have question logon sap silencely. able use win32com logon sap python. below code. in vb can use r3.conn.logon(1, true) make logon siliencely. in python logon seems not method , not allow me pass parameters it. i tried using r3.conn.logon(1, true) in python, returned error told me logon not callable. how should call logon silencely in python thanks from win32com.client import dispatch r3 = dispatch("sap.functions") r3.conn.system = 'xxx' r3.conn.client = '100' # other values needed pass r3.conn r3.conn.logon #here problem

javascript - React Router v4 with Redux - dispatch is not passed -

so, i've been trying switch app react router v4 (the api has changed quite lot), , i've reached: router setup const createstorewithmiddleware = applymiddleware( thunkmiddleware, createlogger )(createstore); const store = createstorewithmiddleware(rootreducer); const routerlayout = () => ( <provider store={store}> <app> <switch> <route component={login} path="/login" /> <route component={accountdetails} path="/account/:id" /> </switch> </app> </provider> ); const routes = ( <hashrouter> <routerlayout /> </hashrouter> ); reactdom.render(routes, document.getelementbyid("app-container")); now problem reason can't redux hooked components: export class login extends react.component<any, any> { componentdidmount() { console.log(this.props); //

php - can't send attachment on phpMailer() -

i'm using phpmailer send email. when attached $body email being send html body, attachment not being send. removed $body , set text body ( $email->body = 'abcd' ) , fine, attachment , body text send. can't use $email->body = $body; , $email->addattachment("img/".$file_name); @ same time. this code: <?php session_start(); $url = "http://{$_server['http_host']}"; $escaped_url = htmlspecialchars( $url, ent_quotes, 'utf-8' ); if(isset($_files['image'])){ $errors= array(); $file_name = $_files['image']['name']; $file_size =$_files['image']['size']; $file_tmp =$_files['image']['tmp_name']; $file_type=$_files['image']['type']; $tmp=explode('.',$_files['image']['name']); $file_ext=strtolower(end($tmp)); $expensions= array("jpeg","jpg","pn

mysql - How efficiently check record exist more than 2 times in table using sub-query? -

i have query . have compound index cc.key1,cc.key2. executing in big database select * cc ( ( (select count(*) service s cc.key1=s.sr2 , cc.key2=s.sr1) > 2 , cc.key3='new' ) or ( (select count(*) service s cc.key1=s.sr2 , cc.key2=s.sr1) <= 2 ) ) limit 10000; i tried make inner join , getting slower . how can optimize query ? the trick here being able articulate query problem: select * cc t1 inner join ( select cc.key1, cc.key2 cc cc left join service s on cc.key1 = s.sr2 , cc.key2 = s.sr1 group cc.key1, cc.key2 having count(*) <= 2 or sum(case when cc.key = 'new' 1 else 0 end) > 2 ) t2 on t1.key1 = t2.key1 , t1.key2 = t2.key2 explanation: your original 2 subqueries add count if given record in cc , given key1 , key2 value, matched corresponding record in service table. strategy behind inner query use gro

c - How to run a background process before all foreground processes or a particular foreground process? -

this program system.c #include <stdio.h> #include <stdlib.h> int main() { system("./client &"); printf("we in main program\n"); printf("we in main program\n"); printf("we in main program\n"); printf("we in main program\n"); printf("we in main program\n"); return 0; } this client.c #include <stdio.h> int main() { printf("we in background process\n"); { //doing process on message queue receive messages } while (1); return 0; } how output of ./system running linux terminal below one we in background process in main program in main program in main program in main program in main program can please explain more clarity? maybe have @ , inspire yourself. #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { int pid

java - Java8 using enum values in interface's default methods -

i'm exploring possibilities of static , default methods introduced in java 8. i've interface has 2 default methods construct command, run on server through ssh simple tasks remotely. moving mouse requires 2 arguments: x , y position of mouse. public interface robot { default string movemouse(int x, int y) { return constructcmd("java -jar move_mouse.jar " + x + " " + y); } default string clickleft() { return constructcmd("java -jar click_left.jar"); } static string constructcmd(string cmd) { return "export display=:1.0\n" + "cd desktop\n" + cmd; } } i've multiple enums values preset, potently combine enums 1 , not use interface ever, enum contain hundreds or thousands of values , want keep organised, i've split evertying in multiple enums. i want enums share same methods figured i'll give default methods in interface shot.

javascript - Angular filter "Error: [ngModel:nonassign] Expression '(gridData.StructureViewModel | sumPlanByKpi:kpi)' is non-assignable." -

pls, me resolve error. , wrong? i have input custom filter | sumplanbykpi:kpi filtermodule.filter('sumplanbykpi', ['$filter', function ($filter) { return function (input, kpi) { if (angular.isundefined(input) && angular.isundefined(kpi)) return 0; var sum = 0; var findedplansarray = []; (i = 0; < input.length; i++) { var findedplans = $filter('filter')(input[i].plans, function (plan) { return plan.kpi_id === kpi.id; }); var temp = findedplansarray.concat(findedplans); findedplansarray = temp; } angular.foreach(findedplansarray, function (v, k) { if (v.value != null) sum = sum + parseint(v.value); }); return sum; }; }]); <input type="text" class="form-control input-sm col-lg-1" ng-model="(griddata.structureviewmodel | sumplanbykpi:kpi)"

json - Android HTTP POST using loopj error -

i android beginner i'd http post jpg image onto server. using loopj library can't work. the following code works smoothly in python: c.setopt(pycurl.httpheader, [authheader]) c.setopt(pycurl.post, 1) data = [('image', (c.form_file, filename_tmp))] c.setopt(pycurl.httppost, data) c.perform() c.close() authheader header key in form of "authorization: token .......". unfortunately can't code on android work: //http client setup string loginstring = "*********"; string base_url = "https://www.******"; asynchttpclient client = new asynchttpclient(); //post image try { requestparams params = new requestparams(); params.put("image", myfile); params.sethttpentityisrepeatable(true); client.addheader("authorization: token ", loginstring); client.post(base_url, params, new texthttpresponsehandler() { @override public void onsuccess(int

Find many members of a list in an other! Python -

i have problems find list members in other array. doesn't print errors prints anything.. code.. wanna search "parole" in frequenzaparolespamglob, list..this wrong code.. sorry bad english. in advance attention... requenzaparolehamglob=counter() i=0 while < len(frequenzaparoleham): frequenzaparolehamglob= frequenzaparolehamglob + frequenzaparoleham[i] i=i+1 frequenzaparolespamglob=counter() i=0 while < len(frequenzaparolespam): frequenzaparolespamglob= frequenzaparolespamglob + frequenzaparolespam[i] i=i+1 sommafreqspam= sum(frequenzaparolespamglob.values()) sommafreqham= sum(frequenzaparolehamglob.values()) frequenzaparolespamglob=sorted(list(collections.counter(frequenzaparolespamglob).items())) frequenzaparolehamglob=sorted(list(collections.counter(frequenzaparolehamglob).items())) inputemail = input('inserisci una email:') parole = nltk.word_tokenize(inputemail) parole=[i in parole if not in listastop

php - Change a column name on select -

i have temporary table. col_1 col_2 col_3 col_4 abc b01 10 5 abc b01 77 5 abc b03 30 7 abc b05 50 11 abc b05 88 11 def b05 50 50 def b05 88 50 def b06 66 50 a01 b02 20 0 a01 b04 40 0 a02 b02 99 0 and helper table: id1 id2 abc a01 def a02 what i'd do. if there values in col_1 in temporary table matches id2 in helper table, values changed id1 in helper table. how on select ? so, when select ( select * temporary ). result: col_1 col_2 col_3 col_4 abc b01 10 5 abc b01 77 5 abc b03 30 7 abc b05 50 11 abc b05 88 11 def b05 50 50 def b05 88 50 def b06 66 50 abc b02 20 0 abc b04 40 0 def b02 99

c# - Severity Code Description Project File Line Suppression State Error The tag 'VideoResultControl' does not exist in XML -

i trying implement microsoft emotion api in c# using code available on github. followed steps given in https://www.microsoft.com/cognitive-services/en-us/emotion-api/documentation/getstarted . have 3 errors, of them is: error : tag 'videoresultcontrol' not exist in xml namespace 'clr-namespace:sampleusercontrollibrary;assembly=sampleusercontrollibrary'. line 28 position 10. error: tag 'samplescenarios' not exist in xml namespace 'clr-namespace:sampleusercontrollibrary;assembly=sampleusercontrollibrary'. line 12 position 10. in solution explorer, "sampleusercontrollibrary (load fail)" appears: means no user controls libraries loaded. thanks in advance. i had exact same problem the problem here sampleusercontrollibrary not loaded. because - cognitive-common-windows git submodule so, todos - git submodule init git submodule update more info can found here

php - How to remove cookies in redirected URL? -

i passing link through httpwebrequest() , httpwebresponse() methods, getting final response url contains cookies(session id) in it. for example, link http://histoire-bateaux-aviron.fr/ i getting following response url: histoire-bateaux-aviron.fr/;jsessionid=d94cea91011fdf30cca8a8eac8ce4971.tcpfix243a when open http://histoire-bateaux-aviron.fr/ in browser, link in browser address bar doesn't contain session id value. how remove session id , cookie values above response url?

jni - How to wrap callbacks in Java with SWIG -

following thread: how should write .i file wrap callbacks in java or c# i realize question similar answer question tailored specific void* user data argument, while callback takes enum , char* . this how callback defined , used in header file typedef void (*callback_t)(const log somelog, const char *text); virtual void setcallback(const callback_t somecallback, const log somelog) = 0; where log enum. i'm rather new jni , swig, need specific guide on how wrap this, similar 1 presented in thread mentioned above. thanks in advance. the simple solution adapt answer @ previous question use global variable store jobject can't store inside argument gets passed during callback. (it's bad design on part of library author there doesn't seem way of passing argument in when setting callback made available function, @ time callback happens. that's either void* or this . given it's c++ if me designing library i'd have used std::function , re

java - CheckBoxes are not getting cleared after clicking Next button -

i trying implement survey app in have ask few questions , question can have more 1 answer. have used checkbox problem facing when click on next button, next question appears on screen checkbox s checked last question still checked new question. want checkbox s cleared when click next button next question. public class surveyactivity extends activity { button submit,conti,nextbtn; textview head,survey,optn1,optn2,optn3,optn4; string que,opt1,opt2,opt3,opt4; checkbox checkbox1,checkbox2,checkbox3,checkbox4; int surveyno=127; int questionno=1; public final static string tag_success = "success"; public static final string extra_message = "message"; string msg; private progressdialog pdialog; jsonparser jsonparser = new jsonparser(); protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_survey); submit=(button)findviewbyid(r.id.btnsumbit); conti=(button)findviewbyid(r.id.btn