Posts

Showing posts from May, 2014

dynamic - Conditional jsf include -

how can conditionally include jsf facelets file @ runtime? sample functionality required if ( add button click) { ui:include src="add.xhtml" } if ( update button click) { ui:include src="update.xhtml" } the syntax above indicative ... mojarra 2.1.1 / apache tomcat 7.0.22 / primefaces 3.4 ui:include doesn't have rendered attribute have encapsulate in other component. set property on server base on button clicked. <h:form> <p:commandbutton value="add" update=":includecontainer"> <f:setpropertyactionlistener value="add" target="#{mybean.action}"/> </p:commandbutton> <p:commandbutton value="update" update=":includecontainer"> <f:setpropertyactionlistener value="update" target="#{mybean.action}"/> </p:commandbutton> </h:form> <h:panelgroup id="includecontainer"> <h:panelgroup re

javascript - JS code does not work on mobile -

i have following code $('.checkbox.radio-info input[type="checkbox"]').change(function() { if ($(this).parent().parent().find('input[type="checkbox"]:checked').length > 1) { $(".checkbox.radio-info input[type='checkbox'").prop('checked', false); $(this).prop('checked', true); } }); this works expected on desktop, however, on iphone (ios 9, chrome) doesn't work. not uncheck checkbox when check one. is there in code device related? it seems missing "]" in line: $(".checkbox.radio-info input[type='checkbox'").attr('checked', false); maybe desktop browser more forgiving? if doesn't help, please share html well.

hive - Avro,parquet and SequenceFileFormat position in Hadoop Ecosystem and their utility -

i have seen different file formats being used while importing , storing hdfs , data processing engines utilize these formats while performing own set of procedures.so kind of difference these file formats make , how choice made different use cases.being newbie creates confusion.kindly same. the choice depends on use case facing according type of data have, compatibility processing tools, schema evolution, file size, type of query , read performances. in general : avro more suitable event data can change on time sequence datasets sharded between mr jobs parquet more suitable analytics due it's columnar format here keys can you writing performance ( more + have faster ) sequence : +++ avro : ++ parquet : + reading performance ( more + have faster ) sequence : + avro : + + + parquet : + + + + + file sizes ( more + have smaller file ) sequence : + avro : ++ parquet : + + + and here facts each file type avro : better in schema ev

java - JUnit Testing a class -

