instruction stringlengths 0 30k ⌀ |
|---|
```
class BiLSTMNERTagger(nn.Module):
def __init__(self, emb_dim, hid_dim, n_layers, token_vocab_size, tag_vocab_size):
super().__init__()
self.embedding = nn.Embedding(token_vocab_size, emb_dim, padding_idx=0)
self.rnn = nn.LSTM(emb_dim, hid_dim, num_layers=n_layers, batch_first=Tr... |
ASP.NET Core 6 Web API : best way to pause before resending email |
|multithreading|smtp|asp.net-core-webapi|.net-6.0|thread-sleep| |
There is a dot in your pattern here `day-.(.*)--.*` that matches any character.
In this case it matches the first digit of the year, so that will not be in group 1, and you don't match the leading digit before "day" and that will result in a wrong result like "1023-2-5"
You could match optional digits before `da... |
{"kind":"views","type":null,"data":[{"_type":"RectangleView","_id":"AAAAAAGOiuElxKkXyqE=","_parent":{"$ref":"AAAAAAGOiq4RWKiyWpQ="},"font":"Arial;13;0","left":160,"top":248,"width":16,"height":280}],"context":{"id":"AAAAAAGOiq4RWKiyWpQ=","type":"UMLSequenceDiagram","refs":[]}} |
i have been using below task to read contents of a file "file.py" from github repo "GITHUB_XXXX" but i am unable to see the actual content of the file. what is the best way to read the contents of the file from github by using git token and ansible?. verified all settings on repo to grant access to read the file conten... |
{"OriginalQuestionIds":[11926259],"Voters":[{"Id":1116230,"DisplayName":"Nico Haase"},{"Id":-1,"DisplayName":"Community","BindingReason":{"DuplicateApprovedByAsker":""}}]} |
I have several GAMs (from `bmrs`) that I'd like to perform a leave-one-out (LOO) cross-validation with to determine the best model. However, every time I use loo, I run into issues that culminate in the R fatal error message and I have to start all over again. It's rather annoying as there doesn't seem to a good way t... |
When using the 'gluster volume replace-brick' or the 'gluster volume reset-brick' commands, if the brick has been used in a volume before, or even just specified in a 'replace-brick' or 'reset-brick' command, the volume will be recorded in the .glusterfs directory on the brick. To work around this, delete the .glusterf... |
I am encountering a peculiar issue. Whenever I attempt to utilize Laravel's request validation, I receive a 'save' string in my Postman response. I have tried using both `$this->validate()` and `$request->validate` from the `Illuminate\Http\Request` class, and `FormRequest`. However, when I remove the validation from m... |
null |
null |
{"Voters":[{"Id":4294399,"DisplayName":"General Grievance"},{"Id":3001761,"DisplayName":"jonrsharpe"},{"Id":14853083,"DisplayName":"Tangentially Perpendicular"}],"SiteSpecificCloseReasonIds":[18]} |
Add this line storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
at
android{
release{
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
}
}
if you have already then replace with
storeFile file("key.jks") ? file("key.jks") : nul... |
Not sure why do you need this and what are you trying to achieve but you can have static property in static class - for example:
public static StaticExample
{
public static ObjectDTO ObjectDTO { get; set; }
}
And you can assign this object like this:
StaticExample.ObjectDTO = new Obje... |
```SELECT
_key,
MAX(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_pr) = 'tv' THEN first_dt_bought END) AS first_dt_bought_tv,
MIN(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_pr) = 'tv' THEN first_dt END) AS first_dt_tv,
MIN(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_p... |
If you want to fix your for-loop, you need to pass `!!sym(temp.name)` to `dplyr::filter()`:
```
library(dplyr)
df.mirna.pv <- structure(list("let-7a-5p" = c("no", "yes", "yes", "no"),
"let-7a-1-3p" = c("yes", "yes", "yes", "yes"),
"let-7b-5p" = c("no", "no", "yes... |
I am having an issue. It just published my first project and now I am realising if you add an "/" to the end of the URL it does load in a very different way I cant even explain. When you add a "Trailingslash" some of the Buttons of the Website are not clickable and if I do this with ng serve the font is changing, I can... |
As per [the Python docs](https://docs.python.org/3/install/index.html#alternate-installation-the-user-scheme), this is installing using the "user scheme":
> Files will be installed into subdirectories of [site.USER_BASE](https://docs.python.org/3/library/site.html#site.USER_BASE) (written as *userbase* hereafter).
... |
[@Claudiu's solutions](https://stackoverflow.com/a/38112757) works pretty well, a little bit more cleaner would be:
```
python3 -m site --user-base
```
e.g. something like this in your `~/.profile`:
```
PATH="$(python3 -m site --user-base)/bin:${PATH}"
``` |
I have to create a custom report on a ServiceNow UI Page using Javascript and HTML/Jelly. Everything is working except for this line:
`<td>${jelly.jvar_bucket.timebuckets[idx].totalSystem;} </td>`
If I replace `idx` with a number, say 20 or 25, then the report shows as expected. With idx it is all blanks.
... |
Indexing in HTML/Jelly Report not working |
|javascript|html|indexing|servicenow|jelly| |
null |
I have [Googled this exception][1], and it seems to mostly boil down to people using the old `option[@select]` style attribute selector.
My problem, however, is a little different. When I get the error, there is no line number being attributed to it.
I think it has something to do with the hashes I am using for m... |
I have a link button that, when entering my **Manage Job** page for the first time (and in most cases) works fine and triggers the popup as expected:
<a href="#dialogCompletion" data-rel="popup" data-position-to="window" data-transition="pop" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-calendar u... |
I'm starting with NodeJS and Express 4, and I'm a bit confused. I have been reading the Express website, but can't see _when_ to use a route handler or when to use `express.Router`.
As I could see if I want to show a page or something when the user hits `/show` for example I should use:
var express = require(... |
null |
|java|sockets|tcp| |
{"OriginalQuestionIds":[43983718],"Voters":[{"Id":7758804,"DisplayName":"Trenton McKinney","BindingReason":{"GoldTagBadge":"python"}}]} |
I highly recommend to use dotPeek from JetBrains to look at dll library and it's version.
According your second question. Versions can be absolutely different, not only major versions count.
![enter image description here][1]
[1]: https://i.stack.imgur.com/llXig.png |
You can use an `INNER JOIN` to reach your desired result.
```
SELECT t1.id, t1.name, t2.points
FROM Person AS t1
INNER JOIN Points AS t2 ON t1.id = t2.id;
```
A complete example is given here: [db<>fiddle](https://dbfiddle.uk/_9lZMVZx) |
I have an SVG element inside a DIV and a BUTTON element. In the button it's aligned both vertical and horizontal center, and in the DIV it is aligned top and left.
I've inspected both elements but could not find what makes the SVG align middle in BUTTON. There must be something in the user agent stylesheet but I cou... |
|html|css|svg| |
|php|laravel|postman| |
I have a Blazor WebApp in which I load data with EF Core. Now I get the following error when displaying the data on a page because of reference loops, the data is loaded in an Syncfusion ComboBox:
```
<SfComboBox TValue="Contact" TItem="Contact" @bind-Value="item.Owner" DataSource="Contacts"... |
Ollama in Docker pulls models via interactive shell but not via RUN command in the dockerfile |
|docker|dockerfile|ollama| |
It is not clear what you are asking here, but it does not appear to be consistent with the [guidelines for discussions](https://stackoverflow.com/help/discussions-guidelines). If you have a question, you can post it to SO *as a question post*, but please provide sufficient detail so others can understand what you are a... |
null |
I have some old code that was written to support work on a local network, but now may be run by remote workers. Individual file system accesses that were reasonably fast on the local network are intolerably slow for remote access because of all the additional overhead.
For reading files, I have been able to improve ... |
Speed up search of remote directories |
|c#|filesystems|remote-access| |
In my case i'm adding icons like this
assets:\n
- assets/images/
- assets/icons/
but in my case i have not use any icon in the project and i have remove this line - assets/icons/ in pubspec.yaml after that i have pubget that and i have hot restart apply in my project and this error are resolved |
Your solution is incorrect because you used the logger before the filter and the filter will be triggered if anyone subscribed to it, so Mono/Flux flow chain will run later rather than the other code. Your controller hasn't run yet, so you're reading the response code prematurely. Please in the future use debug mode an... |
I am trying to send a Solana swap transaction using javascript and I am getting `custom program error: 0x16`, I have looked everywhere and the only thing I could find is this list of errors :
https://github.com/solana-labs/solana-program-library/blob/ea354ab358021aa08f774e2d4028b33ec56d4180/token/program/src/error.r... |
Solana SendTransactionError 0x16 |
|javascript|solana|solana-web3js|solana-transaction-instruction| |
I am trying to pre populate a Joomla website form (RSForm!Pro) with information already entered by a registered user into the extension Event Booking by Ossolution Team.
The RSForm!Pro allows pre population of online form fields with scripts called when form is opened. I have a simple query working as expected when ... |
I have an application to predict the size of a fish in an image. I have built a FastAPI endpoint --`/predict/`-- that runs the multi-step process to make that prediction. The steps include two calls to external APIs (not under my control, so I can't see more than what they return).
When I run my code just from the ... |
Calls to external API work when running code as a script, but receive `500 Internal Server Error` response when using FastAPI to run the same code? |
|python|fastapi|http-status-code-500| |
hello there, im jpose75 and i having problems with my code, now the ennucienment: |
|python| |
null |
I have this regex that works perfectly with PHP:
$que = preg_replace("/(?<=^| )([a-z])\\1*(?= |$)\K|([a-z])(?=\\2)/","$3",$que);
This regex removes repeated chars inside strings (for example, `axxd` becomes `axd` however `xxx` will still become `xxx`). The problem that I am facing, is because it does not work... |
How to migrate this regex to JavaScript |
|javascript|regex| |
{"Voters":[{"Id":2621917,"DisplayName":"Michael Piefel"},{"Id":2396432,"DisplayName":"fasteque"},{"Id":472495,"DisplayName":"halfer"}]} |
To diagnose the error from your aiohttp code, it's important to print the full exception details, not just its name.
```python
print(exception)
```
In this code, detailed information is printed about what went wrong. |
The error you're encountering, "Call to a member function prepare() on null," suggests that there's an issue with your database connection or configuration. This error typically occurs when trying to execute a database query on a null object.
Given that you're using MongoDB as your database backend, there are a few ... |
[enter image description here][1]
I just installed Ubuntu 22.04 LTS in VirtualBox, I have assigned **10GB** of RAM, **8** Processors and **256MB** with **3D** video memory to the virtual machine.
I have tried changing the hardware config in virtualbox settings and updating the virtual machine along with inst... |
I am trying to make my python program use c++ code but I get dependency errors.
Here is the c++ code that I converted into a dll file:
```
#include <stdio.h>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
extern "C" {
int b_search(int* arr, int size, int v) {
... |
c++ python ctypes dependency issues |
|python|c++|terminal|dependencies|ctypes| |
null |
it seems like you made a mistake in your indentation starting at the for loop. Python indentation determines the scope where code runs, message cannot be found because it is out of scope (because it's missing a level of indentation)
i believe indenting 20 to 28 should fix your issue
async def on_message(self,... |
Use the --user flag as in
<!-- language: shell -->
pip list --user
source: https://pip.pypa.io/en/stable/cli/pip_list/ |
If I understand correctly, you want to be able to drag the blue button along the arc of the progress bar and the progress should be filled with color to correspond to the button position.
I don't quite understand why it would make sense to be able to adjust the progress manually like this, but anyway, if this is the... |
I am having an issue. It just published my first project and now I am realising if you add an "/" to the end of the URL it does load in a very different way I cant even explain. When you add a "Trailingslash" some of the Buttons of the Website are not clickable and if I do this with ng serve the font is changing, I can... |
I installed packages with `sudo pip install --user` option and I had to do `sudo python` to get it working.
<!-- language: none -->
vishnu$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
With sudo:
vishnu$ sudo python
Python 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 C... |
This question was inspired by [a question](https://stackoverflow.com/questions/33182491/why-bcd-instructions-were-removed-in-amd64) I recently came across on Stackoverflow. It reminded me that early in the development of the x86-64 ISA I had written 32-bit x86 code for BCD addition without using the BCD support instru... |
<!-- language-all: sh -->
Many moons later, let me complement the **existing, helpful answers - which continue to work _in principle_** (see below) - with a **simpler _PowerShell (Core) 7_ solution**:
Thanks to a contribution by [Mathias R. Jessen](https://stackoverflow.com/users/712649/mathias-r-jessen), [_Power... |
To avoid permission denied, the following code is OK for trashing the file instead of removing it:
_ = service.files().update(fileId=fileDelete, body={'trashed': True}).execute()
and if you are in a shared drive, remember to use:
_ = service.files().update(fileId=fileDelete, body={'trashed': True}, sup... |
I'm trying to rejigger my usage of web worker pooling to eliminate redundant server requests. In my existing solution, I'm loading workers pretty straightforwardly like this:
```js
const worker = new Worker(`${src}?v=${version}`);
```
This happens `N` times for each worker pool. WebPack has no problem with this... |
How to stop WebPack dev server from trying to handle Worker Blob URL's |
|web-worker|webpack-5| |
The line
```python
y = Function('y')(t)
```
already defines `y` as a function of `t`. When you write `y(t)` later, you're asking sympy to call `y` as if it's a function (like when you call the `print` function as `print(...)`). You have two options: (1) Don't define `y` as a function of `t`, i.e.
```python
... |
#include <iostream>
#include <string>
int main() {
std::string hash = "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1";
std::cout << "SHA-256 hash in binary format: ";
for (char c : hash) {
switch (c) {
case '0': std::cout << "0000"; break;
case ... |
and/or "How does one safely handle context in a RollingFileAppender TriggeringPolicy?"
I am having problems with [OnStartupTriggeringPolicy][1] not fulfilling its stated purpose of
>Triggers a rollover on every restart, but only if the file size is greater than zero.
on systems where the "real time clock" might ... |
Why does Log4j OnStartupTriggeringPolicy check the file timestamp? |
|log4j2|rollingfileappender| |
[Artilliery load testing code][1]
I want to use a random string(number) from numbers.json (it's an array of numbers not like usual json file) (number is denoted by 'from' in below mentioned code) for one complete flow. and also want to randomly select query from queries.json file. I want 4 iterations of thes... |
{"Voters":[{"Id":23839152,"DisplayName":"Robin Scheel"}]} |
I would kindly need your support to know how to put the same date format indicated in the original resource in the belongsto field in Laravel nova 4.
Resource 1:
```
public function fields(Request $request)
{
return [
ID::make('id')->sortable(),
Date::make('Shipment ... |
null |
null |
```
SELECT
key,
MAX(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_pr) = 'tv' THEN first_dt_bought END) AS first_dt_bought_tv,
MIN(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_pr) = 'tv' THEN first_dt END) AS first_dt_tv,
MIN(CASE WHEN LOWER(product) = 'electronics' AND LOWER(sub_... |
|excel|vba| |
it wasn't loading in the beginning of the project because i had node version 18 installed, someone online suggested to downgrade the node version to 16 in order for it to load and it works perfectly fine. The problem is node 16 is not compatible with tailwindcss, and so I uprgraded it back node version 18. It's no lo... |
What other ways to get my expo go to load? |
|android|css|ios|node.js|tailwind-css| |
null |
> If anyone has an idea as to what might be happening, I would greatly appreciate it.
Well it’s simple. The application is running in the background. You can check your *TaskManager* and kill it from there.
What exactly causes the application to keep running in the background will need more investigation to find... |
|amazon-web-services|aws-lambda| |
null |
Create a class like this:
import Foundation
import Charts
@objc(BarChartFormatter)
class ChartFormatter: NSObject, IAxisValueFormatter{
let months: [String] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
func strin... |
I would use optional chaining to check whether `self.crypto.randomUUID` exists.
<!-- begin snippet: js hide: false console: true babel: null -->
<!-- language: lang-js -->
function GenerateGuid() {
if (self?.crypto?.randomUUID) {
console.log(self.crypto.randomUUID());
}
... |
I use the case-by-case Replace/Exclude feature frequently in `Intellij`/`Pycharm`. I thought it applied to Global Find/Replace but maybe I'm misremembering and it's just in a single file? Here is what it looks like in the latter:
[![enter image description here][1]][1]
Instead in the Global Find/Replace (all ... |