Posts

Showing posts from May, 2013

c# - NAudio - Stream audio outward in realtime via RTP -

i using naudio audio needs, i've run thorny issue. have remote device can receive rtp audio. stream audio file device (after u-law or similar encoding + rtp wrapping). however, there doesn't seem mechanism maintain outgoing timing rtp packets. for example, waveout player "manages" timing responding requests underlying sound/directx layers. in manner, timing maintained sound drivers using "pull" method. what i'm looking component can provide correct "pull" timing on (e.g.) iwaveprovider (or similar) can take each packet, rtp-ify it, , send on wire. so, here's core code: ipendpoint target = new ipendpoint(addr, port); socket sender = new socket( addressfamily.internetwork, sockettype.dgram, protocoltype.udp ); iwaveprovider provider = new audiofilereader(filename); mulawchatcodec codec = new mulawchatcodec(); // <-- chat example int alignment = provider.blockalign

php - Paypal Express Checkout API stopped providing purchaser's name -

we using paypal express checkout api our online store. it's been working past 2 years. week ago, had orders coming through missing shipping name, billing name, or both. payment successful , other information complete, it's missing person's name. not every payment has problem... affects about 1 in 5 payments. our fulfillment company requires name part of shipping address, need supplied paypal. i've tried searching solution no luck. has else experienced problem? idea might be? missing parameter state name required field? these parameters being passed api: 'method' => 'getexpresscheckoutdetails', 'version' => '98.0', 'user' => $paypaluser, 'pwd' => $paypalpassword, 'signature' => $paypalsignature, 'token' => $paypaltoken thank you!

python - Procedure entry point __gxx_personality_v0 could not be located libstdc++-6.dll -

Image
appreciate question has been asked , answered several cases i'm still having issues. directory structure laid out such: models/ bs/ __init__.py values.py optlib/ makefile bin/ optlib.so # generated after compilation/linking libstdc++-6.dll inc/ optlib.h stats.h obj/ optlib.o # generated after compilation/linking stats.o # generated after compilation/linking src/ optlib.cc stats.cc in short, source files in src , header files in inc , object files output obj , shared library file output bin . i've compiled , linked c/c++ libraries using following commands (extracted makefile ): g++ -c -iinc -o obj/optlib.o src/optlib.cc g++ -c -iinc -o obj/stats.o src/stats.cc g++ -shared -wl,-soname,bin/optlib.so -o bin/optlib.so obj/optlib.o obj/stats.o i'm using mingw on windows 7 machine , atte

csv - Logstash not_analyzed -

