Posts

Showing posts from July, 2011

rest - Json Schema Validation Not Fail -

i working on json schema valdation rest assured api. getting json response web service , validate a schema. when change property in schema , run test code, test not fail. wanna test property exist there. if 1 of properties in schema not exist in response test must fail. couldn't this. how can this? test code: @test public void catalogbutiquedetailtest(){ file file = new file("src/test/resources/generatedjson/boutiquedetailschema.json"); jsonschemafactory jsonschemafactory = jsonschemafactory.newbuilder().setvalidationconfiguration(validationconfiguration.newbuilder().setdefaultversion(schemaversion.draftv4).freeze()).freeze(); given() .headers("some-header-info") .contenttype("application/json") .get("web-service-url") .then() .assertthat() .body(jsonschemavalidator.matchesjsonschema(file).using(jsonschemafactory)); } in schema add these properties: "required": ["prop1"

html - Increase a div with flex when another is hidden not working on safari -

Image
i've got follow code: angular.module("myapp", []).controller("mycontroller", function($scope) { $scope.toggleblue = false; }); span { cursor: pointer; } .wrapper { display: flex; justify-content: space-between; padding: 10px; background-color: grey; margin-top: 10px; } .row { width: 35%; } .first { flex: 1; background-color: red; } .second { display: flex; } .toggle { width: 80%; background-color: blue; } .decrease { width: 30px; height: 20px; background-color: yellow; } .nowidth { width: 20px; } <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <body ng-app="myapp" ng-controller="mycontroller"> <span ng-click="toggleblue = !toggleblue">toggle blue box</span> <div class="wrapper"> <div class="row first"></div>

jquery - How to Diplay "No result Found " in Autocomplete using $.getJSON -

