Posts

Showing posts from June, 2013

c++ - Median program through uva -

this first time using online judge, tried simple program become familiar environment. here question . i solved following, wrong answer! #include<stdio.h> #include<math.h> #include<iostream> int main() { int t; int n; int num[10]; int i,j,temp; int s; int fmid; std::cin >>t; int iter=0; while (iter<t) { std::cin>>n; if (n!=-1){ for(i=0;i<n;i++) std::cin>>num[i]; for( i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(num[i]>num[j]) {temp=num[i]; num[i]=num[j]; num[j]=temp; } s=0; if (n%2 ==0) { int mid=n/2-1; int midd=mid+1; s=(num[mid]+num[midd])/2; fmid=s; } else {s=ceil(n/2); fmid=num[s];} std::cout<<fmid; } iter++; } return 0; } any suggestion appreciated. thanks i read numbers, store them in array, sort array using std::sort in <algorithm> please find code below: #include <stdio.h> #include <math.h> #include <iostream> #include <algorithm> int arr[10]; int main() {

windows phone 8 - How can you prevent a ContentDialog from closing on button press in WP8 -

in windows phone 8 (or 8.1), there way prevent contentdialog closing when primary button pressed under conditions? example, have boolean done. when click primary button, want contentdialog close if (done == true). possible? xaml: <contentdialog ... closing="contentdialog_closing"> c#: private async void contentdialog_closing(contentdialog sender, contentdialogclosingeventargs args) { if (!canclose) args.cancel = true; }

Ruby on Rails: Displaying model attribute on view -

so have user model , store model created. having problem displaying name of store has been created in database. it's stupid problem, easy solution, can't figure out i'm doing wrong. here user controller find store want display: def show @user = user.find(params[:id]) @store = store.find(1) end and here view: <% provide(:title, @user.username) %> <div class="row"> <aside class="col-md-4"> <section class="user_info"> <h1> <%= gravatar_for @user %> <%= @user.username %> </h1> </section> </aside> </div> <li><% @store.name %></li> so name of user shows up, no issues there, reason, name of store not showing up. know fact there store id: 1 in database. here appreciated! to output content erb, need add = erb block: <%= @store.name %>

oracle - Split CSV columns in CTL file SQL Loader -

i have 1617 columns in 1 of csv files. oracle has limit of 1000 columns per table, created 2 tables. table 1: 900 columns table 2: 717 columns i have 1 csv file , 7 gb big file. need use sql loader load file on database. i want control file can above me i.e. use first 900 columns , load table 1 , next 717 columns table 2. i don't think can 1 control file. may have use 2 control files. first columns 901 1617 set filler loads table 1, other columns 1 900 set filler loads table 2. run sqlldr twice, once each control file pointing same data file. make sure have primary key column(s) on both in order join them later. either or type of pre-processing wrapper program split file needed. or load via program can read file row row , insert necessary. whatever going maintenance nightmare, dealing many columns. seems proper data normalization needed here have had deal vendor data not change sympathize if case , loading staging table further processing. see post

android - Weird Out of Memory Error. How could this be happening? -

java.lang.outofmemoryerror: failed allocate 1022304 byte allocation 16777216 free bytes , 464mb until oom 1 @ java.lang.abstractstringbuilder.enlargebuffer(abstractstringbuilder.java:95) 2 @ java.lang.abstractstringbuilder.append0(abstractstringbuilder.java:146) 3 @ java.lang.stringbuilder.append(stringbuilder.java:216) i running bug in android 5.0, our app crashes lot of users. however, out of memory exception weird , happens on android 5.0+. same app runs fine on versions below 5.0. how oom occurs, when allocating 1mb 16mb free bytes , 464mb until oom ???

android - Setting FragmentStatePagerAdapter count to 0 does not destroy any current visible fragments -

i have pageradapter dynamic number of elements. can modify number of tabs single call, clears list , count 0. unfortunately, not remove fragment showing. public class mypageradapter extends fragmentstatepageradapter { private list<pojo> pojos = new arraylist<>; @override public int getcount() { return pojos.size(); } public void removeall() { this.pojos.clear(); notifydatasetchanged(); } } does know how force viewpager clear himself? update 1: if use viewpager.removeallviews() viewpager unusable afterwards after adapter notifies new data changes.

