Posts

Showing posts from January, 2015

how to get value from url parameter using javascript or jquery -

i have issue in getting value url, have link shows modal have <a href='#modal?userid=<%=resultset.getint("drid")%>' class="button-border togglemodal">apportionment</a> above link opens modal given below <div id="modal" class="modal"> <header> <h2>appointment form</h2> </header> <form action="addappoinment.jsp" method="post"> <input type="hidden" id="docid" name="docid" value=""><br> <input type="text" required><br> <input type="text" required><br> <input type="text" required><br> <input type="text" required><br> <textarea rows="4" cols="21"></textarea><br> <button class="button-border butto...

c# - CheckBox does not update -

i using checkbox toggle button (checkbox.appearance = appearance.button) in child form. if users presses button measurement cycle start if criteria satisfied (e.g. temperature within range). checkbox.checked property remains true until measurement completed. if e.g. temperature out of range warning appear , button reset. same happens if cycle ended properly. in end self-explaining function called: /// <summary> /// resets button states false /// </summary> public void resetbutton() { checkbox_start.checked = false; } now, when debugging, see checkbox_start.checked property false , remains false. ui not show actual value. seemingly remains checked. have tried refresh() , update() on levels. does have idea? possibly keep ui showing actual value? i found similar problem, except datagridview. solution found invalidate control , request redrawn, follows: public void resetbutton() { checkbox_start.checked = false; ch...

visual studio 2010 - vs C#2015 solution's backwards compatibility wont run on vs2010 even when nothing was done to it -

so in middle of making program, when decided try upgrading vs2015 because newer ui. so opened .sln in vs2015 test run program again, , re arrange ui of program, didnt add or remove anything, or touched code. saved file, , tried opening again on laptop still on vs2010. i can open solution,i can access , edit code, can't open designer @ all, or run program made. although can upgrade 1 on laptop newer one, im doing project friend still on vs2010, there way make compatible again? whenever try open project in visual studio 2015 developed in visual studio 2010 prompt window make changes in .sln file shows changes in browser. if try open file changed vs2015 not able open in vs 2010 available open in vs 2012 , on word

sorting - UnderscoreJs : objects sortBy with empty attributes -

problem is, want sort price array of users might contains empty attributes one: var array = [ { "created": "2015-11-27t16:33:46.781z", "name": "johan", "pricing": { "base_price" : "12", "price_by_hour" : "5" } }, { "created": "2015-11-27t16:33:46.781z", "name": "marco" }, { "created": "2015-11-27t16:33:46.781z", "name": "jane", "pricing": { "base_price" : "8", "price_by_hour" : "11" } } ]; array = _.sortby(array, function(item) { return item.pricing.base_price; }); console.log(array); typeerror: cannot read property 'base_price' of undefined how can put items without pricing object @ bottom of list , still sorting it? in case,...

twitter bootstrap - Validate Boostrap modal contact form using Laravel 5, AJAX -

having trouble figuring out how use bootstrap modal in laravel 5 send contact form. i want use ajax page doesn't refresh. when click send in modal, 500 (internal server error) in console log. what should ajax call like? should route like? need in controller simple response back? having difficult time finding examples of these things. here ajax... $.ajax({ method: "post", url: "/results-guest-card", data: str, datatype: "json", success: function(result) { if (response.status == "ok") { console.log ('success');//success! $('#guestcardmodal').modal('hide'); $('.modal-send-button').attr("disabled", false); } else { console.log ('failure');//fail! $(".errors").html(result.errors); $('.modal-send-button').attr("disabled", false); } } }); i writing answer might in future. as op said 1 be...

GWT Decorated Cell Table input rendred onclick -

i have decoratedcelltable can inline editing. when click on editbutton nothing happens celltable . when click cell want edit, cell rendered <input> . is there way render editable cells input clicking on editbutton ? with celltable.seteditable(true); doesn't work. see cells defined per column not per entry in column. the basic idea of cell widgets make widget light wieght not creating input elements each entry in column . so there can 1 input element can active in column @ point of time , same input element reused entire column. hence not possible (as per know ) render editable cells input elements @ time.

XSLT Transformation using Xalan-Java Extensions -

i trying convert xml csv using "xalan-java extensions" [xslt template include java coding] , unfortunately no positive results. i added external libs (bsf.jar;js.jar;xalan.jar;xercesimpl.jar;xml-apis.jar) java projects before, seems 1 not working, i'm getting error: error during transformation - java.lang.nullpointerexception; line#: 55; column#: 45 my java code: public class transformcsv { /** * @param args */ public static void main(string[] args) { // todo auto-generated method stub try { file stylesheet = new file("style.xsl"); file xmlsource = new file("data.xml"); documentbuilderfactory factory = documentbuilderfactory.newinstance(); documentbuilder builder = factory.newdocumentbuilder(); document document = builder.parse(xmlsource); streamsource stylesource = new streamsource(stylesheet); ...

