Posts

Showing posts from February, 2010

android - Last word in toolbar title is sometimes displayed with delay and sometimes is not displayed at all. -

i have problem toolbar. have textview included in toolbar changed each time change page in viewpager. however, in 10% case text not displayed correctly. full title this: "userxx should pay" shows "userxx should" , "pay" displayed delay (cca. 800ms). "pay" not displayed @ all. have no clue might cause problem. tried use default toolbar title instead of including textview toolbar. change last word replaced elipsize (...). here toolbar structure: <android.support.design.widget.appbarlayout android:id="@+id/vappbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true" android:theme="@style/apptheme.appbaroverlay"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/vcollapsingtoolbar" android:layout_wi

windows - Script to copy collection of folders into subfolders seperated in parts -

i have collection of files sizing 33+gb , there 415 folders of these files. cd0001 cd0002 cd0003 cd0004 cd0005 cd0006 etc, etc... these updated files/folders program gets new updates every quarter, , been racking can tell. we have them seperated in parts 1-27 , divide them in 800-1,5gb parts. (started 1gb per part) what hoping can me create script can run, copy cd* folders, respective parts folder, without me having go folder every time , check there. ie. see folder c:\temp\updates\cd0001 looks cd0001 in parts folders (example \\\server1\program\part*\\*) removes old cd* folder. copies in new cd* folder. when started parts, there gaps inbetween cd's, in there cd0001-cd0255 , cd0330-cd0880, etc. and few quarters later, release cd0280, cd0281, cd0282, etc , big. so needed make part28 , continuance gets broken... :) its svn system aswell, cant move cd's part2 part3. any appreciated! if else stumbles upon this, made quick 1 have made li

sql server - Add single quotes to results in a column from a SQL query -

so have following sql: select opportunities.ref opportunities group opportunities.ref which returns following results: op10 op252 op52905 op42 i trying achieve following: 'op10' 'op252' 'op52905' 'op42' i have tried following: select opportunities.ref opportunities case when opportunities.ref not null "'"+opportunitiesref+"'" group opportunities.ref but not work. i not want update column, or use @declare functions this. using sql server 2008. im not sure how go this. help? if using sql server modify query according below : select opportunities.ref opportunities case when opportunities.ref not null ''''+opportunitiesref+'''' group opportunities.ref

c# - How can I add to a listbox from another class? -

i've seen posted few times cannot seem apply me. i want add items listbox in home class servercontroller class. not entirely sure on how go grateful. home class: public partial class frmhome : form { servicecontroller sc = new servicecontroller(); public listbox lb = new listbox(); public frmhome() { lb = new listbox(); initializecomponent(); servicecontroller sc = new servicecontroller(); } //listbox add public void additem(string item) { lb_msg.items.add(item); lb_msg.items.add(item); lb_msg.items.add(""); } } service class: public class servicecontroller { servicecontroller[] scservices; //start service public void startservices() { scservices = servicecontroller.getservices(); try { foreach (servicecontroller sctemp in scservices) { if (scte

django - Store user specific data for each object -

