Posts

Showing posts from June, 2013

google analytics - EXCEL Filter Columns - Containing Numbers Greater Than X -

so here's example of data in 1 of columns /festivals/upcoming /win/competitions/572 /latest/reviews/14940 --- 1 shown /latest/news/15521 /download-festival-2014/lineup is possible filter column 3rd 1 down (as commented) shown. need take last string after last forward slash, check if it's number, if number , if it's less 14650, keep it i exported excel google analytics if it's easier there, good! thanks if data in a1 this, , drag down: =if(iferror(value(trim(clean(trim(left(right(substitute($a1,"/",rept(" ",99)),(2-column(a1))*99),99))))),"")>14650,iferror(value(trim(clean(trim(left(right(substitute($a1,"/",rept(" ",99)),(2-column(a1))*99),99))))),""),"")

javascript - Array in Node.js, how to work with it -

i'm newbye in web programming , more in javascript, i'm trying learn learn node.js, , found strange error... i've got code: var structobject = function(type, title, isreplicable, isvisible) { this._type = type; this._title = title; this._childelements = new array(); this._isreplicable = isreplicable; this._id = 0; //todo }; structobject.prototype.addchild = function (element) { structobject._childelements.push(element); }; structobject.prototype.stringify = function () { console.log("main element: "+this._title); (var i=0;i<this._childelements.length;i++) { console.log("child "+i+": "+this._childelements[i]._title); } }; structo1 = new structobject(1, "element1", true, true); structo1.addchild(new structobject(2, "element2", true, true)); structo1.stringify(); i've got problem here... may see, _childelements intended array, , i've got function addchild shou

javascript - how to disable a send button if fields empty bootstrap -

i using bootstrap make webpage. have simple code 1 input , 1 button. when press button, contains input stored in database. if input empty saves database. can validation javascript want know if bootstrap have option validate this. example forms in bootstrap validate it, dont want use form. <div class="row"> <div class="col-md-4 col-md-offset-1"> <div class="input-group input-group-lg"> <span class="input-group-addon"><span class="glyphicon glyphicon-fire"></span> </span> <input type="text" class="form-control" placeholder="nombre marca" id="marca" required> </div> </div> </div> <div class="row"> <br /> <div class="col-md-3 col-md-offset-1" align="center" onclick="guardar_marca()"> <a href="#" class="btn btn-pr

swing - How to make a thread not freeze you whole JFrame. JAVA -

