instruction stringlengths 0 30k ⌀ |
|---|
|xml|visual-studio|wix|windows-installer| |
null |
Here is how you can stringify a DOM node:
```javascript
const serializer = new XMLSerializer();
const text = serializer.serializeToString(document.body);
console.log(text);
```
If you need to serialize only the visible nodes to JSON object, here is how you can do it using Typescript:
```typescript
interfa... |
Scipy.integrate gives odd results |
|python|python-3.x|scipy| |
Set `PivotFields` as a *"row"* and `DataField` as a *"value"*.
ptTable.PivotFields("SKU").PivotFilters.Add2 Type:=xlTopCount, _
DataField:=ptTable.PivotFields("Total Ventas"), Value1:=10
|
null |
Here's a shot, starting with a reduction and then `Map`-applying it to the original list of frames.
```r
previous_ids <- rev(Reduce(
function(prev, this) unique(c(prev, this$id)),
rev(my_list), init = character(0), accumulate = TRUE))[-1]
previous_ids
# [[1]]
# [1] "xxxyz" "ppuip" "zzuio"
# [[2]]
# chara... |
null |
```
import * as React from 'react';
import Box from '@mui/material/Box';
import ImageList from '@mui/material/ImageList';
import ImageListItem from '@mui/material/ImageListItem';
import ImageListItemBar from '@mui/material/ImageListItemBar';
import IconButton from '@mui/material/IconButton';
import VisibilityIco... |
|android|flutter|flutter-dependencies|android-gps| |
Since I also posted the same question on reddit and it was answered first, I think the least I can do is share the answer here as well (see : https://www.reddit.com/r/filesystems/comments/1br2bar/where_exactly_is_the_first_data_sector_on_a_fat/).
In short, I was rounding up a formula that was already doing the round... |
I have setup a VPS and I have set my public key in the server from my main machine, now I generated a new set of keys in a work machine (secondary laptop) and copied that into the .ssh/authorized_keys file but I get always the following: Permission denied (publickey). Why does this happen? I have tried numerous times b... |
How to add a second ssh public key to authorized_keys file in the server? |
|linux|ssh|ssh-keys|openssh|ssh-keygen| |
null |
Following @Eiffel's 2nd solution and the discussion under the comment section:
@Steven C. Howell says:
> I left the setting in and just realized that while it does not work
> when loading a structure directly from the command line, e.g., $> vmd
> my.pdb my.dcd, it does work when loading a structure after openin... |
# Current Problem
I am trying to productionize a Python application. This is not easy because Python does not support a way of creating a single compiled binary from the source code. Furthermore Python does not support a natural way of creating shared libraries. I will explain this in further detail in the following... |
Creating a Docker container to deploy a Python application |
|python|linux|docker| |
Maven (Java) does not build dependencies into a compiled file.
Here is the code of my main class, the architecture of the application and the contents of the compiled file.
```
import club.minnced.discord.webhook.WebhookClientBuilder;
public class Main {
public static void main(String[] args) {
Sy... |
I have a file ( an image, an audio , a video, an txt file)
1: I need to slit that file in to "n" part and encrypt them
2: if some part of "n" let make it "a " is missing I can use "n-a" to recover and decrypt to get the data point from the beginning.
thank you all. |
I have a relatively large PostgreSQL (v12) table storing JSONB data that has unintentional duplicate data (based on a composite unique index on two columns, `aCol` and `bCol`). In order to create that index, I have to first delete all of the accidental duplicates from the DB. This works fine in 2/3 of our DB servers (s... |
what is the best way to read csv data with two headers.
try (CSVReader csvReader = new CSVReaderBuilder(new InputStreamReader(file.getInputStream()))
.withCSVParser(new CSVParserBuilder().withSeparator(',').build())
.build()) {
HeaderColumnNameMappingStra... |
In my pygame project using pygame and the library pygameGUI I can't load any pngs as the dll for doing it won't load. [The error message I get](https://i.stack.imgur.com/UevZN.png)
I also installed libpng again but this has not worked either. Below is my code.
```
import pygame
import pygame_gui
from pygame_gui... |
Can I make this kind of radio button? |
|javascript|button|text|acrobat| |
null |
while trying to use "#define enl '\n'" in usersnippet we can use \\ to escape the \ that is causing to print a newline.
Thanks to @Holo for the Help :) . |
Thanks! just made the edit. |
null |
The real problem is that you're following a toturial explaining next-auth version 5 while you have `next-auth@4.x.x` in your `package.json`.
If you'd like to follow along the same tutorial, run
```bash
npm install next-auth@beta
``` |
I am using eclipse link jpa implementation with spring boot 3 and when i try to migrate to hibernate 6, application is failed at startup saying error creating bean ‘entityManagerFactory’ java heap space OutOfMemory exception.
Application used to create tables and start quickly with eclipse link but with hibernate 6 ... |
while trying to use "#define enl '\n'" in usersnippet we can use
"\\" instead of "\" to escape the \ that is causing to print a newline.
Thanks to @Holo for the Help :) . |
C expects an optional identifier (variable name). You have two options:
1. Specify an identifier:
```
struct student
{
int num;
char name[20];
float mark;
} s;
```
2. Leave out the identifier and define the variable separately:
```
struct student
{
... |
while trying to use "#define enl '\n'" in usersnippet we can use
"\\\" instead of "\\" to escape the \ that is causing to print a newline.
Thanks to @Holo for the Help :) . |
Object to Css Array
-------------
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
var cssObj = {'border-radius':'10px'}
var cssArray = [];
// Converting ...
Object.keys(cssObj).map((key) => {
cssArray[key] = cssObj[key];
});
... |
Here the pg_available_extensions word is selected:
[enter image description here](https://i.stack.imgur.com/nWtnd.png)
. The selection is not visible
I tried to find a configuration parameter that would address this issue and could not find one. I lost hours trying to undo this unqualifyable non-standard decisio... |
File "C:\Users\lenovo\Downloads\yolov8parkingspace-main\yolov8parkingspace-main\testcount.py", line 62, in <module>
a=results[0].box.box
File "C:\Users\lenovo\AppData\Local\Programs\Thonny\lib\site-packages\ultralytics\utils\__init__.py", line 156, in __getattr__
raise AttributeError(f"'{na... |
Display Image in a MUI Dialog after clicking an IconButton of the ImageListItemBar [MUI] |
|reactjs|react-hooks|material-ui| |
null |
As I said in the title, I am getting the ORA-00918 error but the problem is that it is pointing to a line that is an entire comment line.
In the code below, it is the line written in **RED** and highlighted in **YELLOW**. I even deleted a blank line above it and the error still pointed to the comment line. If anyone... |
{"Voters":[{"Id":5014455,"DisplayName":"juanpa.arrivillaga"},{"Id":5666087,"DisplayName":"jkr"},{"Id":874188,"DisplayName":"tripleee"}]} |
|java|spring|spring-boot| |
Try calling `WaitForExit()` on a different thread so it doesn't block your main UI...
Something like:
Sub Install_VC() 'Visual C++ 2015-2022
arg.FileName = "...installs\Microsoft\Framework\VC_redist_2015-2022_14.38.33130_x64.exe"
arg.Arguments = "/install /passive /norestart"
Dim ... |
I have a challenge in postgres and spend the the whole day trying to nail it and killing me with it. I have these two tables:
```
Tracking plan
------------------------------------------------
id | parameters | subject
1 | [{"coding":{"code":"8231-0... |
Generally speaking, I would go with a firm'ish NO because modern Spark versions provide other means to persist and serve shuffle blocks beyond External Shuffle Service (ESS). This is stated, clear and concise, in [Spark Config][1]:
> **Property Name** `spark.dynamicAllocation.enabled`<br>
> **Default** `false`<br>
... |
Dears, I'm calling who can defeat any SQL query performance issue
I'm in the process of generating an Inventory Report that handles locations for items in stock and I want to show for the user a flag say "Not available any more" that mean the location is not available because it's taken from another item.
That is... |
So I looked at your sheet and the data in the cells seem to be a simple number. The numbers showing as scientific notation are doing so just as a view formatting issue. I suggest instead trying to change the formatting of the cells to show only the simple number format. You could also edit the width of the column to en... |
{"Voters":[{"Id":9952196,"DisplayName":"Shawn"},{"Id":1394729,"DisplayName":"tink"},{"Id":5468463,"DisplayName":"Vega"}],"SiteSpecificCloseReasonIds":[18]} |
i want to store data in a file using gstreamer but the filesink property is making my app crash, to show you i tried to create the simplest example i could:
```
#include <chrono>
#include <iostream>
#include <thread>
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
int main(int argc, char* argv[])
{
... |
PygameGUI error loading libpng16-16.dll: the file cannot be accessed by the system |
|pygame|libpng|pygame-gui| |
null |
I have just started out working with an AngularJS app I'm developing, everything is going well but I need a way of protecting routes so that a user wouldn't be allowed to go to that route if not logged in. I understand the importance of protecting on the service side also and I will be taking care of this.
I have fo... |
I have to make encryption/decryption platform(maybe one page).
The UI/UX is similar to https://cryptii.com/
The technical challenge is that when I select large file(can be 1GB), we need to process file and the encrypted file must be downloaded.
Is it possible without sending file to the server?
I found out FileRead... |
Large file processing in the web browser |
|encryption|filereader|chunks| |
null |
```
"use strict"
function hello(){
console.log(this);
}
hello(); // undefined
window.hello(); // window object
```
I was trying to create a simple hello function to print the value of this keyword on strict mode.
I get undefined on normal function call.
When I call the function using the window object, ... |
Why does the value of this keyword value is different on normal function vs calling the function using window object |
|javascript|this| |
null |
There are multiple ways to achieve this, one way is to have two `Subjects`, one for holding a list of tokens, the other for doing the search.
[Working Example][1]
### Brief Overview of the Filter
**Not a query**
This is what happens when `this.tokens` is updated either by initialization or adding/removing ... |
I use this code to read a directory with camera raw files
with exiftool.ExifToolHelper(logger=logging.getLogger(__name__)) as et:
metadata = et.get_metadata(config["files"]["PictureDirectory"], params=SELECTED_FIELDS)
I cannot find how I can pass something like
#exiftool.ExifToolHelper.__init_... |
Disable the -n for pyexiftool such that fields like LensID are formatted for human reading |
|printing|disable|exiftool| |
null |
I need an equivalent to dependeny injection **to resolve** Blazor/Razor components.
That is, I want to decouple my components in Razor Class Libraries in the exact same way that DI / IoC allows us to decouple back-end services.
Does anyone know how I can achive this?
I an **NOT asking** how to use DI to resolve ... |
Gstreamer cpp filesink not working, crash when using GST_STATE_PLAYING |
|c++|gstreamer| |
null |
This is one of those situations that puzzles me to a point where I give up. I have a PHP page with a very simple task, here is what it does:
```
//r contains hexadecimal representation of an ordinary ASCII string, not base 64 encoded
if (isset($_GET['r'])){
$r = $_GET['r'];
$r = hex2bin($r);
/... |
hex2bin() returning a base64 encoded string |
|php| |
```
data(murders)
murders_2 <- murders %>%
mutate(rate = total / population * 100000) %>%
mutate(idx = case_when(rate < median(rate) ~ "low",
TRUE ~ "high")) %>%
select(state, region, rate, idx) %>%
group_by(idx)
# group_by(idx) is not applicable.
```
What's the problem?
I hope the results ... |
null |
pgadmin gets the list of "available" databases by sending a query to the database it is actually connected to. But the databases actually available to it are determined by pgbouncer's config, which it can't see. So the introspection capabilities of pgadmin are going to broken when connecting through pgbouncer unless y... |
|linux|file| |
This post will help you to get rid of the problem and it works for me. It is because of your PC timezone is not the same as your browser.
https://enddesign.medium.com/a-problem-you-might-have-while-doing-the-chain-middleware-to-create-a-time-server-challenge-from-44027ca483b9 |
Blazor/Razor resolve components using dependency injection |
|razor|blazor|inversion-of-control| |
after following all the steps mentioned in the "Add firebase to flutter" document whenever i am trying to run "dart pub global activate flutterfire_cli" command on my terminal it automatically closes the terminal within a second.
I am stuck and cant proceed untill and unless this step is done.
Can anyone please guide... |
I am trying to connect firebase with my flutter project but unable to do so |
|node.js|flutter|firebase|firebase-authentication|flutter-dependencies| |
null |
I have this loop over a list:
```
MyList = ["test", "test2", "test3", "test4", "test5", "test6", "test7"]
for item in MyList:
print(item) # output: [test, test2, test3, test4, test5, test6, test7]
if item == "test7":
pass
```
Now in here if `item == "test7"` I want to go back to the "test3... |
Going back to an earlier index in list iteration |
when you use a string to refer to a variable name, it doesn't directly access the variable itself. Instead, you can achieve this using a dictionary to store your arrays with their corresponding names.
Try this:
J2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
arrays = {'J2': J2}
appointm... |
like this?
def loop_and_return(lst, target_item, steps_back):
for index, item in enumerate(lst):
print(item)
if item == target_item:
new_start_index = max(0, index - steps_back)
for new_item in lst[new_start_index:]:
print(new_item) |
It's because you're using the `v1` version of their JS and right now full screen is only supported in `v0`. This is their [full screen example][1]:
// Import the Botpress WebChat JavaScript file
<script src="https://cdn.botpress.cloud/webchat/v0/inject.js"></script>
// Initialize the Botpress We... |
|c|algorithm|data-structures|stack| |
I have manually split my data into train and test sets. This is how my data directory looks like.
```
pothole_or_not/
test/
train/
pothole/
road/
```
And this is my datablock:
```
dls = DataBlock(
blocks=(ImageBlock, CategoryBlock),
get_items=get_image_files,
splitter=Grandpar... |
In JavaScript, is there a way to enumerate all private properties of an object? |
|javascript|private-members| |
You can not write anything to DOM when there is no DOM.
Just like you can not put a sofa in your livingroom when there is no house yet.
That means you have to check with ``this.isConnected`` if the element is attached to the DOM, in the ``set record`` method.
Its an instance of a JavaScript class/object; You c... |
Maven (Java) does not build dependencies into a compiled file.
Here is the code of my main class, the architecture of the application and the contents of the compiled file.
```
import club.minnced.discord.webhook.WebhookClientBuilder;
public class Main {
public static void main(String[] args) {
Sy... |
Based purely on [this documentation](http://re2c.org/manual/manual_c.html#regular-expressions), a form of lookahead is supported. So:
```
BINARY_NUM = "0b" ("0"|"1") ("_"? ("0"|"1"))* / [^_01] ;
```
or slightly more compactly:
```
BINARY_NUM = "0b" [01]+ ( "_" [01]+ )* / [^_01] ;
```
But you'll need somethi... |