instruction stringlengths 0 30k ⌀ |
|---|
I'm a basic developer working on a pet project and getting myself in knots on the best approach for displaying this in a React Native app via Flatlist.
First off, this is the format of the JSON file. There are approx 7,000 of these records in the file and many are in a variety of different timezones.
```
name: ... |
Sub LastColumn()
Dim LCol As Integer
LCol = Range("C3").End(xlToRight).Column
Columns(LCol).Select
Columns(LCol).Copy
Columns(LCol + 1).EntireColumn.Select
Columns(LCol + 1).Insert Shift:=xlToRight
End Sub
|
I could solve my problem with magical nutika python compilar tool. --windows-uac-admin parameter provides admin rights for app. Thanks Kay :) |
In this example a SwiftUI view's identity depends on the value of its `@StateObject` member variable. I don't think this should be possible because if a view doesn’t have an explicit identity, it has a structural identity based on its type and position in the view hierarchy. In the example below the `ItemPopupView`'s i... |
using flex and minWidth make datGrid flicker on page loading.
look like it is rendered multiple times |
In my ASP.NET Core-6 Web API, I have these two fields FromDate and ToDate
[Required]
[MaxLength(8)]
[MinLength(8)]
public string FromDate { get; set; }
[Required]
[MaxLength(8)]
[MinLength(8)]
public string ToDate { get; set; }
I want to display to the user in the Swag... |
I'm trying to store 5000 data elements on an array. This 5000 elements are stored on an existinng file (therefore it's not empty).
But I'm getting an error.
Code
def array():
name = 'puntos.df4'
m = open(name, 'rb')
v = []*5000
m.seek(-5000, io.SEEK_END)
... |
You can achive this using woocommerce_package_rates filter
/**
* Hide shipping rates when free shipping is available.
* Change the Free Shipping label to 'Saved X'
*
* @param array $rates Array of rates found for the package.
* @return array
*/
function my_hide_shipping_w... |
I was trying to add a p5.js sketch to my website, so as first try, I grabbed a sketch from Daniel Shiffman's 3D terrain generation with Perlin Noise video ([link 1][1], [link 2][2]) to my [Svelte](https://svelte.dev/) project, when I noticed that the sketch seemed to be running much slower than it was in the p5.js [web... |
Your letters `M` and `N` give a problem in the `TEXT` function they are characters that need to be escaped to be used literally in that function. You can escape those characters by preceding them with a `\`, which escapes only the single character following that token, or by enclosing them within quotes.
so `"\V\U\A... |
I'm working with a game called "Pixels". My goal is to programmatically monitor when trees respawn within the game. A developer provided me with Java code for this, and I've attempted to convert it to Python. I'm able to successfully retrieve my session ID, room ID, and other relevant server details.When I attempt to... |
|c#|.net|sql-server|entity-framework-core| |
It's because you've set 1000px width to the parent (.row)
```css
.row {width: 1000px;}
```
Try to change this value to 100%. It allows the div to take up the full width of its container.
```css
.row {width: 100%;}
```
Don't hesitate to inspect your project with the dev tools within your browser to see h... |
null |
I'm using PostgreSQL in my project. The primary key column in my table is a Character type with length of 36. I generate guids in backend and store them in the table. Do I need to change the column type as uuid? Can it have the save performance? |
Is it the same to set id column as uuid or character with length of 36 in PostgreSQL? |
|postgresql| |
I have an html that has content over multiple pages that has to be printed. I have attached a sample below.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dynamically Generated HTML with Header for PDF</title> <style> /... |
Printing HTML with fixed header and footer |
|html|css| |
I am working on a Vue.js application and facing an issue with events and event listeners among my components. I have a child component that emits an event 'refresh', but the parent component doesn't seem to capture this event.
Here is the relevant code in my child component where the event is emitted. This is actual... |
Executing below code:
```python
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
browser = webdriver.Chrome
browser.get('https://soysocio.bocajuniors.com.ar/index.php')
```
Error:
```
[line 7] TypeError: get() missing 1 required positional argument: 'url'
```
... |
I want to import SimpleNodeParser from llama_index.node parser.
from llama_index.node_parser import SimpleNodeParser
But when I run this I'm getting an error:
ModuleNotFoundError: No module named 'llama_index.node_parser'
Help me to solve this.
I want to import SimpleNodeParser from llama_index... |
You can reduce your set of interfaces as `{ a: A; } | { a: A; b: B; }` is `{ a: A; b?: B; }`:
interface ButtonOnlyText extends React.ButtonHTMLAttributes<HTMLButtonElement> {
text: string;
}
interface ButtonOnlyIcon extends React.ButtonHTMLAttributes<HTMLButtonElement> {
Icon: React... |
I found the answer. You can solve this using
from llama_index.core.node_parser import SimpleNodeParser |
We can specify the GOROOT in `settings.json` as below:
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/ELblR.png |
Angular's Ahead-of-Time (AOT) compilation process converts TypeScript, HTML, and CSS code into JavaScript during build time, the DOCTYPE declaration in HTML remains essential for defining the document type, ensuring standards compliance, improving browser compatibility, and facilitating error handling and validation. |
The onclick event.target.value should return SELECT while opening a select Dropdown by mouse click and OPTION when click on an option. This is the correct behavior like Firefox do. Chrome gives back "SELECT" in both cases.
In chrome it is impossible (or i found no way until now) to reset a list to the first option w... |
Troubleshooting WebSocket 502 Error in Python Code |
|python|java|api|websocket| |
null |
This will works:
```html
<div class="min-h-screen grid grid-rows-[48px,1fr,48px]">
<div class="bg-gray-400 h-12 header">Header</div>
<div class="bg-gray-300 content">Content</div>
<div class="bg-gray-400 footer">Footer</div>
</div>
``` |
`ngx-countdown` expects `leftTime` to be a number representing seconds left. So to make it work you need to find a difference between `auctionEnd` which is a UTC string and the current Date and convert it into seconds.
Here is how your component could do this:
```ts
export class TimerComponent {
config: Countd... |
Good evening,
I am trying to parallelize a code that sums plus one to all the elements of a vector `M`, with a ThreadPool (the pool is standard and it is implemented in the book Parallel Programming Concepts Snd Practice). So I defined a function `sum_plus_one(x,M)` that takes as arguments `x`: the position of the vec... |
{"Voters":[{"Id":1883316,"DisplayName":"Tim Roberts"}]} |
**Promise resolution**
The technical explanation is that pairs of `resolve`/`reject` functions are "one shots" in that once you call one of them, further calls to either function of the pair are ignored without error.
If you resolve a promise with a promise or thenable object, Promise code internally creates a ne... |
m encountering an alignment issue with checkboxes in a Vue.js application. I'm attempting to center the checkboxes within their respective table cells. By default, they appear left-aligned. Upon applying CSS styling to the cell, all the checkboxes unexpectedly align vertically to the center of the leftmost column of th... |
Vue.js Checkbox Alignment Issue: Centering Checkboxes Within Table Cells |
**What is this error?**
As posted, the supplied code will raise a SyntaxError: as @Frodon's comment says, you would need to use """ (or ''') to have the string span multiple lines like that.
For example, this code:
s = "abc
def"
print(s)
Causes the interpreter to report:
> python test... |
```
interface Test {
a: string;
b: number;
c: boolean;
}
let arr: string[] = []
function test<S extends Pick<Test, 'a' | 'b'>, T extends keyof S>(val: T[]) {
arr = val // it's not ok
}
```
[![enter image description here][1]][1]
PlayGround: https://www.typescriptlang.org/play?ssl=19&... |
This is my `truffle-config.js`
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
require("babel-register");
const HDWalletProvider = require("truffle-hdwallet-provider");
require("dotenv").config();
module.exports = {
networks: {
... |
|html|css|vue.js| |
null |
{"Voters":[{"Id":6752050,"DisplayName":"273K"},{"Id":207421,"DisplayName":"user207421"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[13]} |
RDF: when a property is used the thing in the object position is a literal of datatype X |
I have made a few settings but each time you refresh your page or go to another page on the website, those settings go back to default. How do i store the users settings in cookies so that they stay as they are when the user refreshes or enters another page? The settings are an option to switch to dark mode and an opti... |
Storing settings in cookies |
|javascript|html|cookies|darkmode| |
null |
I think a good and simple solution is to use an adorner to render the masking symbols as an overlay of the original input.
Show the adorner to render the masking characters while hiding the password by setting the foreground brush to the background brush.
The following example shows how to use an `Adorner` to dec... |
Tossing in the expectations communicates the intent of the test better, even if you're correct that they're not strictly necessary. I don't see any apparent performance penalty to including them, either.
You may prefer to use `queryByText` which will return an element or null and let you write "normal" expects that ... |
{"Voters":[{"Id":14853083,"DisplayName":"Tangentially Perpendicular"},{"Id":238704,"DisplayName":"President James K. Polk"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[18]} |
Vue.js Event Emitted in Child Component Not Detected by Parent Component |
|typescript|vue.js|vuejs3|vue-composition-api| |
I'm facing a challenge while working on the student automation system. After selecting the department field in the form, I want to display only the departments associated with the selected unit in the department field. Currently, I can see that the units are listed correctly in the unit selection dropdown, but all depa... |
How to display only department fields associated with a selected department in student automation system? |
I would use a simple loop:
```
out = (np.array([mapping[l] for l in
map(tuple, input_array.reshape(-1, 2))])
.reshape(input_array.shape[:-1])
)
```
Output:
```
array([[0.7, 0.8],
[0.7, 0.9]])
``` |
def function1(ss:pd.Series):
date4curr=df1.loc[ss.max(),'date']
dd1=df1.loc[ss].loc[df1.date!=date4curr]
df1.loc[ss.max(),'fraud_count']=dd1.fraud.sum()
df1.loc[ss.max(),'fraud_sum']=dd1.query("fraud==1").amount.sum()
return 1
df1.assign(col1=df1.index).groupb... |
I am working on a website(MERN) which has a newsletter as well as a contact form both of my forms are sent on different routes, '/subscribe' and '/contact' respectively. I have hosted the server and client side on different domains. The contact form is working perfectly but in subscribe form I am facing a CORS error wh... |
Why I am facing an Origin error despite having included the header in the code? |
|javascript|node.js|cors|mern| |
null |
I'm trying to check if people were able to indicate "being in two different places at the same time".
[https://docs.google.com/spreadsheets/d/1Z9I_5jvgrKKs0ejqJ-PF7FnA6LwHsWUou6xagtaxe3M/edit?usp=sharing][1]
For that :
- I import the presence data of role 1 into a first tab: role1
- I import the presence da... |
Find a value in a range of cells (multiple rows and columns) |
|google-sheets|google-sheets-formula| |
|windows|32bit-64bit|createfile| |
The load balancer suggestion won't work at all. Load balancers are only for **incoming** traffic. The question is entirely about **outgoing** traffic. A load balancer would not be involved in any way in the network traffic of the Fargate task's outgoing connection to an external database. |
null |
{"Voters":[{"Id":1145388,"DisplayName":"Stephen Ostermiller"}]} |
In my case (windows pc) the extension_dir folder was set default to ext. However i got the same error "could not find driver". So i replaced the path to extension directoy with absolute path as below, and it worked.
php.ini
;extension_dir = ext
extension_dir = "C:\dev\php-8.3.4-Win32-vs16-x64\ext" |
I have a Vite-based React library, currently structured like this:
```
import { Button, Typography, Box, Flex, Color, TypographyVariant } from '@placeholder-library';
```
I want to separate the imports to add submodules so that components and shared are imported from different paths:
```
import { Button, Ty... |
In my case, inside the file **alembic/env.py**
I mistakenly used
```py
config.get_main_option
```
instead of
```
config.set_main_option
```
PS:
```py
config = context.config
```
|
With Dockerfile you can build Docker images, and the Docker Compose creates containers from existing images.
Or you can combine the two commands in the compose file (with the build option) and round the `docker compose up -d --build` command. This command first builds the image - same when you run the `docker build -... |
{"Voters":[{"Id":466862,"DisplayName":"Mark Rotteveel"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":10871073,"DisplayName":"Adrian Mole"}]} |
I am trying to understand the internal workings of RowSet.
How does it set the properties data and create a connection?
```
RowSetFactory factory = RowSetProvider.newFactory(); JdbcRowSet jdbcRowSet = factory.createJdbcRowSet(); jdbcRowSet.setUrl(".................."); jdbcRowSet.setUse... |
How RowSet works java? |
|java|jdbc|resultset|rowset| |
null |
If you create the plot in two steps, you can definitely retrieve the x aesthetic from the aesthetic object. One option is to create the aesthetic object first, then generate the plot and retrieve the x aesthetic from the aes object:
my_aes<-aes(
x = xval,
y = after_stat(density)
)
ggplot(... |
Im slowly learning .net Core 8, and Im using Identity with individual user accounts. I've recently learned how to add custom properties to the user account such as FirstName and LastName.
I would like to add a property called departments, however, each user may belong to several departments and so the AspNetUsers da... |
Net Core 8, how can I add properties to user account that contains multiple values? |
I want to parse my api response into desired type and i don't want to loop/map the results to desired type or destruct the props after retrieval of response. Please do the response parse while receiving api response itself.
API response in desired format:
```
import Items from "./DetailsResponse";
export default ... |
Parse the API response into desired type using axios or any other helpful methods in JavaScript/React.js |
|javascript|reactjs|axios|mapping|response| |
null |
As it stands, I have a game I writing, utilizing PCG (Procedural Content Generation). I was wondering if there was a better way to store the vertices of my polygon with certain library restrictions (Box2D is my chosen physics engine). Currently, I have this:
```
std::vector<b2Vec2> topChain;
std::vector<b2Vec2> bo... |
I'm writing a middleware to validate a jwt token and add current authicated user to the request instance for protected routes in Actix web.
here is my code
use std::{
future::{ready, Ready},
rc::Rc
};
use actix_web::{
body::EitherBody,
dev::{forward_ready, ... |
Can't add user info to current request instance after validate the jwt token in actix web middleware in rust |
|rust|rust-cargo|actix-web| |
the next page button doesn't change the url when it's pressed, so i have problem with scrapy.
'''
```
import scrapy
class LegonSpider(scrapy.Spider):
name = "legon"
def start_requests(self):
yield scrapy.Request(
url="https://mylegion.org/PersonifyEbusiness/Find-a-Post",
... |
> Why does the function need a window as an argument?
It ensures that the function has a reference to the global window object in scope (it doesn't have to use global scope).
Common pattern in JavaScript to pass globals into an IIFE. Also when running in environments where `window` might not exist.
> What doe... |
{"Voters":[{"Id":19639413,"DisplayName":"pmacfarlane"},{"Id":584518,"DisplayName":"Lundin"},{"Id":9214357,"DisplayName":"Zephyr"}],"SiteSpecificCloseReasonIds":[13]} |
a little back story about my situation.
I don't know how to code, and have very little knowledge in the general field. I recently hired someone on upwork to complete an automation tool for me. In a recent demo that we had over Zoom, the tool/code worked on her computer. So she sent me the files and when I ran it on ... |
Might be network issues.
Or try deleting `C:\Users\Muhammad_Kamran\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv`.
- If its unix platform try `rm -rf C:\Users\Muhammad_Kamran\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv`
Try and check the permissions on the directory.... |
This seems to be a msvc bug. The program is well-formed.
Here is the newly reported bug:
[MSVC rejects valid program involving template paramter pack taking array by reference ](https://developercommunity.visualstudio.com/t/MSVC-rejects-valid-program-involving-tem/10628323) |
Lets say I am building an interface with the following command:
```lang-bash
$ run --display (file/env/db) # default to file if invalid is entered
```
What I am looking for specifically is how to obtain an enum value with the following:
Given:
```
data type = File | Env | Db
```
When the command `run --dis... |
How to calculate Matrix exponential with Tailor series PARALLEL using MPI c++ |
|c++|parallel-processing|mpi| |
null |