Categories
Development

CALCULATING THE ROLLING AVERAGE OVER A YEAR TO DETERMINE THE NUMBER OF OVERDUE ITEMS IN EXCEL

I WANT TO CALCULATE HOW MANY OVERDUE ITEMS ARE THERE LOOKING BACK 12 MONTHS AND CREATE A ROLLING AVERAGE Due Date Overdue MONTH MOVING 12TH Average FIRST DAY OF THE YEAR 9/4/2018 No 12/31/2018 1/1/2018 8/16/2018 No 1/31/2019 2/1/2018 8/16/2018 Yes 2/28/2019 3/1/2018 8/13/2018 No 3/31/2019 4/1/2018 8/15/2018 No 4/30/2019 5/1/2018 9/10/2018 No 5/31/2019 6/1/2018 […]

Categories
Development

Typescript class: not possible to have additional properties when class implements interface?

I was wondering why its not possible to implement additional properties or functions inside a typescript class when this class implements an interface… it says: …”Object literal may only specify known properties and “FirstName” does not exist in type persInterface”.. I think in java its also possible to implement other props or functions, the implementas […]

Categories
Development

How do I make a CSS grid collapse into one column grid on smaller screens

I have this layout: Basically the HTML and CSS is the following: <style> section { display: grid, grid-template-columns: repeat(3, 1fr) }; div::first-child: { grid-column: 1/3} </style> <section> <div>…</div> <div>…</div> <div>…</div> <div>…</div> <div>…</div> </section> when the viewport becomes smaller, I want the grid to have 2 columns and then 1 column. I could use media-queries and […]

Categories
Development

Finding Indices for Repeat Sequences in NumPy Array

This is a follow up to a previous question. If I have a NumPy array [0, 1, 2, 2, 3, 4, 2, 2, 5, 5, 6, 5, 5, 2, 2], for each repeat sequence (starting at each index), is there a fast way to to then find all matches of that repeat sequence and return […]

Categories
Development

Format labels on AG-Grid charts

How can I format the labels that appear on AG-Grid chart’s axis? I have a lot of time-series data so I expect users frequently to produce charts where the horizontal axis is a date. Unfortunately, this produces unreadable chart labels because the dates are not formatted (see attached image) – The labels look like “Thu […]

Categories
Development

How to output in file uchar?

I have massive of unsigned char[128] = {0xFF, 0xBE,…0x99};. And need to output it to .txt or .bin file. But all fuctions that I tried could work only with const char*. So, what should I use to output uchar[]? I tried fstream and QFile. // 1 2 3 4 5 6 7 8 9 10 […]

Categories
Development

Why is Bitbucket diff showing diffs outside of the commit list?

Unfortunately I can’t show the example here, but basically I started working on this project I got passed from a coworker. I’m the only one who’s made any commits to the repo since I started working on it a week ago. Now I’m trying to summarize the changes I made so created a tag for […]

Categories
Development

React hooks. Periodic run useEffect

I need periodically fetch data and update it to the screen. I have this code: const [temperature, setTemperature] = useState(); useEffect(() => { fetch(“urlToWeatherData”) .then(function(response) { if (response.status !== 200) { console.log( “Looks like there was a problem. Status Code: ” + response.status ); return; response.json().then(function(data) { console.log(data[0].temperature); setTemperature(data[0].temperature); }); }) .catch(function(err) { console.log(“Fetch Error […]

Categories
Development

Are “from” and “gte”/”gt” equivalent in range query in ElasticSearch?

I’ve just discovered that a package that I use for ElasticSearch operations https://github.com/olivere/elastic creates the following range queries with from, to, include_lower and include_upper tags: “query”: { “range”: { “myfield”: { “from”: 0.6666, “include_lower”: true, “include_upper”: true, “to”: null } } } Whereas ES documentation states that the following should be used. “query”: { “range”: […]

Categories
Development

Typescript return type of function from parameter

I would like to know how to do the following in typescript: if I have this function: function getQueries(query) { return Object.keys(query).reduce((list, key) => { return { …list, [key]: query[key].length > 3 } }, {}) } in which I want to pass an object like this getQueries({ first: ‘dsds’, second: ‘dsdsds’, third: ‘ds’ }) and […]