if have eg app stores articles , each of these articles can rated user. rating not visible other users , user specific (no overall rating) ie each rating of same article-object needs stored each user. currently complete crazy stuff: class article(models.model): text = models.textfield(null=true, blank=true) def __unicode__(self): return self.text class userarticlestorage(models.model): user = models.onetoonefield(settings.auth_user_model, on_delete=models.cascade, null=true, ) articles_rated_1 = models.manytomanyfield( article, related_name="articles_rated_1", blank=true ) articles_rated_2 = models.manytomanyfield( article, related_name="articles_rated_3", blank=true ) articles_rated_3 = models.manytomanyfield( article, related_name="articles_rated_

Jquery Cropit data post(PHP/Laravel) -

i using jquery cropit plugin post crop image data hidden input field server, getting 4.3 response in return. the image data after crop looks like: data:image/png;base64,ivborw0kggoaaaansuheugaaamyaaadgcay... but when slice first 5 character string image/png;base64,ivborw0kggoaaaansuheugaaamyaaadgcay... the data posted ok. can explain issue?

r - Anomaly Detection - Correlated Variables -

i working on 'anomaly' detection assignment in r. dataset has around 30,000 records of around 200 anomalous. has around 30 columns & quantitative. of variables highly correlated (~0.9). anomaly mean of records have unusual (high/low) values column(s) while have correlated variables not behaving expected. below example give idea. suppose vehicle speed & heart rate highly positively correlated. vehicle speed varies between 40 & 60 while heart rate between 55-70. time_s steering vehicle.speed running.distance heart_rate 0 -0.011734953 40 0.251867414 58 0.01 -0.011734953 50 0.251936555 61 0.02 -0.011734953 60 0.252005577 62 0.03 -0.011734953 60 0.252074778 90 0.04 -0.011734953 40 0.252074778 65 here have 2 types of anomalies. 4th record has exceptionally high value heart_rate while 5th record seems okay if individual columns. can see heart_rate increases speed

python - Flask-Login opens login-required pages for Anonymous Users -

in flask app, want redirect users logged in members area when open login page. using flask-login extension. now issue anonymous users can open member page without having log in though has login-required decorator. when checked terminal error on members page opened anonymous user: error on request: traceback (most recent call last): file "/home/maxwell/py/aqua/lib/python2.7/site-packages/werkzeug/serving.py", line 209, in run_wsgi execute(self.server.app) file "/home/maxwell/py/aqua/lib/python2.7/site-packages/werkzeug/serving.py", line 200, in execute write(data) file "/home/maxwell/py/aqua/lib/python2.7/site-packages/werkzeug/serving.py", line 168, in write self.send_header(key, value) file "/usr/lib/python2.7/basehttpserver.py", line 412, in send_header self.wfile.write("%s: %s\r\n" % (keyword, value)) ioerror: [errno 32] broken pipe this flask code. pasting bits think necessary: import os flask im

c# - How to check if referenced dll is needed for class on runtime -

i hav ea program dynamically loads , adds elements based on found dlls in given directory. (in short: assembly.loadfrom("...xyz.dll").gettypes().where(t => typeof(mybaseclass).isassignablefrom(t).select(t => activator.createinstance(t))) now of dlls (including multiple classes derived mybaseclass) require additional referenced dlls, not included (like when using api-dll program). typically handled appdomain.currentdomain.assemblyresolve event, dynamically load missing api-dlls based on installation paths) result, when using assembly.gettypes(), "reflectiontypeloadexception ex" subtype "filenotfoundexception" part of ex.loaderexceptions. clarify: exception ok, because api-dlls part of other programs; if run program on pc without these programs installed, of course referenced api-dlls missing (and adding them program not allowed). my question is: how can filter listed types (either assembly.gettypes() or reflectiontypeloadexception ex.types)

java - How to accept this alert in appium? -

Image
appium v1.6.4-beta xcode 8.2 macos sierra 10.12 i want automate save photo in device. in first time have give permission. have used "accept alert", cannot accept alert allow access photo library. shows test passed in green , when execute test, popup still appear in view , photo not saved. this script //check save driver.findelement(by.id("save")).click(); driver.switchto().alert().accept(); capabilities used , capabilities.setcapability("autoacceptalerts", true); this want allow how accept alert? have tried xpath sa well, no luck below code work.give try "ok" , "ok". because if want try identify element text can use accessibilityid or id. driver.findelement(by.id("ok")).click(); below code won't work alerts coming in mobile automation web alerts. driver.switchto().alert().accept();

ios - Google places - GMSAutocompleteViewController didAutocompleteWith full text -

Image
this delegate function in viewcontroller : func viewcontroller(_ viewcontroller: gmsautocompleteviewcontroller, didautocompletewith place: gmsplace) { print("place name: \(place.name)") print("place address: \(place.formattedaddress)") dismiss(animated: true, completion: nil) } i searched "grav skole" , selected first option here : following logs : place name: grav skole place address: "hosleveien 24, 1358 jar, norway" on android, result displayed " grav skole, hosleveien, jar, norway ", desired text , not match ios. missing ? it sounds want access text of predictions displayed in list gmsautocompleteviewcontroller . can implementing viewcontroller:didselectprediction method of gmsautocompleteviewcontrollerdelegate , called when item selected. func viewcontroller(_ viewcontroller: gmsautocompleteviewcontroller, didselectprediction prediction: gmsautocompletepred

how to extract images from Google places API android -

placephotometadataresult result3 = places.geodataapi.getplacephotos(mgoogleapiclient3,place.getid()).await(); if (result3.getstatus().issuccess() && result3!= null){ placephotometadatabuffer placephotometadatabuffer = result3.getphotometadata(); placephotometadata photo = placephotometadatabuffer.get(0); bitmap image = photo.getphoto(mgoogleapiclient3).await().getbitmap(); imageview = (imageview)findviewbyid(r.id.image3); imageview.setimagebitmap(image); } how build google api client in code or there other method access image google place api? you can following url. https://maps.googleapis.com/maps/api/place/photo?photoreference= "enter photo refernce key here"&maxheight=100&maxwidth=100&key="enter google key here"

Open a Lightbox in a Featherlight.js Lightbox without double-click - Is it possible? -

i open featherlight lightbox html-content. content contains small pictures , use featherlight images show bigger sizes. for example: added link image in ajax examples div http://noelboss.github.io/featherlight/ <div class="ajaxcontent lightbox"> <h2>this ligthbox loaded using ajax</h2> <p>with <a href="https://github.com/noelboss/featherlight/#installation">little code</a>, can build lightboxes use custom content loaded ajax...</p><a class="btn btn-default" href="assets/images/droplets.jpg" data-featherlight="image">image</a> </div> when lightbox opens ihave double-click on image/button let open. is possible open on first click? example assuming want open featherlight, , content of featherlight open nested featherlight (which seems odd tbh), can use afteropen callback, in can open nested featherlight using $.featherlight(...) or find('.my-bu

php - thumbnails are more bigger respect to the original image -

i have worpdress website images important part of it, have found solution prevent compression of images wordpress when upload images (wordpress make compression of 90/100 when upload image through image uploader), because want better image quality. this filter used: add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) ); so it's work, see problem, when upload image example size of 150 kb, default thumbnails of wordpress (medium,large) more bigger (300kb) original image why ?