i total newby elk stack , trying setup complicated config start with... :-) i running whole stack on windows 7 laptop. , importing csv goes cannot string field not analysed giving me broken text in kibana visualisations. last try template. both template , conf file located in c:\logstash-1.5.0\bin directory. this conf file: input { file { path => "c:\users\jeroen\documents\temp\csv\elasticsearch_input_vc.csv" type => "core2" start_position => "beginning" } } filter { csv { columns => ["snapshot_date_time","country","tower","service","division","usd group","ref nr","processtype","importance","priority","severity","status , reason","category","is_valid_category","summary","open date time","closed date time","opened by",&qu

html - Dynamic page transitions in jQuery Mobile -

as part of new project, have dynamically create jquery mobile pages navigated between. need able create page, navigate it, delete previous page. these pages created json provided server. intention avoid using static markup these pages , create them entirely dynamically. unfortunately, seems transitions no longer work- 1 can working method fade. funny thing is, seems i'm not 1 problem. jquery mobile have demo page has same issue. they're not setting transition property, should default slide, it's fading, mine. looking problem has not helped. others seem have problem, no solution. known issue jquery mobile, , causes it? have use static pages? i have made original fiddle work using event delegation bind dynamic button: var pagename = "default"; $(document).ready(function () { function changepage() { var newname = pagename == "alpha" ? "beta" : "alpha"; $("body").append("<div id

d3.js - Javascript libary geojson maps every kind of projection -

i need javascript able visualize geojson maps. tried d3.js , leaflat have problem because in d3.js have define manually projection , leaflat accepts epsg: 4326. i data database , there data different projection, visualization wouldn't work that. is there javascript library can display geojson data projections without defining manually? projection should identified automatically , data should displayed right.

c# - unable to create a constant value of type anonymous type only primitive types -

using entity framework version=6.0.0.0 get common id , orderid shown below. var dt1 = p in dt.asenumerable() select new { id = p.field<int>("id"), orderid = p.field<int>("orderid") }; var dt2 = (from order in db.orders select new { order.id, order.orderid }).tolist(); var intersect = dt1.intersect(dt2); based on list of values in intersect. need select values orders table. trying used code getting error "unable create constant value of type anonymous type primitive types" var result= (from in sync.orders intersect.any(b => a.id == b.id && a.orderid == b.orderid) select a).tolist(); you trying "join" ef query in-memory data set, not work because there's not way embed list , lookup in sql. 1 option pull entire table memory asenumerable : var result= (

c# - How to implement FIND method of EF in Unit Test? -

i have web api 2.0 project unit testing. controllers have unit of work. unit of work contains numerous repositories various dbsets. have unity container in web api , using moq in test project. within various repositories, use find method of entity framework locate entity based on it's key. additionally, using entity framework 6.0. here general example of unit of work: public class unitofwork { private iunitycontainer _container; public iunitycontainer container { { return _container ?? unityconfig.getconfiguredcontainer(); } } private applicationdbcontext _context; public applicationdbcontext context { { _context ?? container.resolve<applicationdbcontext>(); } } private genericrepository<examplemodel> _examplemodelrepository; public genericrepository<examplemodel> examplemodelrepository { { _examplemodelrepository ?? container.resolve&l

udp - GStreamer UDPSink blocksize property not working? -

i'm using gstreamer , sending audio using pipeline: gst-launch-1.0 -v filesrc location=soundfile.mp3 ! mad ! audioconvert ! audio/x-raw, layout=interleaved, format=f32le, channels=2 ! udpsink blocksize=512 port=5005 host=127.0.0.1 however, blocksize doesn't appear working @ all. doc udpsink, accessed gst-inspect udpsink : element properties: name : name of object flags: readable, writable string. default: "udpsink0" preroll-queue-len : number of buffers queue during preroll flags: readable, writable unsigned integer. range: 0 - 4294967295 default: 0 sync : sync on clock flags: readable, writable boolean. default: true max-lateness : maximum number of nanoseconds buffer can late before dropped (-1 unlimited) flags: readable, writable

r - table command fails with shiny input variable -

i'm creating first shiny app, works fantastic when using ggplot2 using other base r or vcd plots has me stuck. i'd user able select tabling variable , view resulting mosaic or association plot. server code fails @ table command. things i've tried commented out below. thanks help. library(shiny) library(shinydashboard) library(vcd) header = dashboardheader(title = 'min reproducible example') sidebar = dashboardsidebar() body = dashboardbody( fluidrow(plotoutput('plot'), width=12), fluidrow(box(selectinput('factor', 'select factor:', c('os', 'gender')))) ) ui = dashboardpage(header, sidebar, body) server = function(input, output){ set.seed(1) df = data.frame(condition = rep(c('a','b','c','d'), each = 300), conversion = c(sample(c('convert','not-convert'), 300, replace = true, prob = c(0.9, 0.1)), sample(c

c# - Winform - SetFocus to textbox inside usercontrol on TabControl -

winform application multiple tabs on tabs replicated usercontrol when clicking on particular tab, setfocus textbox within usercontrol. if possible within tabcontrol_selectedindexchanged event. ex: textbox name = txtone txtone resides within usercontrola usercontrola resides within tabcontrol.selectedtab.text = "tab2" when click tab2 i'd focus set txtone. i've tried: (and many other things!) usercontrola.controls["txtone"].selectall(); - returns object reference not set instance of object thanks! because txtone not immediate child of usercontrola , usercontrola.controls["txtone"] return null. you can either dig way down control hierarchy control names ( usercontrola.controls["famefd"].controls["txtone"] ) or expose txtone public field or property in usercontrol class. latter this: public textbox txtone { { return txtone; } } then refer textbox external code this: userco

Javascript (vanilla) - How to specify the type of an element when using querySelectorAll? -

how can specify type of element when using queryselecterall()? example, want select input fields type=text in form. not styling functionality. this have right now: var inputgroup = document.getelementbyid('contactform'); var inputs = inputgroup.queryselectorall("input"); (var = 0; < inputs.length; i++) { inputs[i].addeventlistener("blur", checkinput); } function checkinput() { this.value === "" ? this.classname = "error" : this.classname = "valid"; } right targeting inputs type set submit, radio etc. want target input elements type set text. you can use attribute selector syntax directly in call queryselectorall : var inputs = inputgroup.queryselectorall('input[type="text"]'); this may miss <input> tags don't have type attribute specified @ all. can work around picking <input> tags without in selector: var inputs = inputgroup.queryselectorall('input[ty

swift - UITableViewCell subclass IBOutlets returns nil -

i've set uitableviewcell subclass storyboard , connected subviews iboutlets, can check here: public class waitingstatustableviewcell: uitableviewcell { @iboutlet weak var leftboxview: uiview! @iboutlet weak var lefttimelabel: uilabel! @iboutlet weak var lefttitlelabel: uilabel! overrided initialisers: override init(style: uitableviewcellstyle, reuseidentifier: string?) { super.init(style: style, reuseidentifier: reuseidentifier) self.initialconfigure() } required public init(coder adecoder: nscoder) { super.init(coder: adecoder) self.initialconfigure() } and on initialconfigure function try configure properties of subviews func initialconfigure() { self.leftboxview.backgroundcolor = uicolor.clearcolor() self.leftboxview.layer.shadowcolor = uicolor.darkgraycolor().cgcolor self.leftboxview.layer.shadowpath = uibezierpath(roundedrect: bounds, cornerradius: 12.0).cgpath self.leftboxview.layer.shadowoffset = cgsize(width: 2.0, height:

git - New branches always point to master -

i'm reading documentation , book when creating new branches forked local repo, no matter how many new branches make, head keeps pointing master , if have 10 branches, making changes in 1 affect of them. tempting remove directory , clone repo again, how deal these problems, once wanna try solve problem. appreciated making branch git checkout -b *branchname* cheking head git branch -v everything points 1 place 53f61b4 merged *repository name* master now after doing changes, lets on branch branchname , , not commiting changes, if switch master git checkout master it shows changes made in branchname when create branch, points commit starts. if use git checkout -b <branchname> , commit head. until commit new branch, won't diverge other branches. branch label , , several can point same place. creating branch doesn't generate empty commit or anything. this described in detail in documentation - there's picture showing situation.

From Java Object to JSON String using javax.json -

is possible create json string list<myclass> using java ee 7's javax.json library without iterating on list<myclass> ? this , performance unacceptable 2000 iteration. suggestion? list<myclass> items = mydb.getallitems(); jsonobjectbuilder builder = json.createobjectbuilder(); builder.add("success", true); jsonarraybuilder childrenarraybuilder = json.createarraybuilder(); (myclass item : items) { childrenarraybuilder.add( json.createobjectbuilder() .add("id", gettreenodeid(item) + "-" + (idsplit[1])) .add("nodestatus", b) .add("text", item.getname()) .add("leaf", false)); } you creating lot of objects in loops not necessary. gson , far myclass contains need like: list<myclass> list = mydb.getallitems(); gson gson = new gson(); string mystring = gson.tojson(list);

ruby on rails 4 - “Exact” phrase matching with wildcards + SOLR -

actually want exact matching 'b t patil' , have created following filed-type <fieldtype name="text_name" class="solr.textfield" omitnorms="false"> <analyzer> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.worddelimiterfilterfactory" preserveoriginal="1" splitonnumerics="1" splitoncasechange="1" catenatewords="1" catenatenumbers="1" catenateall="1" generatewordparts="1" generatenumberparts="1" stemenglishpossessive="1" /> </analyzer> </fieldtype> also text field , ngram filed applied on string. whenever entering b t patil query in field @ time returning me irrelevant results i.e returning me b t agrawal jaykumar b. patil bhaskar b. patil i expecting should return me b t patil or b.t.patil or b. t. patil results. need change tokenizer ?

How to use unboundid debug log and log4j -

need in integrating unboundid debug logs in log4j. i understand debug class used unboundid logs , want have them in log4j files try this: static { // bridge java.util.logger output log4j system.setproperty("java.util.logging.manager", "org.apache.logging.log4j.jul.logmanager"); // setting ldap debug level... system.setproperty("com.unboundid.ldap.sdk.debug.enabled", "true"); system.setproperty("com.unboundid.ldap.sdk.debug.level", "finest"); system.setproperty("com.unboundid.ldap.sdk.debug.type", debugtype.gettypenamelist()); }

java - Protected access modifier -

jls 6.6.2 gives following restriction package-access of protected members. a protected member or constructor of object may accessed outside package in declared code responsible implementation of object. what did mean responsible implementation. couldn't example? it means can't access protected super-class member of different instance of same class. package one; public class {protected int b;} package two; public class b extends { public void somemethod (a other) { b = 5; // allowed other.b = 5; // not allowed } }

gcc - compiler options to increase optimization performance of the code -

i porting code intel architecture arm architecture. same code trying build arm cross compilers on centos. there compiler options increase performance of executable image because image on intel might not give similar performance on arm. there way achieve this? a lot of optimization options exist in gcc. default compiler tries make compilation process short possible , produce object code makes debugging easy. however, gcc provides several options optimization. four general levels of incremental optimizations performance available in gcc , can activated passing 1 of options -o0 , -o1 , -o2 or -o3 . each of these levels activates set of optimizations can activated manually specifying corresponding command line option. instance -o1 compiler performs branches using decrement , branch instruction (if available , applicable) rather decrementing register, comparing 0 , branching in separate instructions. decrement , branch can specified manually passing -fbranch-count-reg

javascript - how to secure my ajax request which comes from multiple domain? -

i want accept limit domain requests such want accept request comes www.abc.com , www.xyz.com other request should denied . can't use token process server side because multiple domain using javascript code here can't think server side token , http_addr can manipulate javascript. please suggest how validate reliable? xmlhttprequest insert an origin header request tells site request came from. use populate the access-control-allow-origin header . (this, obviously, provides no protection against non-ajax requests).

c# - Get ViewData in View JQuery -

i have generic list , i'm passing viewdata controller .aspx view. need , iterate jquery script. how make script works? regards success: function (result) { var myarray = new array(); var myarray = '<%: viewdata["list"] %>'; (var = 0; < myarray.length; i++) { alert(i); } ok if using list of strings this do $(document).ready(function () { @{list<string> listfromcontroller = (list<string>)viewdata["list"];} var myarray = [ @for (int = 0; < listfromcontroller.count; i++) { @: '@(listfromcontroller[i])', } ] }); but if passing list of type rather string student employee or user need following please use appropriate class have passed , properties suppose "username" "firstname" "empid" or ever $(document).ready(function () { @{ var listfromcontroller = (list<knockoutjswebapi.models.loginviewmodel>)viewdata["list

deployment - Copy directory on destination machine during .deb installation in Ubuntu 14.04, 64 bit -

i want copy directory (which contains files) on destination machine during .deb installation @ path /opt/myprojectname in ubuntu 14.04, 64 bit. right able install files on destination machine during .deb installation using cmakelists.txt file per below. install(files myshfile.sh destination /opt/myprojectname) but want copy directory (which contains files) on destination machine @ path /opt/myprojectname . if has idea same please let me know. thanks.

unity3d - Error on converting UnityScript to C# -

i trying convert unityscript code d# , getting following error: expression denotes method group, variable , value or type expected on getcomponent void update () { float xvel = getcomponent().rigidbody2d().velocity.x; if( xvel < 18 && xvel > -18 && xvel !=0){ if(xvel > 0){ getcomponent.rigidbody2d().velocity.x=20; }else{ getcomponent.rigidbody2d().velocity.x = -20; } } } your issue with: getcomponent().rigidbody2d() not how use getcomponent, error seeing because getcomponent requires parameter or specified type. js , c# getcomponent work little different. mean do: void update () { float xvel = getcomponent<rigidbody2d>().velocity.x; if( xvel < 18 && xvel > -18 && xvel !=0){ if(xvel > 0){ getcomponent<rigidbody2d>().velocity.x = 20; }else{ getcomponent<rigidbody2d>().velocity.

javascript - Isotope JS Error -

need bit of js error getting please: uncaught typeerror: $portfolio.isotope not function //isotope function - filter portfolio function $portfolio = $('.portfolio-items'); $portfolio.isotope({ itemselector : 'li', layoutmode : 'fitrows' }); $portfolio_selectors = $('.portfolio-filter >li>a'); $portfolio_selectors.on('click', function(){ $portfolio_selectors.removeclass('active'); $(this).addclass('active'); var selector = $(this).attr('data-filter'); $portfolio.isotope({ filter: selector }); return false; }); if don't want script run on pages don't contain required elements ( .portfolio-items ), can run script conditionally based on length property of element collection stored in $portfolio : $portfolio = $('.portfolio-items'); if ($portfolio.length) { // if 'length' non zero. enter blo

asp.net core - Publish to IIS, setting Environment Variable -

reading these 2 questions/answers able run asp.net 5 app on iis 8.5 server. asp.net vnext beta publish iis in windows server how configure mvc6 app work on iis? the problem web app still using env.environmentname value development when run on iis. also, want run 2 versions of same web (staging, production) on same server, need method set variable each web separately. how this? this answer written asp.net core rc1. in rc2 asp.net core moved generic httpplafrom handler aspnetcore specific one. note step 3 depends on version of asp.net core using. turns out environment variables asp.net core projects can set without having set environment variables user or having create multiple commands entries. go application in iis , choose configuration editor . select configuration editor choose system.webserver/aspnetcore (rc2 , rtm) or system.webserver/httpplatform (rc1) in section combobox choose applicationhost.config ... in from combobox. click on envirome

javascript - node.js download image with unknown extension from url -

my issue download image given link, there 1 trouble - dont know image extension(bmp, jpg, png etc.) using request module, , succesfully download image of png extension: var fs = require('fs'); var request = require('request'); var url = 'www.images.com/image01.'; request(url+ '.png').pipe(fs.createwritestream('./image.png')); but when dont know image extension. think maybe can check responce , if it's = '404' , second try download image from: url + '.[another extension]' , on. likes callback hell. make request url, check content-type in header of request mime-type of file. can have file in project, called mime-types.js where download file, can make request of file: var mime = request('mime-types.js'); and content of mime-types.js file should this const jpg = "image/jpeg"; module.exports = { jpg: jpg } then can switch between different mime-types have ,

How to select large result set from Google BigQuery using .net api client library without pagination -

i trying select large result set (~200k) google bigquery using .net client library. i able ~4k rows @ single shot (request & response), google bigquery offers pagetoken next set of results. able select rows big query through multiple request google bigquery (~50 request & response). my question: if there possibility select large result set in single response? if yes kindly share code (even java code fine). there no way run query , select large response in single shot. can either paginate results, or if can create job export files, use files generated in app. exporting free. step run large query , export results files stored on gcs: 1) set allowlargeresults true in job configuration. must specify destination table allowlargeresults flag. example: "configuration": { "query": { "allowlargeresults": true, "query": "select uid [project:dataset.table]" "destinationtable&quo

sql - payroll for employee in stored procedures wth TVP -

i'm trying generate employee payslips , store in db stored procedure encountered problems. it pointing error execute: must pass parameter number 4 , subsequent parameters '@name = value'. after form '@name = value' has been used, subsequent parameters must passed in form '@name = value'. the parameters im inputing in are: start date end date employee hours worked information – table-valued parameter employee id , hours worked pay period. employee allowance information – table-valued parameter employee id, allowance type id , allowance amount. code: create type employeeinfo table ( employeeid int ,hoursworked int ,primary key ( employeeid ,hoursworked ) ); go create type allowanceinfo table ( employeeid int ,allowanceid int ,allowanceamount decimal(7, 2) ,primary key ( employeeid ,allowanceid ,allowanceamount ) ); go create procedure usp_create

php - Undefined variable on POST -

i looked trough pages , fixed undefined index on username , password undefined variable. had more code decided simplify sake of testing , echo see if changes , doesn't. <?php if (isset($_post['submit'])){ $uname = isset($_post['username']); $pass = isset($_post['password']); } echo $uname; echo $password; ?> i this: notice: undefined variable: uname in c:\xampp\htdocs\8\login.php on line 7 notice: undefined variable: pass in c:\xampp\htdocs\8\login.php on line 8 i not understand what's wrong here. if needed here form page html. <form id="login" method="post" action="login.php"> <div id="loginon"> <label for="username" style="color:#0f0; font-family:arial, helvetica, sans-serif;" >username: &nbsp; &nbsp;</label> <input type="text" id="username" name="username" /> <br /> <br

php - WooCommerce Bookings - Available dates as drop down menu -

i'm trying customize booking experience. products tours spread on year , scrolling through calendar find available day isn't efficient. want drop down list has next available day tour. there plugin or solution situation? hi file located in wp-content/plugins/woocommerce-bookings/templates/booking-form the code in post described works part there errors warning: reset() expects parameter 1 array, string given in /home/betaacademyofflo/public_html/wp-content/plugins/woocommerce-bookings/templates/booking-form/date-picker.php on line 54 warning: variable passed each() not array or object in /home/betaacademyofflo/public_html/wp-content/plugins/woocommerce-bookings/templates/booking-form/date-picker.php on line 55 this error appears every date available. a tweak trying make select list shows duplicates of each date need show date once. by each date once mean start date bookings have same start , end date. you can see example here example list have suppres

Loging from shell in Android -

how can log standard loginig system in android shell? 1 logcat used read log. know can write simple program that, isn't there 1 already? well, can use log command. adb shell log "msg" it quite obvious name command log , when think it.

android - Changing MainActivity in Java -

i'm making toggle button changes activity changes once want make permanent user not need change again , again. use shared preference . when user toggle button on (logged) application store login status sharedpreference , clear sharedpreference when user click on off(logged out). check every time when user enter application if user status shared preference true no need login otherwise move login page. to achieve first create 1 class, in class need write function regarding , set value in sharedpreference . please @ below code. public class savesharedpreference { static final string pref_user_name= "username"; static sharedpreferences getsharedpreferences(context ctx) { return preferencemanager.getdefaultsharedpreferences(ctx); } public static void setusername(context ctx, string username) { editor editor = getsharedpreferences(ctx).edit(); editor.putstring(pref_user_name, username); editor.commit();

php - Multiple insert with prepared statement -

i want insert 5 llines in db, following $qry = $db->prepare('insert ignore table (foo, bar) values (?,?), (?,?), (?,?), (?,?), (?,?)'); $qry->execute(array( array($foo1, $bar), array($foo2, $bar), array($foo3, $bar), array($foo4, $bar), array($foo5, $bar) )); gives me error warning: pdostatement::execute(): sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens what should make work ? remove arrays in execute() $qry = $db->prepare('insert ignore table (foo, bar) values (?,?), (?,?), (?,?), (?,?), (?,?)'); $qry->execute(array( $foo1, $bar, $foo2, $bar, $foo3, $bar, $foo4, $bar, $foo5, $bar ));

mysql - Version numbers in database? -

what version number in database , suppose if there multiple tables , in each tables records getting modified necessary have version number. under circumstances should use version numbers in database? you want find out mysql version using below sql. show variables "%version%"; thank you.

laravel - How to access Language Files in PHP Microframework Lumen -

i trying out microframework lumen laravel, can't access language files in laravel ... tryed bit around, didn't figure out. i'm asking you. what did far try out illuminate\translation\translator namespace error bindingresolutionexception in container.php line 744: target [illuminate\translation\loaderinterface] not instantiable. . did same thing symfony\component\translation\translator same result :( so, know how use language files under resources/lang/xx/ ? ok, found :) can still use trans() helper in laravel. here link, found list of helpers of lumen: http://lumentutorial.com/2015/05/lumen-helpers/ hf! :)

Need of main function in C, used in microcontrollers -

i have been using c embedded systems while, have question regarding main() function. when microcontroller boots up, control first reaches reset handler, control goes whichever function need to. if not using initialization code provided compiler library, can keep calling whichever function to. then, why need main()? ide (codewarrior) insists on having main() though. ideas? as per c99 standards not mandatory have main function 'freestanding' environment. in micro-controllers start-up initialization code called reset vector.this code performs global variable initialization,stack initialization etc. , jumps main function. you can modify start-up vector location or start-up code itself. can decide not call main function start-up code. if using own start-up code please make sure ide settings set not generate start-up code.

wpf - Why does async routine not return control to the end user -

working in wpf mvvm pattern. have area in application runs query against underlying database returned in form of xml (albeit unformatted @ stage). aim display xml in syntax editor (once has been correctly formatted) easier end user read. depending upon date range parameters supplied end user query xml returned can run few tens of lines potentially 2 or 3 thousand lines can take time format. typical returned query of 350 lines takes 6 seconds format. because of potential delay thought try use async routine end user did not think application had frozen. accept knowledge of async patchy , i've read available , followed couple of walkthroughs try , @ least make strat in right direction. the routine have below works (in far query run , have formatted xml appear in syntax editor). fails in far main intention control should handed ui not appear happen , string messages i'm passing status bar (with exception of last 1 'submission document completed') aren't be

time series - band filtering based on PSD, to filter out frequency domains in r, probably using "buttord" from signal -

Image
i'm still novice in r , read quite couple of posts , discussions on how filter out frequency domains in time series, none of quite matched problem. i ask suggestions following: calculated wavelet coherence 2 annually measured time series , taking @ wavelet coherence psd graph: the purple line (i.e. 8 year period) represents border under filter out frequency domain, not in psd, in original input data. i though using butter function signal package, overcomplicated purposes. thus approached problem bwfilter function of mfilter package fo pass through data on 8 year period corresponds 2.37e-7 hz. name="dta oak.resid tair " adat=read.table(file=paste(name,".csv", sep=""), sep=";", header=t) dta=adat$ya highpass <- bwfilter(dta, freq=8,drift=false) plot(highpass) however, results not seem correct, because seems filter out data, trend aligned original time series. do have idea may have gone wrong? measurement unit maybe? any

javascript - Parsing Facebook graph API JSON to html -

i'm new json , trying return list of facebook albums: $(document).ready(function () { $.getjson("https://graph.facebook.com/me/photos?fields=id,name&access_token=my token", function (data) { var items = []; $.each(data, function (key, val) { items.push("<li id='" + key + "'>" + val + "</li>"); }); $("<ul/>", { "class": "my-new-list", html: items.join("") }).appendto(".results"); }); }); json facebook: { "data": [ { "id": "10150589771916817", "name": "mobile uploads", "created_time": "2012-03-03t14:47:48+0000" }, { "id": "41633726816", "name": "old pics", "created_time": "200

jquery - Javascript - Offest div each time element is clicked -

i have been struggling simple issue little frustrating. need div move more right each time button clicked. <div class="gallery"> //gallery content here </div> <div class="arrow-m-left" onclick="moveleft()"> //button move gallery left 590px each time clicked. </div> <div class="arrow-m-right" onclick="moveright()"> //button move gallery right 590px each time clicked. </div> you can achieve of jquery .animate() . here example reference here html <button id="left">&laquo;</button> <button id="right">&raquo;</button> <div class="block"></div> css div { position: absolute; background-color: #abc; left: 50px; width: 90px; height: 90px; margin: 5px; } js $( "#right" ).click(function() { $( ".block" ).animate({ "left"

android - Accessing Gps issue -

i trying access gps in mobile using following code locationmanager= (locationmanager)getsystemservice(context.location_service); boolean isgpsenabled = locationmanager.isproviderenabled(locationmanager.gps_provider); loc1 =locationmanager.getlastknownlocation(locationmanager.gps_provider); till yesterday working fine app not fecthing gps i have enabled permission in manifest locationmanager this class provides access system location services. these services allow applications obtain periodic updates of device's geographical location, or fire application-specified intent when device enters proximity of given geographical location. you not instantiate class directly; instead, retrieve through context.getsystemservice(context.location_service). unless noted, location api methods require access_coarse_location or access_fine_location permissions. if application has coarse permission not have access gps or passive location providers. other providers

cascading dropdown inside kendo grid not working -

i have kendo grid cascading drop down using editor template.problem here when editing drop down showing blank when click on drop down rest functionality working fine.please me on why happening this. @(html.kendo().grid(model.locations) .name("grid") .htmlattributes(new { style = "min-height:400px" }) .columns(columns => { columns.command(command => { command.edit().htmlattributes(new { type = "button", @class = "btn btn-primary button" }); }).width(100); columns.bound(p => p.locationid).width(140).hidden(true); columns.bound(p => p.locationname).width(140); c

How to implement sink for C++ COM event handling? -

i'm struggling understand event handling when using com. have com object interface developed 3rd party should fire events. need handle these events c++ application. far have following code setup event: event setup (main.cpp) iconnectionpointcontainer* connection; result = comobjectinterface->queryinterface(iid_iconnectionpointcontainer, (void**)&connection); iconnectionpoint* connectionpoint; connection->findconnectionpoint(__uuidof(_icomobjectinterfaceevents), &connectionpoint); eventsink* sink = new eventsink(); dword cookie = 0; connectionpoint->advise(sink, &cookie); my problem don't know how implement eventsink? i've seen people create simple class extends form of idispatch implementation don't seem have implementation available , can't find decent examples on how create own implementation. have 2 methods on eventsink know called: eventsink.cpp hresult __stdcall eventsink::queryinterface(refiid riid, void **ppv) { *p

css - On MacOS perfect => On Windows a grey bottom border -

Image
i hope can ... have written little application in javafx. this module has vbox -> -toolbar -splitpane -> --anchorpane --anchorpane vbox set 600px height. splitpane , both anchorpanes also. in macos x looks great - in windows there big, grey border @ bottom. i don't know information can give solve problem ... please ask me if need know. i have tested splitpane , vbox red background. => fail, border still grey. thanks! , please forgive english writing ... i'm not native :) mac : windows : your splitpane not able cover whole height of vbox . force splitpane change height when vbox changes its, use : vbox.setvgrow(splitpane, priority.always); in fxml can achieve same effect adding : <splitpane vbox.vgrow="always">

java - Plugin framework and bi-directional program communication -

what way let 2 different separate java programs communicate each other? i not sure if want use osgi (but seems 1 still gets updates; jpf , jspf old). new topic plugin framework. right osgi description of architecture, plugin structure etc. , equinox , other thing real implementation, have use? i make things more precise: want program core tool should able hot-load plugins, , bidirectionally communicate them , javafx gui. i use class controlling gui , additional class algorithms , on (mvc). think style no longer helpful structure plugin-based tool. i want use design pattern beginning, else it'll end mess. the simplest solution problem use serviceloader (doc here ). included in java, , simple use: load jar file(s) @ runtime detect classes implement particular interface (e.g.: your.package.yourservice ). instantiate objects these classes. here pretty post describing how (note: should use second proposal urlclassloader ; not extend classpath dynamically)

python - insert not duplicate data with Pymongo in mongodb -

now,i try insert data pymongo in mongoldb. get_db().users.update({'_id':objectid(session['user_id'])},{'$push':{'hme':objectid(id)}},upsert=true) but,the method produce duplicate objectid.before try find_one(). if not objectid(id) in get_db().users.find_one({'_id':objectid(session['user_id'])})['hme']: get_db().users.update({'_id':objectid(session['user_id'])},{'$push':{'hme':objectid(id)}},upsert=true) better method request.. may use foreach.but syntax error yang if hme key holds arrays of objectid s try $addtoset operator instead of $push since adds value array unless value present, in case $addtoset nothing array ensures there no duplicate items added set , not affect existing duplicate elements: get_db().users.update( {'_id':objectid(session['user_id'])}, { '$addtoset':{ 'hme':objectid(id) } },

javascript - Why my Jquery code doesne't work. Am i properly connected to Html? -

please know noob question stuck on several days.thanks in advance. jquery when open js cosole shows me error $ not definded. why jquery code doesne't work. connected html? $(document).ready(function() { $('#container').mouseenter(function() { $(this).animate({ height: '+=10px' }); }); $('#container').mouseleave(function() { $(this).animate({ height: '-=10px' }); }); $('#container').click(function() { $(this).toggle(1000); }); }); <!doctype html> <html> <head> <title>project</title> <link type="text/css" rel="stylesheet" href="style.css"/> <script src="dev.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> </head> <body> <div id = "conta

ecmascript 6 - ng-control and two-way binding on radio buttons with angular2 -

i'm trying formbuilder , controlbindings (ng-control) of angular2 (alpha 27). i'm trying bind radiobuttons ng-control, can't work. my controller contains following code form: this.colours = [{text:"red"}, {text:"green"}, {text:"blue"}]; this.myform = builder.group({ sometext: [""], somecolour: ["blue"] }); on view tried following: <p *ng-for="var colour of colours"> <input id="{{colour.text}}" name="somecolour" type="radio" ng-control="somecolour" [checked]="myform.controls.somecolour.value == colour.text"> <label for="{{colour.text}}">{{colour.text}}</label> </p> the problem seems be, ng-control sets predefined value of somecolor on every 1 of radio-buttons. click on 1 of other radiobuttons works, bound value not changed. label bound value of ng-control never show value, predefin

oracle - how to show zero on the left before decimal point when using round()? -

i used round() function show file size in byte mb. the data following- file_size ---------- 2463 i used convert- round(document.file_size / (1024*1024), 3) file_size now data showing this- file_size ---------- .002 but, want this- file_size ---------- 0.002 just left zero. how can have this? try to_char(round(document.file_size / (1024*1024), 3), 990.000) file_size more information can find here: https://asktom.oracle.com/pls/apex/f?p=100:11:0::no::p11_question_id:2739503983093