instruction
stringlengths
0
30k
|powerbi|dax|data-analysis|powerbi-desktop|data-cleaning|
With base R, you can use `Reduce` like below ``` cbind( df, list2DF( lapply( c(sum = `+`, prod = `*`), \(op) Reduce(op, df) ) ) ) ``` which gives ``` x y z sum prod 1 1 2 3 6 6 2 2 3 4 9 24 3 5 1 2 8 10 ``` # Data ``` df <- data.f...
How to pass once the full dataset to one worker and specific subsets to the other workers in foreach loop using isplit()
private inline fun <reified T : Any> Context.startActivity() { val intent = Intent(this, T::class.java) startActivity(intent) finish() } pass activity using startActivity<MainActivity2>()
Juste use \Context::getContext()
I'm working on a project in C/C++ buildable with cmake... During build process I've to build configurations (headers and sources) based on some configuration file written in json format. I reached the prefixed result adopting a script file in javascript and in the cmake I placed this command: ``` add_custom_targe...
You need to use a colourspace that sets the gamma correctly for display on your device. Try: convert -colorspace sRGB img0001.pcd img0001.tif
`IF...ELSE IF` constructs work very well in batch files, in particular when you use only one conditional expression on each IF line: <!-- language-all: lang-dos --> IF %F%==1 ( ::copying the file c to d copy "%sourceFile%1" "%destinationFile1%" ) ELSE IF %F%==0 ( ::moving the f...
|scala|implicit-conversion|typeclass|circe|scanamo|
You need to break down your code a little to make the "Translate" a function which just translates the text passed to it. Example: ```lang-vb Option Explicit Const FROM_LANG As String = "es" Const TO_LANG As String = "en" Sub TranslateActiveWorkbook() Dim wb As Workbook, ws As Worksheet, shp As Obj...
|r|
When you input 5 you press enter therefore the new line; This code will solve your problem: public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int total = 1; System.out.print("Factorial of "); int input = Integer.valueO...
Yes, it can be done. The [LLVM C Library][1] is implemented in C++. Not complete though (March 2024). Interesting conference talk on the implementation: [The Challenges of Implementing the C Standard Library in C++ - Siva Chandra Reddy - CppNow 2023][2] Interesting chicken-and-egg problem: the C++ standard ...
**Note**: I've searched accross the net for about an hour without finding an answer to this question. Please let me know if this is a duplicate. I'm working on a typescript project in Visual Studio Code and I want Intellisense to search for classes and give me tips not only in my project folder but also in another f...
VSCode typescript add path to search classes in intellisense
|typescript|visual-studio-code|intellisense|
|git|rebase|git-rebase|
I'm trying to create a general method to find a WebElement by its "label" (e.g. the text displayed in a button) and returning the WebElement: //Find Webelement by Label protected WebElement getWebElementByLabel(String strCSSselector, String strTargetLabel) { //Create list with all elements via CSSselector ...
I tried what';s written in their docs: git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install miniz And then in my cpp #include "miniz.h" But I still get cannot open source file "miniz.h" Any idea please?
C++ VSCode how to link miniz
|c++|
I found the solution,the maf function 'GDCquery_Maf' has been removed from TCGAbolinks. https://github.com/BioinformaticsFMRP/TCGAbiolinks/issues/511 I use the below instead. ``` query <- GDCquery( project = paste0("TCGA-", cancer_type), data.category = "Simple Nucleotide Variation", access = ...
i have to use every time database connection in each page of php to make it work. Require once is not working in cpanel. i tried required once and__DIR__ 'dbconnection.php' but not successful. I have to write everytime database connection code in each page.
database does not connect if i use require once in another PHP page
|php|cpanel|php-mysqlidb|
null
This command wipes the data under `/opt/myfolder` `mount /work/volumegroup/logicalvolume /opt/myfolder`. Is there a way to mount it while keeping all the date under `/opt/myfolder`?
I'm looking for a method to extract sorted data and save it under `sortedData` from `dataSource` of mat-table in order to save it to CSV file. There are filters and pagination applied to dataSource through this.dataSource.filterPredicate; this.dataSource.paginator = this.paginator; this.dataSource.sort = this....
How to get sorted data from mat-table of all pages?
|angular|angular-material|angular-material-table|
|javascript|asp.net|asp.net-core|charts|google-visualization|
First arrange all the `id` values from the `B` objects into a `Map` for fast access. Then loop the `A` objects, looking up each `A` object’s `id` for a match in the map. Map<String,B> mapB = new HashMap<>(); for (B element : setB) { mapB.put(element.id, element); } setA.forEach ( ...
The [root/kernel/sched/deadline.c][1] says it: [1]: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/tree/kernel/sched/deadline.c?h=v6.6-rt > Default limits for DL period; on the top end we guard against small util tasks still getting ridiculously long effective runtimes, on the bottom e...
|javascript|wordpress|elementor|
I have a file which is present as a unstructured txt in ADLS. I want to read the entire file content as text and pass it to a Stored Procedure in Azure data factory. How can I read the entire file and pass it as a string to a Stored Procedure? Below is an example of the file: 'Number: 101095 This is a sample 1 A...
I have a middleware function that sets some utility clients on the request object. When the response finishes it destroys the connections. ```typescript export const setRequestUtils = (req: Request, res: Response, next: NextFunction) => { req.dynamoClient = new DynamoStorage(); req.s3Client = new S3(); r...
In my case, making it simple, using the webdriver, it worked as follows: from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time # open driver in a specific website driver = webdriver.Chrome() drive...
The following will match the desired string. rgx = /^foo:\s*(?:"\K.[^'"\n]*?(?="\s*$)|'\K.[^'"\n]*?(?='\s*$)|\K.[^'"\n]*?(?=\s*$))/ [Demo](https://regex101.com/r/hMppRS/1) For example: "foo: 'bar'"[rgx] #=> "bar" 'foo: "bar"'[rgx] #=> "bar" "foo: bar"[rgx] #=> "bar"
Reading Unstructured Text from the entire file in Azure Data Factory
I am cross-compiling a ROS application to an aarch64 system. When building the linker is looking for the libraries in the host root path, and not in the target rootfs. In particular, the error is: ```bash make[2]: *** No rule to make target '/usr/lib/aarch64-linux-gnu/libboost_date_time.so.1.71.0', needed by ...
I just updated my python from 3.9.1 to 3.9.4, and I'm now getting these warnings in the console: ``` WARNINGS: learning_logs.Entry: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the Learn...
**You are most likely missing a C++ compiler**. Installing Visual Studio with the C++ workload will fix this error. See below: [https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=msvc-170][1] [1]: https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=msvc-170
[enter image description here][1]How can i solve that code?. Sorry i new software engineer Before i got the error. I tried to asynchronous the firebase to my apps and then it automatically ran the " pub get ". Finally i got the error [1]: https://i.stack.imgur.com/o58LG.jpg
|android|flutter|firebase|dart|mobile|
- Go to [this link](https://github.com/extremecoders-re/pyinstxtractor) - Download the archive: pyinstxtractor-master.zip - File: pyinstxtractor.py unpack to the directory of the executable file. - In the address bar of the window (the folder of the executable file), enter the cmd command, press e...
I deployed the a 3 node kafka cluster using the following config in docker-compose Kafka cluster: ``` services: kafka1: image: confluentinc/cp-kafka:latest hostname: kafka1 container_name: kafka1 ports: - "9092:9092" environment: CLUSTER_ID: "7bes6xCzSMeUR-RRas3gMQ" ...
Springboot Kafka Consumer unable to connect to kafka brokers
|spring-boot|apache-kafka|docker-compose|
I want to detect memory leaks by periodically logging the size of the used portion of the WASM heap. What's the easiest way of doing that? I thought the "Rust and WebAssembly" book had some advice about this, but I can't find it.
You can use something similar to this: period1 = input.timeframe(defval = "10", title = "Period 1") This will show up as the image below. [![Input View][1]][1] [1]: https://i.stack.imgur.com/Dc8Zz.png
The sub-process of `ProcessBuilder` has three streams and the I/O between Java and sub-process gets really unhappy / freezes if one of those buffers is filled. You write and read a lot of data. With all `ProcessBuilder` calls it would be possible for the sub-process to freeze because the Java code isn't reading STDO...
null
I want trace my own model. I want to use it in C++. But when I use torch.jit.trace to trace it, I got errors as follows: ```log Traceback (most recent call last): File "main.py", line 457, in <module> traced_script_module = torch.jit.trace(model, (example_input,example_rawdata,example_index,example_mask) ) ...
|python|model|torch|jit|
Code 13 only has happened to me in the past because of a spelling mismatch between a parameter name and the reference in the `$session.params.parameter_name`
null
I am trying to fetch multiple ids from postgres. So here my requirements is I have multiple ids so all that ids which are stored in ruleset tables at rules column which is jsonb type. So while I'm trying to fetch those ids from ruleset table I'm not able to fetch so the query what I run is : SELECT * FROM rulese...
null
I've recently started working on my project of creating an efficient bot to play _bejeweled 2_, right now i'm stuck on a part in which i want my program to do image recognition, right now the idea is to take a picture of a current board, remove background from it and then tell what gem it is by shape, however when i tr...
debounced tk scale with label and value [tk_scale_debounced.py](https://github.com/milahu/random/raw/master/python/tkinter/tk_scale_debounced.py) ```py import tkinter as tk from tkinter import ttk class tk_scale_debounced(ttk.Frame): """ scale with after_change event aka: debounced scale ...
How to modify HTML in WordPress core file
null
{"Voters":[{"Id":1145388,"DisplayName":"Stephen Ostermiller"}],"SiteSpecificCloseReasonIds":[18]}
A safe `eval` can be a good solution: #!/bin/bash if [[ $# -gt 0 ]]; then temp=(egrep -e "\"\$1\"" '*') for (( i = 2; i <= $#; ++i )); do temp+=('|' egrep -e "\"\${$i}\"") done eval "${temp[@]}" fi To run it: bash script.sh A B C
There are no limits real to the type of data that can be set in the value attribute of the option element. Characters with special meaning in HTML do, of course, need to be represented by the appropriate entities (`&` as `&amp;` for example (although the one in the question meets the "followed by a space character" exc...
A few things to fix : (A) You need to change the form tag of your HTML form from ``` <form action="mailto:mymail@gmail.com" method="post" enctype="text/plain"> ``` to ``` <form action="so29mar24.php" method="post"> ``` (B) and change this line in PHP from ``` $email_headers = "From: $name <$email>"; ...
It seems like your regular expression is not excluding the closing tag `</c>` from the third capture group. To fix this, you can adjust your regex to exclude the closing tag if it's present. Like: \s+{"\S+" "(?:<c\S+>)?(.+?)(?:<\/c>)?"}
|python|sockets|networking|protocols|sniffer|
|javascript|reactjs|scroll|
I managed to do it by using an [alternative way](https://docs.astro.build/en/guides/client-side-scripts/#pass-frontmatter-variables-to-scripts) of passing server-side variables --- const question = { 'my': 'question object' }; --- <!-- HTML code--> <my-question-script data-question={...
In Python, trying to decrypt a file using gnupg. Using 'import gnupg'. (NOT python-gnupg). Getting error message - (gnupg:FAILURE status emitted from gpg process: decrypt 4294967295") AND its not decrypting the file. Generating 0 byte output file. gpg --version >> 2.2.27 Debug info/Hints - 1. After impor...
Here's how I set up `gitlab-runner` for a non-root user inside a Vagrant VM (should work for non-VM machines as well): - Check to see if the process is running for the existing user: `ps aux | grep gitlab` - If the process is running, it will look something like this after you run the previous command: `/us...
{"Voters":[{"Id":21171912,"DisplayName":"Dhhebehsi98e"}]}
Today I discovered that I don't know how to copy instance in Golang. While I have `deepcopy()` in Python, or `.clone()` in Rust. And when i googled I saw that in go correct way is dereference. So i did that way. But noticed that despite i define struct field as value, copy still points to same object in me...
What is correct way to copy struct instance with fields in Go?
|go|pointers|reference|copy|
You can possibly check if `randomUUID` can be executed as a function. If its undefined `typeof` will return `undefined` as a string and therefore fails. I dont see more things to test. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> function GenerateGuid() { ...
When using JaVers, JaVers is creating four tables to function. I am looking for a way to use this library in a microservice environment. Our main goals are to audit action using ENUM, and track the modification with javers. I'm not sure how to use javers to handle audit from other micro service. I read from one answer ...
Javers in microservice architecture
|spring-data-jpa|architecture|microservices|javers|
null
How do I log WASM heap memory usage from Rust?
|rust|webassembly|
The access pattern argument **eAccessRanged2D** is causing the image to be "scaled down" from 1920 x 1080 to roughly around 960 x 540. The code is written for Blinkscript Nuke application. kernel Halation_kernel : ImageComputationKernel<ePixelWise> { Image<eRead, eAccessRanged2D, eEdgeClamped> src; I...
You can create a function or T-SQL procedure which can have below 2 queries. Delete * from FINAL where ID in ( select distinct ID from INCREMENTAL); Insert into FINAL (Select Id, Code from INCREMENTAL; These are just rough queries bu should give you basic idea Edit : To get the records which are going to ...
why images didn't display in browser after deploying the website even if the folder names and file names are correct ? my website link is https://aquaworld.vercel.app/ I recheck the file names, formats , try once more to deploy nothing had happen normal running it works , after deploying it didn't
images didn't display in website after deploying
|html|css|
null
To **build** a subset of a **third-party C++ library** like **XLA** as a static library with headers using **Bazel**, you need to **properly define** your BUILD file and ensure that the **necessary targets are included**. also, Regarding the **absence of the .a or .lo file** in your **bazel-bin directory,** it's possi...
How I would approach this is to make logo (in this case `Book Finder`) to have an position of absolute, then position it accordingly relative to the parent (navbar). Then for the `navbar-nav`, you can apply `display: flex` together with `justify-content: center`. <!-- begin snippet: js hide: false console: true ...
try to use this in your handleSubmit import { router } from '@inertiajs/react'; function onDeleteSubmitEventHandler(e) { e.preventDefault() Inertia.delete(`/article/${article.id}`) router.reload({ only: ['article'] }) } https://inertiajs.com/partial-reloads as y con see in i...
Struct alignment with bit-fields
My requirement is to create a Materialized view on redshift containing flattened data in nested Dynamodb JSON format. I have tried most of the ways provided by AWS as well as creating a function or stored procedure, but none of them are providing me with the correct result. My ask is can someone help to extract the dat...
extract nested fields from dynamodb json format in redshift/ Unmarshall DynamoDB JSON to regular JSON
|amazon-redshift|flatten|materialized-views|json-extract|
null
I have multiple "internal" library which I'm trying to manage with vcpkg+cmake. Generally speaking everything is working properly. I have only one minor issue which I can't solve. When working in Windows with MSVC compiler I can't have the pdbs of my internal dependencies copied along with the dlls. The depende...
|c++|bit-fields|
|python|amazon-web-services|aws-lambda|