Tuesday, 15 March 2011

r - How to order error bars in ggplot2 on two conditions -



r - How to order error bars in ggplot2 on two conditions -

i trying order error bars in ggplot based on 2 columns. have looked @ provided answers helpful 1 column,but when want order on 2 fail obtain intended result.

this code fulfil firstwish of ordering teh bars based on first column (outcome)

ddf$outcome <- factor(ddf$outcome, levels=c("total", "cardva" , "ami" , "heartf" ,"dysrhy"), ordered=true)

however, when want order on column cat(with order of whole year, cold season , warm season) code not work.

ddf$cat <- factor(ddf$cat, levels= c("whole year", "cold","warm"), ordered=true)

how can order bars based on outcome , cat? next code produces plot alphabetical order of column cat.

dodge <- position_dodge(width=0.9) ggplot(ddf, aes(x = outcome, y = pinc,ymin = lcinc, ymax = ucinc, group=cat,color=cat,shape=cat)) + geom_point(position=dodge,size = 4) + geom_linerange(position=dodge,size =0.7) + geom_hline(aes(yintercept = 0)) + scale_x_discrete("", labels = c("ami" = "ami","cardva" = "any cvd", "dysrhy" = "dysrhythmia", "heartf" = "hf", "total"= "all subjects")) + theme_bw() + labs(colour="period", shape="period", y="relative difference (%)") + theme(axis.title=element_text(face="bold",size="14"),axis.text=element_text(size=14,face="bold"))

sample info follows

dput(ddf) structure(list(outcome = structure(c(1l, 1l, 1l, 2l, 3l, 4l, 5l, 2l, 3l, 4l, 5l, 2l, 3l, 4l, 5l), .label = c("total", "cardva", "ami", "heartf", "dysrhy"), class = c("ordered", "factor")), pinc = c(0.50389187458233, 0.579539836910437, 0.601685513579753, 0.28267013091543, 1.71852544919748, -0.284681087465499, -0.315288733679508, -0.214290507233894, -0.0319464172748196, -1.0103617140803, 0.0669795902723536, 0.338718648843339, 2.46728604502957, -0.626929184485836, -1.33251808343037), lcinc = c(0.124678813009127, -0.000690299706695985, 0.101542783301833, -0.317021516853733, 0.436205248000321, -1.32202043292773, -1.93050761165515, -1.18689153946393, -2.12567063251963, -2.7029110723661, -2.57800553889581, -0.573641468633246, 0.539635356054902, -2.18756799993103, -3.77359786707672), ucinc = c(0.884541170935749, 1.16313666688221, 1.10432713392166, 0.885969516714469, 3.01721768570142, 0.763563152101443, 1.32653303537096, 0.767883675589554, 2.10656667282445, 0.711630697043031, 2.78377546784718, 1.25945080162582, 4.43189566234674, 0.958610284817674, 1.17048722562318), cat = c("whole year", "cold season", "warm season", "whole year", "whole year", "whole year", "whole year", "cold season", "cold season", "cold season", "cold season", "warm season", "warm season", "warm season", "warm season")), .names = c("outcome", "pinc", "lcinc", "ucinc", "cat"), row.names = c("2", "8", "5", "41", "42", "44", "45", "31", "32", "34", "35", "26", "27", "29", "30"), class = "data.frame")

r plot ggplot2

javascript - AngularJS custom directive for mouseenter and mouseleave -



javascript - AngularJS custom directive for mouseenter and mouseleave -

i trying create custom directive because first solution came worked, seemed messy.

when tr element has mouseenter want show pencil icon, , when mouseleave occurs pencil icon should hide again.

first solution: (this worked)

<tr ng-mouseenter="hoveredit = !hoveredit" ng-mouseleave="hoveredit = !hoveredit" ng-repeat="user in users"> <td>{{user.first_name}}</td> <td>{{user.last_name}}</td> <td>{{user.email}}</td> <td><i ng-show="hoveredit" class="fa fa-pencil"></i></td> <td><button class="btn btn-danger" ng-click="delete(user)">delete</button></td> </tr>

i thought ng-mouseenter , ng-mouseleave seemed clutter tr element, want create directive...here tried

