Posts

Showing posts from March, 2010

c++ - Overload resolution produces ambiguous call when template parameters added -

in following code compiler can resolve call f() call f(int&, const char*) . the call g() , however, ambiguous. lists 4 overloads possible overload set. if remove , typename t2, std::size_t i template argument list array argument, , hard code them instead, there no ambiguity , compiler picks g(t&, const char*) . how adding 2 template arguments makes ambiguous? can see how, though decay , casting, resolve 1 of overloads, cannot figure out how adding template parameters introduces ambiguity. i have testing on clang 3.8 (unreleased) , vc++ 2015. #include <string> void f(int&, const char*){} void f(int&, char(&)[8]){} void f(int&, bool){} void f(int&, const std::string&){} template <typename t> void g(t&, bool){} template <typename t> void g(t&, const char*){} template <typename t> void g(t&, const std::string&){} template <typename t, typename t2, std::size_t i> void g(t&, t2(&)[i]){} ...

python - Multiplication on slice of pandas dataframe -

i have dataframe this: year a_annex arnston bachelor berg 1955 1.625 0.940 nan nan 1956 1.219 1.018 nan nan 1957 2.090 1.20 nan 1.190 1958 0.950 1.345 nan 1.090 and want multiply in [1:,1:] .404 the code trying is: df=pd.read_csv(r'h:\sheyenne\grazing records\master_amu_complete.csv') hectare=0.404 df=df.iloc[1:,1:] df=df*hectare but returns: typeerror: not operate 0.404686 block values can't multiply sequence non-int of type 'float' printing df.info() says after slice non-null object if helps. yes, problematic value. can find these problematic values function (thanks ajcr): df = df.convert_objects(convert_numeric=true) first nan converted 0 , apply function above , return nan instead of problematic values. have find rows nan values , return subset of original df . pri...

android - Will Cloud Computing ever cost me more than what I am getting from ad revenue? -

i made app , bit cpu intesive. want delegate of work cloud computing. hypothetically, if source of revenue admob ads, there ever situation paying, $200 month more getting ad revenue, on pay-as-you-go plan? or need funding @ first or something? i'm using -> "google compute engine"; pricing: https://cloud.google.com/compute/pricing thank you. only emprical results can answer question. there no theory specific setup. for clue, have gae webapp source of income adsense ads , cost appengine hosting. application runs @ profit now, didn't when volume lower. according experience there seems "breaking point" going low volume medium when app starts become profitable. if ask whether chances of monetizing app has increased cloud computing, i'd answer yes.

how to schedule a quartz job with scala -

i trying simple example of quartz job running in scala. configure() gets executed once when module loaded. lazy val quartz = stdschedulerfactory.getdefaultscheduler override def configure() = { val job = new job { override def execute(jobexecutioncontext: jobexecutioncontext) = { println("event") } } val job = jobbuilder.newjob(job.getclass) .withidentity("job", "group") .build val trigger: trigger = triggerbuilder .newtrigger .withidentity("trigger", "group") .withschedule( cronschedulebuilder.cronschedule("0/5 * * * * ?")) .build quartz.start quartz.schedulejob(job, trigger) } however, error message when code runs. 2015-09-29 15:27:05,015 [defaultquartzscheduler_quartzschedulerthread] error org.quartz.core.errorlogger - error occured instantiating job executed. job= 'group.job' org.quartz.schedulerexception: problem instantiating class 'com.s...

ios - NSDateFormatter Returning Unexpected Time Values -

can explain me why following code returns inconsistent time values? i've been getting incorrect results when trying create nsdate object user specified date/time string , i've put following code below illustrate problem. // create 2 strings containing current date , time nsdateformatter * dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"yyyy-mm-dd"]; nsdateformatter * timeformat = [[nsdateformatter alloc] init]; [timeformat setdateformat:@"hh:mm:ss a"]; timeformat.amsymbol = @"am"; timeformat.pmsymbol = @"pm"; timeformat.timezone = [nstimezone timezonewithabbreviation:@"edt"]; nsdate * = [[nsdate alloc] init]; nsstring *thedate = [dateformat stringfromdate:now]; nsstring *thetime = [timeformat stringfromdate:now]; nslog(@"the current date/time (gtm): %@", now); nslog(@"the current date/time (edt): %@ %@", thedate, thetime); // combine date , time strings nsmutabl...

vector - How do I limit a for-loop in GLSL with a Vec3 as iterator? -

