Posts

Showing posts from August, 2010

How to append a column data to a MAX Aggregate function in SQL? -

column names: name , reading , channel , time i'm trying find max value each distinct name . each name has many values read on time interval of once every hour. goal pick out max value each distinct name , record time interval occurred in. so far have gotten code: select name, max(reading) "max_reading", data, channel, time interval_data group name, data, channel however, gives me error saying time has aggregated or grouped by. there easy way append time max value occurred @ output , not have perform grouped by/aggregate function on column? sample data: name reading data channel time 1 1 1 1 1/15/2015 09:00 1 3 1 1 1/15/2015 10:00 1 2 1 1 1/15/2015 11:00 1 5 1 1 1/15/2015 12:00 2 2 1 1 1/15/2015 09:00 2 4 1 1 1/15/2015 10:00 2 6

python - Tornado - What is the difference between RequestHandler's get_argument(), get_query_argument() and get_body_argument()? -

when use requesthandler.get_argument() , requesthandler.get_query_argument() , requesthandler.get_body_argument() ? what use-case each of them? also request.body , request.argument in these cases? used in scenarios? and, there request.query or similar too? most http requests store parameters (say, form values) in 1 of 2 places: url (in form of ?foo=bar&spam=eggs query string ), or in request body (when using post request , either application/x-www-form-urlencoded or multipart/form-data mime type ). the request.get_query_argument() looks url parameters, requesthandler.get_body_argument() lets retrieve parameters set in post body. requesthandler.get_argument() method retrieves either body or url parameter (in order). you use request.get_argument() when explicitly don't care parameter comes , endpoint supports both , post parameters. otherwise, use 1 of other methods, keep explicit parameters come from. the request.get_*_argument methods use r

node.js - End of multiple streams (stream inside loop) -

im working on project , have compress several directories, , use compressed files call function. that, i'm using https://github.com/npm/fstream , https://github.com/npm/node-tar libraries. var fstreamr = require('fstream').reader; var fstreamw = require('fstream').writer; var tar = require('tar'); (var comp in components){ // in order build images docker api, directory // containing dockerfile , code must compressed // tar. var fr = fstreamr({'path':components[comp],'type':'directory'}) var fw = fstreamw({'path':'../../'+comp+'.tar'}) fr .pipe(tar.pack()) .pipe(fw) fw.on('finish',function(){ //do }) } so comp changes in each iteration , create new tar file. problem need tar completed before calling function uses it. i have 2 issues here. first one: callback @ event listener event 'finish' never called. the second

assembly - Intel Xed: Suppress Disassembly output -