ironpython - Creating a Python engine for debug within a parent Python engine -

i'm working on ironpython script executed 3rd party application (ansys hfss) provides scripting interface automation, etc. since creating graphical interface script using sharpdevelop (sd) ide. able take advantage of sharpdevelop's debugging tools don't seem able work. i see sd supports 'attach process...' feature, describes do. however, don't have access parent python engine being spawned 3rd party application. i have found many solutions talk creating python engine within c# application can connected external debugger. unfortunately haven't been able find cases python engine created within existing python engine. can provide solution?

java - How do I declare gradle Antlr task output specs to avoid unnecessary rebuilds -

i have typical antlr 4.5 project 2 grammar files: mylexer.g4 , myparser.g4. them, antlr generates 6 output files: mylexer.java, mylexer.tokens, myparser.java, myparser.tokens, myparserbaselistener.java , myparserlistener.java. gradle tasks working correctly output files generated, compiled , tested expected. the problem gradle sees 6 target files being out of date, every run or debug session has regenerate them , therefore has recompile main java project if none of source files have changed. the gradle task generates file has output spec defined folder 6 output files generated. think need way define being 6 specific files rather output folder. don't know syntax that. here's pertinent part of build.gradle file: ext.antlr4 = [ antlrsource: "src/main/antlr", destinationdir: "src/main/java/com/myantlrquestion/core/antlr/generated", grammarpackage: "com.myantlrquestion.core.antlr.generated" ] task makeantlroutpu

java - getting the urls from the dependencies resolved by Aether -