vec3 origin = vec3(0,0,0); vec3 stepvalue = vec3(0,1,0); vec3 destination = origin + (10*stepvalue); (vec3 stepper; stepper==destination; stepper += stepvalue) this not actual code, example doing same thing, except vectors aren't clean , easy these. this not work. loop not iterate @ all! using ... for(vec3 stepper; stepper==stepper; stepper += stepvalue) ... iterates through loop either until driver crashes, or until loop terminates manually. the operaters > , < , >= , <= aren't allowed vectors , lessthan / greaterthan neither. so how work this, besides running infinite loops? is there other option besides using == ? thanks! for (vec3 stepper = origin; all(lessthan(stepper, destination)); stepper += stepvalue) lessthan , lessthanequal , return bvec* can evaluated boolean value using functions all , any . however, aware still not iterate in example, since x , z of destination 0 , not >= stepper.

javascript - why is first child of the body undefined? -

it runs ok on body outputs undefined on first child. doing wrong? function doit(e) { console.log('tag: ' + e.tagname); console.log('nt: ' + e.nodetype); (var childelement in e.children) { doit(childelement); } } doit(document.body); <body> <ul id="fork"> <li id="myli" class="myclass">hello</li> </ul> </body> edit: this helped me finish css cleaner. check out [jsfiddle] for...in loops iterate enumerable properties, want iterate values. then, for (var prop in e.children) doit(e.children[prop]); however, that's bad way of iterating array-like objects. better use for (var = 0; i<e.children.length; ++i) doit(e.children[i]); or es5 array methods [].foreach.call(e.children, doit); function doit(e) { console.log('tag: ' + e.tagname); console.log('nt: ' + e.nodetype); ...

module - Why do F# functions evaluate before they are called? -

if define module such: module module1 open system let foo = console.writeline("bar") then, in interactive do #load "library1.fs" //where module defined open module1 i see [loading c:\users\jj\documents\visual studio 2015\projects\library1\library1\library1.fs] bar indicating foo function ran without me calling it! how/why happen? there way prevent it? i'm aware return value of foo whatever (console.writeline("bar")) evaluates to, , there isn't reason can't evaluated "immediately?" (when module loaded guess?) - there way prevent happening? if module functions alter state of other stuff, can ensure not evaluate until called? function bodies evaluated when function called, want. problem foo not function, it's variable. to make foo function, need give parameters. since there no meaningful parameters give it, unit value ( () ) conventional parameter: let foo () = console.writeline(...

python - Storing objects in class instance dictionary has unexpected results -

Image
apologies in advance lengthy post , has time take look. complete working example @ end of post. i understanding behavior of code. wrote 2 simple graph-oriented classes, 1 nodes , 1 graph itself. graph has dictionary track instance of node according index , self.nodes , node keeps list of neighbors, self.neighbors (these self's graph , node respectively). what's strange can complete list of node's neighbors going through graph instance nodes dictionary, if try neighbors of neighbors accessing node through node's neighbors list, node no neighbors, showing incorrect information. example, once read in , process graph, can print out each node , neighbors perfectly, calling graph instances's listnodes() , gives me 1 example graph: (i = 1, neighbors: 5 2 4 3) (i = 2, neighbors: 1) (i = 3, neighbors: 1 8 9) (i = 4, neighbors: 1 9 6) (i = 5, neighbors: 1) (i = 6, neighbors: 4 7) (i = 7, neighbors: 6) (i = 8, neighbors: 3) (i = 9, neighbors: 4 3) so can a...

c# - Why does Selenium not find an array-indexed XPath-based element when using Page Factory? -

i have pom (page object model) has following declaration: public class mypom { [findsby(how=how.xpath, using="(//textarea)[0]")] private iwebelement questiondescription; //this fails in selenium, successful in chrome-console: [findsby(how=how.xpath, using="(//input[@class='cso-num'])[0]")] private iwebelement questionscore; public mypom(iwebdriver driver) { pagefactory.initelements(driver, this) } } on chrome console, $x("//textarea")[0] query fires fine. however, each of xpath selectors has such "array based indexing" results in nosuchelementexception . i'm not sure problem is. every validation of xpath, outside of selenium seems return valid html dom node, not selenium. i added explicit pause, prior finding element on page follows no avail: webdriverwait wait = new webdriverwait(_driver, timespan.fromseconds(5)); however, if following in method, works fine: iwebelement questiondescription = getdriver...

php - how to check if a video id exists on youtube -

what trying check if video entered users exists or not , have searched lot , found : reretrieving_video_entry , looks deprecated, how possible using google apis client library php check if video exists or not? here's i'm using, works pretty well. youtube api v2. deprecated $video = "ck3n2dc3fds"; $ch = curl_init(); curl_setopt($ch, curlopt_url, 'http://gdata.youtube.com/feeds/api/videos/'.$video); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); $content = curl_exec($ch); curl_close($ch); if ($content && $content !== "invalid id" && $content !== "no longer available") { $xml = new simplexmlelement($content); }else { //doesn't exist } you can check if video exists using youtube data api (v3) . download/clone api here . and here's script made check if video exists given youtube video id. require_once dirname(__file__).'/../google...

c++ - CUDA Warps and Optimal Number of Threads Per Block -

from understand kepler gpus, , cuda in general, when single smx unit works on block, launches warps groups of 32 threads. here questions: 1) if smx unit can work on 64 warps, means there limit of 32x64 = 2048 threads per smx unit. kepler gpus have 4 warp schedulers, mean 4 warps can worked on simultaneously within gpu kernel? , if so, mean should looking blocks have multiples of 128 threads (assuming no divergence in threads) opposed recommended 32? of course, ignoring divergence or cases global memory access can cause warp stall , have scheduler switch another. 2) if above correct, best possible outcome single smx unit work on 128 threads simultaneously? , gtx titan has 14 smx units, total of 128x14 = 1792 threads? see numbers online says otherwise. titan can run 14x64 (max warps per smx) x32(threads per smx) = 28,672 concurrently. how can smx units launch warps, , have 4 warp schedulers? cannot launch 2048 threads per smx @ once? maybe i'm confused definition of maximum n...

