instruction stringlengths 0 30k ⌀ |
|---|
The following doesn't directly answer the question, so I'll not accept it. However it helped me to in understanding a critical point about Dafny's real numbers.
Why shouldn't `real` be called `rational` or some other number system whose axioms/properties we can prove `real` to satisfy? Wouldn't that be more natural ... |
Program doesn't run after DFU |
|c|embedded|stm32|stm32f4|dfu| |
null |
|c|memory-management|malloc| |
Setting a variable based on a condition is absolutely possible!
{% set variable = (condition == 1) ? 'this' : 'that' %}
The condition can be evaluated against `true`, `false`, or another variable as well. |
I am experimenting with the excellent Bootstrap DateTimePicker plugin but appear to have hit the buffers right at the start. The page control appears correctly but the calendar button is entirely unresponsive - no picker actually pops up. I have created [this fiddle][1] to illustrate the problem. Examining the conso... |
I'm trying the Episodic Semi-Gradient Sarsa from Sutton & Barto Chapter 10 (second edition) for the [CartPole problem using Gymnasium](https://gymnasium.farama.org/environments/classic_control/cart_pole/). For function approximation, I'm using neural networks with keras. However, implementing the algorithm faithfully f... |
from sqlalchemy import create_engine, text
db_connection_str = "mysql+pymysql://user:pass@some_mariadb/dbname?charset=utf8mb4"
#Don't worry while running the code , I had replaced all the values in the db_connection_str with my values
engine = create_engine(
db_connection_str,
... |
|blazor|syncfusion|csvhelper|csv-import| |
{"Voters":[{"Id":269970,"DisplayName":"esqew"},{"Id":3689450,"DisplayName":"VLAZ"},{"Id":3730754,"DisplayName":"LoicTheAztec"}]} |
I used focus and it works all text boxes just fine.
$('input[type=text]').focus(function(){ $(this).select() }) |
|python|path|file-permissions| |
How about try `asp-action` , like
<form id="FormActive" asp-action="Index">
</form>
Then in controller:
[HttpPost]
public IActionResult Index(int id)
{
return View();
}
result:
[![enter image description here][1]][1]
**Update**:
Try to use `<... |
|pyarrow| |
{"Voters":[{"Id":9599344,"DisplayName":"uber.s1"}],"DeleteType":1} |
- In Desktop
(The emulator turns on automatically)
[npm start video](https://youtu.be/uUhNKguiao4)
[terminal(?) image](https://i.stack.imgur.com/k913N.png)
[emulator image](https://i.stack.imgur.com/GY4MG.png)
- On the laptop
After turning on the emulator
can activate the React-Native
Which ... |
For some loss functions, you will need to indicate extra parameters, you can specify them with ":" after the type of the loss function, for example:
model = CatBoostRegressor(loss_function='Lq:q=4')
In general, the parameters should be declared as such:
<Metric>[:<parameter 1>=<value>;..;<p... |
I want to navigate to the next screen after bloc listener checks the state, but in my UI, the bloc listener does not know that the state has changed. Therefore, the state is changed on\<event\>((state,emit)) after emitting to the next state.
Here is my code:
1. Bloc
```flutter
import 'package:bloc/bloc.da... |
Here's a concise polyfill using [`Array.prototype.reduce`][1]:
if(!Object.entries)
Object.entries = function(obj) {
return Object.keys(obj).reduce(function(arr, key) {
arr.push([key, obj[key]]);
return arr;
}, []);
}
[1]: https://deve... |
My issue is that I want to create a registration form where the registrant can add as many delegates as he wants by clicking on "Add delegate". The problem is that the form works perfectly but it just takes into account only the first row to add the values in the database when clicking on submit.
I tried many ways o... |
How to add the dynamic new rows from my registration form in my database? |
|php|database|wordpress|forms|phpmyadmin| |
null |
s3cmd will do the job.
It allows multiple file upload, uploading in chuncks and even sync folder with s3 folder
https://docs.digitalocean.com/products/spaces/reference/s3cmd/ |
The accepted answer was not working for me.
I fixed this by adding a slash at the end of the index directive like so:
index index.htm index.html index.php /;
The way this works is I guess by looking for nothing in the root directory, not finding it and reporting a genuine 404. It can be any bogus page with... |
I work in a windows form application. i wanna make a setting page for my program. in this form i have music for the total of my program and i have sound for my button, it sounds when you click on a button. i can off them and on them. my problem, is sounds of buttons. when i off the sound in the setting and it just off ... |
Recommended way to use Gymnasium with neural networks to avoid overheads in model.fit and model.predict |
|python|machine-learning|keras|neural-network|reinforcement-learning| |
Best options is to put this in an async function and call get token first, that's what I do in tests for example:
beforeEach(async () => {
const token = await getToken()
client = new Client({
url: 'http://localhost:4000/',
exchanges: [cacheExchange, fetchExchange],
... |
I have a button called EXPORT and now I need to create a shortcut to export file to excel. The short cut is Ctrl+Alt+E. When I press the shortcut it have to call the function "onCommandExecution" which will check the ID condition and execute the function "onExportToExcel". I have been made debugging and I the ID was no... |
null |
Tracking app usage and events for Android hybrid apps created in Phonegap is an easy affair if one uses Google Analytics. I implemented my own solution using [this Cordova plugin][1]. I had expected that implementing Piwik analytics would be just as easy. I started off with [this plugin][2] and then followed the ins... |
I have encountered this pattern of selecting all columns using * in DBT, when bringing the source data into the staging layer.
You can find it in the [dbt docs][1] about the staging layer but in [this dbt course][2].
The pattern goes like this:
with
source as (
select * from {{ source('s... |
DBT - Using SELECT * in the staging layer |
No options:

Installed packages:

Hi, I just downloaded Visual Studio 2022 and can't seem to find the add options, specifically add controller when I right click on add as shown in picture. I have ins... |
Firstly, Change `CMD ["java", "-jar", "./build/libs/app.jar"]` to
```
SHELL ["/bin/bash", "-c"]
CMD "java -jar ./build/libs/twitch-bot-*.jar"
```
As you noticed the output file is not called `app.jar` but instead as named as gradle does, roughly `{NAME}-{VERSION}.jar`. Changing to [shell format][1], while setti... |
I have this simple playbook that reads a file content => fetches a value
=> append that to a local file,
I want to get a config value for different hosts stored in a local file.
```yml
---
- name: Check file content
hosts: all
become: true
tasks:
- name: Check if file exists
ansible.bui... |
I work in a windows form application. i wanna make a setting page for my program. in this form i have music for the total of my program and i have sound for my button, it sounds when you click on a button. i can off them and on them. my problem, is sounds of buttons. when i off the sound in the setting and it just off ... |
Was going thru unit of work pattern, with EF Core - if the work unit is large and involves 3,4 entities, will it slow down the performance, because it will have to take 3,4 db round trips and update each entity ?
Trying to search but did not get much links on this |
|sql|optimization|dbt|staging-table| |
1. The map draw polygons and markers but the polyline is not showing, the code is the following:
```
GoogleMap(
onMapCreated: _onMapCreated,
onCameraMove: _onCameraMove,
onCameraIdle: _onCameraIdle,
polygons: getPolygonList(zonesCubit.state.zone... |
The Polyline is not showing in flutter but the directions api is enabled and the current position is not updating |
|flutter|google-maps|google-maps-flutter| |
null |
I have the basic tier of Azure Analysis service. I am trying to connect to a Blob storage container that is in the same VNET as the Azure Analysis Service.
I have set up an "on prem gateway" on a VM in the same vnet and am able to connect to the blob storage and pull a test file that is of size 18Bs.
The actual ... |
Will it slow down the performance when Unit of work pattern is used with EF core |
|c#|entity-framework|design-patterns| |
null |
After contacting the OneSignal support, they have answered clearly that they removed this scheduling notifications functionality from OneSignal Flutter SDK starting from version 5, quoting from their support email:
> With that said, with the migration to version 5, we have removed the ability to send push from the S... |
I am currently trying to use SetDisplayConfig from winuser.h to immediately apply a "Preserve aspect ratio" display scaling mode for the active display mode, but I can't seem to get the settings to apply. I've tried many things, but nothing works. Can anybody point me in the right direction to implement this? Any help ... |
How to immediately apply DISPLAYCONFIG_SCALING_ASPECTRATIOCENTEREDMAX display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO |
|c++|winapi|windows-10|implementation|windows-11| |
null |
You can do it by creating a function that changes the `fontSize` and add it on the `LocalStorage` every time a person clicks on it.
After that you can use the `window.onload()` to always check, when the page loads, if there is any `fontSize` on the `LocalStorage` and set it if there is.
Example:
**HTML**
... |
I think "%s" are expecting additional string arguments, but you have only provided "sAux", "s1", and "s2". You should remove the extra "%s from the format string. Here's the code:
String sAux = getResources().getString(R.string.ShareText);
String s1 = "https://play.google.com/store/apps/details?id=";
... |
I wrote a small python package that finds both the min and max value of an array fast:
https://github.com/nomonosound/numpy-minmax
Here's how to use it:
`pip install numpy-minmax`
```
import numpy_minmax
min_val, max_val = numpy_minmax.minmax(arr)
```
The algorithm is written in C and is optimized with ... |
I am having issues with my SQL statement below. The `NOT LIKE` and `OR` statement is producing `FALSE` statements, in that it is producing the output when it should not, since I am using a `NOT LIKE`. When I put the statement as a stand-alone (*without* the `OR` condition), it works as intended.
For example, I am s... |
In Vim, `<CR>` refers to the "Carriage Return" key, which is essentially the Enter or Return key on your keyboard.
So the sequence for jumping to the fist instance of `foo`: [Esc] -> `/foo` -> [Enter] -> `i`
In case you need 3rd instance of `foo`: [Esc] -> `/foo` -> [Enter] -> `n` -> `n` -> `n` -> `i`
General ... |
I am new to React & I have a bootstrap switch checkbox and for me the value is getting saved in the mongodb but my problem is when I open the document again, the checkbox is not in the position where it was last updated.
If I updated the document while it is true it wont be

99 5 -1.2250E-3 -3552 1050 -110
... |
MCNP 6 - Doubts about cells |
|algorithm|montecarlo| |
null |
The point of the `<const>` local variable attribute is to allow Lua to check, at "load" time (when you call `dofile` / `load` / `require` or similar), whether a local variable is not being mutated - that is, whether the only assignment is the initial one at declaration time. It is a tool to help programmers (1) express... |
Making canvas background transparent |
I want to display Geojson data on a map to draw polygons and points
I used Flutter_map library: ^4.0.0
I tried converting from geojson to latlng and did not find a way
The libraries that should help me are very old
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometr... |
View Geojson on flutter_map |
|flutter|dart|dictionary|geojson|fluttermap| |
null |
For me, adding an `autoFocus` prop did the trick:
```html
<input autoFocus {...} />
``` |
I am performing unsupervised clustering with PCA.
The first 7 Components contain 50, 13, 9, 8, 5, 3, 3% of the variance.
There is no feature that stands out in PC1. However there are some stand out features in the remaining PCs in terms of the loadings.
When I compare my results to the ground truth, the cluster... |
Principal Component Analysis and Clustering - Better Discrimination between Classes |
|cluster-analysis|pca| |
null |
|typescript|react-native| |
null |
|reactjs|typescript|react-native| |
I dont know if this will help but maybe there's a problem in matching the frontend routing in you 'response'.
const response = await api.get('/dog-profile/dogprofile', {
headers: {
'x-auth-token': token
}
try removing /dog-profile |
1. I have a table of groups.
2. I'm searching for a way so that "Group 2" will get updated when "Group 1" changes.

Please note that
* I want this without any Script or HelperColumn.
* I don't want to use Named Ranged in dropdown criteria. (a... |
1. I have a table of groups.
2. I'm searching for a way so that "Group 2" will get updated when "Group 1" changes.

Please note that
* I want this without any Script or HelperColumn.
* I don't want to use Named Ranged in dropdown criteria.
(... |
Azure Analysis Service, with an on prem gateway, in vnet |
|azure|powerbi|azure-application-gateway|vnet| |
You can set the encapsulation strategy using **ViewEncapsulation.None**.
**Beware**:
> The styles of components are added to the <head> of the document,
> making them available throughout the application, so are completely
> global and affect any matching elements within the document.
To avoid that, you ca... |
> Do you have any clue how to achieve this in MySQL?
Yes, go by foot and make the xml yourself with `CONCAT` strings. Try
`SELECT concat('<orders><employee emp_id="', emp_id, '"><customer cust_id="', cust_id, '" region="', region, '"/></employee></orders>') FROM table`
I took this from a 2009 answer [How to co... |
```
def quickSort(arr):
if len(arr) <= 1:
return arr
pivot = arr[int(len(arr)/2)]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quickSort(left) + middle + quickSort(right)
def binSearch(sorted_arr, target):
cen = i... |
Binary Search Error while trying to search through list |
|python|binary-search| |
null |
Windows 11
I would like to filter double values.
[![enter image description here][1]][1]
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/ZckkI.png
[2]: https://i.stack.imgur.com/ICCrr.png
1. testo = text
2. numerico = numeric
3. valuta = currency
... |
I can't load two static images into a container via DecorationImage
[![][1]][1]
I tried to load through an additional column, but in my opinion this is very bad for the developer. Perhaps there is a better result
```
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '... |
null |
> I think it probably requires to use index_sequence but I'm not sure
> how.
Yes, it's very easy to do this using `index_sequence`:
template<typename... Args, std::size_t... Is>
void foo(const Args&... args, std::index_sequence<Is...>)
{
using typeLists = std::tuple<Args...>;
bar... |
I have one GET API which is having array in the input.
I want to call that API through in my node.js project.
I have tried many options but none worked.
This is my REST Request.
let request = await Request.get(
`url?arr=1234,1235`,
{
headers: {"Content-Type": "application/json" }
}
... |
To change the arrow size in the React application using the `react-sigma` library, you need to directly manipulate the Sigma.js instance to apply custom settings. Here's how you can do it:
1. **Extend Sigma.js with Custom Settings**: You need to create a custom Sigma.js component that extends the functionality of `S... |
Dears...this is part of my chatbot.when user click button nothing happens.please help
import streamlit as st
from streamlit_chat import message
if user_input := st.chat_input("You:"):
st.write(f"User: {user_input}")
bot_reply = "Test bot reply"
st.write(f... |
button click not working inside if statement |
|if-statement|checkbox|onclick| |
I have read about `notnull `constraint in C# and it was written that "This allows either value types or non-nullable reference types but not nullable reference types."
I tried checking this constraint in the code below:
```
MyTestClass<int?> instance1 = new MyTestClass<int?>();
MyTestClass<string?> instance2 = ... |
C# notnull constraint with nullable types have unexpected behavior |