Posts

Showing posts from July, 2012

javascript - how to resolve date picker format in mvc5 -

im working in mvc5 entity framework. here fields have date fields need set data format. here using script , datepicker. got problem if set after date of 12. got error "enter valid date" script used in views:- $('#datepick').datepicker({ dateformat: 'dd/mm/yy', mindate: 0 }); code used in views <div class="row form-group"> <div class="col-md-4"> due date: </div> <div class="col-md-8"> @html.textboxfor(model => model.goodreceipt.due_date, new { @value = datetime.now.tostring("mm/dd/yyyy"), @class = "form-control control-text ", @id = "datepick" }) @*@html.validationmessagefor(model => model.goodreceipt.due_date)*@ </div> </div> i got error this"enter valid date" date must in 12, after 12 (i.e 13-12-2014) error occur onlyii comment validation message here got error. here want finish task. i guess there dif

image processing - How do I create and apply a Gaussian filter in MATLAB without using fspecial, imfilter or conv2? -

Image
i have following code in matlab: i=imread(image); h=fspecial('gaussian',si,sigma); i=im2double(i); i=imfilter(i,h,'conv'); figure,imagesc(i),impixelinfo,title('original image after convolving gaussian'),colormap('gray'); how can define , apply gaussian filter image without imfilter , fspecial , conv2 ? it's unfortunate can't use of built-in methods image processing toolbox task. however, can still you're asking, though bit more difficult. i'm still going use functions ipt you're asking. also, i'm going assume image grayscale . i'll leave if want colour images. create gaussian mask what can create grid of 2d spatial co-ordinates using meshgrid same size gaussian filter mask creating. i'm going assume n odd make life easier. allow spatial co-ordinates symmetric around mask. if recall, 2d gaussian can defined as: the scaling factor in front of exponential concerned ensuring area underneat

sql - How to combine results of two tables when constraint key of one table has few null values -

Image
i having 2 tables 1 accomodation , 1 hotelpaymententry want combine both tables without repeating same enquiry_id. below tables , query tried , result: table accomodation enquiry_id checkin checkout hotelname amount rh - 26/02/2014 - 10 2014-03-18 2014-03-19 spice routes houseboats 15500 rh - 04/03/2014 - 1 2014-03-19 2014-03-20 spice routes houseboats 9000 rh - 04/03/2014 - 2 2014-03-17 2014-03-18 spice routes houseboats 24000 rh - 05/03/2014 - 6 2014-04-04 2014-04-05 spice routes houseboats 9000 rh - 10/03/2014 - 3 2014-06-17 2014-06-18 spice routes houseboats 33000 table hotelpyamententry ![enter image description here][1] hotel enquiryid checkin checkout totalamount paynow dateofpayment spice routes houseboats null null null null 5000 2014-12-09 spice routes houseboats null null null null 6000 201

javascript - Why my angular code turns to comment? -

i use angularjs. html comment after render. why? before render code: <select data-ng-model="selecteddate"> <option data-ng-repeat="date in oldrecords" value="{{}}">{{date}}</option> </select> after render: <section> <select data-ng-model="selecteddate" class="ng-pristine ng-valid"> <!-- ngrepeat: date in oldrecords --> </select> </section> its better use ng-options in case , there comment shown because $scope.oldrecords either doesn't exist or empty.

javascript - How can I electively ignore a knockout 'submit' binding? -