html - CSS transitions height input element -

i new bare me. have input element grows right when user clicks in box. .search { display: inline-block; width: 20px; -webkit-transition: .5s ease; -moz-transition: .5s ease; transition: .5s ease; text-align: left; } .search:focus { width: 250px; -webkit-transition: .5s ease; -moz-transition: .5s ease; transition: .5s ease; text-align: left; } <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <input class="search" type="search" value="" name="s" id="s"> </form> the idea input element grows 20px 250px. problem has nothing transitions not working :-) the problem inputbox small in height. whatever try won't bigger: see fiddle you using input type search , , won't accept height. adding -webkit-appearance:textfield; allow add padding increase height, or set height manually. ...

linq - Correct implementation of IGrouping to be used inside longlistselector groupheader -

i have observablecollection following- private observablecollection<keyedlist<int, anime>> _grp; public observablecollection<keyedlist<int, anime>> groupedanimebygenre { { return _grp; } set { _grp = value; raisepropertychanged("groupedanimebygenre"); } } i using populate longlistselector grouping. keyedlist implemented this- public class keyedlist<tkey, titem> : list<titem> { public tkey key { protected set; get; } public keyedlist(tkey key, ienumerable<titem> items) : base(items) { key = key; } public keyedlist(igrouping<tkey, titem> grouping) : base(grouping) { key = grouping.key; } } i have following code feed observablecollection. keep in mind animelist2 temporary collection. var groupfinale = animelist2.groupby(txt => txt.id).where(grouping =...

intellij idea - Add new project to existing javadoc -

i have 2 projects can create javadoc fine using intellij idea. however, if create them in same folder docs overwritten. generate single javadoc both projects (and add more later on). how go doing in idea? you should convert separate projects modules of single project, , use "whole project" option scope in "generate javadoc" dialog.

Regex - Matching Strings with a Single Character -

i'm new regex. i'm looking expression return results meet following criteria: the first word must 3 letters or more the last word must 3 characters or more if word or words in-between first , last word contains 1 letter, return phrase every other word in-between first , last character (apart single letter words) must 3 letters or more i return phrases like: 'therefore a hurricane shall arrive' , 'however i know i michael smith' there should space between each word. so far have: ^([a-za-z]{3,})*$( [a-za-z])*$( [a-za-z]{3,})*$ any appreciated. spacing? i'm using application called 'oracle edq'. in normal regex world you'd use \b , word boundary. ^[a-za-z]{3,}(\s+|\b([a-za-z]|[a-za-z]{3,})\b)*\s+[a-za-z]{3,}$ ^^ ^^ see demo and perhaps, non-capturing groups (as anubhava shows). from see, there no word boundaries in oracle edq regex syntax (as non-capturing groups). sh...

android - Issues Related to Google Play Developer Console – Alpha Testing -

can update apk has been uploaded alpha/beta testing ? have created alpha testing , testers sent feedback regarding bugs fixed , have fixed them want update apk in alpha testing possible or have make new alpha testing ? is possible transfer apk in alpha/beta testing production without need upload same apk production ? , assuming apk has no bugs , , testing done testers without reporting bugs . you can upload new apk google play changes. ensure change build version etc. you can promote alpha or beta app going developer console -> apk -> navigate current apk in alpha or beta -> find promote drop down -> click either promote beta or promote production.

regex - Sed replace string with multi-lines -

i have simple sed command: #!/bin/bash command=$1 sed -e "s#command#$command# the value command should new line every command cannot figure out how give them sed , sed put every command on new line. have tried is: ./script 'ls\n date\n uname\n' regards! if i'm understanding question, looking replace representation of newlines within string (i.e. backslash character, followed 'n') actual printed newlines. the following script takes single quoted string (the input shown in question) containing literals '\n' , converts actual new lines. #!/bin/bash echo -n $1 | sed -e 's#\\n#\n#g' example usage: [user@localhost ~]$ ./simple_sed.sh 'ls\ndate\nuname\n' ls date uname the changes needed script echo argument, otherwise sed expects file , nothing; match \\n , replace newline; , add 'g' end continue searching within line after replacement has occurred (read: multiple \n substituted in single line)...

javascript - Why I cannot use Konva.Image() in Konva.Shape.fillPatternImage(imageObj)? -

the following example konvajs library load image: var imageobj = new image(); imageobj.onload = function() { var yoda = new konva.image({ x: 50, y: 50, image: imageobj, width: 106, height: 118 }); , here code var annotation = new konva.line({ points: this.contour, stroke: color, closed: true, strokewidth: 1 }); var nativeimageobject = new image(); nativeimageobject.onload = function() { var konvaimage = new konva.image({ image: nativeimageobject }); annotation.fillpatternimage(konvaimage); dentalchart.pattern.custompatternimages.push(custompatternimage); gridlayer.add(annotation); stage.draw(); }; nativeimageobject.src = pattern.todataurl(); nativeimageobject.id = patternenum + '' + color; for fillpatternimage use native image object. http://konvajs.github.io/docs/styling/fill.html

sql server - Using Where and Count from Multiply tables -

i have 2 tables problem columns: patient_no, encounter_date, diagnosis_1, diagnosis_2 procedure columns: patient_no, procedure_code i trying count number of unique clients have specific diagnosis problem table , specific procedure procedure table. i'm using inner join on two, when run query count bigger number if counted clients specific diagnosis, think wrong. select (select count(diagnosis_1) problem, procedure problem.patient_no=procedure.patient_no , problem.encounter_date between '10/1/15' , '12/31/15' , problem.diagnosis_1 in ( 'z68.53', 'z68.54', 'o99.210', 'e66.9', 'e66.3') , procedure.procedure_code in ( 'ts141', 'ts140')) + (select count(diagnosis_2) problem, procedure problem.patient_no=procedure.patient_no , problem.encounter_date between '10/1/15' , '12/31/15' , problem.diagnosis_2 in ( 'z68.53', 'z68.54', 'o99.210', 'e66.9', ...

Jquery store string and put it out elsewhere when checkbox is checked -

looking here. have create price check calculator. 2 things need done: if checkboxes different values checked overallprice has shown somewhere. i need summary of selected items. need put selected items beneath overallprice. i managed point 1 work. im struggling point 2. have no clue how put checked items elsewhere. heres how far ive got: $(document).ready(function() { $('input[type="checkbox"]').click(function() { var total = 0; //var item = []; var $parent = $(this).closest('ul'); $parent.find('input:checked').each(function() { total += parseint($(this).val()); //item.text(); }); $parent.find('span[class^=total]').html(total + ' €'); var overallprice = 0; $('span[class^=total]').each(function() { overallprice += parseint($(this).html().replace(' €','')); }); $('.overallprice').html(overallprice) //$('.overallprice').append(item); ...

javascript - JQuery Select All Option Values From DualListBox -

i'm using dual listbox plugin , trying select list of countries using jquery: var countries = $('.selected').find(":selected").map(function(){ return this.value }).get().join(", "); this listbox: <select class="selected" style="height: 200px; width: 100%;" multiple="" name="countries[]"> <option style="padding:4px 0px 4px 8px;" value="ca" selected="">canada</option> <option style="padding:4px 0px 4px 8px;" value="fr" selected="">france</option> <option style="padding:4px 0px 4px 8px;" value="de" selected="">germany</option> <option style="padding:4px 0px 4px 8px;" value="nl" selected="">netherlands</option> <option style="padding:4px 0px 4px 8px;" value="uk" selected="">united kingdom</option>...

html - Something is moving my drop down nav bar to the right -

when hover on html section html & css nav option moved right reason, how align other nav options. http://codepen.io/anon/pen/beqprq #nav { list-style: none; text-align: center; padding: 1.250em 0 1.250em 0; background: #ffffff; font-size: 106.25%; font-family: 'oxygen'; } #nav li { text-decoration: none; text-align: center; color: #fff; } #nav ul li ul.dropdown { background-color: #000000; display: none; position: fixed; z-index: auto; left: 400; vertical-align: left; } #nav ul li:hover ul.dropdown { display: block; } #nav ul li ul.dropdown li { display: block; } #nav > ul > li { display: inline-block; margin-right: 2%; padding: 4.375em 1.250em 4.375em 1.250em; } #nav > ul > li > { text-decoration: none; color: #000000; } #nav > ul > li > a:hover { color: #00c5a2; } your <ul> has default styling ( padding-left ) has removed. adding #nav ul li ul.dropdown { padding-left...

string - Find and replace in R for categorical variables -

this question has answer here: replace values in vector based on vector 2 answers x1 <- c("agree","disagree","agree","agree","agree","disagree","disagree") how replace agree=1 , disagree=0 large atomic vectors or specific row/columns in data frame? you can this ifelse(x1 == 'agree', 1, 0) more conditions can added necessary.

php - laravel routes, how to group similar in one file -

i'm working laravel (5.2), , there lot routes in route file. in fresh install noticed loading auth routes this. route::auth(); nothing else there in routes.php file related auth routes. in file, i've one route::get('color/event', 'colorcontroller@index'); route::post('color/event', 'colorcontroller@post_message); ... ... and many others, want load in laravel way, route::color(); , should load color related routes thanks time you can try route::resource('admin/settings','admin\settingscontroller'); and try command $ php artisan routes

javascript - Uncaught Error: [$injector:modulerr] Failed to instantiate module scheduleApp due to: -

html <!doctype html> <html ng-app="scheduleapp"> <head> <title>angularjs schedule</title> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <script src="js/angular.js"></script> <script src="js/angularfire.min.js"></script> <script src="js/firebase.js"></script> </head> <body> <div class="container" ng-controller="maincontroller"> <div class="page-header text-center"> <h1>schedule city</h1> </div> <div class="row times"> <div class="col-xs-4 text-center"> <h2>{{day.name}}</h2> <div class="time-slot" ng-repeat="slot in day.slots"> ...

ios - Animate the changing of data in a collectionView -

i'd animate change in uicollectionview. have collectionview @iboutlet : @iboutlet weak var collectionview: uicollectionview! and collection view reloads (so can change alpha of each cell) this: var bulkawardmode = false; @ibaction func bulkawardtoggleclicked(sender: uibutton) { if(bulkawardmode == false) { bulkawardmode = true } else { bulkawardmode = false } dispatch_async(dispatch_get_main_queue(), { self.collectionview.reloaddata() }) } however not animated, tried changing reloaddata() line self.collectionview.reloadsections(nsindexset(index: 0)) , causes crash error attempt create view animation nil view . i'm doing wrong, i'm not quite sure what. did try putting code in uiview.animatewithduration block, failed. you can try: collectionview.performbatchupdates({ () -> void in // here can insert ,delete , animate cells }) { (success) -> void in //completion block }

algorithm - How Cache Oblivious quick sort is? -

in burst sort paper author claims quick sort not cache efficient sorting algorithm. author mentioned however, of disadvantages of quicksort still present.each character inspected multiple times, until in equal pivot partition.each string re-accessed each time character in inspected, , after first partitioning these accesses random. large set of strings, rate of cache misses high. i found ppt says quick sort , merge sort cache oblivious algorithm wikipedia , few paper claim quick sort cache efficient. i not able understand cases in quick sort cache miss apart compulsory miss integer data.can explain quick sort cache miss in detail ? the passage quoted talking issues when sorting strings. if array of strings during quicksort stored array pointers (which easy way it), after first pass of quicksort possible pointers stored in nearby positions in array point memory locations far apart, if original array of strings allocated in consecutive memory. seems pla...

angularjs - Umbraco 7.3.4 - Custom Data Type Value Doesn't Change -

i have created custom data type deal character limits on text areas. i have been following demo $scope.info = "hello world" before user started typing in text area. i have since deleted should have removed text umbraco content interface. but still showing "hello world" on right side of text box. customer editor angular controller: angular.module("umbraco").controller("my.customeditorcontroller", function ($scope, notificationsservice) { $scope.info = ""; $scope.limitchars = function () { var limit = parseint($scope.model.config.limit); if ($scope.model.value.length > limit) { $scope.info = "you cannot write more " + limit + " characters!"; $scope.model.value = $scope.model.value.substr(0, limit); notificationsservice.remove(0); notificationsservice.warning($scope.info); } ...

HTML5 Canvas gradient appears black -

Image
i'm trying reproduce following background image in html5 canvas, renders on browser black box. original image made in illustrator , that's i'm getting coordinates (actually used export plug-in). <html lang="en"> <head> <meta charset="utf-8" /> <title>index</title> <script> function init() { var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); draw(ctx); } function draw(ctx) { var gradient; // layer1/red background bottom ctx.save(); ctx.beginpath(); ctx.moveto(1036.0, 789.7); ctx.lineto(12.0, 789.7); ctx.lineto(12.0, 21.7); ctx.lineto(1036.0, 21.7); ctx.lineto(1036.0, 789.7); ctx.closepath(); ctx.fillstyle = "rgb(235, 10, 10)"; ctx.fill(); // layer1/shadow bottom ctx.beginpath(); ctx.moveto(1036.0, 788.7); ctx.lineto...

angularjs - How to send binary data to API with Angular js -

i trying send image binary api. the api has mode can send url, if code works fine. want send binary image html canvas. here's docs of api can see parameter https://dev.havenondemand.com/apis/ocrdocument#request i error alert when call getocr method. leads me think api call isnt being made correctly. pls help. here's send function looks like. $scope.getocr = function(imagedata){ var apikey = 'xxxxxx'; var requeststring = 'https://api.havenondemand.com/1/api/sync/ocrdocument/v1?apikey='+ apikey +'&file='+ "data:image/jpeg;base64," + imagedata; $http.get(requeststring).then(function(resp) { alert(angular.fromjson(resp.data).text_block[0]['text']); }, function(err) { alert('error'); }) } and here's looks when call method $cordovacamera.getpicture(options).then(function(imagedata) { $scope.imguri = "data:image/jpeg;base64," + imagedata; ...

How are XSLT files processed? -

i wondering, how xslt files processed. how interpreted , executed? are xslt files read line-by-line , "executed" scripting language? or entire file read first , statements executed if entire xslt code well-formed? or.... ???? (please note, i'm c++ programmer first day xslt conntact. thing i've figured out, xslt not compiled machine code. :-) ) it vary 1 xslt processor another. can assume whole stylesheet read, validated, , converted internal representation, may optimized using rewrite rules, , internal representation executed kind of interpreter. more advanced processors, such saxon-ee, generate instructions - not machine instructions, kind of intermediate language such java bytecode, or perhaps custom instruction set interpreter execute.

java - Caused by: javafx.fxml.LoadException error -

this code worked, i'm in trouble. think problem, idk: caused by: javafx.fxml.loadexception: /c:/users/alex/workspace/fxmlexample/bin/application/login.fxml:10 i don't know / understand wrong in these codes. in main run scene. » main.java package application; import javafx.application.application; import javafx.fxml.fxmlloader; import javafx.stage.stage; import javafx.scene.parent; import javafx.scene.scene; public class main extends application { parent root; @override public void start(stage stage) throws exception { root = fxmlloader.load(getclass().getresource("login.fxml")); scene scene = new scene(root, 800, 600); stage.settitle("login system"); stage.setscene(scene); stage.show(); } public static void main(string[] args) { launch(args); } } » login.fxml, here think problem <?xml version="1.0" encoding="utf-8"?> <?import java.n...

javascript - How to remove initial auto focus of anchor tag -

i wondering how remove automatic focus automatically happens first anchor tag on page load. i not looking disable focus ability pretty able find solutions while researching question. focus should still apply , show when anchor clicked . here css (scss in case) focus itself, want remain. &:focus { outline:3px solid #51ace9 } i have tried doing rid of auto focus on page load: window.onload= function() { var anchors = document.getelementsbyclassname('my_class') (var = 0; < anchors.length; i++) { anchors[i].blur(); } } but doesn't seem work. can suggest proper solution? $(document).ready(function({ $("a").blur() ; });

vb.net - How do I sum an array of structures? -

i creating arrays of structures defined, when stripped essentials purpose of question, this:- public structure mystruct public innards double public shared operator +(byval example1 mystruct, byval example2 mystruct) mystruct dim out_struct mystruct out_struct.innards = example1.innards + example2.innards return out_struct end operator end structure i set array:- dim my_struct1 mystruct dim my_struct2 mystruct dim my_struct3 mystruct my_struct1.innards = 1 my_struct2.innards = 2 my_struct3.innards = 3 dim my_struct_array() mystruct = {my_struct1, my_struct2, my_struct3} and want calculate sum of elements in array:- dim my_total mystruct my_total = my_struct_array.sum but results in compilation error:- overload resolution failed because no accessible 'sum' accepts number of arguments. is there way work? interface have implement? or have resort linq? arrays don't have sum function can use linq; howev...

javascript - Angular interceptor gives blank output with no error -

i want inject content-type in $http. request. have following interceptor don't errors/output, i'm doing wrong? .factory('interceptor', ['$injector', '$q', function ($injector, $q) { return function () { return { request: function (config) { var deferred = $q.defer(); config.headers['content-type'] = 'application/x-www-form-urlencoded'; deferred.resolve(config); return deferred.promise; } }; }; }]) .config(['$httpprovider', function ($httpprovider) { $httpprovider.responseinterceptors.push('interceptor'); }]); .factory('interceptor', ['$injector', '$q', function ($injector, $q) { return { request: function (config) { config.headers = config.headers || {}; config.headers[...

javascript - How to assembly js libs in an angular application -

i'm starting first angular application (for information, angular2). starting learn tools nodejs, gulp, etc... i have nodejs server, serves server stuff , front stuff. for front stuff, have html, css, resources, , js files. working angular, have required dependencies in node_modules. i'm ok typescripts management gulp. have managed have app js files concatenated in "build" target folder. now, want copy there libs/dependencies, index.html have 2 script include : myapp.js , libs.js (minified angular , possibly other libs). i cannot find way that. got result webpack, minifies app in libs.js file, , want app separate can debug in non minified js dev mode. is there way extract node_modules required libs app, minify them , concat them in compact libs.js ? when parse node_modules, huge repository (mainly due server dependencies stuff gulp, mocha, ... nothing useful frontend), , i'm pretty sure taking node_modules/**/*.js , concat not idea! thank respon...

python - lmfit, result.plot_fit(ax) not plotting all 3 plots in pyqt -

Image
i have pyqt5 widget class mplibwidget(qtwidgets.qwidget): """ base matplotlib widget """ def __init__(self, parent=none): super(mplibwidget, self).__init__(parent) self.figure = figure() self.canvas = figurecanvasqtagg(self.figure) self.canvas.setparent(self) self.mpl_toolbar = navigationtoolbar2qt(self.canvas, self) self.canvas.mpl_connect('key_press_event', self.on_key_press) self.axes = self.figure.add_subplot(111) self.axes.hold(false) when try use fit using result.plot_fit(ax=ax), plots data column of plot fit. not init_fit or best_fit. def fit(self, data, widget): self.layers = ['air', 'bk7', 'slg'] wv = np.arange(400, 900) mod = lmfit.model(self.get_r, ['wavelengths'], ['thickness', 'void_percent']) mod.set_param_hint('thickness', value=130, min=50, max=250) mod.set_param_hint('void_percent', value=.15, min=.05, ...

c# - The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[TipoDeCanal]', -

i error when passing data controller view: the model item passed dictionary of type 'system.collections.generic.list`1[tipodecanal]', dictionary requires model item of type tipodecanal'. public class tipodecanalescontroller : genericcontroller { private unitofwork unitofwork = new unitofwork(); // get: tipodecanales public actionresult index([datasourcerequest] datasourcerequest request) { //return json(unitofwork.tipodecanalrepository.get(),jsonrequestbehavior.allowget); return view(unitofwork.tipodecanalrepository.get()); } @model ..models.tipodecanal @using ..models @{ viewbag.title = "index"; } <h2>index</h2> @(html.kendo().grid<tipodecanal>() .name("grid") .columns(columns => { columns.bound(p => p.id); columns.bound(p => p.nombre).title("nombre"); columns.b...

plsql - Oracle sql last cancel record -

i have below data: order order_id order_name order_date order_status 1 iphone 20130102 13:20:00 cancelled 1 blackberry 20130102 13:00:00 cancelled 1 ipad 20130102 13:00:00 cancelled person person_id person_name order_id 1 harshini 1 i want retrieve below data when query based on order_date between 20130102 13:00:00 2013 13:20:00.it means last cancel order. person_name order_name order_date harshini blackberry 20130102 13:00:00 just try this... select p.person_name ,o.order_name,o.order_status order_1 o,person p orderdate=(select max(orderdate) order_1)

How to link a Symfony CMF StaticContent to an existing route -

i using symfony cmf stack without simplecmsbundle. in sonata admin able create staticcontents including seo metadata. working , can add content pages seo metadata way. however, how can link existing route of symfony application staticcontent (page)? for example, have messagecontroller defines own routes. /messages/inbox/{page}. how can define seometa (or staticcontent) these pages? if use dynamic routing, process route has reference content , using route enhancer content set request attribute "contentdocument" automatically injected standard symfony controller resolver: https://github.com/symfony-cmf/contentbundle/blob/master/controller/contentcontroller.php#l75 if not use dynamic router recommend add default on route containing content path. can use transform (see sensioframeworkextrabundle) or manually read document path inside controller action.

multithreading - Updating GUI from thread C#, without binding to UI controls -

it know invoke method used when u need update gui other thread. how can implement without binding control code? here's test class: class test { public list<thread> threads = new list<thread>(); public int nthreads = 0; public int maxthreads = 5; public void dowork(object data) { string message = (string)data; //messagebox.show(message); } public void createthread(object data) { if (nthreads >= maxthreads) return; thread newthread = new thread(dowork); threads.add(newthread); newthread.isbackground = true; newthread.start(data); nthreads++; } public void windupthreads() { //messagebox.show("count: " + nthreads.tostring()); for(int = 0; < threads.count; i++) { if (threads[i].isalive == false) { threads[i].abort(); threads.removeat(i); ...

android - How to get Ringtone from system sounds -

i'm using alarmmanager display alarms in android app, want display sound system available sounds alarm availability me choose between set sounds ringtone, alarm, notification : uri alert = ringtonemanager.getdefaulturi(ringtonemanager.type_alarm); // or type_ringtone or type_notification ringtone r = ringtonemanager.getringtone(mcontext, alert); but want system available tones , choose 1 between them. this worked me : uri ringtone= ringtonemanager.getactualdefaultringtoneuri(youractivity.this, ringtonemanager.type_alarm); and stated this answer , have following: intent intent=new intent(ringtonemanager.action_ringtone_picker); intent.putextra(ringtonemanager.extra_ringtone_existing_uri, ringtone); intent.putextra(ringtonemanager.extra_ringtone_default_uri, ringtone); startactivityforresult(intent , 1); and selected tone " uri " can store in ringtone shown below in onactivityresult() @override protected void onactivityresult(int requestcode, ...

linux - R: cannot install 'rasclass' package on Ubuntu 14.04 -

i trying install 'rasclass' package on r (version 3.2.3) somehow installation fails. output large pasted here, found interested in this question , might key solve issue. shortly: terminal can see have gcc-4.8 , 4.9, g++-4.8 , 4.9, , gfortran-4.8. remeber changing symbolic links between gcc , g++ use "4.9" version. can not having gfortran-4.9 problem? if so, how change symbolc links version after downloading? finally, paste last part of (failed) package installation. /usr/bin/ld: impossibile trovare -lgfortran collect2: error: ld returned 1 exit status make: *** [rcppeigen.so] errore 1 error: compilation failed package ‘rcppeigen’ * removing ‘/home/umberto/r/x86_64-pc-linux-gnu-library/3.2/rcppeigen’ * installing *source* package ‘matrixmodels’ ... ** package ‘matrixmodels’ unpacked , md5 sums checked ** r ** preparing package lazy loading error in loadnamespace(j <- i[[1l]], c(lib.loc, .libpaths()), versioncheck = vi[[j]]) : namespace ‘matrix’ 1.1-4 be...

python 3.x - Django blog post doesn't update it just creates another object -

this view supposed find blog post , change it's information, instead of makes new blog object new (and old) information. the update view @login_required def view_updatepost(request, blog_id): if not request.user.is_staff or not request.user.is_superuser: raise http404 #post = blog.objects.get(pk=blog_id) post_to_be_changed = get_object_or_404(blog, pk=blog_id) form = blogform(request.post or none, instance=post_to_be_changed) if form.is_valid(): post_to_be_changed = form.save(commit=false) # # post_to_be_changed.save() #messages.success(request, "<a href='#'>item</a> saved", extra_tags='html_safe') return httpresponseredirect(post_to_be_changed.get_absolute_url()) context = { 'post_to_be_changed': post_to_be_changed, 'form': form, } return render(request, 'blog/makepost.html', context) the template used view makepost....

jquery - Wrap divs from div parent -

i have code <div class="superdiv"> <div></div> <div></div> </div> i want wrap .superdiv children divs div called <div class="subdiv"></div> how can make ? thanks you use .wrapinner() method : $('.superdiv').wrapinner('<div class="subdiv"></div>'); you use .wrapall() method on children elements: $('.superdiv').children().wrapall('<div class="subdiv"></div>');

android - How to Increment a timer when a certain button is clicked? -

i know if it's possible increment seconds, hours, or minutes while timer running. have implemented answer in apps feedadapter. used kind of incremental function in countdowntimer , worked out!, when pause , resume again.(let's not it). handlers , functions in links's answer! i have 2 button in adapter: 1: start's timer 2: want button increment seconds or minutes etc. appreciate gets through! how handle multiple countdown timers in listview? public void incrementexpirationtime () { int defaultincrementvalue = 10000; //lets ten seconds (this can long data) long productexpirytime = getproductexpirytime(); productexpirytime+=defaultincrementvalue; } i made private long productexpirytime; instance didn't help. you can tinker better. how did take think useful let me know if have question. private final int increment = 10; private final int one_second = 1; private boolean running = false; private int time = 100; public void i...

meson build - Link static library to shared library or to a binary -

i have static library project a (let's call liba.so ) , want compile shared library in project b (let's call libb.so ) , embed liba.so in it. also, have binary in project b depends on liba.so , want embed in binary. is possible? how? when separate code base what build , install project a. create dependency on project in project b's definition. that looks this: a_dep = dependency('a', version : '>=1.2.8') lib_b = shared_library('proj_b', sources: 'prog_b.c', dependencies : a_dep) the version section in dependency optional. when in same meson project b when , b in same meson project, it's little uglier. have declare dependency anchor in a. that looks this: incdirs = include_directories('include') lib_a = static_library('a', 'proj_a.c', include_directories : indirs) liba_dependency = declare_dependency( include_directories : incdirs, link_with : lib_a, sources : [...

ember.js - Computed property on key of object passed as component parameter -

i have messages service messages saved in database , set them globally user have them set so messages: [ ember.object.create({ id: 1, name: "out bid", body: "you've been out bid on item", read: false, seen: false }), ember.object.create({ id: 2, name: "out bid", body: "you've been out bid on item, you've been out bid on item", read: true, seen: false }) ], i have computed tell me how many of these messages have not been marked seen , when click on bubble shows if number on 0 go messages route. in messages route inject messages service , set model equal messages service has in it model() { return this.get('messages').get('messages'); } this route displays messages in each loop renders component {{#each model key="id" |message|}} {{message-item message=message}} {{/each}} in component trying add unread c...

php - Handling table attributes/properties using CakePHP and MySQL -

first of all, happy new year :-) i think question obvious programmers didn't manage find answer. let's have customer table , customer have attributes (properties). don't want add new field in customer table every time add new attribute. moreover, customers don't have same number of attributes. all know each attributes known in advance (some day, add 'referer', 'age', 'type_of_prefered_food' .... attributes not mandatory, customers may fill information or not). my question is, best way manage using cakephp 3 , mysql ? having customer hasmany attributes (if think in case have have constant list of each properties id) or having customer belongstomany attributes (so, through relation table) knowing that, best : having attribute id referenced integer or string ? how retrieve specific property ... my question cakephp oriented, want know if 1 approach easier work with. there cakephp tools/function/library me retrieve/add/edit...

python - Ansible extra unquoted colon error -

hi following tutorial here https://pynet.twb-tech.com/blog/ansible/ansible-cfg-template-p2.html my site.yml --- - name: generate router configuration files hosts: localhost roles: - router my tasks/main.yml --- - name: generate configuration files template: src=router.j2 dest=/lib/python2.7/site-packages/ansible/rtr-template/{{item.hostname}}.txt with_items: testconfig my template (router.j2) no service pad service tcp-keepalives-in service tcp-keepalives-out service timestamps debug datetime msec localtime show-timezone service timestamps log datetime msec localtime show-timezone service password-encryption ! hostname {{item.hostname}} {{item.example}} ! boot-start-marker boot-end-marker ! logging buffered 32000 no logging console my var(main.yml) --- testconfig: -{hostname: router123, example: no ip cef} when run following output, think there problem var formatting. unsure how fix it error: syntax error while loading yaml script, /usr/lib/pyt...

python - Flask and PhantomJS, Evaluate internal URL -

i'm need evaluate internal url within flask (0.10.1) using phantomjs (1.9.8). if substitute http://www.google.com url correctly evaluates. if serve html on ip correctly evaluates. when try use internal url page hangs , receive 502 bad gateway . i've been struggling weeks. has calling internal url inside flask app, don't know how around this. appreciated. controllers.py from selenium import webdriver import os phantomjs = os.path.expanduser('/usr/local/bin/phantomjs') log = os.path.expanduser('/home/www/tmp/ghostdriver.log') driver = webdriver.phantomjs(phantomjs, service_log_path=log) driver.get('http://localhost/calendar') html = driver.page_source return render_template('{{html}}.html', html=html) ghostdriver.log phantomjs launching ghostdriver... [info - 2016-01-07t19:40:33.072z] ghostdriver - main - running on port 43105 [info - 2016-01-07t19:40:33.927z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - page.settings - {...

excel - Enabling scroll with xlValidateList -

i able scroll list create dropdown using vba. current code is: with dashboard.range("ac17").validation .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop,operator:=xlbetween, formula1:="='hidden template'!$ah$3:$ah$72" .ignoreblank = true end it creates dropdown list fine, ability scroll list mouse wheel when selecting it. any suggestions? thanks!! the scrolling in area apparently doesn't work well. user on site, jaafar tribak, has posted way this: scroll data validation list . it's kinda involved, code appears pretty plug-and-play. see last post on page. additionally, if put mouse on actual scroll bar , start scrolling, start working kind of. might able come sort of solution using controls

image processing - Aggregating neighbouring pixels Python / GDAL and Numpy without interpolation -

consider have image of 2000 x 2000 pixels , pixel size 10 x 10 meters. pixel values float numbers ranging 0.00 - 10.00. image a. i resize image a quarter of dimensions (i.e. 1000 x 1000 pixels) pixel size 20 x 20 meters (image b) spatially aggregating 4 neighbouring pixels in non-overlapping blocks, starting top-left corner of image, while value each pixel in image b result of arithmetic average. i have written following code using several sources stackoverflow; reason not understand resulting image (image b) not written , not readable of software want process further (i.e. arcgis, envi, erdas etc). i appreciate help best regards dimitris import time import glob import os import gdal import osr import numpy np start_time_script = time.clock() path_ras='c:/rasters/' rasterfile in glob.glob(os.path.join(path_ras,'*.tif')): rasterfile_name=str(rasterfile[rasterfile.find('img'):rasterfile.find('.tif')]) print 'processing:'+ ' ...