Posts

Showing posts from January, 2015

h.264 - VLC streaming requires extreme bandwidth -

Image
i streaming 1080p video 1 computer using rtp. use following command line: .\vlc.exe -idummy -vvv "test.mp4" --sout "#rtp{mux=ts,dst=10.0.0.5,port=1234}" "vlc://quit" the bit rate of video track of source file (h.264 high profile) below 6 mbit/s, audio bit rate below 100 kbit/s (aac he). nonetheless, vlc uses 1 gbit/s streaming: additional transcoding not change notably, when bit rate specified: .\vlc.exe -idummy -vvv "test.mp4" --sout "transcode{venc=x264{preset=veryfast},vb=3000}:rtp{mux=ts,dst=10.0.0.5,port=1234}" "vlc://quit" since videos work fine (i.e., stream @ few mbit/s barely cpu load) , others don't (like 1 described above), wanted ask possible troubleshooting steps there are. -vvv not give errors, warnings or debug infos after initial buffering. the sending , receiving computer both run windows 10 64-bit , connected through gigabit ethernet switch. connection seems fine other application. test...

reactjs - React Router: Render new view without page refresh -

Image
hello! i'm trying rework react-router navlink renders new page on click, instead of rendering @ bottom of div, shown in gif above. here's content of main app.js component: import react, { component } 'react'; import './app.css'; import {browserrouter router, switch, route} 'react-router-dom'; import home './home.js'; import './about.js'; import september './september.js'; import trilogy './trilogy.js'; class app extends component { render() { return ( <router> <div> <switch> <route exact path = '/' component={home} /> <route path = '/about/' component = {about} /> <route path = '/september/' component = {september} /> <route exact path = '/september/trilogy/' component = {trilogy} /> </switch> </div> </router> ); } } export default app; the home component's code, holds navbar that's used in hom...

Android: TelephonyManager.listen() callback not being called -

i installed call state listener on telephonymanager recognise if call outgoing. if manually start phone call callback being triggered. good. if start phone call program(same program contains callback listener) not triggered. why? (the call being established successfully) code starting call: uri call = uri.parse("tel:" + number); intent intent = new intent(intent.action_call, call); context.startactivity(intent); p.s.: necessary permissions set in manifest, off course. otherwise wouldn't work in manual scenario.

c# - Create ShellObject using WindowsAPICodePack -

i have following parsingname shellobject "::{26ee0668-a00a-44d7-9371-beb064c98683}\\0\\::{e2e7934b-dce5-43c4-9576-7fe4f75e7480}" how create new shellobject based on value? i have tried (where path = above string) shellobject obj = shellobject.fromparsingname(path) but exception arguments not valid.

ssl - Pound Apache Varnish - HTTPS requests -

i followed guide, enable https websites: http://www.geoffstratton.com/varnish-and-pound-apache works, not https however run few differences , https doesn't work: what have difference in is: start=yes daemon_opts="-a :80 \ -t localhost:6082 \ -f /etc/varnish/default.vcl \ -s /etc/varnish/secret \ -s malloc,256m" used custom.vcl here $cfg['pmaabsoluteuri'] = 'http://myserver.com/path-to-phpmyadmin'; then, assuming phpmyadmin lives in directory myserver.com/phpmyadmin, tell varnish ignore in vcl_recv: if (req.url ~ "phpmyadmin") { return(pass); } , in sub vcl_fetch: if (req.url ~ "phpmyadmin") { return(hit_for_pass); } skiped part completely, reason varnish , phpmyadmin works without it. your .pem files have in order of rsa key, server certificate, intermediate certificate. i had different certificates given, , instructions convert private.key pr...

Npm with git-submodules: package not found -

i'm using: git version 2.12.2.windows.2 node -v v6.10.3 npm -v 5.3.0 i had following project structure: main project package.json node_modules dependencies npm linked sub project core a npm linked sub project core b sub project core package.json node_modules dependencies sub project core b package.json node_modules dependencies sub project package.json node_modules dependencies sub project b package.json node_modules dependencies sub project c package.json node_modules dependencies sub project a,b,c needing sub core project , b. every project versioned git. using structure running , building of projects fine resulted in major problems: 90% of dependencies same resulting in tons of duplicate packages. installing packages in every project takes massive amount of time. npm install anywhere without removing symlinks removed packages should not removed. restructured project following structure: adding main project git , a...

