instruction stringlengths 0 30k ⌀ |
|---|
If you must use a position, you can capture an index variable by reference in your lambda. Of course, the usual caveats about `pow` and floating point numbers apply, and this is unnecessary to accomplish the task, but it is _possible_.
```
int idx = 0;
int number = std::accumulate(
arr.begin(), arr.end(),
... |
I have a LET & FILTER function used to use a drop down (green cell) and then it populates a report underneath based on data in sheet("Master")
You can see it's bringing in all the ("Master") sheet columns B:M in order and I don't need columns C:K
![enter image description here][1]
How can I change
`fRng,Ma... |
That's not jow you cycle through a variable. You should do:
{% for wc in response %}
{{ wc }}
{% endfor %}
By doing `{{ response.wc }}` Django will try to do three things: a lookup for `response["wc"]`, a call to `response.wc()` or getting attribute `response.wc` and a list lookup `response[wc]` wh... |
Builder annotation access level private |
HTTP Status 404 in Struts 2 web application and result JSP |
found the issue. I don't know why and there is nothing in the documentation that indicates this (that I could find) but referencing _two_ metadata variables seems to break it and have all metadata variables return an empty string value.
```json
"expression": "'test_val_myschema'.'||$AR_M_SOURCE_TABLE_NAME",
... |
According to the second link you posted, I looked, it seems that the training process has stopped |
Your loop in `Play.move_invaders()` can tell each invader to move, except that any invader that moves beyond the limit left or right will cause *all* invaders to move down, *and* that switches the direction, which changes the test for the other invaders (`if self.direction == 'right':` etc) so not all invaders move the... |
How can I get the difference in minutes between two dates and hours in C? |
|c| |
how i can move element of dynamic vector in argument of function push_back for dynamic vector. Probably, i’ve said something and it isn’t right. Sorry, but i don't know English so good…
`vector<int> *ans = new vector<int>();
vector<int> *x = new vector<int>();
ans->push_back(x[i]);` |
I'm doing the parallel version of Bellman-Ford algorithm in c++ using std::atomic
This is my main function executed in multiple threads
```
void calculateDistances(size_t start, size_t end, const Graph& graph, std::vector<std::atomic<double>>& distances, bool& haveChange)
{
for (size_t source = start; source <... |
**The problem**
In my Flutter app, there is a custom drawer that is accessed through a button. In this drawer, there is a widget (InfoCard) which displays some of the user's information. However, in this widget, there is a FutureBuilder, so every time the drawer is displayed it shows a CircularProgressIndicator unti... |
Stripe React Native - How to save payment method with 'IntentConfiguration' (collecting payment details before creating an intent)_ |
|react-native|stripe-payments| |
|vue.js|twitter-bootstrap|vuejs3|bootstrap-5| |
One way to overcome this limitation is that you perform custom string encoding on both-side. For example:
```
var encodedHashtag = $"U+{Char.ConvertToUtf32("""#""", 0)}";
var valueToSearch = "TEST#12345".Replace("#", encodedHashtag);
```
and
```
var encodedHashtag = $"U+{Char.ConvertToUtf32("""#""", 0)}... |
It looks like you're running into the same problem [as described in this blog post][1]. The short of it is that you are responsible for disposing of your logger, which will flush its contents to the appropriate sink.
[1]: https://web.archive.org/web/20161012233113/http://blog.merbla.com/2016/07/06/serilog-log-cl... |
{"Voters":[{"Id":2756409,"DisplayName":"TylerH"},{"Id":4685471,"DisplayName":"desertnaut"},{"Id":523612,"DisplayName":"Karl Knechtel"}]} |
To delete variables in the current cmd instance, do this:
set http_proxy=
set https_proxy=
or (even better):
set "http_proxy="
set "https_proxy="
To delete variables for future cmd instances, do this:
setx http_proxy ""
setx https_proxy "" |
I am unable to plot a regression line for a simple dataframe that consists of a period formatted date column and a integer column. The sample dataframe may be created using below code:
```
df = pd.DataFrame({"quarter": ['2017Q1', '2017Q2', '2017Q3', '2017Q4',
'2018Q1',... |
I have a problem using httpClient and WCF, in particular when I put a hashtag (#) as input.
Here below my code:
for WCF:
```c#
[OperationContract]
[WebGet( RequestFormat = WebMessageFormat.Json, UriTemplate = "/GetCase/{*id}" )]
string[] GetCase( string id );
```
on client:
```c#
HttpClientHandler handler... |
I m creating an application using react/node express, I m providing an interface to the user containing a button named import: I want to do this: when the user clicks on this button a popup window will appear to him to connect to his bitbucket and when he connects he choose the repository and files he wants to import a... |
importing files from bitbucket / jira and store it in my backend |
|import| |
null |
You can try to use this package: https://pypi.org/project/selenium-print/
It uses selenium's `execute_cdp_cmd` function behind the scenes, which is fairly easy to use. The parameters can be found [here][1].
```py
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
options = webdr... |
|vba|image|ms-word|page-break| |
def function1(dd:pd.DataFrame):
dd1=dd.dictionary_column.apply(lambda x:pd.Series(eval(x.strip('"')))).T.reset_index()
dd1.columns=["dictionary_key","dictionary_value"]
return dd.sql().join(dd1.sql(),how="left",condition='1=1').select("ID,ENV,dictionary_key,dictionary_value").df()
... |
Try following:
1. Windows terminal:
```ps
# In my case name is "mountain" - see screenshot
docker run -p 8080:8080 mountain
```
[![enter image description here][1]][1]
2. Then:
`http://localhost:8080/`
[1]: https://i.stack.imgur.com/PteGY.png |
null |
Changing your tables from heap tables to clustered tables on `ID` seems like it should help. If `ID` is not unique than making a compound clustered index on all three columns would help with join speed since the data from the table would be ordered on the pages based on the three columns.
The tradeoff that you take... |
Why do I need to wait to reaccess to Firestore database even though it has already done before? |
|flutter|google-cloud-firestore| |
{"Voters":[{"Id":2325110,"DisplayName":"user2325110"}],"DeleteType":1} |
I am creating a app that will read data from firebase and display it on a map. The app keeps crashing because there are hell lot of records to retrieve from the database. I need a way with which I get only the latest node data and not the entire data snapshot.
MainActivity.java:
```
package com.example.mrt_app_c... |
How to read new child from firebase in an android app? |
|java|android|firebase|google-maps|firebase-realtime-database| |
null |
I have a small neural network in Tensorflow, with about 100 input variables and 2 hidden layers. Does Tensorflow have a built-in way of assessing input variable importance?
My first thought is to just drop each variable and calculate the accuracy, and the bigger the drop in accuracy, the more important the variable.... |
Does tensorflow have a way of calculating input importance for simple neural networks |
|tensorflow|variables|deep-learning|neural-network| |
```
io.on("connection", (socket) => {
console.log(`User Connected: ${socket.id}`);
//joining Room
socket.join(selectedOption);
socket.broadcast.emit("userConn", `${username} joined ${selectedOption}`);
socket.on('emitMessage', (data) => {
if(data.room == selectedOption){
so... |
null |
In order for your code to work with any PO, you can set the id to the currentRecord's id:
var purchaseOrder = record.load({
type: record.Type.PURCHASE_ORDER,
id: scriptContext.currentRecord.id,
isDynamic:true
});
However, it will only work for already existing PO's which you ar... |
I have a LET & FILTER function used to use a drop down (green cell) and then it populates a report underneath based on data in sheet("Master")
You can see it's bringing in all the ("Master") sheet columns B:M in order and I don't need columns C:K
![enter image description here][1]
How can I change
`fRng,Ma... |
When my breakpoints failed (C#/.NET/VS 2022 Community), my research on this issue (primarily here on SO) focused on issues with missing PDB files. Indeed, reviewing Debug::Windows::Modules indicated problems with numerous PDB files.
My research included reading through most if not all related posts here at SO, incl... |
I am using Windows Server, and installed Anaconda v2023.09 as my environment. I wanted to install `mamba`, so I called
```bash
conda install mamba -c conda-forge
```
However, this process is almost taking forever. I wonder is there any kind of way I can accelerate such installation?
Before `mamba` installed,... |
|anaconda|conda|mamba| |
I am using SQlite3 in Visual Studio code. My goal is to create a table within a database and then import data in that table. The code works fine except for when there is a space involved in the header. The header for the column is "Order ID". When I get rid of the space and import the data it works fine but when I use ... |
You simply need to add a CSS class "button" to each element and also to get the cart URL, better use `wc_get_cart_url()` WooCommerce function like:
```php
function step_controls() {
echo '<div class="step_controls_container">
<a class="btn-primary button step_back_to_cart" href="'.wc_get_cart_url().'">B... |
I'm plotting some functions of distance where the functions oscillate with a characteristic distance, and I'd like the units of the x-axis to be in terms of this characteristic distance. For example if the characteristic distance is 200m metres, I want x=50 on the x-axis to be 0.25, x=100 to be 0.5 and so on.
Here'... |
Changing the units of an axis on a seaborn plot |
|python|matplotlib|seaborn|graphing| |
null |
To display products that do not have the **`"pa_sort-chassis"`** attribute assigned!
Please try this code and it should display the products that do not have the "pa_sort-chassis" attribute assigned in the Admin portal on the Products page.
add_action( 'admin_notices', 'products_no_chassisattribute_admin' );
... |
Here's a solution to automatically start downloading a file:
[How to trigger a file download when clicking an HTML button or JavaScript][1]
Add this function and update the "downloadLinkClickHandler" function:
```js
// Function to handle download link click
function downloadLinkClickHandler(event) {
// ... |
In an HTML document, suppose I have something like a link that starts after another non-whitespace character, e.g.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<p>This is some text that includes a link (<a href="https://example.com">example</a>)</p>
<!--... |
In this instance in the conext provided, (s & '0') does not create a std_logic_vector, it creates a `signed`. VHDL is a context driven language. Because no arithmatic is available on `std_logic_vector`, and the types of `L` and `R` are signed, the arithemtic must be of the signature (from ieee.numeric_std):
```vhdl
... |
I have a problem in the Firefox browser that I cannot solve. So the problem is the following: I have a function that I use to collect data when a page receives a refresh
```
const eventName = isOnIOS ? "pagehide" : "beforeunload";
this.window.addEventListener(eventName, async () => {
await this.saveActi... |
Ns biding abording issue only on Firefox |
|javascript| |
I'm solving an exercise for class. I have a problem with reading binary files. I have made a function to write different objects to a file and it works fine. But when I read it, it only prints one. Can somebody help me?
Main
```
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
... |
Helpt with reading files |
|java|file|objectinputstream| |
null |
I am trying to run the momentum program for Trading Evolved (Chapter 12 – Momentum/Momentum Model.ipynb), contained below.
I am having a terrible time with the dates.
Running the code as it was originally provided gives me the error
AttributeError: 'UTC' object has no attribute 'key'
After a large amount of... |
How can I prevent a line break at an SVG icon? |
|html|css|svg| |
|asp.net|microservices| |
I noticed that instead of using Numpy to change my data step by step I could develop an end equation with Sympy, simplify it, and then lambdify it, such that I have the end point of a Numpy program.
I'd like to know if such an approach is not a waste of time. |
Should I be using Sympy to first develop an equation or go straight through Numpy? |
According to the official [EF Core docs][1], the method `AddRangeAsync(IEnumerable<TEntity>, CancellationToken)` is used when working with special value generators that require a database round trip. For instance, if your application employs `SqlServerValueGenerationStrategy.SequenceHiLo` to allocate blocks of IDs in a... |
|excel|vba|ms-word| |
I've been checking the implementation of the `SimpleCommandBus` and `DefaultCommandGateway`, but the only scenario when the `DefaultCommandGateway` would **not** rethrow the exception, is if the `CommandResultMessage` is not exceptional.
Note that the `CommandResultMessage` is the object Axon Framework creates to c... |
You don't mention where the SQL server is located. However if the SQL instance is not on your computer.
Above being the case?
Then the application should work just fine from all computers on that same network.
Just make sure WHEN you link the table(s), make sure you using FILE DSN, and not a user/system DSN. The... |
This is an elegant, simple, fast and arbitrary solution that works for Python version >= 3.8:
**Version 1:**
```python
from math import isqrt
def is_square(number):
if number >= 0:
return isqrt(number) ** 2 == number
return False
```
**Version 2:**
```python
def is_square2(number):
... |
As of right now I am using NLTK to create a chatbot in python but am considering rewriting for spaCy . i am looking for a way to feed my AI several pre built sentences to choose from at random from the pairs when responding to a user .
for example; say the bot says something and the user asks “would you like to disc... |
how do i randomise responses? |
|python-3.x|windows|nltk| |
null |
Firstly the title of the post may not do justice to the question, so my humble apologies for this.
Here is the question:
| Date | Type | Value |
| ----------| -------------- |-------|
| 2024-03-11| 3 |3
| 2024-3-11| 4|5
| 2024-03-12| 3 |3
| 2024-3-12| 4|5
| 2024-3-12| 5... |
Pandas select rows with values are present for all elements in array |
|python|pandas| |
The correct solution is to use `<input type="file" ...` as answered in several other stack overflow posts.
For example, if you want to just have the built-in camera app get launched, just create element:
```
<input type="file" name="image" accept="image/*" capture="environment">
```
You can use the 'file' inpu... |
Remove @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
|
You can just use [`Confluent.Kafka.Timestamp.UtcDateTime`][1]:
```
DateTime dt = consumeResult.Message.Timestamp.UtcDateTime;
```
There is no reason to convert it to string even if the type had `ToString` overloaded (currently it does not so you get the default one which returns the type name).
[1]: https:... |
I have an array of `value,location` pairs
```bash
arr=(test,meta my,amazon test,amazon this,meta test,google my,google hello,microsoft)
```
I want to print the duplicate values, the number/count of them, along with the location.
For example:
```txt
3 test: meta, amazon, google
2 my: amazon, google
1 this: me... |
Find duplicates in array, print count with pair |
|mongodb|mongodb-query| |
In Smarty, you can use following syntax: `{$index|string_format:"%02d"}`
Sample with a section loop:
```tpl
{section name="myloop" loop="10" step="1"}
{$index = $smarty.section.myloop.index+1}
{$index|string_format:"%02d"}
{/section}
```
Sample with a for loop:
```tpl
{for $index=1 to 10}
{$index|s... |
|javascript|html|css|frontend|backend| |
In GPC we need to allow VMs on VPC A Subnet 1 to communicate with VMs on other VPCs (in other projects) where there subnets overlap (exchange originates from A).
eg.
Project A | VPC A | Subnet 1 | 10.10.142.0/24
Project B | VPC B | Subnet 1 | 10.10.12.0/24
Project C | VPC C | Subnet 1 | 10.10.12.0/24
We have rul... |
Zipline Date Trouble |
I am creating an endpoint in charge of verifying that the "pages" table verifies that all the records work by checking with axios to verify that the link field works correctly or at least a status of 200.
The problem with my code is that the application freezes with the first record and does not advance, also if a rec... |
null |
null |
null |
null |
null |