Posts

Showing posts from May, 2010

MySQL - Total count & rate of change in a single SQL query -

i'm trying extract total number of website hits plus rate of change(rate of increase/decrease) per client per city per day percentage in single sql query not able right. i've created example @ http://www.sqlfiddle.com/#!9/fd279/8 could please request assistance? try avoiding inner join, has wrong condition anyway ( t1.hitdate = t2.hitdate , t1.hitdate-1 = t2.hitdate can't satisfied): select t1.hitdate, t1.city, t1.client, sum(t1.numvisits) - ifnull((select sum(t2.numvisits) page_hits t2 t2.hitdate = t1.hitdate-1 , t2.city = t1.city , t2.client = t1.client), 0) rate_of_change page_hits t1 t1.client='c' group hitdate, city order hitdate;

testing - Soft keyboard not present, cannot hide keyboard - Appium android -

i getting following exception: org.openqa.selenium.webdriverexception: unknown server-side error occurred while processing command. (original error: soft keyboard not present, cannot hide keyboard) (warning: server did not provide stacktrace information) command duration or timeout: 368 milliseconds i using driver.hidekeyboard() hide soft input keyboard open on screen. how ensure keyboard open before hiding it? or other workaround? use adb command check whether keyboard has popped or not adb shell dumpsys input_method | grep minputshown output : mshowrequested=true mshowexplicitlyrequested=false mshowforced=false minputshown=true if minputshown=true yes software keyboard has popped up. use driver.presskeycode(androidkeycode.back); one way using java is process p = runtime.getruntime().exec("adb shell dumpsys input_method | grep minputshown"); bufferedreader in = new bufferedreader(new inputstreamreader(p.getinputstream()));

javascript - display user end error before submitting a form -