dataframe - I want to generate 8 combinations of names from a column in an R data frame based on conditions from other columns in the same data frame -

i have data frame 20 players 4 different teams (5 players per team), each assigned salary fantasy draft. able create combinations of 8 players salaries equal or less 10000 & total points greater x excluding combinations contains 4 or more players same team. here data frame looks like: team player k d lh points salary pps 4 atn exoticdeer 6.1 3.3 6.4 306.9 22.209 1622 1.3692 2 atn supreme 6.8 5.3 7.1 229.4 21.954 1578 1.3913 1 atn sasu 3.6 6.4 11.0 95.7 19.357 1244 1.5560 3 atn el lisash 2 2.6 6.1 7.9 29.7 12.037 998 1.2061 5 atn nisha 2.7 5.6 7.5 48.2 12.282 955 1.2861 11 cl swiftending 6.0 5.8 7.8 360.5 22.285 1606 1.3876 13 cl pajkatt 13.3 7.5 9.3 326.8 37.248 1489 2.5015 15 cl sexybamboe 6.3 8.5 9.3 168.0 20.660 1256 1.6449 14 cl egm 2.8 6.0 13.5 78.8 21.988 989 2.2233 12 cl saksa 2.5 6.5 10.5 59.8 15.898 ...

Error in my Java code, Grade Book? -

i new coding, , taking online course learn java. had assignment assign (string) letter grades based on (int) grades. use tester program, i'm not savvy on how write such programs yet. is there error in code: string lettergrade = "f"; grade = grade; while (grade >= 90) { lettergrade = "a"; } if (grade >79) { lettergrade = "b"; } else if (grade > 69) { lettergrade = "c"; } else if (grade >59) { lettergrade = "d"; } return lettergrade; as pointed out in comments, think use of while here. should try understand first each statement means when code. anyway, should use 'if' instead of 'while' rest of stuff seems correct. if use 'while' , case seems true stuck in loop forever. and testing program not difficult use different test cases @ beginning put grade = 55; // random test case numbe...

c - trouble with forking 3 grandchildren from children, order and PID and PPIDs not right -