hey need question answered... how make following code not freeze whole jframe? try { thread.sleep(integer.parseint(delayfield.gettext()) * 1000); system.out.println("hello!"); } catch(interruptedexception ex) { thread.currentthread().interrupt(); } use different thread perform task. if in main ui thread freeze.. example can following new thread() { @override public void run() { try { thread.sleep(integer.parseint(delayfield.gettext()) * 1000); system.out.println("hello!"); } catch (interruptedexception ex) { thread.currentthread().interrupt(); } } }.start(); update after wise suggestions of robin , marko updating answer better solution. actionlistener taskperformer = new actionlistener() { public void actionperformed(actionevent ev

How to pull data moving backwards in a java ArrayList -

i trying make can write data arraylist track random integers , have previous button go last result (this testing code not full code project) getting error when trying take int arraysize , subtract 1 , reprint data. idea why happening or how way accomplish task. int lenth = 10; arraylist<integer> list = new arraylist<integer>(); int arraysize = list.size(); random random = new random(); int newrandom = random.nextint(lenth); list.add(newrandom); newrandom = random.nextint(lenth); list.add(newrandom); system.out.println(list.get(arraysize)); arraysize--; system.out.println(list.get(arraysize)); also here error getting: exception in thread "main" java.lang.arrayindexoutofboundsexception: -1 @ java.util.arraylist.elementdata(unknown source) @ java.util.arraylist.get(unknown source) @ test.c_mainactivity.main(c_mainactivity.java:22) when assign 1 primitive (such int ) another, copies value new variable. objects, works bit differently in these variab

VisitorID in BigQuery doesn't match Sessions Google Analytics -

i've looked around web , keep getting same answer: count sessions in bigquery, take count(distinct concat(fullvisitorid, string(visitid))) . in cases, that's not getting me close sessions in google analytics. there other way count sessions better? here's i'm trying do: select hits.customdimensions.value val, count(*) pageviews, exact_count_distinct(concat([fullvisitorid], string([visitid]))) sessions [xxx.ga_sessions_20150619] hits.customdimensions.index = 7 , lower(hits.type) = 'page' group val order pageviews desc limit 1000 for custom dimension values, gets close ga, others off twice amount. there way better session count in bq? well, can't speak ga data (of course, check make sure you're not sampling data @ all), if run following query, you'll pull sum of each of session counts per fullvisitorid: select sum(sessionsperuser) (select fullvisitorid, count(visitnumber) sessionsperuser [xxx.ga_sessions_2017yyzz] group ful

email - Configure SMTP host from php.ini -

i'm trying configure swiftmailer's smtp transport looking @ php.ini. i've tried creating compilerpass alter mailer_host parameter, changed value doesn't seem influence container gets built. on second attempt, tried requesting service definition swiftmailer.mailer.default.transport."something", can't seem find correct service either. any pointers? thanks ok, found out can alter configuration of other bundles using prependextensioninterface. after implementing interface in own extension, this: public function prepend(containerbuilder $container) { $container->prependextensionconfig( 'swiftmailer', array ('host' => ini_get('smtp')) ); } i'm aware there better solutions this. instance, placing swiftmailer configuration in server-wide .yml file , including that. offer more flexibility etc., now, fine.

Error 3001 vba Excel Macros MySQL Insert -

im trying insert row in mysql db using excel macros. connection appears working ok vba 3001 error (microsoft visual basic 3001 arguments of wrong type, or out of acceptable range, or in conflict 1 another) when y execute code: dim rs adodb.recordset set rs = new adodb.recordset connectdb 'strsql = "insert talar.ots (ubicaciontecnica, equipo, posmant) values ('sdasd', 'sdasd','sdasd')" rs.open strsql, oconn, adopendynamic, adlockoptimistic i allready read , try different things 50 tutorials , other posts in page, bad results.... this code of connection: private sub connectdb() dim oconn adodb.connection set oconn = new adodb.connection oconn.open "driver={mysql odbc 5.2 unicode driver};" & _ "server=localhost;" & _ "database=talar;" & _ "user=root;" & _ "password=root;" & _ "

javascript - To Add Title to Anchor tag using Jquery from Resource file -

i want add title attribute anchor tag (from resource file) getting generated below mentioned code. var hyperlinkopen = divtitlebar.children('a'); hyperlinkopen.removeclass("ui-dialog-titlebar-open ui-corner-all"); hyperlinkopen.addclass("ui-dialog-help-layer-titlebar-open"); title should title="open" . how can add title anchor tag? use jquery .attr() set attribute. yours divtitlebar.children('a').removeclass("ui-dialog-titlebar-open ui-corner-all").addclass("ui-dialog-help-layer-titlebar-open").attr('title','open');

mongodb - Example of odm:query console command in Doctrine Mongo ODM -

is there exemple of query command of console tools in doctrine ? tried in symfony project following way : ./app/console doc:mongo:query acmebundle:myentity {tag:1} but returns whole collection, tough 1 record has tag "1". looked in source code, seems query must in json format have no idea right format, guess must compatible argument of find() method json format expects key string. try {"tag": 1}.

javascript - How to get placement coordinates of an absolutely positioned element relative to another? -

i can't seem find on github here go: suppose have dom element parent contains position: relative , element child contains position: absolute , child of parent, how can go getting coordinates [top, left] child element [relative parent] given placement string? (i.e. "top left", "top middle", "bottom right", , forth... ?) ideally, this: var coordinates = getrelativecoordinates({ el: child // child element contains "position: absolute" relativetoel: parent // parent container contains "position: relative" placement: "top left" // "top left" || "top middle" || "top right" || "right top" || etc... }); console.log(coordinates); >> {top: "-100px", left: "0px"} "when position set absolute, element removed normal document flow—that is, no longer takes space , may overlap other elements. also, top , left p

java - A functional interface that extends other can't - can't assign constructor reference to it - Is it compiler bug? -

in simple code below can see 'factory' interfaces, different between them factory0bad extends supplier : @functionalinterface public static interface factory0bad<t> extends supplier<t> { t get(); } @functionalinterface public static interface factory0good<t> { t get(); } public static class handler {} public static class handlera extends handler {} public static void main(string[] args) { // line compiles factory0good<? extends handler> = handlera::new; // not! factory0bad<? extends handler> bad = handlera::new; } so line factory0good<? extends handler> = handlera::new; is accepted compiler (1.8.0u05), line factory0bad<? extends handler> bad = handlera::new; is not. why this? missing here? bug in javac? // not! // 1.8.0_05 - fails // 1.8.0_40 - succeeds // 1.8.0_45 - succeeds factory0bad<? extends handler> bad = handlera::new;

Inno Setup : How to change language file depending on code -

i use own languages files (.isl) instead of using default languages files of inno setup. permits me customize messages. now, have 2 versions of each language files, 1 in case of first installation , 1 in case of update, but, possible choose file code? if yes, how it? maybe there better way changing messages change languages files depending on type of installation, if yes, know do. thanks add alternative texts [custom messages] section: http://www.jrsoftware.org/ishelp/index.php?topic=custommessagessection then in pascal script, when upgrading, update respective gui element alternative translation loaded using custommessage('myalternativeupgradestring') http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_custommessage

jsf 2 - Initializing primefaces datatable rowkey -

i have primefaces datatable i'm populating properties of objects in arraylist once user clicks search button. need add column radio button user can select row of table update. i'd set rowkey metadatakey property of objects, following error: rowkey="#{result.metadatakey}": property 'metadatakey' not found on type java.lang.string i believed caused metadatakey not existing @ time table rendered. remedy it, set table render after user had completed search, resulted in same error. here relevant html: <h:form id="dataform"> <p:panel styleclass="centered"> <p:messages id="message" showdetails="true" autoupdate="true" /> <p:outputlabel id="searchlabel" value="search metadata: " />&nbsp;&nbsp;&nbsp; <p:inputtext id="search" value="#{updatemetadataitemsbean.searchterm}" />

JSch CheckKexes makes SFTP transfer VERY SLOW -

i using jsch 0.1.52 api sftp transfers. slow running on unix (aix) machine. checked log , consistently see "checkkexes" takes 15 - 35 seconds. haven't found in jsch documentation explaining how possibly set configuration parameter suppress check, or change setting somehow. is there can done speed up?

anova - Centering Variables in R -

do centered variables have stay in matrix form when using them in regression equation? i have centered few variables using scale function center=t , scale=f . converted variables numeric variable, can manipulate data frame other purposes. however, when run anova, different f values, variable, else same. edit: what's difference between these two: scale(df$a, center=true, scale=false) which embed matrix within data.frame and scale(df$a, center=true, scale=false) df$a = as.numeric(df$a) which makes variable numeric, , removes matrix notation within variable? example of trying do, example doesn't cause problem having: library(car) library(mass) mtcars$wt_c <- scale(mtcars$wt, center=true, scale=false) mtcars$gear <- as.factor(mtcars$gear) mtcars1 <- as.data.frame(mtcars) # part 1 rlm.mpg <- rlm(mpg~wt_c+gear+wt_c*gear, data=mtcars1) anova.mpg <- anova(rlm.mpg, type="iii") # part 2 # make wt_c numeric mtcars1$wt_c <- as.n

List - > details flow. Best practices Android -

i wondering, best practices or preferred way handle list , details flow in android. example: a) have fragment list of items. b) when user select item, show item details in screen (activity or fragment, question purpose doesn't matter). all data stored database, using content provider. question: should item id in fragment a, pass screen b , select entire data using cursor loader in screen b public void onitemclick(adapterview<?> parent, view view, int position, long id) { // launch intent id param. } or select entire data in fragment , pass screen b? public void onitemclick(adapterview<?> parent, view view, int position, long id) { // todo selected item. parking parking = (parking) parent.getadapter().getitem(position); // launch intent parking extra. } best practices?

CouchDB bulk update won't create document if needed -

i optimizing script wrote last year reads documents source couch db, modified doc , writes new doc destination couch db. so previous version of script did following 1.read document source db 2.modify document 3.writes doc destination db what i'm trying pile docs write in list , write bulk of (let's 100) destination db optimize perfomances. what found out when bulk upload has write list of docs destination db if there doc in list has "_id" not exist destination db, document won't written. the return value have "success: true" if after copy happened there no such doc in destination db. i tried disabling "delayed_commits" , using flag "all_or_nothing" nothing has changed. cannot find info on stackoverflow / documentation i'm quite lost. thanks to future generations: experiencing known bug , should fixed in next release. https://issues.apache.org/jira/browse/couchdb-1415 the actual workaround write documen

