instruction stringlengths 0 30k ⌀ |
|---|
Consider something like [Google Input Tools](https://www.google.com/inputtools/) for instance, which can transliterate text in multiple languages using the Latin script. As you type a word, it interactively autocompletes it, showing you multiple possible results.
My question is, do the major OSs (i.e. Linux, macOS a... |
In c++, It's possible to use some tricks with the help of constexpr, to write a MACRO that encrypts strings in compile-time, and decrypts them in runtime, and we could use something like `ENCRYPT("MyString")` to achieve this. An example is the following header file:
https://github.com/skadro-official/skCrypter/blob/... |
You can use a guard to prevent recursive calls
``` vb
Private m_updating As Boolean
```
Then in the TextChanged event handlers check, set and reset the guard. Here
`HEX_TextChanged` as an example
``` vb
Private Sub HEX_TextChanged(sender As Object, e As EventArgs) Handles HEX.TextChanged
If Not m_updati... |
flatpak creation issue for old version of Wine (6.13) |
|wine|flatpak|flatpak-builder| |
I am trying to use Ruby to emulate an `append` function from DrRacket. However, when I try it, I get `((1 2 3) . 99)` instead of `(1 2 3 . 99)`. Is it possible to correctly emulated `append` with a preexisting list, or do I need to make a copy of it first? Please reply at your earliest convenience.
|
I'm struggling to get the correct keyboard to show and be able to insert numbers and the decimal symbol but I'm faced with a strange situation.
This is what i got with Android Studio using Java code:
[![enter image description here][1]][1]
Here the xml code to show this keypad:
<EditText
an... |
|reactjs|react-state| |
A normal user **(Note: I mean only the user, and not a programmer or developer)** doesn't need to know how many arguments or what arguments are required. It is the responsibility of the developer to give the program user friendly. For instance, for giving the approximate age of a user, user is asked to give only the ye... |
I could solve the same error by instructing the scm plugin to use the 'github' server for the credentials.
This can be done by adding the following property in the `pom.xml`:
<properties>
<project.scm.id>github</project.scm.id>
</properties>
In my Maven `settings.xml` I have the following configuratio... |
I am trying to work with llama index and constantly i coming across the error of loading the document.
#Load and index the data with the simpleDirectoryReader of Llama Index
reader = SimpleDirectoryReader(input_files=["./modals/llamaindex test/data/paul_graham_essay.txt"])
docs = readr.load_data()
print(f"Loaded{le... |
How can i import the document in Llamaindex |
|artificial-intelligence|huggingface-transformers|llama-index| |
null |
I generate a PDF file and the unicode text appears in macos preview but not acrobat.
I have the following `fdf` file
```
%FDF-1.2
1 0 obj
<<
/FDF
<<
/Fields [
<<
/T (name)
/V <FEFF0793>
>>]
>>
>>
endobj
trailer
<<
/Root 1 0 R
>>
%%EOF
```
The main thing is `FEFF0793` which is `utf16be` enc... |
pdftk unicode works in preview but not adobe acrobat |
|pdf|unicode|utf-8|pdftk| |
We're in the process of upgrading our PHP Laravel system, and one of the key concerns is the compatibility of passwords between the old and new systems. The passwords in the old system are encrypted, and we need to ensure a smooth transition to the new encryption method without causing disruption to users' access. What... |
How to Safely Migrate Encrypted Passwords During a PHP Laravel System Upgrade? |
|php|laravel-8|bcrypt|password-encryption| |
For smoother interaction of my application with the user I need to know when my program can see **the whole flow** of keyboard events from the user, and when this flow is interrupted. I’m testing my approach on a simple top-level with only a (subclassed) Rich Edit control inside. It turns out that checking for `WM_KI... |
null |
null |
null |
null |
null |
null |
I cannot reproduce your error since it would be impossible without the source data to run it through, but I am 99.99% sure about what is happening just by looking at the code. The issue is the use of GridSearchCV here.
CV stands for cross-validation. This means that in order to evaluate the performance of a single g... |
[EDIT] since 17.1 you can now use a [signal as input](https://angular.io/guide/signal-inputs#signal-inputs). There is no need for `@Input()` anymore:
```typescript
firstName = input<string>(); //InputSignal<string|undefined>
```
Previous answer below:
It's not yet ready, you can however convert a regular input... |
You can use type hints to make sure that pycharm knows the type of dynamically created objects:
class Dialog(QDialog):
def __init__(self):
super(Dialog, self).__init__()
loadUi("dialog.ui", self)
self.table: QTableView = self.findChild(QTableView, "tableView")
o... |
You're using `actions/github-script@v6` to run shell commands. It's not meant for that.
Try this way:
name: Update version
on:
push:
tags:
- 'v*' # Trigger only in case of new tag
jobs:
update_version:
runs-on: ubuntu-latest
steps:
... |
## Why is not running?
Basically, is not usual to use CMD and ENTRYPOINT **together**. If you do that, the cmd instructions are appended to the entrypoint as simple arguments. In your case something like this:
```
ENTRYPOINT["/entrypoint.sh", "/bin/bash", "-c", "/log-agent.sh"]
```
More details here
- ht... |
`selectedBook = aStoreItems[i];` is never executed. It is dead code. When `return` is executed, the function exits and executes no other statements in that function are executed.
You should just not have that `selectedBook` variable. Instead *use* what the function returns at the calling side. So in the second part ... |
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... |
I wrote a SnippingWidget function and linked it to the main code. After executing this function, my application crashes with an error. I looked up what the error is with try and it says: "PyQt5.QtCore.pyqtSignal' object has no attribute 'emit'". I want this function to just hide itself when finished, meaning it can be ... |
I have a ViewPager 2 inside a plannerFragment, which calls 2 fragments: one (localeChoosingFragment) contains a recyclerview for the user to choose a locale, and another to choose places within that locale (localeExploringFragment). A ViewModel (japanGuideViewModel) stores the data (as MutableLiveData), including the i... |
Your approach seem okay for implementing entity auditing in spring boot. However
1. Your AuditorAware implementation looks appropriate for fetching the current user. Ensure that it correctly handles scenarios where the user is not authenticated or the current user cannot be determined.
2. Using a MappedSuperclas... |
For install **cudatoolkit and cudnn** by Anaconda you can use these following command `conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0`
You must aware the **tensorflow version** must be less than **2.11**
For check if the everything installed properly
1) In command prompt check `nvidia-smi` command... |
I'm trying to build a work schedule tracker, starting with the header. A picture attachement shows how the design will look once completed [Schedule Header Cosmetics](https://i.stack.imgur.com/DtFf0.png)
I have three classes so far,
- InputWindow: A Toplevel window for a user to select a month and year from two com... |
Tkinter App - My Toplevel window is not appearing. App is stuck in mainloop |
|python|python-3.x|class|tkinter|ttk| |
null |
I am making Android application that displays contents that is copied from USB storage disk.
The problem is when USB storage disc is connected to device, Media Player `onCompletion()` is immediately called although movie now playing is not finished yet.
I want to fix this problem not to call `onCompletion()` when... |
I have a React frontend application configured with a proxy in the package.json file pointing to my Flask backend running on http://localhost:2371. However, when making requests to fetch data from the backend using fetch("/members"), the frontend seems to be fetching data from localhost:5173 (the address on which the r... |
The structure of your query is not correct. There are a lot of ways to fix this problem, but essentially you need to separate the data call from the component display instead of trying to do both all at once.
This is usually done with React Hooks, and there are numerous examples out there of how to accomplish this.... |
onCompletion(mp: MediaPlayer?) is unintentionally called after USB storage is connected |
|android|kotlin|usb|android-mediaplayer| |
It looks like you are missing the program database (PDB files).
You have to invoke the linker with the /DEBUG option.
Since you are using SCons - you have the edit your configuration file and add the /DEBUG linker options. |
For install **cudatoolkit and cudnn** by Anaconda you can use these following command `conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0`
You must aware the **tensorflow version** must be less than **2.11**
For check if the everything installed properly
1) In command prompt check `nvidia-smi` command... |
{"Voters":[{"Id":2442831,"DisplayName":"Lino"},{"Id":7015400,"DisplayName":"Peter Haddad"},{"Id":2851937,"DisplayName":"Jay"}]} |
In the openned directory there is a sub directory that contains many files (millions). This is for a good reason. Still, the vscode server keeps searching through these files for potential Python environments, and this takes forever.
Moving this sub directory to a different location solved the problem. |
I am trying to develop a plugin to export markdown file to PDF.
Here is a sample markdown content:
```
# What is Obsidian ?
Obsidian is a **markdown** editor.
```
I am using `marked` library to convert `markdown => html string` after which using `html` function of `JSPDF` library to convert to PDF and save
... |
{"Voters":[{"Id":807126,"DisplayName":"Doug Stevenson"},{"Id":209103,"DisplayName":"Frank van Puffelen"},{"Id":2851937,"DisplayName":"Jay"}],"SiteSpecificCloseReasonIds":[13]} |
IIUC, you can build a directed graph with [`networkx`](https://networkx.org), then find the [`shortest_path`](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.generic.shortest_path.html#networkx.algorithms.shortest_paths.generic.shortest_path) between each node... |
'PyQt5.QtCore.pyqtSignal' object has no attribute 'emit' |
|qtpy| |
null |
I'm trying to add recession bands to this graph:
[The Taylor (1993) rule for the US and the Fed Funds rate, 1960-2023](https://i.stack.imgur.com/UJIa6.png)
I'm not sure where to start. Here's what I've got currently:
```
p <- ggplot(df, aes(date, fedfunds, group = 1, color="red"))+
geom_line( size=1.2, alp... |
The answer was posted [here][1]
[1]: https://github.com/browserify/pbkdf2/pull/98
Apparently, browserify injects the variables when compiling so global and process are different. Global is the node and process is the browser process. I fixed the issue by changing process.versions and process.versions.node to ... |
I am trying to write a little program, which is resistant against buffer overflow and similar vulnerabilities.
Since we cannot trust the user input, I thought it would be a good idea to concatenate all the strings that are inputted into one string and then pass it to a static path, which is a bash script in the same... |
I wrote a SnippingWidget function and linked it to the main code. After executing this function, my application crashes with an error. I looked up what the error is with try and it says: "PyQt5.QtCore.pyqtSignal' object has no attribute 'emit'". I want this function to just hide itself when finished, meaning it can be ... |
**1st solution** - automatic.
The PyCharm plugin **"PyCharm Help"** allows you to automatically download web help for offline use: when help is invoked, pages are delivered via a built-in Web server.
This solution has drawbacks - for me, it downloaded help only for one version of Python, but not for newer versions ... |
I want to create private channel on Laravel + React with Pusher (I want to create chast online). I found issues like [here][1] and others but it doesn't solve my problem. Looks on my code.
useEffect(() => {
Pusher.logToConsole = true;
const pusher = new Pusher("***", {
cluste... |
Privsate channel doesn;t display messages - propably it's problem with authentication |
|reactjs|laravel|frontend| |
You can use the `text` query parameter to reduce the number of icons.
Since Material icons rely on ligatures you need to enter the names of the desired icons (See [list of icons][1]).
E.g for filtering to `close` and `search` icon we append this query parameter:
```
&text=closesearch
```
We can also ... |
|assembly|multiplication|riscv|integer-overflow| |
I wanted today to compile my c++ code on windows, I get an undefined reference to all box2D part of my code.
Here's my Makefile :
```
linux: main.o
g++ main.o -o main -O2 -Wall -lbox2d -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
./main
windows:
g++ -I../include -L../lib ../main.cpp -o main.exe -O2 -Wa... |
Instead of adding a generic parameter for the value, add it for the key, and by using [indexed access types](https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html) get the correct type for the value:
```
function changeHandler<T extends keyof Data>(field: T, value: Data[T]) {
data = {...data, [f... |
For any Eclipse version starting from 2022-03 (4.23) you can download from the Eclipse Marketplace [OmniFish tools][1], since Glassfish tools doesn't seem to be maintained and does not support Glassfish 7.
Also note that you need to download [Glassfish 7][2].
After you install OmniFish tools and restart Eclipse y... |
Update new version Released: Feb 17, 2024.
py -m pip install feast |
Since you already know where the repository is and which type of file you are looking for, the use of `find` is not optimal. you could simply use a for loop instead:
for file in ./build/html/*.html;do ../emojize_pngorsvg.py ${file} > ${file}; done;
Not sure why you would need to change the extension, delete t... |
I have a collection of a few thousand characters. Each character has eight localized fields and nine different supported languages. Below is an example of the schema I am using populated with sample data (just with a smaller document).
```
db.characters.insertMany([
{
"key": 123,
"attack": 1337,
"number... |
My 2 cents for OS X including write that handles extensions + offscreen image drawing (method 2); one can verify with NSGraphicsContext.currentContextDrawingToScreen()
```swift
func createCGImage() -> CGImage? {
//method 1
let image = NSImage(size: NSSize(width: bounds.width, height: bounds.height),... |
Your `FragmentContainer` has a height of `wrap_content` meaning it won't respect the constraints set by `constraintTop_toBottomOf` (and similar) attributes.
Using `0dp` (`MATCH_CONSTRAINT`) as its height is the key. Please read more about it [here][1].
> ... The first two works in a similar fashion as other la... |
The top rated answer does not work with the new Reflectation implementation in e.g. Java 21 that uses MethodHandles and ignores the flags value on the Field abstraction object.
One solution is to use Unsafe, however with [this JEP](https://openjdk.org/jeps/8323072) Unsafe and the important `long objectFieldOffset(Fi... |
I want to use multiple PMMLs to keep the transformation of the data and the application of the model separate. Here is the code I am using. I am doing this because I want to include some kind of winsorizing on my data.
```
train_stats = {}
continous_domains = []
for cont in con_vars:
# REMOVE -1 values to... |
How to transform Dataframe Mapper to PMML? |
null |
I am trying to build my object using the below Json payload(which is being fetched from external API), now when ever i use any get method(i.e: jsonObject.getString() or jsonObject.getBoolean(), jsonObject.getObject()) and
if the value present for the key is null,I am getting an exception that "the value is not a st... |
The extension operates via Java still it would seem, so it carries it's own jdk (and thus it's own CACERTS)
C:\Users\<me>\.vscode\extensions\oracle.sql-developer-23.4.1-win32-x64\dbtools\jdk\lib\security\cacerts
Just import your signing root for the TLS connection into the cacerts above using keytool
k... |
I was given this solution:
open the Registry editor by pressing Windows logo key then pressing R.
When the RUN box opens, type regedit there then click OK.
Then navigate to this path:Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Security
If you do not have the Security key there, that looks like... |
I have a Next.js app with the following structure:
```
.
├── next.config.js
└── src /
└── app/
├── page.tsx
└── getYoutubeTranscript/
└── getYoutubeTranscript.tsx
```
`next.config.js` has the following policy defined:
```
// @ts-check
/** @type {import('next').Nex... |
Not directly related to OP question but just to complete @mrhn answer.
When working with an array of data you want to all convert to DTO, you can use `::collect()` like so;
```php
$ratings = Rating::collect($request->input("rating"));
```
It then gives you access to all [Laravel `Collection` methods](https:/... |
I've encountered a challenge with handling keyboard suggestions in a `contentEditable` element, specifically the unwanted spacing that occurs when selecting suggested text from a virtual keyboard. Here's an approach I've developed that seems to mitigate this issue:
**Approach:**
The strategy involves storing the ... |
* **Chrome/Edge/Opera Only**: [`navigator.storage.estimate().usageDetails`][1] provides a breakdown by storage type, but it's not supported in Firefox/Safari (see [browser compatibility][2])
>Note: The returned values are not exact: between compression, deduplication, and obfuscation for security reasons, they will ... |
I am trying to perform a network meta-analysis. The network contains 3 subnetworks. Therefore I decided to use netmeta::discomb to perform an additive analysis. This worked without error in another project, but not with the new studies.
My current dataset contains 9 studies over a total of 10 treatments (all two-arm... |
How can I solve non-conformable arguments in R netmeta::discomb (Error in B.matrix %*% C.matrix)? |
|r|meta-analysis| |
null |
I found this code on web, and it works on retina. Paste here, hope can help someone.
```objective-c
NSImage *computerImage = [NSImage imageNamed:NSImageNameComputer];
NSInteger size = 256;
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:NULL
... |
Use the following:
python setup.py install --prefix=<your path> |
I'm very new to JS. I'm trying to return a matched value from user input from a global array (aStoreItems) for a theoretical online book store. The array consists of objects passed through a constructor.
```
// Function to find object by ID value
function getBookById(id) {
console.log("Variabl... |
You get many out of bounds
The following model works better
range J = 0..5;
range R = 1..3;
range T = 1..10;
int P[J] = [0,1,2,3,4];
int d[J] = [1, 1, 3, 5, 2];
int EF[J] = [1, 2, 1, 1, 1];
int LF[J] = [2, 3, 4, 6, 2];
dvar int x[J][T];
subject to {
... |
I am working on a project in which execution at some size of data requires additional heap space, The actual problem is that I tried multiple approaches to solve but all in vain.
At first, I started by editing my launch.json file since I am using VSCode, tried adding the Xmx parameter to the vmArgs.
nothing, I adde... |
null |
I am working on a WordPress site and while integrating SMTP with the site, I used (EASY WP SMTP & WP Mail SMTP) with 3 different SMTP credentials. When I try to send a test mail over SMTP, it gives me an error (Connection Timeout), and simple SMTP is also not working. I tried to add SMTP and create a test form (contact... |
i was expecting to migrate project App from JDK11/SDK33 to JDK 17/SDK 34 but fails everytime,
i have been for days tring to find the correct configuration..
My console error output:
```
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':flutter_native_image'.... |
Flutter run JDK 17/SDK 34 migration issue 'flutter_native_image' |
|java|android|flutter|dart|gradle| |