Posts

Showing posts from September, 2010

What shell command might I use to open the last alphanumeric file in a directory? -

i have log files auto generated , organized in directory such: logs/laravel-2015-07-01.log logs/laravel-2015-07-02.log logs/laravel-2015-07-03.log logs/laravel-2015-07-04.log logs/laravel-2015-07-05.log i want create shell alias prints out tail of latest log file (laravel-2015-07-05.log @ moment). alias plog="tail ___________________________" what can fill in blank select latest log file? a new log file generated each day , date string pattern should apparent. server timezone files generated not same local timezone, solution i'm looking find log file latest date (not today's date). assuming these files in directory , follow strict naming format laravel-yyyy-mm-dd then can run ( in log directory ) view last log tail ls | tail -n 1 | xargs tail this uses default alphabetical sort order of ls can adjust if outside directory run : ls -d logs/* | tail -n 1 | xargs tail

linux - Awk stop processing in case of only head row is existed in the file -

i have 1 awk process below awk 'fnr==1 && nr!=1 { while (/1name/) getline; } 1 { print } ' *.test.final | sort -t $'\t' -k1,1 > test.out this combine multiple files have extension .test.final. each files has same format below test1.test.final 1name column1 column2 test1_1 5 4 test1_2 3 2 another file test2.test.final 1name column1 column2 test2_1 2 4 test2_2 3 2 so final results below, 1name column1 column2 test1_1 5 4 test1_2 3 2 test2_1 2 4 test2_2 3 2 but times stopped processing in case there no data existed in file. like below, test3.test.final 1name column1 column2 it stop , not process anyone know why , how fix this? files tab delimited. thanks i think overcomplicating code using while , getline . just skip header of files when not first one. on rest of cases, print n

php - View/Twig best practice: retrieve sub/child records in controller or view? -

i'm building application using twig , symfony, has general *vc. when want retrieve child/sub/related records (for example subcategories of parent categories), should be: create nested array of data needed in controller , pass view/twig. retrieve sub records within view , loop through them there (initially passing in parent records). this provided sub records can retrieved single method call or access single property. in view anyway, if requires more single method call, it's getting complex view. i realize opinion based, i'm wondering if there best practices in general or twig or symfony.

php - comapring with boolean using triple equals for result set of mysql query -

this question has answer here: the 3 different equals 9 answers why using triple equals here compare ? if ($conn->query($sql) === true) { echo "new record created successfully"; } many php functions may return mixed types, unlike many other languages. if compare == , values tested. therefore non-zero value equal true, , things 123 == '123abc' true. the === operator requires types same also, object not equal true , 123 === '123' doesn't equal true.

jquery - Slick.js autoplay carousel bounces the last slide, then bounces back to the correct slide -

i using slick.js carousel autoplay configuration in .net site. on last slide, bounces previous slide second. afterwards, bounces right correct slide. preconditions: files , libraries included should according slick.js , other q&a's in site what checked: removing / altering autoplayspeed adding dots increasing / decreasing slides amount implementing in mobile site (works great) adding infinity set true (it default value anyways) removing onerror function changing "homecarousel" class name results: when autoplayspeed short(1000) - bounces front , no visible systematization markup: <div class="homecarousel"> <div> <a href="/article/qa%20article%20friendly%20name%20"> <img alt="first image main ban\dsvfner " data-alt-source="homepage/fbbg.jpg?v=0" onerror="javascript:common.imagelink.replacesourceonerror()" src="http://az742468.vo.msecnd.net/images/homepage/fbb

Arrays messed up C++ -

const int n = 5; int person[] = {2, 3, 12, 5, 19}; int big = 0; int small = 100; int i; (i = 0; <= n; i++) { cout << "person[" << << "] ate: " << person[i] << endl; //cin >> person[i]; (int j = i+1; j <= n; j++) { if (person[i] < person[j]) { int tmp = person[i]; person[i] = person[j]; person[j] = tmp; } } if (person[i]>big) big=person[i]; if (person[i]<small) small=person[i]; } cout << "person[" << << "] ate pancakes: " << big << endl; cout << "person[" << << "] ate least pancakes: " << small << endl; cout << "sorted:" << endl; (i = 0; < n; i++) { cout << "person[" << << "]: " << person[i] << endl;

c++ - Omnet Tkenv run config for multiple parameters: executing only the first value of parameter -

Image
my ini code config as: [config br54mbps1ms] description = "at 54mbps si 1ms 1250 bytes time interval" repeat = 2 sim-time-limit = 1 min **.scalar-recording = true **.vector-recording = false **.host1.udpapp[0].messagelength = 1250b **.wlan*.bitrate = 54mbps **.host1.udpapp[*].sendinterval = ${interval = 100..1200 step 100} **.vector-recording = false output-scalar-file = 54mbps/${configname}54mbps${interval}us.sca and want run given intervals 100 1200 gap of 100 (at 100, 200, 300 ... us) in omnet tkenv or gui. option read run through run configuration as: the problem that, runs 100us successfully, generates output sca file , terminates process. not able figure out reason not running next send interval. in order run combinations of sendinterval values should write * (asterisk) in run number field , select command line interface. multiple runs not possible when tcl/tk user interface selected.

java - When I use a Bound Service in Android, does it run in the background, on its own thread or on the main UI thread? -

i searching through dictionary in app, , because may takes time, , involves searching through 170,000+ items, , inserting 100 items database, etc..., trying make not hog main thread. have read conflicting things bound services. run on own thread, or have manually in service? basically, have run in background? thought whole point of bound service. appreciated! you can use asynctask class or start new thread if don't want on ui thread

windows - Configuring IIS7 Host Headers -- Redirect -

i'm having issues configuring host headers using iis 7.5 (w2008r2). the bindings/configurations follows: sitea http www.sitea.com port 80 https port 443 --- certificate used issued www.sitea.com a rewrite rule redirect attempts connect on http https. siteb http dev.sitea.com port 80 the record dev.sitea.com resolves server's ip, expected. the issue when attempt connect dev.sitea.com, redirects www.sitea.com. removing rewrite rule , https binding config sitea had no effect. i'm unsure of go here continue troubleshooting. appreciated! question, if stop www.sitea.com, dev.sitea.com come up? if not, have incorrect binding. make sure dev.sitea.com have binding set same ip address. also make sure don't have same line in web.config of dev.sitea.com redirect https://www.sitea.com

node.js - Implementation of script using javascript -

i'm want add effects when clik button using jquery.i wrote code on file named script1.js:(authentication/views/javascript/script1) $(document).ready(function() { $( ".button" ).mouseenter(function() { $(this).addclass("active"); }); $(".button").mouseleave(function() { $(this).removeclass("active"); }) }); when call script in signin.ejs using :(authentication/views) <script src="jquery/jquery-ui-1.11.4/jquery-ui.min.js"></script> <script type="text/javascript" src="javascript/script1.js"></script> the button still fixed , no effect shown. style.css:(authentication/views/style) .active { background-color:#556677; } .button { background-color:#8cc6d7; border:1px solid #5eb6dd; border-radius: 5px; width:100px; height:40px; margin-left:auto; margin-right:auto; font-family:arial; font-size:15px; } then adde

java - Storing resource files as hashmap like structure -

Image
i @ minecraft directory , found resources (image, sound, binary-data) store in way hashmap or git repository. here hashmap alike json files here actual file system. my question is, why that(benefits?), how , correct term kind of storing resource file strategies? it called b-tree. pros - constant lookup time. sorry - small lookup time. log(n) exact. olivier

java - Recursive JSON view of an entity with one-to-many relationship in REST controller -

i'm using springboot , jpa build rest interface. now, have strange json returned list of products fetched database. let's have: @entity public class product { @id @generatedvalue(strategy = generationtype.auto) private long id; @manytoone(optional = false, fetch = fetchtype.lazy) @joincolumn(name = "categoryid", nullable = false, updatable = false) private category category; ... } @entity public class category implements serializable { @id @generatedvalue(strategy = generationtype.auto) private long id; @onetomany(mappedby = "category", cascade = cascadetype.detach) @orderby("name asc") private list<product> products = collections.emptylist(); ... } the jpa repository product defined as: public interface productrepository extends jparepository<product, long> { list<product> findall(); } in controller have: @autowired private productrepository produ

javascript - External resources not reaching inside of function scope -

i'm trying make inventory picker trading website, i'm having trouble calling external resources. when calling external function, goes correctly, whenever try call external function inside of function in html, errors, saying uncaught typeerror: $(...).imagepicker not function this relevant code. <script src="~/scripts/image-picker.js"></script> <script> var name = "homeguarddev"; var inventory = []; var selecteditems = []; $.ajax({ async: false, type: 'get', url: "/home/getinventory/?username=" + name + "&page=1", success: function (data) { var parsed = json.parse(data); (var = 0; < parsed.length; i++) { var text = parsed[i].name; inventory[i] = parsed[i]; if (parsed[i].serialnumber !== "---") { text = text + " [#" + parsed[i].serialnum

dialog - How to change persistence property of cq:inplaceEditing -

Image
i wish use cq:inplaceediting modify property on jcr whenever used aem authors. unfortunately, not know how modify name of property modifies in jcr. appears modifies value of property "text" default. for purposes, want use rich-text-editing properties have names define, not default name "text." the image @ link shows tree contains cq:inplaceediting (courtesy of crxde): these attributes of cq:editconfig: these attributes of cq:inplaceediting: ...and content node of jcr looks when use inplaceeditor. i've blotted out names of properties potential security reasons. note "text" property below changed when used inplaceeditor. note want able define property name inplaceeditor changes, rather "text" property: is there way use different property name instead of "text"? -----------edit---------- after changing property "textpropertyname" property searching for, still doesn't appear modify behav

sql server - How to execute a Java task on a scheduled basis, and on demand? -

my task dump large mssql table csv file uploaded elsewhere. task needs run nightly (or on scheduled basis), , should executable on demand (from web page). csv conversion must done in java. this i've never implemented, seems common need. google research, came 2 options. have no idea if these have obvious pitfalls, or if there obvious (and superior) implementation options unaware of. use informed feedback/advice on how approach this. execute java application in web services container, apache tomcat. application run , it's business logic on whatever schedule, , tomcat make accessible web page. seems overkill, setup , maintain tomcat installation. package java program jar, , setup jenkins job (i have access jenkins server installation) execute main class on whatever schedule. , create jenkins jobs (in php or something) needed on demand executions. seems clean , easy option, there obvious pitfalls i'm missing? there many tools job, no idea how pick right one. also

powershell - Remove path from output -

using following select-string command in powershell: select-string -path e:\documents\combined0.txt -pattern "get /ccsetup\.exe" -allmatches > e:\documents\combined3.txt creates output file each line starting path , file name followed colon. example: e:\documents\combined0.txt:255:255.255.255 - - [31/dec/2014:04:15:16 -0800] "get /ccsetup.exe http/1.1" 301 451 "-" "mozilla/5.0 (compatible; searchmetricsbot; http://www.xxxx.com/en/xxxx-bot/)" how rid of output file path name, output file name , colon in results? select-string outputs object can pick off properties want. get-member command show these object members if pipe e.g.: select-string -path e:\documents\combined0.txt -pattern "get /ccsetup\.exe" -allmatches | get-member one of properties line . try way: select-string -path e:\documents\combined0.txt -pattern "get /ccsetup\.exe" -allmatches | foreach {$_.line} > e:\documents

Bridging from Objective C to Swift with PromiseKit -

using promisekit 2.0 swift 1.2, i'm trying use pmkpromise created in objective c swift. objective c code: @interface footest : nsobject + (pmkpromise *)promise; @end swift code (i've tried number of variations, none of work. 1 closest example given @ http://promisekit.org/promisekit-2.0-released/ ): footest.promise().then { (obj: anyobject?) in self.obj = obj } compiler error: cannot invoke 'then' argument list of type '((anyobject?) -> _)' this doesn't work either: footest.promise().then { (obj: anyobject?) -> anypromise in return anypromise() } similar error: "cannot invoke 'then' argument list of type '((anyobject?) -> anypromise)'" there 2 different promise classes in promisekit, 1 swift ( promise<t> ) , 1 objc ( anypromise ). swift ones generic , objective-c cannot see generic classes, why there two. if foo.promise() meant used in both objc , swift doing right thing. if int

linux kernel - Constructor time IO in a device mapper implementation -

i'm developing device mapper driver , wondering delays dues performing disk initialization in constructor context. there's fair amount of io done during initial setup - ranges of blocks clean out. from looking on dm implementations appears work done synchronously in constructor. constructor shouldn't allowed return until operation done. don't know if that's idea or whether there's way make asynchronous until init time work done. i thinking calls 'map' might deferred returning dm_io_requeue until operation completes. may seconds. i've not found docs or reference covers function set of target_type structure in dm. i've seen of dm drivers making use of of these function indirects. hints on there's details of methods or rules on can , can't done in constructor?

premake - premake5 precompiled headers not working -

(this using premake5 alpha binary available download on website) i'm trying port existing vs solution on using premake5. it uses ms style precompiled headers(stdafx.h/stdafx.cpp). when specify test project: pchheader "stdafx.h" pchsource "stdafx.cpp" it set project using precompiled headers, not setting stdafx.cpp generate precompiled headers(/yc). instead files in project trying use(/yu) , nobody generating pch. not build.. i'm guessing works somehow, black magic missing here? here entire premake5 file reference -- premake5.lua solution "cloud" configurations { "debug", "release", "final" } platforms { "win32_avx2", "win64_avx2"} location "premake" flags{"multiprocessorcompile", "extrawarnings", "fatalcompilewarnings", "fatallinkwarnings", "floatfast"} startproject "cloud" vectorexte

How to make a matrix like letter fall down animation in jquery -

i want make animation in jquery letters fall top , fade out @ bottom. not getting how it.can u tell me how use jquery animation it.thanks in advance. try this: (function(caption) { var stepx, stepy, //screen grid width , height width, height, doc, //message show message, messagelength, currentchar, getchar, messageleft, messageright, messagetop, //animation settings falltime, delay, makedelay, animationend, animationstart, ismessage = function(position) { return position >= messageleft && position < messageright; }; //create initials var init = function() { var docel, math = math, prefix = " |-moz-|-o-|-webkit-".split("|"); doc = document; docel = doc.documentelement; stepx = 10; stepy = 18; width = math.floor(docel.clientwidth / stepx); height = math.ceil(docel.clientheight

symfony - Docker permissions development environment using a host mounted volume -

i'm using docker-compose set portable development environment bunch of symfony2 applications (though nothing want specific symfony). i've decided have source files on local machine exposed data volume other dependencies in docker. way developers can edit on local file-system. everything works great, except after running app cache , log files , files created composer in /vendor directory owned root. i've read problem , possible approaches here: changing permissions of added file docker volume but can't quite quite tease out changes have make in docker-compose.yml file when symphony container starts docker-compose up files created have permissions of user on host machine. i'm posting file reference, worker php, etc. live: source: image: symfony/worker-dev volumes: - $pwd:/var/www/app mongodb: image: mongo:2.4 ports: - "27017:27017" volumes_from: - source worker: image: symfony/worker-dev ports:

java - Resize Image to defined Dimension and paint unused area red? -

Image
the following happens server side. want scale image following. the image should scaled fit in predefined dimension. image should scale fit in bounding rectangle. know how scale image java libs imagescalr. after scaling image should painted in target dimensions rect , places image not fill target rect should painted red shown in following image: how can paint image target rectangle , fill areas no image red? create bufferedimage bounding of box of desired area // 100x100 desired bounding box of scaled area // change actual area want use bufferedimage scaledarea = new bufferedimage(100, 100, bufferedimage.type_int_rgb); using bufferedimage 's graphics context, fill image desired color graphics2d g2d = scaledarea.creategraphics(); g2d.setcolor(color.red); g2d.fillrect(0, 0, 100, 100); draw scaled image image... // 100x100 desired bounding box of scaled area // change actual area want use int x = (100 - scaled.getwidth()) / 2; int y = (100 - scaled.geth

javascript - Preventing downward scroll -

i looking try , prevent downward scroll whilst allowing upward scroll possible using either css or javascript/jquery? you can use stoppropogation , preventdefault, seen here > jquery or javascript - how disable window scroll without overflow:hidden; stoppropogation stops event bubbling parents , preventdefault attempts cancel event if possible. so bind these scroll handler. $(window).scroll(function(e){ e.preventdefault(); e.stoppropogation(); });

javascript - Is it possible to reduce the memory allocated by Google Chrome for my web page? -

i trying make website minimalist feeling it, put fullscreen image on background background-image of body . have transition: background-position 1s set css rule body , easing function, create smooth scrolling effect when going other pages in same html file (i have no actual scrollbar, navigation elements). thing noticed once started scrolling, memory reserved page went small 77mb on 500mb! tested in firefox, doesn't seem happen (either because pages have no separate processes or memory allocation works differently, imagine). why happen in google chrome , not in other browsers? , how can reduce enormous amounts of memory reserved page? to give information on using: browser: google chrome ram: 8gb page uses javascript following plugins: jquery bootstrap background image dimensions are: 1440 x 540 a few possible causes of problem: the image big rendered transition , easing function. i should not use background-image this, create new <img/> background.

running gulp tasks that include shell processes synchronously -

i trying use gulp installer complex system involves creating folder, copying files around , runnin compliation scripts. presently have following gulp tasks: // tasks skipped set sessionfolder gulp.task('default', function () { // main runsequence('prepare_comedi', 'compile_comedi'); }); gulp.task('prepare_comedi', function () { // copies comedi files build folder gulp.src(['../comedi/**/*']).pipe(gulp.dest(sessionfolder)); }); gulp.task('compile_comedi', function () { var logfile=this.currenttask.name+'.log'; gutil.log(gutil.colors.green(this.currenttask.name), ": building , installing comedi, logging "+logfile); var cmd= new run.command('{ ./autogen.sh; ./configure; make; make install; depmod -a ; make dev;} > ../'+logfile+ ' 2>&1', {cwd:sessionfolder+'/comedi', verbosity:3}); cmd.exec(); }); when run gulp, becomes obvious processes s

