Posts

Showing posts from September, 2012

arithmetic or geometric sequence in python -

do know how can write code in python including function takes list , find out if arithmetic or geometric? wrote code boolean , doesn't arithmetic or geometric , has output. l=[int(x) x in input("please enter list:").split()] def arithemetic(l): i=1 if(l[0]+l[i]==l[i+1]): return true i+=1 def geometric(l): i=1 if(l[0]*l[i]==l[i+1]): return true i+=1 def isarithemeticorgeometric(l): if(arithemetic(l)): print(arithemetic(l)) elif(geometric(l)): print(geometric(l)) print(isarithemeticorgeometric(l)) there few mistakes here, try go on them 1 one asking list l=[int(x) x in input("please enter list:").split()] this throw valueerror when gets fed non-numeric type. round float int problem 1 can solve surrounding while loop , try-catch block while true: try: l=[int(x) x in input("please enter list:").split()] break except valueerror: pass the problem int can solve

How to customize workflow in VSTS online? -

i've read msdn docs, cannot find way edit work item transitions in vsts online. i'm trying to: add custom reason state of work item. (e.g. "resolved", "won't fix") see/edit existing rules how states transition. neither of things appear possible @ moment. the vsts process customisation different tfs , still evolving. #1 seems might added in future update. #2 doesn't seem appear, microsoft have relaxed of transition rules on templates on vsts default.

c++ - Segmentation fault when declaring a vector -

i'm writing programme 2 classes: class sequence { protected: vector<int> seq_; public: sequence(){ for(int i=0; i<16;i++) seq_.push_back(0); }; sequence(int a, int b,int c){ for(int i=0; i<16; i++) seq_.push_back(a*i+b*i*i+c*i*i*i); }; sequence(const sequence & myseq){ for(int i=0; i<16;i++) seq_[i]=myseq.get_i(i); }; int get_i(int i)const{ return seq_[i]; }; void print() const { for(int i=0; i<16; i++) cout<<seq_[i]<<endl; }; int operator*(sequence & myseq) const { int sum=0; for(int i=0; i<16;i++) sum+=seq_[i]*myseq.seq_[i]; return sum; }; void operator=(sequence & myseq) { for(int i=0; i<16; i++) seq_[i]=myseq.seq_[i]; }; };

reactjs - Import react-mdl -

please help, trying import react-mdl project import react 'react'; import icon 'react-mdl/lib/icon'; export default class test extends react.component { render() { return ( <div> <icon name="add" /> </div> ); } }); i error, can not understand why enter image description here how fix error? install react-mdl using: npm install --save react-mdl use import icon : import { icon } 'react-mdl';

AngularJs - show-hide password on click event using directive -

i have 1 input field password , 1 button input field now, if type of input field password i.e type="password" , on click of button should become text i.e type="text" if again click on same button should change type="password" means should toggle value of type of input element i have done using controller, it's working fine controller. below working code using controller but instead of controller if want use directive how handle toggle condition using directive purpose - want use functionality on multiple input elements html <div class="input-group"> <label>password</label> <input type="{{inputtype}}" class="form-control" ng-model="password" /> <span ng-click="show()">show</span> </div> controller $scope.inputtype = 'password'; $scope.show = function() { if ($scope.inputtype === 'password') { $scop

php - How to set a value fetched from database table as selected value in drop down list in cakephp? -

hey trying set selected="selected" drop down list cant seem solution. e.g.. city entered in user's table when user chooses edit profile rest of details comes in text boxes city should displayed in drop down list , default selected value should match city of user. note :- citites entered directly in echo $this->form->input("city",array("type"=>"select","empty"=‌​>"city","options"=>a‌​rray("city1"=>"city1‌​","city2"=>"city2","‌​city3"=>"city3","cit‌​y4"=>"city4"))); you can use default make option selected in cakephp try this: echo $this->form->input('city', array('type' => 'select', 'options' => array("city1"=>"city1‌​","city2"=>"city2","‌​city3"=>"city3","cit‌​y4"

Leaflet v1.03: Make CircleMarker draggable? -

does leaflet guru has idea, what's easiest way make circlemarker draggable in leaflet v1.0.3 ? it's easy "standard" markers using "draggable" -option. such option doesn't exist circlemarker. tried using several events, problem is, not marker being moved underlying map. another possibility use of "stoppropagation" -function (but domevents). or use of "removeeventparent" ... if "parent" of circlemarker map , events? regarding documentation there domutility/draggable -class. need? <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>draggable markers</title> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.j