Google Analytics and Android Applications -

so yesterday application update rejected because of violation of ad policy. suspect because added new function that, when application loaded first time, created unique id installation. sent id out requests data server, in order track usage device. morning removed code, submitted new update , accepted. track how application being used device every day, looking @ google analytics. i managed plumb in, , working, need know few things first. do need have opt out option? do need have proper privacy policy? has else implmented apps? for have use google analytics. you device people use , can differentiate devices , android versions , countries , regions etc. it helpful identify , strategic analysis of application. i suggest google anlaytics best option , not violate google play store policy.

angularjs - Why can't i use the $http service in a route resolve? -

i want make views show after initial data fetched , trying accomplish route resolve, can't work. doing wrong? angular skills bit shabby aplogize in advance if question dumb. application.js : var application = angular.module('reporterapplication', ['ngroute']); application.config(['$routeprovider', '$interpolateprovider', function($routeprovider, $interpolateprovider) { $interpolateprovider.startsymbol('<%'); $interpolateprovider.endsymbol('%>'); $routeprovider .when('/packing/scan.html', { templateurl: 'packing/scan.html', controller: 'packingscancontroller', resolve: { initdata : application.packingscaninit() } }) .when('/packing/stats.html', { templateurl: 'packing/stats.html', controller: 'pa

How can I adjust the ACL of existing posts on Parse.com -

i have 4.5k posts in parse.com application. of them have read access want adjust these records have read/write or add role read/write access. the roles part not clear me. how can create subscriber role example , attach users this. do have in cloud code parse.com ? for _user class, default acl read public , written user particularly. other classes created, default setting public read/write. have understand before heading role. for case, need write simple script in order modify acl individually. role similar acl. because every single objects has acl , it's difficult modify them 1 one. role created grouping users have common access privileges parse.com data. following story telling parse.com great: for example, in application curated content, may have number of users considered "moderators" , can modify , delete content created other users. may have set of users "administrators" , allowed of same privileges moderators, can modi

