Posts

Showing posts from March, 2011

c++ - How to get number of connections on PORT per IP in Windows? -

i have been searching around google time , can`t seem find answer... i using getextendedtcptable() view current connections, unable number of connections each ip on specific port. is there example/function ? or have create ? any guidance or example appreciated. have nice day! so using this code msdn basis end example enumerates list of connections, populating pointer int ports number of connections remote systems local ports. to determine number of connections particular local port, can print out value of ports[port] . the code supplied more c , c++ , used new[] , delete[] ports. #include <winsock2.h> #include <ws2tcpip.h> #include <iphlpapi.h> #include <stdio.h> #pragma comment(lib, "iphlpapi.lib") #pragma comment(lib, "ws2_32.lib") #define malloc(x) calloc(1, (x)) #define free(x) free((x)) int main() { // declare , initialize variables pmib_tcptable_owner_pid ptcptable; int *ports; // array of

c# - SQL Server Windows Auth using other Credentials than logged on User -

i got connection string in c#: strg_sql_connection = @"server=server\instance; database=db;uid=domain\user; password=password;"; it tries login using user logged on on development machine don't want. how can fix this? you cannot use windows credentials connection string. process, or @ least thread, must impersonate desired user before establishing connection. there many ways can impersonate, refer msdn details. see windowsidentity.impersonate() and/or client impersonation . a trivial way achieve impersonation using runas.exe

javascript - Not able to resolve webpage links when request goes through phantom js server -

i have installed phantom js server seo request crawler first passes through phantom js server , can convert dynamic web page static web page served crawler. server installed , testing on localhost.the url placed in browser or request able reach phantom js phantom js unable resolved web pages script links. stuck here.any great appreciated..here code <code> 1. **angular-seo-server.js** var system = require('system'); if (system.args.length < 3) { console.log("missing arguments."); phantom.exit(); } var server = require('webserver').create(); var port = parseint(system.args[1]); var urlprefix = system.args[2]; var parse_qs = function(s) { var querystring = {}; var = document.createelement("a"); a.href = s; a.search.replace( new regexp("([^?=&]+)

javascript - Animation @keyframes slide top and stay -

this question has answer here: stopping css3 animation on last frame 6 answers i want #upmenu stay outside viewport once animation ended. i'm struggling understand doing wrong. thanks help. $(document.body).ready(function() { $("#num").hover(function() { $("#upmenu").toggleclass("toptop"), $("#fp-nav").toggleclass("top") }) }) #upmenu{ position:fixed; top:0; } .toptop { -webkit-animation: slide-out-top 1.5s cubic-bezier(.215, .61, .355, 1); animation: slide-out-top 1.5s cubic-bezier(.215, .61, .355, 1) } @-webkit-keyframes slide-out-top { 0% { -webkit-transform: translatey(0); transform: translatey(0) } { -webkit-transform: translatey(-100%); transform: translatey(-100%) } } @keyframes slide-out-top { 0% {

python - Trying to use variables outside of a for loop gives a SyntaxError: no binding for nonlocal 'max_' found -

def min_diff(arry_): max_ =0 temp_ =0 in arry_: nonlocal max_ nonlocal temp_ if > max_: nonlocal max_ nonlocal temp_ temp_ = max_ max_ =i return max_-temp_ i want use max_ , temp_ outside loop getting error syntaxerror: no binding nonlocal 'max_' found nonlocal can applied in functions have nested scope. nested scope when define function inside of function. python doesn't have block scopes; for loop doesn't create new scope, don't need use nonlocal in loop. variables available throughout rest of function. drop nonlocal statements altogether: def min_diff(arry_): max_ = 0 temp_ = 0 in arry_: if > max_: temp_ = max_ max_ = return max_ - temp_ in python, functions, class definitions , comprehensions (list, set, , dict comprehensions generator expressions) own scope, , functions can act parent scope closures (nonlocal variables).

php - How to retrieve data from 2 database using doctrine in same entity-manager? -

i have problem in retrieve data 2 difference mysql databases $em = $this->doctrine->emdetails; $qb = $em->createquerybuilder(); $qb->select('g.gradeid grade_id', 'g.gradename grade_name', 'g.rank', 'ay.academicid academic_year_id'); $qb->from('entity\grades', 'g'); $qb->leftjoin('g.academicyear', 'ay'); $qb->where('ay.academicid = :academicid'); $qb->setparameter('academicid', $data); $result = $qb->getquery()->getresult(); return $result; academicyear exist in x database , grades exist in y database i have following error base table or view not found: 1146 table 'y.academic_years' doesn't exist how can solve problem to query 2 different database need work 2 entity managers. if you're working symfony can find how here : http://symfony.com/doc/current/doctrine/multiple_entity_managers.html of

c++ - Can't return result from int function -

i making class inherited program in c++. function determane whenever triangle right , calculate area. here program: #include <iostream> using namespace std; class puncte { public: int x1,y1; int x2,y2; int x3,y3; puncte(int a, int b, int c, int d, int e, int f):x1(a),y1(b),x2(c),y2(d),x3(e),y3(f){} void afisarep() { cout<<x1<<y1<<x2<<y2<<x3<<y3<<endl; } }; class latura { protected: int l1, l2, l3; public: void latimeal(int a, int b, int c) { l1 = a; l2 = b; l3 = c; } }; class triunghi: public latura { public: int ariatrdr() { return l1*l3/2; } }; int main() { puncte p(2,2,2,2,2,2); latura l; l.latimeal(1,2,4); triunghi t; if (p.x1 == p.x3 && p.y1 == p.y2) { cout << "triunghi dreptunghic!" << endl; cout << t.ariatrdr() << endl; } return (0); } everthing working fine doesnt show correct result adress , dont know how fix it

java - Does spring junit rollback by default? -

i'm testing dao layer using spring , junit. test: @contextconfiguration(locations = "classpath:application-context-test.xml") @runwith(springjunit4classrunner.class) public class testemployeedao { @autowired private employeedao employeedao; @test @transactional public void testinsertemployee(){ employee employee = new employee("abdel karim"); employeedao.insert(employee); . . . } } } but when execute test , check database find no row inserted, , no exception thrown. don't understand why, default behaviour of spring (springjunit4classrunner) rollback transaction? thanks in advance. yes, default rollback true. switch off use: @test @transactional @rollback(false) public void testinsertemployee(){ employee employee = new employee("abdel karim"); employeedao.insert(employee); }

c++ - Add, save data from MFC App(Visual Studio 2015) to SQL Server -

i beginner in using visual studio. i've had learnt on displaying data sql server in asp.net web application. want display data mfc application(project type). don't know how start make button functioning save text database. compared asp.net, offers toolbox grid view display data not in mfc app. have .rc file being designed interface. got sql server management studio use. take @ https://www.tutorialspoint.com/mfc/mfc_database_classes.htm guidance not complete. need step step , complete tutorial on how add, save data sql server using mfc application @ visual studio 2015. create class in mfc application of type odbc customer . right click on "header files" folder in solution explorer , click "add class". select option " mfc " , select " mfc odbc customer ". asked select data source. assuming haven't created data source till now, click " new ". select database driver type , type location want save data source. aft

excel - Rails send file xlsx didn't work -

i use axlsx generate excel, confused how let user download it. i wrote in download controller, , excel file's path public/excel/timestamp.xlsx . def code_generator if request.post? #generate xlsx...... excel_path = "#{rails.root}/public/excel/" + datetime.now.strftime('%q') + '.xlsx' send_file excel_path, :disposition => "attachment" end end when post data controller, browser didn't create download action. however, in terminal, displayed 2016-11-08 17:01:56.971 [info] sent file /users/username/desktop/project_name/public/excel/1478595716963.xlsx (0.1ms) update i found out there's nothing send_file . here original code # code_generator.html.erb <%= form_tag('/admin/code_generator', method: 'post', remote: true) %> i change <%= form_tag('/admin/code_download') %> add new controller method code_download , same thing original code_generator . but time, works

c# - Wave file - processing specific chunk of audio data -

i'm trying iterate on wave file , send 20ms of every iteration. assuming i'm using 8khz, 1 channel, 16bit audio file, have below code using naudio: wavefilereader wheader = new wavefilereader(fullfilename); byte[] data = new byte[wheader.length]; int read = wheader.read(data, 0, data.length); short[] samplebuffer = new short[read / 2]; short[] inpbuf; (int = 0; < read; += 2) { inpbuf = new short[159]; //20ms? buffer.blockcopy(data, 0, samplebuffer, 0, read); inpbuf = samplebuffer; process20(inpbuf); //send 20ms of audio data inside inpbuf } i can see complete audio data inside samplebuffer (generated wave sine) cannot divide these 20ms inpbuf , see inpbuf contains whole audio data. once understand issue i'll able move on stereo , different audio formats. any appreciated, thanks. the problem related blockcopy operation buffer.blockcopy(data, 0, samplebuffer, 0, read); you copying whole input buffer start each time because have not defin

setup mod_proxy on apache http webserver in solaris -

installed apache http webserver in solaris.i enabled loadmodule mod_headers.so, mod_proxy.so, mod_proxy_http.so , inside location tag have added below lines enable proxypass , proxypassreverse in httpd.conf file proxypass http://localhost:8080/myapp proxypassreverse http://localhost:8080/myapp but not working in solaris , throwing error page.can me solve issue...

angularjs - How to delete the item from the list -

im creating app using ionic , angularjs. in app developing have used swipe option ionic delete specific coupon main-list. problem problem face here is, im able delete description of selected coupon, not able delete/remove coupon main-list. have use $rootscope have declared json array . have declare $scope.item selected coupon , details being pushed, in-order display description of each selected coupons. i'm going wrong somewhere in code please me right. thank you. html: <ion-list> <ion-item ng-click="select_item(coupons)" ng-repeat="coupons in couponlist" ng-model="coupons.selected"> {{coupons.coupontitle}} <br> <ion-option-button ng-click="editcoupons(coupons)">edit</ion-option-button> <ion-option-button class="button-assertive" ng-click="deleteselected(coupons)">delete</ion-option-button> </ion-item> </ion

codenameone - Hand coded GUI build failed in Codename One -

in project started create form gui builder did not feel comfortable tool. consequently rather hand coded based on demo example https://github.com/codenameone/materialscreensuikit/blob/master/src/com/codename1/uikit/materialscreens/loginform.java . i should mention changed name hand coded form mainform mainform2 , using netbeans latest availabel plugin of cn1 (updated november 7th 2016). each , every simulator run (when click on ide play button) error : ant -f /home/blablah/cn1project -dnb.internal.action.name=run run processing gui builder file: /home/blablah/cn1project/src/mypackage/mainform.java /home/blablah/cn1project/build.xml:469: gui builder source file corrupt, don't edit below/above line comments seem missing or modified! errccode a: -1 errcode b: -1 build failed (total time: 0 seconds) line 469 reads :   <generateguisources srcdir="src" encoding="utf-8" guidir="res/guibuilder" /> i understand error message , can confirm li

removing duplicates from a file from starting point of a file -

input file a b c d b c f e i tried below options: awk '!x[$0]++' file.txt > file.txt.tmp && mv file.txt.tmp file.txt perl -ne 'print unless $dup{$_}++;' file.txt > file.txt.tmp && mv file.txt.tmp file.txt awk '{if (++dup[$0] == 1) print $0;}' file.txt > file.txt.tmp && mv file.txt.tmp file.txt but removes duplicates , gives output below: a b c d f e but need output below. output file d b c f e i got answer below. awk -f'|' '{k=$1 fs $2} nr==fnr {a[k]=nr; next} a[k]==fnr' file.txt file.txt

ios - Q:Value of type '[String]' has no member 'filtered' -

Image
in code when implementation func : filtercontentforsearchtext(searchtext:string, scope:string) error comes: let resultpredicate:nspredicate = nspredicate.init(format: "name contains[c] \(searchtext)", searchtext) resultdatasource = datasource?.filtered(using: resultpredicate) nsarray? // red error:value of type '[string]' has no member 'filtered' i post code below: import uikit class storelistviewcontroller: uiviewcontroller, uisearchbardelegate,uisearchdisplaydelegate,uitableviewdelegate,uitableviewdatasource { var datasource:[string]? = nil var resultdatasource:nsarray? = nil override func viewdidload() { super.viewdidload() initdata() initui() } /* // mark: - navigation // in storyboard-based application, want little preparation before navigation override func prepare(for segue: uistoryboardsegue, sender: any?) { // new view controller using segue.destinationviewcontroller. // pass selected object new view controll

AngularJS - remove duplicate records -

Image
i new world of angularjs , working on angular 1.5 what trying remove duplicate records response before assigning $scope the results looks following [ { "phonenumbers": [ { "value": "00 1 111-222-333", "pref": false, "id": 0, "type": null }, { "value": "00 1 222-222-333", "pref": false, "id": 1, "type": null }, { "value": "00 1 333-222-333", "pref": false, "id": 2, "type": null } ] },{ "phonenumbers": [ { "value": "00 1 111-222-333", "pref": false, "id": 0, "type": null }, { "value": "00 1 222-222-333", "pref": false,

android - Moving Apk to SD Card -

moving sd card copies apk in /data/app folder sd card. wanted same code. i tried failed canwrite() , setwriteable(true) , delete() returns false file apkfile = new file(info.activityinfo.applicationinfo.sourcedir); apkfile.delete(); is @ possible delete/move apk sd card (and not copy it)? fyi: installlocation not me. so, had take above approach. you can not move /delete installed apk file without root privileges . if want move/delete installed apk need rooted android device. becase installed apk inside system/ directory , mounted read-only. had remount this mount -o remount,rw /system read more how write files system/ ?

sql server - Fulltext show the matching word in a multi-word search condition with OR -

i have full-text indexed table , column full-text indexed contains list of ids , other information. example: searchinformation 100, 101, 102, 103, 104, mike 200, 201, 202, 203, 204, john and full-text query (a simplified version) is: select searchinformation table t1 inner join containstable(searchtable, searchinformation, '"100" or "110" or "mick"') k on t1.id = k.[key] now, query identifies correct row due "100" value being matched, there way show / select value has been matched search conditions? in case, want select value of 100 query. have looked full-text documentation , i'm not sure if possible or if maybe additional changes in table , query design. so, i'm looking result set similar to: searchinformation matchfound 100, 101, 102, 103, 104, mike 100 i have approach each id number associated mike or john in single row, below, then, after match can directly take matc

javascript - d3 change class of clicked node text -

i'm trying add class label, clicked in force diagram. use "click" function, hands clicked item update function (it updates class of item). tried using this console report " nodeclicked.childnodes[1].classed not function ". then googled , tried use " d3.select(this).select("text"); " not report error, nor update text. a node < g > element has 2 children: circle , text (the text want give css class) if want to, can @ code snippet: // toggle children on click. // save information clicked , update gui function click(d) { if (d.children) { d._children = d.children; d.children = null; } else{ d.children = d._children; d._children = null; } // save node clicked nodeclicked = d3.select(this).select("text"); // save d3 data of node nodeclickeddata = d; } to change class tested both: $(nodeclicked).addclass("nodegreenmarked"); and: nodeclicke

javascript - observe KO observable from another viewmodel -

so have 2 view models taking each other var viewmodel1 = function(){ this.messageforvm2 = ko.observable(""); this.message = ko.observable("hello vm1") }; var viewmodel2 = function(vm1){ this.message = ko.observable(vm1.messageforvm2()); }; var mastervm = (function(){ this.viewmodel1 = new viewmodel1(), this.viewmodel2 = new viewmodel2(this.viewmodel1); })(); ko.applybindings(mastervm) <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script> <h4>view model 1</h4> <div data-bind="with: viewmodel1"> <p data-bind="text: messageforvm2"></p> <input data-bind="value: messageforvm2, valueupdate: 'input'" /> </div> <h4>view model 2</h4> <div data-bind="with: viewmodel2"> <!-- ko if: message() === "hello" --> <p d

jquery - Error in setValue on overriding afterRender method of combobox. extjs -

my code combobox below { xtype: 'combobox', id: 'menuitemscombo', fieldlabel: "items", name: 'menuitem', store: this.itemsstore, valuefield: 'id', displayfield: 'longname', editable: false, emptytext: 'none', typeahead: false, multiselect: true, querymode: 'local', tabindex: 25, labelwidth: 195, fieldcls: 'text-field-height-style', forceselection: false, listconfig: { loadingtext: '', loadingcls: 'x-wrap-cls x-mask' }, cls: 'combobox-taxesedit' } i have below afterrender method overridden combobox in file. afterrender: function () { try { if (this.store) { if (this.store.superclass.$classname == "data.store" || this.store.superclass.$classname == "ext.data.chainedstore") { if (this.store.isloaded() == false && this.store.is

windows - How to call Submit from Credential Provider -

as far understand, when user presses submit button eventually, getserialization method called login details. i programming credential provider waits external signal log in, , not want user press submit button. is possible trigger submit event credential provider? i found way it. trick not call submit button, use icredentialproviderevents::credentialschanged method. have thread running, trigger credentialschanged . enable new credential logs user in. this shown in microsoft sample samplehardwareeventcredentialprovider . it worth notice windows logonui automatically selects new credential. not know if in documentation, behaviour experienced.

Excel VBA summary paste -

i have tried using following answer: (specified use) sub makesummary() dim sh worksheet, n long dim long, m long n = sheets.count - 1 m = 2 = 1 n sheets(i).range("a12:b17").copy sheets("allinfo").range("a" & m).pastespecial (xlvalues) sheets("allinfo").range("a" & m).pastespecial (xlformats) m = m + 6 next end sub i can't seem te macro paste next each other, can see m pasting under each other how macro past next tried m=m+a since column not work. thanks shairado if want advance columns, let's row 1, , advance m wanted, use sheets("allinfo").cells(1, m).pastespecial (xlvalues) instead – @shai rado

html - How Get the source code of https page ? -

i want https page source code , using down code ; require_once 'simple_html_dom.php'; ob_start(); session_start(); set_time_limit(360000000); error_reporting(1); $url = "https://www.superbahis833.com/services/coupontemplate.mvc/getcoupon?couponaction=todaycoupons&sportids=102%2c410&markettypeid=&eventid=&bookid=&eventclassid=-1&sportid=102&eventtimegroup=etg_nextfewhours_0_0"; $kodlar = file_get_html($url); echo var_dump($kodlar); and return => bool(false) and tryin curl page source code ; $base = "https://www.superbahis833.com/services/coupontemplate.mvc/getcoupon?couponaction=todaycoupons&sportids=102%2c410&markettypeid=&eventid=&bookid=&eventclassid=-1&sportid=102&eventtimegroup=etg_nextfewhours_0_0"; $curl = curl_init(); curl_setopt($curl, curlopt_ssl_verifypeer, false); curl_setopt($curl, curlopt_header, false); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($cur

ios - Completion handler is not called -

pardon me beginner's question, have function completion handler, it's not called when function complete. tip? thanks func updatedailylength(completion: ()-> void ) { //do here } and in caller: updatedailylength(completion: { getmonthlydistance() }) the function getmonthlydistance() never called. you need call updatedailylength func updatedailylength(completion: ()-> void ) { completion() }

jquery - TreeView directory structure in php -

how display files , folders available in current directory php (ftp) see attached image example.... tree view image define('site_url',"http://yourdomain.com"); function listfolderfiles($dir){ $filefolderlist = scandir($dir); echo '<ul>'; foreach($filefolderlist $filefolder){ if($filefolder != '.' && $filefolder != '..'){ if(!is_dir($dir.'/'.$filefolder)){ echo '<li><a target="_blank" href="'.site_url.'/'.ltrim($dir.'/'.$filefolder,'./').'">'.$filefolder.'</a>'; } else { echo '<li>'.$filefolder; } if(is_dir($dir.'/'.$filefolder)) listfolderfiles($dir.'/'.$filefolder); echo '</li>'; } } echo '</ul>'; } listfolderfiles('uploads/'); // fun

c++ - Ptr<Node> a = CreateObject < Node > (); -

while going through different examples in ns-3 ( network simulator) came across definition this. coudn't figure out syntax means. ptr<node> = createobject < node > (); in other cases use similar syntax, rhs quite different. helperclass help; ptr< xxx > = help.somethingrandom(); or prefix const before xxx . i guess different way of creating objects in c++. still confusing. can please elaborate whats happening ? in advance. assuming ptr smart pointer class. seems createobject template function, implementation boils down this: template<typename obj> ptr<obj> createobject() { return ptr<obj>(new obj); } the idea code generic, work type. using function ensures no resources leak during multiple initializations, if constructor happens throw exception. the standard library has equivalent std::shared_ptr / std::unique_ptr matching std::make_shared / std::make_unique functions.

c# - Center Grid according to Grid Cell in WPF -

Image
i have grid in wpf application centered horizontally , vertically, no big deal. however, center entire grid according single grid cell instead of entire grid. possible? here small illustration of want achieve. want red cross center. first picture shows entire grid (the grid green square) being centered, second picture shows entire grid being centered according cell red cross. possible in xaml? didn't provide code on purpose because don't think that's necessary question, it's not have error or doesn't work, have no clue how achieve this. there outer grid, inner grid , element should centered. outer , inner grid have equal row , column weights. layout adapts resize <grid> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="2*"/> <rowdefinition height="*"/> </grid.rowdefinitions> <grid.columndefinitions> <columnde

html - Storing data in SQLite and allowing users to access and modify it using their browser -

first of all, apologize if question has been answered elsewhere. if has, maybe couldn't comprehend solution looking for. i've looked through every relevant stackoverflow question find, believe me. so plan is, i'm creating website university allows users post description of lost items. need store data somewhere, , allow finders of these lost items access these descriptions , contact ones lost it. have sqlite, question (you have figured out i'm pretty noob) can store data receive users in sqlite database , allow others view same using data in database located in machine? @ possible? if so, how go achieving required functionality? in particular: how make when submit button pressed, data input users stored in database. how can let others view stored in database? that said, if has better solution achieving same goal, i'm ears. p.s. i'm versed in java , html, know little javascript , little sql. if goal can reached using these languages only, super. e

scala - Breeze vs. Spire: Can/should I combine them? -

i use breeze's collections (namely densevector ), in have integers , doubles , like, , use them little might use numpy's arrays. stumbled upon https://github.com/non/spire . impression is, not strong on collection, stronger on types might want put inside of collections - e.g. interval sounds awesome. impression right , combining them idea? from https://stackoverflow.com/a/40474914/4533188 learned breeze uses netlib-java fast. destroy speed if put descendants of anyref (in case spire) densevector s back-end arrays instead of descendants of anyval ?

java - C#/WCF SOAP client (without Svcutil.exe or any WSDL tool) for a SOAP-based RPC style web service endpoint created using JAX-WS -

please create c#/wcf soap client (without svcutil.exe or wsdl tool) soap-based rpc style web service endpoint created using jax-ws in following java code snippet? for example, here's python soap client jax-ws: import suds suds.client import client class serviceclient(object): def gethelloworld(self, arg): try: wsdl_url = 'http://localhost:9999/ws/hello?wsdl' client = client(wsdl_url) # print client result = client.service.gethelloworldasstring(arg) return result except suds.webfault f: print(f) print(f.fault) except exception e: print(e) print (serviceclient().gethelloworld('python web service client')) the python soap client output: hello world jax-ws python web service client considering "web services" obsolete/legacy technology , instead wcf recommended in .net, create wcf soap client corresponds aforementioned pytho

GetMethod in Interface as field of class c#? -

this program calculator. examine have: public interface ifunction{ string name {get; } double eval(); } and public class subtract:ifunction{ private double x,y; public double eval(){ return x - y; } public string name{ { return "subtract";} } } public class add:ifunction{ private double x, y; public double eval(){ return x + y; } public string name{ { return "add";} } } i have write class, has string field operation. name of string field must use name{ get; } ifunction , can "add" or "subtract". if "subtract", implement subtract operation, calling eval() method subtract class, , etc; how make polymorphic calling of method in class calculator ? must calculator class implement interface? public class calculator{ private double leftoperand, rightoperand; private string operation; public double calculate(){ /*here must call eval

vb.net - Get value through one of the xmlnode property for currentnode -

my current xml node : <item xsi:type="itm:resource"> <id>10</id> </item> i want read whole tag , search whether resource there or not in tag : selectsinglenode.outerxml.contains("resource") but outer xml considering tags inside item , want current node have tried other properties name,value indeeds return "item" i have done in different way selectsinglenode("xpath").attributes(0).value.contains("resource") hope helps

angular - How to implement ng2-dragula and firebase with sort -

Image
i trying show names have tables numbers , sorted tablenumber. my data looks like: and code is: @component({ selector: 'dropanddrag', template: ` <ul> <li *ngfor="let item of (items|async)" [dragula]='"bag-one"' [dragulamodel]='(items|async)'></li> </ul> ` }) export class sorttablecomponent { items: any; constructor(public service: smarttablesservice) { this.items=this.service.getdata(); } } the problem how can group table number , show, this.items array of objects, template ng should changed name property item.name .

Java: How to change the language of java.util.logging to English? -

i have java.util.logging print output file. works fine. however, messages contain chinese characters correspond log level , time messages logged. how can make print english instead of chinese characters ? this current messages like 11月 08, 2016 8:28:03 下午 mysamples.testing.testingfile errorfunction 資訊: exception: 123 start application passing language on command-line override current default language of os. java -duser.language=en myapplication

java - e4 toolbar too long, doesn't make itself multiline -

my toolbar should set multiline, if cannot display of elements. got lots of tool items in toolbar, how can set, of these displayed, i.e. in multiline toolbar. see fragment.e4xmi model. my e4xmi

JAGS and WinBUGS giving differing DIC -

i'm doing network meta-analysis including several clinical trials. response binomial. each trial contains several treatments. when random effects model, output jags , winbugs similar. when fixed effects model, dic , pd components way out, though posteriors of parameters i'm interested in similar. i've got similar models have gaussian response, not binomial, , jags , winbugs in agreement. the bugs/jags code fixed effects model lifted page 61 of this , appears below. however, same code runs , produces similar posteriors using winbugs , jags, it's dic , pd differ markedly. don't think code problem. for(i in 1:ns){ # loop on studies mu[i] ~ dnorm(0, .0001) # vague priors trial baselines (k in 1:na[i]) { # loop on arms r[i, k] ~ dbin(p[i, k], n[i, k]) # binomial likelihood logit(p[i, k]) <- mu[i] + d[t[i, k]] - d[t[i, 1]] # model linear predictor rhat[i, k] <- p[i, k] * n[i, k] # expected value of numerators

HTML in url to on Rails -

i want have link html content in rails 5 it's seems code doesn't work: <%= link_to "<i class="fa fa-dashboard"></i> <span>dashboard</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span>".html_safe, admin %> i've got syntaxerror in admin::indexcontroller#index want go admin/index controller index action... thanks. if can't make route helpers work, use explicit url_for syntax instead. can pass block put html in links more easily: <%= link_to url_for(:controller => 'admin/index', :action => :index) %> <i class="fa fa-dashboard"></i> <span>dashboard</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> <% end %> running rake routes (or rails routes , rails 5) show

java - Slenium web driver : Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: ce6fd} -

while running selenium webdriver script got error named "org.openqa.selenium.firefox.notconnectedexception: unable connect host 127.0.0.1 on port 7055 after 45000 ms. firefox console output". platform used : firefox - 44.0.2 selenium web driver - 2.48.2 language - java also tried many suggestion google different version of firefox , selenium still facing issue. please me out overcome error. try using selenium 3.0.1 latest firefox. don't forget download gecko driver , set system variable it's path: system.setproperty("webdriver.gecko.driver","path of geckodriver.exe"); webdriver driver = new firefoxdriver();

jetty - Solr is trying to connect to different external server IP -

i'm running solrcloud example, solr 5.4 zookeeper 3.5.2 alpha. cloud running got error : error: error server @ http://localhost:8983/solr: expected mime type application/octet-stream got text/html. <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>error 404 not found</title> </head> <body><h2>http error 404</h2> <p>problem accessing /solr/gettingstarted/config. reason: <pre> not found</pre></p><hr><i><small>powered jetty://</small></i><hr/> </body> </html> solrcloud example running, please visit: http://localhost:8983/solr then when try delete collection ./solr delete -c gettingstarted i got error saying deleting collection connecting 104.239.213.7 instead of localhost, doesn't connect of course. error : deleting collection 'gettingstarted' using command: http://104.2

java - How To Display Admob Interstitial Every Time A Button Is Pressed -

i'm beginner when comes android development. first application. know how display admob interstitial ad every time button pressed. have managed display interstitial ad, on first time button pressed. however, getting error when trying load ad. here code: package com.mycash.borgjake.mycash; import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.widget.button; import android.widget.textview; import android.view.view; import com.google.android.gms.ads.adlistener; import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; import com.google.android.gms.ads.interstitialad; import static com.mycash.borgjake.mycash.r.styleable.view; public class mainactivity extends appcompatactivity { private interstitialad minterstitial; button btnclick; button btnwithdraw; textview txtbalance; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

Compare individual values of 2 multi-dimensional arrays in google script -

i have 2 multi-dimensional arrays i'm trying compare data against. while length of nested arrays may vary on case-by-case basis, each instance lengths same , mirrored between both arrays , first array[0] of each contain exact same info. thing will/may vary order headers may appear in array[0]. may be h1, h2, id in first and id, h1, h2 in second array. full example 1st array [ [ header1 , header2 , id ] , [ dataa , datab , 000 ] ] 2nd array [ [ header1 , header2 , id ] , [ dataa , datab , 111 ] ] question how can parse, loop, split, whatever (still new this) can compare each values , put them single array? result wanted [ [ oldheader1 , oldheader2 , oldid , newheader1 , newheader2 , newid ] , [ dataa , datab , 000 , dataa , datab , 111 ] ] and yes, dataa , datab should same both sources. i'm comparing against, ids of each things should different. if dataa doesn't match datab does, i'd continue add logging. that's la

android - How to add variable to link -

i using retrofit library , weather forecast openweatherapi. i have this. base url: http://api.openweathermap.org/data/2.5/ @get("weather?q=&units=&appid=" + api_key) call<weatherapi> getweathercity(@query("city") string city, @query("units") string units); but bad url (i not know how repair it) - response{protocol=http/1.1, code=502, message=bad gateway, url= http://api.openweathermap.org/data/2.5/weather?q=&units=&appid=111111111111111111111111&city=&units=metric } your problem in url. if break url down able see error. so have main body of url: http://api.openweathermap.org/data/2.5/weather then first param ?q= havent added after =, first problem. then: &units= again nothing after =, next problem. then: &appid=111111111111111111111111 bit fine. then: &city= again nothing after =. then: &units=metric bit fine. so problem not passing values parameters.

Get Resource URL Path in Java Spring -

trying path of json file have in resource folder failing getresource().getpath() . url in robust manner possible. public static void initializefirebase() { try { url url = getresource("google-services.json"); system.out.println(url.getpath()); firebaseoptions options = new firebaseoptions .builder() .setserviceaccount(new fileinputstream(url.getpath())) .setdatabaseurl("https://xxxxx.firebaseio.com/") .build(); firebaseapp.initializeapp(options); } catch (ioexception e) { e.printstacktrace(); } } the above function prints: /users/username/documents/spring_project/springbackend/build/resources/main/google-services.json before throwing error: exception in thread "main" java.lang.runtimeexception: failed read service account @ com.google.firebase.firebaseoptions$builder.setserv

javascript - Pick out object from array using id. Node.js and Express -

i have task school, , working node.js & express. im stuck. if paste browser http://localhost:3000/courses/2 need course id of 2 in array below. thist part of array... courses[0] = '{"_id":1,"courseid":"dt162g","coursename":"javascript-baserad webbutveckling","courseperiod":1}'; courses[1] = '{"_id":2,"courseid":"ik060g","coursename":"projektledning","courseperiod":1}'; courses[2] = '{"_id":3,"courseid":"dt071g","coursename":"programmering c#.net","courseperiod":2}'; courses[3] = '{"_id":4,"courseid":"dt148g","coursename":"webbutveckling för mobila enheter","courseperiod":2}'; here code router.get('/:id', function(req, res, next) { var id = req.params.id; var get_course = "no cours

python - Azure rest API AuthorizationFailed error -

i have tried read alerts via following azure api endpoint = 'https://management.azure.com/subscriptions/{subscription_id}/providers/microsoft.security/alerts?api-version=2016-03-01' headers = {"authorization": 'bearer ' + access_token} json_output = requests.get(endpoint, headers=headers).json() it returns following error message, {u'error': {u'message': u"the client '8447xxxx-xxxx-xxxx-xxxx-49bb99abxxxx' object id '8447xxxx-xxxx-xxxx-xxxx-49bb99abxxxx' not have authorization perform action 'microsoft.security/alerts/read' on scope '/subscriptions/{subscription_id}'.", u'code': u'authorizationfailed'}} regarding message, need "security manager" role added credentials: see role description: https://azure.microsoft.com/documentation/articles/role-based-access-built-in-roles/#security-manager how apply role (ps, cli or restapi): https://azure.microsoft.c