Posts

Showing posts from August, 2010

ios - Setting Corner Radius on ImageView is imperfect in iPhone 6 and 6 Plus -

Image
i using imageview s in app set cornerradius make them circular. works fine, when verify in iphone 6 , 6 plus, parts @ edge seem cut off, eg. top part in image below: note haven't added 3x launch image, app displayed scaled version of original. assuming issue happens because of scaling factor. i.e. width specify in code not see in device. also, assume fixed if use autolayout. are assumptions correct? if not, please provide explanation , solution same. :) ! edit1: my imageview of 35 x 35 size. set corner radius follows: [commentcell.profileimageview.layer setcornerradius:17.5]; [commentcell.profileimageview.layer setmaskstobounds:yes]; edit2: floating points doesn't seem it, because tried same frame size 36 x 36 , corner radius 18 . your assumptions correct, there solution : [commentcell.profileimageview.layer setcornerradius:profileimageview.frame.size.width/2];

javascript - D3 chart Y axis line is not visible in some resolutions -

i have stacked bar chart similar link , graph plotted correctly problem y axis line invisible. if increase browser page size in example chart, can see @ resolution x, y axis lines , horizontal tick lines appear. x, y axis lines , horizontal tick lines appearing , disappearing subjected resolution of page. how solve this? i defining x , y axis below var yaxis = d3.svg.axis() .scale(y) .orient("left") .ticks(5) .ticksize(-width - 180, 0, 0) .tickformat(d3.format("$")); var xaxis = d3.svg.axis() .scale(x) .orient("bottom") .tickformat(d3.time.format("%b")); svg.append("g") .attr("class", "y axis") .attr("transform", "translate(0,0)") .call(yaxis); svg.selectall('.axis line, .axis path') .style({ 'stroke': '#ddd', 'fill': 'none', 'stroke-width': '1px' }); svg.append("g") .attr("class", ...

recursion - Recursive Insertion in a Binary Tree C# -

why reason member variables left , right never change when make recursive call? here's source code: public class c_nodo { int dato; c_nodo left; c_nodo right; public int dato { { return dato; } set { dato = value; } } public c_nodo left { { return this.left; } set { this.left= value; } } public c_nodo right { { return this.right; } set { this.right = value; } } public c_nodo(int inf) { this.dato = inf; this.left = null; this.right = null; } } public class c_arbol_bin { c_nodo root; public c_arbol_bin() { root = null; } simple insertion in root or make recursive call public void inserta(int dat) { if (root == null) { root = new c_nodo(dat); } else { insert_order(this.root, dat); } } here make recursive insertion in ordered w...

java - How to initialize initial context in JMS -

i create message queue in standalone application using jms queue. not using kind of container tomcat , jboss. should arguments passed initial context object.? s standalone application.. note: if wishes give down vote question, please give reason in comment , give down vote. thanks! initialcontext ctx = new initialcontext(?????); queue queue = (queue) ctx.lookup("queue/queue1"); queueconnectionfactory connfactory = (queueconnectionfactory) ctx.lookup("queue/connectionfactory"); queueconnection queueconn = connfactory.createqueueconnection(); queuesession queuesession = queueconn.createqueuesession(false,session.auto_acknowledge); queuesender queuesender = queuesession.createsender(queue); queuesender.setdeliverymode(deliverymode.non_persistent); textmessage message = queuesession.createtextmessage("hello"); queuesender.send(message); system.out.println("sent: " + messag...

javascript - $location.search() makes angular-ui-bootstrap's tooltip disappearing -

when implemented in code mechanism change url's query in background (using $location.search ), caused disappearing tooltips have option tooltip-append-to-body , @ moment of changing url value. need tooltip-append-to-body attribute because of reasons (the simplest solution remove that's not solution me). my code looks this: js: angular.module('mapp', ['ui.router', 'ui.bootstrap']) config(['$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider) { $urlrouterprovider.when('', '/'); $stateprovider .state('home', { url: '/', reloadonsearch: false, templateurl: 'home.html' }); } ]) .controller('myctrl', ['$scope', '$timeout', '$location',function($scope, $timeout, $location) { var value = 0; var runtimeout = function() { $timeout(function() { $location.search('start', value++); ...

ftp - How to specify destination path using mget command -

i trying copy multiple files linux machine windows using mget . files getting downloaded, i'm not able specify destination directory (windows directory) the mget not allow explicitly specify target local directory. it downloads files current local working directory. though, can change local working directory using lcd command: ftp> lcd c:\path local directory c:\path. ftp> mget *.*

android - Activity in stack -

ointent.setflags(intent.flag_activity_clear_top | intent.flag_activity_clear_task | intent.flag_activity_new_task|intent.flag_activity_no_user_action); //ointent.setflags(intent.flag_activity_no_history|intent.flag_activity_no_user_action); ointent.putextra("exit", true); startactivity(ointent); finish(); i have use following set of code clear activiites...it works fine...in scenario...the blank activity started...i think because of starting new task in flag...i dont want empty activity/...how solve this? api 21++ activitymanager =(activitymanager) this.getsystemservice(activity_service); list<apptask> ap = am.getapptasks(); ap.get(0).finishandremovetask(); api 21-- from sir @david wasser pointed, use , mantain putextra code , in oncreate of target activity check if has key of exit , call finish() immedi...

java - Openshift with lombok issue -

i create new application template of openshift wildfly 8, , works fine. after add lombok:1.16.4 library, maven in server doesn't compile, in local machine works fine. when run mvn -e -popenshift -dskiptests -x compile in openshift machine, says me: [debug] command line options: [debug] -d /var/lib/openshift/id/app-root/runtime/repo/target/classes -classpath /var/lib/openshift/id/app-root/runtime/repo/target/classes:/var/lib/openshift/id/.m2/repository/javax/javaee-api/7.0/javaee-api-7.0.jar:/var/lib/openshift/id/.m2/repository/com/sun/mail/javax.mail/1.5.0/javax.mail-1.5.0.jar:/var/lib/openshift/id/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/var/lib/openshift/id/.m2/repository/org/projectlombok/lombok/1.16.4/lombok-1.16.4.jar:/var/lib/openshift/id/.m2/repository/org/torpedoquery/org.torpedoquery/1.7.0/org.torpedoquery-1.7.0.jar:/var/lib/openshift/id/.m2/repository/org/javassist/javassist/3.18.0-ga/javassist-3.18.0-ga.jar:/var/lib/openshift/id/.m2/...

c# - 'Fiddler.FiddlerApplication' does not contain a definition for 'Startup' -

i'm building asp.net application in visual studio 2013(update 4, .net framework version 4.5.1) , plugging fiddler functionality in using fiddlercore library( fiddler version 4.5.1.2 ). following build error : 'fiddler.fiddlerapplication' not contain definition 'startup' no other errors. looking @ object browser found startup method missing there also. what solution problem?

c# - Index was out of range. Must be non-negative and less than the size of the collection. 4 -

my datagridview has 4 rows. row[2] has name of date1 , row[3] has name of date2. tested code cells[2] , cell[3] instead of cells name. again received same error. problem index not out of range. , less size of collection. code: for (int = 0; < dgv1frmmodateeghamat.rows.count; i++) { datetime date1 = convert.todatetime(dgv1frmmodateeghamat.selectedrows[i].cells["date1"].value); datetime date2 = convert.todatetime(dgv1frmmodateeghamat.selectedrows[i].cells["date2"].value); timespan span = date2.subtract(date1); int result = int.parse(span.totaldays.tostring()); if (result >= int.parse(textboxx2.text)) { dgv1frmmodateeghamat.selectedrows[i].visible = true; } else { currencymanager cr = (currencymanager)bindingcontext[dgv1frmmodateeghamat.datasource]; cr.suspendbinding(); dgv...

html5 - Using <video> with <source>, where do you add the crossorigin attribute? -

when using <video> tag alone, 1 adds crossorigin attribute so: <video src="blah" crossorigin="anonymous"></video> however, i've had trouble finding out correct placement of 'crossorigin' when using multiple video sources , example: <video> <source src="/somesource.mp4"> <source src="/somesource.webm"> </video> do put 'crossorigin' attribute on <video> tag or individual <source> tags? if later, mean each source can have individual crossorigin handling within 1 video tag? do put 'crossorigin' attribute on tag or individual tags? the w3c specs specify crossorigin attribute on video tag (or more precisely htmlmediaelement) not on src element (or again more precisely, htmlsourceelement). so, assuming follows specs, rash assumption - see margus's answer exmple, should put cross origin attribute on video tag rather individual source ...

HTML/CSS Border Around Multiple Elements -

Image
i'm trying border around image , paragraphs items can't figure out how it. encased them in divs , added class them background color , border effects nothing. i'm shooting for: this html code looks section: <div class="pair"> <a href="gpa_calc_screen.png"> <img src="gpa_calc_screen.png" alt""> <!--relative img path --> </a> <p> custom gpa calculator, , think first real app made. going georgia tech, , college in general, vital asset. although @ gt don't operate on plus/minus system, added setting in can edit if want. </p> </div> and here css: .pair div { display: block; /*padding: 5px; clear: right; width: 100%; border-radius: 5px; border-width: 3px; border-color: red;*/ background: red; } you don't need add div in...

java - Want to randomly choose word from text file and instead printing everything from text file -

i want compiler randomly choose word text instead of printing text file. right code below printing text file. think there wrong getword method because when call getword method main function error . public class textfile { protected static scanner file; protected static list<string> words; public textfile(){ words = openfile(); } private list<string> openfile() { //list<string> wordlist = new arraylist<string>(); try { file = new scanner(new file("words.txt")); } catch (filenotfoundexception e) { system.out.println("file not found"); } catch (exception e) { system.out.println("ioexception"); } return words; } public void readfile() throws filenotfoundexception { //arraylist<string>...

ios - How to pass the UIView with a gesture recognizer as parameter? -

i use: tap.addtarget(self, action: "handletap:") self.view.addgesturerecognizer(tap) i want access view.tag property of view in handletap method. how pass uiview "tap" in parameter of handletap? thanks. func handletap(sender:uitapgesturerecognizer) { if let tag = sender.view?.tag { println(tag) } }

swift2 - How to Don't Repeat Yourself with Swift 2.0 enums -

i've got multiple enums raw values, don't having rawvalue: every time initialize 1 raw value, i've supplied alternative delegating initializer no external label: enum e1 : int { case one, 2 init?(_ what:int) { self.init(rawvalue:what) } } enum e2 : int { case one, 2 init?(_ what:int) { self.init(rawvalue:what) } } very nice. can let e = e1(0) , right thing happens. now i'd consolidate repeated code. hoping swift 2.0 protocol extensions allow me - writing init?(_ what:int) initializer in one place , injecting / inheriting in both enums. however, haven't found way works. problem protocol extension doesn't know adopter have init(rawvalue:) initializer, , have not found way reassure it. i suspect because of automagic way rawvalue initializer comes existence, , nothing can done. perhaps has suggestion. sounds you're looking extend rawrepresentable protocol: extension rawrepresentable { in...

In Python 2.7.10, put quotes around information from a CSV file to be used in a Google search -

my program takes first , last name csv file row , puts google search argument along word. search becomes: john doe teacher be: "john doe" + teacher how can quotes , + sign? thanks! just try + or join method of string: >>> name = "john doe" >>> deal_name = '"' + name + '" + ' + 'teacher' >>> print deal_name "john doe" + teacher >>> or_deal_name = ''.join(['"',name,'" + ','teacher']) >>> print or_deal_name "john doe" + teacher

javascript - ajax queries still waiting after window close -

i have webpage has ajax call gets data php script. ajaxrequest = new xmlhttprequest(); ajaxrequest.open("get", "submit.php?id=" + id, true); ajaxrequest.send(null); inside submit.php wait binary finish , create outfile. while(1){ if(is_file($outfilepath)){ break; }else{ sleep(60); } } the problem if user closes browser window, ajax call , corresponding httpd not aborted. and if user refreshes webpage multiple times, end having hundreds of httpd processes waiting the same outfile created. apache server status 115 requests being processed, 5 idle workers wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww_w____........ ................................................................ ................................................................ scoreboard key: "_" waiting connection, "s" starting up, "r" reading request, "w...

javascript - Need suggestion to code for filter icon -

i need code in selenium web drive java below code. using java eclipse. trying find element filter menu. once click filter icon filter menu displayed. when try find element clicking filter icon using firebug below code got highlighted span class="k-icon k-filter xpath not working. <th class="k-header k-filterable k-with-icon" scope="col" data-title="package detail" data-index="0" data-field="packagedetail.namee" data-role="columnsorter"> <a class="k-grid-filter" href="javascript:void(0)" tabindex="-1"> <span class="k-icon k-filter"/> </a> <a class="k-link" href="/valiadationrule/getdata?valiadationrulegrid-sort=packagedetail.namee-asc">package detail</a> </th> <th class="k-header k-filterable k-with-icon" scope="col" data-title="category" data-index="1" data-field=...

java io - File output deletes all the content -

i trying make program removes text file. text remove , file path provided command line arguments. goes fine, when open file after program has finished running, it's empty. doing wrong? import java.io.file; import java.io.ioexception; import java.io.printwriter; import java.util.scanner; public class remove { public static void main(string[] args) throws ioexception{ if(args.length != 2) { system.out.println("usage : java remove stringtoremove filepath"); system.exit(1); } string stringtoreplace = args[0]; string path = args[1]; file file = new file(path); if(!file.exists()) { system.out.println("no such file exists!"); system.exit(2); } scanner input = new scanner(file); printwriter output = new printwriter(file); while(input.hasnext()) { string currentline = input.nextline(); currentline = currentline.replaceall(stringtoreplace, ""); output.println...

Using Python Spyne (RPC) is there a way to return a native python list instead of the fancy Array or Iterable? -

both iterable , array types seem have native list hidden away in them, find myself doing things like: mylist = service.fetchremotelist()[0][1] where fetchremotelist() _returns=iterable(string) i don't want have put [0][1] @ end of list function calls. spyne uses wrapped arrays default, because that's else in xml world does. wrapped array: <users> <user> <id>1</id> <name>batman</name> </user> <user> <id>2</id> <name>robin</name> </user> </users> bare array: <users> <id>1</id> <name>batman</name> </users> <users> <id>2</id> <name>robin</name> </users> you can see why likes wrapped arrays better now. it's matter of convention, surely helpful one. plus, it's not possible polymorphism non-wrapped arrays. spyne uses wrapped fun...

linux - Do git merges for remote machine locally and with a GUI -

so have remote centos server running small app , have git repo set on machine. date, i've been running git centos server via ssh terminal, including doing merging via mergetool , vimdiff . is...okay. not great. terminal editor split 4 panes vaguely terrifying. what handle merges via windows machine , friendly gui based merge tool, don't want clone repo windows machine. want windows machine perform merge on centos machines files directly. i suspect possible, i'm not having luck google. link instructions fine. any help?

SQL: Right way to model multible relations in UML/ ERD -

how do uml example: order(id, user_id, invoice_user_id) user_id , invoice_user_id foreign keys , user_id != null both users stored in same entity. how cardinalities or uml priciple? guessed way: [order]0..n--1..2[user] so order can have 2 users. option (i hope understand textpicture...) should mean order can have 2 users. or way right: [order]n -- 1[user] |n |1 [(invoice)user] one user can have many orders and/or can invoice user of many orders... you should naming unnamed association-end properties , using 2 separate associations. way have it, there no way invoice user separately other user . , these users anyway? need more analysis understand roles involved. here's guess: seller creates number of invoices buyer receives number of invoices invoice received by 1 buyer invoice created by 1 seller that gives model this: ------ |seller| ------ 1 | creatingseller | * | createdinvoice ------- * 1 -...

ios - Image shows up in iPhone simulator but not ipad - Swift -

when go select image camera roll , display in view doesn't appear on ipad simulator. works great on iphone. here code //--controls how pick image when button clicked--\\ @ibaction func chooseimage(sender: anyobject) { var image = uiimagepickercontroller() image.delegate = self image.navigationbar.tintcolor = uicolor.whitecolor() image.sourcetype = uiimagepickercontrollersourcetype.photolibrary image.allowsediting = false self.presentviewcontroller(image, animated: true, completion: nil) } //--after imaged picked brings view--\\ func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingimage image: uiimage!, editinginfo: [nsobject : anyobject]!) { println("image selected") self.dismissviewcontrolleranimated(true, completion: nil) imagetopost.image = image photoselected = true } apparently, uiimageview called imagetopost not displayed correctly ipad simulator. check storyboard file , make sure image...

variables - PHP Define a Resource URL -

we run iis server hosts multiple internal websites. have updated lot of our tools , noticed have common urls point core intranet site. had manually update links when changed. what create type of "config" variable can hold these common resource url's in can use them in of our websites @ time. from have read, people suggest define seems in scope of project working on. i guess question - best way define common url's can used in multiple sites? i'd prefer not have include file in of them if possible on variable / session level best. thoughts on solution?

java - Reusing part of Stream mapping and filtering to compose two different results -

i'd know if there way of reusing common stream operation varies in end different outputs. example bellow i'm trying compact one-step operation: public static departmentinfo extractdepartmentinfo(baselinepolicy resource) throws resourceprocessorerror { function<exception, exception> rpe = e -> new resourceprocessorerror(e.getmessage()); list<string> parents = objects.requirenonnull( exceptions.trying( () -> arrays.aslist(exceptions.dangerous(resource::getparentids).expecting(cmexception.class).throwing(rpe)) .stream() .map(cid -> exceptions.dangerous(cid, resource.getcmserver()::getpolicy).expecting(cmexception.class).throwing(rpe)) .filter(policy -> pagepolicy.class.isassignablefrom(policy.getclass())) .map(pagepolicy.class::cast) .filter(page -> exceptions.danger...

node.js - Check if a file is open in another process -

is there way open file non-sharing exclusive read-write access? a file change event fs.watch not mean file has been written, in case of node based processes more chunks coming down stream, or might not have been flushed yet. fs.open lets file open , being streamed opened, in write mode without error. 1 introduce timeout delay that's brittle , arbitrary. on windows, 1 able createfile file_share_none c, can't quite recall equivalent on linux (as locks advisory if remember correctly), don't know if os x has equivalent, posix or otherwise). you can use @ronomon/opened check if file open in process, if applications have open handles or file descriptors file. it won't tell applications have file open, file open in other applications. it works on windows, macos , linux , requires privileges on linux. it uses native binding on windows open file exclusive sharing mode detect sharing violations due other processes open handles. on macos , linux wra...

laravel - Blade conditional extends -

i know seems answered question, not (i hope). what looking way extends or not view: if request ajax call view not extends nothing. like: @if(!request::ajax()) @extends('navbar') @section('home') <div>"my content"</div> @stop @else <div>"my content"</div> @endif this not looking for: @extends((( request::ajax()) ? 'layouts.ajax' : 'layouts.default' )) i mean if request ajax call, want view not extend nothing. hope clear. thx! solved using @include statement

javascript - Trigger events when pageYoffset >= div.offsetTop -

Image
i working on simple navigation site uses window.pageyoffset change label on navigation button fixed document right, , secondly, click actions on button scrolls top position of respective container based on label. note: container dynamic, height varies based on height of images received. container b has fixed height, i've not decided on height going functionality going i've considering 700px. how calculate pageyoffset, such label change triggered when pageyoffset >= containerb.offset.top? i'm not sure if condition met or chasing wild goose. there better way tackle problem. current solution this current solution label change triggers when scrollbar not close topposition of containerb. i've attached image depicts page. window.addeventlistener( "optimizedscroll", function optimizedscrollfunc( ) { var self = voapp, gototop = document.getelementbyid( "cc-gototop-js" ), winpageyoffset = window.pageyoffset, w...

html - How to keep the last nav item to always stay in line? -

i'm confused, why collapses when window shrinks horizontally? i've tried set width of div , tried setting display:block . i'm using bootstrap 3, don't think relevant. h1 { font-family: 'latobold'; color: #ff990f; } /*---------------------------------- header ----------------------------*/ #header { position: relative; margin-bottom: 1em; min-width: 100ex; white-space: nowrap; } #header > .inner { height: 95px; } /* njnavbar ************************************/ #header .njnavbar { position: absolute; bottom: 0px; right: 0px; height: 42px; min-width: 90ex; white-space: nowrap; } #header .njnavbar * { font-family: 'latoblack', arial, verdana, sans-serif; font-size: 16px; color: #fff; text-transform: uppercase; text-shadow: #08121b 0px 1px 1px; ...

Initial data for inline formsets of Django related models? -

i'm trying create updateview page allows me edit customer's information affiliated users' information in form. customerform works fine, i'm not sure how set initial data inline formsets. tried dictionary of users going through self.object.user_set.all() loop. can't seem make change userformset. here's code: forms.py class customerform(modelform): class meta: model = customer fields = ['name', 'system', 'bill_amount', 'exchanges', 'due_date', 'invoice_date', 'keycodes_expire', 'paid_date', 'active'] success_url = reverse_lazy('index') userformset = inlineformset_factory(customer, user, fields=['name', 'expiration_date'], extra=1, can_delete=true) models.py class customer(models.model): active = models.booleanfield(default = false) bill_amount = models.decimalfield(max_digits=7, decimal_places=2) due_date =...

sonar runner - How do I use Sonargraph SonarQube plugin? -

i have couple of questions sonargraph sonarqube plugin. first is, is plugin free ? when downloading plugin dashboard license of type called apache2, think free. case? the second question how use plugin? found instructions on developers' website pertained scanning via maven. here link said instructions: https://www.hello2morrow.com/products/sonargraph/sonar is possible scan sonar-runner ? if so, how can view results on dashboard? thank-you reading this. regards, i think should directly contact hello2morrow answers question, because sonargraph commercial product.

haskell - Luhn algorithm implementation -

i'm expecting luhn 5594589764218858 = true false -- last digit number lastdigit :: integer -> integer lastdigit 0 = 0 lastdigit n = mod n 10 -- drop last digit number droplastdigit :: integer -> integer droplastdigit n = div n 10 torevdigits :: integer -> [integer] torevdigits n | n <= 0 = [] | otherwise = lastdigit n : torevdigits (droplastdigit n) -- double every second number in list starting on left. doubleeveryother :: [integer] -> [integer] doubleeveryother [] = [] doubleeveryother (x : []) = [x] doubleeveryother (x : y : z) = x : (y * 2) : doubleeveryother z -- calculate sum of digits in every integer. sumdigits :: [integer] -> integer sumdigits [] = 0 sumdigits (x : []) = x sumdigits (x : y) = (lastdigit x) + (droplastdigit x) + sumdigits y -- validate credit card number using above functions. luhn :: integer -> bool luhn n | sumdigits (doubleeveryother (torevdigits n)) `div` 10 == 0 = true | otherwise ...

java - How to prevent JSF namespace pollution -

i consider jsf have namespace pollution in have expose private members world shouldn't do. here's example: suppose have form data , date input forms, represented in backing beans as: private date fromdate; private date todate; // getters , setters jsf xhtml page can see fields , work 'em then have private method, being called on post construct: private list<? extends statisticsmodel> _getdatamodel() { list<? extends statisticsmodel> datamodel = null; if (issingledate()) { datamodel = getdatamodel(getfromdate(), getfromdate(), getselected()); } else { datamodel = getdatamodel(getfromdate(), gettodate(), getselected()); } return datamodel; } which calls abstract method every subclass have implement: protected abstract list<? extends statisticsmodel> getdatamodel(date from, date to, string[] selected); if carefully, find abstract method from date , to date parameters cri...

python - Adding a titled color bar and generally getting a colored scatter plot to look good -

i'm creating scatter plot colored according 2-d array, having trouble getting color bar set correctly alongside it. have far is: self.fig1 = plt.figure('blahblahblah', (10.0,10.0))) ax2=plt.subplot(111) ax2.set_ylabel('blah') ax2.set_xlabel('blah') ax2.set_title.... ... ... cmap, norm = mpl.colors.from_levels_and_colors9[0.9, 0.975, 1.025, 1.1],['green', 'red', 'blue']) ax2.scatter(firstarray,secondarray,c=colordefiningarray,marker="o",cmap=cmap,norm=norm, vmin=0.9,vmax=1.1) cax=self.fig1.add_axes([0.95, 0.2, 0.02, 0.6]) #pulled these #s question, no idea mean cb = mpl.colorbar.colorbarbase(cax, cmap=cmap, norm=norm, spacing='poportional') cb.set_label('moreblah') #saving fig the color bar showing up, except doesn't have title. also, feel if there easier way this, can't seem figure out other questions. edit: know it's issue saved image scaling. don't know how scale image without scal...

Goal not working with pagePath filter in Analytics API -

i find conversion rates 1 of goals. however, want see results based on pages "profile/" in url. i've tried using following filter separately in analytics api add-on google sheets: ga:pagepath=@profile/ or ga:pagepath=~profile the filter works, don't conversion hits. can help? thanks, josh unless goal page path of /profile should use segment rather filter. difference segment give visits include (exclude etc. depending on conditions segment) visitors via profile page, whereas filter include pageviews exact /profile page. so looking segment definition sessions::condition::ga:pagepath==/profile this limit data sessions have @ point visited profile page (but show happenend before , after). a more convinient way segment definition define segment in ga interface, head on query explorer , select newly created segment via segments dropdown. can copy there (either id or can copy segment definition if click checkbox below dropdown).

Facebook PHP SDK 4 get id of fan page calling tab app -

i have facebook tab app installed in multiple fan pages, must show different results. tried query strings, know, tab link can´t have custom vars. my idea id of current fan page calling tab app, , pass variable define different results. i tried facebook php sdk 4: define('facebook_sdk_v4_src_dir', 'src/facebook/'); require 'autoload.php'; use facebook\facebooksession; use facebook\facebookpagetabhelper; facebooksession::setdefaultapplication('xxx', 'xxx'); $canvashelper = new facebookpagetabhelper(); var_dump( $canvashelper ); but get: protected 'pagedata' => null protected 'signedrequest' => null any ideas? solution: after hours of work , returning fb sdk 3, found this: facebook iframe tab signed request empty "after changing "tab url" 'tab/index.php", signed request started show in app tab!" works, sdk 4!

javascript - Protractor - Returning pending promise when functioned out -

i trying create function comb through array of elements , return first instance of 1 meets criteria. this have inside test does work : element.all(by.css('_cssselector_')).filter(function(elms, index) { return elms.getattribute('height').then(function(height) { return parseint(height) > 0; }); }).then(function(validelms) { browser.actions().mousemove(validelms[0]).perform(); } ...but if function out, does not work : getvalidelm = function() { var validelm = element.all(by.css('_cssselector_')).filter(function (elms, index) { return elms.getattribute('height').then(function (height) { return parseint(height) > 0; }); }).then(function (validelms) { return validelms[0]; }); return validelm; } if run: var validelmfrompage = getvalidelm(); console.log(validelmfrompage); i get: promise::2046 {[[promisestatus]]: "pending"} wh...

css - How to get the distance between a well and the edge of the screen -

for web page want place in between edge of made bootstrap , edge of screen. there way stays there, on resize? use 1 of offset css classes .col-md-offset-* example. more @ http://getbootstrap.com/css/#grid-offsetting

configuration - nginx domain forwarding with added parameter -

i keep getting strange issue on nginx right now. have 2 nginx servers, 1 hosting content want forward other server. 1 doing forwarding has sites enabled config of: server { listen 80; server_name pastdomain.com; return 301 https://domain.com$request_uri?from_past_domain=true; } server { listen 443; server_name pastdomain.com; return 301 https://domain.com$request_uri?from_past_domain=true; # bunch of ssl config here } basically want send traffic new server can interpreted new variable from_past_domain can interpret needed on new server. ie. pastdomain.com/thing/thing1/1/ would translate to domain.com/thing/thing1/1?from_past_domain=true right appears working except in case visit pastdomain.com i instead domain.com//?from_past_domain=true which incorrect. in addition, doesn't add new parameters correctly. ie. if have pastdomain.com?test=1&test2=2 forwards domain.com/?test=1&test2=2?from_past_domain=true how can go forwarding correctly? ...

javascript - Conditional model binding in AngularJS -

i trying create calendar has default template of 'available hours' in day, , allow user edit particular day assigned number of hours. so basically: team 1: sunday: 8 monday: 8 tuesday: 8 wednesday: 8 thursday: 8 friday: 8 saturday: 8 i have edited angularui bootstrap datepicker directive allow me create datepicker input box under each day show current hours available day , allow user enter custom value. i store default template in database each team, , have table date , hours. table used check if date requesting has additional hours allotted or should use default template. i can make work on server side, making work in client escaping me. i need populate values of datepicker input boxes default template values unless value date exists in custom table. can make work, problem comes in when try edit of this. if set ng-model custom template, bind on dates there entry. if don't set model, don't know how add entry custom object date. here plunk shows...

how to check if another app is minimized or open in android? -

i have seen many solutions check if our own app minimized,running or background.but there way check if app package running or minimized based on can run code.like app-locker.here need turn off network apps according user selection on installed apps in device, when selected apps on foreground, network should disabled when selected apps closed or minimized.then enable network. compliant google play if make such app? because somewhere read don't allow apps interfere other apps.so confused. tl;dr: google doesn't want this, , shouldn't try. the old hack relied on activitymanager#getrecenttasks() find out app in foreground disabled starting in android 5.0. app lockers work on lollipop using new hack involving activitymanager#getrunningappprocesses() . how works described in this answer . this hack reportedly broken on android m. there's new usagestats api might able glean bit of info, requires permission can granted system activity. it's documente...

python - Reading a tar compressed file in pandas? -

this code seems work , takes list of files , compresses them in format pandas can read, , combines them 1 location. edit - modified code add new files (based on file not existing in tar). os.chdir(r'c:\\users\documents\ftp\\') saveloc = r'\\fnp\mydownloads\\' compression = "w:bz2" extension = '.tar.bz2' filename = 'global_performance' filetype = 'performance_*.csv' tarname = saveloc+filename+extension files = glob(filetype) tar = tarfile.open(tarname, compression) file in files: if file not in tarname: tar.add(file) tar.close() filename = 'global_status' filetype = 'status_*.csv' tarname = saveloc+filename+extension files = glob(filetype) tar = tarfile.open(tarname, compression) file in files: if file not in tarname: tar.add(file) tar.close() is there way pandas read tar file? can specify file know exists within file, or perhaps concat of files 1 read? being able add new files nice...

xcode - Opening NSSavePanel as sheet -

i using xcode7 beta2 play around swift 2. trying use file-selection dialog ( nssavepanel ) brought me trouble. running following code clicking associated button won't bring dialog sheet (not @ all) make window's decoration disappear, leaving in broken state otherwise functional sheets open dialogs without decoration. using call deprecated api beginsheetmodalforwindow , in commented line, works expected. @ibaction func openfileclicked(sender: anyobject) { let openpanel = nssavepanel() openpanel.cancreatedirectories = true //openpanel.beginsheetmodalforwindow(self.view.window!, completionhandler: { openpanel.beginsheet(self.view.window!, completionhandler: { (result) -> void in print("opening:\(result)" ) }) } is code broken somehow or there issue api calling.

HTML5/Javascript searching for existence of files in local directory -

i'm trying allow web application check existence of files in user's local directory (the searches repeat in background). i've researched amount , found 1 of ways seems possible filesystem api, available in chrome. main issue web app running on internet explorer (if not exclusively). are there ways implement functionality html5/js? thanks

Powershell remote execution with php exec function -

i trying run powershell command on remote computer with php script. i have no trouble execution local powershell scripts. example, successful executed following code: exec("powershell -command c:\wamp\www\pstest.ps1", $output, $return_var); output: "hello world", return code: 0 when execute following command prompt have no issues. powershell -command invoke-command -computername computer.servername.local c:\wamp\www\pstest.ps1 output: "hello world", return code: 0 however, when try execute same code within php script fails. exec("powershell -command invoke-command -computername computer.servername.local c:\wamp\www\pstest.ps1", $output, $return_var); output: "", return code: 1 make sure account service running under has admin rights on target system. should fine if personal project @ home. may have rethink things if on corporate system.

java - Can't access hive tables over http -

i trying use hive jdbc driver connect hive server running on particular host port. can establish connection , create tables (the tables show on namenode web ui) can't access existing tables. note: existing tables running hive console , (for odd reason) can accessed when run hive console in particular directory. how can jdbc client access hive tables using jdbc connection?

c# - How can I make an Optional 1:1 Relationship in EF6 with the same Entity Type on both sides? -

i want donut optionally relate donut, , if so, other donut relate back. i've read, believe need set parent/child relationship, though in real world, it's optional pairing (donuts can exist happily, or exist in pairs). here current setup: public class donut { public int id { get; set; } public int? parentdonutid { get; set; } public int? childdonutid { get; set; } // virtual properties public virtual donut parentdonut { get; set; } public virtual donut childdonut { get; set; } } this statement in mapping file gets me close, insists on creating new key named parentdonut_id on table instead of using existing parentdonutid : this.hasoptional(t => t.childdonut) .withoptionalprincipal(t => t.parentdonut); but when try mapping: this.hasoptional(t => t.childdonut) .withoptionalprincipal(t => t.parentdonut) .map(m => m.mapkey("parentdonutid")); // or "childdonutid" i error...

Is it possible to pipe HDF5 formated data? -

it possible write hdf5 stdout , read stdin (via h5::file file("/dev/stdout",h5f_acc_rdonly) or otherwise)? what want have program foo write hdf5 file (taken first argument, say) , program bar read hdf5 file , instead of command_prompt> foo temp.h5 command_prompt> bar temp.h5 command_prompt> rm temp.h5 simply say command_prompt> foo - | bar - where programs foo , bar understand special file name - mean stdout , stdin respectively. in order write programs, want know 1) whether @ possible , 2) how implement this, i.e. pass h5fcreate() , h5fopen() , respectively, in case file name = - . i tried , seems impossible (not big surprise). hdf5 has h5fcreate() , h5fopen() , , h5freopen() , neither of seems support i/o stdin/stdout . i not think can use stdin hdf5 input file. library needs seek around between header contents , data, , cannot stdin .

networking - Load balancer for websockets -

i know how load balancers work http requests. client opens connection lb, lb forwards request backend servers, lb gets response , same connection sends response client , closes connection. want know internal details of load balancer websockets. how connections maintained , how response sent client. read many questions on stackoverflow none of them gave clear picture of internal implementation of lb the lb route connection server behind it. so long keep connection open keep being connected same server , not communicate lb again. depending on client, on reconnection routed server. i'm not sure how works when libraries fallback json-p tho

javascript - ui bootstrap multiple decorators -

used this link update accordion template. need replace ui bootstrap template carousel. there way can chain decorator functions or should done way? also, if need have various versions of carousel? then? what have right isn't working: .config(['$provide', decorate]) function decorate($provide) { $provide.decorator('accordiongroupdirective', function($delegate) { var directive = $delegate[0]; directive.templateurl = '/modules/projects/views/admin/templates/accordian.html'; return $delegate; }) .decorator('carousel', function($delegate) { var directive = $delegate[0]; directive.templateurl = '/modules/projects/views/admin/templates/carousel.html'; return $delegate; }) } whenever wanted decorate of existing component configuration phase of angular, need append component type name, here going decorate directive , need provider name decorator carouseldirective instead of carousel . code ...

java - WaveData LWJGL3 -

i trying load sound in lwjgl 3 according tutorial ( http://wiki.lwjgl.org/index.php?title=openal_tutorial_1_-_single_static_source ), found problem class wavedata, in older version of lwjgl 2.x, not there. there cant compile code. there other way how load sounds in lwjgl using openal... in lwjgl 2 used use paulscode sound system ( http://www.paulscode.com/forum/index.php?topic=4.0 ) not sure if works in newer version of lwjgl 3. thank answer :) and if there tutorial around sound in lwjgl3, please include link in answer, tried googling theese tutorials ages failed. in forum post stated: lwjgl3 doesn't include wavedata lwjgl2 still works same in lwjgl3, grab lwjgl2 source code , include in project. so should safe copy old wavedata class , use lwjgl3, because loading algorithm , openal internals have not been changed. recently, lwjgl included bindings stb library. provides set of utility functions different things, image loading, font loading , perlin ...

how to start integrating django-cms into existing project -

my purpose convert static pages (about us, contact etc) in existing project admin editable pages. have followed instructions @ tutorial things started don't seem results. far performing python manage.py cms check seems indicate got set up. don't seem urls right. says here you need include 'cms.urls' urlpatterns @ end of urlpatterns. my urls follows: urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # uncomment next line enable admin: url(r'^admin/', include(admin.site.urls)), # main site url(r'^', include('website.urls')), url(r'^', include('cms.urls')), ) if settings.debug: import debug_toolbar urlpatterns = patterns('', url(r'^media/(?p<path>.*)$', '...

windows - Adding Git to PATH Variable - Can't find GitHub under AppData/Local -

i following guide here on how add git path variable can use command line (not git bash). installing git in path github client windows to quote answer, git supposedly located here get git url we need url of git \cmd directory computer. git located here: c:\users\\appdata\local\github\portablegit_\bin\git.exe i opened file explorer , went directory c:\users\appdata\local\ under view tab, have hidden items checked. cannot see github folder listed. in search bar, appended github end of directory path , got following message windows can't find 'c:\users\username\appdata\local\github'. check spelling , try again. i'm trying add git environment path variable, can't find git located. in git bash, able try which git got /bin/git but i'm not sure how can find put in under environment variable. doing random search, found git folder located here c:\programfiles(x86)\git but supposed enter path variable? different answer in ot...

C# - Polymorphism confusing overloading and method hiding -

i have class named item acts abstract class, not defined one. class has maxperstack property: public class item { public short maxperstack { { return this.data.maxperstack; } } } i have class named equip derives item class , has property named maxperstack declared new : public class equip : item { public new short maxperstack { { return 1; } } } i have following method called add , uses maxperstack property of item : public void add(item item) { console.writeline("stack: {0}.", item.maxperstack); } when do: add(new equip()); it goes maxperstack property of item rather equip one. why's happening? because didn't mark item.maxperstack virtual , , didn't mark equip.maxperstack override . need both of things behavior you're expecting. by implicitly marking base type's method sealed , explicitly marking derived type n...

ruby on rails - Detecting Elastic Beanstalk Environment? -

i trying tag error messages elastic beanstalk environment. there way programmatically determine environment in ec2 instance inside elastic beanstalk? i using ruby on rails ruby way nice, can port language. i have rails project , doing inside in order determine environment our ec2 instance part of. below code doing more 1 check, file check makes sure running code on ec2 instance. second set of url calls grabbing ec2 instance id along aws region being used. uses previous 2 pieces of data find environment-name using aws-sdk. it's little ugly gets job done. require 'net/http' require 'aws-sdk' uuid = file.readlines('/sys/hypervisor/uuid', 'r') if uuid str = uuid.first.slice(0,3) if str == 'ec2' metadata_endpoint = 'http://169.254.169.254/latest/meta-data/' dynamic_endpoint = 'http://169.254.169.254/latest/dynamic/' instance_id = net::http.get( uri.parse( metadata_endpoint + '...

PHP, MySQL, PDO - Insert Into Not Working -

i have code: <?php require_once 'dbconfig.php'; if(isset($_get['id'])) { try { $db = new pdo("mysql:host=$host;dbname=$dbname", $username, $password); $db->setattribute(pdo::attr_errmode, pdo::errmode_exception); $db->setattribute(pdo::attr_emulate_prepares, false); $getsavedholidays = $db->prepare("insert tvinfo(id, imdbid, name, rating, genre1, genre2, year, plot, uploader, views, downloads, uploaddate, size, resolution, fps, audio) values (:id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id, :id)"); $getsavedholidays->setfetchmode(pdo::fetch_assoc); $getsavedholidays->execute(array(':id' => $_get['id'])); $result = $getsavedholidays->fetchall(); if(!$result){ die('error: id not found'); } } catch (pdoexception $e) { print_r($e->errorinfo); die(); } foreach ($result $r) { echo 'name: '.$r['name...