instruction stringlengths 0 30k ⌀ |
|---|
|github|jenkins-pipeline|cicd| |
null |
I am trying to create a function that returns the balance of my sepolia testnet metamask wallet.
I wrote this function:
```
function getBalance() external view onlyOwner returns (uint256) {
return address(this).balance;
}
```
but it returns 0 all the time.
Note that my smart contract is alread... |
Function for returning a wallet balance |
|ethereum|blockchain|solidity|smartcontracts|wallet| |
null |
This error occured because your xampp control panel MySQL is not on or enable. Soenable it then this error automatically solve. |
- For every Load (shipment) my company does, the customer must be invoiced. To generate this invoice we have created a Visualforce Page that renders as a PDF.
- I have a shared Google Drive Folder named "Salesforce" that integrates directly with our Salesforce.
- Every time a new Load is created (load has it's own ob... |
Automate Visualforce PDF to corresponding G Drive Folder |
|google-drive-api|apex|visualforce|google-drive-shared-drive| |
null |
I have a React JS 18 Project using webpack5 + Tailwindcss + Twin.macro for CSS in JS. I am trying to migrate to RsPack and I followed the official migration doc --> https://www.rspack.dev/guide/migrate-from-webpack.html
The issue is Twin.macro needs some babel plugins to work but those are not there in RsPack. What... |
Step scaling option disabled for ECS Fargate service |
|amazon-web-services|amazon-ecs|amazon-cloudwatch|aws-fargate|aws-auto-scaling| |
function getAllSubsets(arr) {
let subset = [[]];
function generateSubsets(indx, currentSubset) {
if (indx == arr.length) {
return;
}
for (let i = indx; i < arr.length; i++) {
currentSubset.push(arr[i])
... |
Currently, I've a .img file (Kernel source file) with a capacity of 3.7GB. Could you Please suggest Linux terminal commands for extracting this .img file into a normal kernel source file?
Thanks and Regards,
Ravikumar
|
How to extract the .img file conversion into normal kernel source file in the linux? |
|linux|linux-kernel|embedded-linux| |
I eventually got my answer to this question from a user named "Tassle" from computer science stack exchange; here is a link to his answer:
https://cs.stackexchange.com/questions/167260/how-many-games-will-a-menace-tic-tac-toe-computer-take-to-train?noredirect=1#comment346349_167260
In short, Tassle says that the ... |
I have a C# Windows Forms application that was written and originally tested on Windows 10. The application needs to be able to open on any given monitor (set via a config file), and this feature works fine on Windows 10. To prepare for future system requirements, we have been preparing a Windows 11 image and trying to... |
Which approach is more better use of httpclient in .Net Framework 4.7 among the following two? |
|c#|asp.net|httpclient|dotnet-httpclient|sendasync| |
null |
>i dont understand it so if it could be provided with proper explanation
As shown in [The Java Tutorials][1] by Oracle Corp, a `for` loop has three parts:
```java
for ( initialization ; termination ; increment )
{
statement(s)
}
```
Take for example an array `{ "alpha" , "beta" , "gamma" }`:
```ja... |
problem of retrieving fcm token. iam working on sos alert web application using firebase cloud messaging. every this is good but iam not getting registration token.
const fcmToken = await getToken(messaging {vapidkey: 'VAPID_KEY'})
console.log(fcmToken)
FCM Token not being logged to the c... |
We have a requirement to connect the Cloud SQL Database via Cloud Auth proxy deployed on a GKE cluster from an on-premise application securely.
on-premise -> cloud auth proxy (GKE) -> Cloud SQL Instance. This is working fine when the connections are made on port 8080 but we would like to make it a secured connection ... |
Enabling Secured connections to access Cloud Auth proxy from On-premise |
|google-cloud-platform|cloud-sql-proxy| |
null |
I am currently running the program via VNC and after startup I open the terminal and run the following code
```bash
cd home/documents/......
source venv/bin/activate
python new.py
```
as soon as i run this, the camera activates and the code to detect and announce what object is infront begins.
So what do I nee... |
How to Fix C# WinForms Application Not Loading correctly on Windows 11? |
|c#|.net|windows|winforms|windows-11| |
null |
hope all are doing great.
I was doing a project that registered a client account. However, it faces CORS policy issues:
```
Access to XMLHttpRequest at 'http://localhost:8085/client/sign-up' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access con... |
Angular / Spring Boot problem : No 'Access-Control-Allow-Origin' header is present |
|angular|spring-boot|cors| |
null |
I'm trying to write a pinescript strategy on tradingview. I have a problem setting a limit exit profit target in percentage.
**Hypothesis**
Create a long in a determined condition, and set an exit with a limit order with take profit at 3%.
entry_id = str.tostring(bar_index)
long_profit_percent... |
I find out that best solution for all workers is to use full width of window for text element and after this scale element down to size which you want. It working for me in safari also in chrome and it's not blury on any stage.
I find right scale for full hd resolution and after this I just recomputing it.
... |
instead of using $request.knowledge.answer use $request.knowledge.answer[0] |
{"OriginalQuestionIds":[6095757],"Voters":[{"Id":4108803,"DisplayName":"blackgreen"}]} |
I am using the laravel 7 and implement rate limit in kernel file
` protected $routeMiddleware = [
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
]`
i have 3 route file admin, home and user i put in all file group middleware like
`Route::middleware(['throttle:10,1'])->group(function () {
.... |
Laravel 7 rate limiter is not working properly |
|php|laravel|laravel-7|throttling|rate-limiting| |
null |
I have two certs in pem format:
- Server SSL Cert from Let's Encrypt
- Login cert (cert + private key) from MongoDB atlas
When both are imported to single keystore, mongo driver throws:
```
com.mongodb.MongoCommandException: Command failed with error 8000 (AtlasError): 'certificate validation failed' on server ac-... |
How to import two .pem into single .p12 keystore? |
|java|mongodb|spring-boot| |
null |
I use python get my onnx input shape
providers = ['AzureExecutionProvider', 'CPUExecutionProvider'] # Specify your desired providers
sess_options = onnxruntime.SessionOptions()
sess = onnxruntime.InferenceSession(model_path, sess_options, providers=providers)
input_shape = sess.get_inputs()[0].sh... |
I have a Flux that has a `doOnNext(this::dumpJson)` but for some odd reason it stops on the first one if I do this
```java
private void dumpJson(Object it) {
try {
objectMapper.writerWithDefaultPrettyPrinter().writeValue(System.out, it);
System.out.flush();
} catch (IOException e) {
throw new R... |
Why would using writeValue stop a Flux but writing to a temporary value then printing it allow it to work? |
|java|project-reactor| |
My question is about running two Vue+Vuetify applications in the same web page and avoiding styling conflicts between them.
Consider a "main" Vue 3 web application running the homepage for a website. This "main" app embeds another "minor" Vue 3 web application in its HTML via a `<script>` tag. Both Vue 3 app use Vue... |
How to isolate the theme colors of concurrent Vue+Vuetify app instances? |
|css|vue.js|vuejs3|vuetify.js|themes| |
To design an NFA for the language (01 ∪ 001 ∪ 010)<sup>\*</sup> we could take it step by step. First design a diagram for the language (01)<sup>\*</sup>:
[![nfa1][1]][1]
q<sub>0</sub> is the start and accept state, and q<sub>0</sub> is the sink for invalid input. Then extend it to (01 ∪ 001)<sup>\*</sup>:
[![n... |
How to configure Twin.macro with RsPack |
|webpack|tailwind-css|webpack-5|rspack|twin.macro| |
I am trying to run (something similar) and figure how many times the loop actually ran
```yaml
- name: this step
debug:
msg: "working on {{ item.name }}"
when: not item.skip
with_list:
- {name: t1, skip: True}
- {name: t2, skip: False}
- {name: t3, skip: False}
- {name: t4, sk... |
I want to send push and pull events of images to Kafka using the Azure ACR Webhook function.
'Event Hub' is not available due to cost.
The webhook is set to be thrown to the Kafka Rest Proxy URI with the header 'Content-Type: application/vnd.kafka.json.v2+json'.
When an event occurs
Headers:
'User-Agent: Azure... |
CoreMirror has a method `fromTextArea` that takes two parameters - first the source and second is the property that would like the editor to look like.
var editor = CodeMirror.fromTextArea
(document.getElementById('editor'),{
mode:"text/x-java",
lineNumbers:true,
autoC... |
Why doesn't FutureBuilder execute a condition when the data is not ready yet? I.e. block else where '-------------' is not executed.
Before I used provider, that block would execute, i.e. it would show CircularProgressIndicator.
The provider value (ChangeNotifierProvider) is changed in the PaginationAppBar.
... |
This is a sample of a one pager SAP UI5 App with
- XMLView with a table
- Controller with JSONModel
- Databinding the JSONModel in the table
The versions of the SAP resources are not up-to-date but they (still!) work.
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>... |
I have EC2 instance which running multiple java servers, each server use local port 1234, and I have Elastic IP for each java server, and I use iptables to resirect traffic on EIP:443 to EIP:1234 so I need to reserve EIPs for all java servers and I need to open the port 1234 on firewalls from outside to make the applic... |
how to run multiple java servers on the same machine on the same port 443 |
|java|linux|amazon-web-services|nginx| |
null |
I have a question about visualizing the alluvial diagram in R.
My goal is to show the association between multiple groups so I decided to use an alluvial diagram. However, an alluvial diagram usually shows the association through the source, target1, target2...Could I ask if there is a visualization tool that can ad... |
null |
This is a use case for `INDEX\MATCH`:
`=E2*INDEX($B$2:$B$5,MATCH(D2,$A$2:$A$5,0))`
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/6PkIl.png |
I have two certs in pem format:
- Server SSL Cert from Let's Encrypt
- Login cert (cert + private key) from MongoDB atlas
When both are imported to single keystore, mongo driver throws:
```
com.mongodb.MongoCommandException: Command failed with error 8000 (AtlasError): 'certificate validation failed' on serv... |
So I'm using terraform module where the source is another internal git repository. I can successfully create resources using the module, but when I try to remove(or comment) the module does not get removed. It throws an error. However, when I use terraform destroy command, I can remove this module via the command line.... |
Terraform: Error: Provider configuration not present. Module gets created, but when I remove or comment it throws an error |
For a multi-container pod on minikube this is how the service and deployment yamls of zookeeper and kafka will look like.
apiVersion: v1
kind: ConfigMap
metadata:
name: broker-conf
data:
KAFKA_BROKER_ID: "1"
ZOOKEEPER_CONNECT: 127.0.0.1:2181
BOOTSTRAP_SERVER: 127.0.0... |
>Is this an expected behaviour of the labeling tool? Such that I need to draw the labeling region myself?
- ***There is a difference in the capabilities or limitations of the OCR extraction process. It's possible that the standard pricing tier introduced restrictions or modified settings that affected the OCR extrac... |
null |
flutter clean
flutter pub get
pod install
|
>How to make Postgres GIN index work with jsonb_* functions?
You can't. PostgreSQL [indexes][1] are tied to operators in specific operator classes:
>In general, PostgreSQL indexes can be used to optimize queries that contain one or more WHERE or JOIN clauses of the form
>
>>*`indexed-column`* ***`indexable-operat... |
As this is a highly active question and amazon support tends to link this question as a standard reply - adding `jdk.crypto.cryptoki` and `ca-certificates` to the docker files fixed the issue - in case you are using java. The TLS version was 1.2 and seems the problem was related to the older versions of amazon sdk. |
Be wary that your test does not mimic the use of an update view.
You should post unchanged data as well since those will be loaded on the page before you enter any updates.
````python
def test_movie_update_view(self):
self.assertEqual(self.movie.movie_name, 'Avengers - Endgame')
... |
I have a SVG that contains a single `<path>` element that draws a certain shape. The coordinates of this path are contained within the path's `'d'` attribute's value. I need this shape flipped horizontally. When I try to accomplish this in Adobe Illustrator, using Reflect tool for example, I get double the size of data... |
Modify the data of SVG path element's d-attribute to make the resulting path flipped |
|css|svg|vector|adobe-illustrator| |
I'm trying to use the retrieve_endpoints function in cli_config.js.
I added the functions to the module exports and added the require in the cli_config file.
Why can't I seem to call the retrieve_endpoints function?
**collector.js**
```
async function retrieve_endpoints(enviromnent) {
let configured_end... |
Exporting function(s) does not make it available in other module |
|javascript|node.js|node-modules| |
null |
You can achieve this by saving the edited item in component data. Then manipulate this object in the dialog and save it back to items array on save (or delete it from array on delete).
```lang-javascript
data: () => ({
editedItem: {},
// ...
}),
methods: {
editItem(item) {
this.editedItem = O... |
I'm working on a SQL Server database where I need to track the progression of outcomes for production operations. Each operation (OP) is attempted until it succeeds (outcome=1). If an operation fails (outcome=0), it's retried for a given amount of times, if it passes, after which we proceed to the next operation.
Th... |
The error
```
Get-EventLog : Cannot open log Application on machine .. Windows has not
enter code here`2023-08-08 02:33:27 provided an error code.
```
Seems to come from the entrypoint:
https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows/start.ps1
```
while ($true)
{
... |
if(tid\<n)
{
gain = in_degree[neigh]*out_degree[tid] + out_degree[neighbour]*in_degree[tid]/total_weight
//here let say node 0 moves to 2
atomicExch(&node_community[0, node_community[2] // because node 0 is in node 2 now
atomicAdd(&in_degree[2],in_degree[0] // because node 0 is in node 2 now ... |
The CNN website includes a chart for each stock with a price forecast. I was unable to scrape the forecast figure with the following code.
For example: the URL about Tesla stock is:
[https://edition.cnn.com/markets/stocks/TSLA
](https://stackoverflow.com)
The code is:
```
Sub CNN_Data()
Dim request As Object... |
To add an auto const feature when you save the file in Flutter in Visual Studio Code, you should follow these steps:
1. Press (<kbd>Ctrl</kbd> + <kbd>P</kbd>) then search for (settings.json) file.
2. Add this code line to there;
"editor.codeActionsOnSave": {
"source.fixAll": true
... |
"require" is used to import packages, libraries and even pictures and videos sometimes. It has almost same usage as that of "import".
For example:
import img from "../images/download.jpeg";
Likewise,
<img src=require("../images/download.jpeg")> |
{"Voters":[{"Id":523612,"DisplayName":"Karl Knechtel"}]} |
I had the same error. In my case I had some accidental spaces in the version's variable, for example:
buildscript {
ext.appcompatVersion = '1.6.1 ' <-
}
I removed the spaces from the end and it worked:
buildscript {
ext.appcompatVersion = '1.6.1'
} |
This XPath,
//p[count(node())=1][em]
will select all `p` elements with a single child node that is a `em` element.
---
Explanation
---
- `//p` selects all `p` elements in the document.
- `[count(node())=1]` filters to only those `p` elements that have a single child `node()`. Since `node()` matches no... |
You can use ```numpy``` with ```stl``` to create a function to return the vertices and faces. First run ```pip install numpy-stl``` then use the following code
import numpy
import stl
def parse_stl(stl_file):
# Load the STL file
mesh_data = mesh.Mesh.from_file(stl_file)
... |
you can use these ways:
- Method 1: Check if the user is on a mobile device
> const isMobile = /Android/i.test(navigator.userAgent);
- Method 2: Check if the screen width is less than 680 pixels
> const isMobileWidth = window.innerWidth < 680;
|