Image
hi have question creating more children fork() based upon earlier question asked using fork() make 3 children out of 1 parent in c (not c++) i want output (#s simplfied , used illustrate order) [grandpa]hi pid 1234 , come ####(dont care number is) [dad] hi pid 2111 , come ppid 1234 [son] hi pid 3111 , come ppid 2111 [son] hi pid 3112 , come ppid 2111 [son] hi pid 3113 , come ppid 2111 [dad] hi pid 2112 , come ppid 1234 [son] hi pid 3111 , come ppid 2112 [son] hi pid 3112 , come ppid 2112 [son] hi pid 3113 , come ppid 2112 [dad] hi pid 2113 , come ppid 1234 [son] hi pid 3111 , come ppid 2113 [son] hi pid 3112 , come ppid 2113 [son] hi pid 3113 , come ppid 2113 but output looks this: it seems ok @ end there regards dad ppid except last 1 , of pids seem out of order. don't know why there 1 son, 5, 3 sons. here code: int grandforking(null) { gen1 (null); return 0; } int gen1 (null) { void about(char *); i...

xml - Deserialization not filling data - C# -

i trying deserialize xml . sample xml given below <?xml version="1.0" ?> <transaction_response> <transaction> <transaction_id>25429</transaction_id> <merchant_acc_no>02700701354375000964</merchant_acc_no> <txn_status>f</txn_status> <txn_signature>a16af68d4c3e2280e44bd7c2c23f2af6cb1f0e5a28c266ea741608e72b1a5e4224da5b975909cc43c53b6c0f7f1bbf0820269caa3e350dd1812484edc499b279</txn_signature> <txn_signature2>b1684258ea112c8b5ba51f73cda9864d1bb98e04f5a78b67a3e539bef96ccf4d16cff6b9e04818b50e855e0783bb075309d112ca596bdc49f9738c4bf3aa1fb4</txn_signature2> <tran_date>29-09-2015 07:36:59</tran_date> <merchant_tranid>150929093703rudzmx4</merchant_tranid> <response_code>9967</response_code> <response_desc>bank rejected transaction!</response_desc> <customer_id...

c# - Extract Multiple Occurances of Variable Length Text Without Multiple Patterns -

Image
from following data .xxx[val1, val2, val3] values of val1 , val2 , val3 need extracted. if 1 uses pattern @"\[(.*?), (.*?), (.*?)\]" data can extracted, when data string varies fails all data. take these variable examples .xxx[val1] or .xxx[val1, val2, val3, val4, val5] or .xxx[{1-n},] . what single regular expression pattern can achieve results on sets of data provided examples? what correct pattern this? the best practice not match unknown, design pattern after knowns. in similar practice, not blindly match using .* (zero or more of anything) backtracking can horrendously slow; why add complexity when not needed. frankly 1 should favor + 1 or more usage more * 0 or more should used when specific items may not appear. the string can vary. it appears example if think compiler, tokens separated either , or ending ] . let develop pattern knowledge (the knowns). the best way capture consume until known found. using not set o...

php - Send email with proxy IP using CURLOPT_CONNECT_ONLY -

what problem here? can't send email server different ip address (for example proxy here). warning: curl_setopt() expects parameter 2 long, string given in [link] on line 12 <? $ch = curl_init(); curl_setopt($ch, curlopt_proxy, "103.10.22.242"); curl_setopt($ch, curlopt_proxyport,3128); curl_setopt($ch, curlopt_connect_only,true); curl_exec($ch); echo curl_error($ch); $to = "you@your-domainname.com"; $nameto = "who to"; $from = "script@your-domainname.com"; $namefrom = "who from"; $subject = "hello world again!"; $message = "world, hello!"; mail($from, $namefrom, $to, $nameto, $subject, $message); ?> an ip address can represented single number. googled ip long converter , found this . the equivalent long value ip 1728714482 .

excel - I want randomly to select a cell from a table of values on the same workbook -

i trying select random cell table of values on excel worksheet. have tried use many different functions nothing has worked. to random cell address 10x10 range top left cell d4 please try: =address(randbetween(4,13),randbetween(4,13))

r - RStudio windows size -

in rstudio, can adjust size of 4 windows (or panels): text editor, console, environment/history, files/plots/packages/help/viewer. i export plots rstudio , paste in ms word or save image file. concern size of plot different every time because adjust size of panels need. is there way adjust panels' sizes same sizes did before after randomly adjust panel sizes? if can specify panel size numbers, can it, rstudio not provide such feature. this code writes plot in png format (good web), specified width, height, , resolution. (in case, 400 pixels / 72 pixels per inch = 5.56 inches across-- every time ). see here more detail , other formats. png(file="your_plot",width=400,height=350,res=72)

ios - How to change UIAlertController button text colour in iOS9? -

