Posts

Showing posts from March, 2015

jsp - Jar try to create service in windows on java wrapper -

hellow. today in first time try create service in os windows used jar. try used java wrapper community edition 3.5.29 create test_service in windows ok. next step try start new test_service. service try startup , down. in logs java wrapper has information. status | wrapper | 2016/07/19 11:53:21 | --> wrapper started service status | wrapper | 2016/07/19 11:53:21 | java service wrapper community edition 32-bit 3.5.29 status | wrapper | 2016/07/19 11:53:21 | copyright (c) 1999-2016 tanuki software, ltd. rights reserved. status | wrapper | 2016/07/19 11:53:21 | http://wrapper.tanukisoftware.com status | wrapper | 2016/07/19 11:53:21 | status | wrapper | 2016/07/19 11:53:22 | launching jvm... info | jvm 1 | 2016/07/19 11:53:22 | [11:53:22 19.07.2016]: starting oracle. info | jvm 1 | 2016/07/19 11:53:22 | [11:53:22 19.07.2016]: try update. info | jvm 1 | 2016/07/19 11:53:22 | [11:53:22 19.07.2016]: update ok. error | wrapper | 2016/07/19 11:54:21 |

java - OSGi Http Whiteboard pattern -

moving web.xml osgi http whiteboard pattern created bundle-context.xml how pass below properties web.xml in jspservletfilter's osgi:service-properties <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <el-ignored>true</el-ignored> </jsp-property-group> </jsp-config> i tried below solution not work. <bean id="jspservlet" class="com.test.servlet.web.servlet.testjspservlet"/> <osgi:service ref="jspservlet" interface="javax.servlet.servlet" > <osgi:service-properties> <entry key="osgi.http.whiteboard.filter.name" value="jspservlet" /> <entry key="osgi.http.whiteboard.servlet.pattern" value-ref="jsppatternslist"/> <entry key="osgi.http.whiteboard.context.select" value="(osgi.http.whiteboard.context.name=cb)" />

Sitecore List Manager: add new contact -

i'm trying add new contact empty list in sitecore list manager. click "create , add new contact", type appropriate data , click "save" button. after following messages: please note list being built , locked. and please note contacts in list being indexed, not contacts available view @ time. 0 out of 1 contacts indexed. then use "index manager" , rebuild "sitecore_list_index". after that, go list manager , unlock list manually. finally, can't see contacts in list. can't figure out what's wrong. edited sitecore version 8.1 (it upgraded 8.0) this issue in 8.0, there contact locking issue. @ list manager @ bottom of list. upgrade should fix issue. kb.sitecore.net/articles/616431

ios - Xcode UITesting: label disappears from hierarchy and won't come back -

this using xcode 7.2.1 , swift 2.0. i have table cell containing uilabel used display error message. @ initial load blanked using code this: cell.errorlabel.alpha = 0.0 cell.errorlabel.text = nil then later on when i've detected error want display this: cell.label.text = "to" cell.errorlabel.alpha = 1.0 cell.errorlabel.text = "error !!!!" this works fine when running app. when running in ui test, try test error being displayed this: let tocell = xcuiapplication().tables.... // finds cell label 'to' xctasserttrue(tocell.statictexts["error !!!!"].exists) and fails. i've verified i'm getting right cell checking other ('to') label present. is. ui testing not see error label. i've tested adding break point , using debugger this: (lldb) p tocell.statictexts.count t = 427.03s number of matches for: descendants matching type statictext t = 427.29s snapshot accessibility hierarchy enterpri

c# - XAML - Update text on different property update -

so have following xaml: <textblock text="{binding disconnecteddevices, updatesourcetrigger=propertychanged}" /> the view model has following properties: public string disconnecteddevices {get; set;} public ienumerable<ideviceinformationvm> devicecollection {get; set;} there's method gets called raises property notified event: public void devicecollectionchanged() { raisepropertychanged(() => devicecollection); } i'd update value in textblock when devicecollection changes. i'm aware call raisepropertychanged on disconnecteddevices i'm wondering if possible update textblock on different property change event. thanks all! edit: suggestions using observablecollection instead of ienumerable, unfortunately, i'm not @ liberty change collection type.. the devicecollectionchanged method called whenever collection changes (tedious know...) further edit: have gone ahead with raisepropertychanged(() => disconnecteddevic