i want show "no result found " message when response empty.in case when end session expired @ time return login page need json data how can handle html data . $( "#customers_name" ) .bind( "keydown", function( event ) { if ( event.keycode === $.ui.keycode.tab && $( ).autocomplete( "instance" ).menu.active ) { event.preventdefault(); } }) .autocomplete({ source: function( request, response ) { $.getjson( "ajax_functions.php", { term: extractlast( request.term ), console: $('select[name="console"] option:selected').val(), call: 'getcustomersemaillist', nmsadmin: '<?php echo tep_session_id();?>' }, response ); }, change: function (event, ui) { if(!ui.item){ $("#customers_name").val(""); } }, focus: function() { return false; }, se

javascript - How to determine error if using $.post() or $.get() -

i know how handle errors $.post or $.get $.post(url,data,function(data,status,xhr),datatype) $.get(url,data,function(data,status,xhr),datatype) without using $.ajax has error handler. $.ajax({ url: url, type: $(this).attr("method"), datatype: "json", data: data, processdata: false, contenttype: false, success: function (data, status) { }, error: function (xhr, desc, err) { } }); jquery's post , get promisses, can chain functions done , fail , always on these: var jqxhr = $.post( "example.php", function() { alert("success"); }) .done(function() { alert("second success"); }) .fail(function() { alert("error"); }) .always(function() { alert("finished"); }); or later, varibale: jqxhr.always(function() { alert("second finished"); }); see documentation.

naming - How do you call a stub but used for production purposes? -

i'm writing application in piece of functionality can fulfilled 1 of more components. app user defines in settings class should used provide each functionality. concept have name? the closest concept can think of stub , used testing. an example of concept in django: setting variable staticfiles_finders stores class names used finding static files. i don't know django documentation implementation of chain of responsibility pattern. the pattern can specify implementation configuration called plugin pattern .

sql server 2008 - How to find sql error code in vbscript adodb.command.execute for "create login" -

i'm trying find error code when attempting create login using adodb.command object. if "create login" succeeds, adorecord object created. if fails, no ado object if created. i display , log sql server error of failure. err object empty on failed execution. the code: tsqlcmd.commandtext = "create login " & uname & " password = '" & upw & "'" tsqlcmd.activeconnection = conn on error resume next set adorec = tsqlcmd.execute() ' how find sql error ? if err <> 0 serr.number = err.number serr.description = err.description serr.source = err.source serr.helpcontext = err.helpcontext createlogin = false errmsg = "createlogin: adodb create command error: " & hex(serr.number) & vbcrlf & _ "desc: " & serr.description & vbcrlf & _ serr.source & vbcrlf 'fake logging msgbox(errmsg) exit function end if execu

r - Variable in colnames -

i want combine text , variable in colnames. example i've tried (mix between python , r): list_names <- "henk", "ash", "brock", "piet" list_age <- 14 , 12, 44, 56 (i in range 1:4) { colnames (df) <- c("this name", list_names[[i]], "and i'am", list_age[[i]], "years old." } i tried this, error colnames has got many arguments. does know how put these variables in colnames? kr, arnand we may need paste (using r ) colnames(df) <- paste("this name", list_names, "and i'am", list_age) colnames(df) #[1] "this name henk , i'am 14" "this name ash , i'am 12" "this name brock , i'am 44" #[4] "this name piet , i'am 56" data list_names <- c("henk", "ash", "brock", "piet") list_age <- c(14 , 12, 44, 56) df <- data.frame(v1 = 1:4, v2 = 2:5, v3 = 3:6,

Is it a good practice to always have function prototypes for static functions in C? -

i looking @ embedded firmware in c language. notice there static functions being used in .c files there no function prototypes. practice always put function prototypes near top of .c file? there situations when not putting function prototypes better? is practice put function prototypes near top of .c file no. if using multiple .c files calling same function, better declare function in .h file , include it, instead of redeclaring in every new .c file calls function if using 1 file, , not sure whether declare or not - declaring enable call function before definition, think practice are there situations when not putting function prototypes better? there times in can compile without prototypes, in general think it's not better omit them, don't think can it's really bad

php - disable preg_replace() for some images... -

i using function replace data-rel , add hyperlink images of content. function add_image_responsive_class($content) { global $post; $pattern ="~<img(.*?)class=\"(.*?)\"(.*?)src=\"(.*?)\"(.*?)>~i"; $replacement = '<a href="$4" data-rel="lightbox-gallery"><img$1class="$2"$3src="$4"$5></a>'; $content = preg_replace($pattern, $replacement, $content); return $content; } add_filter( 'the_content', 'add_image_responsive_class'); its working awesome, there 1 issue facing now. time want add images have different links. example want add logos link websites. opening same image because of preg_replace() function. is there way disable images somehow? cant use link media file every image, that's why using function. please me!

java - ShapedRecipe with Lore? -

i'm writing craftbukkit plugin server. couldn't find how check if ingredient item has lore shapedrecipe packedice = new shapedrecipe(new itemstack(material.packed_ice)); packedice.shape(new string[]{"aba","bcb","aba"}).setingredient('a', material.prismarine_shard).setingredient('b', material.gold_block).setingredient('c', material.snow_ball); bukkit.getserver().addrecipe(packedice); instead of shapedrecipe packedice = new shapedrecipe(new itemstack(material.packed_ice)); need bit more code: itemstack = new itemstack(material.packed_ice); itemmeta m = i.getitemmeta(); m.setdisplayname("customdisplayname") list<string> l = new arraylist<string>(); l.add("line 1"); l.add("line 2"); m.setlore(l); i.setitemmeta(m); shapedrecipe packedice = new shapedrecipe(i); hope helps //edit: sorry missunderstod first, check if item in upper right corner has lore "line1"

javascript - Regular Expression for hostname & ip -

i'm trying find regex validate ip-addresses , 1 hostnames in javascript. i looked @ many posts here , elsewhere cannot quite find 1 suits needs. for ip found 2 work fine (dont know if there differences other format): 1: (this preferred regex ip-addresses) ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ 2: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ for hostname found one: /^(([a-za-z0-9]|[a-za-z0-9][a-za-z0-9\-]*[a-za-z0-9])\.)*([a-za-z0-9]|[a-za-z0-9][a-za-z0-9\-]*[a-za-z0-9])$/ which works fine. but^^ problem hostname regex validate 192.168.178.1111 this not hostname, invalid ip-address. i fit both hostname & ip regex in single regex term since hostname regex validate non-valid ip-address cannot combine them. does have idea on how create hostname regex not validate invalid ip-address? edit: found 1 well: http://jsfiddle.net/opd1v7au/2/

.net - Is it possible to create a method which returns a key of entity by reference in C# with Entity Framework? -

let assume there 2 assemblies - core , infrastructure. in first 1 there interfaces , models. represents domain model , contains business logic. models built on abstractions - interface methods used. for instance: public interface inotificationservice { void notify(user user, int modelid); } public interface iauthorizationservice { void isauthorized(user user); } public interface ipersistenceservice { int addsomeentity(somemodel model); void savechanges(); } public interface isomemodelmanagementservice { void addsomemodelandnotify(user user, somemodel model); } public class somemodelmanagementservice : isomemodelmanagementservice { //here constructor injection of inotificationservice, iauthorizationservice , ipersistenceservice void addsomemodelandnotify(user user, somemodel model) { if(authorizationservice.isauthorized(user)) { int id = persistenceservice.addsomeentity(model); persistenceservice.savechanges();

javascript - Detecting an undefined object property -

what's best way of checking if object property in javascript undefined? use: if (typeof === "undefined") { alert("something undefined"); } if object variable have properties can use same thing this: if (typeof my_obj.someproperties === "undefined"){ console.log('the property not available...'); // print console }

android - Getting empty RecyclerView -

it first time im working recyclerview , have problem. im trying view drawerfragment. drawer menu working fine cant see recyclerview there. can me? this layout of fragment: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#dadada" tools:context="com.example.entwicklung1.designtestapp.navigationdrawerfragment" android:orientation="horizontal"> <linearlayout android:id="@+id/linid" android:layout_width="match_parent" android:layout_height="120dp" android:background="#0064a7" android:paddingleft="20dp"> <imageview android:layout_width="240dp" android:layout_height="120dp" android:elevation="20dp" andro

Scope of static inner class in java -

i found strange thing today. have following class static inner class. public class pdto { private agreement agreement = new agreement(); public static class agreement{ public string agreementname; public string agreementdescription; public string currency; } public agreement getagreement() { return agreement; } public void setagreement(agreement agreement) { this.agreement = agreement; } } another class classa has following method :- private agreement createbillingagreement(pdto payment) { pdto.agreement billingagreement = payment.getagreement(); agreement agreement = new agreement(); agreement.setname(billingagreement.agreementname); agreement.setdescription(billingagreement.agreementdescription); billingagreement.agreementname = "changed agreeement name" ; } class b's code calls method of class a classbservice.createbillingagreement(payment); system.out.println("c

java - How to fetch specific word from long string with particular keyword -

i have string below:- this string output of command find services entry in config file , print out. here b c etc services , respective services entry or config parameters. map(s): service.cfg os_serv 0 0 0 50 50 1 "d:\workdir\upg_81\bin\olaunch" -f "d:\workdir\upg_81\bin\osserv" gui svr 0 0 1 99 99 2 "d:\workdir\upg_81\bin\olaunch" -f "d:\workdir\upg_81\bin\omf" -a netcap 0 1 1 1 1 60 "d:\workdir\up g_81\bin\netcap" netprobe 0 0 0 99 99 1 "d:\workdir\upg_81\bin\netprobe" lamserv 1 1 1 1 1 10 "d:\workdir\upg_81\ bin\lamserv" mserv 1 1 1 1 1 10 "d:\workdir\upg_81\bin\mserv" uidserv 1 1 1 1 1 10 "d:\workdir\upg_81\bin\uidser v" rserv 0 1 1 1 1 10 "d:\workdir\upg_81\bin\rserv" nlsserv 1 1 1 1 1 10 "d:\workdir\upg_81\bin\nlsserv" om fsvr 1 1 25 25 25 60 "d:\workdir\upg_81\bin\objserv" -c 250 searchserv 0

parse.com - iOS push notifications not showing up through Parse local server -

i'm doing whatever can send ios push notifications react-native app , app display notifications. i've been trying figure out months. i have local parse server running following config: { "appid": "org.reactjs.native.example.reactzeronotifications", "masterkey": "masterkey", "databaseuri": "mongodb://localhost/test", "push": { "ios": [ { "pfx": "reactnotification-dev.p12", "bundleid": "org.reactjs.native.example.reactzeronotifications", "passphrase": "*", "production": false }, { "pfx": "reactnotification-prod.p12", "bundleid": "org.reactjs.native.example.reactzeronotifications", "passphrase": "*", "production&

xml - Oracle XMLQuery is corrupting the namespace -

oracle version 11.2 below cut down version of xmlquery i'm running on xmltype column. when run query, parses , recreates stored xml, tsxm namespace ( that not equal default namespace ) gets changed. query nothing , rewritten, real (much bigger) query uses same methodology why i'm posting question in format. if change tsxm namespace definition same default namespace : xmlns:tsxm="http://schemas.thomson.com/ts/20041221/tsip" then problem goes away, in real application not possible. create table: create table xml_document_tmp ( document_id number(12) not null, xml_data sys.xmltype not null, created_date timestamp(6) not null ); insert data: insert xml_document_tmp (document_id,created_date,xml_data) values(1,sysdate,'<patent xmlns="http://schemas.thomson.com/ts/20041221/tsip" xmlns:tsip="http://schemas.thomson.com/ts/20041221/tsip" xmlns:tsxm="h

paypal - Membership subscriber integration in joomla 3.0 -

i have build website in joomla 3.5 version. client asking membership subscribe payment. in website 2 places need payment gateway. 1.two type user there free , paid. paid user can registration form in need pay , subscribe option. 2.event booking. kindly me extension , payment gateway suitable concept? the best way use membership subscription plugin purpose. still have more requirement customize plugin code. here link of joomla subscription plugin membership read documentation first. http://extensions.joomla.org/category/e-commerce/membership-a-subscriptions

angularjs - Extending Existing Chart Types angular chart js using chart js 2.0 -

i'm using great chart.js (version: 2.0.2) , angular-chart.js (version: 1.0.0-beta1) compatibility purposes. there lot of functionalities add project (like adding horizontal line chart or having rounded corners bar chart ). theses solutions use chart.types.[typeofthecharttoextend].extend({..}). i'm stuck using chart.js v2.0, doc isn't clear. how can extend existing chart using chart.js v2.0 ? any advice or example appreciated. thanks! try line chart: var originallinecontroller = chart.controllers.line; chart.controllers.line = chart.controllers.line.extend({ draw: function() { originallinecontroller.prototype.draw.apply(this, arguments); /* own drawing code here */ } } you can context with: var ctx = this.chart.chart.ctx;

javascript - Why is variable inside callback function undefined outside of it? -

this question has answer here: how return response asynchronous call? 25 answers why eventfb1 undefined outside of graph.get callback function? and why eventfb object different response res (e.g. in console log eventfb1 ) inside of graph.get callback function? var graph = require('fbgraph'); var eventfb = graph.get('13216634559578/posts', {limit: 1, access_token: 34ul345kt39884p'}, function(err, res) { var eventfb1 = res; console.log(eventfb1); }); console.log(eventfb1); thanks! it because graph.get asynchronous request whereas javascript synchronous execution. therefore, code outside call executes before response request

javascript - Angular ng-repeat not show empty object attributes -

i trying loop through using data below in angular ng-repeat { "qid": "173995x306x4091", "gid": null, "comments": "milestone1: here milestone1details", "owner": "me", "targetdate": "28-10-2016" }, { "qid": "173995x306x4101", "gid": null, "comments": "", "owner": "", "targetdate": "" } html : <div class="modal-body" ng-repeat="milestone in milestones "> <table class="table table-striped"> <thead> <tr> <th>milestone </th> <th>milestone owner</th> <th>milestone target date</th> </tr> </thead> <tr> <td>{{milestone.comments }} </td> <td

c++ - Why LoadUserProfile() fails with error 5 "Denied Access" in this code running in system service? -

i have piece of code below running in system level windows service. if add createenvironmentblock() , createprocessasuser() code, works. use "loaduserprofile()", fails error 5 should mean "access denied". please check missing. want retrieve user level registry value system service. comment in code way, failed retrieve user level registry value. void getuserregistry() { #ifdef q_os_win dword lasterror = 0; dword sessionid = wtsgetactiveconsolesessionid(); qinfo() << "session id = " << sessionid; wchar_t* ppusername[100]; dword sizeofusername; wtsquerysessioninformation(wts_current_server_handle, sessionid, wtsusername, ppusername, &sizeofusername); qinfo() << "windows user name = " << qstring::fromwchararray(*ppusername); std::wstring strvalueofbindir = l"unknown value"; // long regopenresult = error_success; handle husertoken = null; handle hfaketoken =

angularjs - Render array of arrays table in Angular using ng-repeat -

i have array of arrays (representing rows , columns) , need render html table data. each row array of column values, example: $scope.table.row[0] = [123, 456, 789] this attempt (that doesn't work). ideas? <table> <tbody> <tr ng-repeat="row in table"> <td ng-repeat="col in row">{{col}}</td> </tr> </tbody> </table> you either need iterate on table.row or make table array of arrays itself. demo . <table> <tbody> <tr ng-repeat="row in table.row"> <td ng-repeat="col in row">{{col}}</td> </tr> </tbody> </table> or table = [ [123, 456, 789], [111, 222, 333], [111, 222, 333]] <table> <tbody> <tr ng-repeat="row in table"> <td ng-repeat="col in row">{{col}}</td> </tr&g

c# - How to fix or get around a system out of memory exception when zipping large files? -

this question has answer here: out of memory exception while updating zip in c#.net 2 answers so have application zips directories , works except today got exception , when checked log turned out got system out of memory exception because of directory ~550mb. question is: there way around or enable application work bigger sized directories? here code zips directories: using (filestream ziptoopen = new filestream(destdir1, filemode.open)) { using (ziparchive archive = new ziparchive(ziptoopen, ziparchivemode.update)) { int ind = folder.lastindexof("\\") + 1; string foldername = folder.substring(ind, folder.length - ind); ziparchiveentry readmeentry; directoryinfo d = new directoryinfo(folder); fileinfo[] files = d.getfiles("*"); foreach (fileinfo file in files) { readmeentry = archive.cr

javascript - Analogues $apply or $digest(Angular) in Aurelia -

is there analogues functions $apply or $digest in aurelia ? how call changes bindingvalue? my case: have tree(each node contain list of item, screen 1). have parent component(names: tree), , node component(names:node). each node have toggle button. when i'm toggle items parent component should know how changes content height. togglenode(event) { (var = 0, length = this.current.children.length; < length; i++) { this.current.children[i].visible = !this.current.children[i].visible; } //some code this.evaggregator.publish("toggle-agents", event); } view: <ol show.bind="current.visible">//some markup</ol> my parent component catch event , check content size: @autoinject export class agents { constructor(private evaggregator: eventaggregator) { this.toggleagentssubscriber = this.evaggregator.subscribe("toggle- agents", (e) => { //some code recalculate content height }); }

c# - Regex that removes the 2 trailing letters from a string not preceded with other letters -

this in c#. i've been bugging head not luck far. so example 123456bvc --> 123456bvc (keep same) 123456bv --> 123456 (remove trailing letters) 12345v -- > 12345v (keep same) 12345 --> 12345 (keep same) abc123ab --> abc123 (remove trailing letters) it can start anything. i've tried @".*[a-za-z]{2}$" no luck this in c# return string removing 2 trailing letters if exist , not preceded letter. match result = regex.match(mystring, pattern); return result.value; your @".*[a-za-z]{2}$" regex matches 0+ characters other newline (as many possible) , 2 ascii letters @ end of string. not check context, 2 letters matched regardless of comes before them. you need regex match last 2 letters not preceded letter: (?<!\p{l})\p{l}{2}$ see this regex demo . details : (?<!\p{l}) - fails match if letter ( \p{l} ) found before current position (you may use [a-za-z] if want deal ascii letters) \p{l}{2} - 2 letters $

python - Extracting parameters from astropy.modeling Gaussian2D -

i have managed use astropy.modeling model 2d gaussian on image , parameters has produced fit image seem reasonable. however, need run 2d gaussian on thousands of images because interested in examining mean x , y of model , x , y standard deviations on our images. model output looks this: m2 <gaussian2d(amplitude=0.0009846091239480168, x_mean=30.826676737477573, y_mean=31.004045976953222, x_stddev=2.5046722491074536, y_stddev=3.163048479350727, theta=-0.0070295894129793896)> i can tell this: type(m2) <class 'astropy.modeling.functional_models.gaussian2d'> name: gaussian2d inputs: (u'x', u'y') outputs: (u'z',) fittable parameters: ('amplitude', 'x_mean', 'y_mean', 'x_stddev', 'y_stddev', 'theta') what need method extract parameters of model, namely: x_mean y_mean x_stddev y_stddev i not familiar form output stuck on how extract parameters. the models have attributes can a

symfony - Adding a custom form inside the show template of a Sonata Admin Entity -

i want generate small form indide sonata admin show template. have done far creating function in custom crud specific entity (order) extends sonata's default crud; public function approveorderaction($id = null) { $request = $this->getrequest(); $id = $request->get($this->admin->getidparameter()); $order = $this->admin->getobject($id); $approveform = $this->createformbuilder($order) ->add('reqsecondapprover', 'checkbox', array('label' => 'require second approval', 'required' => false)) ->add('secondapprover', 'choice', array('choices' => crud::getwhatever(array('developer')), 'required' => false)) ->getform(); $approveform->handlerequest($request); if ($approveform->issubmitted() && $approveform->isvalid()) { $secondapproval = $request->request->get('form'); $

angular - looking for dropdown component for angular2 -

i'm looking dropdown select component angular2 without dependencies other angular2 itself. component found require jquery or have use without dependencies other angular2 itself creating custom dropdown isn't big deal. plus it's 'light-weight' can get. need is: create list of elements out of passed data make list visible on click , hide again when list element selected emit data when element selected this need: @component({ selector: 'custom-select', template: ` <div class="selected" (click)="openclose()"> <div class="when-selected" *ngif="selected"> <span>{{selected.title}}</span> <img [src]="selected.img" /> </div> <div class="placeholder" *ngif="!selected"> shown when nothing selected </

python - How to implement non overlapping rolling functionality on MultiIndex DataFrame -

so far i've found this question doesn't solve problem due facts that: i have multiindex dataframe the inner level has different amount of data each outer level, can't use len() i have following dataframe outer inner value 1 2.000000 2 4.000000 3 6.000000 4 8.000000 b 1 3.000000 b 2 6.000000 b 3 9.000000 b 4 12.000000 b 5 15.000000 i want sum last 2 values each outer in non-overlapping manner. a want sum inner 's 3 + 4, 1 + 2. b want sum inner 's 4 + 5, 2 + 3. note pairwise sum supposed start last value. resulting in outer inner value 2 6.000000 4 14.000000 b 3 15.000000 b 5 27.000000 groupby custom resample function you need custom resampling this. little hacky might work. remove mulitindex ing deal regular column groupby() s groupby() 'outer' , .apply() custom function e

php - Gitstack git server - push to apply changes -

(sorry unclear title). scenario. have local server , installed gitstack in it. able to push , pull local git server. same server runs webapp working on. plan push commits local git server , change must reflect webapp. instead of using filezilla copy files machine serer, push changes via git. how it? or possible? i tried inside gitstack's installation folder. expected see actual project's files inside git files there.

java - Calling a Method That Takes a Parameter Within ActionListener -

i've encountered problem while trying call method within class implements actionlistener . method being called, datacompiler , needs use integer wordcountwhole , returned in wordcount class. problem can't pass required parameter actionlistener method . import javax.swing.*; import java.awt.*; import java.awt.list; import java.awt.event.*; import java.beans.propertychangelistener; import java.text.breakiterator; import java.util.*; import java.util.stream.intstream; public class gui extends jframe { public jtextarea textinput; public jbutton databutton; public string str; public gui() { super("text miner"); pack(); setlayout(null); databutton = new jbutton("view data"); //button take user data table databutton.setsize(new dimension(120, 50)); databutton.setlocation(5, 5); handler event = new handler(); //adds action listener each button databutton.ad

javascript - angular UI-Bootstrap modal not binding with controller -

i create ng-template , bind controller , template pass through ui-bootstrap modal. code :- vm.uploadfile = function () { var uploadmodal = $uibmodal.open({ animation: true, templateurl: 'upload.html', bindtocontroller: true, controller: 'modalctrl', controlleras: 'modalvm', resolve: { items: function () { } } }); uploadmodal.result.then(function (data) { data.uploadedby = 'admin'; data.filename = data.name; vulgridservice.datastackforfile.unshift(data); vulgridservice.gridapi.core.refresh(); }, function () { console.log('modal dismissed at: ' + new date()); } ); } } my template below:- <script type="text/ng-template" id="upload.html"> <div class="&

Windows batch file to find variable string in a html file -

i trying write windows batch file through specific html file looks (simplified): <input name="pattern" value="*.var" type="text" /><img style="width: 16px; height: 16px; vertical-align:middle; cursor:pointer" onclick="this.parentnode.submit()" class="icon-go-next icon-sm" src="/static/474743c8/images/16x16/go-next.png" /></form></div><table class="filelist"><tr><td><img style="width: 16px; height: 16px; " class="icon-text icon-sm" src="/static/474743c8/images/16x16/text.png" /></td><td><a href="./address.var.varapplication-varapplication-varwebservice-05.05.07-snapshot.var">address.var.varapplication-varapplication-varwebservice-05.05.07-snapshot.var</a></td><td class="filesize">133.49 mb</td><td><a href="./address.var.varapplication-vara

cluster computing - wait for already finished jobs -

i launch pbs script once others completed. use commands: $ job1=$(qsub job1.pbs) $ jobn=$(qsub jobn.pbs) $ qsub -w depend=afterok:$job1:$jobn join.pbs this works, in cases. if run joining script when job1 , jobn finished, go idle indefinitely waiting already-finished-jobs finish. sounds insane, happens. if run qstat can see joining job being held ('h') $ qstat -u me job id username queue jobname sessid nds tsk memory time s time --------------- -------- -------- ---------- ------ --- --- ------ ----- - ----- 1990613 me workq join.pbs -- 1 1 -- -- h -- however if @ least 1 of jobs still running, while other finished, joining script not go idle , finish. so solutions deal jobs over? need job finish. when join job starts, server still needs know depended-upon jobs; if either of gone qstat , you'll need increase keep_completed in qmgr . otherwise, when join job ready run, dependency never satisfied, ,

symfony - How owerride 'show' template in new version sonata admin -

how can override 'show' template in new version? before extend in template base template: {% extends 'sonataadminbundle:crud:base_show.html.twig' %} and override {% block show_field %} content {% endblock %}. but not work. template me need extend now? ps want override template 1 entity so, global override not me try if base_show_macro template looking for: vendor/sonata-project/admin-bundle/resources/views/crud/base_show_macro.html.twig or in twig: {% extends 'sonataadminbundle:crud:base_show_macro.html.twig' %}

ios - Loading data from webservice in UitableView -

i have tableview custom cell. want populate tableview data coming form webservice. saving data in nsuserdefaults after getting webservice. , fetching userdefaults array named "dataarray" now when try populate in cellforrowatindexpath show error because dataarray not populated yet. lets if take 2 seconds fetch data webservice, save in userdefaults , populate array. how can populate tableview after 2 seconds , not before ? please thanks. 1- create array , in numberofrowsinsection return array.count; 2-after data web service populate array , used tableview.reloaddata() 3- check used correct tableview , correct cell identifier , establish uitableview delegate , datasource app. hope you.