c# - DataSet and DataRow for Net Standard 1.5 -

i'm trying port pcl net-standard stable version (1.5). the system.data.datatable fix nuget package of system.data.common v4.3.0. there workaround fix system.data.dataset , system.data.datarow namespaces without targeting net-standard preview version 2.0? or maybe valid refactor type use it? you cannot use dataset/datarow these classes not present in netstandard1.5. if library uses these types in public api cannot replace these classes own "system.data.dataset" or "system.data.datarow" because these custom types not match real framework classes come in netstandard2.0. if use internally may rewrite code use idatareader , idbcommand directly, or use 3rd-party data access library nreco.data provides own simplified recordset structure similar datatable/datarow (but not same of course).

sass - How to apply a line of css to all browsers but IE? -

i don't want recreate file specific line of code, want ignore css line if in internet explorer. avoid putting inline css. is possible? .container { height: 100px; // apply in chrome, firefox, safari, etc. } yes, can use conditional comment. <!--[if !ie]>--> <style> .container { height: 100px; /* in chrome, firefox, safari, etc */ } </style> <!--<![endif]--> notice "not" operator ! apply browsers not ie. see this link more.

json.net - Why is .Net trying to load the wrong version of Newtonsoft.Json? -

in project have following packages installed: jwt v2.3.2 ( https://www.nuget.org/packages/jwt/2.3.2 ) newtonsoft.json v9.0.1 ( https://www.nuget.org/packages/newtonsoft.json/9.0.1 ) when program runs, throws exception system.io.fileloadexception not load file or assembly 'newtonsoft.json, version=10.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) @ jwt.serializers.jsonnetserializer.serialize(object obj) @ jwt.jwtencoder.encode(idictionary`2 extraheaders, object payload, byte[] key) ... why .net attempting load version of newtonsoft.json. jwt requires v6.0.4 or greater have satisfied. both of these packages installed , working before newtonsoft.json had v10. how runtime know v10 exists? i solved immediate problem adding binding redirect down v9 find root of problem. i ran update-package newtonsoft.json -reinstall , ...

Richfaces error page redirection with gatein, jboss 5.1.0 ga portlet bridge jars and my mistakes -

Image
i know there lot of similar questions out there same/similar topics not apply of solutions problem. i want redirect user custom error page whenever exception caught while rendering portlet page. why exception thrown while rendering page ? because in background throw give user useful information, designed way , not going changed anytime soon, intention keep way. i belive better if give examples: simple portlet provide use name , press ">>" button information user, in previous implementation working fine see second picture.. second picture: as can see layout correct""(this how looked) error page has replaced portlet content own content , error message why not information user. far good. now lets @ problem case: have upgraded jboss 4.2.3 ga 5.1.0 ga , gatein comes play ground. there old jars used create view of portlets, upgraded newer ones. such as: (org.richfaces.framework) richfaces-api 3.3.3-final, (org.richfaces.framework) rich...

ruby on rails - Can't install a npm module with webpacker-react -

i install react-dropzone in project. use react-rails project. had installed webpacker-react use gem. installed react-dropzone via npm install , can't load in react components. (i suppose it's due webpacker-react). so, how load modules installed via npm react components? component.jsx import dropzone 'react-dropzone' class main extends react.component { ondrop(file) { } render() { return ( <div classname="container"> <div> <dropzone ondrop={this.ondrop().bind(this)}> <p>to fix</p> </dropzone> </div> </div> ) } } package.json (well installed) "react-dropzone": "^3.13.3", error message in firefox console: referenceerror: require not defined in debugger : var _reactdropzone = require('react-dropzone'); webpacker.yml ...

android - How would I convert this activity to a Fragment? -