jquery - Bootstrap Tooltip Opacity changes? -

Image
i've been adding twitter bootstrap tooltips basic survey site i've been creating learn backbone. all of tooltips correct except tooltip added branching button. here's how bad 1 looks: here's how of others look: it's has opacity of .8 while others 1. i'm not changing how i'm adding them i'm perplexed what's going on. i found different so recommends doing: .tooltip.in { opacity: 1; filter: alpha(opacity=100); } but doesn't seem work. here's how i'm adding tooltip: <div id="arrow-up"><i class="fa fa-arrow-up" title="you can rearrange order questions appear in using arrows next each question." data-toggle="tooltip" data-placement="left"></i> </div> another version ? : <input type="checkbox" id="imagequestion" class="image-question" checked> <label for="imagequestion">add image questi

javascript - Dynamically setting multiSelect for combobox in extJS -

i kinda facing interesting problem combobox's multiselect property. i have grid 3 columns id, name, associated part. i have enabled rowediting plugin , editors id textfield(editid), name textfield(editname) , associated part combobox(editpartcombo multiselect true). i have 2 buttons add , update. when select row in grid , press update, rowediting starts @ exact position. in update button code, setting multiselect property of editpartcombo false somehow not reflecting. code on update button: { text: 'update press', handler: function(btn){ var grid = btn.up('grid'); var selection = grid.getselectionmodel().getselection(); if(selection.length > 0){ combo = ext.getcmp('editpartcombo'); combo.multiselect = false; delete combo.picker; combo.createpicker(); combo.reset(); var rowediting = grid.getplugin('roweditplugin'); var rowno = grid.store.indexof(selection[0]); rowediting.canceledit(); rowediting.startedit(rowno, 1); } else

