instruction
stringlengths
0
30k
I am making a battleship project from scratch. What would be a way to identify a *specific* point on the map, and let you choose it, and then print out the chosen grid, with the "#" replaced with something else like a "X"? Here's the code: ``` turns = 10 alphabet = ["A","B","C","D","E","F","G","H","I","J","a","...
{"Voters":[{"Id":23922491,"DisplayName":"Piotr Gasidło"}]}
A `foreach()` loop will allow array data to be unpacked into variables use array destructuring syntax, but the example below will only get the first email from each subset. Code: ([Demo][1]) foreach ($array as ['email_do_convidado' => [$email]]) { echo "$email\n"; } Result: johndoe@gma...
null
A bit beter patch: + if (p->nullValue[0] != '\0' && cli_strcmp(z, p->nullValue)==0) sqlite3_bind_null(pStmt, i+1); + else sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); Now, when .nullvalue is set its value is replaced to NULL while importing CSV/TSV file.
Here is my code: https://github.com/d0uble-happiness/DiscogsCsvVue App.vue <template> <div> <FileUpload @file="setFile" /> <ParseCsvToArray v-if="file" :file="file" /> <ProcessReleaseData /> <FetchRelease /> <DownloadCSV /> </div> </template> ...
Failed to resolve import, but the path is valid, and detected as such by VSCode
|typescript|vue.js|
day_of_week feb_23 mar_23 apr_23 may_23 jun_23 <chr> <int> <int> <int> <int> <int> sunday 24575 48314 83366 84074 116821 monday 32208 46043 78434 85285 122528 tuesday 41347 56317 101060 76440 101694 wednesday 25792 51056 61445 98910 94837 thursday 21852 46027 71823 83957 117189 frida...
How can I solve this problem in Geom_line?
|r|charts|line|geom|
null
The OP's problem qualifies perfectly for a solution of mainly 2 combined techniques ... 1) the [`map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) based creation of a list of [async function/s (expressions)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
I guess this is silly question, but I am confused as to how can regex `.*` match all the strings? `*`: zero or more occurrences of the preceding element, `.`: matches any one character, So, in `.*`, `.` should match any one character( say 'x'), then `*` would mean 0 or more occurrences of 'x', thus giving us ...
Clarity on how can `.*` match all strings?
|regex|string-matching|
null
I am writing a program in which I need to analyse the impact of rounding off on the result. The algorithm shall be implemented as fixed-point math eventually. In my program I need to see what impact it has if I round off certain part of the calculation to 4, 3, 2, 1 decimal places and also integer. However, I found ...
from django import forms from django.contrib.auth.models import User class SignupForm(forms.ModelForm): class Meta: model = User fields = ['username', 'password', 'first_name', 'last_name', 'email'] widgets = { 'password': forms.Pa...
I am trying to setup node 15.3.2 version using docker compose file. I have added all the necessary requirements in dockerfile. But after executing ```docker compose up``` command, I am facing below error. I tried ```docker compose --build``` command as well. If any one have any solution please let me know. Dockerfi...
Error: Cannot find module '/var/apps/frontend/bash'
|node.js|dockerfile|
Hey here's my settings and value of confPath String, it worked after I moved the file to src/main/resources [1]: https://i.stack.imgur.com/GCWEt.png
It's possible only if you check the checkbox "Keep my email addresses private", in which case all web-based Git operations will use the generated `@users.noreply.github.com` email. Downside: You can't use your public email in your web commits either. If you don't check this option, GitHub will leak your "private...
In React component can not debounce handleChange
|reactjs|debouncing|
embedPy needs to make a call to Python. It tests `python3` first and if that fails it tries `python`. You can test on your command prompt to check if they run: ``` C:\Users\rianoc>where python3 C:\Users\rianoc\AppData\Local\Microsoft\WindowsApps\python3.exe C:\Users\rianoc>where python C:\Users\rianoc\Ap...
I've encountered an issue where I need to remove a MongoDB document by its `_id` without utilizing ObjectId in the PyMongo library. Typically, it seems that ObjectId needs to be imported and used for identifying documents for removal. However, I'm exploring whether there's an alternative method to achieve this without ...
I have a following piece of code: ``` ... body: TabBarView( controller: tabController, children: <Widget>[ FutureBuilder( future: customerController.getAllCustomers(), builder: (BuildContext context, AsyncSnapshot<Lis...
I am using pg-promise for performing a multi row insert of around 800k records and facing the following error: Error: Connection terminated unexpectedly at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:509:28) at Connection.emit (node:eve...
A bit beter patch: + if (p->nullValue[0] != '\0' && cli_strcmp(z, p->nullValue)==0) sqlite3_bind_null(pStmt, i+1); + else sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); - sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); Now, when .nullvalue is set its value is re...
How to implement a sorted custom list class
Someone deployed a ChatGPT Web app in Azure for me, but the version installed from the repository is from a few months ago. I'm trying to figure out how to update the external Git, but if I reconnect it, the whole app breaks (I get a 500 error). [![enter image description here][1]][1] [1]: https://i.stack.im...
How to update to the latest external Git in Azure Web App?
|azure|github|
The standard way to define a file is to use a FILE definition that is saved to the CICS CSD. When defining a FILE you use the dataset name (DSNAME attribute) as the base, path or alternate index. See the IBM docs for more details https://www.ibm.com/docs/bg/cics-ts/5.3?topic=resources-file-attributes
A bit late on the topic, but I was struggling with the same error. What solved the issue for me was renaming the `layout.js` file to `_layout.js`. For some reason the file was not rendered without the underscore as prefix.
Another slight variation for benchmark, though the change is not that radical. ``` r df_update <- function(df) { if("col3" %in% names(df)){ df$col3[is.na(df$col3) & (df$col1 %in% c("v2", "v3"))] <- "VAL" } df } lapply(my_list, df_update) # microbenchmark::microbenchmark() : #> Unit: milliseconds ...
Filter by JSON object by keys
|javascript|reactjs|json|object|filter|
There is a trick to accomplish this. I'm assuming the title and subTitle will have a maximum of three lines. The idea is to create a Text with a placeholder that has up to three lines. Then add the overlay of your two title and subTitle `View`s to this placeholder. ```swift struct TextWrapper: View { //Make su...
I'm implementing a type of BSP tree in Rust, and I am wanting to write a function that tells which side of a parent node a node belongs to. This is what I have ``` enum Side { L = 0, R = 1, } enum RegionKind { Split { subregion: [Option<Rc<Region>>; 2], }, Client{ wi...
I have the following mongo model: ``` { "_id" : "5f5a1c1f6976570001783ab7", "date" : NumberLong(1590624000), "source" : "here", } ``` I would like to have the number of documents, group by date, that have source field at here value for example: ``` { "date" : NumberLong(1590624000), "cou...
Mongo count number of objects grouped by a field value
|mongodb|mongodb-query|aggregation-framework|
Have you tried stopping the project and then restarting it? Changes involving native-end plugins typically require a project restart to take effect.
When attempting to get a time using mktime, I get a overflow exception. This occurs on a Debian docker image, but not on my host machine: ``` docker pull python:3.9.7 ``` https://hub.docker.com/layers/library/python/3.9.7/images/sha256-9d7d2a6ce11fe5a12c74f81b860f5142fd91192427ece0b566c4fb962353325e?context=ex...
|python|database|informix|
Recast removes comments from file
Hey here's my settings and value of confPath String, it worked after I moved the file to src/main/resources [ide pic][1] [1]: https://i.stack.imgur.com/iPQ6I.png
I'm working on an Angular form where users can input their phone numbers. I've added a custom directive appPhoneExtMask for phone number formatting and applied Angular form validation for minlength and maxlength. However, I'm facing an issue where if the user only enters spaces into the input field, it triggers a valid...
Flutter not showing rendered shimmer, but waits for future builder to have data before showing
|flutter|
Try To connect to your MongoDB instance with specified database name, use the following connection string from outside the container 'mongodb://localhost:27017/my-db' and this from inside the container 'mongodb://mongo-db:27017/my-db' add this to docker-compose environment: - MONGO_INIT...
I've downloaded Docker Desktop to run it, but when I open it, I get an error message: **Docker Desktop - Unexpected WSL error**: ``` `(Docker Desktop - Unexpected WSL error btrd. An unexpected error was encountered while executing a WSL command. Common causes include access rights issues, which occur after waking ...
Docker Desktop - Unexpected WSL error And WslRegisterDistribution failed with error: 0x80041002 Error: 0x80041002 (null)
|docker|windows-subsystem-for-linux|
null
I am trying to create a webpage which is made up of a header and bellow the header a list of items. I want the list of items to be vertically scrollable. I also would like the webpage to take up the entire window but not be bigger. Currently my problem is the list of items is not scrollable and instead extends far belo...
|python|qtpy|
[this is my result][1]I ran the deep learning for regression, it is a multimodal model with two loss functions. the mse and mae are acceptable, but the r2 is so horrible.the r2 started from very big negative number and then decreasing during one epoch. any idea can explain it? what should I check? Thanks!!!!! this i...
I have the following `array` that I converted from a JSON response of the `WP REST API`: [ [ 'id' => 6, 'convite_id' => [4], 'nome_do_convidado' => 'John Doe', 'email_do_convidado' => ['johndoe@gmail.com', 'another@example'], ], [ ...
How to access deep values from a particular column of a multidimensional array
|php|arrays|loops|multidimensional-array|
null
I'm new to DynamoDb. So if someone could explain to me, what am I doing wrong, or what I miss in my understanding that would be great. I'm trying to get the most effiicient way of searching for a row, that contains some value. 'm playing around with some test data to see how it works and how to design everything. ...
Pattern matching over entries of an array/split
|rust|pattern-matching|
I am new in react native and I want to achieve text chat functionality with agora in react native. Currently, I'm encountering an issue where if a user is not on the chat screen and receives messages from another user, those unread messages are appended at the end after the older messages load. Additionally, when t...
i'm working on React and Firebase and i'm trying to integrate Firebase Cloud Messaging. My main challenge is passing my app credentials to the ```firebase-messaging-sw.js```. This file is in the public folder and can't access ```.env``` file. I've been looking at a number of tutorials and they cover FCM setup but not h...
Firebase Cloud Messaging: how do i get access to environment variables the public folder
|reactjs|firebase|firebase-cloud-messaging|
# Answer no longer valid The `@import` syntax was removed from `CSSStyleSheet.replace()` * [Chrome][1] * [Mozilla][2] ## <s>Constructable Stylesheets</s> This is a new feature that allows for the construction of `CSSStyleSheet` objects. These can have their contents set or imported from a css file using Java...
You should encode the cookie value. The [.NET method][1] is `UrlEncode` in the `System.Web.HttpUtility` API. In .NET Framework, this `UrlEncode` method [was provided by][2] the `System.Web.HttpServerUtility` API. See also [this SO answer][3]. [1]: https://learn.microsoft.com/en-us/dotnet/api/system.web.httputili...
null
I just solve this problem for myself. I changed `includePath` in *c_cpp_properties.json* from ``` "${workspaceFolder}/**", "C:\\msys64\\usr\\lib\\gcc\\x86_64-pc-msys\\11.3.0\\include\\**", "C:\\msys64\\usr\\lib\\gcc\\x86_64-pc-msys\\11.3.0\\include-fixed\\**", "C:\\msys64\\usr\\include\\**" ``` to ``` "${works...
What does this mean "Error connecting to SMTP server: (421, b'Service not available')"
|python|html|css|flask|smtp|
null
Customise switch appearance in AndroidX preference activity
I am developing a multi-module Gradle (8.7) project, structured such that one module acts as the main application, while the others are libraries used by this application. All unit tests are located within the application module. Although these tests cover code paths in the library modules, Jacoco does not seem to gene...
Jacoco Coverage in Multi-Module Gradle Project Not Including Submodules
|java|spring-boot|gradle|sonarqube|jacoco|
null
I had the same problem while following the Scrumdinger tutorial on the Apple Developer site. Finally I found a comment by some guy on a similar problem. It turned out that his development machine has no mic. That explains why the tutorial code works fine on my iPhone. Then I connected my iPhone to my Mac Mini as a w...
I'm relatively new to using neo4j. I've connected to a database with the py2neo library and populated the database with the faker library to create nodes for Person and Address each with attributes attached to them. I'm interested in creating indexes and testing the performance of different indexes. These were the two ...
CUDA Toolkit 12.4 (latest up to March 2024) doesn't provide xgetri function which is used in LAPACK for matrix inversion, in their cuSolver collection of LAPACK functions for dense matrices. I really don't know why they have not included xgetri in CUDA Toolkit, but if I want to implement matrix inversion using xgetrf+x...
CUDA matrix inversion
|matrix|cuda|lapack|inversion|
I am using macOS. I have multiple `LazyVGrid` in my `ScrollView`. I am using `.scrollPosition()` to track the scroll position. Without using this modifier, I don't have any issues, but if, the scrolling is broken. The problem is similiar to this one: https://stackoverflow.com/questions/66397921/add-multiple-lazy...
ScrollView with multiple LazyVGrids jumping around when using .scrollPosition
|swiftui|scrollview|lazyvgrid|
Im new to using javaFx and programming in general so this might be a stupid question. Im trying to make a function that makes the thread wait without crashing the program which would result in something like the image above. [What Im trying to achive](https://i.stack.imgur.com/9ScnL.png) I have tried using thread.sl...
I have a project where I define a "heterogenous list" like the following. I'm not sure what this trick is called but I've found it to be useful: ```haskell {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} import Data.Kind (Type) data (a :: Type) :> (b :: Type) = a :> b deriving Show infixr ...
I have a dataset of investments that shows a value for the investment, a coupon rate, and an annual income. Some investments generate no income, and some investments have a coupon rate but the annual income is not computed. How do I update the income column when there is a valid coupon but no number in the income colum...
How do I update a dataframe column with a formula that uses values from other columns?
|python|pandas|
null
I've developed a Telegram bot "mini app" that allows users to visit a website and open a "ticket" by entering text to explain their issue. Following this, a message "An admin will arrive soon" is sent to the user through the bot interface, and a Discord message is dispatched via a webhook to notify moderators that a ne...
I am unable to create a build with this command: `docker build -t feedback-node .` Although docker was working fine previously. I have also tried almost all the available suggestions but found nothing that could resolve it. [![This is the snapshot of it ](https://i.stack.imgur.com/igImj.png)](https://i.stack.imgur....