below main activity navigation drawer. i've realised fragment transaction, cant activity has fragment. possible convert fragment or shall start again.. import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.navigationview; import android.support.design.widget.snackbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmenttransaction; import android.support.v4.view.gravitycompat; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbardrawertoggle; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.menu; import android.view.menuitem; import android.view.view; public class mainactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); ...

curve 25519 - Does PBC (pairing-based cryptography library) support curve25519? -

i don't know how input point @ curve25519 using pbc. if not, how can calculate pairing points @ curve25519? is there other lib solving this? curve25519 not pairing-friendly. there 2 famous libraries pairing: miracl , pbc .

hadoop - Oozie coordinator scheduling using cron expression giving error -

i have scheduled coordinator using cron expression frequency = "20 3 * * 2-4" gives error. oozie coordinator logs "java.lang.illegalargumentexception" : paramter [frequency]=[20 3 * * 2-4] must integer . parsing error input string : "20 3 * * 2-4" hdp version : 2.5.3 oozie client build version : 4.2.0.2.5.3.0-37 .. .. you requesting oozie apply xml schema coordinator... in version 0.2 of schema. the documentation hints cron syntax worked schema 0.2 i'm pretty sure cron scheduling introduced in oozie v4.0 (and documented in v4.1) -- , since oozie v4.0 introduced schema 0.4 believe documentation wrong. bottom line: requesting xmlns="uri:oozie:coordinator:0.4" should allow oozie parse cron schedule correctly.

angular - set/edit route queries(or params) without navigating -

hi want use routes store information pagination data or filter data in queries (or params). example i'm on app/datagrid and want add page=2 , pagesize=10 it app/datagrid?page=2&pagesize=10 is there way edit/set them current route without triggering route change/update? thanks! if adding current route, route not change. won't reload component if parameters change. you can see example here: passing params angular 2 traditional way this uses .navigate command, if navigating same component displaying, won't "navigate". alternatively, build service retains data instead of using route parameters. have example here: https://blogs.msmvps.com/deborahk/build-a-simple-angular-service-to-share-data/ the service this: import { injectable } '@angular/core'; @injectable() export class dataservice { servicedata: string; } but instead of servicedata you'd have page , pagesize .

parallelizing nested for loop with cuda have big limit -

