Posts

Showing posts from February, 2014

html - Trying to resize the navbar, change font size, and center the text -

i'm trying create navbar website. i've gone through css , tried resize navbar , align text. don't know i'm going wrong. here section of css. .nav { font-family: "indie flower", serif; font-size: larger; color: white; } #navwrapper{ width = 100% float: left; margin: 0 auto; list-style : none font-family: "indie flower", arial; background-color: red; height = 10px; text-align = "center"; } also html <body> <div id="main" class="main" style ="text-align = center"> </div> <div id = "navwrapper"> <p class = "nav">holder</> </div> <br> <iframe src = "http://chrisfoose.blogspot.com" width = "100%" height = "300" frameborder = "0"> <p>unfortunately browser not support dynamic content.</p> </iframe> </div> </body> also, link current results are:

javascript - JQuery History.js plugin not replacing state of one page in both HTML4 and HTML5 browsers -

i using jquery history.js plugin enable history api in html5 browsers , emulate in html4 browsers. using ajaxify script implement plugin. changed script little shown: var history, $, document; function preparevariables() { history = window.history, $ = window.jquery, document = window.document; } function inithistory() { // prepare variables var /* application specific variables */ //contentselector = '#content,article:first,.article:first,.post:first', contentselector = '#navcontent'; $content = $(contentselector), //.filter(':first'), //contentnode = $content.get(0), $menu = $('#menu,#nav,nav:first,.nav:first').filter(':first'), activeclass = 'active selected current youarehere', activeselector = '.active,.selected,.current,.youarehere', menuchildrenselector = '> li,> ul > li', completedeventname = 'statechangecomplete', /* applicat

node.js - How to get a value from Jade to Javascript? -

i know looks repetitive, little bit different other question here. i using node expressjs routing , passportjs login , in login page have dropdown list select value want pass along angular script. in app.js have: var languages = [ {"lang": "english", "code": "en"}, {"lang": "chinese", "code": "zh-cn"} ]; app.get('/', detectbrowser, routes.index); app.get('/login', routes.login(issamesubnet, languages)); index.js: exports.index = function(req, res){ res.render('index', { login: 'some string' }); }; exports.login = function(language) { return function(req, res) { res.render('login', { lang: language }); }; }; login.jade: label.control-label language select.form-control each val, index in lang option(value= val.code)= val.lang so how can grab value of option tag javascript , pass next stage (angularjs)? i know how i

c++ - How to force gcc to ignore localisation -

my localisation set german , gcc outputs german compiler warnings codeblocks handles warnings errors , doesn't let me run application. got far figured out need force gcc output english warnings answers found "set systems language english" don't want so. how can force gcc output compiler warnings in english without changing entire system language? gcc uses lang , lc_messages , lc_all environment variables. the cause of gcc printing messags in german lang set de_de.utf-8 unset (or set default posix locale, c , or english locale such en_us ) before running gcc. if can't adjust command-line codeblocks uses invoke compiler should able adjust environment before running codeblocks, e.g. instead of running codeblocks start ide (or whatever command start ide is) run lang=c codeblocks that alter environment codeblocks process , child processes runs, including compiler commands runs. if doesn't work check maybe have lc_all or lc_messages se

php - wordpress logged in user in storyboard -

trying logged in user in wordpress within lightbox plugin: [iframe_loader type='lightbox' href='https://www.website.org/wp-content/uploads/articulate_uploads/testcert/' size_opt='lightebox_default'] this storyboard test send results php page - code in php page is: <?php $current_user = wp_get_current_user(); /** * @example safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof wp_user) ) * return; */ echo 'username: ' . $current_user->user_login . '<br />'; echo 'user email: ' . $current_user->user_email . '<br />'; echo 'user first name: ' . $current_user->user_firstname . '<br />'; echo 'user last name: ' . $current_user->user_lastname . '<br />'; echo 'user display name: ' . $current_user->display_name . '<br />'; echo 'user id: ' . $current_user->id . '<br />';

python - pandas iloc vs ix vs loc explanation? -

can explain how these 3 methods of slicing different? i've seen the docs , , i've seen these answers , still find myself unable explain how 3 different. me, seem interchangeable in large part, because @ lower levels of slicing. for example, want first 5 rows of dataframe . how 3 of these work? df.loc[:5] df.ix[:5] df.iloc[:5] can present 3 cases distinction in uses clearer? note: in pandas version 0.20.0 , above, ix deprecated , use of loc , iloc encouraged instead. have left parts of answer describe ix intact reference users of earlier versions of pandas. examples have been added below showing alternatives ix . first, recap: loc works on labels in index. iloc works on positions in index (so takes integers). ix tries behave loc falls behaving iloc if label not in index. it's important note subtleties can make ix tricky use: if index of integer type, ix use label-based indexing , not fall position-based indexing. if label

serialization - Passing async 'hasMany' relation to a component -

i have ember model 'hasmany' relation don't want embed, , need pass asynchronously component gets records relation. when call component emblem file ( =user-answer useranswers=useranswers id=smth.id ), error "no method 'get' undefined". here code: app/models/quiz_progress.coffee: `import ds "ember-data";` `import progressmixin "../mixins/progress_mixin"` quizprogress = ds.model.extend progressmixin, useranswers: ds.hasmany 'user_answer', async: true `export default quizprogress;` app/components/user-answer.coffee: `import ember "ember";` useranswercomponent = ember.component.extend tagname: 'div' classnames: ['ui', 'list'] useranswer: (-> id = @get('id') answers = @get('useranswers') answers.findby('questionid', id).get('answers') ).property('id', 'useranswers') `export default useranswercomponent;`

java - Spring boot properties file override from command line -

i having problem spring boot , fat jar invocation command line.i trying overide property command line without success. have parameter in code: @value("${param1}") private string param1; and have put application.properties file inside src\main\resources following content; param1=param 1 value properties file when build jar , run with: java -jar java-apns-notifier-0.1.0.jar --param1=aaaaaaaaa param1 printed value application.properties file , not takes account value command line. project source code here any idea? you forgot pass arguments in application class. need change springapplication.run(application.class); to springapplication.run(application.class, args);

How to add data to an existing file and also read it with Java -

this simple program user inputs 2 variable values , chooses operator. program displays results , asks user if save file. format should x + y = z. declared variable should catch user input resw = ""; i unable resw capture user input variable values can saved file. if enter resw = "x + y = z"; then saved. second problem...when saves writes on previous save. need save each entry new line. don't know how that. finally, view file well. far can tell need filereader , bufferedreader so. not working though , moves on next line of code. if (answer.equals("y")||answer.equals("y")){ system.out.println(resw); bufferedwriter.write(resw); bufferedwriter.newline(); system.out.println("results saved file."); } system.out.println("do want review results y/n"); answer = ins.nextline(); if (answer.equals("y")||answer.equals("y")){ filereader filereader = new filereader(filen

socket.io - Python running Socket IO with another task -

Image
i running socketio server, it's ok. write message , reply message must control page long-polling. i can't implement socketio server. my socketio server code: from socketio import socketio_manage socketio.server import socketioserver socketio.namespace import basenamespace socketio.mixins import roomsmixin, broadcastmixin class chatnamespace(basenamespace, roomsmixin, broadcastmixin): def on_nickname(self, nickname): self.request['nicknames'].append(nickname) self.socket.session['nickname'] = nickname self.broadcast_event('announcement', '%s has connected' % nickname) self.broadcast_event('nicknames', self.request['nicknames']) # have them join default-named room self.join('main_room') def recv_disconnect(self): # remove nickname list. nickname = self.socket.session['nickname'] self.request['nicknames'].remove(nickna

My html/css document has ghost margins or padding? -

http://jsfiddle.net/2psu0gs4/ have @ js fiddle above. there ghost margins can't rid of , don't understand why they're there?? i have tried margin: 0; isnt working? <help></help> any help? tom you have few issues causing trouble. your anchors inline elements , therefore respect whitespace (line breaks , spaces) between tags. comment between every tag (see https://css-tricks.com/fighting-the-space-between-inline-block-elements/ ), that's lot of markup , more of hack solution. i recommend setting anchors display inline-block they'll handle margins , padding in way expect them to, , float them left stack neatly against each other. by setting images max-width:25% , you're drawing them @ 1/4 width, still reserve 100% of width (sort of how position:relative affects blocks) causes anchor tags draw @ 500px wide. to solve this, moved max-width:25% style img declaration a declaration. left me 500px wide images overlapping

css - Chrome bug border-radius+overflow with perspective -

i'm having strange problem chrome. if create div perspective, border radius, overflow hidden , transformed div inside element wont respect de perspective. http://codepen.io/cavax/pen/mwpgxz if remove border radius can see element has perspective. any idea? <div id="prova"> <div id="rotate"></div> </div> <div id="prova2"> <div id="rotate2"> </div> </div> #prova { width: 400px; height: 200px; -webkit-perspective: 400px; perspective: 400px; margin: 40px; border: 1px solid #000; overflow: hidden; border-radius: 30px; } #rotate { width: 200px; height: 200px; background-color: red; -webkit-transform: rotatex(40deg); transform: rotatex(40deg); position: absolute; bottom: 0px; left: 100px; } #prova2 { width: 400px; height: 200px; -webkit-perspective: 400px; perspective: 400px; margin: 40px; border: 1px solid #000;

javascript - Getting the size of visible table rows -

i have drop down option , every time drop down option changes, content of table being filtered based on value of drop down. however, want display message if in table filtered (basically if shows nothing). have code, not consider visibility of table row. alert(document.getelementbyid("table").rows.length); drop down (html): <td> room preference: <a style="color: red;">*</a> </td> <td> <select name="roompreference" id="roompreference" class="form-control placeholder-no-fix" onchange="setrooms();"> <option value="ward">ward</option> <option value="semi-private">semi-private</option> <option value="private">private</option> <option value="suite room">suite room</option> <option value="icu">icu</option> <option value=&qu

javascript - A library with close can't create a new obj base on its constructor -

i received error of uncaught typeerror: object not function on line new can run if var item = mylib; however, not clear issue here. (function(window){ function mylib (){ var library={}; library.localvar1="one"; library.localvar2="two"; library.func1 = function (){ console.log("func1 output"+library.localvar1) return true; } library.func2 = function (){ library.func2var1 = "func2one"; console.log("func2 output"+library.localvar2) return library.func2var1; } return library; } //define globally if doesn't exist if(typeof(library) === 'undefined'){ window.mylib = mylib(); } else{ console.log("library defined."); } })(window); var item = new window.mylib; console.log(item.localvar2,"var2"); console.log(item.func2(),"

r - sorting the output of dist() -

i have matrix m m <- matrix ( c( 2, 1, 8, 5, 7, 6, 3, 4, 9, 3, 2, 8, 1, 3, 7, 4), nrow = 4, ncol = 4, byrow = true) rownames(m) <- c('a', 'b', 'c', 'd') now, i'd order rows of m based on respective distance, use dist() dist_m <- dist(m) dist_m is, when printed b c b 8.717798 c 9.899495 5.477226 d 2.645751 7.810250 10.246951 since want ordered, try sort(dist_m) prints [1] 2.645751 5.477226 7.810250 8.717798 9.899495 10.246951 which want. i'd more happy if printed names of 2 rows of number distance, like 2.645751 d 5.477226 b c 7.810250 b d 8.717798 b 9.899495 c 10.246951 c d this possible, have no idea how achieve this. one option convert dist matrix , replace upper triangle values 0, melt , subset non-zero values, , order based on 'value' column. m1 <- as.matrix(dist_m) m1[upper.tri(m1)] <- 0 library(resh

javascript - simple css fade transition not working through jquery -

when use jquery change opacity 0 , 1, doesn't work. works whens theres no position absolute, need position absolute on elements. thanks! $('.share').on("click",function(e){ if($('.sharemedia').css("bottom")=="54px"){ $('.sharemedia').css("bottom","0px"); $('.sharemedia').css("opacity",0); } else{ $('.sharemedia').css("bottom","54px"); $('.sharemedia').css("opacity",1); } }); .sharemedia{ position: absolute; bottom:0; background-color: rgba(0,0,0,.40); padding: 10px 12px; transition:.6s; opacity:0; } .controls{ position: absolute; bottom:0; width: 100%; background-color: rgba(0,0,0,.40); padding: 10px 0; transition:.6s; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">&l

c++ - OpenCL: cl::getDevices crashes -

i have problems opencl-code, crashes @ marked position, nvidia gpu (opencl 1.1) (the intel platforms (opencl 1.2 , opencl 2.0) behave well). cl::platform::get(&allplatforms); alldevices.resize(allplatforms.size()); size_t nodevices = 0; (size_t = 0, end = allplatforms.size(); < end; ++i) { allplatforms[i].getdevices(cl_device_type_all, &alldevices[i]); //here crashes nodevices += alldevices[i].size(); } cl_int getdevices( cl_device_type type, vector_class<device>* devices) const { ... devices->assign(&ids[0], &ids[n]); //here crashes return cl_success; } i've no idea why crashes , how fix it. edit: debugger says ids valid pointer , n=1 (in case of crash) do have recent version of header? have "isreferencecountable" function in it? earlier versions of header suffered problem nvidia (incorrectly) releases 1.2 cl.h 1.1 icd. c__ header has no way know link

regex - Regexp To Match Characters after string -

i want match string comes after http://test.website.com/account/activateaccount/ . e.g.: the string evaluated: http://test.website.com/account/activateaccount/bba29f0c-f0e0-4e3a-93dd-e10a090c3f29 desired outcome: bba29f0c-f0e0-4e3a-93dd-e10a090c3f29 thanks! if want match guids, can use: \/((\w{8}(?:-\w{4}){3}-\w{12}))$ example here: https://regex101.com/r/iw6fh2/1 if want match every text , beginning part of address fixed, can use: http\:\/\/test\.website\.com\/account\/activateaccount\/(.*) example here: https://regex101.com/r/jf8oi1/1

ios - inputAcessoryView being displayed with UIAlertController -

i have overridden -inputaccessoryview: method in uiviewcontroller returns view displayed on top of keyboard shown while editing uitextfield on viewcontroller's view. -(uiview *)inputaccessoryview; i presenting uialertcontroller viewcontroller. uialertcontroller *alert = [uialertcontroller alertcontrollerwithtitle:@"save profile" message:@"you have made changes profile. want save them?" preferredstyle:uialertcontrollerstylealert]; [alert addaction:[uialertaction actionwithtitle:@"cancel" style:uialertactionstylecancel handler:nil]]; [alert addaction:[uialertaction actionwithtitle:@"save" style:uialertactionstyledefault handler:^(uialertaction *action) { //code save profile. }]]; [self presentviewcontroller:alert animated:yes completion:nil]; as can see have not added textfield uialertcontroller. weirdly, inputacessoryview turns @ bottom of screen when uialertcontroller presented. is bug, or have overlooked somethi

ms access 2010 - SQL - Filter a query result with an additional condition -

i have database 2 tables: - credit records payments have receive - payment records payments have received the structure credit: id, total payment: id, received my goal have query print payments still not paid. wrote query prints - id of credit - total money request - total money received need add condition: don't print records payment done. sql code: select credit.id, credit.total, (select sum(payment.received) payment payment.id = credit.id) totalreceived credit credit.total > 0; i tried changing last row "where credit.total > totalreceived" doesn't work. may me please? :) ps. in credit id unique while in payment table can present many rows same id. this should credit records have not been paid. payment table should have creditid field join instead of on credit.id = payment.id if that's how it's set should work. select c.id, c.total, sum(nz(p.received,0)) totalreceived credit c

sql - Conditional RowNumber -

Image
i trying put conditional numbering depending on result rownum column. when rownum 1 have new column brand new increment 1. in picture in column roomnum 5 should replaced 2, 9 3m 13 4, etc. doing wrong in query? select case when rownum < 2 row_number() on ( partition scheme order scheme asc ) else null end roomnum, case when rownum > 1 null else scheme end scheme ,rownum you need partition whether or not roomnm null . resulting value have case : select (case when roomnum not null row_number() on (partition scheme, (case when roomnum not null 1 else 0 end) order roomnum ) end) roomnum

r - table frequencies with custom column -

for example, have matrix: a <- c(2,3,4,3,3,2,2) table(a) output: 2 3 4 3 3 1 but output want is: 1 2 3 4 0 3 3 1 so example, value range 1 4.... because of random value, list may doesnt contain 1 or more element range when value range 1 4, want table have 4 coloumns not exist value filled 0 (0) you can convert 'a' 'factor' , specify levels before doing table table(factor(a, levels=seq_len(max(a)))) #1 2 3 4 #0 3 3 1 if need custom level should specified well. using example comments, a<- c(2,3,3,3,2,2) table(factor(a, levels=1:4)) #1 2 3 4 #0 3 3 0

Force JSF to refresh page / view / form when opened via link or back button -

i have jsf page posts data external page. data loaded jsf managed bean generates unique id in post data. i have issue user clicks on checkout button navigates same page , presses checkout button again. post data has not updated. moreover, bean not invoked @ all. there anyway force jsf reload page , form data? <form action="#{checkoutbean.externalurl}" method="post" id="payform" name="payform"> <input type="hidden" value="#{checkoutbean.uniqueid}" /> <input type="submit" value="proceed checkout" /> </form> that page being loaded browser cache. harmless, indeed confusing enduser, because s/he incorrectly thinks it's coming server. can confirm looking @ http traffic monitor in browser's web developer toolset (press f12 in chrome/firefox23+/ie9+ , check "network" section). you need tell browser not cache (dynamic) jsf pages. way brow

python - Monkey patching a @property -

is @ possible monkey patch value of @property of instance of class not control? class foo: @property def bar(self): return here().be['dragons'] f = foo() print(f.bar) # baz f.bar = 42 # magic! print(f.bar) # 42 obviously above produce error when trying assign f.bar . # magic! possible in way? implementation details of @property black box , not indirectly monkey-patchable. entire method call needs replaced. needs affect single instance (class-level patching okay if inevitable, changed behaviour must selectively affect given instance, not instances of class). subclass base class ( foo ) , change single instance's class match new subclass using __class__ attribute: >>> class foo: ... @property ... def bar(self): ... return 'foo.bar' ... >>> f = foo() >>> f.bar 'foo.bar' >>> class _subfoo(foo): ... bar = 0 ... >>> f.__class__ = _subfoo >>> f.bar

c++ - ::tolower vs std::tolower difference -

this question has answer here: what “::” mean in “::tolower”? 4 answers i have using namespace std; vector<char> tmp; tmp.push_back(val); ... now when try transform(tmp.begin(), tmp.end(), tmp.begin(), std::tolower); it fails compile, compiles: transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower); what's problem std::tolower ? works 1 argument, e.g., std::tolower(56) compiles. thanks! std::tolower has 2 overloads , cannot resolved unaryoperation c version ::tolower not. if want use std::tolower can use lambda as transform(tmp.begin(), tmp.end(), tmp.begin(), [](unsigned char c) {return std::tolower(c); });

c++ - Segmentation fault (core dumped) while using GMP Integers -

i wrote simple program in c++, using gmp library, prints out modulus of numbers which's digits composed of 1 (like 1, 11, 111, 1111, 11111, ...) , 2001; problem when program reaches 23 digits of 1, error saying segmantation fault(core dumped). can point out problem ? here code : #include <iostream> #include <stdio.h> #include <string> #include <gmpxx.h> int main(int argc, char** args){ mpz_t currnumber; mpz_init(currnumber); mpz_set_str(currnumber, "1", 10); while(mpz_sizeinbase(currnumber, 10) < 24){ char* digits = mpz_get_str(nullptr, 10, currnumber); strcat(digits, "1"); mpz_set_str(currnumber, digits, 10); digits = nullptr; mpz_t r; mpz_init(r); mpz_set_str(r, "1", 20); mpz_t divisor; mpz_init(divisor); mpz_set_str(divisor, "2001", 20); mpz_mmod(r, currnumber, divisor); std::co

dockerhub - How can I edit my image tags on docker hub? -

i have public docker hub repository, automated build linked github repo. i found misnamed tag of last build. is possible re-edit image name manually after building process without influencing image ? for automated builds , manually pulling, re-tagging , pushing won't work. first, if pull , re-tag image, cannot push manually automated build. end getting error pushing registry: authentication required. the true solution go build details page, click on settings -> automated build -> edit tag name under docker tag name , hit save , trigger build . create new tag , triggers build. secondly, cannot delete tags (for automated builds) on own. please contact support@docker.com asking them delete tag. also, should refrain using http delete request docker hub. these api endpoints meant private registry , not docker hub till date. docker planning release v2 registry endpoint soon, after can safely use api calls delete/manipulate tags , images. until not us

ios - returning a value from asynchronous call using semaphores -

i need use nsurlsession make network calls. on basis of things, after receive response, need return nserror object. i using semaphores make asynchronous call behave synchronously. problem is, err set inside call, semaphore ends (after dispatch_semaphore_wait(semaphore, dispatch_time_forever); ), err becomes nil. please help code: -(nserror*)loginwithemail:(nsstring*)email password:(nsstring*)password { nserror __block *err = null; // preparing url of login nsurl *url = [nsurl urlwithstring:urlstring]; nsdata *postdata = [post datausingencoding:nsasciistringencoding allowlossyconversion:yes]; // preparing request object nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:url]; [request sethttpmethod:@"post"]; [request setvalue:postlength forhttpheaderfield:@"content-length"]; [request sethttpbody:postdata];

c++ - Qt5 MYSQL "open()" method return true even with wrong credentials -

while writing qt5 application uses qsqldatabase mysql, encountered strange bug when try connect datebase. qsqldatabase::open() returns true wrong username, password , port. that's code: qsqldatabase db = qsqldatabase::adddatabase("qmysql", "connection"); db.sethostname(interface.inputip->text()); db.setdatabasename("connectdb"); db.setport(interface.inputport->value()); db.setusername(interface.inputlog->text()); db.setpassword(interface.inputpass->text()); bool result = db.open(); if(result) qmessagebox::information(0, "success", "connected"); else qmessagebox::information(0, "error", db.lasterror().text()); db.close(); is possible avoid bug?

Summing a tuple in a list, in python -

i know there must quick way this, can't seem find it. need find way add items in tuple. hoping mytuple.sum. i have list of tuples mylist= [(1,3,5,3),(1,5,5,5),....,(1,3,2,1),(1,1,1,2)] and need able call on mylist[0].sum thanks! it's hard tell want, it's 1 of sum(mylist[0]) or sum(sum(x) x in mylist) or map(sum, mylist)

python - My understanding of threading -

i have not programmed in on year sorry if stupid question. looked lots of examples on site threading seem getting different outcome other people. from understanding of threading, using simple code, should printing yo , lo together, yo lo yo lo but instead yo yo yo ... from threading import thread import time def printyo(): while(3>1): print ("yo") time.sleep(1) def printlo(): while(3>1): print ("lo") time.sleep(1) t2 = thread(target=printlo()) t = thread(target=printyo()) t2.start() t.start() you calling function instead of giving target thread. t2 = thread(target=printlo) t = thread(target=printyo)

php - Send form (AJAX) in android and receive JSON response -

Image
the idea duplicate on android web http://www.telekino.com.ar/ in site there form check if lottery ticket won according other post, site uses ajax contact webservice , data. i dont know start, step can layout. ( 3 edittext 3 values needed send form, , 1 button start process) lost. how continue? need use send values , receive response.? is possible duplicate on app request? i'm doing http request here , in success method response saved in variable "data". $http({ method: 'get', url: 'http:/****.**/api/gebruikers?email=' + $scope.email + '&wachtwoord=' + $scope.wachtwoord }).success(function (data) { // variable "data" json response recieve, json string. });

angularjs - How to make a template repeat -

i have directive, want template show rows data set app.directive('exampledirective', [ 'testprovider', 'testfactory', function (testprovider, testfactory) { return { restrict: 'e', template: '<tr><td>{{name}} </td><td>{{surname}}</td></tr>', replace: true, link: function(scope, elm, attrs) { var dat= testfactory.datareturn(); (var = 0; < dat.length; i++) { scope.name = dat[i].name; scope.surname = dat[i].surname; console.log(dat[i]); } // alert("hah"); } }; }]); how can make repeat ng-repeat ? assuming service returning promise. here simple code repeat data in table. app.directive('exampledirective', [ 'testprovider', 'testfactory', function (testprovider, testfactory) { return { restrict: 'e', template: '<table ng-repeat="person in per

html - How to display sessions information using php -

i trying display session information username, user login through login page, session has capture user entered username , should display in page. below have tried php script, not echoing username, kindly check in script errors, in advance. <?php session_start(); $_session['test']= $_post['myusername']; $name= $_session['test']; echo $name; ?> <form action="login.php" method="post"> <p>username</p> <input name="myusername" type="text" id="myusername" required> <p>password</p> <input name="mypassword" type="password" id="mypassword"required></br> <button><img src="http://icons.iconarchive.com/icons/webiconset/application/32/register-icon.png" /></button> </form> login.php output getting , going next page without displaying user name. you can't access ses

r - Perfect fit of ggplot2 plot in plot -

Image
i want plot restricted cubic spline main plot , add box-and-whisker plot show variation of x variable. however, lower hinge (x=42), median (x=51), , upper hinge(x=61) did not fit corresponding grid line of main plot. library(hmisc) library(rms) library(ggplot2) library(gridextra) data(pbc) d <- pbc rm(pbc) d$status <- ifelse(d$status != 0, 1, 0) dd = datadist(d) options(datadist='dd') f <- cph(surv(time, status) ~ rcs(age, 4), data=d) p <- predict(f, fun=exp) df <- data.frame(age=p$age, yhat=p$yhat, lower=p$lower, upper=p$upper) ### 1st plot: main plot (g <- ggplot(data=df, aes(x=age, y=yhat)) + geom_line(size=1)) # ci (g <- g + geom_ribbon(data=df, aes(ymin=lower, ymax=upper), alpha=0.5, linetype=0, fill='#ffc000')) # white background (g <- g + theme_bw()) # x-axis (breaks <- round(boxplot.stats(p[,"age"])$stats)) (g <- g + scale_x_continuous(breaks=breaks, limits=range(p[,"age"]), labels=round(breaks))) (

perl - How to check service success or error in controller in angularJS -

i have function in controller calls service function. code both. controller $scope.addnewproduct = function (newproduct) { var newproduct = {}; newproduct.productid = newproduct.id; newproduct.productname = newproduct.name; newproduct.productimagepath = newproduct.imagepath; newproduct.subcategoryid = newproduct.subcategory.id; newproduct.subcategoryname = newproduct.subcategory.name; newproduct.brandid = newproduct.brand.id; newproduct.brandname = newproduct.brand.name; newproduct.variants = []; productservice.addnewproduct(newproduct); $scope.newproduct = {}; $scope.newproduct.id = parseint($scope.products[0].productid) + 1; }; service productservice.addnewproduct = function(newproduct) { productlist.unshift(newproduct); var req = { url: "cgi-bin/addnewproduct.pl", method: 'get', params: {productid: newproduct.productid, productname: newproduct.productname, productima

javascript - Google Earth API Draw many placemarks without crashing the browser -

i using google earth api , want draw multiple placemark (points , polygons) on map @ once. actual scenario user have list of , can click them draw them 1 1 or click draw button start drawing 3000 placemarks. problem after few second browser/plugin crashes or prompts user stop plugin executing. this example code made : <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en""http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <head> <title>many points test!</title> <script src="http://www.google.com/jsapi?key=abqiaaaawbkbzlyhsmtcwxbtcjbgbrszhs7k5svaudm8ua-xxy_-2dywmxqmhnagaawto7l1fe1-amhuqxilxw"></script> <script> google.load("earth", "1"); var ge = null; function init() { google.earth.createinstance("map3d", initcallback, failurecallback); } function ini

php - Symfony2 enable profiler but cannot reach it -

i working on symfony2 project, trying enable profiler can further debugging. expect see x-debug-token-link under response headers dont see , cant see toolbar @ bottom of page. in routing_dev.yml seems these options enabled: framework: router: { resource: "%kernel.root_dir%/config/routing_dev.yml" } profiler: { only_exceptions: true } web_profiler: toolbar: true intercept_redirects: false yet cannot reach profiler. there missing...? make sure app_dev.php or other entry point enables debugging: debug::enable(); also make sure routing_dev.yml contains profiler routes: _profiler: resource: "@webprofilerbundle/resources/config/routing/profiler.xml" prefix: /_profiler

ios - Why isn't this If argument being implemented? -

Image
i asked question earlier ( stop segue , show alert partially not working - xcode ) and received answers asked me implement different methods of checking textfield before segue. however, realised amiss because 1 of if arguments being run fine. this code: import foundation import uikit import darwin class view3on3 : uiviewcontroller, uitextfielddelegate { @iboutlet weak var apteams: uitextfield! @iboutlet weak var aprounds: uitextfield! @iboutlet weak var apbreakers: uitextfield! override func viewdidload() { super.viewdidload() initializetextfields() } func initializetextfields() { apteams.delegate = self apteams.keyboardtype = uikeyboardtype.numberpad aprounds.delegate = self aprounds.keyboardtype = uikeyboardtype.numberpad apbreakers.delegate = self apbreakers.keyboardtype = uikeyboardtype.numberpad } override func touchesbegan(touches: set<uitouch>, withevent event: uievent?){ view.endediting(true) super.touchesbegan(to

sql server - PHP with MSSQL performance -

i'm developing project need retrieve huge amounts of data mssql database , treat data. data retrieval comes 4 tables, 2 of them 800-1000 rows, other 2 55000-65000 rows each one. the execution time wasn't tollerable, started rewrite code, i'm quite inexperienced php , mssql. execution of php atm in localhost:8000. i'm generating server using "php -s localhost:8000". i think 1 of problems, poor server huge ammount of data. thought xampp, need server can put without problems mssql drivers use functions. i cannot change mssql mysql or other changes that, company wants way... can give me advices how improve performance? server can use improve php execution? thank in advance. the php execution should least of concerns. if is, going things in wrong way. php should doing running sql query against database. if not using pdo, consider it: http://php.net/manual/en/book.pdo.php first way sql query structured, , how can optimised. if in complet