Posts

Showing posts from February, 2014

get oracle java 1.8 in windows without installing it -

is possible java in zip format? don't want install getting .exe file. is there zip version of java 1.8 can download , extract , start using in windows machine(64 bit processor) you can extract jdk folder installation exe. check this link steps. post jdk 1.7 work jdk 1.8 also do following. steps download jdk oracle download , install 7-zip here open installition exe using 7-zip extract tools.zip extract content of tools.zip folder (e.g. c:\jdk). open extracted folder in cmd prompt. execute for /r %x in (*.pack) .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" command set java_home jdk (e.g c:\jdk) folder. add %java_home%/bin path env variable. testing run following command check installation, print version of jdk. c:> javac -version javac 1.7.0_51 note: tested jdk 1.7 , 1.8 update edited answer add steps in answer instead of link blog post.

c# - Capture open user controls in Windows form application -

how capture open user control in c# windows form application in run time.i need capture user control , dispose it. assuming "open user control" mean form, go with foreach (form form in application.openforms) { if (form.text == "xyz")//your form { //... } }

Issue with Django paypal -

am using django paypal e-commerce site , payments working correctly,but once payment done not redirected site.am using paypal ipn in localhost.is because running in local machine,following code sending data paypal. def checkout(request,name): product=products.objects.get(name=name) print "producttttttttttttttttttttt",product # want button do. paypal_dict = { "business": settings.paypal_receiver_email, "amount": product.price, "item_name": product.name, "invoice": "unique-invoice-id", "notify_url": "192.168.5.108:8000" + reverse('paypalipn'), "return_url": "192.168.5.108:8000/payment-complete/", "cancel_return": "192.168.5.108:8000", } form = paypalpaymentsform(initial=paypal_dict) context = {"form": form} return render_to_response("payment.html",

javascript - Combine dialog and wizard in jQuery -

