instruction stringlengths 0 30k ⌀ |
|---|
The STRICT_TRANS_TABLES sql_mode (which *should* be used wherever possible) unfortunately promotes some warnings to errors when in an insert/update/etc, even where you guard against it with checking the results of a function call.
You could temporarily disable it before your update:
set session sql_mode=repla... |
To group by `tagValue`, since this is an array field, you need to apply the [`$unwind`][1] pipeline step before the group to split the array so that you can get the actual count:
db.feed.aggregate([
{'$unwind': '$feedTag'},
{'$group': {
'_id': '$feedTag.tagValue',
'number': { ... |
I am building a simple budget tracker, and I'd like to let user to filter by apps name.
Below is my code.
```json
[
{
"status": "on",
"id": "NZMwD83Nxg",
"name": "GTA_UA_UAC_Android_01_DAU",
"dailyBudget": 800,
"apps": [
{
"name": "app 1",
"icon": "https://m... |
I'm currently working on a CSS layout where I have a **fixed parent div** containing another div. I want the inner div to be **fixed relative to the body**, not its parent.
Code (Tailwind):
```
<div class="h-screen bg-red-100">
<div class="fixed left-1/2 top-1/2 h-80 w-80 -translate-x-1/2 -translate-y-1/2 bg-re... |
I have a firebase project.
I am calling an external api via cloud function in the hope the api key (stored in env variable) will be less discoverable.
While I have managed to get the following code working in the emulator, it doesn't work after deployment.
```
const {onRequest} = require("firebase-functio... |
{"OriginalQuestionIds":[48304195],"Voters":[{"Id":11107541,"DisplayName":"starball","BindingReason":{"GoldTagBadge":"visual-studio-code"}}]} |
**Description:**
I recently completed my first JavaScript project, a Pomodoro clock, without relying on tutorials. I'd like feedback on my code to improve my skills further. Here's a detailed overview of how I implemented it:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-j... |
https://stackblitz.com/edit/vitejs-vite-myutvi?file=src%2FApp.jsx
Hello,
I’m currently integrating a custom export functionality. My goal is to add an export button to display “Save as CSV” but the text is rendering as undefined.
import React, { useEffect, useState } from 'react';
import CanvasJSReact... |
On Windows 10:
Click start, search for "environment variables".
or
Use windows + R key to run command, run the following "sysdm.cpl"
then (if used win+R key): go to advanced tab, theres a box (system variables)
Then in system variables search for "Path",
click on it, click "Edit". A new window pops... |
null |
I'm trying to work with HMVC in CodeIgniter 4. I worked with it previously but in version 3.10. I can't find the HMVC plugin for CI4.
Somebody can help me? Thanks.
I want to work with modules for each class and add their respective views and controllers. |
CodeIgniter 4 with hmvc |
|codeigniter|codeigniter-4|hmvc| |
null |
|php|linux|bash| |
To me, the only difference is that the regular operation needs one more instantiation, and the result is held by this new instance. And thus the regular implementation should call the other.
[But](https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types) : *these (in-place) methods should attempt t... |
Why regular operations are not based on their in-place corresponding operation? |
|python|operator-overloading|in-place| |
null |
I have recently authored a new hierarchical clustering algorithm specifically for 1D data. I think it would be suitable to the case in your question. It is called `hlust1d` and it is written in `R`. It is available under [this link](https://CRAN.R-project.org/package=hclust1d).
The algorithm addresses @Anony-Mousse'... |
How can I position a div fixed relative to the body, when it's inside a fixed parent div? |
|javascript|html|css|tailwind-css| |
Many of the answers above already mention it, just to reiterate.
Using Ansible on a system with multiple versions of python, for instance following these steps on Rocky 9.3:
```
python3.11 -m venv venv
source venv/bin/activate
pip install -U pip
pip install ansible
pip install selinux
```
And following tha... |
Your code might compile now, but it will not work as you expect.
`INT_MIN`/`INT_MAX` are the min/max values for an `int`.
It is typically **32 bit** and therefore the values that you used before were probably **–2147483648** and **2147483647** respectively (they could be larger for 64 bit integers).
On the ot... |
Although @oguz-ismail's answer would work with the sample output provided, it seems that actual `equery` output is very strange when fed into a pipe.
This convoluted commandline seems to work around the problems:
```
script -B /dev/null -E never -f -q -c '
eix-installed -a | xargs equery depends
' |
tr -d... |
We have also faced the same issue, we removed "^" from the version number to avoid installing the latest version, the below is what we did and it worked. The latest msal version is having some breaking changes it seems.
**Old Code**:
"@azure/msal-angular": "^2.3.0",
"@azure/msal-browser": "^2.24.0",
**New Code:**... |
I am encountering a Fatal error message stating "Failed to listen on tcp://0.0.0.0:8080: Address already in use" when trying to create a server for websockets on my website. How can I resolve this issue?
Problem: I am trying to set up a websocket server on my website, but I am receiving the following error message: ... |
{"OriginalQuestionIds":[9674815],"Voters":[{"Id":4108803,"DisplayName":"blackgreen"}]} |
Weird no one mentioned this but, you can get location from `react-router-dom` using the `useLocation` hook. So you can just use that in the dependency array.
[Docs here][1]
```lang-js
const location = useLocation();
useEffect(() => {
console.log(location);
}, [location.pathname]);
```
Edit:
This is a solu... |
{"Voters":[{"Id":13061224,"DisplayName":"siggemannen"},{"Id":14868997,"DisplayName":"Charlieface","BindingReason":{"GoldTagBadge":"sql-server"}}]} |
I'm optimizing some work I did moving from Orange to Python code, but I'm having some problems with image Embedders.
I'm trying to recreate my work using Tensorflow/Keras, but the outputs of the VGG16 networks but the 4096 outputs of the activation layer of the penultimate FC layer for this architecture, using Orange ... |
Custom Export Button Text Becomes Undefined When Using useEffect in Canvasjs |
|reactjs|react-hooks|canvasjs| |
`gcc <YourFileName>.cpp -o output.exe`
Now you can run `output.exe` |
This is not another of those questions, this is about parsing and interpreting PHP in the browser with JS.
How can you run PHP in JavaScript? I am not asking about running PHP in the server and then send the resulting string to the browser as JavaScript. I am literally talking about JavaScript parsing and running PH... |
Here's my two cents on the matter,
Dependency Injection is about passing the required dependencies (objects or services) into a class from an external source, rather than creating instances of those dependencies within the class itself.
Why?
So that we can achieve loose coupling between classes by taking advan... |
For setting up FSLogix with Azure Files for Azure Virtual Desktop. You can follow the steps below-
*Prerequisites*
- Azure subscription with permissions to create resources.
- Azure Virtual Desktop environment set up.
- Azure Files share created for FSLogix profiles.
- FSLogix agent installed on AVD VM... |
Is there a way to manually set the values shown in the legend of a seaborn (or matplotlib) scatterplot when the legend contains a continuous variable (hue)?
For example, in the plot below I might like to show the colors corresponding to values of `[0, 1, 2, 3]` rather than `[1.5, 3, 4.5, 6, 7.5]`
```
np.random.s... |
Manually set values shown in legend for continuous variable of seaborn/matplotlib scatterplot |
|python|matplotlib|plot|seaborn|visualization| |
I have this piece of code:
<h2 class="title" >
<a th:href="${blogItem.getLink()}" th:text="${blogItem.getTitle()}"><style>h1 {color:'${blogItem.getTitleColor()}';} Title</style></a>
</h2>
but I have this error: `Mismatched property value (<color> | [initial | inhe... |
style tag with Thymeleaf |
|html|css|spring-boot|thymeleaf|spring-thymeleaf| |
I'm looking at this query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX schema: <http://schema.org/>
PREFIX ex: <https://example.org/>
SELECT distinct ?person
WHERE {GRAPH ex:someGraph
{
?name <http://www.ontotext.com/plugins/autocomp... |
How to combine ontotext GraphDB autocomplete and SPARQL to refine searching? |
|autocomplete|sparql|graphdb| |
I addressed this issue (twice now) by using `fastlane` and reinstalling all simulators.
You can install fastlane with `brew install fastlane` and then reset all your simulators:
fastlane snapshot reset_simulators
This will wipe out all your current simulators so just make sure you haven't done any special ... |
Looking at `retry`'s [`RetryConfig#delay`](https://rxjs.dev/api/index/interface/RetryConfig) property I noticed you can pass a function instead of a number.
const CONDITION_NOT_REACHED = 'CONDITION_NOT_REACHED';
export function poll<TApiArgs, TApiResponse>(
input: PollCmd<TApiArgs, TApiResponse>
... |
I'm currently working on a React application where I'm using React Router for navigation. However, I'm facing an issue where the components associated with routes are not rendering properly.
**index.js**
```
import React from 'react';
import ReactDOM from 'react-dom';
import App from '../components/App';
impo... |
React Routes not Rendering Components |
|javascript|reactjs|routes| |
I have a simple section a vue3 form which I would like to perform some validation on.
I would like to render an error message based on what error condition is being met.
When there is only one error condition to be met - the error message renders fine. however when there are multiple possible error messages, only an ... |
websocket Fatal error message stating "Failed to listen on tcp://0.0.0.0:8080: Address already in use |
|python|php|websocket|phpwebsocket| |
null |
[Product description is mixed in shortcodes](https://i.stack.imgur.com/eU0k3.png)
I am trying to remove the shortcode in the google feed description. Descpription is not looking very good.If anyone can help , I tried searching on google but its not helping.
I tried searching google and I couldnt find the possible... |
Wordpress Salient theme is pushing Shortcodes in Google feed description |
|php|wordpress|feed| |
null |
Start camera
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String fileName = System.currentTimeMillis() + ".jpg";
tempFile = new File(Environment.getExternalStorageDirectory() + savePath, fileName);
if (currentapiVer... |
To work nice on all browsers, I'd suggest this solution using jQuery :
HTML
``` html
<img src='./templates/lights3.jpg' alt="bg" id="bg"/>
```
CSS
``` css
#bg {
position: fixed;
top: 0;
left: 0;
z-index: -5000; // Yes I always overdo ^^ (that's not very clean)
}
.bgwidth {
width: 100%;
... |
null |
|python|palindrome| |
# Background
After upgrading to Windows 11, I've encountered an issue where I cannot open PowerShell in administrator mode directly from toolbar.
This method is mentioned here: [How to run PowerShell with admin privileges from the current folder?](https://stackoverflow.com/questions/40599282/how-to-run-powershell-wi... |
Conditional rendering error message failing when more than one possible error in vue3 with vuelidate |
|vue.js|vuelidate|laravel-mix-vue3| |
{"Voters":[{"Id":4799172,"DisplayName":"roganjosh"},{"Id":535275,"DisplayName":"Scott Hunter"},{"Id":550094,"DisplayName":"Thierry Lathuille"}],"SiteSpecificCloseReasonIds":[13]} |
My data is two different lists and they seem as following:
[List 1](https://i.stack.imgur.com/97EtI.png)
[List 2](https://i.stack.imgur.com/THHie.png)
in the attached pictures, are two lists, so I am trying to compare Date column in List 1 with Date column in List 2. If they match then multiply corresponding cells... |
Compare two columns if 1st cell matches with 2nd cell then |
|excel| |
null |
The explanation of the two eggs problem can make some people confused in the first time, so we can understand the solution as follows:
Given x is the floor we start dropping the eggs.
- If it breaks, the total of trials in the worst case is **(x - 1)**
- If it doesn't break, how should we step up to the next floor? ... |
I have made one discord bot in the past it work perfectly but when I tried makeing another just like that it don't work it doesn't respond to my messages in the server but it respond in the private dms I tried to debug it by print statements but it don't receive the message from the server, I have checked the permissio... |
I am using this plugin, but I wanted to modify the php to redirect my uploads to a specific 'clientsimages' folder. However I can't seem to get it to work, any suggestions?
I'm using this code:
https://github.com/ruvictor/wc-file-attribute/blob/master/att.php
This is the code I tried, but it isn't uploadi... |
How to redirect uploads from customers to go into specific folder? |
|php|wordpress|plugins| |
null |
Finally I found this cheeky hack:
```
test: |
exec 3<>/dev/tcp/localhost/8080
echo -e "GET /ready HTTP/1.1\nhost: localhost:8080\n" >&3
timeout --preserve-status 1 cat <&3 | grep -m 1 status | grep -m 1 UP
ERROR=$?
exec 3<&-
exec 3>&-
exit $ERROR
``` |
Using gdal-async in nodejs, im trying to convert verctor files from geojson to dxf.
```
const dsGeoJSON2 = gdal.open('./upload2/objects.geojson');
const out2 = gdal.vectorTranslate('./upload2/objects.dxf', dsGeoJSON2, ['-f', 'DXF']);
```
the output file is emty, even with .kml but when i change to gpx for ex... |
I have developed an app in .net Maui and would now like to hand it over to my customers. The only problem is that the company's laptops only allow apps to be installed that are from trustworthy authors. Even if I create an author certificate in visual studio and install it manually on a customer's laptop, the author (m... |
Unknown Author error while deployment in .net MAUI Win App |
I am working on a custom board with two IMX7ULP. The thing I'm trying to do seems quite simple, the A7 from one IMX7ULP send a signal to the M4 of the other IMX7ULP, just an electrical signal, one of the pin of the A7 as output, one of the pin of the M4 as input (PTA16), no special communication protocol. We manage to ... |
Unable to read value from gpio set as input |
|c|gpio|cortex-m|imx7| |
null |
The only issue which i see might be intefering with your ObjectMapper is the 2 extra modules which are added.
mapper.registerModules(securityModules());
mapper.registerModule(authorizationServerJackson2Module());
try removing these 2 and then try again. |
I am using Vue3 and Vue router 4, while tyring to run this.$router.push
it throws `leaveGuards.forEach is not a function`
I see that https://github.com/vuejs/router/blob/f776cbe1098596f53b5c2f696d29e1c02afd1fc1/packages/router/src/router.ts#L824 at this particular line for my application the leaveGuards is an empty... |
this.$router.push is causing a leaveGuards.forEach is not a function error |
|vuejs3|vue-router4| |
null |
You can define a new method on `Array` object's prototype. E.g:
Array.prototype.IsTrue = function () {
return true;
}
Then use it:
product.attributes.IsTrue()
But this method will exist on every instance of Array object. E.g: `[1,'abc'].IsTrue()` is a valid usage.
You can't define ... |
Discord bot can't send messages from the server but sends messages from dm |
|python|discord|discord.py|bots| |
null |
I am testing the m.if3 function in gekko by using conditional statements of if-else but I get two different outputs. The enroll_rate is 0.1 for the first 5 months and it switches to 0.3 for the remaining 45 months.
```
m = GEKKO(remote=False)
# parameters
sitecost = 9 # Cost per site
patcost = 12 # Cost p... |
Why does it provide two different outputs? [gekko] |
|gekko| |
null |
You can use the [`sx` prop][1]:
```javascript
const boxStyle = {
my: 4,
display: "flex",
alignItems: "top",
gap: 1,
p: 2,
...
};
...
<Box sx={boxStyle}></Box>
```
Alternatively, you can create a separate component for your specific box, like:
```javascript
const StyledBox = ... |
I am trying to execute the following script. but I don't get neither the desired results nor a error message ,and I can't figure out where I'm doing wrong.
import pyodbc
cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
"Server=mySRVERNAME;"
... |