Posts

Showing posts from September, 2010

sorting - Split many lists into 2 sections which contain strings and numbers -

i have csv file looks below: hussain 1 0 0 3 i have managed make of them lists created in rows: lists produced follows: ['hussain', '1', '0', '0', '3'] i want able sort them names printed alphabetically along each person's greatest score: note 1st number excluded student's class number out of 1, 2 , 3 , not part of score. people in specific class need printed user decide class sort: if user says class 1 program should print: hussain:3 i appreciate have been struggling on part of code though have been working on long period of time. thank you try this: tuples = [['hussain', '1', '0', '0', '3'], ['bon', '2', '1', '2', '3'], ['alice', '1', '5', '2', '3'], ['josh', '3', '1', '7', '10'], ['jack', '2', '0', &#

azure - Peek Message before Receiving -

i new azure , learning & service bus past couple of weeks. i trying read messages azure service bus queue. queueclient receive method pull message out of queue not want initially. browsing through messages in queue 1 @ time in while loop using peek() method. compare correlationid of message correlation id internally maintain in local db table. only if correlation id matches, go ahead , receive message. but, inorder receive message using messagesequencenumber, learned have defer message first, messageid stored in list or , use queueclient receive() method receive messages , mark message complete. but since browsing messages using peek(), not allow me defer message. stuck here in receiving message using messageid. also cannot complete message before receiving. can please suggest ways accomplish this? brokeredmessage message = new brokeredmessage(); message = null; while ((message = reader.peek()) != null && row_count > 0) { list<long> deferredmess

temperature - Using Landsat 7 to go from NDVI to Emissivity -

i using landsat 7 calculate land surface derived temperature. understand main concepts behind conversion, however, confused on how factor emissivity model. using model builder calculations , have created several modules uses instruments gain, bias offset, landsat k1, , landsat k2 correction variables. converted dn radiance values well. now, need factor in last , confusing (for me) part: emissivity. calculate emissivity using ndvi. have model procedure built calculate ndvi layer (band4- band3)/(band4+ band3). have calculated pv, fraction of vegetation calculated by: [ndvi - ndvi_min]/[ndvi_max-ndvi_min]^2. now, using vegetation cover method, need ev , eg. not understand how find these values calculate total emissivity value per cell. does have idea on how can incorporate emissivity formulation? confused on how derive value... i believe emissivity included part of dataset. alternatively, emissivity databases exist (such aster database here: https://lpdaac.us

php - Laravel Eloquent and Query Builder "with (nolock)" -

i have throuble because queries not have with (nolock) instruction after from clause. because that, queries lock database , nobody can use system. how use with (nolock) eloquent & query builder? for example.. in query: return static::with('campaigntype') ->where('active', 1) ->get(); i want follow result: select * campaigns (nolock) inner join campaign_types (nolock) on campaign_types.id = campaigns.campaign_type_id campaigns.active = 1 here how deal eloquent (tested on laravel 5.1 , 5.2) you need add scope in model: public function scopenolock($query) { return $query->from(db::raw(self::gettable() . ' (nolock)')); } then can call like return model::nolock()->get();

java - JBoss Fuse - Maven Archetype Blueprint - Camel - Routing -

i trying build simple camel route using jboss fuse , maven basically. using command mvn archetype:generate create skeleton project. when prompt says, "choose number or apply filter (format: [groupid:]artifactid, case sensitive contains): 582:" type camel . then select option: 49: remote -> org.apache.camel.archetypes:camel-archetype-blueprint (creates new camel project osgi blueprint support. ready deployed in osgi.) please see below: choose number or apply filter (format: [groupid:]artifactid, case sensitive contains): : type 49 option. for option choose org.apache.camel.archetypes:camel-archetype-blueprint version: press enter camel 2.15.1. define value property 'groupid': : org.me for option: define value property 'artifactid': : fuse-ghettoblasting-blueprint for option: define value property 'version': 1.0-snapshot: : 1.0 for option: define value property 'package': org.me: : org.me.demo i run comm

wordpress - WooCommerce Category and ACF -

i'm using advanced custom fields (acf) plugin. on woocommerce product category, want have content area seo. acf me doesn't work, nothing shown on front end of site. content-product.php has the field: <li <?php post_class(); ?> style="max-width:<?php echo $column_width; ?>px"> <div class="mk-product-holder"> <?php do_action( 'woocommerce_before_shop_loop_item' ); ?> <div class="mk-love-holder"> <?php if( function_exists('mk_love_this') ) mk_love_this(); ?> </div> <h3><a href="<?php echo get_permalink();?>"><?php the_title(); ?></a> // here extrafield seo-text, field registered in fields name "extratext" <?php echo get_field('extratext'); ?> </h3> </div> </li> woocommerce category screenshot: http://www.directu

excel - Pasting a range of Data into a new column - omitting empty cells, but keeping same row -

i have data in 2 columns (a , b) has been generated through excel formulas within each cell. not cells have visible value, have embedded formula. i.e.: col a row 1 = "677" row 2 = "" <-- (not empty has formula) row 3 = "345" row 4 = "" <-- (not empty has formula) every have manually paste these values 2 other columns in sheet, (col c , d) supposed replace other data exists in cells... i.e. if there value copy paste in, if there no value leave existing data in col c , d intact. when tell paste special , "skip blanks", still counts "" (empty) cells not blank because of hidden formula in them, , overwrites existing data in cells in col c , d empty cell values. i had idea of writing macro select source range, , loop through range a2:b1200 (using "for each cell" in range), copying , pasting cells not empty, preserving old data. i got point cannibalizing other functions. not see how paste no

java - TiledMapTile set texture region gives NullPointerException -

i'm having trouble setting texture region tiledmaptile. gives me nullpointerexception , have no idea why. here code: tiledmaptile cointile; public void show () { maptexture1 = new texture(gdx.files.internal("maps/other/texture1.png")); textureregion maptexture1region = new textureregion(maptexture1, 32, 0, 16, 16); cointile.settextureregion(maptexture1region); } and here error: 04-09 21:57:18.222: e/androidruntime(7792): java.lang.nullpointerexception 04-09 21:57:18.222: e/androidruntime(7792): @ com.never.mind.screens.gamescreen.show(gamescreen.java:225) which leads line: cointile.settextureregion(maptexture1region); usually, nullpointerexception happens when did not initialize in code. since did not provide full code, give suggestions. did maptexture1 = new texture(gdx.files.internal("maps/other/texture1.png")); you should also cointile = new tiledmaptile () { @override public int getid() { return

PHP variable getting overwritten -

well, trying write code checks if twitch stream live or not. have created array $_session['errors']; on second .php $_session['errors'] either given 'live' or 'not live', whenever goes first .php page $_session['errors'] overwritten @ point defined. my question is, how, if possible around issue. code: php in index.php: <?php $_session['errors'] = ''; echo $_session['errors']; ?> php streaminfo.php: <?php if (empty($_post) === false) { header('location: index.php'); } $streamer = $_post['username']; $apiurl = "https://api.twitch.tv/kraken/streams/" . $streamer; $apicontent = file_get_contents($apiurl); $streamerinfo = json_decode($apicontent); if ($streamerinfo->stream == '') { echo '<h2>' . 'streamer not live' . '</h2>'; $_session['errors'

java - Computer Assistance Program -

the question states this: "the use of computers in education referred computer ¬assisted instruction (cai). write program elementary school student learn multiplication. use random object produce 2 positive 1-digit integers. program prompt user question, such “how 6 times 7?” the student inputs answer. next, program checks student’s answer. if correct, display message “very good!” , ask multiple question. if answer wrong, display message “no. please try again.” , let student try same question repeatedly until student gets right. separate method used generate each new question. method called once when application begins execution , each time user answers question correctly." here have far. /* * change license header, choose license headers in project properties. * change template file, choose tools | templates * , open template in editor. */ package programmingassignment5.pkg35; /** * * @author jeremy */ import java.awt.*; import java.awt.event.*; import java

objective c - iOS: FBSDKShareDialog Opening App but Not Allowing User to Share Link -

i'm trying integrate new facebook sdk app i'm working on , reason whenever try , share link share screen doesn't come up. kicked facebook app (or web app if there's no facebook app installed), never option share link i'm trying user post. i've pretty followed example on facebook developer site t, reference, here's code: - (ibaction)sharetofacebook:(id)sender { nslog(@"share facebook"); fbsdksharelinkcontent *content = [fbsdksharelinkcontent new]; content.contenturl = [nsurl urlwithstring:@"http://google.com"]; content.contenttitle = @"test post!"; content.contentdescription = @"content description; fbsdksharedialog *sharedialog = [fbsdksharedialog new]; [sharedialog setmode:fbsdksharedialogmodeautomatic]; [sharedialog setsharecontent:content]; [sharedialog setfromviewcontroller:self]; [sharedialog show]; // [fbsdksharedialog showfromviewcontroller:self withcontent:content d

android - Php session vars not showing in print/print preview. Printing from gpad 7 tablet using chrome browser -

for reason, session variables not showing when print tablet. if print same screen pc, data shows fine. local vars show fine in both scenarios. any idea causing this? tablet: lg gpad 7 4g/wifi browser: latest ver.of chrome android print method: printershare app on wifi website: hosted in server2003 server session vars hold correct value , session_start(); @ top of page. <?php session_start(); $nonlocal = $_session['hasdata']; $local = "this shows in print preview"; echo $local; echo $nonlocal; solution: include favicon in headers. feel moron.

c# - Mapquest: This key is not authorized for this service -

i trying use geocoding.net reverse geocode latitude , longitude formatted address. want address mapquest , not other providers yahoo, google , bing. code: try { igeocoder geocoder = new mapquestgeocoder("fmjtd%7cluu82q6***********"); var addresses = geocoder.reversegeocode(latitude, longitude); return ("formatted address : " + addresses.first().formattedaddress); } catch (exception exception) { return exception.message; } this code catches exception , thorws error "this key not authorized service." i know error occurs when try hit enterprise api of geocoder i.e http://www.mapquestapi.com/geocoding/v1/reverse?key= ******************* for free , open source usage, should hit api: http://open.mapquestapi.com/geocoding/v1/address?key=your-key-here how can this? there option of passing post url in constructor itself? or other way? scanning on open-source code of geocoding.net, lo

ruby - Is there a better way of validating a non model field in rails -

i have form field in ror 4 app called 'measure'. not database column, values model create child entries of own via acts_as_tree : https://github.com/rails/acts_as_tree i have throw validation when 'measure' invalid. have created virtual attribute known measure , check validations on condition. model somemodel attr_accessor :measure validates_presence_of :measure, :if => condition? problem when saving code, thrown validation fine. thrown same validation when trying update record in other method of model. way surpass writing code: # not want this, there better way? self.measure = "somerandomvalue" self.save i making virtual attribute throwing validations. there better way of throwing validations? form has other validations, not want error validations shown differently because not attribute. i want validated when active record saved via create , update action of controller , not when being updated random method of model.

python - Flask-restless endpoints with user resolution and filtration -

how correctly should api returns objects belonging user asks them? api/version/items/<items_id> or api/version/user/<user_id>/items/<items_id> in first case, server queried database user id, obtains authentication. i don't know how create both cases in flask-restless. think preprocessor useful, user_id authorization (jwt token), can't find way use search parameters db. from flask_jwt import jwt, jwt_required, current_user ... manager.create_api(item, methods=['get'], collection_name='items', url_prefix='/api', preprocessors=dict(get_single=[api_auth],get_many=[api_auth])) @jwt_required() def api_auth(*args, **kwargs): user_id = current_user.id # code user id addition. pass preprocessor place build query object. think endpoint items should like: api/version/items but whithin preprocessor build query object passed request: get api/v

Pentaho report designer split query result in two or three tables -

i need next question: have select want show result shown in several pages because select contains on 100 rows. want show 2 or 3 tables in same page these 100 rows don't know how i appreciate kind of help. thanks in advance there no feature exists such in pentaho report designer. jira new feature ticket there status still unresolved http://jira.pentaho.com/browse/prd-2107 according ticket has been moved backlog developed in version 6.0.0

simulation - How to set up Anylogic Optimization experiment? -

anyone tried using optimization experiment anylogic ? trying optimize set of parameters through simulations. anylogic says objective function called @ end of each simulation run. problem seems call whenever ... confused. how can make sure called @ end? there feature need adjust in optimizer ? thanks! l.

r - Warning messages when subsetting on integer variables -

i have small shiny application in i'm displaying variable names checkboxgroupinput , based on selection i'm subsetting data table variables , displaying it. what observed when variable of integer type label selected, there warning message on rstudio console : warning in formatc(x = c(36l, 29l, 20l, 25l, 48l, 42l, 19l, 26l, 36l, 39l, : class of 'x' discarded if change variable type character(in case label gone) in data.table warning goes away - these warning messages mean , how rid of them without change type of columns? here code : server.r library(shiny) dft<-data.table(name=c("a","b","c"),age=c(10l,12l,13l)) label(dft$name)<-"full name" label(dft$age)<-"age of patient" shinyserver(function(input, output) { output$x<- renderui({ checkboxgroupinput("g1","g1label",names(dft)) }) output$y<- rendertable({ if (length(input$g1 > 0)) {subse

c# - EPPlus not formatting last record -

Image
i'm using helper below export data our website simple excel spreadsheet. use createandformateworksheet method to... create , format worksheet datetime data types preserved leading zeros. this works great, fomatting isn't being applied last row of spreadsheet. i've done research , can't find on topic, i'm thinking must have setting either out of place or used incorrectly. ideas? public static void exportdata<t>(httpresponsebase response, list<t> dataset, string filename) { var pck = new officeopenxml.excelpackage(); var ws = createandformatworksheet(pck, dataset); response.clear(); response.contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; response.addheader("content-disposition", "attachment; filename=" + filename + ".xlsx"); response.binarywrite(pck.getasbytearray()); response.flush(); response.en

multithreading - How can I improve performance with FutureTasks -

the problem seems simple, have number (huge) of operations need work , main thread can proceed when of operations return results, however. tried in 1 thread , each operation took let's 2 10 seconds @ most, , @ end took 2,5 minutes. tried future tasks , submited them executorservice. of them processed @ time, each of them took let's 40 150 seconds. in end of day full process took 2,1 minutes. if i'm right, threads nothing way of execute @ once, although sharing processor's power, , thought processor working heavily me tasks executed @ same time taking same time take excecuted in single thread. question is: there way can reach this? (maybe not future tasks, maybe else, don't know) detail: don't need them work @ same time doesn't matter me matters performance you might have created way many threads. consequence, cpu switching between them generating noticeable overhead. you need limit number of running threads , can submit tasks execute con

protege - create or load ontology in eclipse using owlapi -

hello write ontology in protege , add owlapi eclipse project. want add own ontology eclipse project these codes : import static org.junit.assert.*; import static org.semanticweb.owlapi.search.searcher.annotations; import java.io.bytearrayoutputstream; import java.io.file; import java.util.arraylist; import java.util.collection; import java.util.collections; import java.util.hashset; import java.util.list; import java.util.set; import javax.annotation.nonnull; import org.junit.*; import org.junit.rule; import org.junit.test; import org.junit.rules.temporaryfolder; import org.semanticweb.owlapi.apibinding.owlmanager; import org.semanticweb.owlapi.formats.owlxmldocumentformat; import org.semanticweb.owlapi.io.streamdocumenttarget; import org.semanticweb.owlapi.io.stringdocumentsource; import org.semanticweb.owlapi.io.stringdocumenttarget; import org.semanticweb.owlapi.model.addaxiom; import org.semanticweb.owlapi.model.addontologyannotation; import org.semanticweb.owlapi.model.iri

javascript - Output div contents and styling to image -

i have type of word cloud developed. simple database search result applies random css styling (size, color, vertical layout, etc) keywords make pretty inside div or single cell table. these keywords retrieved via php/mysql function. i able output div/table cell's (whichever work better) contents along css styling image file. i've seen posts suggesting html2canvas haven't had luck getting search results css show in image , not sure if possible in case. any ideas point me in right direction? thanks, you use html pdf script, this one , , use imagick php function convert image. source: http://buffernow.com/html-to-image-php-script/

c# - Using regex to split string by Non Digit and Digit -

ive seen few answers similar none seem go far enough. need split string when letters change numbers , back. trick pattern variable meaning there can number of letter or number groupings. for example ab1000 => ab 1000 abc1500 => abc 1500 de160v1 => de 160 v 1 fgg217h5ij1 => fgg 217 h 5 ij 1 etc. if want split string, 1 way lookarounds : string[] results = regex.split("fgg217h5ij1", @"(?<=\d)(?=\d)|(?<=\d)(?=\d)"); console.writeline(string.join(" ", results)); //=> "fgg 217 h 5 ij 1"

spring - SimpleMessageListenerContainer and TaskExecutor always only 1 message processed -

Image
i have simplemessagelistenercontainer using taskexecutor (pool size = 15) never process more 1 message @ time. here how configured. simplemessagelistenercontainer settings are: concurrentconsumers = 1 (e.g., 1 jms consumer) taskexecutor = instance of java.util.concurrent.threadpoolexecutor threadpoolexecutor settings are: corepoolsize = 1 maximumpoolsize= 15 workqueue = linkedblockingqueue<runnable> size 200 my expectation: i expect 1 jms consumer pull off messages , run them fast possible in 1 of background taskexecutor threads. if 50 messages on queue, pull off 50. run 15 @ time while other 35 held in taskexecutor's linkedblockingqueue internal queue. what's happening: instead, app processes 1 message @ time. in jconsole, have extended container , exposed more jmx attributes task executor status, see "taskexecutor" activecount 1 maximum (e.g. threadpoolexecutor.getactivecount()). threadpoolexecutor never moves 15. so, jms consumer

ruby on rails 3 - Putting require 'spec_helper' results in Bad URI error -

i did rails generate rspec:install, ran rake spec , works fine. however, when create new spec file , add require 'spec_helper', following error. rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/uri/common.rb:176:in `split': bad uri(is not uri?): (uri::invalidurierror) anyone know might issue? edit: also, when run rake db:schema:load rails_env=test uri::invalidurierror: bad uri(is not uri?): maybe, has raven sentry? raven dependency causing issue.

javascript - how to display a modal on a selected item in knockout -

i have list of services getting api, values id, name , needauthorization, , when service need authorization, want display modal box enter authorization code. i'm trying this: selectedservice.subscribe(function (newvalue) { if (services().needauthorization == 1 && selectedservice == services().id) { $('#preauthorizationmodal').modal('show'); } }); but it's not working me. i'm new knockout , lil bit of appreciated. in advance presenting , dismissing knockout can done 'if' or 'with' binding. create "modallayer" responsible showing modals. communicate layer using signals/events/subscriptions example. the html modallayer like. <!-- ko with: modalviewmodel --> <div data-bind="text: title"></div> <div data-bind="text: body"></div> <div data-bind="foreach: buttons"> ... </div> <!-

ios - Mach-O Linker warning: too many personality routines for compact unwind to encode -

i finished upgrading project use swift 1.2. i've got new linker warning i've never seen before. ld: warning: many personality routines compact unwind encode . it doesn't give offending file or additional details. know how suppress warning, i'd know how fix it. thoughts? this different other questions answered because explain how hide warning, none of them explain how fix problem. yes. have got same error. going suppress myself - feeling not idea.

user interface - Can I change the behavior of Android's LayoutTransition to eliminate the fade but keep the height animation? -

it's easy add layout transitions attribute: android:animatelayoutchanges="true" however, animation not create pleasing user experience. when elements added layout (i'm using simple vertical linearlayout) or change gone visible there's 2-stage process think rather annoying. first, room prepared new element (everything else pushed down). when there's enough room, new view fades existence. likewise, when view removed or changes visible gone, first fades out, room claimed gradually shrinks zero. i way change animation think natural way it: when adding view height gradually changes 0 full size, first see top, without ever changing alpha. when removing view height gradually changes full size zero, near end of animation see top, without ever changing alpha. how can accomplish in android? (note: user can tap on several buttons , cause several elements appear / disappear in quick succession, before animation other views ended - or make appear while it'

javascript - Firefox createMediaStreamDestination bug using rtc? -

i stream audio on rtc , want mute , unmute audio. this works... no gain control: function(stream) { /* getusermedia stream */ console.log("access granted audio/video"); peer_connection.addstream(stream); } this works on chrome not on firefox (with gain control) function(stream) { /* getusermedia stream */ console.log("access granted audio/video"); var microphone = context.createmediastreamsource(stream); gainnode = context.creategain(); var dest = context.createmediastreamdestination(); microphone.connect(gainnode); gainnode.connect(dest); local_media_stream = dest.stream; peer_connection.addstream(local_media_stream); } i no error , hear no voice. when send gainnode context.destination can hear myself. i think "context.createmediastreamsource(stream)" broken in way. can tell me why ? , how fix this. edit: checked streams and: stream //type: localmediastream dest.steam //type: mediastream in firefox

html - Inner div with background doesn't affected by outer div with border-radius -

i applied border border-radius li . background applied a . issue a corners still showing up. is there solutions can think of aside following? two possible solutions: use overflow:hidden . this solution doesn't apply current layout need other solution. apply border-radius both li , a . this solution @ moment need @ least lessen css codes on project... note: tab layout pixel perfect using method. fiddle here. body { background:#eee } ul { margin: 0; padding: 0; } ul li { display: inline-block; list-style: none; position: relative; border:1px solid #aaa; border-bottom:0; border-radius:5px 5px 0 0; vertical-align:bottom; } ul li { padding: 10px 15px; display: block; line-height: 25px; margin-bottom:-1px; } ul li.active { background:#fff; } .content { border:1px solid #aaa;background:#fff;height:200px } <ul> <li class="active"><a href="#">tab 1</a>&l

How do I make a paragraph of text display as a square/rectangle in CSS -

i have created modal popup , have been trying figure out how make text in modal justified on top, bottom, left, , right (displaying rectangle/square). have tried block not working. so modal section text looks this: xxxxxxxx xxx xxxx xx xxx xxxxx xxx xxxxxxxxx xxx xxxxx xx xxxxx xxxx xxxx xxxx xxxxxxxx xxxx xxxxxxxx xx xxxxx xx xx xxxx xxx x xxxxxxx xx x x x xx xxxxx x x x x xx x xxx x x x and jagged right. how make there no jagged edges like. xxxxxxxx xxx xxxx xx xxx xxxxx xxx xxx xxxx xx xxx xxxxx xx xxxxx xxxx xxxx xxxx xx xxxxx x xxxx xxxxxxxx xx xxxxx xx xx xxxx xxx x xxxxxxx xx x x x xx xxxx x x x x x xx x xxx x x x i have been trying while , can't seem it. edit: added css #modal{ background-color: #4d94b8; outline-color: #180238; border: 1px solid #3b7593; border-radius: 80px; font-family: arial; text-align: justify; display: inline-block; text-align: justify; left: 50%; top: 50%; width:24%; height:50%; z-index: 1000; margin

data structures - PYTHON Binary Search Tree - Recursive Remove -

i'm working on binary search tree class , have implement remove method using recursion. here code given us. def remove (self, x): def recurse (p): # modify method. if p==none: return p elif x<p.data: return p elif x>p.data: return p elif p.left==none , p.right==none: # case (1) return p elif p.right==none: # case (2) return p elif p.left==none: # case (3) return p else: # case (4) return p self.root = recurse (self.root) obviously there should more return p each conditional. , i'm pretty sure first if , 2 elifs used 'locate' node containing x. not sure how implement 4 cases. input appreciated. also, end goal use method iterate through bst , remove each node. well, first step locate x, remember recursion, should recurse remove function on child tr

java - how to get the result of restful web service with httpClient in json format -

i'm developing httpclient application use list<object> restful web service in json format. i want use result in json format. this httpclient application class : public class clientabortmethod { public final static void main(string[] args) throws exception { closeablehttpclient httpclient = httpclients.createdefault(); try { httpget httpget = new httpget("http://localhost:8080/structure/alldto"); system.out.println("executing request " + httpget.geturi()); closeablehttpresponse response = httpclient.execute(httpget); try { string data= entityutils.tostring(response.getentity()); system.out.println(data); // not feel reading response body // call abort on request object httpget.abort(); } { response.close(); } } { httpclient.close();

web component - Render table rows with Polymer's <core-list> -

i trying use <core-list> render rows table like: <table> <tbody> <core-list data="...">...</core-list> </tbody> </table> unfortunately, it's not simple. <tbody> can't contain <core-list> element it's ignored browser (or @ least assume that's reason). thought obvious use case <core-list> official documentation doesn't mention using tables @ surprising me. maybe i'm blind wasn't able google i'm wondering if can't use <core-list> in way or approach isn't right. it seems way use <div> s , style them table because of reasons described in original question. this applied polymer 0.5 issue same polymer 1.0 well.

swift - Items Greyed Out in Xcode After Copying Between Storyboards -

Image
i have 2 storyboards , copied , pasted view 1 other. still works of items greyed out in wrong size configuration. can see picture below showing problem. have width , height set same in both storyboards xcode acting in wrong configuration edit. (yes, i've tried changing configuration of them still present greyed out items).

javascript - AngularJs Intranet Windows Authentication -

i'm working on angular app intranet application. hosted angular , webapi in iis separate application. need validate current windows logged-in user against active-directory group. when user loads angular page, should automatically send in logged-in userid. tried $windows service, not have user information. any approach use here.

java - Json Data on Fragment -

i learning android programming , created basic project using android studio. my application crashes when click on getdata button. the mainactivity.java: package com.cs_infotech.newpathshala; import android.app.activity; import android.app.fragmenttransaction; import android.content.intent; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.content.context; import android.os.build; import android.os.bundle; import android.view.gravity; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.support.v4.widget.drawerlayout; import android.widget.arrayadapter; import android.widget.textview; import android.widget.toast; public class mainactivity extends actionbaractivity implements navigationdrawerfragment.navigationdrawerc

angularjs - How to conditionally assign value to a ViewModel property from within the View -

i have following html shows error message when ng-show conditions met. however, ng-init assignment happens whether error message shown or not. <div ng-show="peopleworksform.submitted && formdata['disclosurequestion'+($index+1)+'answer'] == 'true' && formdata['disclosurequestion'+($index+1)+'optionalanswer'] == undefined" ng-init="$parent.answervalfailed = true"> invalid value </div> what want operation inside ng-init after ng-show conditions met. there easy way so? use ng-if , inside use ng-init :) <div class="pw-form-inline-error" ng-if="peopleworksform.submited && formdata['disclosurequestion'+($index+1)+'answer'] == 'true' && formdata['disclosurequestion'+($index+1)+'optionalanswer'] == undefined"> <span ng-init="$parent.answervalfailed = true">

c# - ImageResizing.Net behind WCF -

i've been evaluating nathanael jones amazing imaging library , plugins image processing services company building on azure. before acquiring license testing them ensure fit in within our scenario. favor , check them out here . i'm having great success plugins when using them in asp.net mvc web application. i'm using image server functionality within controller post ui. cropping, resizing , simple/advanced filters working expected. the problems having when move functionality wcf service class library within application. cropping , resizing work expected, filtering instructions (brightness, contrast, sepia, etc...) either being ignored or fail silently. here image processing code: var instructions = new imageresizer.instructions(); //all of these instructions work instructions.width = 300; instructions.height = 300; instructions.mode = imageresizer.fitmode.crop; instructions.outputformat = imageresizer.outputformat.jpeg; instructions.jpegquality = 90; double[]

python - Why is it keep on asking when I input correctly? -

def main(): month = 0 date = 0 year = 0 date = [month, date, year] user = input("enter according mm/dd/yy:") user = user.split('/') month = user[0] date = user[1] year = user[2] while int(month) > 12 or int(month) < 1 : print("month incorrect.") user = input("enter according mm/dd/yy:") while int(date) > 31 or int(date) < 0: print("date incorrect.") user = input("enter according mm/dd/yy:") while int(year) > 15 or int(year) < 15: print("year incorrect.") user = input("enter according mm/dd/yy:") i keep on getting month incorrect when it's correct. please help. i'm trying user's input match correct form of mm/dd/yy. , i'm trying convert yy -> 2015. please help. there bug in code. suppose if input "15/30/15", says incorrect month , tries fetch user input in format "mm/dd/yy", user not spliting based on

Modifying elements in a STL List - C++ -

i attempting construct binary search tree using generalized list in c++. class element { private: list<element*> _children; char* _name; // , other data members/methods... } as can see, have class "element" , has list "_children" of element pointers. i trying access these children may add children them , forth... however, cannot modify these values current method of using "const_iterator" , reason doing "begin()" method of _children returns const_iterator. someone help? thank :) update: thank much... turns out, mistakenly had method return const reference of _children data member. const list<element*>& getchildren();// return [_children] i deleted const , works perfect now. thank you! :d the begin function return const_iterator if list const. _children list should able standard iterator let perform non-const operations on it: list<element*>::iterator = _children.begin(); this