i have form knockout binding data-bind="submit: saveprofilechanges" . viewmodel function saveprofilechanges calls following new code: dataaccess.submitjsonwithfilerequestjquerywitherrorfunction = function () { function uploadimagecomplete() { // hanlde response image post. } $("#upload_iframe").load(function() { uploadimagecomplete(); }); $("#userprofileform").submit(); }; i have added code allow pseudo-ajax image upload ie9, using iframe fallback. have tried jquery plugins upload without success , decided plain , simple approach less risky , minimise impact on loads of functionality not aware of. the problem submit call in upload method triggers ko bound saveprofilechanges , calls upload function again, ad-nauseum. there way can ignore ko binding local call submit ? less savouryu alternative set flag in viewmodel while busy doing upload, saveprofilechanges return without doing further, until upload finishes

java - How to log application auditing to separate file on Wildfly 8 -

i have java ee application running on wildfly 8 in want enable audit logging. using interceptorbinding , interceptor able catch relevant api calls. what want write these audit calls separate audit log file. tried implementing using logback, , of second answer in this stackoverflow question managed this. first reply, i.e. disabling system logging, did not work. however, while solution writes audit trace separate file, other logging stopped being written default files , output console. what want achieve have regular logging written regular file (i.e. server.log) default, have own custom audit log messages in separate file (also rolling on daily basis, renaming old file date written). whether done logback, log4j, wildfly's own logging system or wildfly cli audit log, irrelevant long achieves purpose, minimal overhead. @ stage considering writing own file simple outputstream, feels rather superfluous when there solutions should more efficiently. this logback file looks lik

How can get all results from Youtube API (search API) response -

like title. request : https://www.googleapis.com/youtube/v3/search?key=aizasyduxczhyyvhwfxkuf3ygw9p0gwmklvwlyc&part=id,snippet&publishedafter=2014-12-09t00:00:00z&publishedbefore=2014-12-11t00:00:00z&videocategoryid=gcsg93lxrvicygrelz&type=video&maxresults=50&pagetoken= total result 1000000. can 500 results maximum (10 page, 50 results/page). @ 10th page, don't see nextpagetoken property go next page. ??? don't know why. how can of result. youtube imposes soft limit of 500. there no direct way more through api. full details: https://code.google.com/p/gdata-issues/issues/detail?id=4282 relevant excerpt: "we can't provide more ~500 search results arbitrary youtube query via api without quality of search results severely degrading (duplicates, etc.). the v1/v2 gdata api updated in november limit number of search results returned 500. if specify start-index of 500 or more, won't results. this supposed have gone

MongoDB Aggregation group and count strings -

i have problem counting different logstatusses collection. i'd following result query: month | importername | nroferror | nrofdebug | nrofinfo | nrofwarning so includes grouping month , importername , counting number of documents different statusses. my mongodb collection: { "_id" : "8ec84cb7-5099-4a9d-be00-a40200a67c5a", "messages" : [ { "logstatus" : "error", "message" : "my test message" }, { "logstatus" : "error", "message" : "my test message" }, { "logstatus" : "error", "message" : "my test message" }, { "logstatus" : "error", "message" : "my test message" }, { "logstatus" : "er

php - What's the purpose of this bitwise AND operator? -

the code basic php code cms,it read mysql content render web page based on 3 different methods ,by id,name or special type(index page,sitemap page ...).but can't understand line " $r=dbrow("select * pages special&$v limit 1"); " bitwise , supposed ? <?php class page{ static $instances = array(); static $instancesbyname = array(); static $instancesbyspecial = array(); function __construct($v,$byfield=0,$fromrow=0,$pvq=0){ # byfield: 0=id; 1=name; 3=special if (!$byfield && is_numeric($v)){ // id $r=$fromrow?$fromrow:($v?dbrow("select * pages id=$v limit 1"):array()); } else if ($byfield == 1){ // name $name=strtolower(str_replace('-','_',$v)); $fname='page_by_name_'.md5($name); $r=dbrow("select * pages name '".addslashes($name)."' limit 1"); } else

Django cms editor 3.0.3 and HTML attributes getting removed -

i using cms-editor 3.0.3 when editing page , tags "placeholder" , "onclick" parameter getting removed. have pasted following code: <div class="form-group"><input class="form-control" id="phnno" name="user-req-phone" placeholder="please enter phone" type="text" /></div> <div class="col-sm-12"><button class="btn btn-primary btn-block mt20 " onclick="trip(1)" style="width: 100px; float: left;" type="submit">submit</button></div> after saving code automatically convert this: <div class="form-group"><input class="form-control" id="phnno" name="user-req-phone" type="text" /></div> <div class="col-sm-12"><button class="btn btn-primary btn-block mt20 " style="width: 100px; float: left;" type="submit&

deployment - Jenkins build passes when ssh deploy fails -

i'm using here tag in jenkins build step send deploy commands on ssh, , unfortunately build passing when commands inside here tag don't finish successfully: ssh user@host <<eof cd /path/to/app git pull bower install npm install grunt build cp -r /path/to/app/dist/* /path/to/dist/ forever restartall exit eof is there better way approach problem? you not catching error codes inside "here document". last command exit , without exit code, default 0 success. since last command of ssh success, whole command treated success, , build success. easiest way fix that: chain commands && so: cd /path/to/app && git pull && bower install && npm install && grunt build && cp -r /path/to/app/dist/* /path/to/dist/ && forever restartall && exit best way fix that: write proper shell script, with error handling , , execute that. if lazy error handle every line, can start script s

Capture image using Camera with iOS and appium -

i automating test need launch camera app , , capture images/videos. captured images/videos saved in media library. since 1. on real ios device can not automate camera app using appium, thought write , ios app launch camera , till step fine, launch camera capture button not clicked using appium. do have other way launch camera on ios device using appium , capture images ? part of apples security model sandbox. can play within own sandbox. since camera app it's own entity not have control on once launched , can not provide testing code control it. you need either write own camera control module can control take pictures using test tool or can pre-populate device required images.

python - Numpy string scalar comparison -

i'm seeing strange behavior numpy or i'm bad @ it. i have structured array string field. want filter data based on field. understanding that, work: data['somefield'][data['filterfield'] == 'someconstant'] but strangely, did not. i'm under assumption data['filterfield'] == 'someconstant' will produce array of boolean. did not, return boolean (not array of it). instead of that, using data['filterfield'] == full(data.shape,'someconstant',dtype=data['filterfield'].dtype) works expected hassle , error prone. expected behavior? if so, there shorter way create array of string? data['filterfield'] list of strings. np.char has set of operations type of array. looks ordinary array==scalar test numeric arrays not work type of array. np.char.equal(c1,c2) compares 2 char arrays, , doesn't have provision 1 of being plain string. so approach, generating string array, right one.

sql server - sql query to get records between dates -

id | status | value | createddatetime -----+--------+--------+------------------------ 1 | open | y | 2014-12-10 14:03:10.100 2 | open | y | 2014-12-10 13:03:10.100 3 | open | n | 2014-12-10 13:01:12.100 4 | open | y | 2014-12-10 05:02:11.100 5 | open | n | 2014-12-09 15:03:10.100 6 | open | n | 2014-12-08 14:03:10.100 7 | open | y | 2014-12-08 14:03:10.100 i wants write sql query records 2014-12-08 14:03:10.100 2014-12-10 14:03:10.100 , status should open value = y . i tried below sql query- select * mytable createddatetime between '2014-12-08 14:03:10.100' , '2014-12-10 14:03:10.100' , status in ('open') , value='y' how this select id,status,value,createddatetime <table> createddatetime between '2014-12-08 14:03:10.100' , '2014-12-10 14:03:10.100' , status = 'open' , value = 'y' the between operator inclusive in

Add custom action to Android Share-Sheet -

Image
i have app user should able share text. want provide default sharing options plain text android provides. following code: intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, text); sendintent.settype("text/plain"); intent chooser = intent.createchooser(sendintent, "share"); startactivity(chooser); this bit that: source: http://developer.android.com/training/basics/intents/sending.html but able have 1 more option in share-service-picker dialog triggers custom action in own code. namely want user able favourite entry. beside sharing via sms, email, fb, whatever, i'd there 1 more item on top of list, saying "add favourites" (including icon if possible). so question if that's possible?!? , if, how :) any tips appreciated! intent filters inform system intents application component willing accept. similar how constructed intent action action_send in sending simple d

html - Javascript capturing user activity -

is there existing js lib capturing user activity browser side? ie. scrolling, mouse moving, mouse clicking etc. i've been googling, searching stackoverflow , github keep getting links paid analytic programs aren't quite i'm after. i'm tempted start building myself, more think it, harder realise it'll , i'd better off using existing lib if available. what i'm thinking. appropriate way go it? i'm assuming best way listen on body or window element , capture desired events haven't had bubbling disabled. it'd nice batch , minify data before emitting/posting server. in remove mode or occurring data. if user scrolls don't need scroll events, meaningful ones start, accelerate or stop. could emit batches every x number of events or x seconds. , send final batch window.onbeforeunload . i found these 2 questions here & here . aren't quite i'm after. i want able configure event aggregation ask question on user interaction

G3m sdk (glob3 mobile) android map and 3d model -

i working on android app display plane flying on map , it's trajectory based on data read file (latitude, longitude coordinates, altitude, roll, pitch, heading). use glob3 mobile sdk , used start example "3d model'. problem when try position plane using setpitch(), setroll() , setheading(), setroll() , setheading() same axis in opposite directions can't control 1 motion of plane. if on code , give me few ideas on how change axis great, i'm not android. here links 3d model example provided on github https://github.com/glob3mobile/g3m/blob/purgatory/android/g3mandroiddemo/src/org/glob3/mobile/demo/threedmodelactivity.java , , here code android studio https://drive.google.com/file/d/0bzo0p5utgoipau9lr25bewdycmc/view?usp=sharing in app have 3 buttons start, pause/resume , stop animation. set camera looking 270 degrees , have use setpitch(90) otherwise plane on side, controlling roll that. these vemap references. if using google maps please go through

ios - HTML5 iPad app not working on iPad1 -

Image
i developed phonegap html5 app , working fine on ipad 2's , android devices. when install app onto ipad 1's app installs, icon disappears, after rebooting icon , looks if installed. i can launch app, , splash screen displayed, app closes. here deployment settings - i'm quite new this, if there relevant settings need know about, let me know , i'll update post. phonegap version: 3.6.0-0.21.19 ipad 1 running ios 5.1.1 i create project , build via phonegap commandline, package xcode use diawi distribute ipads. cordova, phonegap based on dropped ios 5 support version 3.5.0 you can read blog post here: http://cordova.apache.org/announcements/2014/05/23/cordova-350.html so it's code reaching ios 6 commands , crashing. i'm afraid, you'll either have revert older version of phonegap or buy newer test device. i not recommend rolling older version of phonegap because, february, apple require apps submitted include 64-bit support (see here

phpbb3 - PHPBB - How to logout all users? -

how i, administrator of website, log out users phpbb? custom php script, or there function in phpbb itself? would killing/removing sessions db enough? in advance. in acp under general tab there option purge sessions - hit run now button , clear sessions database logging out.

php - Updating table via PDO prepare query -

i've been having problems trying update value based off code received on page. for example: http://example.com/register.php?code=fa82f82712d1 (not actual code, it's 32-char code actually). i start transaction, , update in following way: $stmt = $stmt->prepare("update user set got_code = 1 code = :code"); then $stmt->execute(array(':code' => $code)); code gotten before. but never updates anything, i'm running rowcount() (gives me '0') , closing transaction can't seem updated. the column type char(32) should match length of code received. is possible it's causing confusions because of data type? maybe bind parameter before like: $stmt2 = $stmt->prepare("update user set got_code = 1 code = :code"); $stmt2->bindparam(":code", $code, pdo::param_str); if ($stmt2->execute()){ $stmt->commit(); } else { $stmt->rollback(); } edit: after comment of o

javascript - how to query nested JSON using mongodb -

i have json this: "marks":{ "sem1" :{ "mark1":10, "total":100 }, "sem2":{ "mark2":20, "total":200 }, "sem3":{ "mark2":30, "total":300 } } i need result mark total sem 10 100 sem1 20 200 sem2 30 300 sem3 how can achieve above format using monogodb query.query jaspersoft related means useful. this not structure if not in control need mapreduce javascript processing: db.collection.mapreduce( function () { var doc = this, marks = doc.marks; object.keys( marks ).foreach(function(key) { //emit( key, doc["marks"][key] ); var matched = object.keys( marks[key] ).filter(function(inner) { return inner.match(/^mark/); }); if ( matched.length > 0 ) { //emit( matched[0], 1 );

php - Google Analytics API, getting constantly error 500 , when ask for profiles list -

i have script update profile list using //all code inside class, , in class constructor, update token $this->token = $this->gettoken($this->accountid); $tokendata = json_decode($this->token); if($this->client->isaccesstokenexpired()) { $this->client->refreshtoken($tokendata->refresh_token); $this->token = $this->client->getaccesstoken(); $this->accesstoken = json_decode($this->token)->access_token; $this->savetoken($this->token,$this->accountid); } .... $this->service = new google_service_analytics($this->client); .. // ask profiles $profiles = $this->service->management_profiles->listmanagementprofiles("~all", "~all",array('max-results' => 500)); but when run code error error calling https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles?max-results=500&key=##acess_key## : (500) backend error this code, wo

javascript - Link not working after render partial js -

so want re-render table after updating event. i this: ## controller: respond_to |format| if schedule_child.save sql = "schedules.doctor_id = ? , schedules.location_id = ? , schedule_children.start_time >= ? , schedule_children.start_time <= ?" @schedules = schedulechild.joins(:schedule).where(sql, current_doctor.id, session[:location_id], time.now, time.now + 7.days).order(start_time: :asc).page(params[:page]).per(7) format.js {render :layout => false} end end my js.erb: $('#schedules').html( "<%= escape_javascript( render "schedules" ) %>" ); my view: %a.status_link.btn.btn-success.btn-sm{"data-href" => set_schedule_status_path(location_id: session[:location_id] ,id: schedule.id), :style => "#{schedule.is_away ? 'display: none' : '' }", :id => "#{schedule.id}", :remote => "true"} %i.fa.fa-check-square-o %span

javascript - JS script to calculates sum of amount calculates wrong -

i have prepared this jsfiddle ilustrates how script calculate twice sum of each selected option attribute price. please me solve issue. optionsamount wrong, mean calculated twice.. why that? thanks function update_amounts(){ var sum = 0.0; var optionsamount = 0.0; $('#basketorder > tbody > .product').each(function() { $('.selectedoptionselect option:selected').each(function(){ optprice = $(this).attr('price'); optionsamount+= parsefloat(optprice); }) var qty = $(this).find('.qty option:selected').val(); var price = $(this).find('.price').val(); var amount = (qty*price); sum+= (amount + optionsamount); $(this).find('.amount').text(''+ amount.tofixed(2)); }); $('.total').text(sum); } try this, function update_amounts(){ var sum = 0.0; $('#basketorder > tbody > .product').eac

javascript - Getting "TypeError: undefined is not a function" when trying to send email using mailgun -

i trying send email using mailgun , have given code below parse.cloud.define("sendemail", function(request, response) { var mailgun = require('mailgun'); mailgun.initialize('domainname', 'myapikey'); mailgun.sendemail({ to: "test@test.com" , from: "test@test.com", subject: "title", text: "contents" },{ success: function() { response.success(request.params); console.log("--email sent - success"); console.log(request.params); }, error: function() { console.log("--failed send email - success"); console.error(request.params); response.error("uh oh, went wrong"); } }); }); but recieving error typeerror: undefined not function in line parse.cloud.define("sendemail", function(request, respons

php - Multiple JSON objects from text file -

hello i'm trying use mutiple json objects shown in example below. [ { "dateandtime" : "1025", "logginglevel" : "error", "description" : "test" } ] [ { "dateandtime" : "1025", "logginglevel" : "error", "description" : "test" } ] this how it's created ios side because create 1 of objects @ time because it's report logging system , need message passed when it's needed. json objects created @ separate times , appended file. i know valid json string below. [ { "dateandtime" : "1025", "logginglevel" : "error", "description" : "test" }, { "dateandtime" : "1025", "logginglevel" : "error", "description" : "test" } ] however that's not need. there way of using 2

javascript - How to pass value from directive to template? -

i have external template. need create custom directive have attribute/parameter/value/whatever passed template upon it's render. how it? it should easy this: html <table> <cell rownum="0"></cell> <cell rownum="1"></cell> <cell rownum="2"></cell> <cell rownum="3"></cell> </table> angularjs prototypeapplication.directive('cell', function() { return { restrict: 'e', replace: true, transclude: true, scope: { rownum:'@' }, templateurl: 'views/prototype/booking/templates/table-row.html' }; }); template: <tr> <td> <div class="form-group first-name"> <label>first name</label> <input type="text" ng-class="{'input-valid': isvalidfield('firstname&

asp.net mvc - select2, mvc and html5 -

we using select2 dropdown in our website. website going responsive , while select2 awesome control, not turn native control on mobile using html5. i.e.: html5 tag date bring native mobile calendar, different android ios, , more user-friendly. have same feature our dropdowns. since select2 not include select tag in markup, not possible. anynody have suggestion control satisfy these needs? used programming environment asp.net mvc thank you --edit-- select2 typical markup: <div class="select2-container" id="s2id_step1generalinfo_isgweinclusive" style="width: 100%;"> <a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1"> <span><table cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="labelselectedoption"></td>

oauth 2.0 - How to get developer Id required to access AOL APIs? -

i want work aol.com api. for purpose need client_id(developer id) . but cant find , how can id, checked this site didn't find anything. any idea how can client_id(developer id) aol.com api? it looks if aol open auth api has been discontinued. http://www.programmableweb.com/api/aol-open-auth http://www.programmableweb.com/api/aol-open-mail all links used point documentation point main aol.com website. i called aol , technical support representative unable find information @ on developer apis.

python - Unable to index into a list -

i writing program read output of program, read line line , put in list. #!/usr/bin/python import subprocess def receive(command): process = subprocess.popen(command, stdout=subprocess.pipe) lines = iter(process.stdout.readline, "") line in lines: recarr = line.split() print recarr[14] receive(["receivetest","-f=/dev/pcan32"]) the output receivetest program is: 19327481.401 receivetest: m s 0x0000000663 8 2f 00 42 02 00 e4 8a 8a 19327481.860 receivetest: m s 0x000000069e 8 00 1f 5e 28 34 83 59 1a it constant stream of messages. when split, list has range of 14 because after splitting, make sure, used: print len(recarr) this gave me output of 14 . but whenever try print last element: print recarr[14] i following error: file "./cancheck.py", line 10, in receive print recarr[14] indexerror: list index out of range this caused erronious text printed @ top of list, need way of making sure program

c++ - Size of a structure having unsigned short ints -

i surfing in 1 of our organisational data documents , came across following piece of code. struct { unsigned short int i:1; unsigned short int j:1; unsigned short int k:14; }; int main(){ aa; int n = sizeof(aa); cout << n; } initially thought size 6 bytes size of unsigned short int 2 bytes. output of above code 2 bytes(on visual studio 2008). is there slight possibility i:1 , j:1 , k:14 makes bit field or something? guess , not sure it. can please me in this? yes, bitfield , indeed. well, i'm not sure c++ , but in c99 standard, per chapter 6.7.2.1 (10): an implementation may allocate addressable storage unit large enough hold bit-field. if enough space remains, bit-field follows bit-field in structure shall packed adjacent bits of same unit. if insufficient space remains, whether bit-field not fit put next bits or overlaps adjacent units implementation-defined. order of allocation of bit-fields within unit (high-order low-order or low-or

lisp - Cond definition in scheme -

this easy question guess need it.i making simulator game in scheme(dr racket)and want change how cond works.but change thing cond need know definition of cond , not find in dr racket.can give definition of cond in scheme? the racket definition of cond in collects/racket/private/cond.rkt . it's written using low-level syntax object operations, not using either syntax-rules nor syntax-case , unless know syntax objects well, won't readable you. as alternative starting place customised cond , 1 definition of cond reference implementation given in srfi 61 . succinct , 1 of best implementations of cond i've seen: (define-syntax cond (syntax-rules (=> else) ((cond (else else1 else2 ...)) ;; (if #t (begin ...)) wrapper ensures there may no ;; internal definitions in body of clause. r5rs mandates ;; in text (by referring each subform of clauses ;; <expression>) not in reference implementation of cond, ;; expands (begin .

intellij idea - Failed to create a child event loop -

in intellij idea community edition 14.0.2, i'm trying run java applet , every time try run project, got this dummy error. error: failed create child event loop what i've tried compiling newly created hello world program update intellij uninstall & reinstall allow windows firewall rule disabling antivirus program i'm using windows 8.1 anti-virus program windows defender . error detail log file: java.lang.illegalstateexception: failed create child event loop @ io.netty.util.concurrent.multithreadeventexecutorgroup.<init>(multithreadeventexecutorgroup.java:81) @ io.netty.channel.multithreadeventloopgroup.<init>(multithreadeventloopgroup.java:50) @ io.netty.channel.nio.nioeventloopgroup.<init>(nioeventloopgroup.java:72) @ io.netty.channel.nio.nioeventloopgroup.<init>(nioeventloopgroup.java:58) @ org.jetbrains.io.builtinserver.start(builtinserver.java:60) @ org.jetbrains.ide.builtinservermanagerimpl$1.run

java - Getting tomcat error while deploying Libreplan on windows -

i have forked codebase of libreplan repository , import in eclipse. trying deploy libreplan-webapp tomcat7. have configured data source file present inside tomcat-7.0.39\conf\catalina\localhost directory. libreplan-webapp.xml given below <?xml version="1.0" encoding="utf-8"?> <context antijarlocking="true" path=""> <resource name="jdbc/libreplan-ds" auth="container" type="javax.sql.datasource" maxactive="100" maxidle="30" maxwait="10000" username="libreplan" password="libreplan" driverclassname="com.mysql.jdbc.driver" url="jdbc:mysql://localhost/libreplandev" /> </context> i followed instruction given in manual [ http://www.libreplan.org/install.html] build wepapp , deploy on tomcat. getting below error while starting of tomcat severe: child cont

combobox - Access displaying first record when using combo box to switch records -

i have access database uses linked tables residing on sql server. 1 of these tables created simple form showing several fields of underlying table. i want switch records using combo box, added 1 using combo box wizard, selected option "find record on form based on value selected in combo box". the combo box works, noticed whenever new value selected, access briefly return first record before displaying selected record. can verify both noticing screen flicker (e.g., bound fields briefly display data first record), profiling calls sql server, can see 1 query first record, , query selected record. this problem not occur if use next/previous navigation buttons @ bottom of form. how can avoid unnecessary query? what using wizard did create macro behind event of combobox click. looks .. , , first, ="[somefield] = " & str(nz(screen.activecontrol,0)) .. can do, instead of using macro, follow this if @ macro (or arguments accepts), little more cle

java - BufferedReader.readLine blocks my program but BufferedReader.read() reads properly -

i have snippet follows: process proc = runtime.getruntime().exec(command); bufferedreader br = new bufferedreader(new inputstreamreader(proc.geterrorstream())); string line = br.readline(); now in above code sure process have on line input, did not use kind of while loop or null check. problem readline blocks. 1 reason aware of is, stream having no data read , hence readline keeps waiting. check this, removed readline , used read() function follows: process proc = runtime.getruntime().exec( command ); bufferedreader br = new bufferedreader(new inputstreamreader(proc.geterrorstream())); int a; while((a=br.read())!=-1){ char ch = (char) a; if(ch == '\n') system.out.print("new line "+ch); if(ch == '\r') system.out.print("carriage return "+ch); system.out.print(ch); } to surprise code worked , printed messags new line , carriage return. wondering why did readline block? data available terminated newline. else r

Python - sorting a list -

this question has answer here: does python have built in function string natural sort? 12 answers i started playing list , know. if have data in list in format ['john 1', 'jack 2'] how sort them number? you can pass key sorted function extracts number splitting on space , converts integer. a = ['john 2', 'jack 1'] print(sorted(a, key=lambda x:int(x.split(' ')[-1]))) # ['jack 1', 'john 2']

Why does Datastax ODBC not accept "Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)"? -

Image
i trying install datastax odbc driver hive on windows . have "windows 7 ultimate n (64bit)" installation , every time try start installer odbc driver error saying need install visual c++ 2010 runtime: . i have done that. in fact, upgraded microsoft visual c++ 2010 sp1 redistributable package (x86) see if worked. still, getting same error. here's screenshot of visual c++ "programs" have installed: . question: there can debug further? missing something? unfamiliar windows environment. you're showing have installed 2010 32 bit runtime (x86), while asks the 64 bit runtime (x64). from can gather, need install this (imo. should file bug datastax , ask them include redistributable package create less hassle users).

java - Spring Boot Multi Module Gradle Build - Multiple "Fat Jars" -

our spring-boot project looks following project |__ build.gradle |__ settings.gradle |__ module_a |__ module_b |__ ... |__ module_a |__ module_b module_a contains springapplication class , file application.properties running ./gradlew build works fine, problem is, every module (about 10) gradle generates fat jar including dependencies. we want have 1 far jar (in module a) buildscript { ext { springbootversion = '1.2.0.release' springloadedversion = '1.2.0.release' } repositories { // note: should declare repositories need here mavencentral() maven { url "http://repo.spring.io/release" } maven { url "http://repo.spring.io/milestone" } maven { url "http://repo.spring.io/snapshot" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springbootversion}") classpath("org.springframework:sp

Sublime / LESS-Build error when compile bootstrap -

i have problems compile less on sublime text 2 less-build plugin, less normaly works when want build bootstrap less sources sublime response me error: [compile] c:\test\assets\css\main.less -> c:\test\assets\css\main.css expected ')' found ' ' on line 20 in file 'less/mixins/image.less': [19]: // spelling of `min--moz-device-pixel-ratio` intentional. [20]: .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { --------------------^ [21]: background-image: url("@{file-1x}"); [done - failed] [finished in 0.3s] how repair this? the less-build-sublime plugin seems use dotless less compiler. .net less compiler supports language features version 1.3.0. the source code of bootstrap uses less compiler @ version 2.1.0. bootstrap depends on 1 of language features doesn't exist in version 1.3.0.

amazon web services - Can't write simple php code to call aws sqs -

i have little experience php, please bear me. i'm attempting follow aws documentation example confirm can connect aws sqs using aws php sdk, i'm getting stuck...and it's dumb i'm doing. here's php file (called stuff.php): <?php header('content-type: text/plain; charset=utf-8'); require '/home/ubuntu/vendor/autoload.php'; // create queue using aws-php-sdk function, create_queue, , store // in '$newqueue' variable. $newqueue = $sqs->create_queue($queuename); // print created queue results. echo '<br></br><h2>create queue</h2>'; print '<pre>' . print_r($newqueue, true) . '<pre><br/><br/>'; ?> which copied aws documentation require address updated. created ~/.aws/credentials file using format: [default] aws_access_key_id = your_aws_access_key_id aws_secret_access_key = your_aws_secret_access_key but when load file in browser, apache2 error.log sends me

c# - Is the only way to use 'params' in a controller action to give it an array from JavaScript? -

i have method within controller: [httpget] public jsonresult getpreference(params string[] settings) { // things related getting preferences return json(preferenceslist); } is means pass parameters method ajax call array? there more graceful or elegant methods? $.get(url, { settings: [color, rotation] }); i think should able along lines of this: get /somecontroller/getpreference?settings%5b0%5d=first&settings%5b1%5d=second (where %5b [ , %5d ] ) or just get /somecontroller/getpreference?settings=first&settings=second see this post hanselman , this 1 haack . the former useful if want use complex types rather string or int .