i using intel xed (intel's encoder/decoder) decode , encode application's instructions within intel's pin tool (binary rewriter). when output disassembly in pin syntax mode set xed, lot of output need. example: test disp_width:8, easz:2, eosz:2, has_modrm:1, hsw, imm_width:8, imm0signed, imm0:0x1 i opcode followed operands in xed format xed encoder can read in disassembly , encode it.is there way can suppress output? or opcode , operands separately in relatively pain-free manner? any appreciated. cheers, danny

c# - Problems creating a round UIImageView with Storyboard [Xamarin] -

Image
i facing weird problem , sure oversee obvious: want round image this: i perform following action round corners of uiimageview: testimage.layer.cornerradius = testimage.frame.size.height * 0.5f; testimage.clipstobounds = true; in storyboard imageview has constraint left , right of 60, top 92 , aspectratio of 1:1. however, when run app receive following on iphone 6plus: i played bit around cornerradius , produce required circle 100 on iphone 5, 125 on iphone 6 , 150 on iphone 6plus. when generate code this: var testimage = new uiimageview(new coregraphics.cgrect(0, 0, 150, 150)); testimage.image = uiimage.fromfile ("kitten.jpg"); testimage.layer.cornerradius = testimage.frame.size.height * 0.5f; testimage.clipstobounds = true; view.add (testimage); i expected result: am doing wrong storyboard? thanks in advance! i've double-checked in xcode, i'll put in answer: in first instance

html - Change angular-material for a $mdDialog -

Image
i want remove gray background when hover on 'yes' , 'no' buttons of $mddialog . have managed change color of text changing in angular-material.css . ideas? here pic of 'no' , 'yes' buttons referring to: first of all, not modify original sources of library. once decide update newer version, of changes lost. better practice override original styles own. in order that, create separate css file , add site after angular-material.css . to modify background color of buttons in dialog, need following code: md-dialog .md-button:not([disabled]):hover { background-color: transparent !important; } .md-button:not([disabled]):hover class responsible styling hover color of md-button controls. in case, !important needed override original color of buttons. finally, md-dialog @ beginning ensures styles applied inside dialogs. update 1 - alternative solution another more complicated solution creating custom confirmation dialog. way can c

c++ - MSB6001: Invalid command line switch for "cmd.exe". | Qt + Windows Phone RT -

hi i've got problem visual studio express 2013. when want compile code drive me crazy. beacause serching solution of error: error 1 error msb6001: invalid command line switch "cmd.exe". illegal characters in path. c:\program files (x86)\msbuild\microsoft.cpp\v4.0\v120\microsoft.cppcommon.targets 170 5 tablicechemiczne i can compile code using qt , deploy on device. app looks great cannot deploy shop. 1 reason of assets file not avaible during developer console: package acceptance validation error: following image(s) specified in appxmanifest.xml of 13084artmetic.tablicamendelejewa-artmetic_1q966j2m0cjrj.appx not found: assets/logo_71x71.png, assets/logo_150x150.png, assets/logo_71x71.png, assets/logo_310x150.png, assets/logo_480x800.png but in fact in package, because found manually. , second reason cannot add signature package: package acceptance validation error: package 13084artmetic.tablicamendelejewa-artmetic_1q966j2m0cjrj.appx uses incorrect h

caching - Why does cache write-back happen the way it does? -

wikipedia says: when system writes data cache, must @ point write data backing store well. why? course note's don't justify this. component processor interested in what's in cache? apparently mirroring isn't urgent, can postpone the writes... the timing of write controlled known write policy. there 2 basic writing approaches: ... write-back (or write-behind): initially, writing done cache. write backing store postponed until cache blocks containing data modified/replaced new content. so it's postponed until it's about replaced ? how make sense -- you're mirroring information know change! why not when blocks added ? let's assume talking cpu caches. actually, following rules true types of write-back caches (e.g. databases , like). one goal of caches make use of temporal locality : small number of memory addresses written ("hot" addresses), while other addresses "cold". example of &quo

Android can't run simple onTextChange code -

public class mainactivity extends appcompatactivity { private edittext addresstextbox; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); addresstextbox = (edittext) findviewbyid(r.id.edittext); addresstextbox.addtextchangedlistener(addresswatcher); } private final textwatcher addresswatcher = new textwatcher() { @override public void beforetextchanged(charsequence s, int start, int count, int after) { } @override public void ontextchanged(charsequence s, int start, int before, int count) { addresstextbox.settext("dsa"); } @override public void aftertextchanged(editable s) { } }; } when change text shows application isn't responding wait/close. why happen , how can fix that? what s stand in ontextchanged method? i might wr

javascript - Update form field based upon another form field -

i have form field, called customer. have 2nd form field called "gatecode". want able select customer(which works right via autocomplete script), , upon select of existing customer, auto-populate corresponding "gatecode" customer. possible? right happens 2nd form field blank upon load, , overwrites "gatecode" whenever form saved. corresponding customer code : <input data-type="customername" value="<?php echo isset($invoice['client']['customername']) ? $invoice['client']['customername']: ''; ?>" type="text" class="form-control" id="clientcompanyname" placeholder="company name"> gate code <input type="text" class="form-control" id="customer_gatecode_modal" name="customer_gatecode_modal" placeholder="gate code"> current jquery code : $('#clientcompanyname').autoc

java - Swing: Visual interface connect to second frame -

i have 2 frames. want first frame open second. tried this, leads exception. class aboutaction implements actionlistener { public void actionperformed(actionevent e) { frame.dispose(); aboutinfo = new aboutinfo(); about.frame.setvisible(true); } } about.addactionlistener(new aboutaction()); this full program: https://github.com/zhelyazkov97/fuel-calculator.git . you're basic problem nullpointerexception create misunderstanding of how swing works , bad design. basically, define class as... public class aboutinfo extends jframe { private jpanel contentpane; javax.swing.jframe frame; now, here confusion starts, have 2 frames, ever add components instance of aboutinfo . the basic answer here is, rid of frame , it's confusing issue. in fact, shouldn't extending jframe in first place, should use jpanel , add instances of class instances of jframe or jdialog or ever container want

php - Why can't I access textarea id's after parsing array -

