instruction stringlengths 0 30k ⌀ |
|---|
Convert the class to logical of multiple variables in the workspace |
|r|tidyverse|purrr| |
null |
{"Voters":[{"Id":11107541,"DisplayName":"starball"},{"Id":1974224,"DisplayName":"Cristik"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[13]} |
{"Voters":[{"Id":182668,"DisplayName":"Pointy"},{"Id":1210329,"DisplayName":"geocodezip"},{"Id":740553,"DisplayName":"Mike 'Pomax' Kamermans"}]} |
> If you get a “cannot find module ‘pg’” error, install it by running `yarn add pg` or `npm install --save pg`
As written here: https://strapi.io/blog/postgre-sql-and-strapi-setup |
gem update spring
in production and development
they have to the same version
or else you will have to force the gem version in gemfile |
I have figure it out with your help and used one to many relationship
**Order.php**
public function wilaya()
{
return $this->belongsTo(Wilaya::class, 'wilaya_id');
}
public function commune()
{
return $this->belongsTo(Commune::class, 'commune_id');
}
and in... |
I am building a workflow that uses containers and Cloud Batch.
My current container is created from a Docker file:
FROM ubuntu:latest
ENV CONTAINER_NAME="python3"
RUN apt-get update && \
...
I have used this container successfully in Google and Azure Batch with no issues.
I recently rebui... |
Ubuntu:24.04 Container generating excessive logs |
|linux|ubuntu|logging| |
|c|embedded|gpio|cortex-m|imx7| |
Recently, when I was reading some article (do not ask me to remember it's title), I found out that improving performance with Java's `native` methods is not such a good idea, as switching state of thread, converting Java's variables and classes into C's variables and other necessary operations do also take some time to... |
Just make a storage key unique. For example include a topic or replied comment id in it:
```
localStorage.setItem(`reply-to-${topic.id}`, comment.text);
```
You can use also `sessionStorage` that unique per a tab. But closing the tab will destroy it.
You can also generate an unique ID and `history.replace()` i... |
Json integers must be given without double quoting them. So simply removing the double quotes arround `str(int(currentTime.timestamp()))` would work for your case
|
**Firstly: Many thanks to [yvs2014][2] from [discourse.gnome.org][3] for help!**
<br></br>
Apparently the callback function should be declared as:
```
static void baudrateDropdownSelectCallback(GtkDropDown *dropdown, void *unused, void *data[])
```
The solution is probably related to this function implementat... |
Good day,
Could someone please assist with how to achieve the below. So I need to take the first "Addition" which is the "Total_COB_Growth" + "Sum_of_Previous_Interest" where the "Sum_of_Previous_Interest" is dependent on the LAG of "Additions" if that makes sense. I can't get it right in SQL to have the previous va... |
mi controlador es el siguiente:
```
[HttpGet]
public async Task<IActionResult> GetAll([FromQuery] QueryObject query)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
try
{
var stocks = await _stockRepository.GetAllAsync(query);
v... |
Is there a way to open a webbrowser and detect when the browser is closed through C#?
The basic approach is to use Process.Start and add an event listener to Exited; this works for other programs like Notepad.exe, or for google chrome if it isn't already running. But if Chrome is already running the launched process... |
Launch URL from C# and detect when browser is closed |
|c#|google-chrome|process| |
The comment by @Christian Stieber identifies the immediate problem:
> When you do the recursive call to `count_end`, you wanted to assign the return value to `ctr`.
```lang-cpp
//start = count_end(a, start + 1, ctr); // Wrong!
ctr = count_end(a, start + 1, ctr); // Right.
```
With this fix, the two ... |
Here is the problem. Change your `amount` to `pos.length` in your method. Otherwise, you aren't iterating across all positions.
```
for (int i = 0; i < pos.length; i++) { // <----- corrected here.
if (pos[i] == position) {
array[tracker] = ADP[i];
tracker++;
}
}
```
Note that if you us... |
I have a file with lines I need to extract from the JSON-like syntax.
My regex works good in most cases. It extracts desired symbols into a second capture group. But I noticed sometimes my desired text is optionally can be enclosed by some tags which I want to ignore.
**Sample file:**
```
{"title_available" "tex... |
I am using liquibase 4.5.0 and the below thing worked for me.
```
val database =
DatabaseFactory.getInstance()
.findCorrectDatabaseImplementation(
new JdbcConnection(
DriverManager.getConnection(
jdbcUrl,
g... |
{"OriginalQuestionIds":[13391579],"Voters":[{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"},{"Id":1491895,"DisplayName":"Barmar","BindingReason":{"GoldTagBadge":"arrays"}}]} |
I just fired up a new project to verify that this works:
npm init
npm install prisma --save-dev
Add .env file with database information, e.g.
DATABASE_URL="postgresql://postgres.xxxxyyyyzzzz:passpasspass@aws-0-us-west-1.pooler.supabase.com:5432/postgres?schema=public"
where postgres.xxxxyyy... |
Yes, you can set the `Content-Security-Policy` header in the `.htaccess` file of your project if you're using an Apache server. However, the policy you've set `frame-ancestors *;` allows the page to be embedded from any origin. If you want to restrict it to the same origin, you should use `self` instead of `*`. Here's ... |
I haven't programmed much in Java, I once had to write a few applications for school, and it wasn't a problem to run it, now I would like to develop it and look for some other projects, (MyLocalTon to be more precise) I see that it uses Java 11, from what I read Maven is from Java 17, and I have no idea how to run such... |
The table is not creating and i dont want to use declarative_base and alchemy.orm
i was told to use class but i don't know how to arrange it
```
class Tables():
def __init__(self, engine, metadata, table, name, age, location):
self.engine = sqlengine
self.metadata = sql_metadata
se... |
I struggled with this myself. The official answer is not useful for something like neovim, where you have dozens of configuration files. So I ended up simply making a junction from `~/AppData/Local/Nvim` to `~/.config/nvim`.
To do this automatically, make a file with the name `run_after__symlink-neovim-config_window... |
```python
a = "123"
b = "12" + "3"
c = str(100+20+3)
print(a is b, b is c)
```
Why would the output be ‘False’ in the second case? |
Python: why aren’t strings being internalized if they are received from ints by using str()? |
|python|string|integer| |
I created a file named types.d.ts in my src folder, which is included in the *"include"* key in *tsconfig* file.
If I create a type alias in the types.d.ts file as follows:
type money = number;
and in a .ts file in the project I use it as follows:
let total: money = 100.00;
When I hover my mouse ... |
Type aliases in type definition file are "tranlsated" into original type in vscode hints |
|typescript|type-alias|vs-code-settings| |
|amazon-web-services|scala|amazon-dynamodb|scanamo| |
In my code, AutoMapper is doing something that I actively don't want it to do and, worse, I can't see any reason why. Consider these models:
```
public class PersonSource
{
public int Id { get; set; }
...
public ContactSource Contact { get; set; }
}
public class ContactSource
{
public int ... |
Does AutoMapper map complex entity ids automagically? |
|c#|automapper| |
```
// useWebVitals.ts
'use client';
import opentelemetry, { TimeInput } from '@opentelemetry/api';
import { CARE_APP } from '@/components/shared/constants/careAppConstants';
import { useReportWebVitals } from 'next/web-vitals';
const DEFAULT_ROUTE = 'Home';
const EVENTS = [
{ metric: 'FCP', name: '... |
Not able to fetch results based on OrderBy using CriteriaBuilder |
|hibernate|spring-data-jpa| |
null |
According to [Wildfly classloading docs][1], inter-deployment dependencies are possible within an .ear. What about between modules contained in two .ears?
If not, I assume the way to do it would be to use global modules...? Any ideas about the rationale behind such a design decision?
[1]: https://archive.ph/6CL... |
{"Voters":[{"Id":11810933,"DisplayName":"NotTheDr01ds"},{"Id":1007220,"DisplayName":"aynber"},{"Id":2756409,"DisplayName":"TylerH"}],"SiteSpecificCloseReasonIds":[18]} |
Goto:
1. Tools
2. Options
3. Text Editor
4. All Languages
5. General
6. Word wrap |
First course of action follows.
From MySQL Command Prompt,
SET GLOBAL connect_timeout=30;
to try for 30 seconds rather than 10 seconds to get your client connected.
If this settles your problem, update your my.ini [mysqld} section.
You may have to add the line because 10 seconds is the default.
|
I have no idea what you mean by `globals()` there and why are you double looping. Instead, add task to the group.
with TaskGroup("group1") as group1:
for key in ['task_1', 'task_2']:
group1.append(tasks[key])
with TaskGroup("group2") as group2:
for key in ['task_3', 'task_4']:... |
The terraform state file is not available to your destory job. It seems like you use a local backend, and the terraform state file is not shared between the apply and the destroy job.
The quickest solution would be if you expose it as an artifact, as you did with the plan file between the plan and the apply job.
... |
I've recently created a package called [django-sonar][1]. I couldn't find anything better in the django ecosystem so I've made it by myself.
[1]: https://github.com/metalogico/django-sonar/ |
I would like to modify some HTML stuffs in a function called `pagination()` in this Wordpress core file: `wp-admin/includes/class-wp-list-table.php`.
I have been searching for a relevant hook which can be used to update HTML in the above function, but I have not found one.
Can anyone please advise what hook shoul... |
I have the following structs:
```rust
#[derive(Debug, Serialize)]
struct Container {
field0: Field<f64>,
field1: Field<f64>,
}
#[derive(Debug, Serialize)]
struct Field<T> {
val: T,
#[serde(skip_serializing_if = "Option::is_none")]
doc: Option<String>,
}
```
**For this instance:**
``... |
Implement serialize to skip field key name and new line if other optional field is None |
|rust|serde| |
Try this:
import time
import datetime
def countdown(m, s):
try:
total_seconds = m * 60 + s
while total_seconds > 0:
timer = datetime.timedelta(seconds=total_seconds)
print(f"Time remaining: {timer}", end="\r")
t... |
I'm currently working on a microservice architecture project that uses Ocelot for APIGateway, and IdentityServer4 for authentication and authorization. Recently, I transitioned from self-contained tokens to reference tokens for improved security.
In the current setup, each microservice sends requests to the introspe... |
Regex - capture group whish is optionally enclosed in sequence of characters |
|python|regex|regex-group| |
This might help you achieve your desired output of "Multiline Typing Animation"
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<div id="typing-container">
<span class="typing-text">JetBrains</span>
<span class="typing-text">Mono.</span>
... |
When the user clicks the Collection or Wishlist button, I expect the code to execute Axios with an ID from the <app> props. However, it needs to be fixed. When I press the button and check the browser console, the `gunplaId` always returns null. I've tried changing all props, but it still returns null, even in the HTTP... |
Maybe the CSS selector for the active tab(s) has changed with the new Firefox version.
What many don't know is that you can inspect the browser itself with the dev tools, just like you would inspect a web page and its DOM; it's called [Browser Toolbox in Firefox][1].
After taking a look at the right element in th... |
{"OriginalQuestionIds":[77996973],"Voters":[{"Id":209103,"DisplayName":"Frank van Puffelen","BindingReason":{"GoldTagBadge":"firebase"}}]} |
I work with Fortran projects in VS2019. My projects employ many subroutines. I've been advised to put the subroutines into a MODULE to get more help from the debugger and code check. Copying the names of all the subroutines into a file (the module file) is a chore. Is there a way to automate this? |
how to automatically generate a Module from a project in Visual Studio |
|visual-studio-2019|intel-fortran| |
Here's a simplified version of the instructions:
1. Open the `config.js` file.
2. In the `extend` section, add a new height property: `'100vh-h-7': 'calc(100vh - 3rem)'`.
3. In your HTML, you can now use this new class `100vh-h-7` for a content container.
Here's how you can apply these steps:
1. In `config.j... |
Congratulations on getting this far. That's how I started my programming journey too!
```
a = Sheets("SellersList").Range("A2").Value
...
ActiveSheet.ListObjects("CopyTable").Range.AutoFilter Field:=1, Criteria1:=a
```
This is where your code decides what values to filter on. You can verify for yourself by ha... |
no me aparecen los parametros para filtrar mi consulta en swagger |
|swagger| |
null |
[Hero][1]
I'm new to coding and trying to build a portfolio page.
What would be the best way code the hero section to look like this?
Right now my code looks like this, is this the best way to build this section?
Thank you :)
```
<section class="hero-section">
<div class="hero">
<div ... |
{"Voters":[{"Id":523612,"DisplayName":"Karl Knechtel"},{"Id":839601,"DisplayName":"gnat"},{"Id":3890632,"DisplayName":"khelwood"}]} |
i am a new mulesoft learner. To get better understanding about mulesoft i want to go through one complete mulesoft real time project.I want to know in real time scenarios how the project is build and managed.Please help me on this.
I am expecting one complete Mulesoft real time project to get better understanding ab... |
I need a mulesoft real time project |
|mulesoft| |
null |
I have configured exactly once Jdbc oracle sink in my Flink Streaming application. I followed flink doumentation and coded accordingly. But getting below exception.
FlinkRuntimeException:unable to recover , error -3: resource manager error has occurred. [null]
at org.apache.connector.jdbc.xa.XaFacadeImpl.wrapExc... |
Getting FlinkRuntime Exception during oracle exactly once jdbc sink |
|flink-streaming|ojdbc|exactly-once| |
null |
Before I see that *"it prints "thread 1 exists" twice."*, I see prints after "main exists". I.e. the worker threads may continue to execute even after main() has exited:
```lang-none
this is thread 1
this is thread 2
main exists
thread 2 exists
thread 1 exists
thread 1 exists
```
This behavior can lead to ... |
A complete different, probably helpful, approach:
Here we directly extract the date part from each string in `dd` and convert it into a Date object.
```
library(parsedate)
library(lubridate)
as_date(parse_date(dd))
```
```
[1] "2023-01-05" "2023-02-05" "2021-01-05"
``` |
null |
I use netleague order in netmeta package of R for my network meta analysis
netleague(net2, digits = 2, ci = FALSE)
However, it showed indirect effect in lower triangle and direct effect in upper triangle.
I just want it to show the reciprocal number in the upper triangle for league table instead of direct ... |
How can I show the reciprocal number in upper triangle of league table? |
null |
- `Case: BE` is a literal string.
- `[0-9]` matches any digit from 0 to 9.
- `{8}` specifies that the preceding character (in this case, digits) should be repeated exactly 8 times.
_Microsoft documentation:_
> [Find.Execute method (Word)](https://learn.microsoft.com/en-us/office/vba/api/word.find.execute?WT.mc_... |
I am using Excel VBA to automate following task.
In Cell D2, i have the following wrapped text:
"My name is **C2** , I am from **C3**, i love reading **A3** type of books. My favorite sport is **B6** . "
Here, name, location, book type, and favorite sport is sourced from the cells C2, C3, A3, and B6.
I ... |
ASP.NET Core 8 is missing from application pool selection after install |
I'm proceeding a very basic hyperparameter tuning for my Random Forest regression algorithm in GEE. In the process I also wanted to compute the RSME to assess said hyperparameter tuning.
I receive an error message saying:
`AggregateFeatureCollection.array, argument 'collection': Invalid type.
Expected type: Featur... |
I would use a boolean mask, this will avoid overwriting existing data, and also be more efficient since only the relevant rows will be evaluated:
```
add = df['StreetAddress'].str.extract(r'(\d{5})', expand=False)
m = add.notna()
df.loc[m, 'Zip'] = add[m]
df.loc[m, 'StreetAddress'] = (df.loc[m, 'StreetAddress']
... |
This can now be done using CSS grid. Credit to [Moob](https://stackoverflow.com/a/76944290/7543162).
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
#parent {
display: grid;
grid-template-rows: min-content 0fr;
transition: grid-template-row... |
Has anyone experienced issues when running a command like this in SSMS?
```
SELECT
STRING_AGG(JSON_ARRAY(COL1, COL2, COL3 NULL ON NULL), ', ')
FROM
{schema}.{table}
```
In my case this closes the connection to SQL Server with an error:
> Msg 109, Level 20, State 0, Line 42
> A transport... |
Create a DAYS table with columns for Year, Month, Date, DayLetter and populate it with one record for each day. If you Google the topic "script for date dimension table" you should find samples.
Do an outer join to the attendance table using the Date column.
In Crystal, insert a CrossTab. Use the Display String... |
{"Voters":[{"Id":21171912,"DisplayName":"Dhhebehsi98e"}],"DeleteType":1} |
Use a nested if with COUNTIF
```
=IF(B1="","skipped",IF(COUNTIF(A:A,B1)>=COUNTIF($B$1:B1,B1),"match","difference"))
```
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/n3pyx.png |
Although @oguz-ismail's answer would work with the sample output provided, it seems that actual `equery` output becomes garbled when it is fed into a pipe.
This convoluted commandline seems to work around the problems:
```
</dev/null script -B /dev/null -f -q -c '
eix-installed -a | xargs equery depends
' ... |
I believe Simu5G was not tested to be used as a library on Windows (i.e. it cannot be used by other project). Simu5G itself can be compiled and used fine on Windows though.
You won't be able to build it easily on Windows. I suggest installing everything in a WSL machine and run everything from there. On Linux you wi... |