i using aether resolve maven dependencies. after following this example on aether example public static void main( string[] args ) throws exception { system.out.println( "------------------------------------------------------------" ); system.out.println( getdirectdependencies.class.getsimplename() ); repositorysystem system = booter.newrepositorysystem(); repositorysystemsession session = booter.newrepositorysystemsession( system ); artifact artifact = new defaultartifact( "org.eclipse.aether:aether-impl:1.0.0.v20140518" ); artifactdescriptorrequest descriptorrequest = new artifactdescriptorrequest(); descriptorrequest.setartifact( artifact ); descriptorrequest.setrepositories( booter.newrepositories( system, session ) ); artifactdescriptorresult descriptorresult = system.readartifactdescriptor( session, descriptorrequest ); ( dependency dependency : descriptorresult.getdependencies() ) { system.o

javascript - Getting address and coordinates from google maps -

i want add google map in website , letting users pick location clicking on map in order pass address , coordinates me (to store in db). does google provide functionality? if yes, how? it does, it's called geocoding . edited: you have coordinates click first - add event listener map 'click' event call function(event). inside function, can access location event.latlng. , there, can use reverse-geocoding link above.

android - TextView consumes onTouchEvent -

for custom layout, need monitor touchevents using onintercepttouchevent method of viewgroup . have following layout inside viewgroup . <relativelayout ... ... ... <textview> ... <imageview> ... <webview> ... ... relativelayout> i facing problem monitoring events when touch on textview . seems textview consuming event. see first motionevent.action_down event in onintercepttouchevent method, subsequent motionevent.action_move & motionevent.action_up not received. textview showing static text content. @ play here , there way ensure textview not consume touch event ?

mysql - Calculating the largest out of multiple averages - SQL -

i have table, contains number of cd entrys, complete names, price , genre. trying return average price genre, average price of "rock", "pop", "alternative rock", "electronica", & "electro house". after then trying have automatically display genre highest average price. the table called "cd" table columns cd.id, cd.title, cd.price & cd.genre i have tried using method shown below.. trying establish different averages 3 of genres.. select ((select avg(cdprice) cd cd.genre = 'rock') rock, (select avg(cdprice) cd cd.genre = 'pop') pop, (select avg(cdprice) cd cd.genre = 'electro') electro); however might missing method, not overly familiar "as" command , correct usage. rows (almost) easier columns. want first avg price each genre: select avg(cdprice) price, genre cd group genre the second part filter

regex - highlight the regular expression java -

i want highlight matching words in text using java. made application, reason code below not working. can tell me what's going on? thanks. pattern = pattern.compile(txt1.gettext()); matcher = pattern.matcher( ""+txtarea1.gettext()); while (matcher.find()) { txtarea2.settext( txtarea1.gettext()); } matcher.group(); highlighter h = txtarea2.gethighlighter(); highlightpainter painter = new defaulthighlighter.defaulthighlightpainter(color.yellow); int p0 = matcher.start(); int p1 = matcher.end(); try { h.addhighlight(p0, p1, painter); } catch (badlocationexception ex) { logger.getlogger(re.class.getname()).log(level.severe, null, ex); } ` you're skipping on found text. while (matcher.find()) { txtarea2.settext( txtarea1.gettext()); } let's there match in middle of text. first time find true you'll set text on txtarea2 . go top of loop , find called again

Group Adjacent Functionality in XSLT -

i have question use of group-adjacent . i have seen 2 patterns being used: pattern 1: <xsl:for-each-group select="*" group-adjacent="boolean(self::p[@class = 'code'])"> pattern 2: <xsl:for-each-group select="*" group-adjacent="@class"> based on used, noticed current-grouping-key() returns false. what purpose of using boolean function in group-adjancent ? with form <xsl:for-each-group select="*" group-adjacent="boolean(self::p[@class = 'code'])"> grouping key boolean value true adjacent p elements having class attribute value code while second form <xsl:for-each-group select="*" group-adjacent="@class"> grouping value string , groups adjacent elements same class attribute values. so depends on needs, if have e.g. <items> <item class="c1">...</item> <item class="c1">...</item>

javascript - jQuery DataTables Scroller Ajax not being called the second time -

i using datatables jquery plugin. having problem using scroller plugin . doesn't load more data when scrolling reaches end of container. init in jquery: $("#data-table").datatable({ "blengthchange": false, "paging": false, "scrollcollapse": true, "searching": false, "serverside": true, "ordering": false, "ajax": { "url": const_web_service_url + "getdata", "type": "post" }, "scroller": { "loadingindicator": true, "trace": true }, "deferrender": true, "dom": "lfrtips", "scrolly": "400px" }); my .net webservice returns json data when datatables first read it: { "draw": 1, "data": [{ "id": 1.0, "name": "88354b7e-c150-4985-b596-113fb3f9

Javafx, how do I create Node/objects that are meant to represent a wave of mobs/turrets? -

Image
tower defense game: public class main extends application { ....... private node turret6; private int turretcount = 0; @override public void start(stage stage) throws exception { mob1image = new image(mob1_image_loc); ............ turretimage = new image(turret_image_loc); mob1 = new imageview(mob1image); ............ turret1 = new imageview(turretimage); group group = new group(mob1, mob2, mob3, mob4, mob5, home); movemobto(1 * w / 10, h / 2, mob1); ............................... movemobto(5 * w / 10, h / 2, mob5); movehometo(w * 9 / 10, h * 1 / 2); scene scene = new scene(group, w, h, color.blue); scene.setonmousepressed(new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { if (turretcount == 0) { group.getchildren().add(turret1); moveturretto( event.getscenex(), event.getsceney(), turret1); turretcount = turretcount + 1; score = score - 10;

ios - UIWebView screen taps in area cease to work after showing then hiding a UIView overlay -

i have been working on app features full screen uiwebview contains html based application. features working qr code scan using native bridge between js , native obj-c code. tapping button launches uiview half size of overall display, overlay, inside see video feed , when qr code detected passes code , uiview closed. works treat. however uiwebview suffers odd issue, elements have been underneath uiview become untappable. it's if there ghost of uiview still present. any ideas why occurring? - (void)handlecall:(nsstring*)functionname callbackid:(int)callbackid args:(nsarray*)args { if ([functionname isequaltostring:@"setbackgroundcolor"]) { ....... snip ........ } else if ([functionname isequaltostring:@"scanqrcode"]) { _viewpreview = [[uiview alloc] initwithframe:cgrectmake(256, 192, 512, 384)]; [self addsubview:self.viewpreview]; [self bringsubviewtofront:_viewpreview]; _capturesession = nil; if (!_isreading) {

javascript - How to clear an angular array -

$scope.itemarray = ['a', 'b', 'c']; this clear array ui wont updated. $scope.itemarray = []; this works fine! why? $scope.itemarray.length = 0; $scope.itemarray.length = 0; << correct. length read-write property. $scope.itemarray = []; << creates new empty array. if have bindings old itemarray, may lost. (html binding ng-if="itemarray[0]" wont lost)

ios - How to access Apple WatchKit WKInterfaceController list -

in watch extension code trying prevent display of second interface controller in scenarios. solution requires looking through list of active view controllers. does know how list of active interface controllers? can in ios using self.navigationcontroller.viewcontrollers find no navigation controller in watchkit. i have read through apple watch programming guide number of times don't address this. since can push & pop interface controllers, there must list kept os suspect there no programming access list. because can pass valid context , access in awakewithcontext: , i've used technique of bundling reference presenting view controller along additional context in watchkit app. not allow build-up list of presented interface controllers, allows things assign delegates, inform controllers of interesting events, etc. i've published jbinterfacecontroller project on github: https://github.com/mikeswanson/jbinterfacecontroller

java - WatchService: missed and unhandled events -

i'm having issue watchservice. here snippet of code: public void watch(){ //define folder root path mydir = paths.get(rootdir+"inputfiles/"+dirname+"/request"); try { watchservice watcher = mydir.getfilesystem().newwatchservice(); mydir.register(watcher, standardwatcheventkinds.entry_create); watchkey watckkey = watcher.take(); list<watchevent<?>> events = watckkey.pollevents(); (watchevent event : events) { //stuff } }catch(exception e){} watckkey.reset(); } *first of all, know watch() called inside infinite loop. the problem when creating multiple files @ time, events missing. example, if copy-paste 3 files ".../request" folder, 1 gets caught, others remain if nothing happened, neither overflow event triggered. in different computer , os, reaches 2 files, if 1 tries 3 or more, rest still untouched. i found workaround though, don't think it's best practice. flow: the

x86 - Assembly Game character movement slowing down my game -

i making game in assembly game being character object (in case 'x' char) moves dodge falling 0's , 1's. falling objects perfect problem i'm having if hold down direction either left or right falling objects stop accommodate player object's new position. i'm using irvine library procs such readkey gets keyboard input else 100% me. i'm not sure why stops complete line of code executed on first go through on print cycle. appreciated. below i'll post code. right runs on infinite loop broken if hit object. ;******* proc make easier reprint rain;kilian proc print proc mov esi,0 mov count, 0; intilize 0 reset print proc printall: mov ecx, count mov ebx , 0 cmp esi,4 je 4 jmp end4 four: mov esi , 4 end4: inloop2: mov dl,xarray[ebx] mov dh,yarray[ebx] call gotoxy ;moves cursor position of rain mov al,rainarray[ebx] call writechar ;rewrite rain push ecx cmp

javascript - Window object cleared on $Interval -

Image
i'm experiencing rather weird behavior when trying log window object defined $window.open() in angularjs within $interval self = $scope.childwindow = $window.open(authservice.buildauthorizeurl(), '_blank') console.log $scope.childwindow var1 = "i may not work" self.var2 = 'i should work' privatedata.authinterval = $interval -> console.log $scope.childwindow console.log var1 console.log self.var2 , 1000 output window {document: document, window: window, frameelement: null, clientinformation: navigator, onhashchange: null…} window {} may not work should work window {} may not work should work as can see, first console.log $scope.childwindow outputting defined window object. others, inside $interval , outputting {} . i've tried not attaching childwindow $scope object, , i've tried attaching self . i've tried following this example , experienced same behavior. have idea why happening? much. jsfiddle demo: http://

javascript - How do I detect when the user changes between inputs pressing 'tab' using jQuery? -

i have view form. form has many inputs, , need detect when user moves between them (clicking or pressing 'tab'). for have this: $('input').on('click',function(){ // }); but need detect if user focus on these input if doesn't use mouse. thank you how focus ? $('input').on('focus',function(){ // }); the focus event sent element when gains focus. event implicitly applicable limited set of elements, such form elements ( <input> , <select> , etc.) , links ( <a href> ). https://api.jquery.com/focus/

java - Strange Compilation Error Involving Casting -

i noticed rather strange when working in ide. double x1 = 0, x2 = 0; int = (int) x1 = (int) x2; so invalid syntax, unsurprisingly. however, it's explanation of why it's invalid syntax confuses me. when put code in eclipse luna , hover on second line, message appears says: type mismatch: cannot convert boolean int 1 quick fix available: change type of 'a' 'boolean' if ignore error , proceed run anyway, throwable stack trace shows same message: exception in thread "main" java.lang.error: unresolved compilation problems: type mismatch: cannot convert boolean int syntax error on token "=", <= expected i don't understand why compiler thinks (int) x1 = (int) x2 sort of comparison evaluates true or false . have idea of why so? the castoperator has higher priority assignment operators. due this, can't assign cast value x1 , since compiler interprets as: ... cast x1 integer assi

mysql - INSERT auto_increment value -

i have simple table few values , primary key auto_incremented 1: create table test1 (acounter int not null primary key, studentid int not null, ranking int not null, aweek date not null); alter table test1 auto_increment=1; if able insert test1 (null,1012,1,'2015-04-20') , data comes in different order tried insert test1 (acounter,aweek,ranking,studentid) values (null,'2015-04-20',1,1012) - receive error primary key cannot null. don't want - expect auto_increment use next value. when declared column auto increment ,db take of insert other values table. insert test1 (aweek,ranking,studentid) values ('2015-04-20',1,1012)

combine xml childs with same attribute in php -

i have surfed on web , tried different aproaches trying achieve want, doesn't work. hope of can point me in right direction. i have xml file multiple childs has same "name" attribute. 1 child need attributes "created_for_playlist" , "sort_on_playlist" , other child same "name" attribute need "name" , "duration". both childs has different attributes... is possible information , merge xml or write direct in array or print or echo directly? this xml: <assets> <asset name="blanco fragment" unique_id="83609dd0-d22c-4217-afc6-64bccf742bee_shot" type="shot" media-type="9" vam_state="1" created_for_layer="5" blank_shot="1" visible="1" /> <asset name="blanco fragment" unique_id="fd090636-fff1-4492-9e1d-2000ea96f1d7_shot" type="shot" media-type="9" vam_state="7" created_

Python user data check -

i have program gets user's input , asks whether information correct or not. however, when user has finished entering information, error code: #welcome print("welcome game!\n") def data(): #age age = int(input("enter age: ")) #gender gen = input("enter gender: ") #email mail = input("enter email: ") #username name = input("enter name: ") return (age, gen, mail, name) def datacheck(): print("your information:\n") print("age: ", age, "\n") print("gender: ", gen, "\n") print("email: ", mail, "\n") print("username: ", name, "\n") yn = input("is correct? yes or no: ") if yn == "yes": print("hello, ", name) if yn == "no": data() #array variables age = data[0] gen = data[1] mail = data[2]

java - it isn't reading my number inputs in the original class -

my code isn't seeing input numbers second class. keeps thinking inputs 0 isn't completing program. did go wrong? i've tried couple different things think of, didn't work. keeps outputting false/unsolvable because numbers 0 instead of inputs. the second class number inputs. private static int a, b, c, d, e, f; public static void main(string args[]) { system.out.println("please enter numbers 'a, b, c, d, e, f' "); chapter9_2ndclass c2 = new chapter9_2ndclass(a, b, c, d, e, f); exercise_09_11 chapter9_2ndclass = new exercise_09_11(a, b, c, d, e, f); // exercise_09_11 gety = new exercise_09_11(a, b, c, d, e, f); // //constructors if (chapter9_2ndclass.issolvable()) { chapter9_2ndclass.getx(); chapter9_2ndclass.gety(); } else { system.out.println("unsolvable"); } } public exercise_09_11(int a, int b, int c, int d, int e, int f) { this.a = a; this.b = b; this.c = c;

ios - UITableview cell retain custom image view filter -

Image
i faces issue when developing tableview custom cell. here problem, have tableview , has lots of customized cell (a uiimageview , uilabel) when user tap of cell pushes new uiviewcontroller , user filling data , tapped "save" viewcontroller push delegation method. in delegate method inspect tapped cell , change tint color (like selected state i'm changing custom imageview tint color). changes correctly when i'm scrolling vertical direction tint color disappear. below pictures , code figuring out correctly. when pop view controller delegate method (works correctly) when scrolling vertical direction tin // custom cell @interface customcell : uitableviewcell @property(strong, nonatomic) uiimageview *imageview; @property(strong, nonatomic) uilabel *titlelabel; @end // custom cell implementation nothing special here. // uiviewcontroller delegate method when pop // i'm filling specific color @interface uiviewcontroller @property (strong,nonatomic) c

javascript - How can i use factory function for different AngularJS controllers? -

i have factory function want use in 3 different controllers, want use if factory code block inside if condition of controller , else factory code block want use in else condition of controller. how achieve task using factory appreciated. so far tried code below... factory.js angular.module("app").factory('geotreefactory', function() { return { gettreecheck: function (geolocation) { if (geolocation.id === 5657){ $.each(geolocation.parent(),function(index,location) { if (location.id !== geolocation.id) { $.each(location._childrenoptions.data.items,function(index,child){ var disablechildid = 'disabled' + child.id; var model = $parse(disablechildid); model.assign($scope, true); }) var disableitemid = 'disabled' + location.id; var model = $parse(disableitemid); model.assign($scope, true); }

date - Convert a get;set string DateEntered from yyyy-MM-dd to MM-dd-yyyy in C#? -

in 1 .cs file have following: public string dateentered { get; set; } in .cs file have string grab date. public string highestdate { { ... return d.dateentered; } } wondering how convert output yyyy-mm-dd mm-dd-yyyy? scope in used follows: data.highestdate thanks in advance. edit: another part of code think integral: var s = this...(i => i.dateentered == datetime.utcnow.tostring("mm-dd-yyyy")); however changes instances of date format. you should store dates datetime variables: public datetime dateentered { get; set; } then can render date in consumer application (ui): public string highestdate { { ... return d.dateentered.tostring("mm-dd-yyyy"); } }

ios - How to get the intersection of two CGPath? -

Image
i using cashapelayer.path , calayer.mask set image mask, can achieve "difference set" , "union" effect cgpath setting masklayer.fillrule = kcafillruleevenodd/kcafillrulezero however, how can intersection of 2 paths? cannot achieve even-odd rule here example: let view = uiimageview(frame: cgrectmake(0, 0, 400, 400)) view.image = uiimage(named: "scene.jpg") let masklayer = cashapelayer() let maskpath = cgpathcreatemutable() cgpathaddellipseinrect(maskpath, nil, cgrectoffset(cgrectinset(view.bounds, 50, 50), 50, 0)) cgpathaddellipseinrect(maskpath, nil, cgrectoffset(cgrectinset(view.bounds, 50, 50), -50, 0)) masklayer.path = maskpath masklayer.fillrule = kcafillruleevenodd masklayer.path = maskpath view.layer.mask = masklayer how can middle part of shown? mean, middle part(which blank in sample view). i can in vector design software ai, think there must way handle. extension uiimage { func doublecirclemask(#circlesize:cgflo

routing - Port forwarding from IP to localhost? -

how can make traffic sent ip address (192.168.91.164) forwarded localhost, or host within local network? note machine on 10.0.1.x network. i trying on mac os yosemite, uses pf firewall , has no ipfw or iptables . more specifically, have process connects activemq server on 192.168.91.164 port 8161 (i can't change address or port), connect activemq server on local machine on same port, or host on local network. you may try edit /etc/hosts , redirect ip 127.0.0.1 edit file text editor , add line end: 127.0.0.1 192.168.91.164

PHP 5.4 on IIS is adding slashes after quote automatically -

my company switched php. have had no real issues until today. when assign string has quotes inside variable, string have slashes escaping single quotes. this 1 week old fresh install of 5.4. read 5.4 not have magic quotes. searched php.ini , did not find magic in name, must not on. example: $sql = "select description value [group]='auto_email_test'"; echo dbstr($sql, "0"); when debug, $sql "select description value [group]=\'auto_email_test\'"; tried no luck. $sql = "select description value [group]='auto_email_test'"; echo dbstr(stripslashes($sql), "0"); why php escaping quotes right away? , why stripslashes() not work remove them? edit: show dbstr(); /** * * executes $imcomingsql query , returns first cell in first row * * @param string $_incomingsql sql query want execute. * @param string $_defaultvalue value return if null. */ function dbstr($_incomingsql, $_defaultvalue) { $resu

c# - When to return ConflictResult in a Web Api Project -

in asp.net web api projects , 1 of http result datatypes returned in controller conflictresult . when return type of result in response? i not find proper example , explanation on status , hope response contain sample code , explanation of reason why existing status such badrequestresult,exceptionresult,internalserverresult not applicable conflictresult? you use response in scenarios same record updated simultaneously 2 users. e.g. edit conflict or if there version conflict between existing data , update request. it return http status code 409 each 1 of requestresult mentioned have different meaning , allows client handle response differently. listing of http status codes provided in link. the ones specified detailed below badrequestresult equivalent http status 400. badrequest indicates request not understood server. badrequest sent when no other error applicable, or if exact error unknown or not have own error code. conflictresult equivalent http

javascript - ng-if condition having class name condition -

i using partial view shown below each tab.each partial view has lot of databindings , data rendering becomes slow. <div class="tab-content" ng-controller="mycontroller"> <div id="tab-1" class="tab-pane fade active in " ng-include="'partialviews/1.html'"></div> <div id="tab-2" class="tab-pane fade" ng-include="'partialviews/2.html'"></div> <div id="tab-3" class="tab-pane fade" ng-include="'partialviews/3.html'"></div> <div id="tab-4" class="tab-pane fade" ng-include="'partialviews/4.html'"></div> <div id="tab-5" class="tab-pane fade" ng-include="'partialviews/5.html'"></div> </div> in link mentioned

css - How do I hide the MediaElement.js video player loading icon that pops up between loops in my WebM video? -

i'm embedding webm video loops in wordpress posts after/before each loop loading spinner icon flashes split second. is there way hide using custom css or so? here's relevant site, happens of video loops embedded far: http://chrisoffner.eu .mejs-overlay-loading { display: none; }

javascript - Using slider on combined bar and linechart -

i build chart combining bar-chart , line-chart in d3.js , added slider updates x-axis not chart itself. attempts failed far. found nice example kind of similar: http://bl.ocks.org/dem42/3878029 i made fiddle, check out here: http://jsfiddle.net/karolinka/zpy0pqlu/10/ thinking in advance. code within slider function: x.domain(d3.range(minv, maxv + 1)); xaxis.tickformat(function(i) { return times[i]; }); svg.transition().duration(750) .select(".x.axis").call(xaxis); linescalex.domain(d3.range(minv, maxv + 1)); svg.transition().duration(750) .select(".lines").attr("d", line); in case anyones interested: line interpolation not nice, works now: http://jsfiddle.net/karolinka/zpy0pqlu/40/ . in end hid additional elements jquery this: if(newtimes.length<5){ $(".bars:nth-child(5)").hide(); } else { $(".bars:nth-child(5)").show(); }

javascript - Using ui-router for "main" layout? -

i'm trying create 'main layout' page using ui-router views, can't seem working right (various errors, controllers not getting called, templates not getting loaded). <!doctype html> <html ng-app="app"> <head> ... </head> <body> <header ui-view="header"> </header> <section ui-view="navigation"> </section> <section ui-view="content"> </section </body> </html> the idea have state representing "root" state whole site providing templates navigation , header "root controller". every other state loads it's content "content" view without affecting others. $stateprovider .state("index", { url: "/", controller: "app.indexcontroller", controlleras: "vm", views: {