loops - Iterate boxplot R model.frame.default -

i have question regarding looping data frame , making boxplot of each numerical column of data frame dependent on data frame. example, mtcars: providing boxplot of each column vs. gear column. i tried following: for (i in names(mtcars)){ boxplot(i ~ gear, data = mtcars) } this, however, results in following error: "error in model.frame.default(formula = ~ gear, data = mtcars) : variable lengths differ (found 'gear')" i know there other posts on stackoverflow show in cases na values prohibit kind of formula working, mtcars dataset complete dataset, na values cannot issue. my question: how can create boxplot each variable vs. 'fixed' variable data frame? example: boxplot(mpg ~ gear, data = mtcars) boxplot(cyl ~ gear, data = mtcars) and on. other posts relating error in context can found here . unfortunately not able solve problem answers described here, because in cases na values problem, or more technical extracting elements list wh

list - Java Adding Strings after end of first for loop -

i have list, appends depending on user input, example if type "lmo" add large pizza, mozzarella , olives list. if type "mhmo" add medium pizza, ham, mozzarella , olives list. now want use loop, print list in format such as large pizza mozzarella, olives, £8.90 the loop can print contents of list how add with string after end of first loop. currently code is: for(int l = 0; l < words.size(); l++) { if (words.size() == 1) { system.out.println(words.get(l) + " no toppings "+ "£"+string.format("%.2f", total)); } else { system.out.println(words.get(0) + " " + words.get(1) + ", " + words.get(2) + ", "+ "£" + string.format("%.2f", total)); } } } at moment it's assuming theres 3 items in list can vary. approach can use loop increment + use with string. you can either creata pizza class on overrid

php - Get the current serverFilenamein dropzone? -