this first time i've had write j unit test , i'm stuck on how start. class represents single cell on othello board has grid , token value. i wanted test constructor both "black" , "white" , different locations, , wanted test of setters , getters. any appreciated. public class boardcell { /** * item @ boardcell. */ private item token; /** * celllocation of boardcell. */ private boardlocation location; /** * constructor. * @param row row number. * @param col column number. * @param token item value. */ public boardcell(int row, int col, item token) { this.token = token; location = new boardlocation(row, col); } /** * sets item value. * @param token item value. */ public void setitem(item token) { this.token = token; } /** * set value of item in boardcell. * @param val value of item. */ public v

vector - C++ read in a line of string as ints? -

i trying read line of string characters numbers (e.g "30 40 50 20") , put them vector. need avoid empty space , newlines. when read input, doesn't see string "30", sees characters "3" , "4". void input() { getline(cin,line, '\n'); (int = 0; < line.length(); i++) { if (! (isspace(line[i]))) { cout << line[i] << ", "; scores.push_back(line[i]);//(atoi(input)); } } cout << scores.size() << "! "; } a line "30 40 50" won't give vector size of 3, give size of 6. optimal ways around issue? edit: should have clarified in original message challenge, in unable include string stream library in original case. i think you're doing right thing grabbing whole line before parsing, otherwise bit of pickle. have parsing. right you're pulling out individual characters.

php - insert element on array on private function -

how can insert element final position of array array on private function?? private function getdata() { return array( 1 => array( 'open_cookie_id' => 1, 'text' => 'i may throw on ya', 'who' => 'leonard mccoy', ), 2 => array( 'open_cookie_id' => 2, 'text' => 'i think these things pretty safe.', 'who' => 'james t. kirk' ), 3 => array( 'open_cookie_id' => 3, 'text' => 'well, hate break you, starfleet operates in space.', 'who' => 'james t. kirk' ), 4 => array( 'open_cookie_id' => 4, 'text' => 'yea

php - Joomla 3.X - Transactions split between functions -

i have problem (once every 1-3 months) transaction gets run twice, , result, data gets entered db twice. here's gist of goes on: function foo() { $arr = getsomearray(); $db = jfactory::getdbo(); try { bar($arr); } catch(exception $e) { $db->transactionrollback(); } } function bar($arr) { $db = jfactory::getdbo(); $db->transactionstart(); // series of inserts , updates // if fail, throw exception $db->transactioncommit(); return true; } here, $arr in foo() should contain unique values. code prevents duplicate entries being inserted db checking if particular entry exists. to test base checks work, i've mocked $arr contain 2 values same. receive exception expected. however, i'm still getting double entries in db , i'm stumped how it's possible. time stamps suggest single transaction gets duplicated , both run in parallel. haven't been able find on particular issue, because it's no

user interface - Ignoring <Button-1> when <Key> is pressed Tkinter, Python -

i want swop tiles on board (in game fifteen) inputted keys. works up/down/right/left, not digit keys 1...9, though coordinates updated correctly within play() function, still doesn't seem move on board. full code is: http://pastebin.com/kvl2jf1g tips?? this key event: def key(event): if event.char.isdigit(): j, row in enumerate(board): i, char in enumerate(row): if char.get() == event.char: print "pressed", repr(event.char),i, j play(i,j) now main part in play() changes string_vars in each label swops empty label (blankx,y coordinates empty space): def play(i,j): global blankx, blanky, game_running if game_running: # update vars if tile can moved if (blankx, blanky) in [(i+1,j),(i-1,j),(i,j+1),(i,j-1)]: board[blanky][blankx].set(board[j][i].get()) board[j][i].set(' ') blanky = j blankx = this visual

CSS Issue with border -

new site , new coding whole, wanting learn well. basically im trying make border grey grey box is, , blue rest of it. i've tried googling struggling find describes im looking for. the grey area 200px wide , starts 26px in left side of page. can @ all? in advance border image header code here - grey box part of logo image. <div class="fusion-header" style="height: 91px; overflow: visible;"> <div class="fusion-row"> <div class="fusion-logo" data-margin-top="5px" data-margin-bottom="0px" data-margin-left="0px" data-margin-right="0px"> you can override parent border in logo element, using negative bottom margin size of border. .header { background: #515151; border: 5px solid #5edbe7; } .logo { width: 200px; height: 50px; margin: 50px auto; background: #5d5d5d; /* override container vorder */ border-bottom: 5px sol

node.js - Named promise results with q.all in NodeJS -

i'm kinda new q stuff , find pretty awesome, there's still can't figure out. i managed run combined promises q.all passing q.all array of promises. this.. var promises = [promiseone(), promisetwo()]; q.all(promises).then(function (results) { res.send(results); } ); the thing want promises named, don't have rely in order of promises. i read somewhere can pass object q.all , have results named. this: var promises = { promiseone: promiseone(), promisetwo: promisetwo() } q.all(promises).then(function(results){ res.send(results); }); but guess doesn't work same way sending array i'm not getting results of promises in there. result similar one: { promiseone: { source: {} }, promisetwo: { source: {} } } so how go getting named results q.all? one thing note amount of promises have in promises array not fixed get param sent user function. also, inside each of promises have array (or object) of promises

c# - ASP.net Identity custom user model not being used by roles, claims and login table -

Image
i using custom user model so: public class applicationuser : identityuser { public string firstname { get; set; } ... } the rest of tables created identity system bit out of sync. new column created called applicationuser_id set @ foreign key there still userid used composite primary key. configuration applicationuser model is public class applicationuserconfiguration : entitytypeconfiguration<applicationuser> { public applicationuserconfiguration() { this.totable("aspnetusers"); this.property(u => u.firstname).isrequired().hasmaxlength(100); this.property(u => u.lastname).isrequired().hasmaxlength(100); } } how tell ef continue using userid foreign key , rid of applicationuser_id? thanks update: working expected until add custom configuration applicationuser. datacontext.cs modelbuilder.configurations.add(new applicationuserconfiguration()); applicationuserconfiguration.cs public class ap

environment variables - How to add library paths in Qt Creator like LIBPATH in Visual Studio? -

Image
question a) how add library paths project should depended libraries in qt creator? b) how settings in project >> run >> build environment related similar in .pro file? environment variable listed there applies .pro file (well don't) exactly? context/details: visual studio has various environment variables folders project looks include files, library files or executable files etc. rather confusing in qt creator , havne't seen documentation on it. the thing obvious includepath variable points directories include files (.h) however how set library paths, path should dependent libraries/dlls etc? can specify exact library libs variable in .pro file, there don't seem equivalent of libpath variable should other libraries if not found in current folder. i have worked around adding library path following way using libs variable dropping library file name , seems work , add path don't see documented anywhere. libs += -l"$$_pro_file_pwd_/xe

Javascript, Only send email when form validates correctly -

i have 2 separate buttons on html form validate inputs , send form respectively. want merge these buttons email generate when form validated correctly. i've included code below , solutions or ideas appreciated: // javascript document function validateform() { //sets variables testing inputs obtaining values entered field var firstname = document.getelementbyid('txtfirstname').value; var lastname = document.getelementbyid('txtlastname').value; var dob = document.getelementbyid('txtdob').value; var pattern =/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/; //this pattern acts template dob field follow var email = document.getelementbyid('txtemail').value; var atpos = email.indexof('@'); var dotpos = email.lastindexof('.'); //these variables check placement of @ , . inside email input var feedback = document.getelementbyid('txtfeedback').value; var invalidform = 0; if (firstname == "") {

javascript - Find the highest subset of an integer array whose sums add up to a given target -

i trying find subset of values within array add given number , return array of subset. need return array contain highest possible largest value. the integer array in ascending order there not valid answer. if there no valid answer need return string along lines of 'no valid answer'. for example: if int array is: [1, 2, 3, 5, 7, 9, 11] , target 19 - want return array [1, 7, 11] . not return [9, 7, 3] because 11 larger 9 , , not return [3, 5, 11] because 7 larger 5 . i assuming need loop within recursive function answer have been unable figure out how it. i have found variations of question in java: https://codereview.stackexchange.com/questions/36214/find-all-subsets-of-an-int-array-whose-sums-equal-a-given-target i have found solution in javascript returns pairs of values (although pretty straight forward): https://codereview.stackexchange.com/questions/74152/given-an-array-of-integers-return-all-pairs-that-add-up-to-100 i thinking need start loop last

use Ionic framework with php files -

i'm creating mobile app ionic framework. got html pages created online. want backend code data sql server. receiving data no problem php. when use php pages don't have interface created ionic. how can use php pages (instead of html) , still lay out ionic? example: scorebord.php <?php $servername = "localhost:3306"; $username = "ssss"; $password = "dffd"; $dbname = "ddddd"; // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select user_username,user_city,user_highscore tbl_user"; $result = $conn->query($sql); ?> <ion-view style="" title="scorebord"> <ion-content class="has-header" overflow-scroll="true" padding="true" style="background: url(img/hx1ml1tvggabo3ene6qg_menu3.png) no-repea

python - Boosting time for multiple for loops in list comprehensions -

Image
i looking method lower execution time python 3.5 takes 2 for-loops in list comprehension looks this: [[(k1-k2)**power k2 in range(m,n)] k1 in range(m,n)] so, started off current approach , found while work, quite slow. first attempt involved transforming list comprehension suitable approach numpy arrays. 3 times faster original approach, that's when noticed quite beautiful: symmetric toeplitz matrix . wiki page: in linear algebra, toeplitz matrix or diagonal-constant matrix, named after otto toeplitz, matrix in each descending diagonal left right constant. i first used default scipy implementation of toeplitz matrix, approach unnecessary slow problem. wrote myself similar approach, third attempt below. methodology i ran 10 tests each approach, each individual test comprising 1000 runs. set parameters m = 10, n = 100 . results can found in table below: approach numpy #1 numpy #2 numpy #3 1 4.573965 1.432406 1.06024

sql server - How to include loan rules in Employee and Loan sql query? -

i have 3 tables employee , loan , loaninstallment . employee table has 1 many relation loan , , loan has 1 many loaninstallment . employee (empid, name, isonprobation) loan (loanid, empid, startdate, enddate). now need write query fetch records of employee in following output. output records (empid, name, status, reason) rules if employee has not taken loan never status should eligible , reason loan not taken. if employee has taken loan within 1 year (i.e enddate less 1 year) status should not eligible , reason loan taken. if employee on probation status should not eligible , reason on probation if employee has taken laon 1 year ago status should eligible , reason loan taken 1 year ago. i have written simple query unable understand how include 4 rules , include reason column in single query. select e.employeeid, e.fullname,l.enddate, (case when datediff(year, max(l.enddate), getdate()) < 0 'eligible'

java - How to check if button clicked, IF form is actually submitted Selenium / TestNG -

i new java/selenium/testng, have issue run 4 sets of data using dataprovider, however, 1 set of data incorrect purpose of testing test works. first check button displayed clicked. want able check button clicked , check if form submitted if form not submitted print error. unsure on how code below: webelement login = driver.findelement(by.id("dijit_form_button_1_label")); //if statement - check if element displayed before clicking on login button. if(login.isdisplayed()){ login.click(); //main event logged if passed reporter.log("login form submitted | "); logger1.info("submit button clicked"); }else{ reporter.log("login failed | "); assert.fail("login failed - check data | "); //main event log fail } webelement logout = driver.findelement(by.id("dijit_form_button_0_label")); if(logout.isdisplayed()){

dictionary - Processing chunks of data - requests / Python -

i have huge files process , searching here found out requests library use. example of file (small one) processed that: https://storage.googleapis.com/tlc-trip-data/2015/green_tripdata_2015-06.csv this code process such data: import requests import csv def consumetaxidata(url): """ given url, reads content , process data. :param url: url readen. :return: list of tuples in form (long, lat, hour). """ print "processing", url points = [] r = requests.get(url, stream=true) keys = none = 0 chunk in r.iter_content(chunk_size=1024): if chunk: if == 0: reader = csv.dictreader(chunk.splitlines(), delimiter=',') else: reader = csv.dictreader(chunk.splitlines(), fieldnames=keys, delimiter=',') line in reader: if == 0: keys = line.keys() print "keys&quo

php - How to change this script to zip an array of dirs? -

i'm new , new php. found script online zip directory , i've edited sends zip browser download , deletes file server. it works fine, zip multiple directories instead of one. how need alter script accomplish this? $date = date('y-m-d'); $dirtobackup = "content"; $dest = "backups/"; // make sure directory exists! $filename = "backup-$date.zip"; $archive = $dest.$filename; function foldertozip($folder, &$zipfile, $subfolder = null) { if ($zipfile == null) { // no resource given, exit return false; } // check if $folder has slash @ end, if not, append 1 $folder .= end(str_split($folder)) == "/" ? "" : "/"; $subfolder .= end(str_split($subfolder)) == "/" ? "" : "/"; // start going through files in $folder $handle = opendir($folder); while ($f = readdir($handle)) { if ($f != "." && $f != "..&q

angularjs - Use ng-controller inside angular templates -

i passing ng-controller attribute in ng-template script tag as, <script type="text/ng-template" id="dirtemplate.html" ng-controller="tmplctrl"> . but variables inside controller scope not available inside template. jsfiddle above code available at, http://jsfiddle.net/hb7lu/21925/ you can 1 of 2 ways not how you're doing it. add ng-controller div consuming ng-include <body ng-app="myapp"> <script type="text/ng-template" id="dirtemplate.html"> {{tmplvalue}} </script> <span ng-include="'dirtemplate.html'" ng-controller="tmplctrl"></span> </body> http://jsfiddle.net/hb7lu/21927/ or add ng-controller in nested div inside template <body ng-app="myapp"> <script type="text/ng-template" id="dirtemplate.html"> <div ng-controller="tmplctrl">{{tmplv

c# change textbox name in code -

i wondering if possible: for(int = 0; < 7; i++) { textbox + + .text = astring; } i want change piece of code work on multiple textboxes, without having type whole code 6 times. know if possible , how? :3 in c# can find control in page aspx. example: for (int = 0; < 10; i++) { textbox textbox = this.page.findcontrol("textbox" + i.tostring()) textbox; if (textbox != null) { textbox.text = "change text"; } }

sql injection - Is my code hackable or secure enough? -

i wonder if app injectable in front end form, url or in other way. frontend: <form id="form1" runat="server"> <asp:hyperlink id="hyperlinkback" runat="server" navigateurl="~/default.aspx">go back</asp:hyperlink> <h3> service locations</h3> <table > <tr> <td><asp:label id="lblfiltervalue" text="filter value :" runat="server"></asp:label></td> <td><asp:textbox id="txtfiltervalue" runat="server"></asp:textbox></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</td> <td> <asp:label id="fieldlist" runat="server" text="filter :"></asp:label> </td> <td>

pandas - How do I decode a msgpack file in Python? -

i've created msgpack file pandas dataframe, using following code: df.to_msgpack('ixto.msg') i've confirmed file saved in directory, can't use msgpack library python since following code: unp = msgpack.unpackb('ixto.msg') gives me following error: attributeerror: 'str' object has no attribute 'read' msgpack.unpackb expects bytes (thus "b") containing encoded data, , you're giving name of file containing data. so need read file first : with open('ixto.msg', 'rb') f: unp = msgpack.unpackb(f.read())

angular - Angular2 conditional routing -

this might basic question, in angular2 there way conditional routing ? or, outside router ? i know ui-router had ability this, haven't seen similar in angular2s router update in new router guards can used instead https://angular.io/docs/ts/latest/guide/router.html#!#guards original (for long gone router) implement canactivate lifecycle hook shown here life cycle hooks in angular2 router , return false if want prevent navigation. see https://angular.io/docs/ts/latest/api/router/canactivate-var.html

javascript - Angular: how to bind to required/ngRequired -

i have directive can required or not. can used in 2 ways (as far know) <my-foo required></my-foo> or <my-foo ng-required="data.value > 10"></my-foo> so, because require , ngrequire same thing think directive this html: <my-foo ng-require="data.isrequired"></my-foo> js: ... .directive('myfoo', function () { return { restrict: 'e', scope: { required: '=' } ... demo well, nope, doesn't work, scope.require undefined . have change scope definition scope: { required: '=ngrequired' } so question preferred way handle both situation such value gets stored in scope.required ? should defined both or use attrs link function ? there 2 approaches can pick: 1. custom form element supporting ng-model if peek @ ng-required directive source code you'll find deals ng-model controller : restrict: 'a', require: '?ngmo

java - jetty package org.json.simple does not exist -

i have simple servlet used jetty. this fragment of servlet: import org.json.simple.jsonobject; import org.json.simple.jsonvalue; public class oscar4servlet extends httpservlet { ... protected void dopost(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { request.setcharacterencoding("utf8"); response.setcharacterencoding("utf8"); response.setcontenttype("application/json"); printwriter out = resp.getwriter(); jsonobject obj = new jsonobject(); obj.put("message", "hello server"); out.print(obj); } } after invoking: javac -cp /usr/share/jetty/lib/servlet-api-2.5.jar oscar4servlet.java i'm getting error: oscar4servlet.java:5: error: package org.json.simple not exist import org.json.simple.jsonobject; ^ oscar4servlet.java:6: error: package org.json.simple not exist import org.json

angularjs - Making an Angular Service to Maintain a counter -

i trying experiment angular services. test wanted make simple counter incremented across multiple controllers , throughout browser life cycle. service seems re-initialized in each controller, ideas ? note: controllers on different pages - there page reload angular.module('myapp').service('session', function($http) { this.inc = function() { console.log("inc called , global :" + this.count); if(this.count) { this.count++; } else { this.count = 0; } }; this.get = function() { return this.count; }; }); and in controller call session.inc(); and session.get(); your setup ok, logic wrong: this.inc = function() { console.log("inc called , global :" + this.count); if(this.count) { this.count++; } else { this.count = 0; } }; first time it's ran, this.count initialized 0 evaluate fal

node.js - Nodejs variable value outside of the function -

in example i'm trying use variable outside of function no luck yet. guys can take , me solve issue? want use variable "value" outside of function. var https = require('https'); var options = { hostname: 'example.com', port: 443, path: '/values', method: 'get' }; var req = https.request(options, (res) => { console.log('statuscode: ', res.statuscode); console.log('headers: ', res.headers); res.on('data', (d) => { var array = json.parse(d); value = array[0][1]; console.log(value); }); }); req.end(); req.on('error', (e) => { console.error(e); }); there aren't tricks or overrides accomplish this. have plan have both places able see variable in same scope (you should read scope in javascript ). closures , classes can enable few other tricks playing scope, none allow override scoping rules entirely. a "trick" can think of regarding scope using

facebook - hybridauth: Invalid Scopes: read_stream -

i keep getting every facebook when hybridauth-2.5.1 when use code below. invalid scopes: read_stream. message shown developers. users of app ignore these permissions if present. please read documentation valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions $config = dirname(__file__) . '/config.php'; require_once( "hybrid/auth.php" ); $hybridauth = new hybrid_auth( $config ); // try authenticate facebook $adapter = $hybridauth->authenticate( "facebook" ); // return hybrid_user_profile object intance $user_profile = $adapter->getuserprofile(); echo "hi there! " . $user_profile->displayname; if has same problem solution "facebook" => array( "enabled" => true, "keys" => array("id" => "162293657470362", "secret" => "109552243da7661c3a1c7bb90670c858"),

dataexplorer - SQL for bucketing counts -

i'm trying create histogram of people's reputations ask questions on site using stackexchange data explorer. the following gives error message: each group expression must contain @ least 1 column not outer reference. invalid column name 'lt_100'. ... suggestions appreciated select case when reputation < 100 "lt_100" when reputation >= 100 , reputation < 200 "100_199" when reputation >= 200 , reputation < 300 "200_299" when reputation >= 300 , reputation < 400 "300_399" when reputation >= 400 , reputation < 500 "400_499" when reputation >= 500 , reputation < 600 "500_599" when reputation >= 600 , reputation < 700 "600_699" when reputation >= 700 , reputation < 800 "700_799" when reputation >= 800 , reputation < 900 "800_899" when reputat

jquery - Expand multiple dropdown menus using a href link -

in header nav, have 3 dropdown toggles hoping able expand allow user click on href link? here dropdown nav code: <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false"> <i class="fa fa-question-circle fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-alerts"> <div class="" style="overflow-y: scroll;height:385px;width:350px; padding-left:0.5cm"> <b>support</b> tickets <li class="divider"></li> <li> <a class="text-center" href="messages.php?show=support"> <strong>see open tickets</strong><i class="fa fa-angle-right"></i> </a> </li> </div> </ul&

Using the printlist/1 predicate in Prolog to sum up all numbers in a list -

i trying use printlist/1 predicate sum numbers in list kind of got stuck.... tried come code keep getting false . here i've come with: printlist([]). printlist([h|t], totalsum) :- print (h+totalsum), nl, printlist(t, totalsum). i know it's wrong , it's last part. appreciated! i query way: ?- printlist([1,2,3]). false. as paulo said, defining 2 predicates here, incorrect. here solution: printlist([], 0). printlist([h|t], sum) :- printlist(t, subsum), sum subsum + h. sample query: ?- printlist([1,2,3,5], l). l = 11. @ paulo requested), tail recursive version: printlist(l, sum) :- sumac(l, 0, sum). sumac([], acc, acc). sumac([h|t], acc, sum) :- nacc acc + h, sumac(t, nacc, sum).

python - Pyqt how to get a widget's dimensions -

i developing application in cannot use modal windows (due application constraints). however, in cases simulate popup window. dynamically create widget has centralwidget parent , use move() method place want. know if there way widget's dimensions @ given time (considering mainwindow can resized @ time) able center placeholder popup (a simple widget) @ middle of centralwidget. thank you you can use framegeometry or geometry depending on your needs .

angularjs - How can I access the following json data in Angular JS? -

well here json { "questions" : { "question 1" : [ { "q" :"question" }, { "a" : "answer a" }, { "b" : "answer b" }, { "c" : "answer c" }, { "d" : "answer d" }, { "answer" : "c" } ], "question 2" : [ { "q" :"question" }, { "a" : "answer a" }, { "b" : "answer b" }, { "c" : "answer c" }, { "d" : "answer d" }, { "answer" : "c" } ] , "question 3":{ "x":"qwerty", "y&q

javascript - dynamically change ng-repeat -

i have object made this: var examples = { 'example1': { ex1: {}, ex2: {}, ex3: {} }, 'example2': { ex1: {}, ex2: {}, ex3: {} } } there button linked function fills example1 object values on first click, , example2 object on second click. first click: example1 values. second click: example2 values. then loop through object using ng-repeat, this: data-ng-repeat="example in examples.example1.ex1" data-ng-repeat="example in examples.example1.ex2" data-ng-repeat="example in examples.example1.ex3" the problem here is, need ng-repeat somehow change , loop through example2 object aswell when button clicked second time. question is, there way change ng-repeat dynamically? edit: goal first list of appear after first click, , both lists appear after second click. i tried make $scope value 2 , put in ng-repeat, didn't work. $scope.counter = 2; //in controller d

html - Start Animation from last state it ends CSS -

var app = angular.module('dialapp', ['nganimate']); angular.module('dialapp').controller('maincontroller',['$scope', function ($scope) { $scope.test = 'test'; $scope.left = false; $scope.right = false; $scope.bottom = false; $scope.leftrotate = function () { $scope.left = true; $scope.right = false; $scope.bottom = false; } $scope.rightrotate = function () { $scope.left = false; $scope.right = true; $scope.bottom = false; } $scope.bottomrotate = function () { $scope.left = false; $scope.right = false; $scope.bottom = true; } }]); body { height: 100%; } .container { padding: 0px; margin: 0px; height: 100%; } .panel-default { border-color: #eff7fa; } .panel-default > .panel-heading { text-align: justify; font-size: large; background-color: #eff7fa; } .panel-body { background-color: #e7f0f4; height