Posts

Showing posts from May, 2010

Python requests library - Strange behavior vs curl -

i comparing these 2 code snippets: subprocess.call('curl -xget http://localhost:81/proxy/bparc/my_key > /dev/null' ,shell=true) vs response = requests.get('http://localhost:81/proxy/bparc/my_key') print len(response.text) and first 1 run in under .01 seconds. second 1 times take 30 seconds, , other times take less .01 seconds. any ideas going on? requests doing fancy that's slowing things down? bad run len? ok, changing response.content fixed it. response.text lot of stuff don't need binary data. response = requests.get('http://localhost:81/proxy/bparc/my_key') print len(response.content)

Compilation Error in i/o redirection in C program in linux -

i'm trying make simple i/o redirection(ls sort)(ls|sort>f1) , next step direct output of sort file in c when compiling gcc giving following error..plz me :) code #include<stdio.h> #include<fcntl.h> #include<string.h> #include<stdlib.h> #include<sys/types.h> #include<unistd.h> int main() { int a,b,c,d,pfd[2],kk,i,j; file *fp; i=fork(); if(i==0) { pipe(pfd); j=fork(); if(j==0) { close(1); dup(pfd[1]); close(pfd[0]); close(pfd[1]); excel("/bin/ls","/ls",0); } else { close(0); dup(pfd[0]); close(pfd[0]); close(pfd[1]); /*close(1); kk=open(f.txt,o_wronly); dup(kk); */ excel("/usr/bin/sort","/sort",0); } } else wait(); /*char k[100],pp[100],ll[]="/bin/"; printf("enter cmd execut"); scanf("%s",k); strcpy(pp,k); strcat(ll,k); pr

hadoop - Sqoop speculative execution -

i have below question in sqoop ? i curious if can set speculative execution off/on sqoop import/export job. and have option of setting number of reducers in sqoop import/export process. according analysis sqoop not require reducers, not sure if im correct. please correct me on this. i have used sqoop mysql, oracle , other databases can use other above. thanks 1) in sqoop default speculative execution off, because if multiple mappers run single task, duplicates of data in hdfs. hence avoid decrepency off. 2) number of reducers sqoop job 0, since merely job running map job dumps data hdfs. not aggregating anything. 3) can use postgresql, hsqldb along mysql, oracle. how ever direct import supported in mysql , postgre.

r - geom_area not stacking (ggplot) -

Image
here structure of data: classes ‘tbl_df’, ‘tbl’ , 'data.frame': 60 obs. of 3 variables: $ year : num 1990 1990 1991 1992 1993 ... $ studytype: factor w/ 4 levels "meta","observational",..: 2 3 3 1 3 3 3 1 3 3 ... $ n : int 1 4 4 1 2 5 3 1 2 6 ... i'm trying stacked area chart using following code: ggplot(evidence.summary.main, aes(x = year, y = n, fill=studytype)) + geom_area(alpha=.80) any ideas why cannot stack properly? and data dput : structure(list(year = c(1990, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1997, 1998, 1998, 1999, 1999, 2000, 2000, 2000, 2001, 2001, 2002, 2002, 2003, 2003, 2003, 2004, 2004, 2004, 2005, 2005, 2006, 2006, 2006, 2007, 2007, 2007, 2007, 2008, 2008, 2008, 2009, 2009, 2009, 2009, 2010, 2010, 2010, 2010, 2011, 2011, 2011, 2011, 2012, 2012, 2012, 2012, 2013, 2013, 2013, 2013), studytype = structure(c(2l, 3l, 3l, 1l, 3l, 3l, 3l, 1l, 3l, 3l, 4l, 1l, 3l, 1l, 3l, 1l, 2l, 3l,

jquery - Jump to page in PDF.js with javascript -

i'm trying use pdf.js' viewer display pdf files on page. i've gotten working, able 'jump to' specific page in pdf. know can set page url, in javascript if it's possible. i have noticed there pdfjs object in global scope, , seems should able access things page setting there, it's rather massive object. know how this? you can set page via javascript with: var desiredpage = [the page want]; pdfviewerapplication.page = desiredpage; there event handler on this, , ui adjusted accordingly. may want ensure not out of bounds: function gotopage(desiredpage){ var numpages = pdfviewerapplication.pagescount; if((desiredpage > numpages) || (desiredpage < 1)){ return; } pdfviewerapplication.page = desiredpage; }

