Benjamin Benjamin

1

votes
0

answer
84

views

Haskell: Conversions of polymorphic types

I wanted to write a library that can convert types between various isomorphic formats and from 'subtypes' to 'supertypes', for example using the following isomorphisms and injections: (a, (b, c)) ((a, b), c) (Either a (Either b c)) (Either (Either a b) c) (a, ()) a ((), a) (Either a Void) a...
Benjamin Berger
1

votes
1

answer
61

views

jQuery, setting an active class based on the data attribute

After extensive research, I've come up with nothing that works perfectly. My HTML My JS $(function(){ activeClass(); }); function activeClass(){ //define the page url var path = window.location.pathname; path = path.replace(/\/$/, ''); //decode the uri path = decodeURIComponent(path); //find each it...
Benjamin Mills
1

votes
2

answer
45

views

How to create outline of circle that increases by 1/365 part each day of the year?

Rather new to JavaScript and I'm trying to complete this project: Inside a circle there will be a counter ticking up from 1 to 365, once per day, so at the time of writing it would say '5/365'. I've worked out how to do this. I also want the full circle to have a thin outline, which I assume you'd...
Benjamin Rowntree
1

votes
0

answer
314

views

Using Spring Eureka Discovery Client with SSL

I have a problem using a spring eureka discovery client (Service A) in combination with an non spring eureka client (Service B). When i try to get Service B from Service A i get an empty list. Both clients register themself successfully to eureka server. I have configured ssl and therefore disabled...
Benjamin Schüller
1

votes
1

answer
250

views

PHP/JS use use templates to create PDF and doc/docx/otf files

Hello as I am dyslexia my text writing skills are not the best, so please bear with me. I have a problem that I am kind of stuck on. I have a form on a webpage where a user fills in their details and clicks submit, after that a mail is being sent with a PDF as an attachment to my email. ATM. I am us...
Benjamin Karlog
1

votes
0

answer
312

views

Using pyMongo and APscheduler with Gunicorn --preload option

I start gunicorn with 3 workers (--workers 3) to launch a flask app and jobs configured with APscheduler. In order to launch my jobs just once (and not once per worker) I use the --preload option. However, my issue is that I also use pyMongo which does not work safe with the gunicorn --preload optio...
Benjamin
1

votes
0

answer
31

views

How to set the default value for Debugging Command in Visual Studio project properties

As mentioned in Why are a visual studio project's command-line settings stored per user? Is it OK to check-in (and share) a .user setting file? the Debugging properties are stored in the .user file which is normally ignored by source control. I have changed the 'Linker' -> 'General' -> 'Output File'...
Benjamin Cuningham
1

votes
1

answer
255

views

Resizing image-pixel arrays with Pillow

I'm working through one of the O'Reilly media books titled, 'Programming Computer Vision with Python', in which one of the exercises is to use pca on a set of images, with the aim of displaying the 'mean' image and the first seven modes; the directions with the most variation. Running the code shoul...
benjamin.g
1

votes
0

answer
90

views

QT - Cmakelist - CLion - vtable doesn't compile

I'm learning CPP and this weekend I learn more about QT, I'm using CLion and Cmakelist. I try to compile a project but when I add the macro Q_OBJECT it's say me : undefined reference to `vtable for DigitalClock' I'm looking for solved my problm and add AUTOMOC but it still doesn't work. Is my CMake...
Benjamin Sx
1

votes
0

answer
38

views

Python time library - imprecision in time evaluation