i have form through wish add values in database. working fine, validation have added server end validation, errors if displayed after form has been submitted, wish use user end validation in way if user not enter field, not entering proper format or password not match, error should displayed simultaneously i.e before hitting submit button. can tell how can done <?php if ($_server["request_method"] == "post") { if (empty($_post["email"])) { $emailerr = "email required"; } else { $email =$_post["email"]; } if (empty($_post["password"])) { $pswrderr = "password required"; } else { $password = $_post["password"]; } if ($_post["password"]!=$_post["retype_password"])

osx - Set imported certificate to always be trusted in Mac OS X -

Image
i have generated certificate in pfx format in mac os x , imported system keychain using: sudo security import server.pfx -k /library/keychains/system.keychain -p foobar the problem trusts set no value specified . how can set trust code signing always trust using command line . the -p option may need. can specified more once each of settings. wish knew how deny 1 specific item while trusting in same line. sudo security add-trusted-cert -d -r trustroot -p [option] -k /library/keychains/system.keychain <certificate> -p options ssl, smime, codesign, ipsec, ichat, basic, swupdate, pkgsign, pkinitclient, pkinitserver, timestamping, eap

Styling DatePicker Android Marshmallow -

i'm struggling android calendar styling. turns out android 6 ignores calendartextcolor , uses textcolorprimary in order style day labels textcolorsecondary style day of weeks. i've checked calendartextcolor on android 5 , works correctly. according documentation textcolorprimary used toolbar text color. https://developer.android.com/training/material/theme.html toolbar text color white , receive white day labels on white background. how specify calendartextcolor without touching textcolorprimary android api 23? you make custom theme datepicker , specify text color there try this <style name="datepickertheme" parent="theme.appcompat.light.dialog"> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/colorprimary</item> <item name="android:textcolorprimary&

html - Prevent multiple submenu's from being visible at the same time (due to transition delay) when only one is being hovered -

updated code example here. it's hard summarise in title, made codepen show what's happening: http://codepen.io/erikdevos/pen/ejmmpy /* menu container styling */ #nav { background: #f5f5f5; width:500px; display:flex; } /* style unondered lists */ ul { text-decoration: underline; list-style-type: none; background: #cecece; } /* give submenu different background */ ul li ul { background: #e3e3e3; } /* add pointer menu */ ul:hover { cursor: pointer; } /* make menu items visible when menu hovered */ ul:hover > li { visibility: visible; transition-delay: 0s; } /* make menu items , add transition delay */ ul > li { visibility: hidden; transition-delay: .5s; } ul li:hover li { visibility: visible; transition-delay: 0s; } ul li:hover ul{ visibility: visible; transition-delay: 0s; } the menu html looks this <div id="nav"> <ul>menu <li>i

angularjs - Angular: Order html elements depending on scope varaible -

i have 2 divs want show on page. order of 2 divs depends on value of variable on scope. the trivial way of doing repeating divs code twice in page, each time in different order: <div class="option 1" ng-if="value"> <div class="div 1"> <p>"this content div 1"</p> </div> <div class="div 2"> <p>"this content div 2"</p> </div> </div> <div class="option 2" ng-if="!value"> <div class="div 2"> <p>"this content div 2"</p> </div> <div class="div 1"> <p>"this content div 1"</p> </div> </div> is there way this, without repeating code? if not support ie9 guess can use flexbox order css property conditional class. <div class="main"> <div ng-class="{after: !value}">this

authentication - How to achieve client validation in iOS? -

how verify if api being hit actual application , not going through mitm attacks. i understand ssl certificates can used achieve transport level security , app can sure taking correct server, how can attain same thing app side. i want make sure app hitting services , hit not coming somewhere don't trust. thanks have @ ssl again - offers client certificates, example, so. yet, shifts problem attacker might use same mechanism apps use certificates. (an shared api token considered okay , easier implement.) in general, cannot achieve guarantee that. might result issueing certificates based on user authentication external means (e.g. make users put in user names , passwords) or make hard adversaries abuse api using reverse turing tests (e.g. automated programms tell computers , humans apart, aka captchas).

c# - How to shim HttpWebRequest Headers? -

i trying shim following code: httpwebrequest request = (httpwebrequest)webrequest.create(uri); request.method = "get"; request.headers.add("authorization", "bearer " + authtoken.token.access_token); request.accept = "application/json"; but running unit test throws exception in part: request.headers.add() because request.headers null . this, in spite of initializing headers in test: shimhttpwebrequest request = new shimhttpwebrequest(); shimwebrequest.createstring = (urio) => { request.instance.headers = new webheadercollection { {"authorization", "bearer abcd1234"} }; //also tried initilizing this: //webheadercollection headers = new webheadercollection(); //headers[httprequestheader.authorization] = "bearer abcd1234"; //request.instance.headers = headers; return request.instance; }; but request.instance.headers still null . what missing? i solved creating ge

utf 8 - Storing swedish characters in mysql database -

i'm having problems storing swedish characters in mysql database. want store them in table called users collation utf8-bin. though i'm using utf8, characters Ã¥ ä ö gets stored Ã¥ ä ö , don't know why. retrieving data , echoing gives me same output, weird characters instead of Ã¥ ä ö . appreciated. call mysql_set_charset("utf8"); after connecting , before making queries. your database charset storage, not transmission between app , database.

angularjs - Run project on Jhipster only shows "This is your footer" -

Image
i have read question jhipster display "this footer" only. referenceerror: angular not defined . answer on question not me. when have run jhipster project - window browser showed text "this footer". screen browser: node version: v4.2.6 npm version: 3.5.3 this bower.json: { "name": "tanga", "version": "0.0.0", "apppath": "src/main/webapp", "testpath": "src/test/javascript/spec", "dependencies": { "angular": "1.4.8", "angular-aria": "1.4.8", "angular-bootstrap": "0.14.3", "angular-cache-buster": "0.4.3", "angular-cookies": "1.4.8", "angular-dynamic-locale": "0.1.28", "angular-i18n": "1.4.8", "angular-local-storage": "0.2.3"

Add Postage and Packaing to Paypal link HTML -

im trying add postage , packaing on top of href link paypal far have this: <a href="https://www.paypal.com/cgi-bin/webscr?business=needemail@paypal.com&cmd=_xclick&currency_code=gbp&amount=13.50&item_name=blue/pink%20wallpaper%20sku%20lu%20w4"> buy </a> however wish add postage , packaing code not sure / add...? dont worry found out adding &shipping=4.95 html code adds shipping.

boot2docker - Docker volumes doesn't exist for data container in 1.9.1 -

docker toolbox 1.9.1 on windows 7 platform the data container created doesn't have volumes when use docker inspect command. $ sudo mkdir /abc $ docker run -d --name data -v /abc:/hostabc busybox true $ docker inspect --format "{{ .config.volumes }}" data map[] i tried in 1.7.1, shows below $ docker inspect --format "{{ .volumes }}" data # in 1.7.1 volumes directly map[/hostabc:/abc] anything did wrong create data container ? or there other place check volumes in data container. try instead docker inspect -f '{{ (index .mounts 0).source }}' containerid if have multiple sharing, simple use range below docker inspect -f '{{range $k := .mounts}}{{println $k.source }}{{end}}' containerid as mentioned here , changed since docker 1.8 note: pr 45 raised op now merged directives like: version=`$docker -v 2>&1 | awk -f'[ .]' '{printf "%2.f%02.f%02.f",$3,$4,$5}'` # echo $version

html5 - Javascript not working inside bootstrap carousel item? -

i ran issue , wonder if there's solution it: i have html5 page bootstrap carousel on it, contains div's show content. 1 of these div's contains buttons meant call js functions. noticed none of these functions ever called, simple console.log not work: <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false" > <div class="carousel-inner" role="listbox"> <div class="item active" > <button onclick="console.log('test!');">test</button> ... all tags closed correctly, omitted further lines clarity here. carousel works expected, nothing wrong that, javascript within not show reaction. when place same button tag outside carousel, console gives me "test!" in console. what's problem here, can fixed? or need avoid carousel when need js within content?

ios - How to add multiple Detail View Controllers in Master-Detail application -

i trying build ipad master-detail app. master view tableviewcontroller . want change complete detail view every different cell user taps in master view. 1 of detail view controllers has allow user type data, other view something, etc. how can add more detailviewcontrollers master-detail app? you should use replace segues purpose. connect many view controllers want directly master controller (not cells) replace segues, , give them identifiers. in didselectrowatindexpath:, implement whatever logic need relate index path controller want segue to, , call performseguewithidentifier:sender: initiate segue. if need pass data on next controller, can in prepareforsegue.

node.js - socket.emit is not working in session.socket.io -

i trying create simple chat application using session.socket.io , rabbitmq , redis session storage. app.js var express = require('express'), http = require('http'), path = require('path'), redis = require('redis'), amqp = require('amqp'), logger = require('morgan'); users = {}; var session = require('express-session'); var rabbitconn = amqp.createconnection({}); var chatexchange; rabbitconn.on('ready', function () { chatexchange = rabbitconn.exchange('chatexchange', { 'type': 'fanout' }); }); var app = express(); var server = http.createserver(app); var io = require('socket.io')(server); io.set("transports", ["polling"]); var redisstore = require('connect-redis')(session), rclient = redis.createclient(), sessionstore = new redisstore({ client

for loop - Why does my PHP code doesn't work anymore for no reason? -

i have loop in code. haven't changed on part of code 5-6 days , never had problems it. since yesterday tried reload code , allways gives me error: maximum execution time of 30 seconds exceeded - in logcontroller.php line 270 well can't explain why maybe of on it. this code around line 270. $topten_sites = []; ($i = 0; $i <= count($sites_array); $i++) { if ($i < 10) { // 270 $topten_sites[] = $sites_array[$i]; } } $topten_sites = collect($topten_sites)->sortbydesc('number')->all(); as said, worked perfectly, why gives me error? if uncomment these lines , every other line contains $topten_sites array, code workes again. this looks wrong: ($i = 0; $i <= $sites_array; $i++) { if ($i < 10) { // 270 $topten_sites[] = $sites_array[$i]; } } if $sites_array array, makes no sense compare integer have never-ending loop. if need first 10 elements in array, can replace loop with:

sql - Why doesn't my query return correct results? -

i have used these temp table return total no of solved cases , total number of pending cases same table grouped district e.g. district totalsolvedcases totalpendingcases 3 1 b 8 6 c 7 1 i have done doesn't return correct result select * #table1 ( select count(cases.pk_cases_caseid) totalcases, districts.districtname cases inner join concernedoffices on concernedoffices.pk_concernedoffices_id = cases.fk_concernedoffices_cases_concernedofficeid inner join districts on districts.pk_districts_districtid = concernedoffices.fk_districts_concernedoffices_districtid inner join casehearings on casehearings.fk_cases_casehearings_caseid = cases.pk_cases_caseid casehearings.isclosingdate = 1 group districts.districtname ) d select * #table2 ( select count(cases.pk_cases_caseid) totalpedningcases, districts.districtname cases inner join concer

javascript - Ionic run function before app closes -

is there kind of function can call listens whether app exit, or close or go background.. event means "the user has stopped using app"? i'm app build 'user log' tracks user navigating through app. instead of sending little pieces of data server these events occur, want send off whole batch in 1 go before user stops using app (again, whether means closing app completely, sending background etc.) and lastly, if such function indeed exist.. put function? in app.js ? or have put listener in every single controller of app? you can check events list cordova docs: https://cordova.apache.org/docs/en/5.4.0/cordova/events/events.html in particular pause event : the event fires when application put background. document.addeventlistener("pause", yourcallbackfunction, false);

Module_six_moves_urllib_parse object has no attribute urlparse when using plot.ly for Python -

i running below code in jupyter: import plotly.plotly py import plotly.graph_objs go # create random data numpy import numpy np n = 100 random_x = np.linspace(0, 1, n) random_y0 = np.random.randn(n)+5 random_y1 = np.random.randn(n) random_y2 = np.random.randn(n)-5 # create traces trace0 = go.scatter( x = random_x, y = random_y0, mode = 'markers', name = 'markers' ) trace1 = go.scatter( x = random_x, y = random_y1, mode = 'lines+markers', name = 'lines+markers' ) trace2 = go.scatter( x = random_x, y = random_y2, mode = 'lines', name = 'lines' ) data = [trace0, trace1, trace2] # plot , embed in ipython notebook! py.iplot(data, filename='scatter-mode') i got error result as: /library/python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:315: snimissingwarning: https request has been made, sni (subject name indication) extension tls not available on platf

html - Jquery removeClass, addClass -

i having poblems removeclass , addclass function. trying change font awesome class when dropdown clicked open. have attempted several times make work think must overlooking something. here html code: <div id="cssmenu"class="col-xs-12 left"> <ul class="nav nav-sidebar"> <li><a href='#'><span>dashboard</span></a></li> <li class='active has-sub'><a href='#'><span>products</span><i class="fa fa-caret-right"></i> and here jquery code trying delete class , add one: $('#cssmenu ul li i').on('click', function() { $('#cssmenu ul li i').removeclass('fa-caret-right'); $(this).addclass('fa-caret-down'); }); thanks having :) btw looking clues , not answers, since trying learn jquery. i add click event on list item: $('#cssmenu ul li').on('click', f

android - How to show home and back navigation icons in ToolbarAndroid in React Native -

i want add home , icons toolbar don't seem appear on app. missing somthing <toolbarandroid title='testapp' navicon={require('image!ic_menu_black_24dp')} style={styles.toobar}/> try 1 adding main layout in activity: android:fitssystemwindows="true"

javascript - Windows App Error: Object doesn't support property or method 'validate' -

i'm developing windows 8.1 app in javascript , html5. while running in emulator getting following error: 0x800a01b6 - javascript runtime error: object doesn't support property or method 'validate'. it highlighting below line of code: jquery(function($) { $("#commentform").validate({ submithandler: function(form) { return false; } }); }); will great if 1 can me out. thanks!

python - Conditional Corporate RML Header with docIf -

dears, we have request print user defined corporate header on first page of business document on pdf (such invoice, sales quotation, sales order). other pages of pdf reports must contain our corporate logo. lucky find post of brett lehrer tried achieve using <header> <pagetemplate> <frame id="first" x1="1.3cm" y1="3.0cm" height="21.7cm" width="19.0cm"/> <stylesheet> <!-- style definitions in here --> </stylesheet> <pagegraphics> ... <!-- corporate logo definition in here --> ... <docif cond="doc.page==1"> ... <!-- corporate contact data in here --> ... </docif> </pagegraphics> </pagetemplate> </header> in custom corporate header rml definition. further modified fil

c# - Check EditText for character count -

i writing android app via xamarin (c#) i have edittext field. , have check nullorempty. if (string.isnullorempty (ulitsa.text) ) { toast.maketext (this, "Заполните поле 'Ваша Улица'", toastlength.long).show (); } i want set max , min character filters. min-3, max-6 ,and if user don't have count of characters show toast notification. how can realize this? myedittext.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { // todo auto-generated method stub } @override public void beforetextchanged(charsequence s, int start, int count, int after) { // todo auto-generated method stub } @override public void aftertextchanged(editable s) { //here, text length: integer len = my

java.util.scanner - No Such Element - No Line Found (Java) -

i'm creating program prints summary of situation after interactive input has ended (ctrl - d). prints summary of average age , percentage of children have received vaccines after interactive input. however, i'm receiving no line found error whenever press ctrl-d @ name:. compiler tells me error @ name = sc.nextline(); within while loop don't know causing error exactly. public static void main(string[] args) { string name = new string(); int age, num = 0, i, totalage = 0; boolean vaccinated; int numvaccinated = 0; double average = 0, percent = 0, count = 0; scanner sc = new scanner(system.in); system.out.print("name: "); name = sc.nextline(); system.out.println("name \"" + name + "\""); system.out.print("age: "); age = sc.nextint(); system.out.println("age " + age); system.o

mysql - Exception in Hibernate Query- java.lang.IllegalArgumentException -

i have written sql query working fine when execute in mysql workbench. same query trying implement in hibernate query use in java code giving exception. please check , me sql query select m.* ct_group_master m m.is_public='y' or m.admin_approved='y' , m.company_id = 1 union select g.* ct_group_master g g.is_private='y' , g.group_id in (select group_id ct_group_member_mapping g.group_id=group_id , member_id = 2) hibernate query java interface method @query("select m ctxtgroupmaster m m.ispublic='y' or m.adminapproved='y' , m.companymaster.companyid=?1 , m.isactive=?3 union select g ctxtgroupmaster g g.isprivate='y' , " + "g.groupid in(select gm.groupmaster.groupid ctxtgroupmembermapping gm g.groupid=gm.groupmaster.groupid , gm.receiverconfig.receiverconfigid=?2)") list<ctxtgroupmaster> findbycompanyidandreceiverconfigidandisactive(integer companyid,integer receiverconfigid,stri

git grep doesn't accept -- to separate branch from filename -

i have both file , branch called atlas, trips git when want search in using git grep: $ git grep asdf atlas -- fatal: ambiguous argument 'atlas': both revision , filename use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' $ git grep asdf atlas -- . fatal: ambiguous argument 'atlas': both revision , filename use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' with git log, can append -- fix it: $ git log -1 --oneline atlas fatal: ambiguous argument 'atlas': both revision , filename use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' $ git log -1 --oneline atlas -- 690eca5 atlas: unit tests how achieve same result git grep ? edit: clarify: want search asdf in every file in branch called atlas. try this: git grep asdf atlas: th

xpages - Error when combining authenticated and anonymous access to one database -

i have existing xpages app authenticated users only. need create 2 new xpages , allow annonymous access them. added 'read public access documents' anonymous user. can see these 2 xpages anonymously sudenly existing non-anonymous part of application doesnt work anymore , app raises dojo errors in browser below. scenario this: tested on domino 9.01 , 9.0.1fp3 + chrome same results i open non-anonymous app in browser , authenticate, works correctly now from different browser open anonymous xpage works fine also now refresh (f5 in browser) non-anonymus app point a) , starts raise errors below. need restart http fix it. i tested scenario several times on local , customers server same result. found http://www-01.ibm.com/support/docview.wss?uid=swg1lo76577 ... there workaround scenario? or how combine anonymous , authenticated access in 1 app properly? xhr finished loading: "http://localhost:8090/xsp/.ibmxspres/dojoroot-1.8.3/dojo/require.js" xhr finished

f# - FAKE: Get all projects referenced by a solution file -

how hold of projects referenced solution file? here have concrete use case. have stolen target copybinaries projectscaffold. copies output of project builds separate folder. not choosy , copies output of every project finds. target "copybinaries" (fun _ -> !! "src/**/*.??proj" -- "src/**/*.shproj" |> seq.map (fun f -> ((system.io.path.getdirectoryname f) </> "bin/release", bindir </> (system.io.path.getfilenamewithoutextension f))) |> seq.iter (fun (fromdir, todir) -> copydir todir fromdir (fun _ -> true)) ) what if want copy output of projects referenced explicitly in solution file. think of this: target "copybinaries" (fun _ -> !! solutionfile |> getprojectfiles |> seq.map (fun f -> ((system.io.path.getdirectoryname f) </> "bin/release", bindir </> (system.io.path.ge

Same name structure with different definition in C -

is allowed use same name structure different definitions in 2 different c files in same project. eg. file1.c typedef struct { unsigned int unvar; } abc; file2.c typedef struct { int var; } abc; abc used in both files. when compile these file part of same project there no errors, want understand whether correct usage. 6.7.2.1 structure , union specifiers the presence of struct-declaration-list in struct-or-union-specifier declares new type, within translation unit. types defined within translation unit, .c file in case. there no problem defining 2 types same name in 2 different translation units. however 2 types not compatible unless follow rules described in 6.2.7., p1 . types defined not compatible .

Dynamically creating named list in R -

i need create named lists dynamically in r follows. suppose there array of names. name_arr<-c("a","b") and there array of values. value_arr<-c(1,2,3,4,5,6) what want this: list(name_arr[1]=value_arr[1:3]) but r throws error when try this. suggestions how around problem? you use setnames . examples: setnames(list(value_arr[1:3]), name_arr[1]) #$a #[1] 1 2 3 setnames(list(value_arr[1:3], value_arr[4:6]), name_arr) #$a #[1] 1 2 3 # #$b #[1] 4 5 6 or without setnames : mylist <- list(value_arr[1:3]) names(mylist) <- name_arr[1] mylist #$a #[1] 1 2 3 mylist <- list(value_arr[1:3], value_arr[4:6]) names(mylist) <- name_arr mylist #$a #[1] 1 2 3 # #$b #[1] 4 5 6

git - Will pushing an old commit overwrite more recent already pushed commits? -

hi there, i don't know if title clear enough... have made commit few days ago , forgot push it. since then, have made other commits , pushed them. now, want push old commit afraid overwrite recent commits. i mean, let's say, in old commit, have modified method 'mymethod:'. in other commit modified method again, , that's version want keep. happen if push first commit ? method "reset" ? push transfer commits (that happened since last push/pull operation), in proper sequence, other repository, nothing overwritten.

javascript - Handling rollbacked MySQL transactions in Node.js -

i'm dealing promblem couple of days, , i'm hoping, me. it's node.js based api using sequelize mysql . on api calls code starts sql transactions lock tables, , if send multiple requests api simultaneously, got lock_wait_timeout errors. var sqlprocess = function () { var self = this; var _arguments = arguments; return sequelize.transaction(function (transaction) { return dosomething({transaction: transactioin}); }) .catch(function (error) { if (error && error.original && error.original.code === 'er_lock_wait_timeout') { return promise.delay(math.random() * 1000) .then(function () { return sqlprocess.apply(self, _arguments); }); } else { throw error; } }); }; my problem is, simultaneously running requests lock each other long time, , request returns after lo

javascript - Issue with Three.js's blender exporter not exporting properly into a json format (on either ubuntu or windows) -

so installed per instructions on github page , tried make work on both windows , ubuntu no avail. this output json get. { "metadata": { "generator": "io_three", "version": 3, "normals": 1, "vertices": 4, "faces": 1, "uvs": 0, "type": "geometry" }, "faces": [33,1,0,2,3,0,0,0,0], "normals": [0,1,0], "vertices": [16.3664,0.795942,32.6299,-32.4816,0.795941,16.4678,32.5285,0.79594,-16.2181,-16.3195,0.795939,-32.3802], "name": "plane.001geometry", "uvs": [] } the 3d model here disclaimer: first time exporting json think installation steps straight-forward.

c++ - sprintf too many/few decimals -

i must convert decimal numbers using non-scientific (ie. no mantissa/exponent/e's) character string. code looks this: /*! \brief converts <em>xml schema decimal</em> */ char *todecimal(double val) const { const size_t nmax = 200; char *doublestr = new char[nmax]; sprintf(doublestr, "%1.6f", val); return doublestr; } the problem when input val 1 function returns 1.000000 hoping output of 1 . also, if change code sprintf(doublestr, "%1.0f", val); correctly outputs 1 , if input val changed 0.000005 output 0 , , hoping output 0.000005 . want output short possible , remove unnessesary 0 's. possible sprintf ? support 3.4e +/- 38 range function. it turns out c++ iostreams (specifically, ostringstream ) better suited task sprintf . use std::fixed manipulator disable scientific notation. use std::setprecision specify precision (number of characters after decimal dot). in case, precision of 45 places seems eno

java - Dynamic Button with time Itervals -

as follow-up first question , has been kindly answered george mulligan, i´m trying create button needs pressed 3 times consecutively avtivated. between each hit countdown on button shows remaining number of hits become active [hence after 1st hit, button show 2, after 2nd show 1 , after 3rd lights green , says active] though there should timer runnning in background or sort of delay initiates after first hit , reinitiates after each except third when button has become active. when maximum delay reached before next hit, button shall turn original state , 1 have start over, i.e perform 3 consecutive hits within time button become active. how go that? so far, i´ve made button change 1 hit , setup .postdelayed() method. though should overridden , reset following hit , disactivated on 3rd hit. who can tell me how achieve that? is there unless statement allow me that? here´s code: mainactivity.java package button.tutorials.suvendu.com.mybuttontutorial; import java

hp uft - Unable to perform an event on a Web button even though the system identifies the object in UFT -

unable perform event on web button though system identifies object in uft. have tried changing replace type value "mouse" , tried using fire event. please me find issue here. check out post uft 12.01 ".click" , "fireevent" doesn't work it many reasons, worked me using ie 8. let me know if works

actionscript 3 - AS3 Check if variable is String outputs MouseEvent info -

update: found workaround using different code. leaving question in cause wants answer why happening , maybe can else well. thanks i trying check if variable string, in case if has url in string. code executing , in trace statement this: if (thewebsite string) trace(thewebsite); output: [mouseevent type="click" bubbles=true cancelable=false eventphase=3 localx=2259.8671875 localy=2485.85205078125 stagex=1003.25 stagey=71 relatedobject=null ctrlkey=false altkey=false shiftkey=false buttondown=false delta=0 commandkey=false controlkey=false clickcount=0] mainstage? [object main_activate] , website? [mouseevent type="click" bubbles=true cancelable=false eventphase=3 localx=2259.8671875 localy=2485.85205078125 stagex=1003.25 stagey=71 relatedobject=null ctrlkey=false altkey=false shiftkey=false buttondown=false delta=0 commandkey=false controlkey=false clickcount=0] here code creates variable. 1. menuscreen.one_btn.addeventlistener(mouseevent.click, w

asp.net - Forms Authentication across virtual directories -

i trying share forms auth root application sub application running in virtual directory. having trouble authentication in subsite. in parent application works expected. i have following setup: parent application: url : http://localhost:1336/ <forms loginurl="~/account/sign-in" protection="all" timeout="30" name=".myapplication" path="/" requiressl="false" slidingexpiration="true" cookieless="usedeviceprofile" enablecrossappredirects="true" defaulturl="/" /> virtual directory: url : http://localhost:1336/subsite <forms loginurl="/account/sign-in" protection="all" timeout="30" name=".myapplication" path="/" requiressl="false" slidingexpiration="true" cookieless="usedeviceprofile" enablecrossappredirects="true" defaulturl="/" /> when try http://localhost:13