instruction stringlengths 0 30k β |
|---|
Technically C doesn't really have "multi-dimensional" arrays. All it have are plain arrays, but then each element in turn can then be another arrays. That's how "multi-dimensional" normal arrays work:
```
int arr[X][Y];
```
Here `arr` is an array of `X` elements, each element is an array of `Y` elements.
The mos... |
In my case I have forgot Camera Permission so that i have added permission in **AndroidManifest.xml:**
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission androi... |
I am estimating survival with weights in a case control study. So all cases have weight equal to one.
When drauwing the estimated curves and comparing them to unweighted estimation I noted that KM curves for cases dont't overlap.
Here's the code for data from "survival" package.
```
library(dplyr)
libra... |
I believe it depends. My field of work is primarily reliant on cloud infrastructure scalability, thus I work with AWS rather than GCP, which excels in ML. I can confidently tell that both perform well and are reliable.
AWS has a wider range of scalable services than GCP. while on pricing, GCP is very transparent with ... |
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 |
Cant install pandas using pip |
|python|python-3.x|pandas| |
null |
I recently migrated our app to.Net 8 and I'm trying to get our previously working Antiforgery tokens to work. Most of it is working fine. However, whenever opening multiple browser tabs we start getting validation errors saying the anti forgery token is not valid. I found this blurb in the Microsoft documentation stati... |
ModuleNotFoundError: No module named 'flask_sqlalchemy', importing in app.py but not subprocess |
|python|flask|sqlalchemy|flask-sqlalchemy| |
null |
The docs are accurate. URL Parameters are not currently 'officially' supported. Some parameters 'may' work for some jobs, but again URL parameters are not officially supported at this time.
One workflow option is to have an AWS Lambda function use all the necessary parameters to retrieve the source URL via curl or ... |
I'm trying to read a url using **curl** command, and expecting command to exit with return code 0 or 1 based on response of curl after parsing the response json.
I tried to parse a json response, but notable to make it working in if else condition.
*URL - localhost:8080/health*
response of the url
{
... |
Shell one liner custom curl command with if else handling |
|linux|shell|curl|cmd| |
The important thing to note in the quote from the official documentation is in bold below:
> All soft references to **softly-reachable objects** are guaranteed to have been cleared before the virtual machine throws an OutOfMemoryError.
Softly-reachable objects are those that can be reached by the "root" context o... |
I started to learn WireMock. My first experience is not very positive. Here's a failing MRE:
```java
import com.github.tomakehurst.wiremock.WireMockServer;
import org.junit.jupiter.api.Test;
public class GenericTest {
@Test
void test() {
new WireMockServer(8090);
}
}
```
```xml
<dependency>
... |
Asp net core Antiforgery token that works over multiple tabs? |
|angular|asp.net-mvc|asp.net-core|.net-8.0|antiforgerytoken| |
Problem solved !
After days of research the reason for that behaviour was complete different.
The Android Maps SDK and the API Key works fine and as expected.
The reason was the following:
Because I using a self-signed ssl certificate for server validation, I added a custom X509TrustManager implementation to ... |
It looks like the problem is caused by state 1, where the step length distribution is estimated to be gamma with mean `3.426185e-15` and standard deviation `8.356259e+09`. This happens because you have very many steps of length exactly zero, and so state 1 is basically just used for zero inflation (as indicated by the ... |
Here is what I landed on. Short version: I used `Patterns.askWithReplyTo()` as I show below:
```
Patterns.askWithReplyTo(Adapter.toClassic(typedActorRef),
ref -> new TypedActor.Message("cat",Adapter.toTyped(ref)),
timeout)
```
This gives me access to the temporar... |
Why do "non-stand-alone" artifacts exist? |
I strongly suggest that you write this using Swift Concurrency, instead of using completion handlers. It would look something like this:
func downloadWithEscaping() async throws -> UIImage {
let (data, response) = try await URLSession.shared.data(from: url)
guard let image = handleR... |
This is considered as anti pattern in modern React ecosystem.
According to single responsibility principle
keep your business logic in a simple way with custom hooks (Use prototype inheritance in it, if required), To store API calls use Tanstack Query and to store global data use Jotai (Atoms). This libraries are v... |
|java|wiremock|artifact| |
when I use the same Keras pipeline to get the results, I'm getting different results.
```
results = pipeline.recognize([ultralytics_crop_objects[5]])
print(results)
--> ji856931
results = pipeline.recognize(ultralytics_crop_objects)
print(results[5])
--> ji8569317076
```
[ultralytics_crop_objects[5]](https... |
You can pass configuration options like:
```shell
pecl install -D 'with-php-config="/usr/local/bin/php-config" with-libmemcached-dir="/usr" with-zlib-dir="no" enable-memcached-msgpack="no" enable-memcached-json="no" with-system-fastlz="no" enable-memcached-igbinary="yes" enable-memcached-protocol="yes" enable-mem... |
I have two dataframes.
df1
col1 var1 var2 var3
X11 NA (for var3)
X12 NA (for var2)
X13 NA (for var1)
df1 has a few columns (float64 type representing some categories) like var1, var2, var3 with values between 1-5 for each and some missing values for the categories.
I want to fill in the... |
lookup missing values from another dataframe in pandas |
|python|pandas|lookup| |
I have query that i have cached forever
controller.php
$duplex = Cache::rememberForever('duplex', function () {
return Property::where('buildingtype_id', '4')->orderBy('created_at', 'desc')
->get();
})
in view.php, i have added a filter in which users can filter down from... |
Illuminate\Support\Collection::filter(): Argument #1 ($callback) must be of type ?callable, array given, called in |
|php|laravel| |
|reactjs|jestjs|ts-jest|babel-jest| |
Update for anyone searching for the same thing: ever since Wagtail 2.12, the original answer does not work as `stream_data` as a property of `StreamValue` was deprecated. You can use the following to achieve the same thing:
def find_block(block_name):
for page in YourPageModel:
for block in... |
It appears that you just want to find records of employees having salaries greater than the average. If so, then the `GROUP BY` clause is superfluous. Remove it, and use this version:
<!-- language: sql -->
SELECT *
FROM db_hr.employee
WHERE salary > (SELECT AVG(salary) FROM db_hr.employee);
By... |
CMake Error at CMakeLists.txt:21 (find_package):
Could not find a configuration file for package "Qt6" that is compatible
with requested version "6.6.3".
The following configuration files were considered but not accepted:
C:/Qt/6.6.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.6.3 (64bit)
can ... |
i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again |
|mysql|qt|cmake|qmake|qsqldatabase| |
null |
|r|machine-learning|keras|deep-learning|mnist| |
>
Hello
I am building an Android application using Clang Qt 6.4.1 armeabi-v7a. However, on other devices such as the Pixel 4 (Android 13) I get a βblank spaceβ appearing on the right at at the bottom of the application when I change the orientation of the device from Portrait to Landscape and vice versa. Her... |
Felgo 4 Android Orientation bug |
|android|orientation|felgo| |
null |
use `Cross Join` and `Subquery` to get your desired result
```
select AgeGroup,SUMNumberOfFans*1.0/SUMNumberOfFans2
from
(Select Date,
AgeGroup,
SUM(NumberOfFans)
From FansPerGenderAge
WHERE date = (SELECT max(date) from FansPerGenderAge)
GROUP BY AgeGroup) a
join (
Select
SUM(NumberOfFans) NumberO... |
|amazon-web-services|terraform|devops|amazon-eks|aws-devops| |
I am creating an operating system and I created a child process using c with this code:
```
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <windows.h>
int main() {
FILE *fptr;
// Open a file in read mode
fptr = fopen("filename.txt... |
I need to know if there any easy migration for the app from layouts to viewbinding enabled in android studio. |
Clarification: Any simple way to update the layouts to viewbinding in onCreate? |
|android|kotlin| |
We have a platform that allows users view and sign a document. We did this using firebase storage `getSignedUrl` to create an array `[document with read access, document with write access]`.
The issue we have is that we keep getting a CORS error. We have set the cors configuration on the Google console a couple of t... |
You can use [First class callable syntax](https://www.php.net/manual/en/functions.first_class_callable_syntax.php) since PHP 8.1
Routes::setup($router, $injector, $this->toRouterCallable(...));
You can use the [Clousure](https://www.php.net/manual/en/class.closure.php) class before that
$cl = Closure::... |
All services were stopped. Instead of changing the ports I did these steps and it worked for me.
Right click on WAMPSERVER icon -> go to **Tools** -> and then click on **Reinstall all services**.
Thank you |
I'm using the extension "Custom right-click menu" to add a custom site search
When i use the context menu, it adds spaces to the search term. i need it to have a +.
`var search = crmAPI.getSelection() || prompt('Please enter a search query');
var url = 'https://www.subetalodge.us/list_all/search/%s/mode/name';
va... |
How do i add a custom delimiter to this context menu search? |
|javascript| |
null |
>**Am I missing some setting/switch/or option that controls population of the Client/dist folder?**
- You were not building the `dist` folder in the using command `npm run build`
- You need to upload after building.
- In you `.yml` file you were only selecting the node version, no operations were being done after ... |
|iterator|iteration|nim-lang| |
I have a registry of class constructors. The registry is also used to create instances of these classes. To allow creating a registry of anything that extends `Base`, I use a generic class `Registry` that infers its repositories from the descriptors passed in constructor. It works well.
But each instance generated w... |
How to write a non generic type for the constructor of a generic class in typescript or use generic with utility types? |
I finally got the solution...the problem was I was referencing to the storage in this manner:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
...
table(infer_schema(location=>'@adf_copyparquetfile_stage_dev/Account', file_format=>'DEV_PARQUET_TYPE')));
<!-- end... |
I was able to do this quickly by editing the user under Securities and under the Securables, setting permissions there. |
I finally got the solution...the problem was I was referencing to the stage of the integration storage in wrong manner:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
...
table(infer_schema(location=>'@adf_copyparquetfile_stage_dev/Account', file_format=>'DEV_PAR... |
Use `Invoke-WebRequest` instead for your first call,
```
$reportResponse = Invoke-WebRequest -Uri $generateReportUri -Method Post -Body ($reportRequest | ConvertTo-Json) -Headers @{ "Authorization" = "Bearer $((Get-AzAccessToken).Token)" }
``` |
Look the following code:
```python3
import asyncio
async def count():
print("One")
await asyncio.sleep(1)
print("Two")
async def main():
await asyncio.gather(count(), count(), count()) # THIS LINE
if __name__ == "__main__":
import time
s = time.perf_counter()
asyncio.run... |
I have two endpoints, /login and /index. The /login is for authentication and getting an access_token. The /index is protected and user should login first.
After authentication, the /login sends the access token to the client. The client should be redirect to the /index page after receiving an access token.
It... |
To address the issue you're facing, simply execute the command below. This will clear out all installed Vagrant plugins and reinstall them, which often resolves problems:
vagrant plugin expunge --reinstall
This command is particularly useful for troubleshooting issues related to corrupt or incompatible plugin... |
null |
From the documentation ([PHP_Codesniffer: ignoring parts of a file][1]):
You can try wrapping the offending code in special comments. Their example:
$xmlPackage = new XMLPackage;
// phpcs:disable
$xmlPackage['error_code'] = get_default_error_code_value();
$xmlPackage->send();
// phpcs:enab... |
Since you have explicitly mentioned decrease clause, Dafny will use that decrease clause. You assumption that it will compare `x + y` with tuple `x`, `y` is wrong. It would have chosen tuple `x`, `y` as if you haven't provided decrease clause. In either case it will compare decrease clause of invoking function/lemma wi... |
There are no "Rules" on where to install python, it's all up to personal preference, but having multiple installations with different libraries added to them can cause issues. I suggest deleting the installation with the lesser amount of libraries and adding all missing libraries to the larger installation. |
I have a DataFrame with a structure and want to convert it to another structure.
firstName names variableName variableValue
abc123 v_001 varX 1.0
abc123 v_002 varX 2.0
abc123 v_001 varY 3.0
abc123 v_002 varY 4.0
efg456 ... |
Deleting duplicates in a table where a unique identifier doesn't quite exist |
|mysql-workbench|mysql-innodb-cluster| |
null |
My project required application of latest version of Tensorflow(2.15.0). In order to install, I created a new environment with Python3.11.8 using Anaconda Navigator. Among the 'Not Installed' packages, Tensorflow-2.10.0 is shown. I also tried to install outside the Navigator using the command.
conda install cond... |
How to Install Latest version of Tensorflow in the Anaconda environment |
|python|tensorflow|anaconda3| |
The configurations of the client, proxy server, and backend server are as follows:
CIP (client IP address): 192.168.189.149, VIP (proxy server IP address): 172.19.222.16, and RIP (back-end intranet server IP address): 192.100.13.203.
Config the iptables proxy at proxy server:
1. iptables -A PREROUTING -p tcp -d 17... |
When iptables is used for reverse proxy, how does the proxy server know the client IP address after the real-server replies messages? |
|reverse-proxy|iptables|nat| |
I think you have to finish your `eval` statement to get a correct output.
And also I shifted `return None` 1 indent to the left, because you want to apply all transform checks and see if they fit before returning None (i.e. finish the `for` loop).
```
transform = pd.DataFrame({'Condition': ['Country', 'Country']... |
In my Spring Boot (3.2.3 vers) application I have the following two JPA entities:
@Entity
@Table(name = "table_1")
@Getter
@Setter
public class Table1 {
@EmbeddedId
private Table1ID id;
@Column(name = "tt_xx")
private String xx;
@Column(name ... |
I need to connect ipv6 through WIFI.
But below code works without turning on WIFI. Let me know how to get ipv6 by turning on WIFI. I am bit confused and can you please guide me.
public String getLocalIpV6() {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface
... |
DataFrame structure conversion |
|python|pandas|dataframe| |
null |
For me this is what worked:
.mat-expansion-indicator::after{
border-color: red;
} |
{"Voters":[{"Id":23474427,"DisplayName":"snj wrk"}],"DeleteType":1} |
`lru_cache` is [implemented in C](https://github.com/python/cpython/blob/52517118685dd3cc35068af6bba80b650775a89b/Modules/_functoolsmodule.c#L737), its calls are interleaved with your function's calls, and I think your **C code** recursion is too deep and crashes.
In Python 3.11 I get a similar bad crash:
```
[E... |
This is a bit of a hack, but this works as expected:
## Using e_title() + e_text_g()
```{r}
df |>
e_charts(x) |>
e_scatter(y) |>
echarts4r::e_title(
text = "right",
textStyle = list(
fontSize = 30,
color = "red",
fontWeight = 'normal'
),
right = "10%",
top = ... |
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... |
How to connect ipv6 through DHCP via WIFI android? |
|android|android-source|ipv6|android-networking|inetaddress| |
I'm trying to migrate `elasticsearch:5.6.15` to `elasticsearch:7.17.18`. I have the following issues:
TransportClient client;
DeleteByQueryRequestBuilder deleteRequestBuilder = DeleteByQueryAction.INSTANCE.newRequestBuilder(client);
deleteRequestBuilder.source().setIndices(index);
Error:
Can... |
You can also explore the functions [`REGEXP_EXTRACT`][1] to pull out the list content enclosed in a square bracket [], combined with [`SPLIT`][2] to separate the extracted string into an array of individual values using space ' ' as the delimiter.
```
WITH sample_data AS (
SELECT 1 AS col1, '[1.2 4.2 6.3 3.1]' A... |