i getting stuck on using laravel 5.2 framework. want server filename while clicking on remove filein dropzone. have upload images. when try remove particular image give me alll images in dropzone here code:- enter code here dropzone.autodiscover = false; var filelist = new array; var =0; $("#my-awesome-dropzone").dropzone({ method:'post', maxfiles: 10, paramname: "file", maxfilesize: 10, addremovelinks: true, acceptedfiles: ".jpeg,.jpg,.png,.gif", clickable: true, init: function() { // hack: add dropzone class element $(this.element).addclass("dropzone"); this.on("sending",function(file, xhr, formdata) { formdata.append("_token", "{{ csrf_token() }}"); }); this.on("success", function(file, serverfilename) { filelist[i] = {&qu

jquery - link from index to folder works locally but not on server -

i have had can't figure out causes issue. problem following: i have page i've developed locally , works fine. have uploaded public_html , index.html, css , js works fine, doesn't show images or fonts. the file structure this: index.html css/style.min.css css/animations.css js/jquery.min.js js/main.min.js fonts/micon/css/micon.min.css img/hakn-min.jpg etc as far understand links should same, , seen 'head' example: <link rel="stylesheet" href="fonts/micon/css/micon.min.css"> <link rel="stylesheet" href="css/animations.css"> <link rel="stylesheet" href="css/style.min.css"> from understanding, if stylesheets working, fonts should well. can me head around this? edit: images css works fine. thanks, håkan in browser have tool called inspector . can open f12 , there (usually in network tab) can see requests web page makes. with inspector can see server g

php - Need to store a large amount of data in session with CI 3 but on storing large data in session it is itself destorying automatically -

i working on large web application need database retrieved session instead of database. first time retrieving db , saving session onward calls of data going session. it handling data @ stage when got more data stored in session session got destroyed automatically... "this problem seems similar question says title session destroyed after redirect other pages of site." i got answer questions point here how handle thing when know in future have more data stored inside session, i wanted know little bit more involved answer right in development stage on production when have user 100000 or more how session behave, application behave in same manner did before. kindly discuss me, researching, need corporation more technical in php discussion may solution many of people facing same kind of issues.. you need use native php session because php session stores id in cookie. codeigniter stores data in cookie , problem stuck. so either need use native php sessions

regex - JMeter Response Assertion fails pattern -

apply to: main sample , sub-samples response field test: text response pattern matching rules: contains patterns test: <?xml version="1.0" encoding="iso-8859-5" standalone="yes"?> <cit_request> <system> <cit_version value="1.0"/> <err value=""/> <format value="xml"/> <interface_ret value=""/> <main_id value="37407427745"/> <msg_id value=".*"/> - regexp not working <sync value="n"/> <version value="002"/> </system> <data> <package_b64> pe1zz0nsawvudefkzfjzihhtbg5zpsj1cm46c2nozw1hcy1wc2l0lxj1omdwij48 unfvsuq+mzc0mdc0mjc3ndu8l1jxvulepjxscvjlc3vsdd48u3rhdhvzpk9rpc9t dgf0dxm+penvbw1lbnq+tmv3pc9db21tzw50pgojcqk8l1jxumvzdwx0pjxszxn1 bhq+pensawvudelkpjc3mzy0ntgypc9dbgllbnrjzd48sw50zxjuywxfq2xpzw50 swq+mjy3

function - How to replace numbers in a class to some chars in jquery? -

this question has answer here: convert english numbers persian/arabic specified div 3 answers how replace numbers in body persian numbers? 6 answers i want create function replace english digits exist in class named i.e. ".fadigits" farsi digits jquery. example: 1 ۱ 2 ۲ 3 ۳ 4 ۴ 5 ۵ 6 ۶ 7 ۷ 8 ۸ 9 ۹ 0 ۰ so can set script change numbers. <script> $(document).ready(function(){ $('.fadigits').persiannumbers(); }); </script> any help? thank you.

java - InputStream of socket not closing on peer loss -

i connecting device opening socket. incoming data perform read action on inputstream in different thread. when take away electricity of peer device connected to, inputstream doesn't recognize loss of connection. this code wait input: stringbuilder sb = new stringbuilder(); string result = ""; int c; try { log.info( "waiting data..." ); while ( ( ( c = inputstream.read() ) >= 0 ) ) { if ( c == -1 ) { log.info( "is -1" ); } /* * todo: <lf> can't delimiter define end of message. should * parameterized. */ if ( c == 0x0a /* <lf> */ ) { result = sb.tostring(); sb.delete( 0, sb.length() ); } else if ( c != 0x0d /* <cr> */ ) { sb.append( (char) c ); } if ( !result.isempty() ) { log.info( getname() + ": received message: " + result ); listener.messagereceived( result.getbytes() ); result = "";

highcharts - Rendering the charts as columnrange type -

Image
i have following chart render working times intervalls columnrange , palcing charts close xaxis. with part of code in code below chart: { spacingtop: 0, paddingtop: 0, zoomtype: 'x', }, i getting following charts: https://jsfiddle.net/62jq6zsd/ but not getting right result. putting code fiddle, can see nothing plotted: http://jsfiddle.net/jlbriggs/3d3fuhbb/225/ looking @ data, reason apparent. have data set as; { x: 1483358580000, y: 1 } but columnrange series type requires data elements of low , high , optional/inferred x value. in addition, have points null values x , not work highcharts - there must x value, whether set or inferred. it's unnecessary - use of null points break line series needed because lines meant continuous; columnrange type has breaks built in. and finally, have x , y mixed - since inverting chart, axes swap places - x vertical axis, , y horizontal. if values time, in 1483358580

angular - How to modify the appearance of MD components -

Image
in code: <button md-icon-button [md-menu-trigger-for]="menu"> <md-icon>more_vert</md-icon> <md-menu #menu="mdmenu"> <button md-menu-item>item 1</button> <button md-menu-item>item 2</button> </md-menu> </button> i trying put top: 67px; i've tried this: <md-menu style="top: 67px;" #menu="mdmenu"> or in <button md-menu-item but has not worked, can see dynamically created, so <div id="cdk-overlay-0" class="cdk-overlay-pane" dir="ltr" style="left: 480px; top: 15px; pointer-events: auto;"> i modified top browser top: 67px; and works expect. i tried add in component.css file next: .cdk-overlay-pane { top: 67px; } but not seem work. i have used it: .test { top: 67px; } and add in class not work me. how can modify top in componen

objective c - NSStrikethroughStyleAttributeName , How to strike out the string in iOS 10.3? -

i have used line of code before release of ios 10.3 ,and worked fine. nsmutableattributedstring *attributestring = [[nsmutableattributedstring alloc] initwithstring:[nsstring stringwithformat:@"%@\n%@",strmrp,stroffer]]; [attributestring addattribute:nsfontattributename value:[uifont boldsystemfontofsize:12] range:nsmakerange(0, strmrp.length)]; [attributestring addattribute:nsfontattributename value:[uifont boldsystemfontofsize:15] range:nsmakerange(strmrp.length, stroffer.length+1)]; [attributestring addattribute:nsstrikethroughstyleattributename value:[nsnumber numberwithinteger: nsunderlinestyledouble] range:nsmakerange(0,strmrp.length)]; but stopped working ,is there alternate way strike out ? it bug in ios 10.3 , nsstrikethroughstyleattributename (any nsunderlinestyle cases) not working more on ios sdk 10.3. if found updated answer related , please inform here, update answer. product version:

authentication - Boost cached authonticated pages -

please me, i'm trying long time. i'm using boost cache in drupal 7 website, , have secured login (https form). when user logged in, boost served cached pages , user appeared logged out, read lot issues in google no 1 solved problem. issue faces me on firefox , chrome not on ie. please can save life.

ios - indexPathForSelectedRow returning wrong index -

i want of data of displayed in cell when i'm tapping on button placed in cell. have implemented used indexpathforselectedrow method. when i'm tapping on cell, method returning 0 index, if i'm not tapping on 0th index cell. code used button - - (ibaction)datasavelounge:(id)sender { nsindexpath *path = [self.loungetable indexpathforselectedrow]; nsstring *titlesave = [[loungedata objectatindex:path.row] valueforkey:@"title"]; nsstring *subtitlesave = [[loungedata objectatindex:path.row] valueforkey:@"excerpt"]; nsstring *idsave = [[loungedata objectatindex:path.row] valueforkey:@"id"]; savemdl = [favouritesmodel savefavourites:titlesave and:subtitlesave and:idsave]; } edit : added cellfforrowatindex method -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ static nsstring *loungecellid = @"mycelllounge"; loungetablecell *loungecell = [tableview dequeuereusablecellwith

python - No module named py4j.protocol on Eclipse (PyDev) -

Image
i configured eclipse in order develop spark , python. configured : 1. pydev python interpreter 2. pydev spark python sources 3. pydev spark environment variables. this libraries configuration : and environment configuration : i created project named compensationstudy , want run small example , sure go smoothly. this code : from pyspark import sparkconf, sparkcontext import os sparkconf = sparkconf().setappname("wordcounts").setmaster("local") sc = sparkcontext(conf = sparkconf) textfile = sc.textfile(os.environ["spark_home"] + "/readme.md") wordcounts = textfile.flatmap(lambda line: line.split()).map(lambda word: (word, 1)).reducebykey(lambda a, b: a+b) wc in wordcounts.collect(): print wc but got error : importerror: no module named py4j.protocol logicly, of pyspark’s library dependencies, including py4j, automatically imported when configure pydev spark python sources.. so, what's wrong here ? there problem log

javascript - TypeScript Unexpected token, A constructor, method, accessor or property was expected -

just trying write function within class using typescript. class test { function add(x: number, y: number): number { return x + y; } } this results in following error: typescript unexpected token, constructor, method, accessor or property expected. i copied example from: https://www.typescriptlang.org/docs/handbook/functions.html am missing something? i'm confused! you shouldn't use function keyword in typescript class definition. try instead: class test { add(x: number, y: number): number { return x + y; } }

java - Log4j same log file multiple webapp versions -

i have 1 webapp deploy tomcat server twice (it has different versions, lets 1.0 , 2.0). webapp has log4j configured. jar files log4j located in web-inf/lib folder of webapp, while properties file logger read external configuration path. both webapps log information in same .log file , happening 1 (either 1.0 or 2.0) logging specified file, while other 1 logs nothing. kinda believe it's because how log4j initialized during webapp initialization, i'm not sure how make both 1.0 , 2.0 log same file. ideas? properties file: log4j.rootlogger=debug, file log4j.additivity.applicationlog=false log4j.appender.console=org.apache.log4j.consoleappender log4j.appender.console.layout=org.apache.log4j.patternlayout log4j.appender.console.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss,sss} %x [%p] [%c{1}.%m] %m%n log4j.appender.file=org.apache.log4j.rollingfileappender log4j.appender.file.file=/external/path/mylogfile.log log4j.appender.file.maxfilesize=50000kb log4j.appender.file.max

Deadlock in MySQL: engine.log analyze -

how сomprehend reason of deadlock - namely, how find out transactions have captured locks? i have engine.log file following deadlock: ------------------------ latest detected deadlock ------------------------ 170327 11:09:53 *** (1) transaction: transaction 4 2719072253, active 5 sec, os thread id 26215 starting index read ... insert into... (the first transaction) *** (1) waiting lock granted: record locks space id 0 page no 36025889 n bits 96 index `primary` of table `mydb`.`mytable` trx id 4 2719072253 lock mode s locks rec not gap waiting ... *** (2) transaction: transaction 4 2719072205, active 35 sec, os thread id 25564 starting index read, thread declared inside innodb 485 update ... (the second transaction) *** (2) holds lock(s): record locks space id 0 page no 36025889 n bits 96 index `primary` of table `mydb`.`mytable` trx id 4 2719072205 lock_mode x locks rec not gap record lock, heap no 27 physical record: n_fields 72; compact format; info bits 0 ... *** (2)

python - SpaCy: How to get the spacy model name? -

it doesn't show in pip list zeke$ pip list | grep spacy spacy (1.7.3) how name of model? i tried doesn't work echo "spacy model:" python3 -m sputnik --name spacy find throws error: zeke$ python3 -m sputnik --name spacy find traceback (most recent call last): file "/users/zeke/anaconda/lib/python3.5/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) file "/users/zeke/anaconda/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) file "/users/zeke/anaconda/lib/python3.5/site-packages/sputnik/__main__.py", line 28, in <module> main() file "/users/zeke/anaconda/lib/python3.5/site-packages/sputnik/__main__.py", line 12, in main args.run(args) file "/users/zeke/anaconda/lib/python3.5/site-packages/sputnik/cli.py", line 89, in run data_path=args.data_path) file "/users/zeke/anaconda/lib/python3.5/site-packages/sputnik/__init

http - How does Google redirect its search results? -

Image
i input query java search text box on https://www.google.com . 1 result https://en.wikipedia.org/wiki/java_(programming_language) . following text right clicking link , selecting copy link address . https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=10&cad=rja&uact=8&ved=0ahukewiijvlpqvnsahvfqy8khu5udyyqfghdmak&url=%68%74%74%70%73%3a%2f%2f%65%6e%2e%77%69%6b%69%70%65%64%69%61%2e%6f%72%67%2f%77%69%6b%69%2f%4a%61%76%61%5f%28%70%72%6f%67%72%61%6d%6d%69%6e%67%5f%6c%61%6e%67%75%61%67%65%29&usg=afqjcneamdpwkk-lszs-jjsyrwukedrmka&bvm=bv.150729734,d.dgc and paste above link chrome address bar. , use developer tools monitor http network traffic. the first http request original link. , status code 200. how chrome make following request https://en.wikipedia.org/wiki/java_(programming_language) ?i know http response status code 302 can make brsowers following link in location header. how redirect done in case status code 200 ?

spark dataframe - converting udf to an inline lambda in pyspark -

i have dataframe consists of 4 columns. let's it's a, b, c , d. want exclude rows column b has value of 'none' or 'nothing'. know how using udf, i'm curious how in lambda anonymous function instead. my dataframe df, , udf follow: from pyspark.sql.functions import udf def b_field(b_field_value): if b_field_value == 'none' or b_field_value == 'nothing': return true udf_b = udf(b_field, booleantype()) print df.filter(udf_ct(df['b'])).count() i'm trying lambda way, , can't work df.select(df['ct']).filter(lambda x: x == 'none' or x == ''nothing) what did wrong? according spark guide format is: df.filter(df['age'] > 21).show() in case can use 1 of following filter conditions: df.filter((df['ct'] != 'nothing') && df['ct'] != 'none')) where condition (which alias filter ): from pyspark.sql.functions import col df.w

Cannot write to a Microsoft Access file using SQL (OLEDB) C# -

i understand may considered duplicate question, @ impasse , not know doing wrong, need help. duplicate question said use oledb in order write microsoft access file, before using sql connection accomplish task. far can tell there no syntax, logic, or runtime errors , visual studios doesnt have issue either. when run code , go add new entry microsoft access database table, says worked, when go , @ file there nothing there. please me, have goe through links, web pages, search engines, , dont know wrong. love learn wrong , how fix wont ever have ask again. currently college student , working on team assignment. our task, create window take input user , add entry microsoft access file if sql database. the issue having trying add new entry local microsoft access file under table named artist. have connected actual sql server before , no 1 else in group has, worse no 1 has done using microsoft access file on our pc either. i have added database (microsoft access file) in visual st

security - Save user login credential in Android. What is the best way? -

i want in app after user logged in, or signed in, password, , other strings receive server, stored in device. i'm thinking encrypt data whit keys receive keystore. after did that, should save encrypted data? i have read save password in local device not best pratice. should store directly on server? here article read here everything goes on server.when login on device ,store users id(hash on server , return hashed id device).store hashed id of user in shared preferences or in local database.and when want retrieve data(for example user data) send hashed id server ,unshash on server make query.

c++ - how to do boost::asio::spawn with io_service-per-CPU? -

my server based on boost spawn echo server . the server runs fine on single-core machine, not 1 crash several months. when takes 100% cpu still works fine. but need handle more client requests, use multi-core machine. use cpus run io_service on several thread, this: #include <boost/asio/io_service.hpp> #include <boost/asio/ip/tcp.hpp> #include <boost/asio/spawn.hpp> #include <boost/asio/steady_timer.hpp> #include <boost/asio/write.hpp> #include <boost/thread/thread.hpp> #include <iostream> #include <memory> #include <thread> using namespace std; using boost::asio::ip::tcp; class session : public std::enable_shared_from_this<session>{ public: explicit session(tcp::socket socket) : socket_(std::move(socket)), timer_(socket_.get_io_service()), strand_(socket_.get_io_service()) {} void go() { auto self(shared_from_this()); boost::asio::spawn(strand_, [this, self

Is it possible to redevelop jQuery-based website to SAPUI5? -

our webpage based on jquery/jqueryui/dhtmlx , additional small libraries. want me every upcoming developments in sapui5. possible in normal way? there proper workaround that? edit: okay, try refine question. have cca 50000 lines of code in frontend. not rewrite sapui5. intention new additional developments in sapui5. question is: have meaning mix existing libraries new framework? sapui5 contains many third-party libraries , jquery/ui included. when asks redevelop existing app in ui5, expect replace current ui ui5's controls, , make use of ui5 concepts. not see short-cut here, rather doing real re-development. not sure mean "normal way".

regex - What is the best way to handle Nginx rewrite with subdomains? -

i need parse out subdomain , add end of url, example: subdomain.mysite.com needs rewrite subdomain.mysite.com/subdomain subdomain.mysite.com/login needs rewrite subdomain.mysite.com/subdomain/login trouble arises because have set of reserve words don't want match, example various different environments. dev-web.mywebsite.com should not map mywebsite.com/dev-web this have far... struggling nginx syntax , regex in general. if ($host ~ ^([^.]+)\.(.+)) { set $subdomain $1; } if ($subdomain ~* ^(dev-web|uat-web)$) { rewrite ^ $scheme://$host/$subdomain$request_uri permanent; } the various errors many redirects or not redirecting @ all. err_too_many_redirects subdomain.mysite.com/subdomain/subdomain/subdomain/subdomain...

java - How to kill all active processes from Android phone with code in my app? -

hi how kill active processes android phone code in app? read couple of articles how kill running applications in android? , tried code: list<applicationinfo> packages; packagemanager pm; pm = getpackagemanager(); //get list of installed apps. packages = pm.getinstalledapplications(0); activitymanager mactivitymanager = (activitymanager)context.getsystemservice(context.activity_service); log.d("packages" , string.valueof(packages)); (applicationinfo packageinfo : packages) { mactivitymanager.killbackgroundprocesses(packageinfo.packagename); log.d("cleaned" , string.valueof(packageinfo.packagename)); } logcat show me active processes, no of them have closed/nothing happens. yes, have included in manifest: <uses-permission android:name="android.permission.kill_background_processes" /> i there i'm missing?

ember.js - Finding the number of records returned from a conditional statement in ember -

i have unless condition , want find out number of records satisfies unless condition. can or not in ember? edit: {{#each model.orderparts |newcart|}} {{#unless newcart.isgeneric}} <div class="card-wrapper col-lg-12 col-md-12"> <div class="col-lg-2 col-md-2"> <div class="order-id">{{newcart.partnumber}}</div> {{#if (gte newcart.promiseqty newcart.quantity)}} <div class="order-status delivered">{{env.app.stockavailable}}</div> {{else}} {{#if (gt newcart.promiseqty '0'(and (lt newcart.promiseqty newcart.quantity)))}} <div class="order-status delivered">{{env.app.lowinstock}}</div> {{else}} {{#if (eq newcart.promiseqty '0')}} <div class="order-status delivered">{{env.app.outofstock}}</div> {{/if}} {{/if}} {{/if}} </div> <div class="col-lg-3 col-md-3"> <div class="item-head

xamarin.forms - Xamarin Forms: handle multiple item per row -

Image
in xamarin forms want show multiple image (2) in row: example of i'd do: in many q&a i've seen use of xlabs gridview project no longer maintained. i think can create custom cell stacklayout inside row recycle policy work? , how can handle item tapped if have 2 column per row? thanks you can take flowlistview . have never used sounds good. <flv:flowlistview.flowcolumntemplate> <datatemplate> <label horizontaloptions="fill" verticaloptions="fill" xalign="center" yalign="center" text="{binding title}"/> </datatemplate> </flv:flowlistview.flowcolumntemplate>

Managing dependencies of Powershell modules -

i have custom powershell script module, let's call pshandycmdlets . in manifest following line found: requiredmodules = @('<another module not installed yet>') the requiredmodules property supposed guarantee module listed here imported global scope before importing current module. fail if module can't located on machine. does powershell provide mechanism ensuring these modules installed when pshandycmdlets installed? if there isn't, there best practice in place handling scenario?

ionic2 - ionic 2 grid problems with col-* / respnosive -

i've got code <ion-grid> <ion-row wrap> <ion-col col-2> <h3>adresse</h3> </ion-col> <ion-col col-1 offset-1> <h3>telefon</h3> </ion-col> <ion-col col-4> <h3>geb./fam./adelspräd.</h3> </ion-col> <ion-col col-2> <h3>beruf/stellung/titel</h3> </ion-col> <ion-col col-2> <h3>knr/inhaber</h3> </ion-col> </ion-row> </ion-grid> but doesn't col-* attributes, it's described in here https://ionicframework.com/docs/v2/api/components/grid/grid/ can't find called css-classes. there 5 cols same width bet when take width-10, reacts i'm doing. at end, want this <ion-col col-12 col-sm> 1 of 4 </ion-col> to responsive. thanks help! you should use width-10

android - Speeding up Ip Scanner with ExecutorService reporting wrong ips -

i'm working on ip scanner scan local net live hosts. implementation uses asynctask run in background , excutorservice create pool thread faster results; however, i'm getting wrong ips. eg ips not exist on network. implementing right? how spawn multiple runnable threads , @ same time update right output. thanks /* * ascyntask scan network * should try different timeout network/devices * try detect localhost ip addres , subnet. * use subnet scan network */ private class taskscannetwork extends asynctask<void, node, void> { string subnet; static final int lower = 1; static final int upper = 254; static final int timeout = 1000; private executorservice ipscanpool; @override protected void onpreexecute() { log.v("ip address: ", ip); subnet = ip.substring(0, ip.lastindexof(".")); hostlist.clear(); scanprog

xamarin - mvvmcross ios lock portrait orientation for specific MvxViewController -

i have solution in xamarin mvvmcross support ios portrait , landscape screen orientations. ios 8.0 add new mvxviewcontroller lock on portrait mode. searched in internet examples ios swift, xamarin forms of not applied mvvmcross solution there way how can lock portrait mode 1 screen xamarin mvvmcroos? thank you this no different normal viewcontroller. public override bool shouldautorotate() => false; public override uiinterfaceorientationmask getsupportedinterfaceorientations() => uiinterfaceorientationmask.portrait;

vue.js - How can I use vue-router's Navigation Guards with Vuex and VueJs 2? -

following store: export const store = new vuex.store({ state: { currentuser: null }, getters, mutations, actions }); this loginuser() action: loginuser(context, payload) { return new promise(function(resolve, reject) { auth.emailsignin({ email: payload.email, password: payload.password }) .then(function(resp){ context.commit('setcurrentuser', resp.data); resolve(); }); }); } this changes currentuser state through mutation. after user logged in trying redirect him home page following method in vue component: methods: { loginuser(){ var = this; this.$store.dispatch({ type: 'loginuser', email: this.email, password: this.password }).then(function(){ that.$router.push('/'); }); } } so guarding home route following beforeeach method: router.beforeeach((to, from, next) => { if (t

python - One figure to present multiple pie chart with different size -

Image
the figure above illustration of purpose. it's easy plot pie chart in matplotlib. but how draw several pie in 1 figure , size of each figure depend on value set. any advices or recommandation appreciate! you can use add_axes adjust size of axes plot. also, there radius parameter in pie function can use specify radius of pie plot. check code below: labels = 'frogs', 'hogs', 'dogs', 'logs' fracs = [15, 30, 45, 10] fig = plt.figure() ax1 = fig.add_axes([.1, .1, .8, .8], aspect=1) ax1.pie(fracs, labels=labels) ax2 = fig.add_axes([.65, .65, .3, .3], aspect=1) # can adjust position , size of axes pie plot ax2.pie(fracs, labels=labels, radius=.8) # radius argument can used adjust size of pie plot plt.show()

NoSQL database json structure for an event booking system -

first time designing database nosql , wondering if following structure project? { "events":{ "e2017":{ "name":"event 2017", "date":"1490567256550" } }, "eventsections":{ "e2017":{ "e2017-a":{ "name":"a", "isfull":false, "totalseats":40, "bookedseats":20 } } }, "sectionseats":{ "e2017-a":{ "a1":{ "isbooked":true, "bookedby":"$userid" }, "a2":{ "isbooked":false, "bookedby":false } } }, "eventseatmap":{ "e2017-a":{ "x":10, "y":10, "r":0 } } } b