sql - how to select one row from several rows with minimum value -

the question based on sql query select distinct row minimum value . consider table: id game point 1 x 1 1 y 10 1 z 1 2 x 2 2 y 5 2 z 8 using suggested answers mentioned question (select ids have minimum value in point column, grouped game) obtain id game point 1 x 1 1 z 1 2 x 2 the question how obtain answer single output each id. both outputs id game point 1 x 1 2 x 2 and id game point 1 z 1 2 x 2 are acceptable. use row_number() : select t.* (select t.*, row_number() on (partition id order point asc) seqnum t ) t seqnum = 1;

excel - Loop Cells to check hours passed -

i trying find macro loop through column check hours compared current time. date/time entered cell via button on form , formatted mm/dd/yyyy hh:mm:ss , want run macro once every hour find cells in column older 6 hours , needs work if goes next day. tried 1 small piece of code found results incorrect. for each rcell in rrng.cells if rcell < hour(now) - 6 msgbox rcell.address, rcell.value elseif rcell = "" exit sub else the datetime values in excel stored decimal. have compare difference between cell's value , now greater 6.0/24 for each rcell in rrng.cells if - rcell.value > (6.0/24) msgbox rcell.address, rcell.value elseif rcell = "" exit sub else ......

php - Send array as json and read that data -

i encoding array json , sending curl other file: $data = array( "authorizedkey" => "abbad35c5c01-xxxx-xxx", "senderemail" => "myemail@yahoo.com", "recipientemail" => "jaketalledo86@yahoo.com", "comment" => "invitation", "forcedebitcard" => "false" ); $data = json_encode($data); $ch = curl_init('http://localhost/curl/1.php'); $headers = array('accept: application/json','content-type: application/json'); curl_setopt($ch, curlopt_customrequest, "post"); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_httpheader, $headers); echo curl_exec($ch); curl_close($ch); problem http://localhost/curl/1.php dont recieve $_post , dont know how operate on posted data. http://localhost/curl/1.php output: headers

angular - Copy values of objects without binding them -

i'd copy copy values of object (item) 1 (editeditem) put form , modify while original object still displayed unchanged. <a (click)="editeditem=item">edit</a> with approach 2 objects bound, item changes when editeditem modified. there way copy values without binding objects? you can use json.parse(json.stringify()) if don't care types. here example: html <a (click)="copy()">edit</a> ts copy() { this.editeditem = json.parse(json.stringify(this.item)) }

Why can i easily decode auth0 id_token on jwt.io? -

okay, i'm developing angular 2 app. i've added auth0 authentication, me handles sessions insecurely. jwt token not encrypted , saved inside localstorage. claims visible anyone, can decoded , revealed. not mention, web storage isn't secure place. i'm opting jwts because later want transform web app desktop app electron , cannot use cookie-sessions. users have additional information such roles, don't want in db on every request, that's why store them in jwt. makes sense encrypt data, auth0 doesn't seem provide function. if claims roles stored in localstorage unprotected, what's stopping me go firefox console , change token, e.g. make myself admin? if claims roles stored in localstorage unprotected, what's stopping me go firefox console , change token, e.g. make myself admin? because jwt signed , so alteration content or signature detected during validation the digital signature, third part of jwt token hhhhhh.ppppppp.ssssss c

java - Android Firebase - Why Null Values in Map fields are ignored -

