How to remove all duplicates from an array of objects?

I have an object that contains an array of objects. things = new Object(); things.thing = new...

How do I get currency exchange rates via an API such as Google Finance?

Now, I did find the Google Finance API and started looking through that but I found a lot of info about portfolios, transactions, positions & other stuff I know nothing about. Am I looking at the...

Dictionary.FirstOrDefault() how to determine if a result was found

I have (or wanted to have) some code like this: IDictionary<string,int> dict = new Dictionary<string,int>(); // ... Add some stuff to the dictionary. // Try to find an entry by value (if...

Naming threads and thread-pools of ExecutorService

Let's say I have an application that utilizes the Executor framework as such Executors.newSingleThreadExecutor().submit(new Runnable(){ @Override public void run(){ // do stuff ...

Is explicitly closing files important?

In Python, if you either open a file without calling close(), or close the file but not using try-finally or the "with" statement, is this a problem? Or does it suffice as a coding practice to...

What are the allowed ways to close self-closing tags for void elements such as <br> in HTML5?

In HTML5 is it still appropriate to close a <br> tag with <br />? This obviously also applies to all other single tags. I realize this doesn't actually affect how stuff works, but what is best...

Dependent types in OCaml

There's a lot of information about dependent types in Haskell and Scala. For OCaml, not so much. Is anyone skilled enough to provide a coding example on how to achieve this in OCaml (if it's...

Expected initializer before '<' token

I have a template class myClass prototyped in a header file, and am implementing it in a .cpp file that is included at the end of the header file. When I use the code: template<typename T> class...

Search for value, return value in adjacent cell

I am not good with the advanced Excel stuff, and I've got something which appears to be a VLOOKUP question (which I have never used before). The situation is such. I need to search for a specific...

Find all matches in workbook using Excel VBA

I am trying to write a VBA routine that will take a string, search a given Excel workbook, and return to me all possible matches. I currently have an implementation that works, but it is extremely...

Drawing Multiple Polygons on Google Maps API v3 from MySQL database

So, I am attempting to draw multiple polygons onto a google map via polygon spatial data from my MySQL table. I have a php script that outputs the following XML based off my table...

No such keg: /usr/local/Cellar/git

I have been struggling with this for a few hours. I am on a Mac using Yosemite. I had homebrew installed, and was using git just fine. I tried doing $git add -i and I got this error: Can't locate...

Approach for tying all NLog logs back to the original request within WebAPI?

I am working to build an API using WebAPI, and have been using NLog for logging throughout the stack. My API solution has two main projects including: The website layer itself that implements the...

Animation Using Cartopy

I'm trying to write a python program that displays an animation of a map of the world where countries change color based on how much renewable energy use they have. I'm trying to have it display...

Typescript module factory pattern

There is a well-known approach in node.js to leverage the module factory pattern. For, example: m.js function factoryMethod(module) { // doing some stuff and returning object initialized with...

Spring JpaRepositroy.save() does not appear to throw exception on duplicate saves

I'm currently playing around on Spring boot 1.4.2 in which I've pulled in Spring-boot-starter-web and Spring-boot-starter-jpa. My main issue is that when I save a new entity it works fine (all...

R: Exit from the calling function

In R, is there a way to exit from the calling function and return a value? Something like return(), but from the parent function? parent <- function(){ child() # stuff afterward should not be...

ASP.NET Core 1.1 Combine Windows Authentication with Login Form as fallback

We are building a proof of concept application with ASP.NET Core 1.1 currently. The target is to provide SSO on intranet level and offer a login page for access via internet. So far I am able to...

Is there a way to disable Thymeleaf, or only enable for certain REST calls?

For instance, I have a basic POST that returns an html called "result" using Thymeleaf. This works and is cool. @PostMapping("/greeting") public String greetingSubmit(@ModelAttribute Greeting...

What are the performance implications of using an immediate-mode GUI compared to a retained-mode GUI?

I am currently working on a standard Windows desktop application (standard meaning no fancy stuff: just buttons, text, sliders, etc.), and have decided to write a GUI framework on my own, after...

Access to email signatures

I haven't really been able to find anything in the documentation and the stuff on Google is about 2-3 years old, and so this is the simple question: Is there a way to update somebody's email...

how to mock navigator.clipboard.writeText in vue test utils

I'm trying to test copy to clipboard in nuxt, but test case can't cover navigator.clipboard.writeText, how to test navigator stuff, i also have tried shallowMount and mount but both not...

How do I set an enviroment variable in GitHub action on a Windows Server?

First of all let me explain what I'm trying to do. I do write a c# .net application which I want to build if a tag was pushed to the master branch. This build should create a release named like...

How to type function taking an enum

Given some enum MyEnum {ONE, TWO}, I wanted to write a function called like useMyFun(MyEnum, MyEnum.ONE); and I failed to type it properly. Now I have something like the following type...

Dependency Injection Into {get; set;} Property

I was wondering how I'd go about setting up my Dependency Injection to inject a dependency into properties that have public getters and setters ({get; set}). So, an example would be: namespace...

What is the best way add basic password protection to a simple Next.js web app on Vercel?

I'm trying to add a simple password validation step to a dashboard that only me and a couple other people would look at. It's not super sensitive data, but I wanted to add a basic protection so...

Flutter - Show only one Dialog at the time

I am working on a flutter application using several dialogs for several purposes. In our code, there are some cases where the user can open a Dialog. Inside this dialog, there are some buttons...

React npm start not working : 'No version of chokidar available'

I cloned my already working React-Typescript app on Github Pages, from Github and wanted to make some changes. I ran npm install and installed all the dependencies but when I run npm start, I got...

Yarn 3.x PNP typescript CRA eslint not working with VSCode

I have been trying this for 9 hours now. I have gone through every single github issues, blogs, links I could find on internet and tried over hundred times. Finally I am posting it here. I am...

C# How do I append code to the end of a running .NET .EXE, preferably from inside that .EXE?

Can a running .NET .EXE append data to itself? What's stopping it? I could launch a separate process to do it just fine. But I can't figure out how to write to itself while it's running. Is there...