unicode - Converting domain names to idn in python -

i have long list of domain names need generate reports on. list contains idn domains, , although know how convert them in python on command line: >>> domain = u"pfarmerü.com" >>> domain u'pfarmer\xfc.com' >>> domain.encode("idna") 'xn--pfarmer-t2a.com' >>> i'm struggling work small script reading data text file. #!/usr/bin/python import sys infile = open(sys.argv[1]) line in infile: print line, domain = unicode(line.strip()) print type(domain) print "idn:", domain.encode("idna") print i following output: $ ./idn.py ./test pfarmer.com <type 'unicode'> idn: pfarmer.com pfarmerü.com traceback (most recent call last): file "./idn.py", line 9, in <module> domain = unicode(line.strip()) unicodedecodeerror: 'ascii' codec can't decode byte 0xfc in position 7: ordinal not in range(128) i have tried: #!/usr/bin

php - How to get all the selected options in a drop down list with JavaScript? -

i have drop down list, , user can select multi options. so part of code in firtfile.inc <div class="col-md-8"> <!-- change report heading can grab on report page --> <select name="searchin[]" multiple="multiple" onchange="javascript:this.form.heading.value=this.options[this.selectedindex].text;" required="required" title="section"> <option value="" disabled selected>select</option> <?php //loop on options for($i=0;$i<sizeof($searchcriteria);$i++){ ?> <option value="<?php echo $searchcriteria[$i]['value'];?>"<?php if($searchcriteria[$i]['value']=='facultyname'){echo ' selected="selected"';}?>> <?php echo $searchcriteria[$i]['display'];?> </option> <?php }/