Out of curiosity, I wanted to see the imprecision of time evaluation in Python using time module. As I know that functions like time.time() and time.sleep()` are based on the CPU clock, what I expected was some more or less random imprecision in the evaluation of time. As a first experiment, I ran:...
Benjamin Barrois
1

votes
2

answer
341

views

Keep audio and video in sync HTML5

I have HTML5 video and audio elements that I'm needing to keep in sync with each other. Eg. if the video buffers then the audio would pause until the video is ready again. Would appreciate someone pointing me in the right direction.
Benjamin Sweney
1

votes
1

answer
288

views

HTTP Pipelining vs. WebSocket in Boost.Beast advanced server example

I have a question to this Boost.Beast example: https://github.com/boostorg/beast/blob/908f84cb3c023ed7c5bd19e2e5283d3218a6d820/example/advanced/server/advanced_server.cpp In line 643 a WebSocket upgrade is done. However, if I understand it correctly, there may still be HTTP write commands in the que...
Benjamin Buch
1

votes
0

answer
250

views

nginx reverse proxy -> double header

I've looking at this problem for a really long time, now it's time to ask for help: No matter what I tried, every option, that I add to the server header gets passed two times, giving me bad results on SSL labs and especially on mozillas oberservatory. So, here's my config (from a subdirectory in ng...
Benjamin Beuster
1

votes
1

answer
113

views

Apache Beam / Dataflow - Delays between steps in pipeline

I'm using Aapche Beam (with dataflow runner) to download binary files (weather forecast, roughly 300 files), then decode them, then store the results as CSV and then load the CSV into BigQuery. ------------ ---------- -------------- ------------------- | Download | ---> | Decode | ---...
benjamin.d
1

votes
0

answer
47

views

Using 'thunk' middleware to make asynchronous fetch requests

I'm having trouble moving from using fetch to using fetch within multiple dispatches. So this code works: export const checkLoginCredentials = (username, password) => { let data = {username: username, password: password} fetch('/authenticate', { body: JSON.stringify(data), headers: { 'Content-Type':...
1

votes
0

answer
34

views

live visitor counter for single page

I'm current working on a live leader-board page and i am trying to add a live view counter to it. I am not getting and data sent to the database and its not reading from the database. I have checked the db connection and its working. I have checked the code in php tester and it has no errors. Take a...
Benjamin Paul
1

votes
0

answer
46

views

Containers present on multiple host unable to communicate with each other

We have cluster of two nodes, each hosting 5 containers each. Both host are able to ping each other and host are able to ping their containers too. Now I need to communicate between the two containers residing on two different hosts. In this case ping is failing. Here is how my network looks like:...
Subodh Benjamin
1

votes
0

answer
80

views

Pass struct member variables by value when calling member functions of the same struct [duplicate]

This question already has an answer here: Borrow checker and function arguments in Rust, correct or over zealous? [duplicate] 1 answer Why does the parameter “borrow” the value? [duplicate] 1 answer This Rust code does not compile: struct Foo { x: i32, } impl Foo { fn bar(&mut self, x: i32) {}...
Benjamin Konz
1

votes
0

answer
52

views

TK103, TCP data contains unknown string

I am working on a code that gets location from a GPS tracker to a server, the GPS tracker uses TK103 as it's TCP communication protocol and it works fine. The device sends proper data stream something like, (057045144658BP05357857045144658180301A0604.8437N08018.7523E000.0002656000.0001000000L0000000...
benjamin c
1

votes
1

answer
69

views

How to set WooCommerce notices from functions,php?

I'm processing some requests in my Wordpress theme's functions.php, and need to set notices there. But none of the WooCommerce methods are available. How can I access wc_add_notice() from there? Code from my functions.php file: function my_function() { // some code wc_add_notice('Yay!', 'success');...
Benjamin Allison
1

votes
2

answer
24

views

increment jquery varibles

I have this code to create variables with different id(s), as you can see here: var numgrid = jQuery('.panel-grid').length; if (jQuery('#pg-'+id+'-0')[0]) { var os0 = jQuery('#pg-'+id+'-0').offset().top; var pg0 = jQuery('#pg-'+id+'-0').attr('id'); } if (jQuery('#pg-'+id+'-1')[0]) { var os...
Benjamin Seifert
1

votes
0

answer
332

views

Hadoop / Spark: kill a task and do not retry

I would like to know if there is a way to stop a job (and have it in a FAILED or KILLED state) when I detect something wrong within a map or a reduce task without Hadoop retries the task. If possible I would like to keep the fact that on 'normal' fails Yarn restart the task. Currently I am throwing...
Benjamin
1

votes
1

answer
401

views

How to populate angular material dropdown with user value in database?

The code that I've written so far populates for input fields but does not populate the dropdown in a reactive form. user.component.ts: onSelect(user: User): void { this.draw.toggle(); this.userForm.reset({ displayName: user.displayName, // input field that works email: user.email, // input field th...
Benjamin Andersen
80

votes
4

answer
125.7k

views

How to store a command in a variable in a shell script?

I would like to store a command to use at a later period in a variable (not the output of the command, but the command itself) I have a simple script as follows: command='ls'; echo 'Command: $command'; #Output is: Command: ls b=`$command`; echo $b; #Output is: public_html REV test... (command worked...
Benjamin
1

votes
0

answer
110

views

First derivate of NDVI time-series modelled with phenex spline and double logistic curve fitting

I'm modelling NDVI time series from MODIS terra and Sentinel 2 data. In order to get continuous NDVI values (needed to draw inferences on the plant phenology) I fitted curves to my data with the aid of the package phenex (modelNDVI function). The methods 'spline' and 'Double logistic' perform best...
Benjamin Sigrist
1

votes
1

answer
677

views

Opening High Sierra system log files (tracev3)

How do I view High Sierra system log files? Specifically I want to do so from recovery, or remotely. In recovery, log collect gives: “log: failed to collect LiveData: No such file or directory (2)” log show doesn't seem work according to its documentation even on a normally booted up system e.g...
Benjamin Dobell
1

votes
1

answer
54

views

Is nonexistence queriable in Datalog?

Suppose I've defined a few values for a function: +(value[1] == 'cats') +(value[2] == 'mice') Is it possible to define a function like the following? (undefined[X] == False)
1

votes
0

answer
44

views

bootstrap navbar toggler display error: collapsing, but disappears right after blinking animation css

I have trouble with the display of the collapse menu on bootstrap. The menu does appear but disappears as soon as the area has collapsed and displayed the elements (i did add script links to the jquery before the bootstrap js ref) here is how the code is called in the html: En Info Projets Catégor...
Benjamin Efrati
1

votes
0

answer
51

views

MySQL - Left join to subquery very slow

I have been struggling with this problem for a bit. I have a table of entries that need to be audited. I am storing the audit history of the entry in another history. An entry can be audited more than once with different values. In the end, I need to find the most recent audit status of an entry, al...
Benjamin Miller
1

votes
1

answer
460

views

Email sent using Contact Form 7 shows <a> tag code not a formatted link

I am using Contact Form 7 plugin with this addon 'Contact Form 7 Dynamic Text Extension' which allows you to use shortcodes to add data to your emails and form elements https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/ I created a shortcode that based on the current page adds a li...
Benjamin
1

votes
1

answer
112

views

Adding a base prefix to Neo4j bolt port

currently we are using a proxy server to route our spring application to a https url however we also want to do this with our Neo4j instance. This requires us to change the base prefix url to allow us to properly route the ports (bolt port and the browser port). Side note we are running Neo4j in a...
Benjamin Tobalt
1

votes
0

answer
29

views

Programmically Change Android USB Host Auto Launch

To get an activity to automatically launch when a specified USB device is connected, the following intent and cooresponding meta data can be added to the activity in the manifest: However, in my app, I have a settings tab where I want to give the user the option to enable or disable auto launch. How...
Benjamin Brownlee
1

votes
1

answer
39

views

Django sending wrong filename with UUID based download

Folks, I'm having an issue that I can work around, but I'd prefer not to. I just rewrote my gallery application, to use a UUID based database index for the download. Eg. url(r'^(?i)download/(?P.+)/', frontend.views.new_download, name='downloads'), So download/ will lookup the file by searching for...
1

votes
0

answer
27

views

video auto play is not working with appendChild

I found code to automatically scroll text and images and modified this to apply to video content (See Snippet). The only problem is that the autoplay doesn't get actioned after: appendChild. I've tried (amongst other things): document.getElementById('video').play(); Below is the code in current f...
Benjamin Hammond
1

votes
1

answer
733

views

R: unable to find an inherited method for function ‘spplot’ for signature ‘“data.frame”’

I am trying to create a map using the spplot function in R. I have loaded different libraries that are necessary to carry out this function: > library(mosaic) > library(latticeExtra) I have read in two data frames. The first, CENSUS, is a table containing 8 different characteristics for 33 Wards in...
Benjamin
1

votes
0

answer
40

views

android background service that triggers manual events

I recently discovered that I could connect my wireless keyboard and mouse with my phone using an OTG adapter. My phone now has an always available, physical keyboard as well as a cursor. I was curious if I could reroute the keyboard input to preform different manual touch events when not being used...
1

votes
0

answer
100

views

How can I use JSF 2.3 with wildfly-swarm?

What I have found out so far: If one would use wildfly 12, it is possible to use JSF 2.3 by enabling ee8.preview.mode, since then you would have Java EE 8, which comes with JSF 2.3. The currently newest release of wildfly-swarm 2018.5.0 uses wildfly 11, which comes with Java EE 7, and comes with JSF...
Benjamin
1

votes
1

answer
269

views

VBA Outlook keep formatting of email with replacement

I am currently working with Excel and Outlook VBA and I got the problem that when using the Replace function to change the mail body the formatting (font size, bold font, hyperlinks) gets deleted. That destroys the readablity of the mail and I need to change this issue. Set OutApp = CreateObject('O...
Benjamin Frza
1

votes
3

answer
36

views

R make subfactors based on consecutively occuring value

Hi does anyone know how to make a subfactor or unique marker to groups of data with the same value or factor consecutively so my data can look like this value group| subgrouping 1 a a.1 5 a a.1 2 a a.1 3 b b.1 2 b b.1 5 b b.1 2 b...
0

votes
0

answer
6

views

Open Facebook app using Facebook link page with Swift

After several searches on Google and Stackoverflow, I can't find the solution to my problem. At present, my app opens a Facebook page via Safari. But I would like this same page to open automatically in the Facebook app. Would you have a solution to offer me please? Here is the code that I implement...
Benjamin Tourin

View additional