i need create multiple steps dialog next, back, cancel , submit buttons. tried use wizard within empty dialog, it's don't have , fill of dialog. is right way put wizard in empty dialog? does jquery have other component (i didn't find one)? thanks! you can make use of 1) jquery plugins ( link1 , link2 etc) 2) or scratch ( link3 )

ruby on rails - ActiveRecord transaction not rolling back on failure -

i trying use activerecord::base.transaction ensure customer , customeraccount , stocknotification created @ once, or none gets created @ if 1 of them fails here transaction stock_notification.rb: validates_presence_of :email def self.make parameters activerecord::base.transaction shop_id = productvariant.find(parameters[:product_variant_id]).shop_id parameters[:customer_account_id] = customeraccount.find_or_make!(parameters[:email], shop_id).id @stock_notification = stocknotification.create(parameters) # reference end @stock_notification end you might need customer_account.rb: def self.find_or_make! email, shop_id customer = customer.where(email: email).first_or_create! customeraccount.where(shop_id: shop_id, customer_id: customer.id).first_or_create! end if call stocknotification.make blank email, create fails (reference a) , no stock notification created, problem customer / customeraccount still being created. s

java - Create one big UML diagram from source with doxygen -

i using doxygen dot in order create uml diagram of java project. when run doxygen creates lot of .png uml files of specifiy classes not 1 "big" uml diagramm classes + member functions etc. shown. is possible generate this? , if yes, how? to have 1 big diagram classes, need in doxyfile enable graphical_hierarchy , have_dots . # if set have_dot tag yes doxygen assume dot tool # available path. tool part of graphviz, graph visualization # toolkit at&t , lucent bell labs. other options in section # have no effect if option set no (the default) have_dot = yes # if graphical_hierarchy , have_dot tags set yes doxygen # generate graphical hierarchy of classes instead of textual one. graphical_hierarchy = yes additionally, there also # if uml_look tag set yes doxygen generate inheritance , # collaboration diagrams in style similar omg's unified modeling # language. uml_look = yes

node.js - result is not coming in a call back function -

i have following code parsebookmark(user_id, category_ids,bookmark_url,function(err, result) { console.log("parse rersult " +json.stringify(result)); //output undefined here }); function parsebookmark(user_id, category_ids,bookmark_url,callback) { savebookmark(user_id,category_ids,title,bookmark_url,function(err, result) { //result coming here callback(result); }); } why output coming undefined here. suggestion please. thanks change savebookmark call to: savebookmark(user_id,category_ids,title,bookmark_url,function(err, result) { callback(err, result); }); if understand code correctly console log second time err variable, undefined .

javascript - how do i reset the geolocation service settings each time my page loads in HTML5 -

Image
hi working on web page need permission user access location. but according story. need make sure if particular user has selected deny on each page load need show him prompt saying [website] want use computer's location shown in snapshot below: but on other hand if user has selected allow should not prompt anymore. is there easy , straight forward way achieve functionality js or html5 settings ? this not possible. see: how make google maps request again location permissions? the browser handles , once choice has been made, cannot reverse it. if site requires geolocation work, can check if permission given (see here: is there way check if geolocation has been declined javascript? ) , if not, should change content or behaviour of site, users know what's going on.

asp.net mvc - Html.AntiForgeryToken Helper not rendering request validation token hidden field in form -

following code in razor view not creating html input type hidden name "__requestverificationtoken" strange. have "logoff" action decorated attribute "validateantiforgerytoken". @using (html.beginform("logoff", "account", formmethod.post)) { html.antiforgerytoken(); <input type="submit" value="logoff" /> } what missing here? it should be @html.antiforgerytoken() not html.antiforgerytoken();

c# - object passed to method by reference not maintaining values from DBContext -

basically, i'm passing model object method , in method, assigning proper object database. since reference, assumed persist throughout rest of method in it called/passed. know has proxy of entity framework can't figure out how fix it. here fragment of code: [httppost] public actionresult create(newformviewmodel nfvm) { db = new dbconnection(connstr); track track= new track(); track parenttrack = new track(); this.create_settrack(nfvm, track, parenttrack); ... and in create_settrack: private void create_settrack(newformviewmodel nfvm, track track, track parenttrack) { track = db.tracks.firstordefault(); parenttrack = db.tracks.where(i=>i.parentid==track.id).firstordefault(); } the track loads in create_settrack then, after code after '...' continues in create, track it's null values. note method parameter new variable. assign track (the variable) track (the paramet

Reading XMl Data same nodes in C# -

i have got following xml data. <useraddress> <addr> <streetaddress/> <streetaddress>some street</streetaddress> <streetaddress>town</streetaddress> <streetaddress>city</streetaddress> <streetaddress>london</streetaddress> <postcode>l45 1sg</postcode> </addr> </useraddress> i trying read each of street address line , store value in variable following code. xelement elem = xelement.parse(xmldata); var address = elem.descendants("addr").tolist(); foreach (var adr in address) { current_user.address_1 = addr.element("streetaddress").value.tostring(); current_user.address_2 = addr.element("streetaddress").value.tostring(); current_patient.address_3 = addr.element("streetaddress").value.tostring(); current_patient.address_4 = addr.element("streetaddres

html5 - HTML 5 draw curved text on a image -

Image
how can draw curved text on image in particular position below. you can use <textpath> svg elements draw text on path. can little bit fiddly, i'll walk through it. first need create <defs> section containing paths want text follow. make things easier if use <circle> element, won't work; has <path> element. fortunately, svg's path drawing support circular arcs , there's no need faff bézier curves. here i'm defining 2 semicircular arcs centred on (0,0) radius of 120; cp1 goes clockwise on top, , cp2 goes anticlockwise around bottom: <defs> <path id="cp1" d="m-120 0a120 120 0 0 1 120 0" fill="none" stroke="red" /> <path id="cp2" d="m-120 0a120 120 0 0 0 120 0" fill="none" stroke="red" /> </defs> the actual drawing part of svg wrapped in <g> element move origin centre of svg (which has dimensions of

c# - Is waiting a thread to be alive with a loop good practice? -

do have this? // loop until worker thread activates. while (!workerthread.isalive); wouldn't better use manualresetevent (or else) @ start of thread's function? edit 1: perhaps in msdn example context "appropiate": // start worker thread. workerthread.start(); console.writeline("main thread: starting worker thread...");   // loop until worker thread activates. while (!workerthread.isalive); otherwise feels awful code smell. source: http://msdn.microsoft.com/en-us/library/7a2f3ay4(v=vs.80).aspx please ignore msdn example, it's horrible , senseless. in particular, spin waiting on isalive makes no sense because there no way thread terminated "before has chance execute", msdn says. thread free not check flag set requesting termination until ready. spin-waiting on isalive never makes sense -- use thread.join() wait on exit, , events (or monitors) wait other states.

autohotkey - Replace a key for an external mouse -

i have external mouse register hid keyboard in device manager. 1 of button shows start menu. want replace mouse click. since have inbuilt keyboard don't want replace start button. want replace start button external mouse try using #installkeybdhook , in keyhistory when have pressed button! this can atleast tell if mouse button has same virtual key code or scan code built-in keyboards key this step step guide http://ahkscript.org/docs/keylist.htm#specialkeys

service - Android How to stop AlarmManager in other Activity -

i using service called in activity 'a' repeatedly created alarmmanager. service checking repeatedly response server, when response true new activity b started. when activity b started want stop service alarmmanager. how can this?? my 'a' activity code calling service following calendar cal = calendar.getinstance(); cal.add(calendar.second, 40); intent intent = new intent(this, response.class); // add extras bundle intent.putextra("foo", "bar"); // start service // startservice(intent); pintent = pendingintent.getservice(this, 0, intent, 0); alarm = (alarmmanager) getsystemservice(context.alarm_service); int i; = 15; alarm.setrepeating(alarmmanager.rtc_wakeup, cal.gettimeinmillis(), * 1000, pintent); startservice(intent); i have tried code snippet in activity 'b' stop alarmmanager fail intent sintent = new intent(this, response.class); pintent = pending

javascript - gulp-livereload with vagrant environment : livereload.js not accessible -

i have problem using gulp-livereload in vagrant environment (generated puphpet). computer windows host, , vm debian. i use gulpfile : var gulp = require('gulp'), less = require('gulp-less') lr = require('tiny-lr'), livereload = require('gulp-livereload'), server = lr() ; gulp.task('less', function () { gulp.src('assets/less/*.less') .pipe(less()) .pipe(gulp.dest('build/css')) .pipe(livereload(server)) ; }); gulp.task('watch', function() { gulp.watch('assets/less/*.less', ['less']); livereload.listen(35729, function(err){ if(err) return console.log(err); }); }); gulp.task('default', ['watch', 'less']); and when chrome extension add magic js file obtain message : failed load resource: net::err_connection_timed_out http://markup.dev:35729/livereload.js?ext=chrome&extver=0.0

How to package other packages python -

here example, use numpy , tkinter in program. when package small program, how can include numpy , tkinter, people doesn't have python, can run it. i believe looking py2exe . this convert py code exe application , packages required libraries.

mongodb - mongo db get collections starting with -

i have number of collections names like app_users5473275725743 app_users5473275725746 app_users5473275725747 app_users5473275725748 i want able find collections starting name 'app_users', while db.getcollectionnames returns collection names. db.getcollectionnames().foreach(function(collname) { if (collname.startswith("app_users")) { print(collname); } });

php - array_search not showing results with ftp_rawlist -

i'm trying search files uploaded or modified month in ftp server. tried ftp_rawlist() store details files on server , used array_search() search array rows contain name of month, it's not showing results, not error. ideas? here's code: $buff = ftp_rawlist($ftp_conn, '/'); // $buff contains (checked via var_dump()) // array(20) { // [0]=> string(64) "drwxr-xr-x 3 4664210 15000 4096 aug 19 15:09 .archived" // [1]=> string(66) "…" // } echo array_search("aug" ,$buff); array_search return identical matches, unless value " aug " , " aug ", return no match. additionally, array_search only return 1 value , if work search part of string, first match returned if there multiple matching values. to search array, use following code: foreach ($buff $array_value) { if (strpos($array_value, "aug") !== false) { // found } }

mysql - join with latest records only from another table:- Remove replication -

Image
i have 2 table lets table1 , table2 table 1 master data , table 2 child . have find out records both table corresponding given table1.id . there more 1 record in table2 corresponding table1.id . filter latest record first table2 corresponding table1.id apply join on filtered data table2 , table1. table1= location_grids table2= local_ads following doing ? select * `location_grids`as l left join `local_ads` la on `la`.`location_grid_id` = `l`.`id` inner join (select id, location_grid_id, max(booked_till) maxbooked local_ads group location_grid_id ) b on la. location_grid_id = b.location_grid_id , la.booked_till = b.maxbooked `l`.`location_id` = '1' , `l`.`flag` = 1 the query returning me unfiltered data. how can filter apply join on data. appreciated. table1:- location-grid table2:- local_ad finally got solution :- searching following query. select location_grid_id, user_id, booked_from, booked_till, purp

javascript - Implementing Insert Function -

i working through khan academy's algorithm course, uses js teach fundamental algorithms. in process of implementing insertion sort, have found problem. we writing function takes in array, index start , value, in order insert number in correct ordered position. have written said function here: var insert = function(array, rightindex, value) { (var = rightindex; array[i] >= value; i--) { array[i+1]=array[i]; array[i] = value; } return array; }; this works fine, , performs should, not pass ka's automated marking system. give guidelines code , suggest done such: for(var ____ = _____; ____ >= ____; ____) { array[____+1] = ____; } ____; does know how reiterate code conform these standards? i had similar solution , didn't pass automated test. if later @ "challenge: implement insertion sort" go ahead , implement function you: var insert = function(array, rightindex, value) { for(var j = rightindex; j >= 0 && array[

c - Access char** result from Swift -

in swift code call c method returns char** result. how can coerce have [string] deal with? thanks swift answers ;-) managed working with let c1 = string.fromcstring(row.memory) let c2 = string.fromcstring(row.advancedby(1).memory) where row char** array got c. mysql_row since want communicate mysql.

c# - Get concrete property that implements type -

given following classes public foo { public foo() { this.bar = new bar(); } public ibar bar{ get; set;} } public bar : ibar { // implemented properties } how can concrete implementation of property bar on foo using reflection? instance.gettype().getproperty("bar").propertytype yields interface only. if trying type implements ibar should it's value , take type: var type = instance.gettype().getproperty("bar").getvalue(instance,null).gettype()

html - Custom CSS Input Field issue -

why cursor start top right in example? see when click inside field, it's top right when type moves centre. ideas why? http://jsfiddle.net/2ltm5adw/ html: <label class="input"> <span>email address</span> <input type="text" /> </label> css: input, select, textarea { line-height:50px; width:100%; padding-left:20px; display: block; } .input span { position: absolute; z-index: 1; cursor: text; pointer-events: none; color: #999; /* input padding + input border */ padding: 7px; /* firefox not respond different line heights. use padding instead. */ line-height: 50px; /* gives little gap between cursor , label */ margin-left: 2px; } .input input, .input textarea, .input select { z-index: 0; padding: 6px; margin: 0; font: inherit; line-height: 50px; } because of line-height . replace height : input, select, textarea { border: 2px solid $gray-lighter;

How should logging be used in a Python package? -

i developing package can used without writing new code , modules can used develop new code (see documentation ). many of modules use logging in simple way: import logging import sys logging.basicconfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.debug, stream=sys.stdout) # code of module follows i have these lines in many modules. seems me should factor out, not sure best / recommended / pythonic way is. the relevant parts in logging documentation seem configuring logging library , logging multiple modules . i guess should move line logging.basicconfig executables ( bin/hwrt ) , remove other logging.basicconfig lines. is there rule how packages should use logging (like pep8 coding style)? if other developers use code might want disable / modify way package logging (so doesn't mixed logging calls). there way them so? your library should not configure logging; that's application-wid

ios - Alamofire with append won't show data -

i want append data in code here below. gives me empty array why? because used framework? class func getdatabyjson() -> array<string> { let urldb = "https://dl.dropboxusercontent.com/u/13259946/voorbeeld.json" //werkt! var data: array<string> = [] alamofire.request(.get, urldb) .responsejson { (request, response, json, error) in //println(error) if let groups : anyobject! = json { var group = groups["groups"] nsarray g in group { data.append(g["name"] nsstring) //println(data) } //println(data) } println(data) //return data } return data } alamofire asynchronously . instead of having getdatabyjson return array of strings, have accept additional completionhandler parameter executes response data when request finishes.

javascript - How to allow only Hebrew letters in input for mobile page, and few more questions? -

i little bit new html , php programming wondered if there way following things : i have input html code should full name of person. <form action="createname.php" method="post"> <input dir="rtl" name="fullname" type="text" placeholder="שם פרטי + שם משפחה" /> <button style="width: 100%;" class="button block green" type="submit" id="login"> המשך לאפליקצייה</button> </form> this code supposed mobile devices, , want know if there away allow hebrew letters in code ? tried few things didn't work maybe because on mobile not sure, have ideas ? strange thing happens person start typing inside input, mobile keyboard shows input stays in same position instead of going above keyboard, keyboard literally above input , person can not see typing inside, anyway change ? the last question less impotent because work advi

How to extract fitted values of GAM {mgcv} for each variable in R? -

i'm searching method add predicted (real, not standardized) values of every single variable in model > model<-gam(ln_brutto~s(agecont,by=sex)+factor(sex)+te(month,age)+s(month,by=sex), data=bears) this summary of model: > summary(m13) family: gaussian link function: identity formula: ln_brutto ~ s(agecont, = sex) + factor(sex) + te(month, age) + s(month, = sex) parametric coefficients: estimate std. error t value pr(>|t|) (intercept) 4.32057 0.01071 403.34 <2e-16 *** factor(sex)m 0.27708 0.01376 20.14 <2e-16 *** --- signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 approximate significance of smooth terms: edf ref.df f p-value s(agecont):sexf 8.1611 8.7526 20.170 < 2e-16 *** s(agecont):sexm 6.6695 7.5523 32.689 < 2e-16 *** te(month,age) 10.3651 12.7201 6.784 2.19e-12 *** s(month):sexf 0.9701 0.9701 0.641

ios - How to manage Core Data to fulfill appropriate section? -

i have 1 table view controller (cardtableviewcontroller) 3 sections (english, chinese, spanish) , view controller (cardeditviewcontroller) can add new items in cards: e.g. can add "lesson 6" english. problem use core data, when create new item, appears not in english elsewhere (in english, spanish , chinese – same item everywhere). how can create save in appropriate section? it's kind of relationship. cardtableviewcontroller.m #import "cardtableviewcontroller.h" @import coredata; @interface cardtableviewcontroller () @property (strong) nsmutablearray *collections; @end @implementation cardtableviewcontroller - (nsmanagedobjectcontext *)managedobjectcontext { nsmanagedobjectcontext *context = nil; id delegate = [[uiapplication sharedapplication] delegate]; if ([delegate performselector:@selector(managedobjectcontext)]) { context = [delegate managedobjectcontext]; } return context; } - (void)viewdidappear:(bool)animated

jquery - Concatenation of 4 input fields -

i new javascript world trying grab input value 4 separate input fields , concatenate them string end time, can use moments timezone output in various different destinations around world. trying concatenate 4 input's 1 when tested alert, display nan . guidance great. $(document).ready(function() { var time1 = $("#time--1").val(); var time2 = $("#time--2").val(); var time3 = $("#time--3").val(); var time4 = $("#time--4").val(); $('.btn').click(function(e) { e.preventdefault(); var time = time1.val + time2.val + time3.val + time4.val; alert(time); }); }); you're calling val() retrieves value of field string or number, , you're calling val on that, return undefined . undefined + undefined == nan . just sum variables: var time = time1 + time2 + time3 + time4;

mysql - CASE statement not working well -

hey guys new mysql actually..i have wrote code like create table customers( id int not null, name varchar (20) not null, age int not null, address char (25) , salary decimal (18, 2), primary key (id) ); insert customers (id,name,age,address,salary) values (1,'aff',2,3,5); my case statement like select case when id > 0 set name = 'sdfsdf'; else set name = 'asd' end case; customers when run on sql fiddle gives me error you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'set name = 'sdfsdf'; else set name = 'asd' end case' @ line 1: select case when id > 0 set name = 'sdfsdf'; else set name = 'asd' end case can me ..any appreciatd the correct statement select case when id > 0 'sdfsdf' else 'asd' end name customers ;

multithreading - Perl forking and IPC::Open2 exec pipes -

i'm running script via cron every 5 minutes. script collects large number of performance metrics across environment, , uses them update round robin databases using rrdtool . at moment, i'm doing via threads , thread::queue . have 'collector' threads, , 'updater' threads: #!/usr/bin/perl use strict; use warnings; use ipc::open2; use thread::queue; use english; $update_q = thread::queue->new(); sub updater { open2( $rrdtool_response, $rrdtool, "/usr/bin/rrdtool -" ) or warn $os_error; while ( $item = $update_q->dequeue ) { ( $rrd, $data ) = split( /,/, $item ); print {$rrdtool} "update --daemon /tmp/rrdcached.sock $rrd $data\n"; $result = <$rrdtool_response>; if ( not $result =~ m/^ok/ ) { print "$rrd $data $result\n"; close($rrdtool_response); close($rrdtool); open2( $rrdtool_response,

if statement - Python: Print to file until empty line? -

i have: for in range (srange, erange): lines=open("%s\%s\propkaoutputfiles\propka_protein_output_%s%s.pka" %(filepath, name, aminoacid, i), "r") file=open("%s\%s\propkamanip\%sinpropka%s.txt" %(filepath, name, aminoacid, i), "w") line in lines: if "0.00 0" , " b 7."in line , (line.split()[0]) == "%s" %aminoacid: print >> file, " %s in %s structure %s" %(aminoacid, name, i) print >> file, line if "0.00 0" , " b 8."in line , (line.split()[0]) == "%s" %aminoacid: print >> file, " %s in %s structure %s" %(aminoacid, name, i) print >> file, line the data reading looks this, embed inside "if in line" code take line if meets criteria , print next lines in document new file until empty line found: lys b 8.x 0.00 0 lys b lys b empty lin

javascript - Mongo and Node.js: Finding a document by _id using a UUID (GUID) -

i'm developing restapi using node.js , i'm trying query mongo collection. can query using strings (for example "companyname") need able query "_id" element in document. in mongo _id stored (as guid): { "_id" : new bindata(3, "mh+t3q6pd0sxvr5z7/pzfw=="), "companyname" : "testcompany", "databasename" : "testdatabase", } current method looks like: exports.getbusinesscarddata = function(req, res) { var id = req.params.id; //"id" = mh+t3q6pd0sxvr5z7/pzfw== tradeshowadmindb.collection('clients', function(err, collection) { collection.findone({'_id': id}, function(err, item) { res.send(item); }); }); }; the "id" coming method base64 string format ("mh+t3q6pd0sxvr5z7/pzfw==") , using query returns nothing (i'm assuming it's not correct type/format). question how "id" correct format c

python - Angular.js and Genshi - conflicts using $ -

hi i'm writing webapp using python, turbogears 2.2, , genshi view\templates. on view side, i'm using angular.js. of time work together. problem – when want use stuff $index inside ng-repeat cannot. when try doing that, genshi.template.eval.undefinederror here html code demonstrate: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/xinclude" ng-app="orderitemeditapp"> ... code ... <tr ngrepeat="item in items"> <td>{{$index}}</td> .... is there way use $index (or other stuff) genshi , angular.js? help use double dollar signs in genshi template escaping: <td>{{$$index}}</td> will output: <td>{{$index}}</td>

sql - mysql query hierarchic -

i need find sql query create table album ( id_album integer not null primary key auto_increment, nom varchar(255) not null ); create table sous_album ( id_sous_album integer not null primary key auto_increment, nom varchar(255) not null, id_album integer references album(id_album) ); create table photo ( id_photo integer not null primary key auto_increment, nom varchar(255) not null, id_sous_album integer references sous_album(id_sous_album) ); insert album(id_album, nom) values ('1', 'album1'), ('2', 'album2'), ('3', 'album3') ; insert sous_album(id_sous_album, nom, id_album) values ('1', 'sous album 1', '1'), ('2', 'sous album 2', '1'), ('3', 'sous album 3', '1'), ('4', 'sous album 4', '2'), ('5', 'sous album 5', '2'), ('6', 'sous album 6', '3') ; inser

xml - How to hide particular test from generated testng report? -

i using testng automation test framework. here testng.xml : <test name="suite run (please ignore this)"> <classes> <class name="com.aaa.setup.suiterun" /> </classes> </test> the method in test run before suite , display on report. don't want display test on report generated testng. is there way or way execute method without mentioning in testng.xml ?

php - Testing load, stress, scalability for website -

i have developed website in codeigniter (php framework) , want test load, stress, scalability . provide online/offline tool ? or should develop program test based on our test conditions using open source api. please clarify , help. you try load test website: http://loadimpact.com (has free test on website paid options) found one: http://siteloadtest.com appears free there http://webpagetest.org , appears free. more found google search of "website stress test"

Transparent listview in jquery mobile version 1.4 -

i found many examples version 1.3, far see there not working version jqm 1.4 css solution on listview version 1.3 was: background-color: transparent !important; background-image: url('') !important; can suggets me fix version 1.4 (1.4.4)? tnx! just apply li itself: li { background-color: transparent !important; } if have anchor tags in listitems, apply anchor: li { background-color: transparent !important; } demo

c++ - Why my double is shown as scientific? -

how can add scientific , float number ? have like var1 0.99999899 var2 3.5008552e-05 sum 3.5008552e-05 but dont understand why in first place var2 shown scientific while in first place declared double var1, var2; so, sum var2... thanks a the way floating-point value displayed down mechanism display it. not property of value itself, nor in way stored within variable: a number number number. call "scientific" not class of numbers. it's class of representations of numbers . same way "twelve" , "12" , "xii" , "a dozen" , "iiiiiiiiiiii" represent same number. "scientific" thing exists when decide represent number in specific way (i.e. when output it). calculations don't "turn numbers scientific" same way saying "2 * 6 twelve" doesn't turn numbers english words. variables store numbers not representations. — r. martinho fernandes your display mechanism —

javascript - Filter Data Attributes jQuery -

i trying filter list items dependant on data attributes have. please see code below: html <li data-process="test 1 ; test 2 ; test 3;">item</li> <li data-process="test 2 ; test 3;">item</li> <li data-process="test 1 ; test 2 ; test 3;">item</li> <li data-process="test 2 ; test 3;">item</li> <li data-process="test 1 ; test 2 ; test 3;">item</li> js $('[data-process="test1"]').hide(); so items test 1 hide. thanks in advance! use contains selector : $('li[data-process*="test 1"]').hide(); see fiddle : http://jsfiddle.net/zfdlvndy/1/ but keep in mind can costful retrieve elements that...

java - Having converting and getting data problems -

i wrote program calculates acceleration. how looks: http://prntscr.com/57yngo when press button show dialog message part of joptionpane . data enter in fields strings convert them double doing : double name = double.valueof(string); the problem if inserted string value instead of double value in fields , pressed button sends acceleration total program badly crash. need solution fix that! if said why did set inserted value string answer way textfieldname.gettext(); if knew way double text field please tell me it. try this: public static void main(string[] args) { string[] values = {"1.0", "2.0", "a"}; (string value: values) { system.out.println(getvalue(value)); } } private static double getvalue(string valuestring) { double result; try { result = double.valueof(valuestring); } catch (numberformatexception e) { result = 0.0; } return result; }

ios - DynamicCastClassUnconditional with Custom Cell Class -

i want use custom cell class contains textfield. dynamiccastclassunconditional error each cell. how rid of error? , custom cell class correct? table-class import uikit class settingsendpointcreateviewcontroller: uitableviewcontroller { override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } // mark: - table view data source override func numberofsectionsintableview(tableview: uitableview) -> int { // return number of sections. return 1 } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { // return number of rows in section. return 3 } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell{ let cellid:string = "endpointname"; var cell:textcell = tableview.dequeuereusablecellwithidentifier(cellid) textcell;

python - update duplicates data in relationship flask sqlalchemy -

i have flask-restless api add , retrieve data database. of fields need localised clients there auxiliary table language , string each field. class myclass(base): __tablename__ = 'myclass' id = column(integer, primary_key = true) translated_field = relationship('translatedfield') and translation table: class translatedfield(base): __tablename__ = 'translated_field' id = column(integer, primary_key = true) myclassid = column(integer, foreignkey('myclass.id')) language = column(string(2)) value = column(text) inserts through json work fine {...,"translated_field":[{"language":"en", "value": "some value"}],...} but when same put request, sets myclassid null in existing row in translated_field table , inserts new row modified data rather updating existing one. obviously not ok because fills database garbage. question is: can modify existing rows or have &

hashtable - hash table suffix tree explanation -

i asking here because couldn't find answer looking elsewhere , don't know else ask this. hope can reply without saying question irrelevant forum. have biology background , using bioinformatics. need understand in lay language hash tables , suffix trees. simple, don't o(n) concepts , stuff, think both kind of same: way store string data? understand better differences. enormously other people me. lot in field now! thanks in advance. ok, lets use bioinformatics illustrate differences. let's have several dna sequences pretty long. if want store these sequences in datastructure. if want use hashtable a hashtable useful way store bunch of objects search datastructure see if contain particular object. one bioinformatics usecase can solve hashtable de-duping large sequence set. let's have huge dataset of next-gen sequenced data , want de-duplicate before assemble. can use hashtable store unique sequences. before inserting sequences hashtable, can

shell - Retrieve bash version in AIX -

after shellshock issue detected on unix systems bash, have create script part of internship in firm in order update bash. prerequisites installation of updated ibm bash*.rpm are: having bash installed (simple check) having bash version under 4.2.50 i have problem dealing second part, since true bash version given command bash -version instead of rpm -qi bash gives version/release of installation package (and not neccessarily true bash version). basically, script goes this: if [[ bash installed ]] ; if [[ bash version installed < 4.2.50 ]] ; install bash version 4.2.50 fi fi bash -version returns lot of text, , pick out bash version. so far, i've used following command: $ bash -version | grep version | awk '{print $4}' | head -n 1 that returns : 4.2.50(1)-release is there way retrieve real bash version? i've played around sed command no success. seems you're trying output this, $ bash -version | a

javascript - Cat.js automation framework issue do get it running after installation -

dear stackoverfellows, actually iam testing new framework cross device testing, name cat.js. relative new, didnt found answers on google. ask you. consider code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>testcase1 cat.jazz</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!--script src="app.js"></script--> <!-- @[scrap @@import[ /cat/lib/cat.js ] ]@ --> </head> <body> <div id="catjsid0" onclick="this.style.color='red'; this.innerhtml+= '[i clicked!]'"> cat js hello caps lock!!!111 </div> <div id="catjsid1" onclick="this.style.color='blue'; this.innerhtml+= '[i clicked!]'"> cat js hello caps loc

javascript - Parse JS - Query not return correct results -

so have simple code backbone-style web app var $content = $('section').first(), document = new parse.query('document'), pid = "fssgsg323"; // document id database document.equalto('personpointer', { __type: "pointer", classname: "person", objectid: pid }).descending('createdat').find().then(function(documents) { alert(documents.length + ' documents found'); (var = 0; < documents.length; i++) { var $li = $("<li class='reportdocumentsitem'></li>"); var aux = new productlistitem({ el: $li, model: documents[i] }); $content.append(aux.$el); } }, genfail); i have 10 entries db have "personpointer" right "pid", sometimes, randomly, while i'm using web app, alert shows me there 0 or less resu

asp.net mvc - PartialView and sections -

i have partial view show panel , text below.. <div class="panel panel-warning customhidden" id="infobox"> <div class="panel-heading"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> information</div> <div class="panel-body well-sm"> lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum. </div> i text section of passed on view consumes partialview. how can pass text in , maintain html div around text? you can use (viewbag) in partial view itself.

php - Composer missing folder when I run 'composer install' -

i have composer.json file: { "require": { "simpleweb/silverpopphp" : "dev-master#3634c414c1e97f5e2a7cce80fa755befae4e62c1" } } and on github repo have engagepod.php file , util folder: https://github.com/simpleweb/silverpopphp/tree/3634c414c1e97f5e2a7cce80fa755befae4e62c1/src/silverpop when run composer install , util folder not appear on installed vendor folder within project. does know why happening? after several attempts , long discussion in comments michael berkowski solve issue adding option --prefer-dist download , not clone github. it fixed issue still don't know why happening.

javascript - Resize PopUp window on Form submit -

i want resize popup window when html form submitted. mean want open form response in same popup window resized different height , width . how can that. ??? i have managed using window.resizeto(width, height); in response page.

dataframe - Complex data frame transposition in R -

i've tried searching answer data.frame/matrix transpoitions aren't complicated trying accomplish. have data.frame looks like f m 2008_b 1 5 6 2008_r 3 3 6 2008_a 4 1 5 2009_b 1 1 2 2009_r 5 4 9 2009_a 2 2 4 i'm trying transpose , rename column , row names such: f_b m_b a_b f_r m_r a_r f_a m_a a_a 2008 1 5 6 3 3 6 4 1 5 2009 1 1 2 5 4 9 2 2 4 essentially every 3 rows being collapsed in single row. assume can done clever plyr or reshape2 commands i'm @ total loss how accomplish it. you try library(dplyr) library(tidyr) lvl <- c(outer(colnames(df), unique(gsub(".*_", "", rownames(df))), fun=paste, sep="_")) res <- cbind(var1=row.names(df), df) %>% gather(var2, value, -var1) %>%

php - How can achieve a clean URL redirect -

so have form when submitted executes php file containing following redirect. echo '<meta http-equiv="refresh" content="0;url='.$nexturl.'" />'; as people know isn't clean/proffesional way of redirecting. is possible include file containing redirect using header location, require variable created in process.php file. for example create using php include: <?php include (templatepath . '/redirect.php'); ?> then within redirect.php header('location: '.$newurl); yes can redirect (that is: set/reset/unset header want) long no output happend before (none, not whitespace or bom (utf-8 byte order mark) - iirc) in case have output can capture via ob_start , output if afterwards oddly enough: made quite clear in doc

SSAS : Calculated Member based on a condition in the same row -

Image
i have fact table i want create calculated member : s = sum of "tot_liv" have "num_prod" = 1 for example: s should equal 50 how ? assuming have measure defined on fact table named "tot liv", measure has "sum" defined aggregate method, , num_prod foreign key dimension named prod having attribute named num prod assume being based on primary key of dimension, , hence 1 records references num_prod primary key, use ([measures].[tot liv], [prod].[num prod].[1]) you see there no 1:1 translation sql mdx, lot of things depend on cube setup, predefines many behaviors have repeat again , again in sql queries (like usage of sum ).

javascript - How to create click event handler inside mouseover event handler? -

i'm trying build kind of element inspector (like in chrome/ff). flow follows: you click 'start inspecting' button. you hover on necessary element. you click on element. you should see element in console. jsfiddle example here code: startinspecting = function(){ $('section *').on('mouseover.inspector', function(e){ $('.hovered-element').removeclass('hovered-element'); $(e.target).addclass('hovered-element'); $(this).on('click.inspector', function(e){ $('section *').off('mouseover.inspector'); $('section *').off('click.inspector'); $('.hovered-element').removeclass("hovered-element"); console.log(e.target); }); }); }; the problem is : each time hover on element - click event handler attached it. if hover on p element 5 times, , click on - see 5 console.log s instead of 1

hadoop - Hive table reading from GZIP contains meta information like file name in the first row -

i have created external table in hive pointing gzip file create external table if not exists raw_cn ( column1 string, column2 string, column3 string, column4 string, column5 string, column6 string, column7 string, column8 string, column9 string, column10 string ) partitioned (day_id string, file_type string) row format delimited fields terminated '|' stored textfile; added partition: alter table raw_cn add partition (day_id = '20140815' , file_type = 'daily' ) location '/mapr/mapr.cluster/cn/20140501/daily'; placed gzip file @ above location however when query table, first row gives me file level information (there no header in file). how resolve issue first row (rest of rows fine): vendor1_617_cn_daily.201408150000664000202600020260243475554512373676764017202 0ustar fworksfworks4f06c1a123

git - echo into grafts does not work -

i have big repository more 300,000 commits. wanna work recent commits. so, used following command: echo "" > .git/info/grafts but not work, since after ran git log, again returned commits. new-root-sha1 passed on master branch. if you're planning on leaving main repository alone , limiting local clone few commits, use following command last 12 commits: git clone [location] --depth 12

c# - Twilio total call duration does not match with billing minutes -

Image
in attached image , total voice minutes july 30 minutes. if pull call logs same month july 2014 (using instruction in https://www.twilio.com/docs/api/rest/call ) , total duration 17 minutes. shouldn't value of usage , total call duration in log equal ?. here test source code finding call log files month july 2014. appreciated. public static void calllogs(string accountsid, string authtoken) { var twilio = new twiliorestclient(accountsid, authtoken); var request = new calllistrequest(); request.starttimecomparison = comparisontype.greaterthanorequalto; request.starttime = new datetime(2014, 07, 01); request.endtimecomparison = comparisontype.lessthanorequalto; request.endtime = new datetime(2014, 07, 31); var calls = twilio.listcalls(request); int? voiceminutes = 0; decimal? totalcost = 0; foreach (var call in calls.calls) { if ( call.price != nu

c++ - Inputting and Outputting Data from file in Vector Error? -

i new c++ , not sure why output file blank. think might have functions? when put code main , not function, output file give me information.. not sure doing wrong. #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> #include <vector> #define die(msg) {cerr << msg << endl; exit(1);} using namespace std; struct eip { string block; string blksfx; string lot; string lotsfx; }; void inputdata(fstream &, vector<eip>); void outputdata(fstream &, vector<eip>); int main() { fstream fs("book1.txt", ios::in); fstream fsout("securedeip.txt", ios::out); if(!fs.is_open()) die("can not open book1.txt!"); if(!fsout.is_open()) die("can not open securedeip.txt!"); vector<eip> name; inputdata(fs, name); outputdata(fsout, name); fs.close(); fsout.close(); return(0); } void inputdata(fstream &fs, vect