i'm loading multiple clients on page, each record own <textarea> . set each <textarea> client's clientid. if(isset($_post['loaddata'])){ try{ $stmt = $db->prepare('select clientid, fname, lname clients memberid = :memberid , groupid = :groupid order lname'); $stmt->bindvalue(':memberid', $_session["memberid"], pdo::param_int); $stmt->bindvalue(':groupid', $_post['groupid'], pdo::param_int); $stmt->execute(); $result = $stmt->fetchall(); foreach($result $row ) { $i++; echo '<tr style="'.getbgc($i).'"> <td style="display:none">'.$row[0].'</td> <td style="width:auto;">'.$row[1].'</td> <td s

javascript - How to use variables in DOM CSS -

i want make webpage responsive using javascript. can tell me why doesn't work , how should this? document.getelementbyid("id1").style.left = variable; very hard understand asking created fiddle passing variable show syntax. https://jsfiddle.net/b6clt0td/1/ <div id="id1"> </div> <input type="button" value="click me" onclick="somefunc()"/> <input type="button" value="move me" onclick="movefunc()"/> <script> function somefunc(){ var red ="red"; document.getelementbyid("id1").style.backgroundcolor = red; } function movefunc(){ var dist = 100; document.getelementbyid("id1").style.left = dist +"px"; } </script>

Select links in Google Doc -

i'm looking following: locate links in document select them , change styling so far, have: var body = documentapp.getactivedocument().getbody(); var text = body.editastext().gettext(); var words = text.split(' '); (var = 0; < words.length; i++) { var word = words[i]; // doesn't work because word isn't text object // word.getlinkurl(); } i understand how iterate on words in paragraph . issue determining if text link. can't use gettext() method because converts text object string (prohibiting me testing if word link via getlinkurl() method. i've found number of "find , replace" solutions. can't use findtext() because can't predict strings in links. instance, resources point example.com . any appreciated. this post seems you're looking for: get links

c# - Dapper/EF - why is there a performance increase when variable is outside of using -

i ran both below queries using same params , stored proc. example takes on minute, whereas example b takes under 20 seconds. if call same proc using ef, i'm down 10 seconds (there on 50000 records returned). it's puzzling why ef quicker. example a: list<resultobj> result; using (var conn = new sqlconnection(configurationmanager.connectionstrings["string"].connectionstring)) { result = conn.query<resultobj>("spproc", param: new { /*params here*/ }, commandtype: commandtype.storedprocedure, commandtimeout: 300).tolist(); } example b: using (var conn = new sqlconnection(configurationmanager.connectionstrings["string"].connectionstring)) { var result = conn.query<resultobj>("spproc", param: new { /*params here*/ }, commandtype: commandtype.storedprocedure, commandt

python - Define a sorted function for timestamps/time objects by key -

this question has answer here: how sort ordereddict of ordereddict - python 2 answers i have dictionary of times , counts. need sort dict in ascending order time. need getting sort useful. right dropping am/pm remove complexity aware i'm running problem there since i'm losing information. calling sorted(mydict, key = bytime_key) with def bytime_key(input): shorter_input = re.match(r'^(.*) \w\w$', input).group(1) time = datetime.strptime(shorter_input, '%m/%d/%y %h:%m:%s') return(time) is fine, save doesn't change order, i'm missing fundamental here. sample dictionary mydict = {'1/15/2016 10:41:00 am': 11, '1/15/2016 10:43:00 am': 4, '1/15/2016 10:22:00 am': 46, '1/15/2016 10:30:00 am': 15, '1/15/2016 10:59:00 am': 34, '1/15/2016 12:06:00 pm':

c++ - opencv undistortPoints returning NaN ios -

i have been working opencv, , cannot seem undistortpoints work. matrix returns has nothing nan values. //newkeypoints std::vector<cv::keypoint>, , it's values valid cv::mat src = cv::mat(1,newkeypoints.size(),cv_32fc2); int = 0; (std::vector<cv::keypoint>::iterator = newkeypoints.begin(); != newkeypoints.end(); it++){ src.at<cv::vec2f>(0,i)[0] = (*it).pt.x; src.at<cv::vec2f>(0,i)[1] = (*it).pt.y; i++; } cv::mat norm = cv::mat(1,newkeypoints.size(),cv_32fc2); //note: fx, fy, cx, cy... k3 global constants declared when initialized cv::mat cameramatrix = cv::mat(3, 3, cv_32f); cameramatrix.at<double>(0,0) = fx; //double fx = 354.65 cameramatrix.at<double>(1,0) = 0; cameramatrix.at<double>(2,0) = 0; cameramatrix.at<double>(0,1) = 0; cameramatrix.at<double>(1,1) = fy; //double fy = 355.66 cameramatrix.at<double>(2,1) = 0; cameramatrix.

Laravel 5 maintenance mode turn on without artisan -

is there possibility turn on , turn off laravel 5 maintenance without php artisan , down commands when website being hosted ? what i've done: route::get('site/shutdown', function(){ return artisan::call('down'); }); route::get('site/live', function(){ return artisan::call('up'); }); the first route working fine. when call site/live site still shuted down. can cause problem ? if project down, cannot call function. what happened after run php artisan down . creates file named down inside storage/framework . after running php artisan up removes file. you can create file manually inside storage/framework . down project. when want live project again, remove file.

Rails Excel 2007 export: Add Byte Order Mark to .erb template -

i exporting data excel making erb template xls file. following procedure recommended in railscast 362 making encoded exports. the output opens fine in excel mac 2011, in excel 2007 characters é appear é because utf-8 encoded file being interpreted excel latin1. according this answer excel 2007 correctly interpret utf-8 file if starts right byte order mark (bom). taking @ @ hex version of output seems indeed doesn’t have bom. there number of sources (like this plataformatec blog post ) explain how add bom when rendering data inline in controller: bom = "\377\376" bom + iconv.conv('utf-16le', 'utf8', data) my question – there way of getting template correctly interpreted excel 2007? or should go rendering data in controller? i don't know why excel makes hard, do. i tried using code myself when ran encoding problem. couldn't figure out how apply working with. did workaround instead. i downloaded csv file indicated in rails

c++ - C++0x Initializer Lists -

i need understanding subtleties of c++0x consolidated initializer lists. why does... #include <iostream> int main() { struct foo { public: struct bar { public: bar(int a, int b, int c){} int ma, mb, mc; } mbar[2]; foo(int a, int b, int c) : mbar{{a, b, c}, {a+10, b+10, c+10}} {} } mfoo(1, 2, 3); return 0; } ...result in compiler error... >g++ -std=c++0x main.cpp main.cpp: in constructor ‘main()::foo::foo(int, int, int)’: main.cpp:18: error: bad array initializer > ...whereas this... #include <iostream> int main() { struct foo { public: struct bar { public: ////////////////////bar(int a, int b, int c){} int ma, mb, mc; } mbar[2]; foo(int a, int b, int c) : mbar{{a, b,

asp.net - how does IdentityDbContext know my password? -

using visual studio 2013 created asp.net mvc 5 project. copied database automatically created file server running ms sql server. however, when created connection string, specified ip address , database name. connects fine; updated data on server , data shows up. how? never told username or password use connect. perhaps server management studio save data somewhere application apparently searching?

linux - bash: “export: command not found... -bash: export: `/usr/local/git/bin': not a valid identifier when opening terminal -

i followed setup git: https://www.howtoforge.com/how-to-install-the-latest-git-version-on-centos , seemed bash file broken. gives me error: bash: “export: command not found... -bash: export: `/usr/local/git/bin': not valid identifier any step step solution this? tried restarting computer still appears. you doing this: export $var and var has value /usr/local/git/bin. export wants variable name . $ var=/usr/local/git/bin $ export $var bash: export: `/usr/local/git/bin': not valid identifier

hive - In SQL how do I match criteria across rows? -

this question has answer here: how return rows have same column values in mysql 2 answers let's have data like: id value x y z b x c x c y c w and want find id have both x , y values or x , w. these stored in second table: value1 value2 x y x w and return: id value1 value2 x y c x y c x w this needs work @ scale, first table has 100m lines , second table thousands of rows. run in impala or hive. you can using group by , having , logic: select id data d cross join table2 t2 group id, t2.value1, t2.value2 having sum(case when d.value = t2.value1 1 else 0 end) > 0 , sum(case when d.value = t2.value2 1 else 0 end) > 0;

lambda - Filter Java Stream to 1 and only 1 element -

i trying use java 8 stream s find elements in linkedlist . want guarantee, however, there 1 , 1 match filter criteria. take code: public static void main(string[] args) { linkedlist<user> users = new linkedlist<>(); users.add(new user(1, "user1")); users.add(new user(2, "user2")); users.add(new user(3, "user3")); user match = users.stream().filter((user) -> user.getid() == 1).findany().get(); system.out.println(match.tostring()); } static class user { @override public string tostring() { return id + " - " + username; } int id; string username; public user() { } public user(int id, string username) { this.id = id; this.username = username; } public void setusername(string username) { this.username = username; } public void setid(int id) { this.id = id; } public string getusername() { retur

ruby on rails 4 - Devise change email does not update email -

i'm trying allow users change email addresses devise uses unique username. though update gives no errors, no change made email address user in database. here relevant portions of code: form: <%= f.fields_for :user_account, @user.user_account |user_account| %> <p>edit email address account: <%= @user.user_account.email %></p> <div class="field"> <%= user_account.label :new_email %><br /> <%= user_account.text_field :email, autocomplete: "off", value: nil %> </div> <div class="field"> <%= user_account.label :password %> <i>(please confirm password associated account)</i><br /> <%= user_account.password_field :current_password, autocomplete: "off" %> </div> <%= hidden_field_tag 'form', 'email' %> <div class="actions"> <%= user_account.submit "edit" %> </div> contr

python - How to make a countdown timer that runs in the background, which terminates the program when it runs out? -

i making wants millionare game in python using graphics. want user 45 seconds per question answer it. however, whenever put timer in code waits 45 seconds first, then lets user answer, instead of running in background , letting user answer @ same time. using threading module run multiple threads @ once you use python threading module make 2 things happen @ once, thereby allowing user answer while timer ticks down. some example code utilizing this: from threading import thread time import sleep import sys def timer(): in range(45): sleep(1) #waits 45 seconds sys.exit() #stops program after timer runs out, have print or keep user attempting answer longer def question(): answer = input("foo?") t1 = thread(target=timer) t2 = thread(target=question) t1.start() #calls first function t2.start() #calls second function run @ same time it's not perfect, code should start 2 different threads, 1 asking question , 1 timing out 45 secon

r - How to create a table from a dataframe -

the following dataframe have col1<-c(1960,1960,1965,1986,1960 ,1969,1960,1993,1983,1924, 1960,1993,1960,1972 ,1960,1969) col2<-c ("a", "c","a","b", "a", "c", "b","a", "b","a", "b", "a", "c","c","a","a" ) mydata<-data.frame(col1,col2) i want create two-way table calculate proportion each category (a, b , c) respectively before 1970 , after 1970 . the desired output should be: year b c before 1970 0.545 0.181 0.272 after 1970 0.4 0.4 0.2 any suggestion appreciated! we can transform dataset create column after 1970 , before 1970 values. can done first creating logical vector ( col1 <= 1970 ), adding 1 true becomes 2 , false 1. use numeric index change values after 1970 , before 1970 . then, frequen

Handling exceptions within if statements in Python -

is there way deal exceptions within if statements, other putting try , except bracket around whole lot, or test exception on each line in advance? for example, had simplified code: if a[0] == "a": return("foo") elif a[1] == "b": return("bar") elif a[5] == "d": return("bar2") elif a[2] == "c": return("bar3") else: return("baz") if a word_of_six_characters_or_more work fine. if shorter word raises exception on line elif a[5] == "d" . possible test exceptions in advance (e.g. changing elif a[5] == "d" elif len(a) >5 , a[5] =="d" , relies on first part being false , second never executed). question is, there other way of causing exceptions treated false , proceed next elif statement rather throwing exception - or similarly, include try except clauses within elif line? (obviously, possible there no way, , getting con

sublimetext3 - In Sublime text 3 how do I default a certain file to a specific type -

this question has answer here: sublime text different syntax files under specific subdirectory 1 answer i'm working fastlane.tools , want fastfile open ruby syntax. i'm not sure change this. click on bottom right language selector, or go view > syntax go open current extension as... , pick desired language. this apply files of extension.

Matlab inverse of large matrix -

this equation trying solve: h = (x'*x)^-1*x'*y where x matrix , y vector ((x'x)^-1 inverse of x-transpose times x). have coded in matlab as: h = (x'*x)\x'*y which believe correct. problem x around 10000x10000, , trying calculate inverse crashing matlab on powerful computer can find (16 cores, 24gb ram). there way split up, or library designed doing such large inversions? thank you. i generated random 10,000 10,000 matrix x , random 10,000 1 vector y. i broke computation step step. (code shown below) computed transpose , held in matrix k then computed matrix multiplying k x computed vector b multiplying k vector y lastly, used backslash operator on , b solve i didn't have problem computation. took while, breaking operations smallest groups possible helped prevent computer being overwhelmed. however, composition of matrix using (ie. sparse, decimals, etc.). x = randi(2000, [10000, 10000]); y = randi(2000, 10000, 1); k = x';

jquery - How Can I run my script after validate,before POST in ASP.NET Web Forms? -

i want use webcontrols.validator (ex. requiredfieldvalidator) validation. can submit button twice , more. <asp:textbox id="textbox1" runat="server"></asp:textbox> <asp:requiredfieldvalidator id="reqfld1" runat="server"controltovalidate="textbox1"></asp:requiredfieldvalidator> <asp:button id="button1" runat="server" text="submit" /> $("form").on("submit", function(e){ if (waiting) return false; waiting = true; showmywattingdiv(); ) i tried code, if invalid i'm waiting too; try code below. key use client-side api asp.net validators. here using property page_isvalid available in page whenever have asp.net validators on page. <asp:textbox id="textbox1" runat="server"></asp:textbox> <asp:requiredfieldvalidator id="reqfld1" runat="server"controltovalidate="textbox1&q

php - $response->getBody() is empty when testing Slim 3 routes with PHPUnit -

i use following method dispatch slim app's route in phpunit tests: protected function dispatch($path, $method='get', $data=array()) { // prepare mock environment $env = environment::mock(array( 'request_uri' => $path, 'request_method' => $method, )); // prepare request , response objects $uri = uri::createfromenvironment($env); $headers = headers::createfromenvironment($env); $cookies = []; $serverparams = $env->all(); $body = new requestbody(); // create request, , set params $req = new request($method, $uri, $headers, $cookies, $serverparams, $body); if (!empty($data)) $req = $req->withparsedbody($data); $res = new response(); $this->headers = $headers; $this->request = $req; $this->response = call_user_func_array($this->app, array($req, $res)); } for example: public function testgetproducts() { $this->dispatch('/products

c# - Awaiting a TaskCompletionSource<T> that never returns a Task -

i trying write unit test around async pub/sub system. in unit test, create taskcompletionsource<int> , assign value within subscription callback. within subscription callback, unsubscribe publications. next time publish, want verify callback never got hit. [testmethod] [owner("johnathon sullinger")] [testcategory("domain")] [testcategory("domain - events")] public async task domainevents_subscription_stops_receiving_messages_after_unsubscribing() { // arrange string content = "domain test"; var completiontask = new taskcompletionsource<int>(); domainevents.subscribe<fakedomainevent>( (domainevent, subscription) => { // set completion source awaited task can fetch result. completiontask.trysetresult(1); subscription.unsubscribe(); return completiontask.task; }); // act // publish first message domainevents.publish(new f

mysql - PHP Add more value to foreach for display group by vendor -

how add more value code display? ex : added 5 products cart different vendors. p1 vendor name test1 p2 , p3 vendor name test2 p4 vendor name test3 p5 vendor name test4 my code : function getvendors() { foreach($_session["products"] $product) { $org[$product["member_display_name"]][] = $product["p_name"]; } return (!empty($org)) ? $org : array(); } foreach (getvendors() $vendor => $prods) { echo "<li>vendor name : {$vendor} </li>"; echo "<li>" . implode("</li><li>",$prods) . "</li>"; } this code given output like: vendor name : test1 p1 vendor name : test2 p2 p3 vendor name : test3 p4 vendor name : test4 p5 this want i want add $product["member_payment"] display : vendor name : test1 p1 payment vendor : 000-111-111 vendor name : test2 p2 p3 payment vendor : 000-111-222 vendor name : test3 p4 payment vendor : 000-111-333 vendor

javascript - How to make a slider with jquery using bullets -

hello want know how make slider jquery, i'm quite new try best specific, want this: have slider 3 images "they on same space" , 3 bullets below images, first can't see images because have opacity: 0 if click first bullet see first image, bullet# 2 img# 2, bullet# 3 img# 3, want put <a> tag example <a href="#"class="avanzar1">avanzar</a> advance next image "it on right side" , left side last image saw, question how can that? need keep transition of them , how join bullets? because need use tag <a> <-- button "for me" or bullets, it's difficult , i'm trying it, welcome here html: <!doctype html> <html> <head> <title>slider</title> <meta charset="utf-8" /> <link rel="stylesheet" href="style.css"> <script src="js/jquery-2.1.4.min.js"></script> <script src="js/sli

Gulp: Run code after asynchronous tasks have completed -

i have gulp task following mission: list of folders. count words in folder. report count each folder , grand total count. so far, have. gulp.task('count', function() { ['folder1','folder2',...].foreach(function(foldername) { gulp.src(['./'+foldername+'/**/*.md']).pipe(countwords(foldername)); }); }); after of folders' words have been counted, want call function reportgrandtotal . have spent hours trying figure out how this. problem gulp.src().pipe() chain runs asynchronously. in many of patterns have tried, reportgrandtotal ends running before of gulp.src().pipe() chains complete. how modify task that, once of gulp.src().pipe() chains have completed, can run reportgrandtotal , grand total? if i'm understanding question, can specify dependency reportgrandtotal, make sure tasks use callback or return stream or promise. gulp.task('reportgrandtotal', ['count'], function(){ // code }

xcode4 - Attempt to programmatically re-position UIImageView -

**updated question reflect addition of "init" in uiimageview alloc* * * have "imageview" variable, declared in ".h" class. forced in particular case programmatically move "imageview" 10 pixels , have experienced no luck. in looking @ current uiimageview ("imageview) position, determined x/y/width/height should (78,214,170,120). below code working with, works displays no uiimageview/uiimage: imageview = [[uiimageview alloc]init]; uiimage *image = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:img2string]]]; imageview.frame = cgrectmake(78,214,170,120); imageview.image = image; i'd appreciate help. you should initialize image view first imageview = [[uiimageview alloc] init]; like above.

string - Adding characters to str_replace in PHP -

i have php file thread ($tid) , post ($pid) ids defined , i'm looking use str_replace combine them , create desired output (below) &p= added: desired output: $tid&amp;p=$pid the closest i've got doing this: $tid=$t1; $pid=$p1; $tid=str_replace("$tid","$tid"."$pid",$tid); the result is: $tid$pid i may need use function (not sure if so?) in str_replace support &p= being added, trying add in quotes directly doesn't seem work resulting in database errors. edit #1: tried doing following based on comments far: $tid=""; $tid.="$t1"; $tid.="$p1"; $tid=$tid; that results in same previous example above: $tid$pid as add &p= database error: $tid.="&amp;p="; so question how add &p= edit #1 example above correctly? i'm attempting understand question little bit. have couple options alluded in comments above. could, instance (where '1',

css3 - CSS Select div whose immediate sibling is NOT p -

Image
this question has answer here: select specific element before other element 5 answers i have situation: the transition on entering is, after 1sec delay, fade-in 100% opacity: transition: opacity 1s ease 1s; the transition on leaving is, within 1sec fade out 0% opacity: transition: opacity 1s; the .leaving element removed after 1second. after removed want position:static on .entering so in other words: "when .entering not followed .leaving, apply position:static" , "when .entering followed .leaving should position:absolute" i'm trying this .entering { position: absolute; } .entering:not(+ .leaving) { position: static; } however not working. ideas? let's example in simplified case, background colors. if .entering followed .leaving , it's background color should red. if .entering followed non- .leaving (or f

Python Subtract integers in List to return a value -

i take large file in python 2.7: 123 456 gthgggth 223 567 fgrthsys 12933 4656832 gjwsoooskkssj ..... and want read in file line line, disregard third element, , subtract second element in each line first element. line 1 above return 333. i have tried far: def deletelast(list): newl = list.pop() return newl f = open(file_name, 'r') line = f.readline() while line: l = line.split() l2 = deletelast(l) l3 = [int(number) number in l2] length = l3[1]-l3[0] print length f.close() but, when try compiler says: valueerror: invalid literal int() base 10: 't' all appreciated. that because list.pop() returning "popped off" item, doesn't return list again. instead of deletelast function have written, better use slice this: l2 = line.split()[0:2] you going run problem later because while loop isn't advancing @ all. consider using loop instead.

Install apache2 on Ubuntu -

i upgrade apache2 v2.2 v2.4, follow instructions on site using command line: # apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils reading package lists... done building dependency tree reading state information... done **apache2 newest version.** apache2-utils newest version. might want run 'apt-get -f install' correct these: following packages have unmet dependencies. apache2-mpm-prefork : depends: apache2.2-bin (= 2.2.22-1ubuntu1.10) not going installed apache2.2-common : depends: apache2.2-bin (= 2.2.22-1ubuntu1.10) not going installed **e: unmet dependencies. try 'apt-get -f install' no packages (or specify solution).** it says installed, run: # service apache2 status apache2: unrecognized service then run command line: #apt-get -f install following packages installed: apache2-mpm-worker apache2.2-bin apache2.2-common suggested packages: apache2-doc apache2-suexec apache2-suexec-custom following new packages installed ap

android - webview is not present in xml layout file but still getting its reference in class file -

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getwindow().requestfeature(window.feature_action_bar); getactionbar().hide(); setcontentview(r.layout.activity_main); webview = (webview) findviewbyid(r.id.webview1); deviceid = secure.getstring(this.getcontentresolver(), secure.android_id); //toast.maketext(this, deviceid, toast.length_long).show(); webview.getsettings().setjavascriptenabled(true); // webview.getsettings().setbuiltinzoomcontrols(true); checkconnection2(); pd = new progressdialog(mainactivity.this); pd.setmessage("loading"); pd.show(); above class file.. and below xml layout file- <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom=

stack - Could anyone help me with this python singpath program? -

first of all, not class. have been working on these 2 programs long time , cannot make heads or tails of it. want past these problems can move onto other lessons. "create function transforms prefix notation postfix notation, , postfix notation prefix notation. function takes 2 arguments. first string of expression without spaces or syntax errors, , second string contains operators. characters not in second string regarded operands. lengths of operators , operands 1, , operators binary operators." ex: >>> fix_trans('ab33c2c11','abc') '33b211cca' and convert (reverse) polish notation: >>> topolish('(3+5)*(7-2)',d,0) '*+35-72' can provide examples of how far you've gotten this, or methods haven't worked you? also, familiar shunting-yard algorithm ?

html - How to prevent child element from inheriting CSS styles -

i have <div> element <p> element inside: <div style="font-size:10pt; color:red;"> parent div. <p>this child paragraph.</p> parent div ends here. </div> how can prevent paragraph inheriting css properties set <div> ? in case best way on right styles <p> element inheriting: so in css file, should using instead of inline styles: .parent-div { font-size: 10pt; color: red; } .child-paragraph { font-size: 12pt; color: black; }

android - Shrink wallpaper bitmap drawable to reduce RAM usage -

i using device wallpaper layout background. bitmap drawable size large on on devices 7 mb in samsung s3. there way reduce without consuming more ram. worried oom on low memory devices. wallpapermanager wallpapermanager = wallpapermanager.getinstance(mcontext); bitmapdrawable bitmapdrawable = (bitmapdrawable) wallpapermanager.getdrawable(); bitmapdrawable.setgravity(gravity.center_vertical | gravity.clip_vertical); if (android.os.build.version.sdk_int < android.os.build.version_codes.jelly_bean) { layout.setbackgrounddrawable(bitmapdrawable); } else { layout.setbackground(bitmapdrawable); } you can use bitmapfactory.options should convert bitmapdrawable byte[] //convert bitmapdrawable byte[] //winsize height screen user device bitmapfactory.options options = new bitmapfactory.options(); options.injustdecodebounds = true; bitmapfactory.decodebytearray(imagedata, 0, imagedata.length, options); if (opt

rest - How do I make an Ember-Data has-many collection that is defined by another API endpoint? -

i've got model, post has many comment s. response get /posts/12 pretty ember-data-friendly: { "post": { "id": 12, "title": "i love ramen", "created_at": "2011-08-19t14:22", "updated_at": "2011-08-19t14:22", "body": "..." } } the api post 's comment s, however, get /posts/12/comments , returns { "comments": [ { "id": 673, "author_id": 48, "created_at": "2011-08-21t18:03", "body": "me too!" } ] } what can model or adapter tell post 12 's comment s, use /posts/12/comments ? notice post has no knowledge of comment ids. update in response buuda's answer , here clarifications: the post must able comment s can (a) show comments on postroute , (b) have properties on post like hascomments: function() { return this.get('c

php - How to create a different store in magento on single domain? -

i searching hard make 2 different stores in magento different functionalities , believe possible in magento 2 different magento installation on single domain. i have went through of following tutorials: multiple magento stores on single domain http://inchoo.net/magento/how-to-set-multiple-websites-with-multiple-store-views-in-magento/ i have read tutorials, think tutorials work on 1 magento installation. i wanted know whether can make 2 store, 1.www.domain.com/store1 2.www.domain.com/store2 with different template design , different functionalities well, think need 2 different installation. also 1st website created , want share categories , products ,but different product prices on 2nd store. are these things possible magento , if yes need hint or little ? also ,how can change nginx configuration same ? sounds need create different website views , stores views. can done in system > manage stores. then need in system >configuration part drop dow