javascript - Wrap function Jquery for multiple elements -

i've function in jquery function row_content(col1, col2) { var divs = col1 + col2; for(var n = 0; n < divs.length; n+=2){ divs.slice(n, n+2).wrapall('<div class="row-content"></div>'); } } var col_2_3 = $('.col_2_3'); var col_1_3 = $('.col_1_3'); row_content(col_2_3, col_1_3); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div class='col_2_3'>test</div> <div class='col_1_3'>test</div> <div class='col_2_3'>test</div> <div class='col_1_3'>test</div> i want, function wrap 2 divs in .row-content not work. thanks ! the problem var divs = col1 + col2; where col1,col2 jquery objects. above line concatenates inputs , does not combine selectors. length wont work wish to. use jquery .add() var divs = col1.add(col2); http://j

job scheduling - If I use both @PostConstruct and @Scheduled on a bean method what will be the consequences -

@scheduled(fixeddelay=10000) @postconstruct public void somemethod(){ //my refresh cache code here } if use both @postconstruct , @scheduled on bean method consequences. method executed twice? 1 after other of may @ same time ?

php - Cant Access a "error" folder in subdomain.localhost/error/ -

i trying put of error documents 1 folder in website root. ideally of error documents go http://subdomain.localhost/error/ whenever load url in browser message access forbidden! error 403 . i removed .htaccess file document root. content of .htaccess file is: errordocument 403 /err_docs/401 errordocument 401 /err_docs/401 errordocument 404 /err_docs/404 errordocument 500 /err_docs/500 indexignore * # prevent directory listing order deny,allow allow * /err_docs/ current folder error documents - (because /error doesn't work). upon inspecting apache error log find: [thu jun 25 13:46:57.445385 2015] [autoindex:error] [pid 5104:tid 1760] [client 127.0.0.1:51853] ah01276: cannot serve directory c:/xampp/apache/error/: no matching directoryindex (index.php,index.pl,index.cgi,index.asp,index.shtml,index.html,index.htm,default.php,default.pl,default.cgi,default.asp,default.shtml,default.html,default.htm,home.php,home.pl,home.cgi,home.asp,home.shtml,home.html,home.htm) f

php - Error 500 with Slim on "subfolder" -

i have index.php file in /api folder on server. , i'm beginning slim , i'm trying make rest api. so in index.php i've got this: $app->get('/', function() use ($db) { echo "get"; }); $app->post('/', function() use ($db) { echo "post"; }); $app->get('/test', function() use ($db) { echo "test"; }); and in .htaccess file, downloaded: rewriteengine on # hosts may require use `rewritebase` directive. # if need use `rewritebase` directive, should # absolute physical path directory contains htaccess file. # # rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [qsa,l] if make call ../api/ i've got "get", post call works fine too, if make .../api/test call i've got 500 internal server error. what doing wrong? thank you!

svn - keeping local changes in git -

i know seems have multiple duplicates there no real solution mentioned anywhere. let's put real world example: for testing, i've load model in application 25 times day. i'm getting messagebox model isn't created newest version of our software every time load it. know in local copy outcomment check faster testing. of course don't want push change, keep locally on next few months or while updating , adding new functionality project every day. want same thing different files in different situations, process should easy , fast. i've read stashing, far it, means: stash (means save) changes bring working copy state differs in want push commit , push changes restore working copy previous state reloading stashed changes (stash pop) this process has done every time commit or update. hmmm... mean, serious? in svn commit (means push) want commit , leave other things alone. finished. if update working copy changed file merged of course. if there sh

ios - Swift's ".sort" works on Simulator but not on iPhone -

i have odd problem code have written works fine on iphone simulator not working correctly on phone itself. basically performing sort on array of objects. sort performed on member of type nsstring. here class definition: class event: nsobject { var act: nsstring! var start: nsdate! var end: nsdate! } here definition of class use wrap collection of event objects. class events: nsobject { var events = [event]() func add(event: event){ events.append(event) } } i need sort array in alphabetic order of act. here how doing that: var result = allevents.values.array [event] sort(&result){$0.act < $1.act string} the problem is: works in simulator when run on iphone result array in order of initial insertion. i have tried: result.sort({$0.act < $1.act string}) but same unsorted result. any clues doing wrong? try in events , call when want sort array if does't work make act string! instead of nsstring! swift 1.2

java - Lambda/default methods/type erasure quirk/bug using ECJ? -

came accross today , spent ages trying reproduce/figure out happening. can explain why happens or bug type erasure/default methods/lambda's/polymorphism? uncommenting default method makes run fine, have expected work is output: works fine object calling consume hello calling accept context hello calling accept via consumer... exception in thread "main" java.lang.abstractmethoderror: method test/lambdatest$$lambda$1.accept(ljava/lang/object;)v abstract @ test.lambdatest$$lambda$1/834600351.accept(unknown source) @ test.lambdatest.main(lambdatest.java:24) code package test; import java.util.function.consumer; public class lambdatest { public static void main(string[] args) { consumer<context> contextignoringobject = new contextunawareobject(); contextignoringobject.accept(new context()); contextignorer contextignoringlambda = () -> { system.err.println("hello"); }; system.err

javascript - Fullcalendar: duplicate entry on dropping (external) -

i using while adding events fullcalendar external drag , drop, item doesn't id modify dropped element (title, id , date) , callback in drop function of fullcalendar var url = "json-save-urlaub.php?event="+date.format()+"&allday="+date.hastime(); $.post( url, function(data){ //callback function retrieving response sent controller/action //event object rendered calendar var event = jquery.parsejson(data); //actually rendering new event calendar $('#calendar').fullcalendar('renderevent', event, true); //$('#calendar').fullcalendar('refetchevents'); $('#calendar').fullcalendar('unselect'); } ); however have 2 entries when drop e

ibm mobilefirst - Can't find WebSphere Integrated Solutions Console -

i installed mobilefirst server 6.3 production on windows. aplication server i'm using websphere application server liberty profile. can not find websphere integrated solutions console. console exist liberty profile? mobilefirst not related @ here. it's web app deployed application server. unlike websphere full profile, webshere liberty profile not come ui console.

c# - Error validating exception when using System.Reflection -

we're developing sharepoint webpart sandboxed solution in visual studio 2013 sharepoint online. use external dll library itextsharp reading , writing pdf. having problem when activating our solution. our error message is: error validating assembly itextsharp.dll . this solution references prohibited type system.reflection.bindingflags , cannot used on site collection. you've answered question already: this solution references prohibited type system.reflection.bindingflags , cannot used on site collection. you can't use system.reflection namespace sharepoint online solutions (for part). allowed members system.reflection are: getvalue name getcustomattributes propertytype getvalue setvalue i recommend taking @ microsoft's documentation developing sharepoint online solutions ( link ) there quite few namespaces available sharepoint development prohibited. here's microsoft has this: because multi-tenant environment,

hadoop - Error while creating Hive/Hbase Table -

failed create hive table. here log 0: jdbc:hive2://localhost:10000> create table hbase_table_1(key int, value string) 0: jdbc:hive2://localhost:10000> stored 'org.apache.hadoop.hive.hbase.hbasestoragehandler' 0: jdbc:hive2://localhost:10000> serdeproperties ("hbase.columns.mapping" = ":key,cf1:val") 0: jdbc:hive2://localhost:10000> tblproperties ("hbase.table.name" = "xyz"); ... error: error while processing statement: failed: execution error, return code 1 org.apache.hadoop.hive.ql.exec.ddltask. metaexception(message:java.io.ioexception: attempt start meta tracker failed. @ org.apache.hadoop.hbase.catalog.catalogtracker.start(catalogtracker.java:204) @ org.apache.hadoop.hbase.client.hbaseadmin.startcatalogtracker(hbaseadmin.java:262) @ org.apache.hadoop.hbase.client.hbaseadmin.getcatalogtracker(hbaseadmin.java:235) @ org.apache.hadoop.hbase.client.hbaseadmin.tableexists(hbaseadmin.java:306) @ org.apache.hadoop.

javascript - Send multiple flash messages or context for form validation -

i have passport set-up , validating input in sign-up process. 1 of validation items is: if (!validateemail(email)) { console.log('invalid email address') return done(null, false, req.flash('message', 'invalid email address')) } i'd deliver attempted email template , load input. best way can think of doing flash message, try fails work. any way format multiple flash-messages drops flash session: { cookie: { path: '/', _expires: null, originalmaxage: null, httponly: true }, passport: {}, flash: {} } please help!

javascript - open a new window form action method in MVC -

i trying open url javascript function. the issue not able authorize url mentioned in image. how can load page action method can authorize url. here javascript method. <img src="~/images/question_frame.png" style="margin-top:3px;height:18px;width:20px;" onclick="window.open('../help/nmc/enu/default.htm', 'nmchelp', 'toolbar=no, scrollbars=yes, resizable=yes, top=50, left=50, width=750, height=600');"/> how can achieve this? how window.open(.../help/nmc/enu/default.htm) opened action method in new window when tried open window out authorized redirected login page. you're displaying static html file, bypass mvc entirely. the easiest create authorized action method , link instead. in action method, return contents of html file. see render html file in asp.net mvc view? .

ios - How to send all traffic over a VPN connection? -

i creating application connect vpn server. i have worked out how this, need able send traffic on connection. is there code can this? so far have tried: let manager: nevpnmanager = nevpnmanager.sharedmanager() var p = nevpnprotocolipsec() manager.`protocol` = p let pw = "" println(manager.connection.status) p.username = "" p.passwordreference = pw.datausingencoding(nsutf8stringencoding) p.serveraddress = "" p.authenticationmethod = nevpnikeauthenticationmethod.sharedsecret //p.sharedsecretreference = getpasscodensdata("vpnsharedsecret") p.useextendedauthentication = true p.disconnectonsleep = false no, don't think there way switch system ip traffic on vpn connection. apple doesn't let apps muck around os that.

angularjs - Angular js:Dynamic values as string in ng-model within ng-repeat -

i generating form dynamically in application. fields of forms column names in database table.the user of application pass name of table , skeleton crud application prepared dynamically. in view part want achieve this <div class="form-group" ng-repeat="(key,col) in cols"> <label for="{{::col}}">{{::col | uppercase | replaceunderscore}}</label> <input class="form-control" type="text" ng-model="{{::col}}" required /> </div> in ng-model need string value is, if column name username model value should ng-model="username" , value should not displayed in form field. want achieve kind of 1 way data binding. simply use js object, example $scope.data = {} , , ng-model="data[col]" .

matlab - insert textbox in a geoshow plot -

i using code below geoshow plot: figure1 = figure; load coast; axes1 = axes('parent',figure1,'fontsize',12,'dataaspectratio',[1 1 1],'clim',[0 4000]); box(axes1,'on'); grid(axes1,'on'); geoshow(lat, long,'color', 'black'); geoshow(latpr, longpr,'color', 'blue'); geoshow(lat_receiver,lon_receiver,'displaytype','point','marker','.','markersize', 30,'markeredgecolor', 'green'); latpr, longpr set of data of path want show. want insert text in plot lat, long of starting point (latpr(1,1), longpr(1,1)) , of last point (latpr(end,1),longpr(end,1)) . how insert text? there textm function can used project text annotations on map axes. something should work: textm(latpr(1,1), longpr(1,1),'your string'); and likewise: textm(latpr(end,1), longpr(end,1),'your string');

javascript - Openlayers 3 - Issue using a polygon as a background -

i developing solution uses openlayers 3 display static images of text documents have been converted pdfs. of documents black text on white background - page i'm displaying openlayers on black, map background - document invisible. my current solution draw white filled polygon @ same extent image being loaded behind text - providing white background extent i'm interested in. the problem when pan around, polygon redrawing, causing undesirable effects. see jsfiddle example. is there alternative way of setting background colour of layer or there setting prevent polygon flickering. css body{ background-color:black; } html <div id="map" class="map"></div> javascript var imgurl = 'http://i.stack.imgur.com/9c8xu.png'; var extent = [0,0,488,198]; var projection = new ol.proj.projection({ units: 'pixels', extent: extent }); //a polygon represent white background var polyfeature = new ol.feature({ geomet

wordpress insert and update query not working -

i trying insert , update data not seems work in wordpress . database exist , when try insert manually works . global $wpdb; $db=$wpdb->prefix.'arete_woocommerce_sms_panel_settings'; $data = $wpdb->get_results ("select * {$db}"); if (!empty( $data )) { $wpdb->update("{$db}",array('type'=>"sms_provider_url",'value'=>$sms_provider_url),array('%s','%s')); $wpdb->update("{$db}",array('type'=>"sms_provider_username_with_param",'value'=>$username),array('%s','%s')); $wpdb->update("{$db}",array('type'=>"sms_provider_password_with_param",'value'=>$password),array('%s','%s')); $wpdb->update("{$db}",array('type'=>"sms_provider_key_with_param",'value

excel - How to Login to website using macro and fetch whole data html table -

i want make macro fetcher first login website fetch html table data. had fetched html table data website doesn't have login page got first page data in excel sheet. need pages data of table first login webpage. here code html table data website. sub macro1() ' ' macro1 macro ' activesheet.querytables.add(connection:= _ "url;https://datatables.net/examples/basic_init/alt_pagination.html" _ , destination:=range("$a$1")) .name = "alt_pagination.html" .fieldnames = true .rownumbers = false .filladjacentformulas = false .preserveformatting = true .refreshonfileopen = false .backgroundquery = true .refreshstyle = xlinsertdeletecells .savepassword = false .savedata = true .adjustcolumnwidth = true .refreshperiod = 0 .webselectiontype = xlselectedtables .webformatting = xlwebformattingnone .webpreformatte

java - Jrebel - ERROR org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] no such class: classCache -

while starting spring mvc project configured jrebel on jetty server, i'm getting stack trace exception error org.zeroturnaround.bundled.javassist.cannotcompileexception: [source error] no such class: classcache message. if server starts , jrebel working fine annoying error message displayed on server startup. [artifact:mvn] 2015-06-25 16:17:21 jrebel: error org.zeroturnaround.bundled.javassist.cannotcompileexception: [source error] no such class: classcache [artifact:mvn] @ org.zeroturnaround.bundled.javassist.ctnewmethod.make(jrebel:79) [artifact:mvn] @ org.zeroturnaround.bundled.javassist.ctnewmethod.make(jrebel:45) [artifact:mvn] @ org.zeroturnaround.javarebel.integration.spring.beans.cbp.cachedintrospectionresultscbp.process(cachedintrospectionresultscbp.java:35) [artifact:mvn] @ org.zeroturnaround.javarebel.integration.support.javassistclassbytecodeprocessor.process(jrebel:70) [artifact:mvn] @ com.zeroturnaround.javarebel.xu.a(jrebel:257) [artifact:mvn] @ com.zero

oracle - Rewrite If-else block using For loop -

how can write following if-else block using loop: begin if :new.plan_id = 1 select plan_max_start_hh24 new_plan_max_start_hh24 screening_plan plan_id = 1; select plan_min_start_hh24 new_plan_min_start_hh24 screening_plan plan_id = 1; elsif :new.plan_id = 2 select plan_max_start_hh24 new_plan_max_start_hh24 screening_plan plan_id = 2; select plan_min_start_hh24 new_plan_min_start_hh24 screening_plan plan_id = 2; elsif :new.plan_id = 3 select plan_max_start_hh24 new_plan_max_start_hh24 screening_plan plan_id = 3; select plan_min_start_hh24 new_plan_min_start_hh24 screening_plan plan_id = 3; elsif :new.plan_id = 4 select plan_max_start_hh24 new_plan_max_start_hh24 screening_plan plan_id = 4; select plan_min_start_hh24 new_plan_min_start_hh24 screening_plan plan_id = 4; end if; end; for plan_id values 1,2,3,4 , have select plan_max_start_hh24 , pla

javascript - Protractor and promises -

a lot of functions exposed protractor return promises. do need structure jasmine tests using protractor using things async tests (with done parameter), , .then , or protractor provide magic me? webdriverjs takes care of control-flow. protractor adds modification of jasmine's expect keep then s @ bay. it's best explained here .

c++ - bit vector intersect in handling parquet file format -

i handling parquet file format. example: a group of data: 1 2 null 3 4 5 6 null 7 8 null null 9 10 11 12 13 14 i got bit vector indicate null element: 1 1 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 and store non-null element: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 i want evaluate predicate: big 5 i compared non-null element 5 , got bit vector: 0 0 0 0 0 1 1 1 1 1 1 1 1 1 i want got bit vector elements: 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 1 the 0 in bold null elements, should false. void intersectbitvec(vector<int64_t>& bit_vec, vector<int64_t>& sub_bit_vec) { int data_idx = 0, int bit_idx = 63; (int = 0; < bit_vec.size(); ++i) { (int j = 63; j >=0; --j) { if (bit_vec[i] & 0x01 << j) { if (!(sub_bit_vec[data_idx] & 0x01 << bit_idx)) { bit_vec[i] &= ~(0x01 << j); } if (--bit_idx < 0) { --data_idx; bit_idx = 63; } } } }} my code quite ugly, there any

python - Apache fail to load django secret key from environment -

i have moved secret key settings.py /etc/environment /etc/environment secret_key='tne@n#^^%pp2h3mnwy2=94vuc!d99h=ww69tttf2n#_ypcjk)h' in project's settings.py secret_key=os.environ['secret_key'] this error in apache error_log file keyerror: 'secret_key', referer: http://anime.moxware.com/ how can solve issue?

ios - didUpdateToLocation called twice, ok. Why is oldLocation nil both times? -

i understand cllocationmanager called twice on init in cases, once cached location data, , once updated content . this makes sense, when returns same result in both cases (eg: because simulated location returns same coord , accuracy). here log startup process. didupdatetolocation called twice, both times oldlocation nil: // setup code: let locationmanager = cllocationmanager() locationmanager.delegate = self locationmanager.distancefilter = 100.0 locationmanager.requestwheninuseauthorization() locationmanager.startupdatinglocation() // log output: locationmanager didupdatetolocation old: nil new: <+22.28468100,+114.15817700> +/- 5.00m (speed -1.00 mps / course -1.00) @ 6/25/15, 3:21:57 pm indochina time locationmanager didupdatetolocation old: nil new: <+22.28468100,+114.15817700> +/- 5.00m (speed -1.00 mps / course -1.00) @ 6/25/15, 3:22:01 pm indochina time what doesn't make sense oldlocation nil in these cases. have provide external variable call a

c# - Look if file contains a specific string and then read that line -

i using foreach loop search files in directory , read them. foreach (string file in directory.enumeratefiles(location, "*.mai")) inside loop want search line in file contains word "sended". there way word , read line? try it: var location = @"<your location>"; foreach (string file in directory.enumeratefiles(location, "*.mai")) { var findedlines = file.readalllines(file) .where(l => l.contains("sended")); } if work big files, should use readlines method, because when use readlines , can start enumerating collection of strings before whole collection returned; when use readalllines , must wait whole array of strings returned before can access array. another example msdn: var files = file in directory.enumeratefiles(location, "*.mai") line in file.readlines(file) line.contains("sended") select new {

Python: How to check if an array is contained in another array using `numpy.all`and `numpy.any`? -

i working on detecting areas on image using scikit-image . able detect blobs using blob_doh function. able find regions using canny edge detector , labeling. now want check if blobs, found before, inside of regions, , sort out blobs not in of regions. want draw blobs inside regions. i trying implement using numpy.all , numpy.any misunderstand way these functions work. here have: for region in regions: # list of pixels' coords in region pixel_array = region.coords # check if blob inside region blob in blobs_doh: y, x, r = blob if np.any(pixel_array == [x, y]): c = plt.circle((x, y), r, color='red', linewidth=1, fill=false) minr, minc, maxr, maxc = region.bbox rect = mpatches.rectangle((minc, minr), maxc - minc, maxr - minr, fill=false, edgecolor='lime', linewidth=1) # draw blobs , regtangles ax.add_patch(c) ax.add_patch(rect) break so,

java - How to verify whether a browser exists in selenium webdriver -

i using webdriver open firefox browser , iteratively pass url using spreadsheet (that contains 5 urls in different cells of column 1). if suppose manually close firefox browser after 2 urls opened. want script handle situation , continue execution tried below 3 conditions, everytime null pointer exception. please suggest how handle situation. if (driver.tostring().contains("null")) if (driver.gettitle().contains("null")) if (driver.getcurrenturl().contains("null")) there no inbuilt method can use workaround /** * * @return true if driver alive else false */ public boolean isalive() { try { driver.getcurrenturl();//or driver.gettitle(); return true; } catch (exception ex) { return false; } }

ios - autolayout constraints in nib not honored for UITableViewHeaderFooterView -

i have uitableview several columns of data. reusable cells loaded xib file has appropriate labels , autolayout constraints. works perfectly; table columns laid out correctly on different devices , when devices rotated. the problem having trying create table footer show totals of columns in table. i created xib file same autolayout constraints cell xib file , loading in tableview.viewforfooterinsection same way did cells. required, using subclass of uitableviewheaderfooterview instead of uitableviewcell . the awakefromnib method in uitableviewheaderfooterview subclass sets background color, can see correct size on devices/orientation, labels footer xib file not getting laid out match table cells. the autolayout constraints footer xib file not being honored. when set different background color in footer xib file, table footer shows background color length of xib's view. i'm new of technology , appreciate in resolving incredibly frustrating issue. is the

php - Ajax inside submitHandler form submit not working -

i working on registration user, i validate fields jquery validation plugins. in 'submithandler' called ajax , if response ok form submited ....but form not submited.but got alert of "ok". here code, jquery(document).ready(function(){ // setup form validation on #register-form element jquery("#reg_form").validate({ // specify validation rules errorelement: "span", rules: { fname: { required: true, maxlength: 12, minlength: 4, remote: {url: "<?php echo get_template_directory_uri() ?>/ajax-checkusername.php", type : "post"} }, lname: "required", phone: {required:true,number: true}, address: "required", email: { email: true, required: true, remote: {url: "<?php echo get_template_directory_uri() ?>/ajax-checkemail.php", type : "post"} }, password: "required", cpassword: { required: true,

scala - Issue serving static files in spray -

i'm having problems serving static files route @ core using spray 1.3.2: ctx.withhttpresponseheadersmapped(hm => hm ++ list(`content-disposition`("attachment", map(("filename", attachment.name), `content-length`(attachment.bytes.length))) .withhttpresponseentitymapped { e => httpentity(new contenttype( mediatypes.forextension(attachment.name.split('.').last.tolowercase).getorelse(mediatypes.`application/octet-stream`), none), e.data) //also tried mediatypes.`application/octet-stream` default } .complete(attachment.bytes) where attachment.name string , attachment.bytes array[byte]. in way i'm able download file represented array[byte] browser interface, problem when file in excel formats (xls, xlsx) downloaded file seem corrupted during process , wont open. strange thing corrupted files dimension of downloaded copy bigger original , in browser console possible notice transfer-encoding set chunked content-le

ember.js - How to make an array of objects global in ember JS -

i have started learning ember js, question might sound silly. i'm trying design blog website using ember v 1.12.0. right now, i'm using static data posts. this: var posts=[{ id:1, author:{name:"clark kent",age:32}, identity: "superman", description: "alien", date: new date('1-1-15'), body: 'stands hope' }, { id:2, author:{name: "bruce wayne",age:31}, identity:"batman", description: "billionaire", date: new date('1-1-16'), body: 'stands fear' }]; i make global can accessed multiple containers , data persists when edit details dynamically. know may not practice. but, right now, i'm trying build page. appreciated. thank you. ideally use ember-data this, thats job designed do. need simple model defined data. take @ guides ember models . if using ember-cli (which recommended), ember da