Benjamin Benjamin

1

votes
2

answer
225

views

Git reflog expiration time

I have known that reflog entries gets deleted which are older than 90 days. I have not made any change in git config too regarding this. Today when I did git reflog master --date=local, I can see entries of 10 months before in it. How is that possible ?I should only be seeing entries dating back to...
Breaking Benjamin
1

votes
2

answer
24

views

Dart/Flutter DateTime difference inDays error for March 31 April 1

I am trying to get the difference in Days between two dates picked from a DatePicker. This works fine except for ONE single date : March 31. The difference in Days between two DateTimes is wrong by 1 day when one of the dates is March 31. I know this is due to Light Saving and March is 30.9… days...
Benjamin
0

votes
1

answer
43

views

When was the STRLEN opcode introduced in PHP?

I was surprised while checking the opcodes generated by a PHP script, that unlike other string functions like str_pad(), strlen() is not a function call like it used to (if I'm not mistaken), but has a dedicated STRLEN opcode: strlen($c); str_pad($c, 2); ... 8 4 STRLEN...
Benjamin
1

votes
1

answer
435

views

How can I bind an array of objects to arcs in a D3 pie chart?

I'm building a pie chart and my data is in the form of a JSON: [ { 'Stage':'birth', 'Avg':19071 }, { // } ] I don't know how I should use the data function to bind that json data to my selection. So this is not working for me: pie = d3.layout.pie(); arcs = svg.selectAll('g.arc') .data(pie(data)...
Benjamin
11

votes
2

answer
692

views

Why do elements created under a `new Document` contain the wrong prototype?

When creating a div it is an instance of HTMLDivElement: var d = document.createElement('div'); d instanceof HTMLDivElement; // true d instanceof Element; // true This also holds true when obtaining an external document and window: var frame = document.createElement('iframe'); document.body.appendCh...
1

votes
2

answer
2k

views

Gatsby: Set background image with CSS

Looking at the Gatsby docs, they suggest that you can reference background images like you would anywhere else: .image { background-image: url(./image.png); } What they don't cover is where these images should live. I've tried placing the image directory in the src folder, in the layout folder, and...
Aaron Benjamin
1

votes
3

answer
88

views

How to Write a Lambda Wrapping a Function with Optional Return Value

I have tried to write a lambda that measures the execution time of arbitrary functions. With a lot of help I have managed that for C++14 and functions having a return value, see Measure execution time of arbitrary functions with C++14 lambda. Then I wanted my code to also work with C++11, therefore...
Benjamin Bihler
1

votes
3

answer
91

views

Visual Studio loses ability to attach to Unity, why?

I'm using Visual Studio with Unity. In general in VS I can simply click 'Attach to Unity' and it will build the solution and indeed attach to Unity. Sometimes, however, a project loses the 'ability' to do so, what means that suddenly clicking the button will only build the solution and not attach to...
Benjamin Zach
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

View additional