i new cuda. i'm trying write cuda kernel perform following piece of code. for(int oz=0;oz<count1;oz++) { for(int ox=0;ox<scale+1;ox++) { for(int xhn=0;xhn<wjh;xhn++) { for(int yhn=0;yhn<wjv;yhn++) { //int numx=xhn+ox*wjh; int numx=oz*(scale+1)*wjh+ox*wjh+xhn; int src2=yhn+xhn*wjv; ic_real[src2]=ic_real[src2]+sr[oz*(scale+1)*wjv+ox*wjv+yhn]*hr_table[numx]-si[oz*(scale+1)*wjv+ox*wjv+yhn]*hi_table[numx]; ic_img[src2]=ic_img[src2]+sr[oz*(scale+1)*wjv+ox*wjv+yhn]*hi_table[numx]+si[oz*(scale+1)*wjv+ox*wjv+yhn]*hr_table[numx]; } } } } the value wjh=1080,wjv=1920,scale=255;oz>=4.this have currently,but code can perform when count1<=4, if oz>4 ,it doesn't work,does know should ? cheers __global__ void lut_kernel(float *sr,float *si,dim3 size...

azure - Getting the time frame in which a series of message is received in stream analytics -

i streaming event messages contain posix/epoch time field. trying calculate in time frame received series of messages device. let's assume following (simplified) input: [ { "deviceid":"device01", "epochtime":1500975613660 }, { "deviceid":"device01", "epochtime":1500975640194 }, { "deviceid":"device01", "epochtime":1500975649627 }, { "deviceid":"device01", "epochtime":1500994473225 }, { "deviceid":"device01", "epochtime":1500994486725 } ] the result of calculation should message {deviceid, start, end} each device id. assume new time frame starts, if time intervall between 2 events longer 1 hour. in example result in 2 transmissions: [ {"deviceid":"device01", "start":1500975613660, "end"=1500975649627}, {"deviceid":"device01", "start":500994...

php - Symfony switch from 2.8-3.3 ClassNotFoundException use statement missing namespace? -

just decided upgrade symfony 2.8 3.3 being noted felt best start fresh symfony project , pull on parts of project , change key needed items changed on major version upgrade. have worked out of issues meaning may have more issues suspect. here current one: c:\xampp\htdocs\fresh_api>php bin/console server:run php fatal error: uncaught symfony\component\debug\exception\classnotfoundexception: attempted lo ad class "commandlistener" namespace "directive\multitenant\masterbundle\eventlistener". did forget "use" statement namespace? in c:\xampp\htdocs\fresh_api\var\cache\dev\a ppdevdebugprojectcontainer.php:580 stack trace: #0 c:\xampp\htdocs\fresh_api\vendor\symfony\symfony\src\symfony\component\dependencyinjection\contai ner.php(331): appdevdebugprojectcontainer->getappbundle_commandlistenerservice() #1 c:\xampp\htdocs\fresh_api\var\cache\dev\appdevdebugprojectcontainer.php(965): symfony\component\d ependencyinjection\container->get('app_bu...

c++ - COM Automation structures vs wrappers for them -

i developing com wrapper windows apis, can used scripting languages don't have native windows api support. thinking should use in com atl projects. safearray or ccomsafearray ? variant or ccomvariant ? or other structure or appropriate wrapper it? i tested using both types, no special performance differences, usage problems or additional implementations found between them. which 1 best used in com atl projects? example, safearray or ccomsafearray ? the interfaces , coclasses must use safearray , variant . can't have com interface or object uses ccomsafearray or ccomvariant in of com-public method signatures or properties. can use ccomsafearray or ccomvariant inside coclass implementations, however.

javascript - Pass variable from config to factory in AngularJS and UI Router -

i'm trying make search in http call different value depending on view i'm in. my factory looks this: .factory('searchservice', ['$http','$filter', function($http, $filter) { var service = { getallexhibitors : function () { var searchindex = 'berliner'; var url = '...'; var config = { params: { search: searchindex }, cache:true }; $http.get(url, config).then(function (data) { service.datafairs = data.data.rows; ... }); }... as can see i'm passing hardcoded variable searchindex parameter search. could set variable depending on view i'm in? my config router looks this: .config(function($stateprovider) { var berlinerstate = { name: 'berliner', url: '/berlinerliste/', views: { 'header': { templateurl: 'header.htm' }, ...

Hide html elements in vuejs2 -

i want hide html elements during initial load, clicking button or link show html elements. can't find solution hide or show element in vuejs2 version. can able see few options in vuejs not sure how use methods. below component code in want hide html element(id) "message". <template> <div class="row"> <div class="col-lg-12"> <label class="checkbox checkbox-inline no_indent"> <input type="checkbox" value="">show stats </label> </div> </div> <div class="row"> <div class="col-lg-12"> <div class="panel-group"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">list values</h3> ...

java - Docker Image with Mixin of Base Images -

i build docker image uses nodejs , java runtime. it possible find separate docker files, 1 each base. how can use 2 bases create new image? in case, gonna run angular app, , spring app in same image. any tips on how have single image such requirements? make sense? if makes sense in case hard judge outside. in general should image 1 thing, run 1 app in particular. seems mixing 2 things in 1 container. if want this, i'd choose "more difficult install" image , choose base image (seems spring image). i'd add packages node.js, should few lines of code. since dockerfiles public, can images , build own image both apps. but in general sounds need 2 images, 1 angular stuff, 1 spring stuff. can compose these images docker-compose or manually linking them if needed.

What is a built in object in Javascript? -

this question has answer here: in ecmascript, how of native objects built-in? 2 answers i read 1 of differences between object-based , object-oriented former supports built-in objects(eg., window object in javascript).so, built-in object , why isn't there in object-oriented language java. that's not difference between 2 terms. for programming language considered "object-oriented", must support following 4 programming concepts: inheritance encapsulation abstraction polymorphism there many languages support these "four pillars of oop" (java, c/c++, c#, javascript, etc.). some languages, however, don't. famous example of call "classic vb" (visual basic prior introduction of .net). language simulate inheritance, there not actual mechanism built language it, while "classic vb" had native objects, ...

angular - Setting dynamic validators on checkbox -

Image
i have form consists of checkbox populated via json server. there 20 objects, , 5 of them contain selected = true, while others false. my html: <input formcontrolname='questioncontrol{{ question.question_id }}' #checkbox class="pvq-create-checkbox" type="checkbox" [name]="question.question_id" (change)="checkedstate($event, checkbox)" [checked]="ischecked(question)"> on initial population of form, setting ischecked(question) , based on selected remove validators controls selected=false. however, on click of checkbox setting validators with: setvalidator(questionid) { //set min length validator this.answercontrolarr[questionid - 1].setvalidators(validators.minlength(4)); this.answercontrolarr[questionid - 1].setvalidators(validators.required); this.answercontrolarr[questionid - 1].updatevalueandvalidity(); console.log(this.answercontrolarr[questionid -1]); //set value // if(this.questionsarr[questionid - 1][3]...

javascript - Cannot remove LayerGroup or FeatureGroup in Leaflet -

i'm using leaflet javascript. have lot of layers being added l.featuregroup (i have tried adding them l.layergroup). problem is, when call either of following functions, not clear layers off map: map.clearlayers(layergroup); map.removelayer(layergroup); i have set this: var layersolutiongroup = new l.featuregroup(); //var layersolutiongroup = new l.layergroup(); have tried both of these var test = l.tilelayer.wms("http://censored:8080/geoserver/ows?", { layers: 'test:layer1', format: 'image/png', transparent: true, name: 'yep', cql_filter : customparamsls }).addto(layergroup); var test2 = l.tilelayer.wms("http://censored:8080/geoserver/ows?", { layers: 'test:layer2', format: 'image/png', transparent: true, name: 'test1', cql_filter : customparam...

c# - Remove all value duplicates in array -

example array: int[] s new = {1,2,3,1}; if use: int[] inew = snew.distinct().toarray(); then out put: {1,2,3} but want out put: {2,3} you need select duplicate count == 1: snew.groupby(x => x) .where(x => x.count() == 1) .select(x => x.first()) .toarray(); fiddle here

objective c - React Native iOS - Error if I change from default Bundle Identifier -

so default cfbundleidentifier org.reactjs.native.example.$(product_name:rfc1034identifier) results org.reactjs.native.example.myapp i changed com.myapp.mobile.myapp , doesn't launch. error log jul 25 19:25:39 as-mbp springboard[1348]: [watchdog] [com.myapp.mobile.myapp] provision violated watchdog process-launch: <fbsprocessresourceprovision: 0x60000052d2a0; allowance: <fbsprocessresourceallowance; type: realtime; timevalue: 20.0s; unitcount: 1>; violated: yes> jul 25 19:25:39 as-mbp com.apple.coresimulator.simdevice.079d4b52-a15c-4a51-822f-72d2b663bbf7.launchd_sim[1327] (uikitapplication:com.myapp.mobile.myapp[0xb4e6][3080]): service exited due killed: 9 jul 25 19:26:01 as-mbp routined[1337]: corelocation: error occurred while trying retrieve motion state update: cmerrordomain code:104 jul 25 19:26:12 as-mbp springboard[1348]: [watchdog] [com.myapp.mobile.myapp] provision violated watchdog process-launch: <fbsprocessresourceprovision: 0x608000336b20; allow...

excel - Functions of a class vba -

i building class has bunch of dictionaries store bunch of column data. depending on parameters, dictionaries printed little differently. created functions within class print data sheet. here class sub export() 'finding next available cell activesheet lastrow = .cells(.rows.count, "a").end(xlup).row end nextrow = lastrow + 1 = 1 me.batchno.count if me.location(i) <> "a_ref " or me.location(i) <> "b_ref " me.notref(i,nextrow) 'syntax error here!!! else me.isref(i,nextrow) 'syntax error here!!! nextrow = nextrow + 1 next end sub and here function calls function notref(i integer, nextrow integer) function isref(i integer, nextrow integer) all functions print saved data "syntax error" when call them. calling them wrong? help. i'm bit rusty on vba believe cannot call functions c/c++/c# style, allow ignore return value. vba function returns value , must therefore pr...

angularjs - I cannot load child router if I am currently in child router and refresh browser -

this router. var studentenroll = { name: 'student-enroll', label: "enroll student", url: '^/home/students/enroll', params: { studentid: { dynamic: true } }, templateurl: stateroute + 'studentenroll/student-enroll-base.tpl.html', controller: 'studentenrollctrl', controlleras: 'studentenrollcontroller', data: { authorizedroles: ['admin'] }, breadcrumbparent: breadcrumbparent }; var enrollselectstudent = { name: 'enroll-select-student', label: "select student", parent: studentenroll, views: { '': { component: "enrollstudentselect" ...

email - How to apply filter on recent N Outlook.Items and get Outlook.Items after filtering? -

i want use following code filter out unread outlook mails,but want apply restriction on recent n outlook.items.but not find such method. outlook.explorer currexplorer = null; outlook.folder currfolder = null; outlook.items folderitems = null; outlook.items restricteditems = null; outlook.mailitem mail = null; outlook.attachments attachments = null; int attachmentcount = 0; try { currexplorer = outlookapp.activeexplorer(); currfolder = currexplorer.currentfolder outlook.folder; if (currfolder.defaultitemtype == outlook.olitemtype.olmailitem) { folderitems = currfolder.items; restricteditems = folderitems.restrict("[unread]=true"); (int = 1; <= restricteditems.count; i++) { mail = restricteditems[i] outlook.mailitem; if (mail != null) { attachments = mail.attachments; attachmentcount += attachments.count; marshal.releasecomobject(atta...

timage - How to insert picture in the Delphi program itself? -

i have used timage component in program. at runtime, add image component using: image1.picture.loadfromfile('c:\users\53941\pictures\eq1.jpg'); now, want run program on other computer, not have image file @ source have given in code. so, how can store image file in program executable itself? store image file in program's resources, using .rc script or ide's resources , images dialog. read embarcadero's documentation more details: resources , images you can use tresourcestream access resource data @ runtime. construct tjpegimage object, load stream it, , assign timage : uses ..., classes, jpeg; var strm: tresourcestream; jpg: tjpegimage; begin strm := tresourcestream.create(hinstance, '<resource identifier>', rt_rcdata); try jpg := tjpegimage.create; try jpg.loadfromstream(strm); image1.picture.assign(jpg); jpg.free; end; strm.free; end; end;

how to find the right pair of handshake within HTTP Header file -

i working http headers recently, , file getting perfect 2-ways handshake. means, there get/post... request followed http/1.1 response. so, guaranteed kind of connection? or possible have multiple post/get ... requests before http/1.1 response or vice versa? if so, how can tell "which response" corresponds "which request"? there pattern? thanks in advance!

javascript - onKeyDown and on onKeyUp -

i'm working on app fly drone, having issues key bindings. we're using react , nodejs. onkeypress used connect, takeoff, , land drone (these work). however, onkeydown , onkeyup not working. i've thrown in few console.log , can see function running when keys pressed, seems backend recognizing when hold key down continue run function, front end switches onkeydown onkeypress onkeyup (thus canceling out initial function attached onkeydown event). hopefully makes sense, can attach code needed or link github. i'm relatively new coding, not sure if i'm trying possible or if needs else (socket.io i've been seeing). this our front end react code. import react, { component } 'react'; import './drone.css' import axios 'axios' import request 'react-http-request' export default class drone extends component { constructor(props){ super(props) this.state = { droneaction: '' }, this.handlekeydown ...

c - Error in signal handling in OpenMPI -

i'm working understand signal handling in openmpi. read "open mpi forward sigusr1 , sigusr2 mpiexec other processes". question is feature enabled default installation. the scenario 1 mpi process raises sigusr1, has detected 'orted' forwarded other processes. in test code, define custom signal handler sigusr1 , register signal handler accordingly. send signal using kill() or raise(). assume orte daemon receive signal , has forward signal remaining processes. // test.c void handle_signal(int signal){ if(signal==sigusr1) printf("received sigusr1 signal \n"); } int main(){ mpi_init(null, null); int my_rank; mpi_comm_rank(mpi_comm_world, &my_rank); signal(sigusr1, handle_signal); if(my_rank == 1) // process rank 1 raises sigusr1 kill(getpid(), sigusr1); mpi_finalize(); return 0; } if run mpirun -np 3 ./test i expect have statement printed twice other 2 processes. when run code, prints once, , orte hnp, unlike application pro...

c++ - Conditionally include source file based on compiler version? -

we testing project setup requires include or exclude source file based on compiler's version. test project located on github @ crc-test . poc, developing process crc-32c since both intel , arm have it. later applied aes, clmul, sha, avx{2}, bmi{2}, armv7a neon, armv8, etc. (ms compilers support neon , armv8 through intrinsics). the source file trying conditionally compile crc-simd.cpp . has implementations using sse4.2 intrinsics , armv8 intrinsics ( crc.cpp provides generic, c++ implementation). i added vcx project file @ crc-test.vcxproj . there itemgroup clcompile : <itemgroup> <clcompile include="main.cpp" > <precompiledheader /> </clcompile> <clcompile include="crc.cpp" > <precompiledheader /> </clcompile> <clcompile include="crc-simd.cpp" > <precompiledheader /> </clcompile> </itemgroup> i need conditional <clcompile include="crc-simd.c...

scheduled tasks - Nomad periodic job starts immediately -

i have nomad periodic job has in job config: periodic { cron = "* */2 * * *" prohibit_overlap = true } however, find when nomad finishes running job (the job takes less 2 hours), more or less starts again (sometimes within 60 seconds). expected start after 2 hours. why happen, , how can make nomad start job every 2 hours? you have * in minutes field, job start every minute. should change cron 0 */2 * * *.

java - Import external (not compiled) groovy classes and keep them outside the jar -

i created groovy project in eclipse. build executable jar, keeping of groovy file sources outside jar, can modified , reloaded @ runtime. i know can using groovyscriptengine: class modelclass = new groovyscriptengine( "path_to_file" ).loadscriptbyname( "model.groovy" ) ; object modelinstance = modelclass.newinstance() ; now, question is: possible simply, instance inside main class, use: import model class main { static void main(string[] args) { model model = new model(args) ... } i hope question clear enough... , thank help! if jar in context of groovy, can add classpath folder groovy files(classes). groovy classloader compiles them automatically on access. otherwise create groovy engine, add classpath directory groovy files..

numpy - How to debug a function in Python that only sometimes doesn't work? -

i going nuts because function gives wrong pair of data! have numpy array around 700 points: np.array =[[ 1.00000000e+01 -4.65000000e+02] [ 1.78319153e+01 -4.60252579e+02] ...] and have given point: point [32.121456577748098, -241.01907826915999] and want check in array point or index closest given point. i use line find nearest point: array[spatial.kdtree(array).query(point)[1]] which works nice. not work! gives item array not closest. interesting fact when try similar functions or solutions both functions not working @ same time. have no idea why works , not. array , points newly generated in main loop used tcp , udp. how can in general debug it? thanks! why don't in numpy? distance = np.sum((yourlist - yourpoint)**2.)**(1/2.) index = np.argmin(distance)

reactjs - React Quill Matchers are not applying to Headers -

i've made custom attributor classes highlighting whole lines, i've run issue clipboard matchers. using quill toolbar buttons can toggle attributors on line, when updating contents db (which uses dangerouslypastehtml()), <h1> elements have attributor classes stripped of them. i think has matches , fact both attributor , headers block scoped, can't figure out. custom attributor: export default class diffhighlightattributor extends parchment.attributor.class { add(node, value) { if (!this.canadd(node, value)) return false; this.remove(node); node.classlist.add(`diff-${this.keyname}`); return true; } remove(node) { let matches = match(node, this.keyname); matches.foreach(function(name) { node.classlist.remove(name); }); if (node.classlist.length === 0) { node.removeattribute('class'); } } } instantiating , registering attributors: const ...