the question similar ios 8 uiactivityviewcontroller , uialertcontroller button text color uses window's tintcolor in ios 9. i have uialertcontroller , dismiss button keeps white colour have tried set [[uiview appearancewhencontainedin:[uialertcontroller class], nil] settintcolor:[uicolor blackcolor]]; uialertcontroller *strongcontroller = [uialertcontroller alertcontrollerwithtitle:title message:message preferredstyle:preferredstyle]; strongcontroller.view.tintcolor = [uicolor black]; i've run similar in past , issue seems stem fact alert controller's view isn't ready accept tintcolor changes before it's presented. alternatively, try setting tint color after present alert controller: [self presentviewcontroller:strongcontroller animated:yes completion:nil]; strongcontroller.view.tintcolor = [uicolor black];

android - Link login activity to the main activity that can pass the user id -

how pass user id next activity using android studio? in app if user enter invalid password in login activity still go same activity valid password.. how want solve it. this code login.php <?php require "init.php"; $user_name = $_post["login_name"]; $user_pass = $_post["login_pass"]; $sql_query = "select name user_info user_name '$user_name' , user_pass '$user_pass';"; $result = mysqli_query($con,$sql_query); if(mysqli_num_rows($result) >0 ) { $row = mysqli_fetch_assoc($result); $name =$row["name"]; echo "success"; } else { echo "fail"; } ?> code background.java (asynctask) protected void onpostexecute (string result) { if (alertdialog.setmessage(result)=="success") { alertdialog.show(); intent intent = new intent(ctx, index.class); ...

c++ - Need help Fixing these errors with classes -

i need understanding these error. have been trying figure out can't working. algorithm adding right? here current error: 'dem' not declared in scope. i thought header file takes care of initialization. rational.h #ifndef _rational_h_ #define _rational_h_ #include <iostream> using namespace std; class rational { int num; //p int dem; // q public: rational(); rational(int p, int q = 1); void display() const; // _p:_q void add(const rational&); }; #endif rational.cpp #include "rational.h" int main() { rational r1(1 ,2); rational r2(1,4); r1.add(r2); r1.display(); } void add(const rational&h2) { int i, k; rational fract; add(h2); = dem; k = h2.dem; num*= k; dem*=k; num = +r2.num*i; //return } you're defining add() global free function, not member function of class rational . can't access member variable dem in it. change void add(co...

php - Laravel on Raspberry Pi : PDOException could not find driver -

i've installed laravel on raspberry pi 2 using php 5.6.13 (raspbian os). has worked until attempted migration php artisan migrate . resulted in error [pdoexception] not find driver . i haven't been able figure out i'm missing. i've installed php5-mysql module using apt. i've set extension_dir in php.ini extension=pdo_mysql.so . i know can use homestead prefer understand missing in current set up, please refrain suggesting homestead. does have idea missing? it's driving me crazy!

List 8 latest products on homepage - Magento 1.9.2.1 -

i know question gets asked quite bit , seems straight forward can't seem find post states answer works. there few solutions on how list products marked 'new from' date in backend , there solutions list latest products specific category need 8 added products catalog full stop. currently manually adding products 'latest products' category id of 116 and have in content of home page cms page: {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="116" template="catalog/product/list-latest.phtml"}} then in list-latest.phtml template file, have code collection: <?php $_productcollection=$this->getloadedproductcollection()->setpagesize(10); $_productcollection->clear(); //this unset loaded items. $_productcollection->getselect()->limit(10); //set new limit $_productcollection->getselect()->reset(zend_db_select::...

Jquery Slide function -

i've been little confused how i'm supposed connect jquery page, , i'm still still relatively new learning javascript/jquery. when put script in head nothing happens when click on have set in file below. on jfiddle works fine. i have portion of site want have mock iphone people visit page can click on it. i used jfiddle found on stack overflow: how make div slide right left there's link goes jqueryui , shows script slide effect there. supposed use in head? <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> this jfiddle tweaked i'm looking achieve: http://jsfiddle.net/tokyothekid/weujtht5/ here's current code in head: <link rel="stylesheet"href="//code.jquery.com/ui/1.11.4/themes/smoot...

SQL Server 2008 R2: Remove single occurrence record. -

Image
i have following table 2 columns shown below: create table test_lin ( cola int, colb int ); insert test_lin values(1,2); insert test_lin values(1,3); insert test_lin values(1,4); insert test_lin values(1,5); insert test_lin values(1,3); insert test_lin values(2,4); insert test_lin values(2,6); insert test_lin values(2,7); insert test_lin values(2,4); insert test_lin values(2,6); note : want show records repeated more once. in case (1,3),(2,4),(2,6) records repeated in table. i want remove single occurrence records result set. records single occurrence shown below in image. with cte ( select cola,colb,row_number() over(partition cola,colb order cola) rn test_lin ) select t.* test_lin t inner join cte c on c.cola = t.cola , c.colb = t.colb , c.rn=2

Removing index.php from url in codeigniter using .htaccess? -

http://localhost/codeigniter/index.php/user/main_page how can remove index.php url ? try file. use in projects https://github.com/eborio/curso-de-codeigniter/tree/master/02-primeros-pasos

azure - Get a list of devices from Notification Hub -

i using azure notification hubs manage device registrations. i using azure mobile services push notification request notification hub. using tags, able use notification hub broadcast sender's message group of recipients. my new requirement is, want sender able send notification particular device belongs particular tag. means need way sender list devices registered to, say... "football" tag, have sender choose device send to, , tell notification hub send notification device. how achieve that? need write api returns devices belong tag sender right? notification hubs allows users extract registrations associated single device. take @ https://msdn.microsoft.com/en-us/library/azure/dn223274.aspx , should help.

How to replace last line in Windows batch code? -

i trying make text-based game, , when user enters something, want computer's character have kind of thinking animation. i've come this: [. ] [.. ] [...] only problem is, want on 1 line, it's actual animation. i've recreated without removed text echo'd, requires cls, send on screen before, three times. takes space , pretty inefficient. i found code changes last without clearing before it, @echo off echo won't disappear! setlocal enabledelayedexpansion /f %%a in ('copy /z "%~f0" nul') set "cr=%%a" /l %%n in (5 -1 1) ( <nul set /p "=this window close in %%n seconds!cr!" ping -n 2 localhost > nul ) it counts down without erasing echo before, not understand how adapt add periods string... know way this? thanks! you there code found; need use own text instead of else's. for /l %%a in (1,1,3) ( set /p "=."<nul ping -n 2 localhost >nul ) if want put periods inside ...

javascript - window.onload get something wrong -

i got information others' api,but not take out,so write in input. for(var x=0;x< loc.length;x++){ point[x]=new window.bmap.point(loc[x].lat, loc[x].lng); getloc(point[x],x); } function getloc(pt,i){ gc.getlocation(pt, function(rs){ var addcomp = rs.addresscomponents; var dd= addcomp.city + "" + addcomp.district + "" + addcomp.street; var addname="address"+i; var text="<input type='hidden' value="+dd+" name="+addname+" />"; $(".page-container").append(text); }); } then problems happened. here window.load window.onload=function(){ var container_1_set={ chart: { type: 'column' }, title: { text: 'sudden turn' }, xaxis: { categories: [] }, yaxis: { min: 0, t...

32bit 64bit - Clockworkmod Tether fails on "libncurses.so.5" -

while trying install clockworkmod tether app on linux, following error; adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: no such file or directory you need install 32-bit version of ncurses library. sudo apt-get update sudo apt-get install lib32ncurses5

unable to access wp-admin after change theme on wordpress -

i cannot access wp-admin, , search on internet , suggest me delete first blank space on file function.options.php, there not blankspace. how should ? warning: cannot modify header information - headers sent by (output started @ /home/voalahui/public_html/wp-content/themes/rebound/admin/functions/functions.options.php:1) in /home/voalahui/public_html/wp-includes/pluggable.php on line 1207 when open function.option.php <?php add_action('init','of_options'); if (!function_exists('of_options')) line 1 there not blank space deleted so, reupload again file hosting, , make sure there not file failed, , it's fixed

javascript - Error with User Sign up with Parse -

so i'm using following js function signing users on website. uses parse. currently, function automatically returns account not created after fill info , click on submit. register-submit id of button. there no error messages either on console. i'm new javascript , parse , not sure i'm messing up. appreciated! <script> $(function(){ event.preventdefault(); $('#register-submit').on('click', function(event) { parse.initialize("s1ysdcya6vuddvfaxkgegzlxovdf8pfg4ymtvjcy", "kgjrcbggvuyfoiqt8haksjhodu1bextqqgnk0hnl"); var user = new parse.user(); var form = document.getelementbyid("register-form") var usernameval = form.username.value; var passwordval = form.password.value; var emailval = form.email.value; user.set('username',usernameval); user.set('password',passwordval); user.set('email',emailval); user.signup(null, { success: ...

qtp - Object required: UFT -

can't further on here. in situation i've select webcheckbox depending on index. below code set brw = browser("title:=.*").page("title:=.*") milestonetblrow=brw.webtable("cols:=7","column names:=;milestone name;milestone date;description;created time;modified time;action").rowcount milestonetblcol=brw.webtable("cols:=7","column names:=;milestone name;milestone date;description;created time;modified time;action").columncount(1) = 2 milestonetblrow step 1 set milestonetbl = browser("title:=.*").page("title:=.*").webtable("cols:=7","column names:=;milestone name;milestone date;description;created time;modified time;action") `milestonetbl.childitem(i,1,"webcheckbox",0).set "on" browser("title:=.*").page("title:=.*").webbutton("name:=mass edit","type:=button","html tag:=input","index:=0...

node.js - How do i pass a user object to a partials in ejs? -

i'm trying render user's name on navbar, navbar in partial folder , none of routes in node.js renders navbar.ejs because partial. i'm using ejs-mate library having reusable layout component used other's html components don't need copy , paste codes (following dry principle), why? because ejs doesn't have built in reusable layout component's feature, , other libraries not maintained other developers. currently i have 2 routes app.get('/', passport.isauthenticated, function(req, res) { res.render('home' { user: req.user }); }); app.get('/anotherroute', function(req, res) { res.render('test'); }); i have 2 ejs files home.ejs <%- layout('boilerplate') %> <h1>home page</h1> another.ejs <%- layout('boilerplate') %> <h1>another page</h1> those 2 ejs files using boilerplate.ejs layout, don't copy , paste same codes on , on again. boilerpla...

postgresql - Trigger not updating tsvector on insert/update -

i'm trying munge data few columns across few tables make full-text searchable, i'm not having luck. here's function: create or replace function on_customer_save_udpate_tsv() returns trigger $$ declare tsv_text text; begin select string_agg(cust_text.text, ' ') agg_text tsv_text (select concat("name", ' ', "phone") text "customers" "id" = new.id union select concat("firstname", ' ', "lastname", ' ', "phone", ' ', "email") text "contacts" "customerid" = new.id union select concat("streetline1", ' ', "city", ' ', "state", ' ', "zip") text "addresses" "customerid" = new.id) cust_text; new.tsv := to_tsvector(coalesce(tsv_text,'')); return new; end $$ language plpgsql; here's trigger: ...

AEM 6.1 configuration for Search Sugesstion and StopWords -

we using aem6.1 , implementing ootb search functionality. requirement have implement stopwords(will not user search common words such like,for,is) , spellcheck(did mean ?) features part of implementation.can suggest best way achieve requirement. thanks you can configure stopwords in oak index definition. -fulltextindex - jcr:primarytype = "oak:queryindexdefinition" - compatversion = 2 - type = "lucene" - async = "async" + analyzers + default - class = "org.apache.lucene.analysis.standard.standardanalyzer" - lucenematchversion = "lucene_47" (optional) + stopwords (nt:file) please check following documentation on oak[1]. to see more details on better follow jira story on jackrabbit oak jira[2]. part of oak1.1.2 , since aem6.1 comes oak1.2.2, should able configure stop words directly. [1] - https://jackrabbit.apache.org/oak/docs/query/lucene.h...

Android application is not working in lower version like Gingerbread -

i trying developing application work in android version api level 23 api level 8.while debugging application working on latest version api, not working on lower version gingerbread. i try change minsdkversion , did not solve issue. while debugging in lower version showing error "installation failed since device possibly has stale dexed jars don't match current version (dexopt error). in order proceed, have uninstall existing application." build.gradle apply plugin: 'android' dependencies { compile filetree(dir: 'libs', include: '*.jar') compile 'com.google.android.gms:play-services:7.8.0' compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.android.support:support-v4:21.0.3' } android { compilesdkversion 22 buildtoolsversion "21.0.0" defaultconfig { applicationid "org.linphone" minsdkversion 9 targetsdkversion 22 versioncode 1 versionname "1.0...

c# - Microsoft band heart sensor sampling rate and event control -

i have obtained data heart rate sensor , heart rate quality sensor using following code:- ienumerable<timespan> supportedheartbeatreportingintervals = bandclient.sensormanager.heartrate.supportedreportingintervals; bandclient.sensormanager.heartrate.reportinginterval = supportedheartbeatreportingintervals.first<timespan>(); ..... [other not relevant code excluded] bandclient.sensormanager.heartrate.readingchanged += (s, args) => { hrdt = args.sensorreading.heartrate; }; { await bandclient.sensormanager.heartrate.startreadingsasync(); await task.delay(timespan.fromseconds(5)); await bandclient.sensormanager.heartrate.stopreadingsasync(); dsphr = hrdt.tostring(); } bandclient.sensormanager.heartrate.readingchanged += (s, args) => qltyhr = string.format("{0}",args.sensorreading.quality); this code working nicely , here sample output file writing richard;;8:48:04 am;64 richard;acquiring;8:48:19 am;64 richard;acquiring...

javascript - Expand div from center of the body using jQuery -

how expand / grow div center? expands top left bottom right. here's jsfiddle . <div class="growme">test</div> $('.growme').animate({ width: '100%', height: '100%', opacity: 1, }, 'normal'); .growme { background-color: #990000; height: 0; width: 0; position: absolute; filter: alpha(opacity=0); opacity: 0; } try make .growme class center of body. adding top, left,bottom , right 0. $('.growme').animate({ width: '100%', height: '100%', opacity: 1, }, 'normal'); .growme { background-color: #990000; height: 0; width: 0; position: absolute; filter: alpha(opacity=0); opacity: 0; top:0; left:0; bottom:0; right:0; margin:auto; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="growme"...

android - Check BLE support on device through adb -

i'm testing multiple device test if android device support ble or not. 1 way know via programming done, apart there way test via adb . any suggestion here! as said hardware/system features can checked program. come question, 2 conditions here. if phone manufactured/market phone , not rooted. no, can not check it. if device development phone or platform such panda or else. yes, can go adb shell, , there files(such bt_conf.xml, bt_stack.conf , bt_hardware something) stored in system folders can check features enabled device. 1 important thing note, program checks here. :) :) happy coding.

pom.xml - How to set the Maven artifactId at runtime? -

i define artifactid in pom @ runtime. aware answers this question bad practise , maven archetypes should used instead, know if possible @ all. currently have pom artifactid this: <artifactid>myproject${var}</artifactid> and can build project setting variable on command line: mvn install -dvar=justatest now possible change input variable @ runtime? example convert uppercase (e.g. gmaven-plugin) or similar? you cannot change artifactid @ build-time. part of maven coordinates (groupid:artifactid:version) must fixed. all other parameters change during build maven-antrun-plugin . <plugin> <artifactid>maven-antrun-plugin</artifactid> <version>1.8</version> <executions> <execution> <id>touppercase</id> <goals> <goal>run</goal> </goals> <configuration> <target> ...

Is there any android framework for sync data between local file and server? -

in app, user data server, save these data local file of phone, same data don't need load server again. if there new messages send user, these data need load server. intended myself, seems functionality not simple imagined. think common functionality, there framework focus on it? please give me guidance. i recommend read sync adapter the sync adapter component in app encapsulates code tasks transfer data between device , server. based on scheduling , triggers provide in app, sync adapter framework runs code in sync adapter component.

visual studio - Get file version of the running exe installer -

i'm using wix application installation , trying add installation build number tfs text in on of dialogs. all application dll's , installer has build number file version. i able accomplish getting file version of existing exe(from post: getting file version of native exe in msbuild ) but not of running exe . <?define property_productversion = "!(bind.fileversion.uxidtest)" ?> <product id="$(var.productid)" name="$(var.productdisplayname)" language="1033" version="$(var.property_productversion)" manufacturer="$(var.property_manufacturer)" upgradecode="$(var.productupgradecode)"> <package installerversion="300" compressed="yes" installscope="permachine" installprivileges="elevated" /> <directory id='targetdir' name='sourcedir'> <directory id='xxx'> <component...

How to edit Invoice sending to email after success from paypal in oscommerce -

i trying find invoice sends user on success paypal in oscommerce. found invoice.php under admin folder. want add field in invoice sending user didnot found desired file the answer simple email sending through checkout_process.php file. search tep_mail on line 257 or nearby.

javascript - Trying to set a hub server for togetherjs application and i am using node.js to run the server i get the following error -

error: cannot find module 'websocket-server' @ function.module._resolvefilename (module.js:336:15) @ function.module._load (module.js:286:25) @ module.require (module.js:365:17) @ require (module.js:384:17) @ object. (d:\rahul\hubserver\togetherjs-develop\togetherjs-develop\hub\websocket-compat.js:27:28) @ module._compile (module.js:434:26) @ object.module._extensions..js (module.js:452:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) @ module.require (module.js:365:17) that means have not installed module. npm install websocket-server usually instead of doing manually have package.json file , can install modules doing npm install i'd want save websocket-server package run command: npm install websocket-server --save remember npm install __ in directory of site is. otherwise node won't find it.