Posts

Showing posts from April, 2011

ruby on rails - Rails4 order by column alias in joins group -

i want have slugs of categories in descendent order of number of products per category (the category slug category witht products first , ones without products last) i rails 3.2 query category. joins("left outer join products on products.category_id = categories.id"). select('count("products"."id") products_count'). group("categories.slug"). order("products_count desc"). select("categories.slug") worked. after upgrading, an activerecord::statementinvalid: pg::undefinedcolumn error, saying column products_count doesn't exist ...and_id = categories.id group categories.slug order products_c... how should fix it? order not recognize aliases. quick fix: category. joins("left outer join products on products.category_id = categories.id"). group("categories.slug"). order('count("products"."id") desc'). select("categories.

Ansible - Registered Variable Usage In Loop -

i have git update 2 different items (mango , apple) , in next step display each individual checkout's latest versions. - name: checkout mango , apple git: repo: ssh://user@gerrit.adap.tv:26545/{{ item }}.git dest: "{{ scriptdir }}/{{ item }}" key_file: "{{ rsa_key }}" accept_hostkey: yes update: yes with_items: - mango - apple register: checkoutversion - name: display checkoutversion debug: msg="checkout version {{ item.name }}" with_items: - checkoutversion.after code output :- task: [makepkg | checkout mango , apple ] ********************************************** ok: [127.0.0.1] => (item=mango) => {"after": "d3aa6131ec1a2e73f69ee150", "before": "d3aa6131ec1a2e73f69ee150", "changed": false, "item": "mango"} ok: [127.0.0.1] => (item=primeribs) => {"after": "f9bb03466f248a9eb92c9656", "before

c# - Cannot add the Signalr Client library as a portable library to a Xamarin project -

Image
i have tried adding signalr client library , webapi client package xamarin solution (on visual studio xamarin support , on xamarin studio) error although able install other pcls (for example microsoft.net.http): could not install package 'microsoft.aspnet.webapi.client 5.2.3'. trying install package project targets 'portable-net45+sl50+win+wpa81+wp80+monoandroid10+xamarinios10+monotouch10', package not contain assembly references or content files compatible framework. more information, contact package author. and following error when adding signalr: adding microsoft.aspnet.signalr.client... adding 'microsoft.aspnet.signalr.client 2.2.0' corda.client. not install package 'microsoft.aspnet.signalr.client 2.2.0'. trying install package project targets 'portable-net45+sl50+win+wpa81+wp80+monoandroid10+xamarinios10+monotouch10', package not contain assembly references or content files compatible framework. more information, contact package

oracle11g - Cannot initialize database while using an Oracle for jhipster application -

i'm trying use oracle database jhipster development in production mode. database configuration is profiles: active: prod datasource: driverclassname: oracle.jdbc.oracledriver datasourceclassname: oracle.jdbc.pool.oracledatasource url: jdbc:oracle:thin:@127.0.01:49161:xe databasename: servername: username: vpp_owner password: vpp_owner jpa: database-platform: org.hibernate.dialect.oracle10gdialect database: oracle openinview: false show_sql: true generate-ddl: false hibernate: ddl-auto: none naming-strategy: org.hibernate.cfg.ejb3namingstrategy properties: hibernate.cache.use_second_level_cache: true hibernate.cache.use_query_cache: false hibernate.generate_statistics: false hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.singletonehcacheregionfactory the oracle server , running , i'am able connect database given credentials. after mvn -pprod mv

java - AWS (Windows 2012) unable to connect to APNS (Apple Push Notification Server) -

i trying connect apns server via java using com.notnoop.apns.apns.jar. public class applepushnotification { static apnsservice apns = apns.newservice().withcert(constants.cert_path, constants.cert_password).withsandboxdestination().build(); public static void pushmsg(string msg, string token) { try{ string payload=apns.newpayload().sound("default").alertbody(msg).build(); apns.push(token,payload); } catch(networkioexception ex) { ex.printstacktrace(); } } } i have downloaded apns production certificate , converted .p12 format , placed in server aws windows 2012 machine. however, no push notifications sent. the same setup works on local machine, windows 8 pc. static apnsservice apns = apns.newservice() .withcert(constants.cert_path, constants.cert_password) .withproductiondestination() .build() i c

