instruction stringlengths 0 30k ⌀ |
|---|
I'm trying to connect my MySql RDS instance to my Heroku environment securely, but I can't whitelist my ENV's ip address because (as I understand it) Heroku changes the ip address' at random.
Using the config vars with the DB credentials and connecting them with an ip of 0.0.0.0 in the security group works, but isn... |
I am using PDFBox to insert text into the PDF
using this but I am getting inverted text in the PDF
try (PDDocument doc = PDDocument.load(new ByteArrayInputStream(decodedBytes))) {
PDPage firstPage = doc.getPage(0);
try (PDPageContentStream contentStream = new PDPageContentStream(doc, firstPage, PDPageC... |
When define python async function, what happens and how it works? |
I know this is old but I thought I would share how I fixed my issue. So the code I was modifying wasn't mine. I added the cross site scripting code to the app I was working on and others. The one I had the problem with was changing the submit action to a different page. The submit (in my case) was unnecessary, so I cha... |
ssh oracle@host "ps -ef|grep -i \_smon\_|grep -v grep|cut -d '_' -f3"
$ ps -ef|grep \_smon\_|grep -v grep|cut -d '_' -f3
prod
test
|
It seems like that we cannot access `Polars.DataFrame` object from `Polars Expressions` without passing them in as input params.
However, we could use the following queries to
1. Replace the `n`th value with the average of the first `n` values
2. Set `1-n`th value, left inclusive, to `Null`
3. Original value o... |
I enabled undo using `.modelContainer(for:, isUndoEnabled: true)` and it worked fine. Cmd+Z etc on Mac, and shake to undo on iOS.
On adding the Mac Catalyst destination, undo no longer works. I thought this strange, so I created a new SwiftData project and, setup `isUndoEnabled` for the default app, and it really do... |
Mac Catalyst disabled SwiftData automatic Undo |
|undo|swift-data| |
***Hi,***
You can use a simple trick witch is `-margin`. Important note: yours second div should have transparent background to allow first div background to show up.
----------
Solution
--------
I don't have yours `wavy div`, so for this example I used a simple circle gradient background to show the pur... |
If you are using python 3, then you can use F-string. Here is an example
record_variable = 'records'
print(f"The element '{record_variable}' is found in the received data")
in this case, the output will be like:
```
The element 'records' is found in the received data
``` |
In my Maui xaml I have an Entry control which is initially enabled and I want to disable it programmatically once the user has entered a correct value in the control.
But it is not
My xaml code looks like this
<Entry
x:Name="InputAnswer"
Margin="0,0,20,0"
FontSize="24"
... |
Unable to disable Entry via Binding |
|c#|xaml|mvvm|maui| |
I want to perform some analysis of source files in Gitlab-managed project. The analysis is about computing frequencies, counting unique strings etc. I came to conclusion that the plain bash `find`|`grep`|`sed`|`sort`|`uniq`-based solution would encounter its limits very soon. Hence I decided to use bash commands only t... |
|java|oracle-database|performance|ssl|handshake| |
I have following process, that I thought would be easy to implement with the AzureServiceBus and sessions:
I have a subscription that creates +5 messages out of one message and sends all those messages via batch to another subscription that enables sessions. Therefore I set the same session id for those +5 messages.
... |
AzureServiceBus: Process all messages of the same session and rollback if one fails |
|session|azureservicebus|azure-servicebus-subscriptions| |
styleNodes according to package is types is:
export interface IdAndContentObject {
id?: string;
content?: string;
}
styleNodes: IdAndContentObject[]
that array, In this case you can try with id of and content(all css files convert to string) use them
|
|sql|sql-server| |
[enter image description here][1]I'm new to this, but I understand that the file is missing. I'm working in vscode, and the error comes out of vs studio
1
I've been trying to install pandas using pip, but it always fails and gives me a giant wall of error text and this at the bottom
[1]: https://i.stack.im... |
I have a react native app with an android native java module that accesses my local Google Fit healthstore using the Java Google Fit API:
DataReadRequest readRequest = new DataReadRequest.Builder()
.enableServerQueries()
.aggregate(DataType.AGGREGATE_STEP_COUNT_DELTA)
... |
Set environment variable for container of specific image of gitlab job |
|postgresql|docker|gitlab| |
Finally I found solution glued of hints in another SO answers.
* Postgres container must be spawned as a service (in `services:` section).
* Such service [can have](https://stackoverflow.com/a/77518809/653539) environment `variable:`s but - unfortunately - the `psql` command of that service is [not accessible](http... |
Store Values From a Multi-Area Range in an Array
-
**2D Array**
<!-- language: lang-vb -->
Sub Test2D()
Dim ws As Worksheet: Set ws = ThisWorkbook.Worksheets(1)
Dim rg As Range: Set rg = ws.Range("A3:C3,A5:C5,A7:C7")
Dim MyArray() As Variant: ReDim MyArray(1 ... |
Almost exclusively if you search for examples of cross-component communication via services the examples are using RxJS inside the service (could be signals now too). However it doesn't seem like this is necessary. For example, even in the case of the below service, both components will be able to see changes to counte... |
Angular Reactivity and Communicating via Services |
|angular|angular-services| |
# Introduction
Recently, I was studying Go Lang and it seems it is an interesting language and I noticed that the polymorphism can be applied as a concept using Go Lang `interface` however when it comes to applying the polymorphism using `struct` it does not work as we may want it to work in OOP. There is a couple o... |
Polymorphism using struct in Go Lang |
|go|inheritance|polymorphism|struct| |
I have a healthy, 2/2 Ready Pod that has been running without restarts for over half an hour, on Kubernetes 1.27 through EKS.
When I try to run `kubectl logs -n $MY_NS pod/$MY_POD -c $MY_CONTAINER` on my Apple M1 Max with a `kubectl version` of 1.25, I get no logs. I am able to get logs for other Pods as I would exp... |
You could do type checking with `isinstance` in python:
```py
#Assuming you already have a instance of commands.Bot named client in this case
channel = client.get_channel(channelid)
if isinstance(channel, discord.StageChannel):
#do something
``` |
```c++
template <>
inline bool _Sp_counted_base<_S_atomic>::_M_add_ref_lock_nothrow() noexcept {
// Perform lock-free add-if-not-zero operation.
_Atomic_word __count = _M_get_use_count();
do {
if (__count == 0) return false;
// Replace the current counter value with the old value + 1,... |
Reference Every Nth Cell
-
[![enter image description here][1]][1]
**Usage**
<!-- language: lang-vb -->
Sub Test()
Dim ws As Worksheet: Set ws = ActiveSheet ' improve!
Dim rg As Range:
Set rg = ws.Range("P2", ws.Cells(ws.Rows.Count, "P").End(xlUp))
... |
{"Voters":[{"Id":77567,"DisplayName":"rob mayoff"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":4267244,"DisplayName":"Dalija Prasnikar"}]} |
While building the react app currently facing this issues.
Creating an optimized production build...
Failed to compile.
static/css/main.4d62b683.css from Css Minimizer plugin
TypeError: Cannot read properties of undefined (reading 'type')
[enter image description here](https://i.stack.imgur.com/stz7k.png)
... |
Failed to compile while building the react app - static/css/main.4d62b683.css from Css Minimizer plugin |
|javascript|css|reactjs|react-css-modules|npm-build| |
null |
I am trying to derive some analytics for a set of data that I have on a csv file. The csv file has the following format[sniped from csv](https://i.stack.imgur.com/xdAnd.png)
The first column contains an ID/schema, each other column represents time/generations. This happens N number of Runs.
I want to be able to t... |
Doh, followed along with the calendarauto example from the video (sqlbi.com) but no dates produced.
No syntax errors. Using 07.40 - Moving average.pbix
Table of Dates = CALENDARAUTO()
works just fine.
Tried other pbix files as well. 'New table' button was used :}
The following is the code I create... |
DAX CALENDARAUTO function returns empty table when used in Power BI Desktop |
|dax| |
I have a piece of MATLAB code that I want to translate to python, here is the relevant part of code:
assuming `x = [1,2,3,4,5]`:
% The size of x
N=size(x);
N=N(2);
The issue is at the second line. I understand the index syntax if it was say `x(2)`, but `N(2)` I don't understand. I've tried lookin... |
I think I already found the fix for this, and it was pretty simple.
First, we want to place the set of navigation ids we pass to `AppBarConfiguration` to a variable because we'll need it for something in `onOptionsItemSelected`. You need something like this:
private val navBaseNodeSet = setOf(
R.id.nav_... |
in PHP 8.3 I'm using:
```php
class Helper
{
/**
* @template T
* @param callable(): T $callback
* @return callable(): T
*/
public static function lazy(callable $callback): callable
{
return function () use ($callback) {
... |
So I tried stretching the image but it didnt work. Not sure if thats what Im meant to do and I cant find anything online that would help.
MyCanvas.Children.Add(ImageOne.Background);
Images ImageOne = new();
public MainWindow()
{
InitializeComponent();
MyCanvas.Children.Add(ImageOne.Backgro... |
I've been trying to learn some assembly and was testing out arrays and found that when I tried to print out the value at the point indexed nothing happened, after experimenting further it appears that even though I am using the arrays as shown in many examples across the internet, it just simply isn't working
Here's... |
{"Voters":[{"Id":23474427,"DisplayName":"snj wrk"}]} |
{"Voters":[{"Id":2505965,"DisplayName":"Oka"},{"Id":298225,"DisplayName":"Eric Postpischil"},{"Id":2877241,"DisplayName":"Vlad from Moscow"}]} |
I have this server code:
```
require('dotenv').config();
const express = require('express');
const mysql = require('mysql');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const cors = require('cors');
const path = require("path");
const fs = require("fs");
const app = express();... |
I may of fixed it, I changed the endpoint from
```
https://graph.microsoft.com/v1.0/me/sendMail
```
to
```
..../users/sendMail
```
That got rid of the 400 error. However, I now have a message telling me that my JSON is not correct!!
Thank you for looking |
I would like to place H1 and P tag in the Modal Header and have them occupy one row each.
I also want to center the text.
I have applied d-block to each, but they will have two cols.
I tried widening the Height in the Modal Header, but that didn't work either.
How can I solve this problem ?
I'm using Bootstrap... |
How do I split a Modal Header column in two? |
|html|css|bootstrap-5| |
The formula in the OP is not working because as per `MSFT` Documentations, `SUMPRODUCT()` function returns the product of corresponding ranges or arrays, where the default operation is multiplication. However, one can use addition, subtraction or division as well, which is possible. Read **[here][1]**.
----------
... |
Husky can prevent you from bad `git commit`, `git push`, and more. If you are getting this error check your ***code syntax***. In case you are getting this error even if your code is valid, please use the below solution.
# #Solution 1:
Delete the `.git/hooks` folder and then do the `npm install` to reinstall h... |
Given the registered variable *loop_results*, count how many items were skipped
```yaml
skip: "{{ loop_results.results |
json_query('[?skipped]') |
length }}"
```
Count the number of times a loop ran
```yaml
run: "{{ loop_results.results|length - skip|int }}"
```
<h... |
{"OriginalQuestionIds":[67644660],"Voters":[{"Id":2991619,"DisplayName":"somethinghere"},{"Id":-1,"DisplayName":"Community","BindingReason":{"DuplicateApprovedByAsker":""}}]} |
Suppose we have the following sequence:
```
[1,2,3,4,5,6,7,8,9,10]
```
And we want to train an LSTM model to predict the next number in the sequence based on the previous numbers. We'll choose a sequence length of 3 for this example.
So, we would organize our data into input-output pairs like this:
```
Input O... |
I know the question is about poetry, but you can use the more general:
```
[project.scripts]
script_name = "your_package.a_file:a_method"
```
That way also users that do not have poetry can a easy to access CLI script. |
I'am using GitLab CI to run a Terraform pipeline. But, as The Terraform CI/CD templates are deprecated since this month (**Feb 2024**) and will be removed. I want to switch to OpenTofu:
[![Terraform CI/CD templates deprecated since Feb 2024][1]][1]
Problem: I followed the [documentation][2] to make the conversi... |
token has expired in node.js |
|node.js|express|jwt|refresh-token| |
I have a Symfony application using Doctrine ORM. When creating a new Temp entity with relationships and trying to persist it, I get a 500 Internal Server Error.
`create:1 POST http://127.0.0.1:8000/users/create 500 (Internal Server Error)`
My`TaskController.php`:
```php
/**
* @Route("/tasks", name="ta... |
Doctrine EntityManager persist() fails on new entity with relationships |
|php|symfony|doctrine-orm|doctrine| |
Is there a way to automatically generate points of coordinates for the contour of islands using existing map ?
Is there a way to generate automatically these coordinate for instance using directly the points of the map of openstreetmap (or other), let say with a certain number of datapoints ?
There are some we... |
null |
When I try to show that 3 does not divide 4 in LaTeX like this, 3 \\nmid 4, it does not display what I need. However, \\mid works correctly.
[mid working correctly](https://i.stack.imgur.com/QNRz2.png)
[nmid not working](https://i.stack.imgur.com/ndpKt.png)
I do a google search on is there a configuration to e... |
Why MathQuill does not support \nmid LaTeX? |
|javascript|web|latex|mathquill| |
null |
You cannot do it by itself, but you can use `forEach` or a loop to pass it:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
let params = new URLSearchParams();
[2, 3, 5, 7, 11, 13, 17, 19, 'etc'].forEach(item => params.append("primes", item));
consol... |
Migrate .gitlab-ci.yml from Terraform to OpenTofu |
|terraform|gitlab-ci|opentofu| |
You could make use of `rowwise` if you prefer tidyverse syntax:
``` r
library(tidyverse)
df %>%
rename_with(~gsub('Pop', '', .x)) %>%
rowwise() %>%
mutate(Partyrel = sum(c_across(-(1:2))[match(PartyA, names(.)) - 2])) %>%
mutate(Partyrel = if(PartyA == PartyB) { Partyrel } else {
sum(c_across(-(1... |
null |
I am trying to esizing iframes based on content changes for cross-origin content. Also I am trying open someone else's website in to my iframe so I don't access to there site. Is there a way to do so?
```
<script type="application/javascript">
function resizeIFrameToFitContent( iFrame ) {
iFrame.width = ... |
Resizing iframes based on content changes for cross-origin content? |
|javascript|html|jquery|css| |
null |
Two things:
1. Process *all* events in the event queue every frame, not just one:
```c++
if( SDL_PollEvent( &e ) )
```
...should be:
```c++
while( SDL_PollEvent( &e ) )
```
2. Maintain a SDL_Keycode -> bool map of keydown states and only apply the movement logic on... |
I am about to publish a PowerBI dashboard onto PowerBI Service to be shared across the company. Currently, the dashboard consists of 6 tabs.
There are 3 groups of people who will have access to it, but RLS is not applied since the access will be page level, rather than filter level. For example, sales people will only... |
PowerBI Service Assign Workplace for different people |
|powerbi|powerbi-desktop| |
I'm trying to add a JW Player v1.1.3 instance in my react v16.8.1.
I ran the command `yarn add @jwplayer/jwplayer-react` to install the player.
After trying to import the player with:
```
import JWPlayer from "@jwplayer/jwplayer-react";
```
I got the following error message:
```
./node_modules/@jwplayer/jwpl... |
How can I group data from csv by ID and other specific columns and perform operations like sum using pandas |
|python|pandas|csv| |
null |
Are these range operator and indexer? I have never seen them used like this `[..h]`.
Line 6 in this code:
```
public static void Main(string[] args)
{
int[] a ={1,2,3,4,5,6,7,8,9};
HashSet<int> h=new(a);
/// do somethings on HashSet
WriteArray([..h]);
}
static void WriteArray(int[] a)
{
fore... |
Get an Array from HashSet in c# with operator [..] |
|c#|range|operator-keyword|hashset|indexer| |
null |
|visual-studio-code|jupyter-notebook|color-thief| |
There is a trick you can use to get the shortcut working. Add a custom keyboard shortcut with the keybinding `Shift+Ctrl+Alt+down`. This disables the gnome shortcut that uses the same keybinding. After saving the keybinding, remove it. The VSCode bindings will now work since the gnome binding stays disabled.
[![en... |
> Regex Match a pattern that only contains one set of numerals, and not more
I would start by writing a _grammar_ for the "forgiving parser" you are coding. It is not clear from your examples, for instance, whether `<2112` is acceptable. Must the brackets be paired? Ditto for quotes, etc.
Assuming that brackets ... |