i discovered when saving pojo map field using firebase on android, if map contains nulls in value property of map, whole field ignored. the workaround easy (non-null values result in map saving successfully), want understand why so? model public class game { private string owner; private map<string, string> characters; public game() { // empty constructor firebase } public string getowner() { return owner; } public void setowner(string owner) { this.owner = owner; } public map<string, string> getcharacters() { return characters; } public void setcharacters(map<string, string> characters) { this.characters = characters; } } calling code final game game = new game(); game.setowner("owner"); game.setcharacters(new hashmap<string, string>()); game.getcharacters().put("bugs bunny", null); game.getcharacters().

java ee - Persisting a Joint Table in JPA -

i have 3 entities, trader, portfolio , member. each trader has portfolio , portfolio can have many members. have set following relationships. i'm not sure how use jointable created, i.e. portfolio_portfolioid , members_memberid. i'd associate each portfolid member id's, i'm not sure how go this. how jointable data persisted? my portfolio class @entity @table(name="portfolio") @namedquery( name="findportfoliobytrader", query="select p portfolio p" + " trader = :trader" ) public class portfolio { @id @generatedvalue private integer portfolioid; @temporal(timestamp) private date lastupdate; private integer balance; private trader trader; private collection<member> members; public portfolio() { this.lastupdate = new date(); } public portfolio(integer balance, trader trader) { this.lastupdate = new date(); this.balance = balance; this.trader = trader; } public integer getportfolioid() { return p

http - Is there any advantage of using X-Robot-Tag instead of robots.txt? -

it looks there 2 mainstream solutions instructing crawlers index , not index: adding x-robot-tag http header, or indicating robots.txt. is there advantage using former? with robots.txt cannot disallow indexing of documents. they have different purposes: robots.txt can disallow crawling (with disallow ) x-robots-tag ¹ can disallow indexing (with noindex ) (and both offer additional different features, e.g., linking sitemap in robots.txt , disallowing following links in x-robots-tag , , many more.) crawling means accessing document. indexing means providing link (and possibly metadata or about) document in index. in typical case, bot indexes document after having crawled it, that’s not necessary. a bot isn’t allowed crawl document may still index (without ever accessing it). bot isn’t allowed index document may still crawl it. you can’t disallow both . ¹ note header called x-robots-tag , not x-robot-tag . way, metadata name robots (for html meta e

app store - invite/install iOS app with custom action -

i building group im app (like groupme), , want allow users invite new users app adding them group, when new user installs , opens app, automatically added group. i have of implemented, cannot figure out how pass data installation can add new user group. is possible trigger custom action upon installation? right i'm texting invite urls forward user app store: http://appstore.com/appname/appname if add parameters end of it, how retrieve them in app code? i have been researching maybe i'm looking wrong thing. found "deep linking" frameworks http://applinks.org/ doesn't seem custom invites.

c - get the float number's exponents -

this question has answer here: how sign, mantissa , exponent of floating point number 6 answers i started learning floating point , know sme stuff. i'm still confused mantissa... can explain me how can exp part of float. sorry if that's super stupid , basic question having hard time understanding it... also how implement following function... implementation wrong. how do it? // extract 8-bit exponent field of single precision // floating point number f , return unsigned byte unsigned char get_exponent_field(float f) { // todo: code here. int bias = 127; int expp = (int)f; unsigned char e = expp-bias; return e; } if want extract ieee-754 single precision exponent float value (in excess 127 notation ), can use float functions, or can use simple union shift , mask same: unsigned float_getexp (float f) { union { unsigned u;

javascript - How to send email on Adobe Air + backbone.js application -

i have developed web application using adobe air , backbone.js. i'm using jade template create contact form. jade code of form below: div.span6.span_col_2.custom_span6#rightcontact div.well.well-large.well-custom form.form-horizontal fieldset input(type="hidden" name="type_contact" value="") - inco = { fkey:"contact_description" } include field_textarea_val - inco = { fkey:"contact_email" } include field_text_val - inco = { fkey:"contact_phone" } include field_text_val a#sendbtn.btn.btn-warning( imsg="send", href="#rwsendcontact" ) when user click send button, content input fields send controller. please @ controller code below: var contactrouter = backbone.

mariadb - Excluding data from a queried table after sql join -

i don't know if not thinking correct join structure can't seem results want join. this sql schema these 3 tables schema select target, sender, message, amount, transactiontime, transaction_id transactions join accounts on transactions.sender=accounts.account_id join users on users.user_id=accounts.user_id users.user_id=40 union select target, sender, message, amount, transactiontime, transaction_id transactions join accounts on transactions.target=accounts.account_id join users on users.user_id=accounts.user_id users.user_id=40 order transactiontime limit 20; sql result table this query have , queries through 3 tables. want information transaction table want exclude account_id not associated user. in case user id 40 , account_id 57. wondering how able rid of that. how 3 not show up. bonus, structure of query including id's associated accounts. if account_id 4 , 57 belonged 1 user , money flowing between them. how able see both 4 , 57 in transaction

java - How to read in an "Enter"/"Return" -

i'd exit while loop when user inputs enter / return key. here's code: do { //id=sclocal.nextint(); try{ id=sclocal.nextint(); }catch(inputmismatchexception exception) { system.out.println("invalid input!"); return; } if(listperformer.size() <= id || id < 0) { system.out.println("invalid input!"); return; } else { idlist.add(listperformer.get(id)); } }while(sclocal.nextline().length() > 0); //here want: * *if user not want input id, input nothing else , press "enter" leave loop. if working jframe or other swing components can similar example. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class test extends jframe { private jpanel testpanel = new jpanel(new gridbaglayout()); private gridbagconstraints c = new gridbagconstraints(); private jlabel label1 = new jlabel(&quo

javascript - Two objects with the same value, calculating and changing values of one object. And the second one misteriously has the new values too -

it might late @ night , might become crazy how can be. i have following scenario: var x = {a: [], b: []}; var y = {a: [], b: []}; model.somefunction(obj1, function(res){ x.a = res; y.a = res; model.somefunction(obj2, function(res){ x.b = res; y.b = res; machewasanderes(); // content of both objects: // x = {a: [punkt1: 20, punkt2: 30}, b: {punkt1: 50, punkt2: 60}]}; // y = {a: [punkt1: 20, punkt2: 30}, b: {punkt1: 50, punkt2: 60}]}; }); }); function machewasanderes(){ for(let prop in x){ for(let = 0; < x[prop].length; i++){ for(let propa in x[prop][i]){ x[prop][i][propa] = x[prop][i][propa] / 100; } } } console.log("x", x); console.log("y", y); // x = {a: [punkt1: 0.02, punkt2: 0.03}, b: {punkt1: 0.05, punkt2: 0.06}]}; // y = {a: [punkt1: 0.02, punkt2: 0.03}, b: {punkt1: 0.05, punkt2: 0.06}]}; } as can see receiving data callbacks of model

Android AlertDialog divider not showing everywhere -

Image
i'm displaying simple dialogfragment alertdialog , simple list. public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.setitems(times, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { } }); builder.settitle("select end date"); alertdialog alertdialog = builder.create(); listview listview = alertdialog.getlistview(); listview.setdivider(new colordrawable(color.black)); listview.setdividerheight(1); return alertdialog; } } but can see on picture bellow, not diver black ?? me normal divider between items ?

ios - how to change the button colour if checkbox is checked in swift? -

i have agree button below 2 checkbox. want enable agree button , change colour of agree button after both checkbox checked. have used custom images checkbox. using code this uibutton class let selectedimage = uiimage(named: "checkbox_checked") let unselectedimage = uiimage(named: "checkbox_unchecked") class qbutton: uibutton { //bool property var ischecked:bool = false{ didset{ if ischecked { self.setimage(selectedimage, forstate: uicontrolstate.normal) }else{ self.setimage(unselectedimage, forstate: uicontrolstate.normal) } } } override init(frame: cgrect){ super.init(frame:frame) self.layer.maskstobounds = true self.setimage(unselectedimage, forstate: uicontrolstate.normal) self.addtarget(self, action: "buttonclicked:", forcontrolevents: uicontrolevents.touchupinside) self.ischecked = false } require

php - Unique Value from multidimensional array -

i'm fetching data database in multidimensional array this $par = []; $var = db::table('welcome_call_done')->where('state','like', '%'. $states .'%')->where('city','like', '%'. $citys .'%')->get(); foreach($var $val) { $prod = db::table('welcome_call_product')->where(['assoc_id' => $val->assoc_id])->get(); array_push($par, $prod); } $unique = array_map("unserialize", array_unique(array_map("serialize", $par))); i want display singles values after execution display multiple data. please tell solution sort problem.

java - Capturing Image in Android getting error on onActivityResult -

i trying capture image in android getting error like: fatal exception: main process: com.pace.planes, pid: 18741 java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=1888, result=-1, data=intent { dat=content://media/external/images/media/4532 }} activity {com.pace.planes/com.pace.planes.confirmation}: java.lang.nullpointerexception while used suggested solutions on stack overflow. here code: captureimage.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent cameraintent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent, camera_request); } }); and here onactivityresult code: protected void onactivityresult(int requestcode, int resultcode, intent data) { if(result

javascript - How to get Steam user inventory online -

ok found out how json after searching answer not find 5 hours. http://steamcommunity.com/profiles/ {steamid}/inventory/json/730/2/?trading=1 brings json. im wondering how can picture of weapon, name , price , store able show on webpage...this csgo here if question isnt clear enough picture of online inventory thats csgopowerball.com if wondering. here im talking about, thats inventory, , grabbed gun, name , price , wear. im wondering how im able grab info json that. cause dont know price or wear on there. if still confused please add me on skype: pannduuh

ios - is it possible to list out all the applications that are installed in the iPhone device in a tableview with icon? -

i want collect applications installed in device , want list icons of applications. apple's provacy concerns have extended app querying other apps on devices, of ios 9 apple have removed ability unless explicitly declared. in past developer use method - canopenurl: defined on uiapplication , passed in url known handled app see if user had app on phone. whilst not viable getting comprehensive list of apps on user's phone, serve know if specific apps there. ios 9 introduced concept of whitelisting url schemes, meaning if going query have explicitly state in .plist. for guide on how works recommend article: http://www.dysonapps.com/blog/2015/9/13/developing-for-ios-9-canopenurl the short answer no, cannot list of other apps on device.

php - Error in loading drupal website -

i'm new drupal user, have website drupal file, want load on localhost, after installing drupal, , when want access localhost/mysite/index.php, got error: access denied warning: call_user_func_array() expects parameter 1 valid callback, function 'ctools_access_menu' not found or invalid function name in c:\wamp\www\mysite\includes\menu.inc on line 454. you not authorized access page. what should do? , how can import existing drupal project on localhost? you may use backup , migrate module backup live site , restore on localhost.

asp.net mvc - Using Viewmodel to populate sql data and add columns -

i take model of table , make viewmodel additions fields, populate view. how do in controller? when model worked i'm not sure how same thing when it's viewmodel. i'm new asp.net mvc appreciated. model: public partial class tbltag { public int tagid { get; set; } public string tagname { get; set; } } viewmodel: public class tbltagviewmodel { public string tagname { get; set; } public string tagnameclr { { if (tagname == "test") { return "green"; } else { return "red"; } } } } controller: cannot implicitly convert type 'system.data.entity.dbset<_1mvcsqlserver.models.tbltag>' '_1mvcsqlserver.viewmodel.tbltagviewmodel' now it's viewmodel structure entities different, assume problem. how resolve this? private te

arrays - Java - convert TreeNode into JSONArray -

i using library construct tree of strings: https://github.com/shell-software/tree , , jar library deal jsons. i want convert treenode into jsonarray , so: assuming every node children jsonarray, each leaf jsonobject , root jsonarray, how can iterate nodes of tree create json?

objective c - Device is Registered for notification but did not get device token -

here code - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) { [[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes: (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound) categories:nil]]; [[uiapplication sharedapplication] registerforremotenotifications]; } else { [[uiapplication sharedapplication] registerforremotenotificationtypes: (uiusernotificationtypebadge | uiusernotificationtypesound | uiusernotificationtypealert)]; } [application registerforremotenotifications]; return yes; } - (void)application:(uiapplication *)application didregisterusernotificationsettings:(uiusernotificationsettings *)notificationsettings { //register receive notifications nslog(@"device registered.

javascript - What would be the simplest way to automatically have the URL segment updated? -

Image
this question url update feature when changing value of page title field. behaviour coded cmsmain.editform.js . i'm stripping down , customising cms usable absolute basic computer user or negligent client, skip pressing update url button upon page name change. in these cases convenient if urlsegment automatically updated. q: simplest way automatically have url segment updated, ie simulate result appear upon clicking "update url" button, after changing title field? you make extension sitetree , include function onbeforewrite this. make change if updated title , not url: class autourlsync extends extension { public function onbeforewrite() { // if title changed, urlsegment not, // update urlsegment here if($this->owner->ischanged('title',2) && !$this->owner->ischanged('urlsegment',2)) { $this->owner->urlsegment = $this->owner->generateurlsegment($this->own

webix - Cannot run multiple karma tests using suave server -

when run below tests individually (by commenting out) each test passes. however, when run tests xmlhttprequest uncaught exception. suave test server receives requests , logging shows no errors or problems: var home_url = "http://localhost:3000/request"; it("should echo test request response", function (done) { var test = { act: 'test1', qry: {} }; var promise = webix.ajax().post(home_url, json.stringify(test)); console.log('test1'); promise.then(function (resp) { expect(resp.json().succ).to.be(true); done(); }).fail(function (err) { done(); throw(err); }); }); it("should echo test request response 2", function (done) { var test = { act: 'test2', qry: {} }; var promise = webix.ajax().post(home_url, json.stringify(test)); console.log('test2'); promise.then(function (resp) { expect(resp.json().succ).to.be(true); done(); }).

matlab - How to use calibration parameters from KITTI? -

i'm working on stereo vision , using data kitti vision benchmark suite, calibration parameters use different parameters stereo camera calibrator toolbox produce , couldn't find way use data in matlab. i tried use calibration images in stereo camera calibrator toolbox looks this: calibration toolbox matlab but when run calibration fails saying calibration fails : unable estimate camera parameters. images may contain severe less distortion or 3-d orientations of calibration pattern similar across images, if calibration pattern orientations similar, try removing similar images or adding additional images pattern in invalid orientations please me if have idea on how solve this

c# - ASP.NET MVC - Adding multiple model items to a single column -

for mvc project, want add model elements table in following format: ╦═══════════╦ ║ season # ║ &lt-------(seasonid selector ddl) ╩═══════════╩ ╔═══╦═══════════╦═════════════════════════╗ ║ ║ team name ║ player names ║ ╠═══╬═══════════╬═════════════════════════╣ ║ 1 ║ gsw ║ playera playerb playerc ║ ║ ║ ║ playerd player e ║ ║ 2 ║ okc ║ playera playerb playerc ║ ║ ║ ║ playerd player e ║ ║ 3 ║ cle ║ playera playerb playerc ║ ║ ║ ║ playerd player e ║ ║ 4 ║ sas ║ playera playerb playerc ║ ║ 5 ║ tor ║ playera playerb playerc ║ ╚═══╩═══════════╩═════════════════════════╝ i managed adding seasonteam viewbag list , looping through each 1 team name in season . loop through each item in roster model , compare seasonteamid in viewbag list , if viewbag list.seasonteamid == model.seasonteamid , add player name row. think following code can explain. relationship between entities:

Gulp makes no changes -

i'm starting gulp, don't error seems gulp.watch don't work. server starts , compile, not refresh changes. comment lines simplify tasks. node version: 4.4.7 cli version 1.2.2 local version 3.9.1 os: win7 my gulpfile .js 'use strict'; var gulp = require('gulp'); var less = require('gulp-less'); var browsersync = require('browser-sync').create(); var jade = require('gulp-jade'); var concat = require('gulp-concat'); gulp.task('less', function() { return gulp.src("./des/less/estilos.less") .pipe(less()) .pipe(gulp.dest("./prod/css/")) .pipe(browsersync.stream()); }); gulp.task('less:watch', function () { gulp.watch('./des/less/*.less', ['less']); }); gulp.task('templates', function() { gulp.src('./des/jades/*.jade') .pipe(jade({ pretty: true })) .pipe(gulp.dest('./prod')) .pipe(browsers

c# - How to simulate the file attribute of a .config file's appSettings section -

microsoft gives instructions how use file attribute make .config file's appsettings section reference file: example: <appsettings file="c:\commonsettings.config"> <add key="myappspecificsetting" value="setting1" /> </appsettings> however, implemented appsettings , isn't general .config file feature. now, have implemented own configurationsection , , able specify file= 1 can appsettings . aside creating property match attribute , retrieve file name, how can recreate/simulate functionality in custom configsection ? thankfully have the source code now . looks it's implemented appsettingssection reading file system, nothing special can reuse in own configuration section. protected internal override void deserializeelement(xmlreader reader, bool serializecollectionkey) { string elementname = reader.name; base.deserializeelement(reader, serializecollectionkey); if ((file != null) &&

asp.net mvc - How to set default value to empty EditorFor-field when post a form i .NET MVC -

i have form in .net mvc 5. user can write number, default "0", if user deletes number e.g. "233" leaving field empty. form not submit. how can submit form empty field? public class mymodel { public int nummer { get; set; } public mymodel(){} public mymodel(int i) {this.nummer = i;} } razor code: using (html.beginform("myaction", "mycontroller", formmethod.post, new { @class = "form-inline" })) { @html.antiforgerytoken() @html.validationsummary(true, "", new { @class = "text- danger" }) @html.editorfor(model => model.nummer, new { htmlattributes = new { @class = "form-control " } }) <input type="submit" value="submit" name="btnsubmit"/> } i not interested in validation error message, have value set "0", default. the defaultmodelbinder initializes model using parameterless constructor (your second constructor

how to load nested XML into data table in c# -

i want convert xml data data table.my xml file contains many nested tags.how can display data in data table using c# <school> <staff> <staffname>raj</staffname> <staffname>rani</staffname> </staff> <students> <firstclass> <name>nani</name> <rollno>1</rollno> </firstclass> <secondclass> <name>rani</name> <rollno>1</rollno> </secondclass> </students> </school> this sample file .now want display data in data table using c#. can 1 me solve issue you can use following code dataset dstest = new dataset(); dstest.readxml(filepath, xmlreadmode.auto); datatable dt = dstest.tables[0];

fft - How FFT2 is computed in Matlab -

so have matrix m=(50,50,250) , want fft2 of slices s=(50,50) along 3rd dimension = 250. let's ft = fftshift(fft2(m)); is calculating ft want? because in function description says function returns 2-d dft each higher dimensional slice of x. example, if size(x) = [100 100 3], fft2 computes dft of x(:,:,1), x(:,:,2) , x(:,:,3) . so, assuming computing ft of slices s=(50x250) along 1st dimension = 50. can clear me? i think quite clear documentation. fft2 computes 250 2d dfts, 1 each of 50x50 slices in m. ft(:, :, i) 2d dft of m(:, :, i). behaves same as: ft = zeros(size(m)); = 1 : size(m, 3) ft(:, :, i) = fft2(m(:, :, i)); end you verify follows ( error should small): ft1 = fft2(m); error = norm(abs(ft1(:) - ft(:))); however, behavior of fftshift not consistent want. should instead use second argument of fftshift shift result along specific dimensions (1 , 2 in case): ft = fftshift(fftshift(fft2(m), 1), 2);

javascript - What all core Node Js modules does Express Js built on? -

what core modules of node.js used built express js framework. know have 'http' , 'fs' modules, else express js have? i did simple search on repository require , , manually checked result. these core modules came with: assert events fs http https path url util i have checked source code of express itself, not dependencies' source code. anyway, hope helps. just out of curiosity: answer for? why want know that?

javascript - ng-click doesn't work in responsive angular-datatables -

i'm trying click on element of table in responsive way, doesn't work. seems ng-click doesn't work perfectly.. this html table: <table id="listadifferite" datatable="ng" dt-options="mycontroller.dtoptions" class="table table-bordered table-striped" cellspacing="0" width="100%"> <thead> <tr> <th>col1</th> <th>col2</th> <th>col3</th> <th>col4</th> </tr> </thead> <tbody> <td data-dt-column="{{differite.iddif}}_0" class="text-center">prova</td> <td data-dt-column="{{differite.iddif}}_1" class="text-center"> <a ng-click="controllerdif.mostradettaglio(differite)"><i class="fa fa-search-plus"></i></a> </td> <td data-dt-column="

openerp - Adding multiple products in many2many field in custom module should convert into invoice lines -

i adding multiple products in field.now have 2 convert product list 1 one invoice lines automatically.i create button when click on create invoice automatically.but not able add invoice lines of product. can me how add many products invoice lines 1 one. you need call create method dicionary of values the id of current poduct: @api.one def _add_to_invoice(self): #you need pass the id of product invoice , add others #fields self.env['invoice'].create({'product_id',int(self.id),'field_one':your_value})

python - Installing pyaudio with pip in a virtualenv -

i'm trying install pyaudio pip: pip install pyaudio in virtualenv i'm getting error: error: command 'x86_64-linux-gnu-gcc' failed exit status 1 entire output: collecting pyaudio using cached pyaudio-0.2.9.tar.gz building wheels collected packages: pyaudio running setup.py bdist_wheel pyaudio ... error complete output command /home/mertyildiran/downloads/virtualenvironment/vir1/cerebrum/env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-gcltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpyr6j73pip-wheel- --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 copying src/pyaudio.py -> build/lib.linux-x86_64-2.7 running build_ext building '_portaudio' extension creating build/temp.linux-x

c++ - Simple task-based OpenMP application hangs -

the following small program ( online version ) attempts calculate area of 64 64 square recursively dividing 4 squares until smallest square has unit length (hardly optimal). reason program hangs. doing wrong? #include <iostream> unsigned compute( unsigned length ) { if( length == 1 ) return length * length; unsigned a[4] , area = 0 , len = length/2; for( unsigned = 0; < 4; ++i ) { #pragma omp task { a[i] = compute( len ); } #pragma omp single { area += a[i]; } } return area; } int main() { unsigned area , length = 64; #pragma omp parallel { area = compute( length ); } std::cout << area << std::endl; } the single construct acts implicit barrier threads in team. however, not threads in team encounter single block, because different threads working @ different recursion depths. why application hangs. in case code not cor

javascript - Moment.js not accepting query string as valid input -

i have following function converts query string moment (or date) object. i've run bunch of tests , basically moment.js doesn't seem accept req.query.m valid string . moment works fine if hardcode input, , i'm able query string itself. the query string is: http://localhost:8080/file/newcalendar?m=1455910939 app.get('/file/newcalendar', function(req, res) { var dateselect = req.query.m; var selecteddate = moment(req.query.m); var selectedmonth = selecteddate.month(); jsontest = { 'testquery': dateselect, 'testmomentonquery': moment(req.query.m), 'testmomentonvariable': moment(dateselect), 'testmomentmonth': moment(12345678).month(), }; res.json(jsontest); }) i've tried using date() instead of moment. app.get('/file/newcalendar', function(req, res) { var selecteddate = date(req.query.m); var selectedmonth = selecteddate.getmonth(); jsontest = {

How to pass variables and data from PHP to JavaScript? -

i have variable in php, , need value in javascript code. how can variable php javascript? i have code looks this: <?php ... $val = $myservice->getvalue(); // makes api , db call ?> i have javascript code needs val , looks along lines of: <script> myplugin.start($val); // tried this, didn't work <?php myplugin.start($val); ?> // didn't work either myplugin.start(<?=$val?> // works sometimes, fails </script> there several approaches this. require more overhead others, , considered better others. in no particular order: use ajax data need server. echo data page somewhere, , use javascript information dom. echo data directly javascript. in post, we'll examine each of above methods, , see pros , cons of each, how implement them. 1. use ajax data need server this method considered best, because your server side , client side scripts separate . pros better separation between layers - i

Getting syntax error in sql query using PHP and MySQL -

i getting following error while using mysql query. error: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'o.user_id='rnayak2009@gmail.com' , (o.status='successful' or o.status='pending' @ line 1 i explaining query below. select o.order_id,o.order_date,o.payment_amount, o.status,op.pro_data_id,pd.image,pd.pro_id,pi.product_name db_order o left join db_order_products op on o.order_id = op.order_id left join db_product_data pd on op.pro_data_id=pd.pro_data_id left join db_product_info pi on pd.pro_id=pi.pro_id o.user_id='rnayak2009@gmail.com' , (o.status='successful' or o.status='pending') please me resolve error. you may need repaste it, looks 2 errors pasted: pi. product_name and pi.pro_idwhere

php - Using cart class with sessions -

i've started learn php classes, interfaces, extends , things related those. before i've worked functions , started quite mess hundreads of separate functions. there multiple classes project based on needs: cart class. should quite generic because @ point might need save data database instead of sessions. calculations class. there around 15 products , around 5 different type of calculations. (based on amount, base price, price per person etc.) database class. used prices database calculations class. create pdf mpdf submitted data through html form (which used update cart amounts , return calculated prices in real time) however, give hint on i'm trying achieve, might give better understanding on how should approach things. now actual questions. here's cart class: interface cartinterface { public function additem($id, $amount, $months); public function updateitem($id, $amount, $months); public function deleteitem($id); public function c