C# WCF Client Binding Interop Blackboard Java WS-Security over HTTPS Transport -

i having trouble getting wcf binding work blackboard java web services api. (simple answer if has got working please post working binding wcf blackboard) i have spent hours trying different configurations , custom coded bindings. some unsuccessful attempts: calling-a-ws-security-java-web-service-with-c-sharp-client wcf-client-with-ws-security 12-common-wcf-interop-confusions configure-wcf-for-ws-security-with-username-over-https wcf-client-connecting-to-java-soap-web-service-using-ws-security clearusernamebinding there many more java , ws-security wcf wont go on. it seems every time 1 thing working breaks. feel going around in circles , making myself more confused. as first test trying simple initialize context object , login using admin test user account wcf proxy. blackboard doc contextws to make sure of worked first downloaded sample code .net wse 2.0 , tested that, worked perfectly. now when use wcf , binding cannot same beh

dllimport - SendKeys with C# PostMessage - Underscore -

i'm trying send underscore postmessage best can -, can here cannot find answer anywhere. i send string character loop gets each 1 , uses postmessage send key, works fine cannot figure out _. public bool sendkeys(string message) { var success = false; uint wparam = 0 << 29 | 0; foreach (var child in getchildwindows(window.windowhandle)) { var sb = new stringbuilder(100); getclassname(child, sb, sb.capacity); //(intptr)keys.h if (sb.tostring() != window.targetwindow) continue; foreach (var c in message) { var k = convertfromstring(c.tostring()); if (string.equals(c.tostring(), c.tostring().toupper(), stringcomparison.ordinal)) { postmessage(child, wm_char, (intptr) k, (intptr) wparam); } else { postmessage(child, wm_keydown, (intp