javascript - How to update my $scope after adding new elements? -

i have problem controller. use ionic (angular) , js-data. when add new item via additem() when see if reload page via f5. here code: .controller('fooctrl', function($scope, $ionicplatform, foo) { $ionicplatform.ready(function() { foo.findall().then(function (items) { $scope.items = items; }); }); $scope.item = {}; $scope.additem = function () { foo.create({ name: $scope.item.name }); }; }) what have see new element withous first pressing f5 in browser window? you creating item , updating database. not updating $scope.items . push item $scope.items or can call code after creating. update $scope.items foo.findall().then(function (items) { $scope.items = items; }); use code: .controller('fooctrl', function($scope, $ionicplatform, foo) { $ionicplatform.ready(function() { foo.findall().then(function (items) { $scope.items = items; })

swing - Java GUI app frame doesn't display correctly when launched? -

Image
i have made tictactoe app using java swing library. ever since i've added menu, wouldn't launch expected. mean, functionality fine sometimes display 1 of 3 undesirable methods have in image when launch it. however, once maximize , minimize frame, display in desired manner. kindly me fix this. you adding components frame once visible. call frame.setvisible(true); after have added components or have revalidate container. once container visible , layed out, have call validate / revalidate if add or remove components.

php - Multi-level navigation using bootstrap in laravel 5 -

Image
i using laravel 5 framework. i have categories table this: i want make bootstrap menu multi-level if parent_id = id this have tried far: <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">categories <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> @foreach( $category $cat ) @if( $cat->id === $cat->parent_id) <ul class="dropdown-menu" role="menu"> <li class="dropdown-submenu"> <a href="{{ url( '/category', safeurl::make( $cat->name ) ) }}" data-toggle="dropdown-toggle" aria-expanded=&

javascript - Angular-Kendo Stacked charts with percentage formatting -

Image
on 100% stacked chart, cannot valueaxis format property render full % amout 0 100%. please see plunk here: http://plnkr.co/edit/2nvnbdshadaspoejbhzn?p=preview you'll find it's simple example, index.html file , 1 script.js. $scope.chartoptions object assigned in script.js. it incorrectly displaying percentage : 0% 0.2% 0.4% ... 1% the html div defined follows: <div kendo-chart k-options="chartoptions" k-rebind="chartoptions"></div> i've read online samples, , read kendo docs @ http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-format . and i've tried kendo.tostring("{0}", "p") format property, can't it. http://demos.telerik.com/kendo-ui/bar-charts/stacked100-bar your appreciated. thanks, bob per discussion , identified issue, don't need remove 'format' , in plunker, 'format': '{0}%' not valid. if change following, can keep for

c++ - Gamma correction doesn't look properly corrected, is this linear? -

Image
i want implement gamma correction opengl lighting, gamma correction applied, results not seem linear @ all. i found opengl: gamma corrected image doesn't appear linear similar issue, hasn't yet received answer nor discussed actual diffuse lights. as illustration, have following 4 light colors defined in linear space: glm::vec3 lightcolors[] = { glm::vec3(0.25), glm::vec3(0.50), glm::vec3(0.75), glm::vec3(1.00) }; with each light source seperated , basic linear attenuation applied diffuse lighting equation following results: this fragment shader: void main() { vec3 lighting = vec3(0.0); for(int = 0; < 4; ++i) lighting += diffuse(normalize(fs_in.normal), fs_in.fragpos, lightpositions[i], lightcolors[i]); // lighting = pow(lighting, vec3(1.0/2.2)); fragcolor = vec4(lighting, 1.0f); } not barely see difference in brightness gamma corrected lights, attenuation distorted gamma correction. far understanding goe

java - implementing Discrete Wavelet Transformation on android -

i'm writing application applying discrete wavelet transformation on image , inverse class applying algorithm works in java when try convert android platform image dose not appear don't know why here code class , main activity : wtc using haar class : import android.graphics.bitmap; /** * @author the-e_000 */ public class haar { private final double w0 = 0.5; private final double w1 = -0.5; private final double s0 = 0.5; private final double s1 = 0.5; /// <summary> /// discrete haar wavelet transform /// </summary> /// public void fwt(double[] data) { double[] temp = new double[data.length]; int h = data.length >> 1; (int = 0; < h; i++) { int k = (i << 1); temp[i] = data[k] * s0 + data[k + 1] * s1; temp[i + h] = data[k] * w0 + data[k + 1] * w1; } (int = 0; < data.length; i++) data[i] = temp[i]; } ///

c# - MVVM: Bind ContentControl to CheckBox -

i have contentcontrol want bind it's content property ischecked property of checkbox . using mvvm, idea thought of doing this: <contentcontrol contenttemplate="{binding currenttemplate}"/> <checkbox ischecked="{binding isnewcustumor}"/> and in view model listen isnewcustumor property change , assign corresponding datatemplate currenttemplate property, think involve using views in view model not mvvm . idea write converter class, don't know how should implement it. so can help? as far understand want switch template based on value of property isnewcustomer . 1 way achieve this, using style trigger. advantage is, purely xaml , easy read: <contentcontrol> <contentcontrol.style> <style targettype="contentcontrol> <style.triggers> <datatrigger binding="{binding isnewcustomer}" value="true"> <setter property=&

linux - Executing Sh with xdotools commands from PHP -

i'm trying execute sh script it's using inside xdotool commands, invoked php page. the user executing apache "daemon". sh code echo $1 win=`xdotool search --onlyvisible --name zoiper windowactivate` whoami sleep 2 xdotool $win type $1 key return sleep 10 xdotool key alt+h php code <?php shell_exec("sudo sh /tmp/zoiper_dialer.sh " . $phone); ?>

html - Center Javascript Slideshow? -

this question has answer here: how horizontally center <div> in <div>? 72 answers i beginner @ coding , answers have come across have gone straight on head. code have make slideshow work (which working) is: <script type="text/javascript"> <!--> var image1=new image() image1.src="congo.jpg" var image2=new image() image2.src="snow.jpg" var image3=new image() image3.src="mekong.jpg" //--> </script> and in body section: <img src="congo.jpg" name="slide" width="400" height="300"> <script type="text/javascript"> <!-- var step=1 function slideit(){ document.images.slide.src=eval("image"+step+".src") if(step<3) step++ else step=1 settimeout("slideit()",2500) } slideit() //--> </script> i ha

How to get ttf font data from system fonts in java -

i have ttf fonts installed on system. i list using graphicsenvironment.getlocalgraphicsenvironment().getavailablefontfamilynames() this not ttf fonts fonts guess. if use: font.decode(fontname) i can awt.font instance. as far know font not connected actual physicalfont, how can retrieve either ttf font file, or byte data ttf file font list or awt.font ? trying retrieve physical font data or similar. data should somewhere right? the reason need use libgdx freetypefontgenerator in order generate bitmapfont this has work on windows, osx , linux. it isn't possible. best can using reflection , work oracle jre , accesses private api may break new oracle release. you write native lib enumerate fonts , files.

javascript - How to make XSS vulnerable box -

i wanna make little input box user can submit code , happen put <script>alert("this alert")</script> then alert pop on page need education purposes <form><input type="text" name="xss"><input type="submit"></form> <p>result: <?= $_get['xss'] ?></p> thats have tried doesnt work , w3c not cover how make xss vulnerable input there several ways this. 1 person suggested indeed use eval(). following: <input type='text' id='vulnbox' value="alert('hello');"/> <button onclick="eval(document.getelementbyid('vulnbox').value)">test</button> here's corresponding fiddle example jsfiddle if interaction more client server use $_get in php read malicious javascript url , output contents of page. so visit page url like: yoursite.com?xss=%3cscript%3ealert()%3c%2fscript%3e and php file

javascript - Prepare SQL - AJAX return Data -

i need setting db marker retrieval. got bit confused on pass back. here have far: data returned: ["chatswood nsw au","chippendale nsw au"] js: var opdata = []; function markers() { $.post("id.php", {id: <?php echo $id; ?>}) .done(function(data) { //data array returned opdata = data; //tried $(opdata) = data; //tried opdata.push(data); //tried $.each(data, function(i) { //tried opdata.push(data[i]); }); }); console.log(opdata); //shows [] empty array regardless } php: $arr = array(); while ( $selectdata -> fetch() ) { $arr[] = $address; } echo json_encode($arr); how go retrieving data? none of above working. this driving me nuts.. should $.ajax instead? the call .done asynchronous, meaning .done finishes right away, before ajax call made, ,

posthoc - Post hoc tukey test for two way mixed model ANOVA -

i , of students have searched solution in numerous places no luck , literally months. keep on being referred lme command not want use. output provided not 1 colleagues or myself have used on 15 years. given using r teaching tool, not flow following t-tests, , one-way anovas intro stats students. conducting 2 way rm anova 1 factor repetition. have succeeded in getting r replicate sigmaplot gives main effects. post hoc analysis given r differs same post hoc in sigmaplot. here code used - notes (as using teach students). #iv between: ivb1 - independent variable - between subject factor #iv within: ivw1 - independent variable - within subject factor #dv: dv - dependent variable. aov1= aov(dv ~ ivb1*ivw1 + error(subject/ivw1)+(ivb1), data=objectl) summary(aov1) # post hoc analysis ph1=tukeyhsd(aov(dv ~ ivb1*ivw1, data=objectl)) ph1 i hope can help. thank you! i have had problem , find convenient alternative aov_ez() function afex package instead of aov(), , pe

java - Spring parameter to store procedure ArrayDescriptor with attribute blob -

i'm using spring 3.2.2 , java code: @override public void writesql(sqloutput stream) throws sqlexception { stream.writeint(this.intidndcarchivoadjunto); stream.writeint(this.objnotacredito.getintid()); stream.writestring(this.strnombrearchivo); stream.writestring(this.strformatoarchivo); stream.writeint(this.objtipoarchivo.getintidtipoarchivo()); oracle.sql.blob blob = oracle.sql.blob.getemptyblob(); blob.setbytes(getobjarchivocargado()); stream.writeblob(blob); } i have in oracle: create or replace type "tp_obj_ndc_archivo" object( id_ndc_archivo_adjunto number, id_ndc number, nombre_archivo varchar2(50), formato varchar2(5), tipo_archivo number, archivo blob ); create or replace type "tp_arr_ndc_archivo" table of tp_obj_ndc_archivo; i did several examples arraydescriptor have problems when contains type blob: org.springframework.jdbc.uncategorizedsqlexception: callablestatementcallback; uncategorized sqlexcep

javascript - Jquery Selectors for multipe slideToogle -

how set selector specific each h1 , main within multiple repeated structure. need able click on h1 , open contained on same section per html bellow. per javascript bellow please answer var trigger , var content should accomplish requirements. <section id="side_nav"> <!-- main --> <section> <header> <h1>main header</h1> <a href="#">call action</a> </header> <main> <div> <p><span>content</span><span>content</span></p> <p><span>content</span><span class="positive">content</span></p> </div> </main> </section> <!-- first sub --> <section> <header> <h1>

domain driven design - How to Persist N Value Objects in an Aggregate Root -

in ddd, in aggregate root of person value object of address, mapping address database table simple: embed attributes of address object record. when person has list, count can vary? create separate table stores our addresses (thereby imposing quasi-identity on each one), , each row fk person belongs? there example of object-relational impedance mismatch. can have layer super-type persistence concerns such id field lives. therefore, persistence layer's point of view, vo entity, still modeled vo in domain. you can read more above here .

Bootstrap 3 navbar-toggle opening at 90% width then sliding right to fill screen? -

i have navbar-toggle menu that, when opened, opens @ looks 90% width slides right fill screen! cannot work out issue here: http://www.bootply.com/zanqbwtecu also in desktop view in same example have nav-pills nav-justified menu that, when hover on button, increases in height give impression of button moving down when click on 1 of submenu options jumps original height. how button remain @ increased width? remove .nav { letter-spacing: 1px; position: absolute; top: 0; left: 0; z-index: 20; } replace with #rickwoodcollapse { width:100%; padding:0; } here bootply -

c# - Simple string property won't seem to bind in XAML GUI -

i have page want display string property in label . code, nothing appear in label. this .xaml <page x:class="myproject.pageone" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" d:designheight="300" d:designwidth="300" title="pageone" name="pageone> <grid> <grid.columndefinitions> <columndefinition width="*"/> </grid.columndefinitions> </grid> <label grid.column="0" content="{binding elementname=pageone, path=astr}" fontweight="normal" fontsize="43" horizontalalignment=&

styles - odoo / OpenERP V8 - template lost for the QWEB reports -

system: odoo v8. issue: on last pdf order discovered somehow the template not applied . (only flat ugly text) fields here, including footer but header not here , there no style applied nor pictures (as default in previous reports) the same occurred pdf reports guess somehow changed or killed template. how may fix it? before: after install correct. base template applied , ok both sales , purchase pdf files. update: content of model in company setting (settings=>company under report tab) correct (when preview page ok) the external_layout qview : <?xml version="1.0"?> <t t-name="report.external_layout"> <!-- multicompany --> <t t-if="o , 'company_id' in o"> <t t-set="company" t-value="o.company_id"/> </t> <t t-if="not o or not 'company_id' in o"> <t t-set="company" t-value="res_company"/&g

html - how to configure a manifest file -

this first time in stackoverflow if break rule or something, please tell me , ill try fix asap. im trying configure manifest (appcache) file download 2 files( 1 html , 1 js) , able use html in offline mode, after many trys, couldnt configure manifest file (or maybe else fail?) store appcache files. at moment have in same folder, 3 files: juego.html , damas.appcache , juego.js damas.appcache: cache manifest cache: juego.html juego.js network: * and in html file... juego.html: <!doctype html> <html manifest="damas.appcache"> ... i dont think more html code or javascript code needed explanation if needed, ill put it. ¿how can got files stored in local? thanks all it's possible have older version of html cached. seems case because setup looks correct, missing unique value—such timestamp—in damas.appcache . cache manifest gets updated when there change file. it's possible mime-type incorrect. ensure mime-type set cache manifest

javascript - How to understand this syntax? var {...} = React; -

this question has answer here: what curly brackets in `var { … } = …` statements do? 3 answers in react native example: https://github.com/facebook/react-native var react = require('react-native'); var { scrollview, touchablehighlight, text } = react; var touchdemo = react.createclass({ render: function() { return ( <scrollview> <touchablehighlight onpress={() => console.log('pressed')}> <text>proper touch handling</text> </touchablehighlight> </scrollview> ); }, }); what syntax mean? var { scrollview, touchablehighlight, text } = react; i typed in nodejs console cause syntax error. special javascripts syntax react native? thanks that destructuring , ecmascript 6 feature . far know not included in version of node.js or iojs yet, there may comma

excel - Differentiating between cells that have the same information for match function -

lets have these 3 tables show interest rates various different things (e.g. auto loan, mortage, credit cards). "######"s showing there values in cells used calculate numbers @ bottom (0.01, 0.03, etc.). lets range in excel these 3 data tables a1:i6 . | | datatable 1 | | | datatable 2 | | | datatable 3 | | |:------------:|:---------------:|:-------------:|:------------:|:---------------:|:-------------:|:------------:|:---------------:|:-------------:| | low,interest | medium,interest | high,interest | low,interest | medium,interest | high,interest | low,interest | medium,interest | high,interest | |--------------|-----------------|---------------|--------------|-----------------|---------------|:-------------|-----------------|---------------| | ####### | ####### | ####### | ####### | ####### | ####### | ####### | ####### | #

asp.net mvc 4 - RazorEngine Error trying to send email -

i have mvc 4 application sends out multiple emails. example, have email template submitting order, template cancelling order, etc... i have email service multiple methods. controller calls send method looks this: public virtual void send(list<string> recipients, string subject, string template, object data) { ... string html = getcontent(template, data); ... } the send method calls getcontent , method causing problem: private string getcontent(string template, object data) { string path = path.combine(basetemplatepath, string.format("{0}{1}", template, ".html.cshtml")); string content = file.readalltext(path); return engine.razor.runcompile(content, "htmltemplate", null, data); } i receiving error: the same key used template! in getcontent method should add new parameter templatekey , use variable instead of using htmltemplate ? new order email template have neworderkey , cancelorderkey email t

woocommerce - Jetpack making the Desktop website weird -

i using jetpack alongside woocommerce (basically mobile theme). have noticed whenever jetpack plugin activated, , feel of desktop website changes.for instance, products carousel displays single product. menu hover doesn't work. product images doesn't show @ etc. deactivate jetpack, website goes normal state. want use jetpack, please help.

jquery - Pass JSON String using Ajax in Java EE -

mongodb doesn't have built-in restful interface trying convert mongodb query result string format , send on using ajax giving me error servletdemo.java : com.mongodb.servlets public void dopost(...){ returnstring(); } public string returnstring(){ mongoclient mongoclient = new mongoclient(new mongoclienturi("mongodb://localhost:27017")); db database = mongoclient.getdb("db"); dbcollection collection = database.getcollection("coll"); dbobject getdocs = new basicdbobject(); dbcursor cursor = collection.find(getdocs); while(cursor.hasnext()){ returnstring += string.format("%s",cursor.next()); } return returnstring; } index.html <body> <button>click me</button> <p></p> <script> $(document).ready(function(){ $("button").on("click",function(){ $.ajax({ url:'servletdem

c# - Create a custom ASP.NET (not MVC) directive possible? -

i'm working on advanced custom framework websites i'm developing @ work, , i'm implementing small plugin system it. want register plugins somehow in aspx file can hook different page events (load, prerender, etc.) after calling them in sequence in page_init function, example. i'll jump straight code see want do: <%@ page language="c#" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" %> <%@ plugin typename="myframework.plugin.core" arg1="arg1" arg2="arg2" %> <%@ plugin typename="myframework.plugin.mainmenu" arg1="arg1" arg2="arg2" %> <%@ plugin typename="myframework.plugin.ie6hacks" arg1="arg1" arg2="arg2" %> <%@ plugin typename="myframework.plugin.footer2015" arg1="arg1" arg2="arg2" %> <%@ plugin typename="myframework.plugin.sortablegridviews"

jquery - WebSite Ajax navigation doesn't work when refreshing / share link -

i'm building website ajax navigation, whole site doesn't need load everytime user wants see page. home, about, news, contact, etc... i did built it, url refresh, button, ok. have following problem. compartilhar/refresh: when refresh page or share link someone, website doesn't load properly. loads specifc portion of site. example: if share link mysite.com/about.php load text of page no header, footer, , other common element main layout. no css . same thing happens if refresh page when i'm in other page. i tried follow tutorial here doesn't load anything. give me blank space. the code have below working, problem i've described above. jquery code: $(document).ready(function() { var content = $('#site'), firstlink = $(".navbar li:first-child a").attr("href"), navlink = $(".navbar li a"); content.load(firstlink); //default load navlink.on("click", function(event){

YouTube API V3 Search - regionCode and relevanceLanguage -

as google informed, i'm moving service api v2 api v3. but i'm having trouble making work parameters regioncode , relevancelanguage when search videos in new api. looking other forums matter, saw lot of people can't make them work too. people claim not work. it's bug has not been resolved yet. please comment , vote here: https://code.google.com/p/gdata-issues/issues/detail?can=2&start=0&num=100&q=&colspec=api%20id%20type%20status%20priority%20stars%20summary&groupby=&sort=&id=7130 also please add youtube-api posts tags.

git - SSH push to Bitbucket using generated keys on Windows 7 -

i follow documentation on bitbucket site , push existing project remote repository ssh. perfomed next steps in cmd: i generated public , private key using puttygen added private key using pageant added ssh config file inside ~/.ssh added public key bitbucket when try execute: git push -u origin --all i stacktrace: enter passphrase key 'k:\path\private_work_key.ppk': enter passphrase key 'k:\path\private_work_key.ppk': enter passphrase key 'k:\path\private_work_key.ppk': permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists. i added public key ~/.ssh/authorized_keys , problem remains. please, explain did wrong? the following scenario worked me, first add key ssh agent, ssh-add path/to/your/privatekey and then, start ssh-agent ssh-agent now try pushing project repository.

ios - Uiimageview not showing in iPhone 6 and 6 plus -

Image
i have collection view custom cell. and in custom cell iphone 6 , 6 plus uiimageview not showing. when printing frame there. nslog(@"%f-%f-%f-%f",cell._image.frame.origin.x,cell._image.frame.origin.y,cell._image.frame.size.width,cell._image.frame.size.height); log - 0.000000-0.000000-177.500000-168.000000 cell screenshot - any suggestions doing wrong... note - working in ipad, iphone 4,4s,5. have checked see if image loaded. iphone 6 (vs working ones) looking file/resource of name imagename@2x.png its possible image view setting alpha 0 (so image ends being white background). may have need comment out (or switch on phone type) : - (void) setalpha:(float)alpha { // [super setalpha:alpha]; } where image loaded from? maybe show code too. maybe have offsets put image off display?

javascript - How to compare the order of two sets of data -

i have got 2 sets of data . var array = ["one" , "two" , "three" , "four" , "five"]; var t1 = "one" ; var t2 = "two" ; var t3 = "three" ; var t4 = "four" ; var t5 = "five" ; i want check order of data in both sets , trying way if(t1==array[0] && t2==array[1] && t3 ==array[2] && t4==array[3] && t5==array[4]) { alert('yes'); } else { alert('no'); } but i'm getting alert "no" . could please let me know how resolve ?? http://jsfiddle.net/85utz097/ you getting "no" because one != 1 change this: var t1 = "one" ; and "yes"!! check demo

abstract syntax tree - Python ast and inspect.getsource() -

how can 1 make ast tree inspectable inspect.getsource() exec(compile(create_module(...), 'foo.py', 'exec')) print(inspect.getsource(obj.instance.method)) inspect.getsource() returns newline terminated string.

php - Unable to connect to Database through WAMP Local server phpmyadmin -

here code connection database i.e. connection.php file. <?php $host="localhost"; $user="root"; $password="123456"; $database="database name"; $conn=mysql_connect($host,$user,$password); mysql_select_db($database); if($conn){ $mysqlerror=false; } else{ echo "unable connect database"; $mysqlerror=true; } ?>

php - Crontab file is corrupted after remove an job on list? -

im using database controlled cronjobs newsletter. crontab job add / remove functions works fine, when remove job on list main trigger file not work properly. here workbench; task list table; id campaign_id remove date cron_command 1 1 0 2015-04-22 17:00:00 * * * * * curl -s http://example.com/tasks.php?id=1 main trigger file (cron.php) checking table, if date reach current date add cron_command crontab, works fine here. tasks.php file works fine , send "id1" campaign mails. after campaign task done , mails sent successfully, above record updated to id campaign_id remove date cron_command 1 1 1 2015-04-22 17:00:00 * * * * * curl -s http://example.com/tasks.php?id=1 main trigger file check remove 1 marked commands , should have remove record both side (crontab / db table). not remove command on crontab , db table, main trigger file gives error "ph

Android support v4 -

i have problem in project. when i'm trying build project error apears in logs: error:execution failed task ':app:dexdebug'. > com.android.ide.common.internal.loggederrorexception: failed run command: /users/pawelkoperdowski/documents/android/sdk/build-tools/22.0.1/dx --dex --no-optimize --output /users/pawelkoperdowski/documents/android/superplanner/superplanner-android/app/build/intermediates/dex/debug --input-list=/users/pawelkoperdowski/documents/android/superplanner/superplanner-android/app/build/intermediates/tmp/dex/debug/inputlist.txt error code: 2 output: unexpected top-level exception: com.android.dex.dexexception: multiple dex files define ljavax/inject/provider; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:171) @ co

ssas - How to filter a dimension hierarchy based on another dimension hierarchy in mdx -

i have sender , recipient dimensions role playing dimensions out of employee physical table. fact table has sender, recipient ,messages columns. want messages sent employee in company except reporting manager. tried this with set [others] except ( ascendants([recipient].[manager]) ,[sender].[manager].parent ) select [others] on columns ,{[measures].[messages]} on rows [cube] [sender].[manager].&[xyz]; basic idea is..get ascendants of recipients of given sender , filter ascendant list consists of senders parent. this doesn't work because can't except between 2 different dimension hierarchies. try making set more context aware via keyword exsiting , use filter compare member_caption with member [measures].[sendername] [sender].currentmember.member_caption set [existingrecip] (existing [recipient].[manager].members) set [others] filter ( [existingrecip] , [existingre

sql - Joining tables with different number of rows without duplicates -

i have complicated sql statement creates table of users have rights connect , appuser , or both: (select b.grantee "username", a.granted_role "connect", b.granted_role "appuser" (select grantee, granted_role dba_role_privs granted_role = 'connect') right outer join (select grantee, granted_role dba_role_privs granted_role = 'appuser') b on a.grantee=b.grantee) union (select a.grantee, a.granted_role, b.granted_role (select grantee, granted_role dba_role_privs granted_role = 'connect') left outer join (select grantee, granted_role dba_role_privs granted_role = 'appuser') b on a.grantee=b.grantee) this produces like: username connect appuser --------- --------- --------- sue connect appuser bob (null) appuser joe connect (null) i wish use all_users table, show users have neither rights.

linux - Catching ICMP reject on UNIX -

firewalls such iptables have option notify sender (after blocking packet) via icmp messages (e.g. port closed). message contains header of rejected packet (required rfc), it's technically possible associate application sent it. is there easy way programatically capture icmp messages related application in unix environment? convenient if application tell user destination behind firewall. doesn't have posix specified, shouldn't limited 1 platform (although know anyway :). one way achieve raw sockets , 1 using pcap, both of these quite invasive , have go through icmp messages , filter ones belong other applications. it's technically possible associate application sent it i doubt there's easy way want. kernel receives icmp message , processes before telling program unsuccessful. example, here's result of pinging unreachable host (running on linux using strace examine system calls; boldface line result of receiving icmp error): send

sql - Joining with a column of type varchar that has both string and numbers stored in it -

i have column in table of type varchar(50) stores both words , ids. example there values such as: 50, 95, example, testing.... when not isnumeric(column) , can use value. when isnumeric(column) , need join table value supposed selected. i got select part down: select case when isnumeric(column) = 1 othertable.name else column end now trying join under same scenario: left join othertable ot on cast(column int) = t.id this not work because cast not work when column word. need join if column number. i not fan of using 1 column store 2 different datatypes took on existing database don't have choice. in case better cast int varchar other way round: left join othertable ot on column = cast(t.id varchar(10))

erp - How to add filtering pop up in Acumatica -

Image
at ct502000 screen in acumatica noticed filterable pop filters data. how add similar filter grid? please don't confuse them pxdialog pop ups. i assume need pxfilteredprocessing attribute. example in project did following: [pxfilterable] public pxselectreadonly<anticipatedpayrolldetail> anticipatedpayrolldetails; this code caused apperance of following filter:

regex - Get text between curly brackets in python -

i'm trying text out of curly brackets of text: circle(265.17373,-53.674312,1") # text={1} circle(265.17373,-53.674312,2") # text={2} for stuff between parenthesis use , works array = np.append(array, np.array([float(x) x in re.findall(r"\d+(?:\.\d+)?", line)])) but want text inside of curly brackets. array2 = np.append(array2, np.array([float(x) x in re.findall(r"/\{([^}]+)\}/", line)])) but not give anything. you need remove forward slash present inside second line of code. array2 = np.append(array2, np.array([float(x) x in re.findall(r"\{([^}]+)\}", line)]