Posts

javascript - AJAX on Android Webview: Should I use JSON or HTML? -

i building feed application infinite scroll inside native android application using webview. first tried ionic framework disappointed performance. i thinking of developing in pure jquery , responsive html/css achieve superior performance. 1 thing considering weather emit html or json server side apis. emitting json means client side dom manipulation can again hurt performance. looking maximum performance. whereas, not sure emitting html idea better maintainability of application. what guys recommend? injecting json should better solution. in case manipulation or operation on data required in later phase of development. possible security issue.you mixing control(tags) , data. preventing inline script execution can protect against attacks extend. this said if implemented , right reasons html might not total bad choice. but, performance over-head might not right reason. again haven't tested confirm this. you can have @ this question.

Data validation - Drop down list with no duplicates in excel -

Image
could please assist me removing duplicates in drop down list . list not static. example: before james peter james nick peter after james peter nick i not sure formula use data validation formula box. i had attempted below, no success: =offset($c$13,0,0,countif(c:c,"?*")-1) step 1 - original names in column a, put array formula¹ somewhere off right in second row. i'll use z2. =iferror(index(a$2:index(a:a, match("zzz",a:a )), match(0, countif(z$1:z1, a$2:index(a:a, match("zzz",a:a ))&""), 0)), "") fill down until run out of names , few more rows allow future expansion. step 2 - go formulas ► defined names ► name manager , create new name. name: listnames scope: workbook refers to: =sheet2!$z$2:index(sheet2!$z:$z, match("zzz", if(len(sheet2!x:x), sheet2!$z1:$z98) )) step 3 - go cell want data validation , use data ► data tools ► data validation. allow: list source: listnames     ...

Python regex to find multiple consecutive punctuations -

i streaming plain text records via mapreduce , need check each plain text record 2 or more consecutive punctuation symbols. 12 symbols need check are: -/\()!"+,'&. . i have tried translating punctuation list array this: punctuation = [r'-', r'/', r'\\', r'\(', r'\)', r'!', r'"', r'\+', r',', r"'", r'&', r'\.'] i can find individual characters nested loops, example: for t in test_cases: print t p in punctuation: print p if re.search(p, t): print 'found match!', p, t else: print 'no match' however, single backslash character not found when test , don't know how results 2 or more consecutive occurrences in row. i've read need use + symbol, don't know correct syntax use this. here test cases: the quick '''brown fox &&quick brown fox quick\brown fox q...

Display php result after html -

i have form people can search database user. when search user , click submit, they're re-directed different page , results displayed. my issue results being displayed before required html tags - here's example of page looks through inspect element: "bobby123 " <!doctype html> <html> <body> </body> </html> how display results after required html tags? how set "set place" results displayed? here's code: <?php if(isset($_post['submit'])) { $term = $_post['search']; $searchuser = $stmt = $con->prepare("select * users username :term"); $stmt->bindvalue(':term', '%'.$term.'%'); $stmt->execute(); if($searchuser->rowcount() > 0) { while($row = $searchuser->fetch()){ $name = $row['username']; echo $name; } }else{ echo 'no results'; } } ?> <form metho...

string - Longest substring of repeated characters -

i have assignment school in which, given input string of entirely 0's , 1's, must return length of longest substring of repeated 1's. not allowed use having trouble fleshing out idea. far have found length of input string , converted input string uint8. way can use find find indices of ones. next thought sort of loop store indices, or maybe check length of each subset , save longest one? i'm not sure how go part or if right way think it. guidance appreciated. you can use regular expressions this: [s,e] = regexp(inputstring,'(1+)'); maximumsequencelength = max(e-s+1); if want find longest substring of character, use following dynamic regular expression, says: "take character. match many of character possible" [s,e] = regexp(inputstring,'(.)((??$1*))'); inputstring(s) returns first element of each substring.

Java File runs in eclipse but on command line -

i have created jar file in eclipse using maven , able run class jar file eclipse. when run following command command prompt: c:\recomendation_engine\recomendation\target>java -classpath recomendation-0.0.1 -snapshot.jar recomendation.managegeneralcontent test i following error: organization environment test java.lang.classnotfoundexception: com.mysql.jdbc.driver @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.class.forname0(native method) @ java.lang.class.forname(unknown source) @ recomendation.managegeneralcontent.main(managegeneralcontent.java:52) i believe issu...

datetime - Python not writing to file -

i'm making script reads through .txt file , proceeds use information, , date, create dynamic html files. worked yesterday, today, seems doesn't want write file... here source code. from __future__ import print_function import httplib2 import os import io import shutil import datetime import random import re apiclient.http import mediaiobaseupload, mediaiobasedownload datetime import date apiclient import discovery import oauth2client oauth2client import client oauth2client import tools def filerino(): daginfo = str(datetime.datetime.today().weekday()) ukenr = (datetime.datetime.today().isocalendar()[1]) dato = datetime.date.today() day = datetime.date.today().day month = datetime.date.today().month yesterday = (day - 1) tomorrow = (day +1) todayerino = str(day) + "/" + str(month) yesterdayerino = str(yesterday) + "/" + str(month) tomorrowerino = str(tomorrow) + "/...