angularjs - How to set the height of the body equals to the length of an array in Angular -

Image
i have user list, can grow dynamically if add new user. want whole body length of user list. in factory determine length of array , need know how access/translate view in angular. this: <div class="mainwrapper" id="mainview" style="width: {{gridsizeng.x * 122}}px; height: {{gridsizeng.y * length of user list }}"> ... </div> part of factory code: userservice.getusers = function () { $http.get("api/users") //your api url goes here .success(function(datafromserver){ //console.log('logging datadromserver ', datafromserver); //userservice.userlist = []; /*datafromserver.foreach(function(user, index, arr) { userservice.userlist.push(user); })*/ var initials = function(name){ var d1 = name.split(" ")[0].charat(0).touppercase(); var d2;

oop - Java - can I extend an instance of a class to make it a parent class instance? -

here small artificial example of trying achieve. have class many parameters - dog . have child class jumpydog , want learn how can can "extend" instance of dog make instance of jumpydog . class dog { int age, numberofteeth, grumpiness, manyotherparameters; jumpydog learntojump(int height) { jumpydog jumpy = new jumpydog(this); // not want copy parameters jumpy.jumpheight=height; return jumpy; } } class jumpydog extends dog { int jumpheight; void jump(){} } or can that: dog dog=new dog(); dog.makejumpy(); dog.jump() you can implement decorator pattern in java avoid copying fields initial object during "extension" internally keeping reference it, won't dog anymore (because dog class has fields avoiding copy). class jumpydog { dog measdog; int jumpheight; public jumpydog(dog me) { measdog = me; } public dog measdog() { return measdog(); } void jump(

matlab - Textscan on file with large number of lines -

i'm trying analyze large file using textscan in matlab. file in question 12 gb in size , contains 250 million lines 7 (floating) numbers in each (delimited whitespace); because not fit ram of desktop, i'm using approach suggested in matlab documentation (i.e. loading , analyzing smaller block of file @ time. according documentation should allow processing "arbitrarily large delimited text file[s]"). allows me scan 43% of file, after textscan starts returning empty cells (despite there still being data left scan in file). to debug, attempted go several positions in file using fseek function, example this: fileinfo = dir(filename); fid = fileopen(filename); fseek(fid, floor(fileinfo.bytes/10), 'bof'); textscan(fid,'%f %f %f %f %f %f %f','delimiter',' '); i'm assuming way i'm using fseek here moves position indicator 10% of file. (i'm aware doesn't mean indicator @ beginning of line, if run textscan twice sat

angularjs - How do I include one angular template in another so that bootstrap classes still work? -

i have directive uses 3 different templates: http://jsfiddle.net/edwardtanguay/plrkya7r/4 these templates each have panel , want them include header template same each of them, this: <script type="text/ng-template" id="itemmenutemplateundefined"> <div class = "panel panel-default" > <div ng-include="'itemmenutemplatepanelheading'"></div> <div class="panel-body"> <div>age: {{item.age}}</div> </div > </div> </script> the included template looks this: <script type="text/ng-template" id="itemmenutemplatepanelheading"> <div class="panel-heading">{{item.firstname}} <b>{{item.lastname}}</b> (problem included no color)</div> </script> the problem although includes scope variable values , html, doesn't seem have same html structure causes e.

gnuplot splot approximation or interpolation? -

Image
i'm rendering heat map using gnuplot splot pm3d using next script set view map set dgrid3d set pm3d interpolate 20,20 set palette defined(\ 0 '#00dc00',\ 3640 '#00ff00',\ 32767 '#c8ff00',\ 61894 '#ff8000',\ 65535 '#ff7000') splot "d:/source.dat" using 1:2:3 pm3d "source.dat" file contains next values 0 0 36 1 0 36 2 0 36 0 1 36 1 1 36 2 1 36 0 2 36 1 2 36.9 2 2 36 gnuplot produced next image but i'm not understand why have red color in top center point equals 36.6 temperature according pallete. in data file have 36.9 instead of that. seems me gnuplot approximated value. how configure in interpolate points?

arrays - JavaScript: unsure how call and apply relate to the arguments object in this function -

in abstract way, totally understand what's going on. great way have unlimited number of arguments functions being passed calculate object. var calculate = function(){ var fn = array.prototype.pop.apply(arguments); return fn.apply(null, arguments); }, sum = function(x,y){ return x + y; }, diff = function(x,y){ return x - y; }; this appears crux of function. using apply method here allow arguments object have pop method of array prototype where unclear is... the tut says going give function object , assign fn variable, remove function object arguments object, because of pop method. (the pop method removes last item of array, , assigns ever called pop method) in case fn variable. end arguments object, no longer has function object, has numeric values var fn = array.prototype.pop.apply(arguments); return fn.apply(null, arguments); recently, started realize perhaps misunderstanding seeing fn variable that, , not function pas

ios - Unexpected CFBundleExecutable key -

Image
after spending time googling, tells me issue new. we had functional project supporting ios7-8. of course multiple times submitted appstore. we use pods, lots of tracking , monitoring, ga , instabug. now decided submit version of app built on xcode 7 on ios 9 testflight. we disabled bitcode, since many pods, flurry , other prebuilt libraries not include it. the build successful, after submission itunesconnect this: we had same googleappindexing library (in pods too), removed it, make work. - instabug. going far, trying understand going on in ios 9 , changes made working project start throwing such errors. any thoughts , ideas welcomed! please share experience, , if missed something, gladly share steps. i encountered same problem today same exact error message when trying submit our app (using xcode 7 beta 5) instead of instabug.bundle bit, me tencentopenapi_ios_bundle.bundle . i solved problem finding named bundle in project - error message suggests - edite

Ajax Response throwing JavaScript Syntax Error -

function fnvalidatepcrhours(pcr, hoursentered) { $.ajax({ type: "get", url : "/tms/validatepcrhours.html?pcr="+pcr+"&hoursentered="+hoursentered, cache: false, success: function(data, textstatus, jqxhr) { alert(data); return true; }, error: function (jqxhr, textstatus, errorthrown) { alert(errorthrown); return false; } }); return false; } as response (in) server, script error. can 1 me on this?

c# - "An exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll but was not handled in user code" error -

i want make web service in visual studio 2013 application. i following error : "an exception of type 'system.servicemodel.protocolexception' occurred in mscorlib.dll not handled in user code". wcf service web.config : <?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5"/> </system.web> <system.servicemodel> <behaviors> <servicebehaviors> <behavior> <!-- avoid disclosing metadata information, set values below false before deployment --> <servicemetadata httpgetenabled="true" httpsgetenabled="true"/> <!-- receive exception details in fault

mysql - Order by a column in another table -

i have 2 mysql tables: web_forums_threads | tid | title | |=================| | 1 | news post | web_forums_posts | pid | tid | content | date_created | date_modified | |===========================================================| | 1 | 1 | today,.. | unix timestamp | null or timestamp | | 2 | 1 | agree! | unix timestamp | null or timestamp | i want select * web_forums_threads , , order recent date_created value web_forums_posts correct corresponding tid. i feel though results i've found google may incorrect case, because multiple rows can exist threads' tid. the example tried (with no success): select * web_forums_threads fid = :postfid order (select date_created web_forums_posts web_forum_posts.tid = web_forums_threads.tid) desc; the syntax might wrong concept there. don't want add column threads table because i'd storing info twice (the first post acts threads content). you have make join between 2 tables select * web_

jenkins - How to publish individual HTML report in Hudson per job run -

i have parameterized hudson job generates html report result. need attach html build not job html report changes based on parameters. http://wiki.hudson-ci.org/display/hudson/html+publisher+plugin did not because attaches report job , shows html report latest build. there way attach html report build hudson? yes, there way: sidebar link plugin . generate want, deploy anywhere ( jenkins private files, can accessed via http (described on plugin page @ comments section) / other http server ) , use mentioned plugin create linked link each job direct clicker html. you need add post-build action in job called 'anchor chain' contained ( described on plugin page ) parameters used create additional sidebar link.

c++ - EDSDK How to get Av property during LiveView -

i'm having trouble getting kedspropid_av after opening session camera. eventually av property before each video taken @ moment can't av property straight after opening session. (i'm able properties zoompossition during liveview etc. no luck av). i've tried getting av while button half pressed (during liveview mode) using command kedscameracommand_pressshutterbutton no luck went absolutely basic code still doesn't work , i'm getting avvalue = 0. appreciated. my basic code: // open session camera error = opensession(camref); if (error == eds_err_ok) { std::cout << "session open" << std::endl; edsuint32 av; av = getav(); std::cout << "aperture: " << av << std::endl; else{std::cout<<"edsdk error: " << error << std::endl;} getav function: edsuint32 getav(){ edsdatatype datatype; edsuint32 datasize; edsuint32 avvalue; error = edsgetpropertysize(camref, kedspropid_av, 0, &

git - How to deploy gulp on production server -

when building website (for sake of clarity html/js website) use gulp compile , concat files placed in build/ folder. the folder structure looks this: ├── assets │   ├── images │   ├── javascripts │   │   └── app.js │   └── stylesheets │   └── style.scss ├── bower.json ├── build │   ├── bower_components │   ├── images │   ├── index.html │   ├── scripts.min.js │   └── styles.min.css ├── gulpfile.js ├── index.html ├── node_modules │   ├── gulp-module-1 │   └── gulp-module-2 ├── package.json └── readme if include these files in git repo, of changes committed twice. is: change in assets/stylesheets/style.scss lead change in build/styles.min.css . however, if decide exclude build/ folder repository, need development tools on production server (i.e. gulp, npm, etc.) can difficult when there's limited privileges on production server. excluding assets/ folder not option lose source compiled files. therefore question is: considered best practice deploy on production serve

Need help understanding TCP sequence number and ACK number -

how sequence number generated? let's sender sends 2 packets: seq number: 68 ack number: 69 length: 62 bytes seq number: 130 ack number: 131 length: 62 bytes and recieves packet reciever sequence number 131 og ack number 130, sequence number next time sender sends packet? 131+62=193? "when host initiates tcp session, initial sequence number random; may value between 0 , 4,294,967,295, inclusive. " at sender: - send 1 packet, , keep track of sequence number , transmission time - once ack received packet, delete stored sequence number, , send new packet (using same strategy of saving sequence number , waiting ack) - if ack hasn't been received after timeout seconds since packet's transmission time, retransmit receiver. @ receiver: - upon receipt of packet k, send ack packet k - if k greater last sequence number received (or if haven't received packets yet), deliver packet application , keep track of k example : host a:

encoding - Writing Chinese and English characters to Mainframe in single file using Java -

we have requirement in need send data ibm (as400) system mainframe system. data combination of chinese , english characters. connecting as400 using jdbc driver , writing data using spring batch. mainframe team has confirmed code page use @ side cp935 chinese character column. while setting encoding property of itemwriter in spring have used cp935, able correctly decipher chinese characters hex values english characters in file not legible @ end. is there way have multiple encoding in single file, cp037 english column , cp935 chinese column? we sending file mainframe using connect direct? there possibility c:d might me changing code page? use unicode, has several encodings (unicode text formats) utf-8: 1208. see 1200 code page range . html text utf-8 fine chinese w.r.t. size, otherwise more chinese might want encoding.

javascript - A way to minify or uglify ES6 Template Strings -

something like var tpl = ` <div> template <span>string</span> </div> ` will produce: var tpl = "\n<div> \n template\n <span>string</span>\n</div>\n"; what need rid of spaces , maybe line breaks, other html minification tools do. so should become similar to: "<div>template<span>string</span></div>" are there ways achieve wisely , indestructible? the best approach using tagged template, like var tpl = minifyhtml ` <div> template <span>string</span> </div> `; you can start with function minifyhtml(parts, ...values) { var out = []; out.push(parts[0]); (var = 1; i<parts.length; i++) out.push(parts[i], string(arguments[i])); return out.join(""); } which same no tag. now can extend minify parts of template dynamically, tpl become expected string. the next step introduce static optimisat

Excel Performance - INDEX-MATCH combination -

i using excel create data sets used in vba application later. using formula: =index(basedata!$l$2:$l$10000;match(dataset!d5&dataset!e5&dataset!k5;index(b‌​asedata!$b$2:$b$10000&basedata!$c$2:$c$10000&basedata!$d$2:$d$10000;0);0)) usually range f.ex.: a2 - a10000 , because data can differently long , vary in data selection. however, slows excel extremely down. switched manual calculations, then, when activating automatic again, excel instance takes extremely long , crashes. i tried past data, when creating new dataset, have pull formula down again , through errors occur in data set. any suggestions can make index-match formulas more performant? i appreciate replies! update i guess lot of performance goes away because index-match not select exact range, counts in blank rows. how exactl range index match automatically? as mention in comment above, long 'regular' formula , not array formula, may find success replacing "a1:a10000&q

audio - Play a sound in android -

how make android app plays sound on click of button ? suppose, sound file a.mp3 inside res\sound\ how should play ? in advance. first of have create folder called raw put there music want play , : public class testsound extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button btsound = (button)this.findviewbyid(r.id.button1); final mediaplayer mp = mediaplayer.create(this, r.raw.musictest); btsound .setonclicklistener(new onclicklistener(){ public void onclick(view v) { mp.start(); } }); } supported media formatsandroid hope works :)

How to access JSON database using javascript -

how can find "firstname" value "anna" , display "lastname" @ end using javascript? dummy example me understand how works. var employees = [ { "firstname":"john", "lastname":"doe" }, { "firstname":"anna", "lastname":"smith" }, { "firstname":"peter", "lastname":"jones" } ]; document.getelementbyid("demo").innerhtml = employees.firstname; <p id="demo"></p> you'd have iterate , check value, want: for (var = 0; < employees.length; i++) { if (employees[i].firstname == "anna") { document.getelementbyid("demo").innerhtml = employees[i].lastname; break; } } to display more 1 anna - i'd use filter on array, , join : var lastnames = employees.filter(function(employe

javascript - leaflet blank screen on meteor but not on single nonmeteor test.html -

i´m using leaflet on meteor showing blank (grey) map without displaying map tiles. when test script locally in single html file working. <html> <head> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> </head> <body> test <div id="map" style="height: 180px;"></div> 123 <script> var map = l.map('map').setview([51.505, -0.09], 13); l.tilelayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { maxzoom: 18 }).addto(map); var marker = l.marker([51.5, -0.09]).addto(map); marker.bindpopup("some text :)"); </script> </body> </html> but not working when try in meteor. meteor setup: i have main.html declare cdns: <head> <script src="http://cdn.leafletjs.com/leafle

karma runner - Jasmine: Function with transformResponse/resolve -

i have function in controller: function get(request) { return userservice.get({ id: request.id, transformresponse: function(data) { return angular.fromjson(data); } }); }; and test this: var $scope; var controller; var userservice; beforeeach(function() { angular.mock.module(function($provide) { userservice = jasmine.createspyobj('userservice', ['get']); $provide.value('userservice', userservice); }); }); beforeeach(inject(function($rootscope, $controller, userservice) { $scope = $rootscope.$new(); controller = $controller('...' { $scope: $scope, userservice: userservice }); $scope.$digest(); })); it('should call user service function when getting user', function() { var request = { id: 5 }; controller.get(request); expect(userservice.get).tohavebeencalledwi

sql - Select Max Row from Column -

i have scan codes used in table, table doesn't save newest scan codes. have order numbers multiple items on orders. the issue need last scan code on each item number each order , not every time has been scanned. don't need know has been scanned prep customization shipping. need know in shipping. 3 results 1 item number because has been scanned 3 times.i don't need duplicate result has been scanned. the "s3dtnseq#" column number of times has been scanned.i need keep rows highest scan count. lower highest scan count need rid of. 'scan to' column "s3dtsto". using "s3dtnseq#" column determine row kept idea. select tmon "order number", tmcpo# "po#", tmrqd "due date", s3itno "item number", s3orqt "quantity", tmcust "cust#", tmname as, "cust name" s3dtsto "scanned to", tmschid "sched id, max( s3dtnseq# ) "

WPF Grid containing rows and columns can be dragged vertically or horizontally -

i need display rectangular grid of items can rearranged both vertically , horizontally i.e. rows can moved , down, , columns can dragged left right. each cell host edit control of sort e.g. richedit box. i'd table (like in microsoft word) , not 3d control. ideally, i'd able insert rows , columns @ runtime. i'm trying think of way can achieve this. far i've thought of: using styled listbox of items, each item containing grid of "cells", separated gridsplitters, , somehow synchronizing vertical gridsplitters. approach, rearranging rows straightforward, dragging columns difficult. using styled listview of sort. creating custom grid , override onrender method display gridlines. displays well, i'm not sure how rearrange rows columns. any thought on how best achieve this?

ruby - Why is my code entering a string when I explicitly convert into an int, ONLY for one specific output? -

this i'm working on right now. here code (feel free critique it, , please do). def order_weight(weights) weightslist = weights.split(" ") def convert(weight) weight.split("").reduce{|sum,n| sum.to_i + n.to_i} end weightsconv = weightslist.map {|weight| convert(weight)} weightslist.sort_by{|a| [weightsconv[weightslist.index(a)],a]}.join(" ") end this works on everything except following input string: order_weight("3 16 9 38 95 1131268 49455 347464 59544965313 496636983114762 85246814996697") in case (by printing), see first 3 entries in weightsconv corrupted "3", "7", "9". else stays same. solved adding .map{|n| n.to_i} @ end of line 7. don't understand why necessary, since i'm converting inside previous block. goes wrong inside one input? ruby bug? no, it's bug. from enumerable#reduce documentation: if not explicitly specify initial value mem

dom - Determine which element the mouse pointer is on top of in Javascript -

i want function tells me element mouse cursor over. so, example, if user's mouse on textarea (with id wmd-input ), calling window.which_element_is_the_mouse_on() functionally equivalent $("#wmd-input") demo there's cool function called document.elementfrompoint sounds like. what need find x , y coords of mouse , call using values: var x = event.clientx, y = event.clienty, elementmouseisover = document.elementfrompoint(x, y); document.elementfrompoint jquery event object

java - How to create Orika global Object Factory? -

is there way create global object factory? mean, example: this.mapper.map(source, myclass.class); this.mapper.map(source, myclass2.class); i want when orika creates myclass , myclass2 instance through custom object factory, not classes, want each one. is there generic way accomplish this? reason because using spring , want custom object factory add instances applicationcontext when creates one.

rails 4 resets session on every request in production -

i implementing web app using rails 4.2.0 , ruby 2.2.0 , facing problem time request in done new session set. in case cannot save session since it's gone. leads situation authenticity token cannot checked. for testing purpose forgery protection disabled in applicationcontroller , that's not reason why session reset. class applicationcontroller < actioncontroller::base #protect_from_forgery with: :null_session skip_before_action :verify_authenticity_token ` end i using active record store save session, same happens cookie store: myapp::application.config.session_store :active_record_store, :key => '_myapp_session', domain: :all, tld_length: 2 every time request done new entry sessions table inserted new sessions_id , session cookie in browser points new session. any ideas reset session? this happens in production environment. in development fine. your issue due call skip_before_action :verify_authenticity_token ; if authenticity to

sqlite - sqlcipher how to import a sqlite3 database -

i have dumped sqlite3 database .sql file. afterwards have import files this: cat databasedump.sql | sqlcipher encrypted_database then i've opened encrypted database , set key with: pragma key="12345" then close database , reopen it, it's still not encrypted. how can load dump in database , encrypt it? $ sqlcipher plaintext.db sqlite> attach database 'encrypted.db' encrypted key 'my password'; sqlite> select sqlcipher_export('encrypted'); sqlite> detach database encrypted;

javascript - unable to access scope property value in directive from a listener function of dragover event inside the link function -

i have directive "droppable" , in scope have property called "configuration" contains value of type object. being bind individual object inside ng-repeater. i have added event listener & handler "dragover" event of element inside link function. in handler of element accessing scope.configuration should contain value have provided html template(value object inside ng-repeater). the template have created recursive 1 dragover event bind elements , children well. what doing these whenever drag on these elements depending upon configuration object(which array of values decide whether droppable area)user indicated setting .dropeffect=move / none. the problem not getting scope.configuration target element of "dragover: event. please me this. comdir.directive('droppable', function () { return { scope: { "configuration": "=config", }, link: function (scope, element, attrs) {

Navigate web pages from php interpreting javascript -

in past have written php script continuously fetches external web page curl, gets html, parses it, , stores "caught" numbers in database. now such external web page has evolved: number no longer "static" (meaning: constants in page's html, or generated server scripting), generated after non-trivial javascript scripting after web page ready, involving ajax call. so, can't use curl anymore. what can use "numbers" after javascript has completed calculations , calls? i'd write in php, if needed may use other language (on unix) , call php. what recommend? can done or hell? (p.s.: i'm afraid of may think may doing "illegal" it's nothing that, "external website" belongs company.) thanks lot

mapreduce - HBase-Mapreducer, optimal number of reducers when using TableReducer -

we using map reduce write data hbase. since have formatting done, implemented our own reducer extending tablereducer. custom reducer behaving differently in production , development environments. getting following error error: org.apache.hadoop.hbase.client.retriesexhaustedwithdetailsexception: failed 659 actions: regiontoobusyexception: 659 times, from here , understood flushing not done properly. however, same working fine in dev environment. along above option, feel configuring number of reducers might effect, how data sent region server. we using salt span row keys among region servers. of now, salt 20m , number of region servers 60. should salt chosen equal number of region servers span records evenly? if not, how identify optimal value number of reducers, while loading data hbase. also, in general, maximum number of connections allowed @ client side, interact hbase. here, using api provided map reducer, in general, we handle client connection hbase, maximum number

wpf - C# NAudio - Changing audio playback position still plays a small buffer of old position -

i trying make basic mp3 player in c# , wpf, along naudio. added slider tracks current position in song allows drag different position , upon thumb.dragcompleted set song's position dragged it. this works fine , all, except when make jump new position, still plays old position 1/5th or of second before changing. noticeable e.g. while singer in middle of singing "aaa", pause, drag point sings "ooo", play again, hear "aa-ooo". results in sounding pretty horrible. so suppose audio playback has small 'buffer' remaining insists on playing before moving on. there way clear buffer? or setting position wrong? i using waveout waveoutdevice , audiofilereader audiofilereader . slider called sldrplaybackprogress . tried change position in song in 2 different ways already: first method: audiofilereader.currenttime = new timespan(0, (int)(math.floor(sldrplaybackprogress.value / 60)), (int)(math.floor(sldrplaybackprogress.value % 60))); sec

javascript - Mongoose model data not saved -

i working on nodejs project, using mongoose , mongodb, , when handling profile update logic, try post data server including profile photo upload, use formidable handle file upload , there no issue, other form fields not being saved there no error message, below it's route code, please me goes wrong. router.post('/api/profileupdate/:username', function(req, res, next) { user.findone({ username: req.params.username }, function(err, user) { if (err) { console.log(err); } else { if (user) { console.log('user found, going update ...'); user.age = req.body.age; user.gender = req.body.gender; user.description = req.body.description; user.occupation = req.body.occupation; var form = new formidable.incomingform(); form.parse(req, function(err, fields, files) { //res.writehead(200, {'

sorting - How to write XPath code to customize a sorted list of data in SharePoint Designer 2010? -

hello , thank help! i working within data form web part in sharepoint designer , need sort data in abstract way. needs sorted 1 column alphabetically catch there 2 specific values column have absolute priority , belong @ top of list. brand new xpath language. can hand xpath code or direction take solve problem? -philip using xpath sort results in custom manner after server has delivered them not going efficient; it's better have sharepoint sort results via caml query parameters before returns them can work paged results. otherwise you'll looking @ retrieving every item list put them in right order. you might consider taking different approach spares writing custom xslt. depending on column type drives sort order, may able add calculated column list displays modified version of source column's value. the following formula checks if column named "source column" equal "value a" or "value b". if it's 1 of values, it'll

c++ - Creating extendable datasets in parallel HDF5 -

i trying write data hdf5 file in parallel. each node has own dataset, unique (although same size). trying write them separate datasets in hdf5 file in parallel. catch later may want overwrite them different size datasets (different size compared original set of datasets --- dataset on each processor same size). know how this? (code relies on boost , eigen) i have code first open file: boost::mpi::environment env(argc, argv); // set info hdf5 , mpi mpi_comm comm = mpi_comm_self; mpi_info info = mpi_info_null; // set file access property list parallel i/o access hid_t plist_id = h5pcreate(h5p_file_access); h5pset_fapl_mpio(plist_id, comm, info); // declare file id std::string filename = "test.h5"; // create file hid_t fileid = h5fcreate(filename.c_str(), h5f_acc_trunc, h5p_default, plist_id); // close property list h5pclose(plist_id); then create , write datasets: // mpi communicator unique_ptr<mpi::communicator> worldcomm(new mpi::communicator); c

php - How to Add a check Constraint to Doctrine Annotation in Symfony -

suppose have field gender in person entity can take of following values male female others how can provide check using doctrine orm annotation , create corresponding radio button in form using php app/console generate:doctrine:crud ? can directly? or have rely on manual approach? you can specify valid choices using choice constraint orm annotation entity property. symfony book uses gender example. in case array {"male", "female", "other"} , , may not want validation error message. as validation in annotation format need enable annotation validation in symfony app configuration (config.yml), believe still disabled default.

javascript - Opening second datepicker after selecting date -

i have 2 datepicker inputs , i'm trying automatically open second 1 after date selected in first. of now, datebox opens , promptly closes. can fine outside of knockout.js viewmodel without datebox closing, problem want second datebox open if first 1 has valid date. this works fine outside of viewmodel, mentioned above, doesn't account errors start date. $("#start_date_input").datepicker('option',"onclose", function() { $( "#start_date_input" ).datepicker( "show" ); }); this i'd second datepicker triggered self.startdate.subscribe(function(){ var startdateerrors = ko.validation.group(self.startdatevalidation); var enddateerrors = ko.validation.group(self.enddatevalidation); if(startdateerrors().length == 0 && enddateerrors().length == 0){ populatelist(); } else if(startdateerrors().length == 0){ //if valid start date selected, show end date $("#end_date_input&q

spring mvc servlet 3 async response no database result in test -

i'm testing new servlet 3 asynchronous requests in new project , stuck while testing controller. i have controller method this: @requestmapping(value = "/thumbnails", method = requestmethod.get) public callable<responseentity<list<thumbnail>>> getallthumbnails() { //at point results repository return () -> { //at point don't results final list<thumbnail> thumbnails = thumbnailrepository.findall(); return responseentity.ok(thumbnails); }; } and corresponding test this: @test @transactional public void testgetallthumbnails() throws exception { thumbnailrepository.saveandflush(thumbnail); final mvcresult mvcresult = restthumbnailmockmvc.perform(get("/test/thumbnails")) .andexpect(request().asyncstarted()) .andexpect(request().asyncresult(instanceof(responseentity.class)))

xml - Preceding-sibling and following-sibling not working with additional element -

i first want apologize length of question, providing information help. i attempting use single xsl on multiple xml documents, , works on original document (the text of 4 walls in room, each wall represented tei surfacegrp element). however, need modify xsl deal tei surfacegrp element, representing 2 sides of written page, , collection of pages. my original xml code 4 walls this: <tei> <sourcedoc> <surfacegrp xml:id="wall" n="south wall"> <surface xml:id="eets.t.29"> <label>verse 29</label> <graphic url="sw_test_1.jpg"/> <zone> <line/> </zone> </surface> <surface xml:id="eets.t.30"> <label>verse 30</label> <graphic url="sw_test_2.jpg"/> <zone> <line/> </zone>