directive solution (doesn't work)

users.directive('showpencilhover', function() { homecoming { restrict: 'a', link: function(scope, element, attrs) { element.on('mouseenter', function() { hoveredit == !hoveredit }); element.on('mouseleave', function() { hoveredit == !hoveredit }); } } });

i believe problem can't reference hoveredit, i'm not sure how create work. advice!

sure can, have preface scope (notice how scope injected in link function)

link: function(scope, element, attrs) { element.on('mouseenter', function() { scope.hoveredit == !scope.hoveredit }); element.on('mouseleave', function() { scope.hoveredit == !scope.hoveredit }); }

javascript angularjs angularjs-directive

javascript - Dynamically build menu structure based on page elements -



javascript - Dynamically build menu structure based on page elements -

i'm having problems creating dynamic menu based on elements of page. how 1 create menu this?:

<div class="parent"> <div class="one child" id="first"></div> </div> <div class="parent"> <div class="one child" id="second"></div> </div> <div class="parent"> <div class="one child" id="third"></div> </div> <div class="parent"> <div class="one child" id="fourth"></div> <div class="one child" id="fifth"></div> <div class="one child" id="sixth"></div> <div class="one child" id="seventh"></div> </div> <div class="parent"> <div class="one child" id="eight"></div> </div>

so jquery build menu construction so:

<ul class="navigation"> <li><a href="#first"></a></li> <li><a href="#second"></a></li> <li><a href="#third"></a></li> <li> <ul class="sub-navigation"> <li><a href="#fourth"></a></li> <li><a href="#fifth"></a></li> <li><a href="#sixth"></a></li> <li><a href="#seventh"></a></li> </ul> </li> <li><a href="#eight"></a></li> </ul>

here fiddle i've been meddling (my effort on making work): http://jsfiddle.net/rt9pm/

somewhere along way lost focus point , i'm unable finish little doodle.

i had time, , thought might still of utilize you:

(function($){ $.fn.createmenu = function (opts){ var s = $.extend({ 'menuid' : 'menu', 'navigationid' : 'navigation', 'navigationclass' : 'navigation', 'attachto' : 'body' }, opts), nav = $('<nav />', { 'id' : s.navigationid }), menu = $('<ul />', { 'id' : s.menuid }), textprop = 'textcontent' in document.body ? 'textcontent' : 'innertext', ulwrap = document.createelement('ul'), liwrap = document.createelement('li'), awrap = document.createelement('a'), litmp,atmp, // defining function create li-wrapped links: createlinks = function (el, par, prefix) { // if 'par' jquery object we'll utilize that, // otherwise assume it's dom node , wrap jquery: var parent = par instanceof jquery ? par : $(par); // cloning created elements rather re-creating elements: atmp = awrap.clonenode(); // creating 'href' link id: atmp.href = '#' + el.id; atmp[textprop] = el.id; litmp = liwrap.clonenode(); // appending cloned element li element: litmp.appendchild(atmp); // adding appropriate class parent 'ul' element, // , appending 'li': parent.addclass(('undefined' === typeof prefix ? '' : prefix) + s.navigationclass).append(litmp); }; // appending 'menu' 'nav': nav.append(menu); // prepending nav specified element (from options/defaults): nav.prependto(s.attachto); // iterating on elements matched selector: this.each(function(i,e){ // using twice, caching: var $e = $(e); // if there no siblings: if ($e.siblings().length === 0) { // create links: createlinks(e, menu); } // if there previous siblings nothing: else if ($e.prev().length) { // nothing, inelegant // couldn't think of improve way } else { // there siblings (this should matched first // sibling of group. // clone new 'li' , 'ul' element: var li = liwrap.clonenode(), ul = ulwrap.clonenode(), // find childnodes of element's parent: items = e.parentnode.childnodes; // append cloned 'ul' cloned 'li': li.appendchild(ul); // iterate on childnodes: (var = 0, len = items.length; < len; i++) { // if node has nodetype *and* nodetype 1 // (therefore node htmlelement): if (items[i].nodetype && items[i].nodetype === 1) { // create links elements: createlinks(items[i], ul, 'sub-'); } } // append created 'li' (above, before loop) menu: menu.append(li); } }); // tend homecoming created elements, jquery often, however, returns // elements of original selector (which 'return this'): homecoming nav; }; })(jquery); $('.one').createmenu();

js fiddle demo.

references:

javascript: conditional (assessment ? assessment_true : assessment_false) 'ternary' operator. document.createelement(). instanceof operator. node.appendchild(). node.clonenode(). node.nodetype. typeof operator. jquery: addclass(). appendchild(). "how create basic jquery plugin." jquery.extend(). prependto(). prev(). siblings().

javascript jquery html

Adding multiple roles to CakePHP Auth Component -



Adding multiple roles to CakePHP Auth Component -

i using tutorial add together authentication , authorization component app.

the problem tutorials find assume user have 1 role. in attached video, roles enum field in users table. have 3 tables:

the users table roles table responsibilities table a table link roles , responsibilities a table link users , roles

i have log in process working, getting roles logged in user. best method this? know of tutorial includes well? using cake 2.5.2

i can post ever code might think relevant, have pretty much whats in video. also, lot of inner working of code seems hidden. suggestions great!

thanks

edit

below models user/roles/responsibilities tables added users object:

**user table:** id (pk) first_name last_name username password **role table** id(pk) role_name **responsibility table** id(pk) responsibility_name **user_roles_membership** id(pk) role_id(fk) user_id(fk) **roles_responsibilities_membership** id(pk) roles_id(fk) responsibility_id(fk)

simple cake authentication , authorization

to reply in detail require me write whole code or exhaustive article - i'm not going that. instead i'll point in right direction.

when user logged in, fetch associated roles , responsibilities user. next code taken from part of documentation (read whole page!). have no clue how info associated i'm guessing here.

$this->auth->authenticate = array( authcomponent::all => array( 'contain' => array( 'responsibility', 'role' ) ), 'form' );

look @ session after user logged in now, should see additional info there. utilize debugkit for illustration or debug() session.

next thing write customized authorization handler work data. documentation shows how here.

app::uses('baseauthorize', 'controller/component/auth'); class myauthorize extends baseauthorize { public function authorize($user, cakerequest $request) { // things permission scheme here. } }

inside authorize() method add together whatever logic need check permissions current logged in user, passed first arg, , check them against whatever want check in request, passed 2nd arg.

all of pretty straight forwards , documented on page. again, recommend read whole page. should become obvious how done.

also might want inquire more specific question generic 1 in case encounter problems implementation.

cakephp cakephp-2.3

mysql - Multiple table inner join not showing any results -



mysql - Multiple table inner join not showing any results -

i'm using visual studio sql database inner bring together 3 tables 1 main table.

the main table event , pk_eventsid linked fk_eventsid of other 3 tables (studentcompetition, immersiontrip, industrycollaboration)

i tried using inner bring together 2 tables (event , studentcompetition) , works, when add together table (event, studentcompetition, immersiontrip) not display though there inner join. column names appear, info doesn’t.

similar column names startdate, enddate , eventid while remaining different. know how grouping similar column names

i'm planning bring together more 10 tables search function.

sql query

select event.eventname, event.eventid, studentcompetition.competitionname, immersiontrip.immersionname event inner bring together studentcompetition on event.eventid = studentcompetition.eventid inner bring together immersiontrip on event.eventid = immersiontrip.eventid

mysql sql visual-studio-2010 join

java - retrieve status from methods insert or save of MongoDb with Spring Data -



java - retrieve status from methods insert or save of MongoDb with Spring Data -

i don't know how retrieve or status know if insert or not document in mongodb

public boolean save(t usuario) { boolean result = false; mongooperations.save(usuario); homecoming result; }

as far know there no way writeresult saveor ìnsertoperations.

but can setting writeconcern 1 or operations.

mongotemplate.setwriteconcern(writeconcern wc)

see mongodb documentation

java mongodb spring-data spring-data-mongodb

Rails 4 Seeding Devise Admins -



Rails 4 Seeding Devise Admins -

i've seen few questions how go seeding users / admins / people through devise none of them working me , i'd assume it's because using rails4.

i need 1 seed. set straight seed file

admin = admin.new admin.email = 'adminone@gmail.com' admin.password = "topsecret" admin.password_confirmation = "topsecret" admin.save!

that did not work...

neither did this...

admin = admin.create! :name => 'john doe', :email => 'john@gmail.com', :password => 'topsecret', :password_confirmation => 'topsecret'

the seed functions, when seek login, invalid combination.

thoughts? i'm using

devise :database_authenticatable, :registerable, #:recoverable, :rememberable, :trackable, :validatable

for model.

update: entire applicationcontroller.rb

class applicationcontroller < actioncontroller::base before_filter :set_mail # prevent csrf attacks raising exception. # apis, may want utilize :null_session instead. protect_from_forgery with: :exception def set_mail @mail_subscriber = mailsubscriber.new(mail_subscriber_params) end private def current_cart cart = cart.find(session[:cart_id]) unless cart.active? cart = cart.create session[:cart_id] = cart.id end cart rescue activerecord::recordnotfound cart = cart.create session[:cart_id] = cart.id cart end def mail_subscriber_params params.fetch(:mail_subscriber, {}).permit(:email, :name) end end

update #2

admin.valid_password?("topsecret")

gives me, seed must not have worked?

bcrypt::errors::invalidhash: invalid hash

admin.create! :email => 'john@gmail.com', :password => 'topsecret', :password_confirmation => 'topsecret'

did not work but

admin.create :email => 'john@gmail.com', :password => 'topsecret', :password_confirmation => 'topsecret'

did work. difference ! after 'create'

hopefully helps people run issue in future

ruby-on-rails ruby-on-rails-4 devise

c# - Editable tooltip in winforms -



c# - Editable tooltip in winforms -

i wondering, possible have tooltip content edited?

for illustration when focus textbox, tooltip pop , if clicked, content editable. e.g. if tooltip contains description of item, description editable , stored in database, next time tooltip show new description.

if isn't possible, there way implemented?

definition of tooltip:

the tooltip or infotip or hint mutual graphical user interface element. used in conjunction cursor, pointer. user hovers pointer on item, without clicking it, , tooltip may appear—a little "hover box" info item beingness hovered over.

so it's info only. if want create contents editable, require using form, textbox, etc.

assuming tip meant help user, doesn't create much sense allow user edit contents of help information.

c# winforms tooltip

packages - "import as" in R -



packages - "import as" in R -

is there way import bundle name in r, way might import as in python, e.g. import numpy np? i've been starting utilize package::function lately avoid conflicts between, say, hmisc::summarize , plyr::summarize.

i'd able instead write h::summarize , p::summarize, respectively. possible in r?

here's solution should used interactive mode. modify :: can take character bundle names, write function register aliases.

`::` <- function(pkg, name) { sym <- as.character(substitute(pkg)) pkg <- trycatch(get(sym, envir=.globalenv), error=function(e) sym) name <- as.character(substitute(name)) getexportedvalue(pkg, name) } pkg.alias <- function(alias, package) { assign(alias, package, .globalenv) lockbinding(alias, .globalenv) } pkg.alias('r', 'reshape2') r::dcast

but instead of using aliases, redefine :: find bundle matches abbreviation:

`::` <- function(pkg, name) { pkg <- as.character(substitute(pkg)) pkg <- installed.packages()[grepl(paste0('^', pkg), installed.packages())] name <- as.character(substitute(name)) getexportedvalue(pkg, name) } ggp::ggplot

r packages

angular ui.grid [[object HTMLDivElement]] will be displayed instead of data in every cell -



angular ui.grid [[object HTMLDivElement]] will be displayed instead of data in every cell -

i'm using angular 1.3 , angular ui bootstrap , ui-grid 3(because of rtl support).

here plunkr.

i've fixed using row template, alter adding {{row.entity[col.field]}} in default row template.

here result:

rowtemplate: "<div><div ng-repeat=\"col in grid.renderedcolumns track $index\" class=\"ui-grid-cell col{{ col.index }}\"><div class=\"ui-grid-vertical-bar\">&nbsp;</div><div class=\"ui-grid-inner-cell-contents\" ui-grid-cell=\"\" col=\"col\" row=\"row\" row-index=\"row.index\" col-index=\"col.coldef.index\">{{row.entity[col.field]}}</div></div>",

angular-ui angular-ui-bootstrap angular-ui-grid

wildfly - JBOSS latest version -



wildfly - JBOSS latest version -

i going start new enterprise application. version wanted use? eap 6.2.0 ga(eap built 7.3) or jboss 7.1.0.final or wildfly 8.1.0.final? confused these versions. when have download eap 6.2.0?

also, why wildfly not avaialbe on http://jbossas.jboss.org/downloads/? why? having impression wildfly , jboss8 same. if both same, why not avalible in downloads of above link?

the community version of jboss has been renamed wildfly , can found here: http://wildfly.org/downloads/. eap 6.2 commercial version of jboss provided redhat professional back upwards them.

which version take depends on requirements , whether willing spend money ;) if going community version, wouldn't create sense start jboss 7 since wildfly 8 provides java ee 7 support, jboss 7 not. i've migrated huge industry-strength project wildfly , surprised new application server. nevertheless, current experience, recommend go eap , professional back upwards big projects utilize whole java ee stack. drawback there eap 6 doesn't back upwards java ee 7 yet.

jboss wildfly

java - When I set a content descriptor on a button subclass in Android, the word "button" gets appended on TalkBack -



java - When I set a content descriptor on a button subclass in Android, the word "button" gets appended on TalkBack -

i trying talkback read content descriptor on button subclass. 1 time button subclass selected, talkback gives me content descriptor plus word "button" @ end. how prevent word beingness appended?

note: did doc reading , noticed dispathpopulateaccessibilityevent() mentions getting accessibilityevent populated/visiting children of view acted event trigger. mean event touches view hierarchy?, , if so, button superclass adding text?

a simple workaround avoid using button, causes words added.

for example, may able replace textview, made button, , add together click listener using view.setonclicklistener(listener) desired effect - see android docs.

there number of such listeners in basic view class can added ui component using view.seton<event>listener(listener) in activity.oncreate method. in case, double-tap listener constructed ontouchlistener, though may require little experimentation precise result want.

java android button accessibility talkback

java - Texture deforming, 4 points -



java - Texture deforming, 4 points -

i writing simple 3d game in java , need code / lib texture deforming. don't want utilize opengl.

example:

i have got texture:

and need deform to:

i hope can understand me. thanks!

ok, here go. implemented small, self-contained illustration can drag around corners mouse:

+1 to...

tucuxi posted basic approach in his answer mvg @ math.stackexchange.com described how compute projective transformation 4 points

here's code:

import java.awt.color; import java.awt.graphics; import java.awt.gridlayout; import java.awt.point; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import java.awt.geom.point2d; import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import javax.swing.imageicon; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.swingutilities; public class pseudo3dtest { public static void main(string[] args) { swingutilities.invokelater(new runnable() { @override public void run() { createandshowgui(); } }); } private static void createandshowgui() { jframe f = new jframe(); f.setdefaultcloseoperation(jframe.exit_on_close); bufferedimage image = null; seek { image = imageio.read(new file("lena512color.png")); } grab (ioexception e) { e.printstacktrace(); return; } f.getcontentpane().setlayout(new gridlayout(1,2)); f.getcontentpane().add(new jlabel(new imageicon(image))); f.getcontentpane().add(new pseudo3dimagepanel(image)); f.pack(); f.setlocationrelativeto(null); f.setvisible(true); } } class pseudo3dimagepanel extends jpanel implements mouselistener, mousemotionlistener { private final bufferedimage inputimage; private final point2d p0; private final point2d p1; private final point2d p2; private final point2d p3; private point2d draggedpoint; pseudo3dimagepanel(bufferedimage inputimage) { this.inputimage = inputimage; this.p0 = new point2d.double(30,20); this.p1 = new point2d.double(50,400); this.p2 = new point2d.double(450,300); this.p3 = new point2d.double(430,100); addmouselistener(this); addmousemotionlistener(this); } @override protected void paintcomponent(graphics g) { super.paintcomponent(g); bufferedimage image = pseudo3d.computeimage(inputimage, p0, p1, p2, p3); g.drawimage(image, 0, 0, null); int r = 8; g.setcolor(color.red); g.filloval((int)p0.getx()-r, (int)p0.gety()-r, r+r, r+r); g.filloval((int)p1.getx()-r, (int)p1.gety()-r, r+r, r+r); g.filloval((int)p2.getx()-r, (int)p2.gety()-r, r+r, r+r); g.filloval((int)p3.getx()-r, (int)p3.gety()-r, r+r, r+r); } @override public void mousepressed(mouseevent e) { point p = e.getpoint(); int r = 8; if (p.distance(p0) < r) draggedpoint = p0; if (p.distance(p1) < r) draggedpoint = p1; if (p.distance(p2) < r) draggedpoint = p2; if (p.distance(p3) < r) draggedpoint = p3; } @override public void mousedragged(mouseevent e) { if (draggedpoint != null) { draggedpoint.setlocation(e.getx(), e.gety()); repaint(); } } @override public void mousereleased(mouseevent e) { draggedpoint = null; } @override public void mousemoved(mouseevent e) {} @override public void mouseclicked(mouseevent e) {} @override public void mouseentered(mouseevent e) {} @override public void mouseexited(mouseevent e) {} } class pseudo3d { static bufferedimage computeimage( bufferedimage image, point2d p0, point2d p1, point2d p2, point2d p3) { int w = image.getwidth(); int h = image.getheight(); bufferedimage result = new bufferedimage(w, h, bufferedimage.type_int_argb); point2d ip0 = new point2d.double(0,0); point2d ip1 = new point2d.double(0,h); point2d ip2 = new point2d.double(w,h); point2d ip3 = new point2d.double(w,0); matrix3d m = computeprojectionmatrix( new point2d[] { p0, p1, p2, p3 }, new point2d[] { ip0, ip1, ip2, ip3 }); matrix3d minv = new matrix3d(m); minv.invert(); (int y = 0; y < h; y++) { (int x = 0; x < w; x++) { point2d p = new point2d.double(x,y); minv.transform(p); int ix = (int)p.getx(); int iy = (int)p.gety(); if (ix >= 0 && ix < w && iy >= 0 && iy < h) { int rgb = image.getrgb(ix, iy); result.setrgb(x, y, rgb); } } } homecoming result; } // http://math.stackexchange.com/questions/296794 private static matrix3d computeprojectionmatrix(point2d p0[], point2d p1[]) { matrix3d m0 = computeprojectionmatrix(p0); matrix3d m1 = computeprojectionmatrix(p1); m1.invert(); m0.mul(m1); homecoming m0; } // http://math.stackexchange.com/questions/296794 private static matrix3d computeprojectionmatrix(point2d p[]) { matrix3d m = new matrix3d( p[0].getx(), p[1].getx(), p[2].getx(), p[0].gety(), p[1].gety(), p[2].gety(), 1, 1, 1); point3d p3 = new point3d(p[3].getx(), p[3].gety(), 1); matrix3d minv = new matrix3d(m); minv.invert(); minv.transform(p3); m.m00 *= p3.x; m.m01 *= p3.y; m.m02 *= p3.z; m.m10 *= p3.x; m.m11 *= p3.y; m.m12 *= p3.z; m.m20 *= p3.x; m.m21 *= p3.y; m.m22 *= p3.z; homecoming m; } private static class point3d { double x; double y; double z; point3d(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } } private static class matrix3d { double m00; double m01; double m02; double m10; double m11; double m12; double m20; double m21; double m22; matrix3d( double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) { this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m10 = m10; this.m11 = m11; this.m12 = m12; this.m20 = m20; this.m21 = m21; this.m22 = m22; } matrix3d(matrix3d m) { this.m00 = m.m00; this.m01 = m.m01; this.m02 = m.m02; this.m10 = m.m10; this.m11 = m.m11; this.m12 = m.m12; this.m20 = m.m20; this.m21 = m.m21; this.m22 = m.m22; } // http://www.dr-lex.be/random/matrix_inv.html void invert() { double invdet = 1.0 / determinant(); double nm00 = m22 * m11 - m21 * m12; double nm01 = -(m22 * m01 - m21 * m02); double nm02 = m12 * m01 - m11 * m02; double nm10 = -(m22 * m10 - m20 * m12); double nm11 = m22 * m00 - m20 * m02; double nm12 = -(m12 * m00 - m10 * m02); double nm20 = m21 * m10 - m20 * m11; double nm21 = -(m21 * m00 - m20 * m01); double nm22 = m11 * m00 - m10 * m01; m00 = nm00 * invdet; m01 = nm01 * invdet; m02 = nm02 * invdet; m10 = nm10 * invdet; m11 = nm11 * invdet; m12 = nm12 * invdet; m20 = nm20 * invdet; m21 = nm21 * invdet; m22 = nm22 * invdet; } // http://www.dr-lex.be/random/matrix_inv.html double determinant() { homecoming m00 * (m11 * m22 - m12 * m21) + m01 * (m12 * m20 - m10 * m22) + m02 * (m10 * m21 - m11 * m20); } final void mul(double factor) { m00 *= factor; m01 *= factor; m02 *= factor; m10 *= factor; m11 *= factor; m12 *= factor; m20 *= factor; m21 *= factor; m22 *= factor; } void transform(point3d p) { double x = m00 * p.x + m01 * p.y + m02 * p.z; double y = m10 * p.x + m11 * p.y + m12 * p.z; double z = m20 * p.x + m21 * p.y + m22 * p.z; p.x = x; p.y = y; p.z = z; } void transform(point2d pp) { point3d p = new point3d(pp.getx(), pp.gety(), 1.0); transform(p); pp.setlocation(p.x / p.z, p.y / p.z); } void mul(matrix3d m) { double nm00 = m00 * m.m00 + m01 * m.m10 + m02 * m.m20; double nm01 = m00 * m.m01 + m01 * m.m11 + m02 * m.m21; double nm02 = m00 * m.m02 + m01 * m.m12 + m02 * m.m22; double nm10 = m10 * m.m00 + m11 * m.m10 + m12 * m.m20; double nm11 = m10 * m.m01 + m11 * m.m11 + m12 * m.m21; double nm12 = m10 * m.m02 + m11 * m.m12 + m12 * m.m22; double nm20 = m20 * m.m00 + m21 * m.m10 + m22 * m.m20; double nm21 = m20 * m.m01 + m21 * m.m11 + m22 * m.m21; double nm22 = m20 * m.m02 + m21 * m.m12 + m22 * m.m22; m00 = nm00; m01 = nm01; m02 = nm02; m10 = nm10; m11 = nm11; m12 = nm12; m20 = nm20; m21 = nm21; m22 = nm22; } } }

java image-processing

c++ - Running MPI programs with multiple processes with Code::Blocks -



c++ - Running MPI programs with multiple processes with Code::Blocks -

i new mpi , trying run 'hello world' program. here program

#include <iostream> #include <mpi.h> using namespace std; int main(int argc, char ** argv) { int mynode, totalnodes; mpi_init(&argc,&argv); mpi_comm_size(mpi_comm_world, &totalnodes); mpi_comm_rank(mpi_comm_world, &mynode); cout << "hello world process " << mynode; cout << " of " << totalnodes << endl; mpi_finalize(); }

the output just

hello world process 0 of 1

i have multi-core cpu , think there should @ to the lowest degree 4 processes running. output should be:

hello world process 0 of 4 hello world process 1 of 4 hello world process 2 of 4 hello world process 3 of 4

or similar. can comment did miss in programme or compile command? way running on windows, msmpi, gcc compiler on code::blocks ide. thanks.

it worked me.

i re-create pasted code mpi_app.cpp. mpicxx compiler wrapper script provided mpi implementers takes care of includes , libs. mpirun wrapper script launching mpi programs provided mpi implementers. mpi implementation i'm using mpich2.

$ mpicxx -o0 -o mpi_app mpi_app.cpp $ mpirun -n 4 ./mpi_app hello world prochello world process 2 hello world process hello world process 0 oess 1 of 4 of 4 3 of 4 f 4

note: "f 4" not re-create paste error. when multiple processes writing stdout should expect garbled or interspersed messages.

it sounds getting compile, if not, looks on windows have manually add together include , lib: http://blogs.msdn.com/b/risman/archive/2009/01/04/ms-mpi-with-visual-studio-2008.aspx

from same link, looks command on windows command line is:

mpiexec –n 10 mympiproject.exe

to run within code::blocks need tell code::blocks run command above. blog post linked below, looks code::blocks uses 'cb_console_runner.exe' run compiled programs. blog post has modified version of programme take -mpi flag telling mpiexec is.

http://www.blog.kubiak.co.uk/post/44

setting -mpi flag:

"argument must define in codeblocks menu in project -> set programs’ arguments?

-mpi <path mpiexec> -n <number of processes>

example:

-mpi c:/progra~1/mpich2/bin/mpiexec -n 8

"

c++ gcc mpi codeblocks

cmake - Difference between COMPILE_FLAGS and COMPILE_OPTIONS -



cmake - Difference between COMPILE_FLAGS and COMPILE_OPTIONS -

what difference between

compile_flags: additional flags utilize when compiling target's sources.

and

compile_options: list of options pass compiler.

in terms of resulting vs2010 solution these commands produce same result:

target_compile_options(target private "/option=test1") set_target_properties(target properties compile_flags "/option=test1") set_target_properties(target properties compile_options "/option=test1")

compile_options list, compile_flags string.

set_target_properties(target properties compile_options "/option=test1;/option2=test2") set_target_properties(target properties compile_flags "/option=test1 /option2=test2")

you can more-easily append list string.

also, compile_options escaped, whereas characters in compile_flags may need escaped manually or cause problems.

cmake

html - How to horizontally align all input button with all other items -



html - How to horizontally align all input button with all other items -

i wanting create form fields, , input buttons horizontally aligned. tried setting margin: 0 auto on items (after resetting css) seems length of text fields create items not horizontally center (the input button takes much less space). there easy way offset difference in widths without using absolute positioning (i want responsive).

here html:

<h1> please upload file </h1> <form action="/upload" enctype="multipart/form-data" method="post"> <input type="file" name="upload" multiple="multiple" ><br> <input type="submit" value="upload"> </form>

and css:

h1, form { display: block; text-align: center; color: red; margin-top: 1.2em; } h1 { font-size: 2em; margin-top: 2em; margin-bottom: 1em; } p { margin-top: .2em; margin-bottom: 1em; } input { display: block; margin:0 auto; } input[type=submit] { font-size: 2em; }

and here issue mentioning. (i choose files button centered)

just add together border input fields create clear it's centre aligned:

jsfiddle input { display: block; margin:0 auto; border: 1px solid #cfcfcf; }

html css forms

PHP sprintf Space Padding -



PHP sprintf Space Padding -

i have next line in code displays output in 6 characters leading zeros.

$formatted_value = sprintf("%06d", $phpparthrsmls);

i want replace leading zeros spaces. have tried examples found searching site , others , cannot figure out.

here have tried.

$formatted_value = sprintf("%6s", $phpparthrsmls); $formatted_value = printf("[%6s]\n", $phpparthrsmls); // right-justification spaces

thanks help!!

in browser, spaces collapsed.

try:

<pre><?php echo $formatted_value; ?></pre>

and 1 time you're satisfied that, take @ css white-space:pre-wrap - useful property!

php padding space

C# Getting unnamed list from json web api using JSON.NET -



C# Getting unnamed list from json web api using JSON.NET -

i'm using json.net info several web apis, explained me in previous q&a. i've stumbled upon kind of web api can't parse because don't know how to. one: https://data.bter.com/api/1/tickers

as can see, it's json collection of trading pairs. collection unnamed, i'd have create class each trading pair, isn't dynamic. i'm using next parse url:

public static t downloadserializedapi<t>(string address) t : new() { t newt = new t(); httpclient client = new httpclient(); using (stream s = client.getstreamasync(address).result) using (streamreader sr = new streamreader(s)) using (jsonreader reader = new jsontextreader(sr)) { jsonserializer serializer = new jsonserializer(); newt = serializer.deserialize<t>(reader); } homecoming newt; }

now i'd set t class "tradingpairs" in there list tradingpairs. way see now, long list of hardcoded pairs :(

anyone care help me? ;)

this json little tricky because of changing property names, should still able utilize generic method data.

i think approach take create class represent trading pair , utilize [jsonextensiondata] feature work around fact vol_xxx property names alter each pair. deserialize dictionary<string, tradingpair>.

here's how define class:

public class tradingpair { public string result { get; set; } public decimal lastly { get; set; } public decimal high { get; set; } public decimal low { get; set; } public decimal avg { get; set; } public decimal sell { get; set; } public decimal purchase { get; set; } [jsonextensiondata] private dictionary<string, object> vols { get; set; } }

then deserialize info this:

var tradingpairs = downloadserializedapi<dictionary<string, tradingpair>>(url);

c# json json.net web-api

getusermedia - Using Microphone with javascript -



getusermedia - Using Microphone with javascript -

i'm creating web-app needs sound recording user's computer, how accomplish using javascript? i've heard getusermedia utilities that's not stable , i'm looking improve alternative. can suggest me anything?

scriptcam offers flash alternative instead of using getusermedia. stable now.https://www.scriptcam.com/

getusermedia quite stable , simple. check out jsfiddle made much earlier:http://jsfiddle.net/xhzt6/(warning:might work on chrome.) hopefully, might alter mind.

cheers!

javascript getusermedia

xml - XElement changes slightly when stored in SQL Server -



xml - XElement changes slightly when stored in SQL Server -

i store xml value sql server table column of type [xml]. when store value containing empty string retrieve in different notation:

<storeme xmlns=""> <imempty /> </storeme>

will retrieve

<storeme xmlns=""> <imempty></imempty> </storeme>

this causing me problem, since programme storing xml should compare old value , xnode.deepequal returns false if compare these 2 versions of data.

i need way compare these 2 without dismanteling them original field. xnode.deepequal thinks different, there improve way can work out these same?

xml

sql server - MaxRecursion exceeded in TSQL sp -



sql server - MaxRecursion exceeded in TSQL sp -

i have code works extent, 1 time there many records in table throws "recursive error message (over 100)"

my code counts number of unique words in column. have added "option (maxrecursion 0) text has made no difference. can help please?

i using sql server 2005(!)

my sp is:

declare @table table(name varchar(50)) insert @table values('bla bla bla ltd') insert @table values('bla plc ltd') insert @table values('more text ') declare @matchlist table(name varchar(50), replacement varchar(50)) insert @matchlist values('very good', 'good') insert @matchlist values('good.', 'good') insert @matchlist values('nice.', 'nice') insert @matchlist values('-nice', 'nice') insert @matchlist values('service.', 'service') insert @matchlist values('great.', 'great') insert @matchlist values('with.', 'with') insert @matchlist values('well.', 'well') insert @matchlist values('problems.', 'problems') --query select coalesce(m.replacement, a.substr) answer, count(*) count #a [test_question] p cross apply ( select substr dbo.f_split(p.answer, ' ') ) left bring together @matchlist m on a.substr = m.name len(coalesce(m.replacement, a.substr)) >3 , coalesce(m.replacement, a.substr) not in ('they','with','have','been','were','house','from','isos','went','when','find','just','that','than','them','their','there') grouping coalesce(m.replacement, a.substr) order 2 desc select * ,row_number()over (order count desc) ranking #a alternative (maxrecursion 0) drop table #a

you have placed option (maxrecursion 0) on query not recursive. that's why has no effect.

probably, function phone call internally recursive. must place option (maxrecursion 0) there.

sql-server tsql recursion

java - Change of state of a button when editing a JTextPane -



java - Change of state of a button when editing a JTextPane -

i know how apply listener jtextpane, because disable button when jtextpane empty , activate button when there somethings in it. i've tried itemchangelistener doesn't work.

do have ideas please ?

check documentlistener, link there's tutorial help solve task.

java swing listener jtextpane

android - Calling OnResume upon Getting Activity -



android - Calling OnResume upon Getting Activity -

i'm trying have notification builder phone call onresume() upon intent beingness fired, similar when user chooses app background running apps. i've tried numerous flags, not getting result desire.

notificationcompat.builder mbuilder = new notificationcompat.builder(this); intent intent = new intent(this, mainactivity.class); intent.setaction("open_tab_contacts"); intent.setflags(intent.flag_activity_clear_top | intent.flag_activity_single_top); pendingintent pintent = pendingintent.getactivity(this, 0, intent, 0); mbuilder.setsmallicon(r.drawable.antartica7); mbuilder.setcontenttitle("notification alert, click me!"); mbuilder.setcontenttext("hi, android notification detail,wewww!"); mbuilder.setcontentintent(pintent); mbuilder.setautocancel(true); notificationmanager mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); // notificationid allows update notification later on. mnotificationmanager.notify("newmessage", 1, mbuilder.build());

i have tried adding

android:launchmode="singleinstance"

and

android:launchmode="singletask"

to androidmanifest well.

since no flags working, instead check intent action manually.

added oncreate():

if(getintent().getaction() != null) { if(getintent().getaction().equals("open_tab_contacts")) { system.out.println("pending intent called"); } else { //normal oncreate } }

android

c++ - Debugging Going Too Far Into My Code -



c++ - Debugging Going Too Far Into My Code -

i using visual studio 2013. i've never used debugger c++ code before, used utilize time programming msp430. anyways, i'm trying programming , trying utilize debugger step through code , follow logic of if/else statements. when seek utilize debugger this, 1 time begins going of prewritten c++ code terms such if, #include, ect. trying debugger ignore of standard c++ behind scenes details, , step through code. messed microsoft "my code only" feature, can't seem desire. worst case, guess have set breakpoint after after line want go through, curious if there easier method. thanks!

update:

here illustration code using test suggestions.

#include <iostream> #include <string> using namespace std; int main(){ cout << "line one\n"; cout << "line one\n"; cout << "line one\n"; cout << "line one\n"; cout << "line one\n"; cout << "line one\n"; cout << "line one\n"; cout << "line one\n\n"; string input; cin >> input; cout << "line one"; cout << "line one"; cout << "line one"; homecoming 0; }

it's nil pretty, i'm trying step first cout statement, see displayed in console window, click button, have display next cout statement, repeat, repeatedly.

i'm sure i'm not implementing suggestions correctly. when seek step out method, ends running of cout statements. because i'm trying cout operation, instead of logic tree, such if/whiles/ ect?

here's illogical mess i'm trying utilize method trace path through logic. it's pretty bad code, before scrap , rewrite it, trying figure out how step through , trace mess.

#include <iostream> #include <string> using namespace std; int main(){ string action; bool running = 1; int turn = 1; while (running){ //display map if (turn == 1){ //ask user input cout << "choose planet (ex: a1 or d4) or end turn: "; cin >> action; if (action == "end"){ if (turn == 1){ turn = 2; } else { turn = 1; } } } else{ cout << "it not turn"; turn = 2; } //change players turn } homecoming 0; }

i'm trying step through nested conditionals, because when run code prints "it not turn" ever. i'm pretty sure know real reason this, debugging snippets not purpose of question. :)

when stepping through code msvc debugger have 2 options (to used after setting breakpoint or having debugger started , programme paused somehow):

step (shortcut f11) step out (shortcut f10)

the first enters in detail function calls, operator overrides, object construction , doesn't leave instruction until has been "stepped through", while latter want: "high level" overview skips in instruction can decomposed , "jumps" next instruction.

the "just code" used managed-feature it seems they've enabled native c++ well. can useful avoid pestering stack trace lots of unnecessary entries, step-in , step-out mechanism still holds.

edit: above works iff app compiled in debug mode. release mode optimized version for.. well.. releasing programs end-users. means won't have debugging info , setting breakpoints won't work expected.

for code above:

make sure you're compiling in debug mode (you can alter going project properties)

put breakpoint on first statement of main() function

launch debugger

when execution stops on line set breakpoint into, press f10 step next instruction

notice execution passed programme when step on console input operation allow digit on terminal screen. resume in debugger come in newline character.

c++ debugging

vb.net - HtmlAgilityPack not finding nodes from HttpWebRequest's returned HTML -



vb.net - HtmlAgilityPack not finding nodes from HttpWebRequest's returned HTML -

i little new htmlagilitypack. want utilize httpwebrequest can homecoming html of webpage , parse html htmlagilitypack. want find div's specific class , inner text of within div's. have far. request returns webpage html:

public function mygetreq(byval myurl string, byref thecookie cookiecontainer) dim getreq httpwebrequest = directcast(httpwebrequest.create(myurl), httpwebrequest) getreq.method = "get" getreq.keepalive = true getreq.cookiecontainer = thecookie getreq.useragent = "mozilla/5.0 (windows nt 6.3; wow64; rv:29.0) gecko/20100101 firefox/29.0" dim getresponse httpwebresponse getresponse = directcast(getreq.getresponse, httpwebresponse) dim getreqreader new streamreader(getresponse.getresponsestream()) dim thepage = getreqreader.readtoend 'clean streams , response. getreqreader.close() getresponse.close() homecoming thepage end function

this function returns html. set html this:

'the html shows in richtextbox richtextbox1.text = mygetreq("http://someurl.com", thecookie) dim htmldoc = new htmlagilitypack.htmldocument() htmldoc.loadhtml(richtextbox1.text) dim htmlnodes htmlnodecollection htmlnodes = htmldoc.documentnode.selectnodes("//div[@class='someclass']") if htmlnodes isnot nil each node in htmlnodes messagebox.show(node.innertext()) next end if

the problem is, htmlnodes coming null. final if then loop won't run. finds nothing, know fact div , class exists in html page because can see html in richtextbox1:

<div class="someclass"> inner text </div>

what problem here? htmldoc.loadhtml not type of string mygetreq returns page html?

does have html entities? thepage contains < , > brackets. not entitied.

i saw post here (c#) utilize htmlweb class, not sure how set up. of code written httpwebrequest.

thanks reading , helping.

if willing switch, utilize csquery, along these lines:

dim q new cq(mygetreq("http://someurl.com", thecookie)) each node in q("div.someclass") console.writeline(node.innertext) next

you may want add together error handling, overall should start you.

you can add together csquery project via nuget:

install-package csquery

and don't forget utilize imports csquery @ top of code file.

this may not straight solve problem, should create easier experiment info (via immediate window, example).

interesting read (performance comparison):

csquery performance vs. html agility pack , fizzler

vb.net httpwebrequest html-agility-pack

java - How do I add a class to an arraylist in processing? -



java - How do I add a class to an arraylist in processing? -

whenever seek add together country arraylist<country> maintain on getting error: unexpected token: ( , highlights countries.add line. i'm not sure why happening.

class country { private int mland, mwaters; //mtotalborders; private string mcenter; country(int earth, int aqua, string yn) { mland = earth; mwaters = aqua; mcenter = yn; } public int getland() { homecoming mland; } public int getwaters() { homecoming mwaters; } public int gettotalborders() { homecoming mland+mwaters; } public string getcenter() { homecoming mcenter; } } country turkey = new country(16, 7, "no"); country french republic = new country(22, 4, "no"); country england = new country(17, 9, "no"); country federal republic of germany = new country(26, 4, "yes"); country republic of austria = new country(28, 1, "yes"); country italy = new country(17, 8, "yes"); country russian federation = new country(23, 3, "no"); arraylist<country> countries = new arraylist<country>(); countries.add(turkey);

you need set code method - want utilize main method - see below.

...... public string getcenter() { homecoming mcenter; } public static void main(string[] args){ country turkey = new country(16, 7, "no"); country french republic = new country(22, 4, "no"); country england = new country(17, 9, "no"); country federal republic of germany = new country(26, 4, "yes"); country republic of austria = new country(28, 1, "yes"); country italy = new country(17, 8, "yes"); country russian federation = new country(23, 3, "no"); arraylist<country> countries = new arraylist<country>(); countries.add(turkey); } }

note: proper convention capitalize class names, , have variable names lowercase.

this require alter class name in code - see below.

class country { private int mland, mwaters; //mtotalborders; private string mcenter; country(int earth, int aqua, string yn) { ......

also anytime reference class name. example.

country turkey = new country(16, 7, "no");

java arraylist processing

opengl - Skybox reflection basing on textures -



opengl - Skybox reflection basing on textures -

i have textures containing normals:

eye position: vertex shader:

vec4 poseye = modelviewmatrix * vec4(in_position.xyz, 1.0f); fs_poseye = poseye.xyz;

fragment shader:

// calculate normal texture coordinates vec3 coords; coords.xy = gl_pointcoord * 2.0 - 1.0; float r = dot(coords.xy, coords.xy); if(r>1.0){ discard; } coords.z = sqrt(1.0-r); //calculate eye position vec4 pixelpos = vec4(fs_poseye + normalize(coords)*pointradius,1.0f);

edit (with abs() of color vector):

and depth:

i have cube texture also, utilize render skybox (you can see part of on pictures above).

i need utilize them create reflection effect.

textures rendered using framebuffers before , utilize them in fragment shader way:

vec3 n = texture(u_normaltex,fs_texcoord).xyz; float not_blurred_depth = texture(u_depthtex,fs_texcoord).r; vec3 position = texture(u_positiontex,fs_texcoord).xyz;

i tried (basing on tutorials):

vec4 vcoords = vec4(reflect(position, n), 0.0); vec4 refl_color = texture(u_cubemaptex, vcoords.xyz);

but cant accomplish proper effect of reflection.

i can see this:

it's incorrect, cause when @ ball above, should see reflected sky. can see same fragment of skybox anywhere @ ball from.

can help me create proper math eqation? matrix should utilize (if any) , how should calculate proper cube texture coords?

opengl reflection textures skybox

java - Android Grid Image Adapter skipping frames -



java - Android Grid Image Adapter skipping frames -

hey guys m developing simple app displays images in gridview , goes total screen when clicked problem is skipping frames . here code .. check out.

mainactivity

public class mainactivity extends activity { gridview gridview; private string[] web = { "string1", "string2", "string3", "string4", "string5", "string6" }; private int[] imageid = { r.drawable.image1, r.drawable.image2, r.drawable.image3, r.drawable.image4, r.drawable.5, r.drawable.image6 }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.activity_main); gridview = (gridview) findviewbyid(r.id.gridview1); gridview.setadapter(new galleryimageadapter(this, web, imageid)); gridview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view v, int position, long id) { intent intentfull = new intent(getapplicationcontext(), fullscreenimage.class); intentfull.putextra("id", position); startactivity(intentfull); } }); } }

galleryimageadapter.class

public class galleryimageadapter extends baseadapter { private context mcontext; public string[] web = { "string1", "string2", "string3", "string4", "string5", "string6" }; public int[] imageid = { r.drawable.image1, r.drawable.image2, r.drawable.image3, r.drawable.image4, r.drawable.5, r.drawable.image6 }; public galleryimageadapter(context context, string[] web, int[] imageid) { mcontext = context; } @override public int getcount() { homecoming web.length; } @override public object getitem(int position) { homecoming imageid[position]; } @override public long getitemid(int position) { homecoming 0; } @override public view getview(int position, view convertview, viewgroup parent) { view grid; imageview imageview = null; layoutinflater inflater = (layoutinflater) mcontext .getsystemservice(context.layout_inflater_service); if (convertview == null) { grid = new view(mcontext); grid = inflater.inflate(r.layout.grid_single_item, null); textview textview = (textview) grid.findviewbyid(r.id.textdua); imageview = (imageview) grid.findviewbyid(r.id.imagedua); textview.settext(web[position]); imageview.setimageresource(imageid[position]); } else { grid = (view) convertview; } homecoming grid; } }

the main layout images showing in grid skip frames , when click on singleitem i.e single image (of course) works fine...

thanks !

i think getview method wrong seek right hope work fine you

@override public view getview(int position, view convertview, viewgroup parent) { view grid; imageview imageview = null; layoutinflater inflater = (layoutinflater) mcontext .getsystemservice(context.layout_inflater_service); if (convertview == null) { grid = new view(mcontext); grid = inflater.inflate(r.layout.grid_single_item, null); textview = (textview) grid.findviewbyid(r.id.textdua); imageview = (imageview) grid.findviewbyid(r.id.imagedua); } else { grid = (view) convertview; } textview.settext(web[position]); imageview.setimageresource(imageid[position]); homecoming grid; }

i think have initialize texview , imageview in adapter class , alter getview method above because converview null first time phone call first time only. hope got solution.

java android baseadapter frames skip

How to add constraints in fmincon in MATLAB -



How to add constraints in fmincon in MATLAB -

i trying utilize fmincon , have problem constraints. constraints alter in case of input , in 1 case have 9 , in case have 18 constraints. way define constraint below:

if input(1+(i-1)*3600*tpred/nu/60,3) == 0 %tamb ineq1(i,1)=(-y1(i,1)+16); ineq1(i,2)=(-y2(i,1)+16); ineq1(i,3)=(-y3(i,1)+16); %tamb+1 ineq1(i,4)=(-y12(i,1)+16); ineq1(i,5)=(-y22(i,1)+16); ineq1(i,6)=(-y32(i,1)+16); %tamb-1 ineq1(i,7)=(-y13(i,1)+16); ineq1(i,8)=(-y23(i,1)+16); ineq1(i,9)=(-y33(i,1)+16); else %tamb ineq1(i,1)=(y1(i,1)-25); ineq1(i,2)=(-y1(i,1)+21); eq1(i,1)=(y1(i,1)-23)^2; ineq1(i,3)=(y2(i,1)-25); ineq1(i,4)=(-y2(i,1)+21); eq1(i,2)=(y2(i,1)-23)^2; ineq1(i,5)=(y3(i,1)-25); ineq1(i,6)=(-y3(i,1)+21); eq1(i,3)=(y3(i,1)-23)^2; %tamb+1 ineq1(i,7)=(y12(i,1)-25); ineq1(i,8)=(-y12(i,1)+21); eq1(i,4)=(y12(i,1)-23)^2; ineq1(i,9)=(y22(i,1)-25); ineq1(i,10)=(-y22(i,1)+21); eq1(i,5)=(y22(i,1)-23)^2; ineq1(i,11)=(y32(i,1)-25); ineq1(i,12)=(-y32(i,1)+21); eq1(i,6)=(y32(i,1)-23)^2; %tamb-1 ineq1(i,13)=(y13(i,1)-25); ineq1(i,14)=(-y13(i,1)+21); eq1(i,7)=(y13(i,1)-23)^2; ineq1(i,15)=(y23(i,1)-25); ineq1(i,16)=(-y23(i,1)+21); eq1(i,8)=(y23(i,1)-23)^2; ineq1(i,17)=(y33(i,1)-25); ineq1(i,18)=(-y33(i,1)+21); eq1(i,9)=(y33(i,1)-23)^2; end

i run step step , goes in if-condition , calculate constraints in both cases. don't know why fmincon can't satisfy constraints. know model can satisfy them if inputs alter fmincon without error on waning can't satisfy them. check inequality constraints positive must me negative.

am define constraints wrong?

with best regards,

during minimization process fmincon assumes size of constraints vector doesn't change. because in order minimization has compute gradient of cost function, gradient of constraints, , can't see of elements disappear 1 function phone call another.

maybe possibility redefine problem constraints vector set maximum size (in case 18), , set -1 latest components when half needed. however, notice solution loose of regularity of problem.

matlab constraints mathematical-optimization

c# - Windows.Web.Http.HttpClient#GetAsync throws an incomplete exception when invalid credentials are used with basic authentication -



c# - Windows.Web.Http.HttpClient#GetAsync throws an incomplete exception when invalid credentials are used with basic authentication -

i working on windows runtime component makes api calls. until before today used httpclient , related models system.net switched on windows.web instead leverage winrt streams.

aside changing using statements, swapping httpcontent ihttpcontent , using windowsruntimeextensions alter iinputstream stream json.net, didn't have special. 3 out of 16 tests fail whereas worked.

all 3 (integration) tests validate receive error response when logging in invalid credentials. there other tests include logging in (but valid credentials) , work fine. given error message of type aggregateexception , has message

system.aggregateexception: 1 or more errors occurred. ---> system.exception: element not found.

a dialog cannot displayed because parent window handle has not been set.

the exception contains hresult values. outerexception has value -2146233088 corresponds 0x80131500 while innerexception has -2147023728 corresponds 0x80070490. neither of known error code on the msdn page.

following investigation:

0x80131500 corresponds to cor_e_exception 0x80070490 corresponds to error_not_found

stacktrace:

result stacktrace: @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.taskawaiter`1.getresult() @ xx.models.requests.getrequest.<executerequestasync>d__0.movenext() in c:\users\jeroen\github\windows-app\xx\xx\models\requests\request.cs:line 17 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.taskawaiter`1.getresult() @ xx.apidispatcher.<executeasync>d__0`2.movenext() in c:\users\jeroen\github\windows-app\xx\xx\apidispatcher.cs:line 40 --- end of inner exception stack trace --- @ system.threading.tasks.task.throwifexceptional(boolean includetaskcanceledexceptions) @ system.threading.tasks.task`1.getresultcore(boolean waitcompletionnotification) @ system.threading.tasks.task`1.get_result() @ xx.apidispatcher.execute[tcallresult,tresponseobject](apicall`2 call) in c:\users\jeroen\github\windows-app\xx\xx\apidispatcher.cs:line 22

originally question worded differently because actual problem seemed hidden. have found out request httpclient returns caller instead of awaiting result of phone call (and executing rest of method).

in project, executing line var info = await myhttpclient.getasync(url); homecoming calling method non-constructed object , subsequent lines come after getasync() phone call not executed.

adding .configureawait(false) stop going did not create difference.

the aggregateexception thrown when user tries login invalid credentials. reason httpclient decides throw exception without giving me homecoming value use. problem here not tell me kind of exception: catching comexception, taskcanceledexception, aggregateexception , exception trigger latter.

i have found out asynchronous integration tests not work multithreaded mstest environment, explains several other failed tests had (but worked fine individually)

i also, finally, have illustration demonstrates problem (but can't provide webservice takes basic auth)!

[testmethod] public void testmethod3() { assert.istrue(new test().do().astask().result); } public sealed class test { public iasyncoperation<bool> do() { homecoming dosomething().asasyncoperation(); } private async task<bool> dosomething() { var client = new httpclient(); var info = "jeroen.vannevel@something.com:nopass"; var token = convert.tobase64string(encoding.utf8.getbytes(info)); client.defaultrequestheaders.authorization = new httpcredentialsheadervalue("basic", token); var info = await client.getasync(new uri("https://mytestdomain/v2/apikey?format=json")); homecoming true; } }

executing code valid password homecoming true while invalid password throw aggregateexception.

right working around problem catching general exception around phone call getasync() rudimentary , i'd know why incomplete exception thrown in first place.

after reconstructing illustration , playing around, figured out happens.

var info = await client.getasync(new uri("https://mytestdomain/v2/apikey?format=json"));

the getasync method invokes http request invalid credentials. happens returned request tries window can come in right credentials, doesn't find one. hence throws element not found while searching window.

this can fixed creating httpbaseprotocolfilter , setting allowui property false , passing httpclient:

private async task<bool> dosomething() { var httpbasefilter = new httpbaseprotocolfilter { allowui = false }; var client = new httpclient(httpbasefilter); var info = "jeroen.vannevel@something.com:nopass"; var token = convert.tobase64string(encoding.utf8.getbytes(info)); client.defaultrequestheaders.authorization = new httpcredentialsheadervalue("basic", token); var info = await client.getasync(new uri("https://mytestdomain/v2/apikey?format=json")); homecoming true; }

c# .net windows-runtime async-await dotnet-httpclient

c++ - Crop image by detecting a specific large object or blob in image? -



c++ - Crop image by detecting a specific large object or blob in image? -

please help me resolve issue. working on image processing based project , stuck @ point. got image after processing , farther processing need crop or observe deer , remove other portion of image.

this initial image:

and result should this:

it more improve if single biggest blob in image , save image.

it looks deer in image pretty much connected , closed. can utilize regionprops find of bounding boxes in image. 1 time this, can find bounding box gives largest area, presumably deer. 1 time find bounding box, can crop image , focus on deer entirely. such, assuming image stored in im, this:

im = im2bw(im); %// in case... bound = regionprops(im, 'boundingbox', 'area'); %// obtaining bounding box co-ordinates bboxes = reshape([bound.boundingbox], 4, []).'; %// obtain areas within each bounding box areas = [bound.area].'; %// figure out bounding box has maximum area [~,maxind] = max(areas); %// obtain bounding box %// ensure floating point removed finalbb = floor(bboxes(maxind,:)); %// crop image out = im(finalbb(2):finalbb(2)+finalbb(4), finalbb(1):finalbb(1)+finalbb(3)); %// show images figure; subplot(1,2,1); imshow(im); subplot(1,2,2); imshow(out);

let's go through code slowly. first convert image binary in case. image may rgb image intensities of 0 or 255... can't sure, let's binary conversion in case. phone call regionprops boundingbox property find every bounding box of every unique object in image. bounding box minimum spanning bounding box ensure object contained within it. each bounding box 4 element array structured so:

[x y w h]

each bounding box delineated origin @ top left corner of box, denoted x , y, x horizontal co-ordinate while y vertical co-ordinate. x increases positively left right, while y increases positively top bottom. w,h width , height of bounding box. because these points in structure, extract them , place them single 1d vector, reshape becomes m x 4 matrix. bear in mind way know of can extract values in arrays each structuring element efficiently without for loops. facilitate our searching quicker. have done same area property. each bounding box have in our image, have attribute of total area encapsulated within bounding box.

thanks @shai spot, can't utilize bounding box co-ordinates determine whether or not has biggest area within have lean diagonal line drive bounding box co-ordinates higher. such, need rely on total area object takes within bounding box well. put, it's sum of of pixels contained within object.

therefore, search entire area vector have created see has maximum area. corresponds deer. 1 time find location, extract bounding box locations, utilize crop image. bear in mind bounding box values may have floating point numbers. image co-ordinates in integer based, need remove these floating point values before decide crop. decided utilize floor. write code displays original image, cropped result.

bear in mind only work if there 1 object in image. if want find multiple objects, check bwboundaries in matlab. otherwise, believe should started.

just completeness, next result:

c++ matlab opencv image-processing

How to size images to render the same proportion in Android -



How to size images to render the same proportion in Android -

i have design concept need create. designed in given resolution: 480x800. contains box width of 390px has horizontally aligned in middle. there 45 pixels left in both sides.

when create layout in android, have give box width in dp. utilize dp->px calculator , check numbers shows. tells me, have set width 252dp create box 390px wide in hdpi, 480x800 phone. when set it, , starts emulator, shows proportions right.

<edittext android:id="@+id/txtbox" android:layout_width="262dp" android:layout_height="37dp" />

i alter emulator 720x1280, hdpi. width box have? 252 dp (390px)? if so, box take half of screen , proportion off.

how should set image width , size create right proportions? create dynamic?

images in android hard deal with. due resolution factor images in 1 device seems different in proportions other devices. solution utilize appropriate images appropriate screen density. see iconography on developer site. providing alternate resources in folder's drawable-hdpi ensure rendered properly. programming practice utilize wrap_content or match_parent our layout_width or height.

android android-image

objective c - iOS delegation doesn't work -



objective c - iOS delegation doesn't work -

i'm trying implement delegate method between 2 classes in app delegated method not called.

here code :

pbpartnersservice.h

@protocol pbpartnersservicesdelegate <nsobject> @required -(void) didreceivenewsdatasfrompartners:(nsdictionary *)datas; @end

then create @property :

@interface pbpartnersservices : nsobject @property (nonatomic, weak) id<pbpartnersservicesdelegate> delegate; @end

in pbpartnersservice.m phone call delegate method (when print self.delegate 'nil') :

if ([self.delegate respondstoselector:@selector(didreceivenewsdatasfrompartners:)]) { [self.delegate didreceivenewsdatasfrompartners:obj]; }

in other class pbticketsservice.h instantiate first 1 :

@interface pbticketsservice : nsobject <pbpartnersservicesdelegate> @property (nonatomic,strong) nsdictionary *ticketlist; @property (nonatomic, strong) pbpartnersservices *partnersservices; - (void) preparefordelegate; @end

i made method in pbticketsservice.m set partnersservices delegate :

- (void) preparefordelegate{ self.partnersservices = [[pbpartnersservices alloc] init]; [self.partnersservices setdelegate:self]; }

and have function never phone call :

-(void) didreceivenewsdatasfrompartners:(nsdictionary *)datas{ }

you should utilize dependency injection: either add together ticketsservice argument of partnerservices constructor, or opposite.

ios objective-c delegates

javascript says undefined for json laravel model -



javascript says undefined for json laravel model -

this controller:

$sibling_details = student::whereraw('family_id ?', array($data['familyid'])); homecoming response::json( array( 'success'=>true, 'msg'=>'family found', 'family_details'=>$family_details->first(), 'sibling_details'=>$sibling_details ) );

in javascript of view next working fine:

$("#family_details").html(data.family_details.father_name);

but next saying undefined:

$("#sibling_details").html(data.sibling_details[0].name);

following line shows:

[object object] [object object] [object object] [object object]

as $sibling_details contains 4 rows

how can retrieve info sibling_details object??

try actual fetching query ->get().

$sibling_details = student::whereraw('family_id ?', array($data['familyid']))->get();

json laravel-4

curl - PHP: Save Dynamic URL Image to Disk -



curl - PHP: Save Dynamic URL Image to Disk -

having problem capturing next dynamic image on disk, 1k size file

http://water.weather.gov/precip/save.php?timetype=recent&loctype=nws&units=engl&timeframe=current&product=observed&loc=regioner

i have setup php curl feature work fine on static imagery, not work above link. similarly, re-create function, file_put_contents (file_get_contents)...they work fine static image. plenty of references in usage of these php functions, not details here. re-create command:

copy('http://water.weather.gov/precip/save.php?timetype=recent&loctype=nws&units=engl&timeframe=current&product=observed&loc=regioner', 'precip5.png');

behavior same, getting precip5.png size 760 bytes, on windows development box , linux staging box, can rule os issues out. again, php functions same thing - generate file - empty. command line curl programme generating same junk 1k file.

so, issue seems source , best can tell is dynamic (streaming?) image.

ideally, done in php or command line utility curl. trying avoid adding java (imageio) dependency this...until absolutely have have go there...

i trying understand nature of beast (the image) first ;-)...

the url saving produces html output, not image. missing parameter &print=1

http://water.weather.gov/precip/save.php?timetype=recent&loctype=nws&units=engl&timeframe=current&product=observed&loc=regioner&print=1

php curl

groovy - Crawler4j With Grails App -



groovy - Crawler4j With Grails App -

i making crawler application in groovy on grails. using crawler4j , next this tutorial.

i created new grails project put basiccrawlcontroller.groovy file in controllers->package did not create view because expected on doing run-app, crawled info appear in crawlstoragefolder (please right me if understanding flawed)

after ran application doing run-app didn't see crawling info anywhere.

am right in expecting file created @ crawlstoragefolder location have given c:/crawl/crawler4jstorage? do need create view this? if want invoke crawler controller other view on click of submit button of form, can write <g:form name="submitwebsite" url="[controller:'basiccrawlcontroller ']">?

i asked because not have method in controller, right way invoke controller?

my code follows:

//all necessary imports public class basiccrawlcontroller { static main(args) throws exception { string crawlstoragefolder = "c:/crawl/crawler4jstorage"; int numberofcrawlers = 1; //int maxdepthofcrawling = -1; default crawlconfig config = new crawlconfig(); config.setcrawlstoragefolder(crawlstoragefolder); config.setpolitenessdelay(1000); config.setmaxpagestofetch(100); config.setresumablecrawling(false); pagefetcher pagefetcher = new pagefetcher(config); robotstxtconfig robotstxtconfig = new robotstxtconfig(); robotstxtserver robotstxtserver = new robotstxtserver(robotstxtconfig, pagefetcher); crawlcontroller controller = new crawlcontroller(config, pagefetcher, robotstxtserver); controller.addseed("http://en.wikipedia.org/wiki/web_crawler") controller.start(basiccrawler.class, 1); } } class basiccrawler extends webcrawler { final static pattern filters = pattern .compile(".*(\\.(css|js|bmp|gif|jpe?g"+ "|png|tiff?|mid|mp2|mp3|mp4" + "|wav|avi|mov|mpeg|ram|m4v|pdf" +"|rm|smil|wmv|swf|wma|zip|rar|gz))\$") /** * should implement function specify whether given url * should crawled or not (based on crawling logic). */ @override boolean shouldvisit(weburl url) { string href = url.geturl().tolowercase() !filters.matcher(href).matches() && href.startswith("http://en.wikipedia.org/wiki/web_crawler/") } /** * function called when page fetched , ready processed * program. */ @override void visit(page page) { int docid = page.getweburl().getdocid() string url = page.getweburl().geturl() string domain = page.getweburl().getdomain() string path = page.getweburl().getpath() string subdomain = page.getweburl().getsubdomain() string parenturl = page.getweburl().getparenturl() string anchor = page.getweburl().getanchor() println("docid: ${docid} ") println("url: ${url} ") println("domain: '${domain}'") println("sub-domain: ' ${subdomain}'") println("path: '${path}'") println("parent page:${parenturl} ") println("anchor text: ${anchor} " ) if (page.getparsedata() instanceof htmlparsedata) { htmlparsedata htmlparsedata = (htmlparsedata) page.getparsedata() string text = htmlparsedata.gettext() string html = htmlparsedata.gethtml() list<weburl> links = htmlparsedata.getoutgoingurls() println("text length: " + text.length()) println("html length: " + html.length()) println("number of outgoing links: " + links.size()) } header[] responseheaders = page.getfetchresponseheaders() if (responseheaders != null) { println("response headers:") (header header : responseheaders) { println("\t ${header.getname()} : ${header.getvalue()}") } } println("=============") } }

i'll seek translate code grails standard.

use under grails-app/controller

class basiccrawlcontroller { def index() { string crawlstoragefolder = "c:/crawl/crawler4jstorage"; int numberofcrawlers = 1; //int maxdepthofcrawling = -1; default crawlconfig crawlconfig = new crawlconfig(); crawlconfig.setcrawlstoragefolder(crawlstoragefolder); crawlconfig.setpolitenessdelay(1000); crawlconfig.setmaxpagestofetch(100); crawlconfig.setresumablecrawling(false); pagefetcher pagefetcher = new pagefetcher(crawlconfig); robotstxtconfig robotstxtconfig = new robotstxtconfig(); robotstxtserver robotstxtserver = new robotstxtserver(robotstxtconfig, pagefetcher); crawlcontroller controller = new crawlcontroller(crawlconfig, pagefetcher, robotstxtserver); controller.addseed("http://en.wikipedia.org/wiki/web_crawler") controller.start(basiccrawler.class, 1); render "done crawling" } }

use under src/groovy

class basiccrawler extends webcrawler { final static pattern filters = pattern .compile(".*(\\.(css|js|bmp|gif|jpe?g"+ "|png|tiff?|mid|mp2|mp3|mp4" + "|wav|avi|mov|mpeg|ram|m4v|pdf" +"|rm|smil|wmv|swf|wma|zip|rar|gz))\$") /** * should implement function specify whether given url * should crawled or not (based on crawling logic). */ @override boolean shouldvisit(weburl url) { string href = url.geturl().tolowercase() !filters.matcher(href).matches() && href.startswith("http://en.wikipedia.org/wiki/web_crawler/") } /** * function called when page fetched , ready processed * program. */ @override void visit(page page) { int docid = page.getweburl().getdocid() string url = page.getweburl().geturl() string domain = page.getweburl().getdomain() string path = page.getweburl().getpath() string subdomain = page.getweburl().getsubdomain() string parenturl = page.getweburl().getparenturl() string anchor = page.getweburl().getanchor() println("docid: ${docid} ") println("url: ${url} ") println("domain: '${domain}'") println("sub-domain: ' ${subdomain}'") println("path: '${path}'") println("parent page:${parenturl} ") println("anchor text: ${anchor} " ) if (page.getparsedata() instanceof htmlparsedata) { htmlparsedata htmlparsedata = (htmlparsedata) page.getparsedata() string text = htmlparsedata.gettext() string html = htmlparsedata.gethtml() list<weburl> links = htmlparsedata.getoutgoingurls() println("text length: " + text.length()) println("html length: " + html.length()) println("number of outgoing links: " + links.size()) } header[] responseheaders = page.getfetchresponseheaders() if (responseheaders != null) { println("response headers:") (header header : responseheaders) { println("\t ${header.getname()} : ${header.getvalue()}") } } println("=============") } }

grails groovy crawler4j

JavaScript the Good Parts: unshift function -



JavaScript the Good Parts: unshift function -

i'm reading javascript:the parts crockford , i'm having problem understanding reimplementation of unshift method in book.here the code:

array.method('unshift', function ( ) { this.splice.apply(this, [0, 0].concat(array.prototype.slice.apply(arguments))); homecoming this.length; });

it useful if go through happening step step. 1 of things don't understand why concatenates [0 , 0] result of array.prototype.slice.

why concatenates [0 , 0] result of array.prototype.slice

the first 2 arguments of splice (which resulting array applied to) are:

index 0 because adding front end of array howmany (to remove) 0 because adding new elements

the remaining arguments values added front end of array, taken array.prototype.slice.apply(arguments) (to convert info arguments object info in array).

javascript

postgresql - integer out of range -



postgresql - integer out of range -

not slightest thought why hell happening..

i've set table accordingly:

create table raw ( id serial, regtime float not null, time float not null, source varchar(15), sourceport integer, destination varchar(15), destport integer, blocked boolean ); ... + index , grants

i've used table while now, , of sudden next insert doesn't work longer..

insert raw( time, regtime, blocked, destport, sourceport, source, destination ) values ( 1403184512.2283964, 1403184662.118, false, 2, 3, '192.168.0.1', '192.168.0.2' );

the error is: error: integer out of rage

i mean comon... not sure begin debugging this.. i'm not out of disk-space , error kinda discreet..

serial columns stored integers, giving them maximum value of 231-1. after ~2 billion inserts, new id values no longer fit.

if expect many inserts on life of table, create bigserial (internally bigint, maximum of 263-1).

if find later on serial isn't big enough, can increment size of existing field with:

alter table raw alter column id type bigint;

note it's bigint here, rather bigserial (as serials aren't real types). , maintain in mind that, if have 2 billion records in table, might take little while...

postgresql integer runtime-error

jquery - appending query string in form action -



jquery - appending query string in form action -

my question might seems odd, caught in situation..

can utilize form action in way??

<form action="http://www.example.com/cread.php?inmid=5445&affid=545&p=http://www.book.example2.com/search.do" method="get" id="form1">

what trying is

user fill form

data along inmid, affid , p passed example.com/cread.php

example.com/cread.php process

example.com forwards form info p=example2.com/search.do

example2.com/search.do rest...

i tried using inmid, affid , p hidden inputs,but due url encoding issue, example.com/search.do can not process form data..

this form action isn't working me..

can tell me how can accomplish purpose??

thnks help

ps

i dont have command on example.com or example2.com if utilize tracking params hidden, url encoding , decoding ( cant control) create problem...however, if utilize form action partial query string alongwith form data, works

use hidden inputs instead of starting query string yourself.

<input type="hidden" name="hiddeninput" value="value goes here" />

i think reason have isn't working because you've started query string ?and you've added values. however, 1 time form submitted, ? , form info going appended whatever have in action attribute.

so effectively, query string started twice, there 2 ?'s may not able interpreted server correctly.

the query string generated be: eg: formsubmit.php?iaddedthis=true?iwasaddedbythebrowser=true

i'm open correction though.

jquery html forms encoding

How would I do this in WiX? -



How would I do this in WiX? -

i need install programme consists of several files, windows programs do. but:

it needs work without admin. app set in application-local folder (something under %appdata%).

must not show ui or prompts (if no error). existing code extracts app-local directory , runs it. (it's smarter that, shows how simple utilize ad-hoc code in case)

download files. files may not needed, or not changed in update, won't in self-extracting exe, should downloaded url.

the c++ runtime dlls nowadays in system32, previous apps used official redistributable mm. if not, download files app-local directory. different (3) in rather seeing if identical file nowadays in target location, looks see if loadlibrary works. (likewise installed ttf fonts)

i'm overwhelmed looking @ wix docs page, , wonder if ill-fitted utilize wix. so, point specific instructions on how each of these?

thanks.

with windows installer, no. windows installer either shows @ to the lowest degree minimal startup ui or, if invoked appropriate command-line arguments, none @ all, if there error.

you utilize windows installer api install msi command how much ui shown , show own, including on error. but, wix gives platform that.

the wix toolset has bootstrapper/bundler/chainer/downloader/reboot handler/package manager msis , exes. since it's engine called "burn", bootstrappers created called "burn bundles." fire has extension point application concerns such ui, called bootstrapper application. standard bootstrapper application shows ui. can write own in c++ or .net.

that said, should realize 2 things. windows installer component manager. has database of installed components (such files) can shared across products. not suited self-extracting archive. wix bootstrapper similar, beingness bundle manager. has database of installed packages can shared across products. not bootstrapper.

i'm not sure point 4. cleaner install redistributables using vendors' installers, ideally can run silently , can own checking previous installation , create quick exit success. but, if find documentation on how check previous installation file or registry searching, can declare in wix bootstrapper bypass downloading , installing packages.

in wix bootstrapper, packages can marked permanent aren't uninstalled product uninstalled. apply c++ runtimes. way, products don't using wix bootstrapper won't broken uninstall.

btw—wix , visual studio utilize wix bootstrapper.

wix

ios - Multiple visible views responding to one gesture recognizer -



ios - Multiple visible views responding to one gesture recognizer -

i have view controller consists of 3 views (self.panedview, self.view, self.sineview) when swipe gesture detected, highest view (self.panedview) moved halfway - revealing 2 additional views (self.view , self.sineview). self.sineview uiview has animation running renders moving sinewave , takes half of self.view. have swipe downwards gesture recognizer works when swipe downwards on self.panedview, doesn't work when swipe downwards on self.sineview. if swipe around self.sineview on self.view seems work. when hide self.sineview , swipe straight downwards on either self.view or self.paned view, swipe downwards works. think animating sine wave gets in way of gesture recognition.

uiswipegesturerecognizer * swipedownrec = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handledownswipe:)]; [self.panedview addgesturerecognizer:swipedownrec]; [self.view addgesturerecognizer:swipedownrec]; [self.sineview addgesturerecognizer:swipedownrec];

also tried varying between these 2 lines of code there no difference:

[self.view insertsubview:self.sinewave belowsubview:self.panedview]; [self.view insertsubview:self.sinewave abovesubview:self.view];

i tried adding separate swipe downwards gesture recognizer each view, still doesn't work.

the problem swipe recognizer self.sinewave couldn't recognized while self.sinewave animation enabled. solution simple: add together uiviewanimationoptionallowuserinteraction parameter options handler animatewithduration:delay:options:animations:completion:

ios cocoa-touch

javascript - tool tip not working in firefox -



javascript - tool tip not working in firefox -

this tooltip script, working fine in chrome not working in firefox,i don't know why tooltip doens't work in firefox. seek solve problem. have thought why doen't work in firefox?

js:

$('.ltt,.wtt,.mtt').css({ position: 'absolute' }).hide() $('area').each(function(i) { $('area').eq(i).bind('mouseover mousemove', function(e) { $('.ltt,.wtt,.mtt').eq(i).css({ top: e.pagey+10, left: e.pagex+10 }).show() }) $('area').eq(i).bind('mouseout', function() { $('.ltt,.wtt,.mtt').hide() }) })

html:

<img src="images/banners/image.jpg"usemap="#map" /> <map name="map" > <a href="" ><area shape="circle" coords="818, 271, 14" /></a> <a href="" ><area shape="circle" coords="655, 154, 10" /></a> <a href="" ><area shape="circle" coords="159, 70, 15" /></a> </map> <div class="ltt"> <label>australia</label> </div> <div class="wtt"> <label>india</label> </div> <div class="mtt"> <label>usa</label> </div>

javascript jquery html

eclipse plugin - Apex Editor for supporting format for code -



eclipse plugin - Apex Editor for supporting format for code -

there sales forcefulness developer console write apex code ....

there force.ide eclipse plug-in but, not back upwards auto-correct, , code formatting facilities.

so there other editor available developing apex code back upwards format code , suggest attribute context-menu...

i haven't used myself, many people @ dreamforce lastly year talking using sublimetext:

http://www.sublimetext.com/

in combination mavensmate plug-in:

http://mavensmate.com/

to work salesforce code. know has re-indentation , auto-complete. don't know auto-correct.

eclipse-plugin salesforce apex-code

Getting irrelevant errors when orientation changes in iOS 7 -



Getting irrelevant errors when orientation changes in iOS 7 -

in ipad app, have table multiple sections , rows. when alter orientation landscape portrait or portrait landscape, 1 of next errors:

terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[webscriptobjectprivate countbyenumeratingwithstate:objects:count:]: unrecognized selector sent instance 0x124a15a0' terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[domhtmlheadelement rotatingclient]: unrecognized selector sent instance 0x8c60a20' terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfstring countbyenumeratingwithstate:objects:count:]: unrecognized selector sent instance 0x8f7c380'

i'm not explicitly using of classes exceptions thrown.

edit: using instruments, found crash happens. haven't used before i'm not sure it.

# event type ∆ refct refct timestamp responsible library responsible caller 2 zombie -1 00:38.935.631 uikit -[uiwindow _setrotatableclient:toorientation:updatestatusbar:duration:force:isrotating:]

when unrecognized selector messages sent objects of classes don't utilize directly, reply target objects have been released unexpectedly , memory re-used objects appear in error message.

your best bet turn on zombies in scheme , see released objects beingness sent messages. or, can seek track downwards figuring out object should receiving message , has happened it. (obviously, first easier when it's possible.)

ios orientation