How to make a string of an string array in php? -

Image
i facing following issue. there array contaning several strings. we'd append eachother together. implode function seems solution. here detailed data in array: 0 -----begin encrypted private key-----\n 1 miicxjbabgkqhkig9w0bbq0wmzabbgkqhkig9w0bbqwwdgqir9as3yoyqiscagga\n 2 mbqgccqgsib3dqmhbajr2e4ed62llqscaodorzp66bntaznbhoyrrzpoyoxhbug4\n 3 ah/505qbwe+slgsnp1gys+mgrbmc6ocv6o+gubmzx/ovhhzee08cqi/a5v4ndyns\n 4 i+v8c9nydepyvsppqhswyea8zqerqbpkzupg2pcrcsmixc0hfuk+2z8q1c6rtmnq\n 5 jyqk7jpo+nnug+xeeetwt02g9vypo2f8nkcqq3oskdxmugyzbirfmmf9cyb5rub2\n 6 qcwgbi1bb+28eozev8sabogfof7svc1o4iy/n0e/qpl67upumdjei5pfdkoqpmyq\n 7 g9wbehpmr/xtqcyhhilfwi5a8bpgb/iounxuryurvg6eiu/ujpyjagod7lhzkvb5\n 8 n8sya94mbdt21oprjov8zcgnd4l9wcy9fk3kkwoxm1ofw4y+lxrcibkzy2dzf5uc\n 9 8kicm/25jbucvkfvuea8siazj7v9budnwaspqfae/xmmoj5rgzxelen/a28je+vz\n 10 mfmia2ndtsbxfxdtdxnrchag2c35wau/hxlo427cci1corydtunnpeumsgiy6cmw\n 11 tcg4mycapdfnsiwgvwpsj/hyeoicdr/q7+apu32dc4jf6/r6gv

data attribute to javascript array -

in code have several markup items so: <div class="sli1" data-values="10, 20, 30, 40,50, 60, 70" <div class="sli2" data-values="20, 40,60, 80,100, 120, 500" what have @ moment simple: sli1 = $('#sli1').attr('data-values') how can improve angular models, can access model via either controller or view? edit abit more code: in view have: <div class="sli1" data-values="... the values embedded via server right view, rather controller. in controller declare models on js vars: $scope.new['test1'] = sli1; $scope.new['test2'] = sli2; that can declare points like: $scope.new['test1'][0] $scope.new['test1'][1]; $scope.new['test1'][2]; $scope.new['test1'][3]; $scope.new['test1'][4]; to array index values, wondering if can better angular directly rather rely on js vars. you can set values ng-model , access them controlle