regex to match EOF

I have some data that look like this john, dave, chris rick, sam, bob joe, milt, paul I'm using this regex to match the names /(\w.+?)(\r\n|\n|,)/ which works for the most part but the file...

Select first row in each GROUP BY group?

As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY. Specifically, if I've got a purchases table that looks like this: SELECT * FROM purchases; My...

Is there a way to include commas in CSV columns without breaking the formatting?

I've got a two column CSV with a name and a number. Some people's name use commas, for example Joe Blow, CFA. This comma breaks the CSV format, since it's interpreted as a new column. I've read up...

How can I show the query time in Perl, DBI?

I use Perl and DBI to manage my MySQL tables, querys, etc. How can I show the running time of a query? If I do a SELECT in the console, the result will be like this: +-----+-------------+ | id |...

Why does PHP replace pluses with spaces in $_COOKIE?

So from my understanding of PHP and cookies, if I use the setcookie() function, then I get a cookie that is automatically url encoded. And when I go to the $_COOKIE array, I should get the cookie...

How to get distinct values from an array of objects in JavaScript?

Assuming I have the following: var array = [ {"name":"Joe", "age":17}, {"name":"Bob", "age":17}, {"name":"Carl", "age": 35} ] What is the best way to be able...

binning a dataframe in pandas in Python

Given the following dataframe in pandas: import numpy as np df = pandas.DataFrame({"a": np.random.random(100), "b": np.random.random(100), "id": np.arange(100)}) where id is an id for each point...

How to build postman request for Rails POST method

No matter how I format the raw portion of this request, I cannot avoid the parsing error below. I have a Rails API with a create method that passes the spec, to illustrate that the controller...

Prevent form submission on hitting Enter key for Text

I know this question has been asked before but I could not find a satisfactory answer for my situation. So I am asking again. I have a simple form with 2 text boxes and a submit button. After the...

Elegant way to match a string to a random color matplotlib

I want to translate the labels of some data to colors for graphing with matplotlib I have a list of names ["bob", "joe", "andrew", "pete"] Is there a built in way to map these strings with color...

MySQL SHA256 with Insert Statement

I want to create a script to fill a database for testing. How would I set a string to be hashed and the inserted into the database? I have: INSERT INTO...

Python prettytable Sort by Multiple Columns

I'm using PrettyTable to print data to the terminal in a nice table format. It's pretty easy to print it ordered by a single column. from prettytable import PrettyTable table =...

Heap corruption error in custom vector class

I am receiving a runtime error from code I have written. When I call the grow() function it works perfectly until it hits the delete, then it crashes and says: This really confuses me and I do...

Create column with duplicate data in same table psql

Postgres database I'm trying to find a faster way to create a new column in a table which is a copy of the tables primary key column, so if I have the following columns in a table named...

How to update multiple ids at once

I just began learning how to code w/ SQL. I am following a tutorial on Codeacedemy.com Here is something I wrote for the fun of it, a simple date base: CREATE TABLE employees (id INTEGER, name...

Vue - Deep watching an array of objects and calculating the change?

I have an array called people that contains objects as follows: Before [ {id: 0, name: 'Bob', age: 27}, {id: 1, name: 'Frank', age: 32}, {id: 2, name: 'Joe', age: 38} ] It can...

Sort short_names in reverse alphabetic order

I dont understand what I am doing wrong: Sort short_names in reverse alphabetic order. Sample output from given program: ['Tod', 'Sam', 'Joe', 'Jan', 'Ann'] My code: short_names = ['Jan', 'Sam',...

Group rows on one column and create nested array from another column

I have an array that looks like this: [ [ 'name' => 'Umber', 'reason' => 'No data', 'id' => '12' ], [ 'name' => 'Jakar', 'reason' => 'Wrong...

Embedded images sent via sp_send_dbmail are not working in gmail or Outlook 2013 for OSX

I'm having a problem where emails sent through Sql Server are not properly being embedded in some mail clients - notably gmail and Outlook 2013 on OSX. (Outlook 2013 on PC is fine) Here's a sample...

How do I correctly use EF Core with AutoMapper ProjectTo and Unions?

My Setup ASP.NET Core 2.0 EntityFrameworkCore 2.0.1 AutoMapper 6.2.2 Problem I have a project with a DTO called PersonDetail and an Entity called Person. When I call db.People.Where(p =>...

Elastic Search: indexing dates field that has null values

I am using Elasticsearch client in Python to create index for the fields below and I am stuck on creating date index that has null values. I am having very hard time seeing why the index it not...

You do not have privileges to manipulate with the users

My xampp phpadmin is is not giving me the option to add users for mysql. I have checked everywhere and cant find the solution. Here is my code in config.inc.php, my.ini and wp-config...

How to select JSON Properties as column using T-SQL

I have a table with a JSON column. I want to select JSON properties as column. The property names will be unknown. So I have to use dynamic SQL. Based on this SO suggestion, I was able to get...

How to get list of all levels of employees working under supervisor?

I need to get the list of employees down to the minimum level working under a specific supervisor or head or manager. Below is the hierarchy of employees, each employee has a supervisor, who...

SAP & Excel Error - SAP trying to open a file in Excel

I write a lot of Excel macros that send script messages to SAP's GUI to execute queries and download the results to an Excel file. My problem is that SAP tries to open the file when the export is...

antd with typescript : Table with Column align='right' is not compiling

I am using antd Table with Typescript as below <Table dataSource={data} columns={columns2} /> When I give align: 'right' to one of the columns, it is not compiling. The following error is shown....

How to sort the antd-table while keep one special line forever on the top of the table?

I'm using react and ant design 3.26 to build my website, and using the antd_table to show some data.Now I need to sort the table while keep one speical row on the top of the table forever and dont...

zsh problem: compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew

I am using apple M1 MacBook pro. When I installed oh my zash. When I addedexport PATH="/opt/homebrew/bin:$PATH" to my ~/.zshrc file. This error was shown in my terminal: joe ::...

How to get a Workday worker / employee web profile URL?

I wish to retrieve a Workday worker (aka employee) web profile URL via the Workday API. The use case is that I'm building a chatbot to retrieve user information and I want to be able to link to...

DT: Link binding is lost after re-rendering the table

I am trying to navigate to the next tabs by clicking on a link nested in a datatable. This works fine at first using Shiny.bindAll. Here you can find an explanation from Joe Cheng regarding the...