parse.com - Parse SDK - similarTo type of query -

i have app in ios , android , i'm getting user's location in both of them! corelocation ios , google maps in android... after location retrieval, apply reverse geocoding, locality out of them... once do, perform equalto queries find photos of specific location... the thing is, there occasions locality of ios, different android's! example, "palaiochori" in ios , "paleochori" in android! observe 2 letters different! so, whereas location same in both devices, equalto query fail! what want know, if there way create type of query, don't check equality. instead, check similarity! notice, use cloud code, server-side solution acceptable , preferred!! clearly location name can not guarantee uniqueness. 2 possible solutions: ensure consistency of database store geopoint these locations. when have palaiochori in database , user finds himself in paleochori , before saving new object , run wherenear() query see if have near places lo

android - ClasscastException in LauncherActivity -

i getting classcastexception when launching app problem in taxitwinapplication app = (taxitwinapplication)getapplication(); activity trying call method other class public class launcheractivity extends activity { @override public void oncreate(bundle icicle) { super.oncreate(icicle); intent intent; taxitwinapplication app = (taxitwinapplication)getapplication(); app.register(); switch (taxitwinapplication.getuserstate()) { case not_subscribed: case subscribed: intent = new intent(this, mainactivity.class); intent.addflags(flag_activity_new_task | flag_activity_clear_task); break; case participant: intent = new intent(this, mytaxitwinactivity.class); intent.addflags(flag_activity_new_task | flag_activity_clear_task); break; case owner: intent = new intent(this, mytaxitwinactivity.class); intent.addflags(flag_activity_new_task | fl

c++ - Run process as Local System -

i have regular program running administrator process. doesn't quite have privileges need. how elevate process run local system account ? i don't want use externals tools achieve elevation. ideal if call win32 functions achieve it. willing write , run windows service in order pass privileges onto process in question. someone please give me clue. searches sending me round , round in circles. program sends session id service service calls openprocesstoken , duplicatetokenex create local system token service calls settokeninformation change token session id match program's service calls duplicatehandle create handle token service sends handle program program calls setthreadtoken using received handle the program have @ least 1 thread local system privileges. adequate purpose.

mysql - how to apply join query using SQL -

i have 2 tables in mysql database. the first table 'property' columns (id(pk), title, description, status) the second table 'object_property' in relations between object , property stored , relation value, having columns (id(pk), object_id, property_id(fk reference column 'id' of property table), value) now want extract result of properties 'property' table relation doesn't exist in 'object_property' table. i need write sql join query this... can me out? new sql. thanks! if writing raw query run directly in mysql use following left join : select p.* property p left join object_property op on p.id = op.property_id op.property_id null if writing query in hql, dealing entities (java pojos) representing tables, rather tables themselves. can offer following hql query: from property p left join p.objectproperty op op null this assumes have class called property represents property table. assumes object_pro

javascript - d3: how to snap mouse over cursor to existing data points -

in following snippet (based on answer of @gerardo furtado d3 multi line mouse on cursor both y , x value ) mouse on cursor interpolating values between data points. how possible cursor shows values real data points? <!doctype html> <html> <head> <script data-require="d3@3.5.3" data-semver="3.5.3" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.js"></script> <style> body { font: 10px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispedges; } .x.axis path { display: none; } .line { fill: none; stroke: steelblue; stroke-width: 1.5px; } </style> </head> <body> <script> var mydata = "date new york san francisco austin\n\ 20111001 63.4 62.7 72.2\n\ 20111002 58.0 59.9 67.7\n\ 20111006 58.8 57.0 77.0\n\ 2

How split a pandas dataframe in muliple excel files -

i have data frame sales related different countries. need crate different excel each of country have in dataframe. not sure how can accomplish in pandas consider dataframe df df = pd.dataframe(dict( sales=[1, 2, 3, 4], country=['jp', 'cn', 'uk', 'au'] )) print(df) country sales 0 jp 1 1 cn 2 2 uk 3 3 au 4 we can iterate through groupby object , use to_excel for n, g in df.groupby('country'): # `n` group name, country g.to_excel('{}.xlsx'.format(n)) this have created files ['au.xlsx', 'cn.xlsx', 'jp.xlsx', 'uk.xlsx']

java - Hadoop Word count - Compare multiple text files' contents with a list of words -

i write program using hadoop , mapreduce. the objective of program read ten text files , detect if content contains top 100 common letters. if there is, counter word increases 1. the final output needs below: file 1: 1,2,3,4.... (where 1 stands frequency of first word in top 100 common word list ,2 stands frequency of second word in top 100 common word list...) file 2: 5,6,10,9.....(where 5 stands frequency of first word in top 100 common word list ,6 stands frequency of second word in top 100 common word list...) etc below complete code.yet, 1 output result 0. why wrong? can me? many thanks import java.io.ioexception; import java.util.arrays; import java.util.hashmap; import java.util.list; import java.util.stringtokenizer; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.intwritable; import org.apache.hadoop.io.longwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.job; import

ruby - how to call class method in rspec -

i have following class method module abc class def class << self include ghi::lmn def mymethod(*args) puts 'class method' def value @value.nil? ? 'test' << name : @value end end end end now how can write test cases method call method mymethod? here's link on how call class method rspec . create call class method in rspec itself: class foobar def initialize(foo, bar) @foo = foo @bar = bar end def output puts @foo puts @bar end end describe foo context bar subject { foobar.new(<info>).output } # create instance of class in rspec end end

swift - Can Swifter be used for a tvOS app? -

i trying access twitter data social media app tvos school project. have come across swifter ( https://github.com/mattdonnelly/swifter ) , noted supports ios , mac. wondering if there workaround use in tvos since written in same language? (as can tell i'm pretty new this) looking @ issues in repo appears working on adding tvos support might ready in time you. in fact, may have done it: https://github.com/kindoblue/swifter

javascript - why parent is not working in jquery? -

could please tell me why parent function not working ? here code https://jsbin.com/gefacenefi/edit?html,js,output $(function () { $('.add').click(function () { $('.item').parent('li.nn').css('color', 'red'); }); }); expected output text red <li class="nn">bhiooo</li> please following: $(function () { $('.add').click(function () { $('.item').parent().siblings('li.nn').css('color', 'red'); }); }); also not closing li element properly. structure should following: <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>js bin</title> <script src="https://code.jquery.com/jquery-2.1.4.js"></script> </head> <body> <button class="ad

domain driven design - How to build complex value-object? -

i have started learn ddd. apologise silly question... so have post entity. looks fine. should have tags . in code looks (ruby code): class post attr_reader :tags attr_reader :title attr_reader :text # ... end class tag attr_reader :name attr_reader :description # ... end tags aren't make sense entity. don't need tag itself. how should implement repository post? have found 2 variants: 1. build tags in same repository. this: # postrepository def find(id) # getting post data storage here # getting tags data post.new(title, text, tags_data.map { |tag_data| tag.new(tag_data[:name], tag_data[:description])) end but looks ugly. can't why. 2. make separate repository tags. # postrepository def find(id) # getting post data storage here post.new(title, text, tag_repository.find(tag_ids)) # or tag_names or tag_something end looks better. fine make separate repository value-objects? what right way according ddd? upd: in other hand

javascript - Jquery array send by ajax to php -

i viewed many post aboit still cant code work. i want php array of checked checkboxes values. heres code: <!doctype html> <html> <head> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <title>untitled document</title> </head> <body> <?php echo'<form method="post"> <input type="checkbox" name="cim" value="valami">'; echo'<input type="checkbox" name="cim" value="valami2">'; echo'<input type="checkbox" name="cim" value="valami3">'; echo'<input type="checkbox" name="cim" value="valami4"> <input type="submit" value="felvisz" name="feladat"></form>'; if (isset($_post['feladat'])) { ?

eclipse - Filter order and web.xml content -

well, straight point: created - eclipse - 2 filters (filter1 , filter2) , servlet(displayheader) see filter order of execution. used tomcat 8.5 target runtime. new/dynamic web project/ context root / , checked "generate web.xml delpoyment descriptor" filter1 prints "i'm filter 1" when it's executed, , "linked" specific servlet "displayheader". filter2 it's twin brother 2 instead of 1. displayheader servlet mapped /displayheader. below filter1 code clarity import java.io.ioexception; import javax.servlet.*; import javax.servlet.annotation.webfilter; @webfilter( urlpatterns = {"/filter1"}, servletnames = {"displayheader"} ) public class filter1 implements filter { /** * default constructor. */ public filter1() { // todo auto-generated constructor stub } /** * @see filter#destroy() */ public void destroy() { // to

r - Combining multiple summary tables with subheadings -

Image
i have data several demographic factors. i trying create publication-quality summary table this: n sex m 150 f 150 marital status single 100 married 100 divorced 100 age <25 75 25-34 75 35-44 75 >= 45 75 i can generate each individual piece of this, so: require(dplyr) dd <- data.frame(barcode = c("16929", "64605", "03086", "29356", "23871"), sex = factor(c("m", "f", "m", "f", "m")), marital = factor(c("married", "single", "single", "single", "divorced")), age_group = factor(c("<25", "25-34", "35-44", "45-54", ">= 55"))) require(dplyr) age_groups <- dd %>% group_by(age_group) %>% count()

git - How to download a github json -

i have problem, try download json generated url https://api.github.com/repos/xxxx/xxxx/contents/xxxxxxx?ref=master i have json result that [ { "name": "xxxx.png", "path": "xxxx/xxxx.png", "sha": "8b33da362caab310626daa2b70b232a98b38c6db", "size": 136356, "url": "https://api.github.com/repos/xxxx/xxxx/contents/xxxx/xxxx.png?ref=master", "html_url": "https://github.com/xxxx/xxxx/blob/master/xxxx/xxxx.png", "git_url": "https://api.github.com/repos/xxxx/xxxx/git/blobs/8b33da362caab310626daa2b70b232a98b38c6db", "download_url": "https://raw.githubusercontent.com/xxxx/xxxx/master/moduleinfosjson/xxxx.png", "type": "file", "_links": { "self": "https://api.github.com/repos/xxxx/xxxx/contents/xxxx/xxxx.png?ref=master", "git":

java - How to check a jlabel array is full? -

this 1 shows validation popup if of labels full. want change shows error message if of jlabels full. //check see if car park full void checkfull() { for(int = 0; < parkingspace.length; i++) { if (parkingspace[i].geticon() != null) { joptionpane.showmessagedialog(null, "sorry car park full!"); } } } you have reverse logic of loop. if find empty space, there's no problem (return). @ end of loop, if haven't returned, have no spaces left //check see if car park full void checkfull() { for(int = 0; < parkingspace.length; i++) { if (parkingspace[i].geticon() == null) { return; } } joptionpane.showmessagedialog(null, "sorry car park full!"); }

c# - How to Send Mail at 10 AM every using hangfire scheduler library ASP.NET Web Forms -

how send mail @ 10 automatically every day using hangfire scheduler library , installed hangfire dll also. below c# code. protected void page_load(object sender, eventargs e) { if (!ispostback) { backgroundjob.schedule( () => sendmail1(), new datetime(2017, 03, 27, 10, 00, 00)); } } } public void sendmail1() { //mailer content } please out issue send 10 every day , if other way helpful. your requirement send email everyday 10 means it's recurring task want schedule. case backgroundjob class not 1 should use. need use recurringjob class. if visit http://hangfire.io/ can located easily. further exploration handfire library classes have explained methods available recurringjob class. recurringjob class has method addorupdate , 1 of overloads takes 4 arguments out of last 2 optional. public static void addorupdate(expression<func<task>> methodcall, string cronexpression, timezoneinfo tim

python - Performance of pyomo to generate a model with a huge number of constraints -

i interested in performance of pyomo generate or model huge number of constraints , variables (about 10e6). using gams launch optimizations use different python features , therefore use pyomo generate model. i made tests , apparently when write model, python methods used define constraints called each time constraint instanciated. before going further in implementation, know if there exists way create directly block of constraints based on numpy array data ? point of view, constructing constraints block may more efficient large models. do think possible obtain performance comparable gams or other aml languages pyomo or other python modelling library ? thanks in advance ! while can use numpy data when creating pyomo constraints, cannot create blocks of constraints in single numpy-style command pyomo. fow it's worth, don't believe can in languages ampl or gams, either. while pyomo may support users defining constraints using matrix , vector operations, not th

r - How to convert rows into columns using dplyr -

this question has answer here: solidifying melted data frame? 3 answers spreading 2 column data frame tidyr 4 answers i have following data frame (tibble): library(tidyverse) lines<-" a,foo,9394981 b,bar,6826405 c,qux,1074885 d,gop,1493691 a,foo,100 b,bar,200 c,qux,300 d,gop,400 " con <- textconnection(lines) dat <- read.csv(con,header=false) close(con) dat <- as.tibble(dat) dat which looks this: # tibble: 8 × 3 v1 v2 v3 <fctr> <fctr> <dbl> 1 foo 9394981 2 b bar 6826405 3 c qux 1074885 4 d gop 1493691 5 foo 100 6 b bar 200 7 c qux 300 8 d gop 400 how can covert to: foo bar qux gop 9394981 6826405 1074885 1493691

Android json parse with Retrofit library -

i found following json formated file . possible parse retrofit ? json has key , value each section here 1 array has key , others array has values . how parse ? { "insertnewdatas": { "columns": [ "id", "operatorname", "latitude", "longitude", "location", "address", "currencies", "exchange", "exchangelimits", "workingdays", "link", "phone", "email", "datetime", "created_at", "updated_at" ], "records": [ [ 3, "coin source", "22.3475", "91.8123", "chittagong", "oxygen , chittagong", "cash", "option2", "$500/month", "30&qu

javascript - Use data from two locations in Firebase, reading data simultaneously -

i want read data 2 database locations, , use these bits of data in function. way doing this: firebase.database().ref('/data/').once('value').then(function(data1) { firebase.database().ref('/datatwo/').once('value').then(function(data2) { //here can use data1.val() , data2.val() }); }); however, understand begins reading /otherdata after first piece of data has finished retrieving. there way simultaneously download these 2 pieces of data , use them in function 1 both complete? thanks use promise.all() : promise.all([ firebase.database().ref('/data/').once('value'), firebase.database().ref('/datatwo/').once('value') ]).then(function(results) { var data1 = results[0], data2 = results[1]; //here can use data1.val() , data2.val() });

ios - multiple autorenewable subscription for dynamic services -

i working on ios app, user can purchase monthly auto renewable subscription consultation, provided doctor. in app, user can purchase such subscription multiple doctors @ same time. moreover, doctors not pre-defined, keep onboarding app independent signup , patient starts subscribing them on monthly autonewable subscription basis. i have 2 questions here: can use payment gateway here or need go iap? if have go iap? apple provide such model? thanks

python - How to make matplotlib clipping to work on plot generated by rbf -

Image
i use patch on plot show points in circle, problem using image generated rbf , not work. here last code tried : from scipy import interpolate import numpy np import matplotlib.pyplot plt import matplotlib.patches patches x, y, z = 10 * np.random.random((3,10)) xi, yi = np.linspace(x.min(), x.max(), 100), np.linspace(y.min(), y.max(), 100) xi, yi = np.meshgrid(xi, yi) rbf = interpolate.rbf(x, y, z, function='linear') zi = rbf(xi, yi) fig1 = plt.figure(figsize=(4, 4), facecolor='white') ax = fig1.add_subplot(111) ax.imshow(zi, vmin=z.min(), vmax=z.max(), origin='lower', extent=[x.min(), x.max(), y.min(), y.max()]) = ax.scatter(x,y) patch = patches.circle((1,1),radius=1,fc='none') ax.add_patch(patch) something.set_clip_path(patch) fig1.show() i getting following result, can see values showed in whole rectangle, not in circle: if set position , radius of circle such includes points random set, work expected. clip imag

android - Real-time watch /dev file in a tail -f fashon -

i have andriod-based device has physical button on it, , it's state can read via file: /sys/class/gpio/gpio8/value 1 or 0 (a "device file"? there a special word kind of file?). i want know if there way watch file, without polling. know watch small interval, seems bad practice me/there has way. then next step determine how pipe android application. it worth noting not believe these buttons integrated android sensors api/lib, otherwise use that i looking direction on how proceed. there no way watch button state aka when button pushed , circuit completed, there no event pushed os, os has poll. thanks! if gpio driver supports pollable attributes via sysfs_notify() mechanism can use poll() in program wait state change. know 2 ways how check this: a) read driver's source code , b) make test , see if works you. some upcoming sysfs enhancements

c# - Restsharp: Underlying connecion has been closed -

i having trouble using restsharp client in windows service. when api down connection lost. once api runs again, rest client keeps throwing same error. if set new instance of restclient. anyone same problem , working solution or proposal? i'm colleague of ludwig. our application starts , connects api, application keeps running , calling api. when api down (restarted) our application gets error: the underlying connection closed: connection expected kept alive closed server , call initodataclient , readconfigasync functions recreate restclient. when api running again expected restclient work again keep getting: the underlying connection closed. not establish secure channel ssl/tls when restart our application works again. there no certificate problems. seems creating new restclient object uses old (invalid) connection of code use: private restclient restclient; private void initodataclient() { restclient = new restclient(options.baseurl); re

Extracting a portion of a string then using it to match with other strings in Powershell -

i asked assistance parsing text file , have been using code script: import-csv $file -header tag,date,value| {$_.tag -notmatch '(_his_|_manual$)'}| select-object *,@{name='building';expression={"{0} {1}" -f $($_.tag -split '_')[1..2]}}| format-table -groupby building -property tag,date,value i've realized since that, while code filters out tags containing _his or _manual , need filter tags associated _manual . example, following tags present in text file: l01_b111_buildingname1_mainelectric_111a01me_alc,13-apr-17 08:45,64075 l01_b111_buildingname1_mainelectric_111a01me_cleansed,13-apr-17 08:45,64075 l01_b111_buildingname1_mainelectric_111a01me_consumption,13-apr-17 08:45,10.4 l01_b333_buildingname3_mainwater_333e02mw_manual,1-dec-16 18:00:00,4.380384e+07 l01_b333_buildingname3_mainwater_333e02mw_cleansed,1-dec-16 18:00:00,4.380384e+07 l01_b333_buildingname3_mainwater_333e02mw_consumption,1-dec-16 18:00:00,25.36 the 333e0

Python - For every value in text file? -

with code writing, have split text file using commas, , each value in there, want make integer. have tried splitting text file , turning integer not work. there way of saying values in file, thing? also, amount of values isn't concrete, depends on user of programme (it 'shopping list' programme. current code: totalcosts=open("totalcosts.txt","r") prices=totalcosts.read() print(prices) prices.strip().split(",") intprices=int(newprices) print(len(intprices)) if len(intprices)==1: print("your total cost is: "+intprices +" pounds") elif len(intprices)>1: finaltotal = sum([int(num) num in intprices.split(",")]) print("your total cost is: "+ finaltotal +" pounds") prices file values contained in, i've stripped of whitespace , split it. need continue on from. thank xx results = [int(i) in results] python 3 can do: results = list(map(int, results))

elixir - Read files in Phoenix in production mode -

i've phoenix app (i created --api flag) has additional data required process requests store in priv/data/filters.csv . so works fine in dev mode, can read file like: file.stream!("priv/data/filters.csv") , once app delivered using mix edeliver update file not accessible anymore. i can see folder in build directory, after app delivered there no such folder priv . i'm not sure why it's not copied deliver folder. what i'm doing wrong? need copy these files after deliver process? can store files have use in prod mode? you should use :code.priv_dir/1 absolute path priv directory of application @ runtime. work erlang releases created e.g. distillery: file.stream!(path.join(:code.priv_dir(:my_app), "data/filters.csv")) for me, after doing mix_env=prod mix release , file priv/foo copied _build/prod/lib/my_app/priv/foo .

php - Load local host URL in 2nd tab runs 1st tab to same URL faster. Why? -

when single tab open url: http://localhost/soccer/public/index.php and second tab open http://localhost/soccer/public/games.php if first tab taking long time, (3 seconds or more) , execute/load going 2nd tab , reloading/refreshing causes 1st tab load "instantly". i can't understand why loading different tab force 1st tab load faster. browser latest chrome. wamp set running php 7. the url can change 1 of local sites have , results same; refreshing 2nd tab loads 1st tab immediately. thanks shedding light on curiosity. code tax: $query = "show tables"; $stmt = $con->prepare($query); $r = $stmt->execute(); echo "completed";

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

sql - TSQL Dynamic Pivot -

i have "small" issue pivot sql script. have based current solution on similar question here dynamic pivot . i have managed write pivot script , largely ok. however, situation this, instead of getting unique entries onto single rows, script outputs this listingentryid address employees location 1 null null nottingham 1 canal street null null 1 null 3 null 2 null null london 2 camden null null 2 null 12 null whereas results looking should listingentryid address employees location 1 canal street 3 nottingham 2 camden 12 london here's script declare @listingid int = 1; declare @cols nvarchar(max), @query nvarchar(max) select lev.listingcolumnid, lev.listingentryid, le.createdby, lev.entryvalue,

Warning: mysqli::query(): Empty query in C:\xampp\htdocs\admin\setswim.php on line 13 -

i tried update datas form in edit1.php setswim.php gives error : warning: mysqli::query(): empty query in c:\xampp\htdocs\admin\setswim.php on line 13 edit1.php <html> <body> <center> <?php $d=$_get['id']; include "includes/db.php"; if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } if ($result = $con->query("select * students student_number='".$d."'")) { if ($result->num_rows > 0) { while ($row = $result->fetch_object()) { $number= $row->student_number; $n= $row->student_name; $d= $row->s