instruction stringlengths 0 30k ⌀ |
|---|
The table is not creating and i dont want to use declarative_base and alchemy.orm
i was told to use class but i don't know how to arrange it
class Tables():
def __init__(self, engine, metadata, table, name, age, location):
self.engine = sqlengine
self.metadata = sql_metadata
... |
|html|css|css-grid|margin|card| |
You can set it just after creating an instance of your custom calendar class. It should work.
I mean;
# Create an instance of your custom calendar class
my_calendar = Calendar()
# Set the first weekday to Sunday
calendar.setfirstweekday(6)
|
I believe that officially the best solution here would be Stripe apps, as it allows you to customize your access to the account with the [app manifest][1] permissions.
I don't think Connect is a good idea in this situation, for two reasons:
- You will have unlimited access to all objects from the account, which I... |
I want to know about best practices with C, in creating a API connection wrapper, I have credentials and a variety of non-security related global variables. This will be in a public git repository so I don't want to expose sensitive data. However, I need the security data at compile time, not just at runtime. I see ... |
Is it best to declare global variables in a header file or environment file in a C project |
|c|security|environment-variables|global|gitignore| |
My php script runs fine if I fetch the mysqli result as StdClass. But, I run into random "out of memory" issues when i cast the mysqli result to a user-defined class.
**This always works fine:**
```
while ($O = $result->fetch_object()) {
$papers[$O -> id] = $O;
}
```
**But this causes an out of memory e... |
How to rework rolling sum using Numpy.strides? |
|python|numpy| |
def prompt_for_angles(angle_name: str) -> float:
try:
angle: float or None = float(input(f"Angle for {angle_name}: "))
while not (0 < angle < 180): # while input is NOT correct
print("Invalid. Please enter an angle between 0 and 180")
angle: float or None = float(in... |
I would try something like
```
@AutoConfiguration
@EnableJpaRepositories("com.acme.library.repository")
@ComponentScan
public class AutoConfigure {
// intentionally left empty
}
```
|
As the warning states, you can use an `A` element or other elements that rely on the router API under a Router component.
So, moving the Router component in a way to wrap the `A` elements like shown below should solve your problem:
```typescript
function App() {
return (
<Router>
<Header />
... |
That solution did the trick to get a right arrow button. I wanted this to be dynamic so I could reuse it across multiple projects and easily adjust the width and height of the button. I was able to use CSS variables to do the calculations to modify the button according to the base width and height.
See live demo her... |
|python|arrays|numpy|scipy|numerical-integration| |
|scala|pagination|amazon-dynamodb|implicit|scanamo| |
null |
You should use `divmod` for this. `divmod` will give you the results of floor division and modulo, in one line.
```
x = int(input('Enter your number: '))
out = []
# As long as x is greater than 0
while x:
# Assign x with x divided by 2
x, xm2 = divmod(x, 2)
# Output x modulo 2
out.append... |
i have a Steam Deck and would like to install GLFW on a Steamdeck, so that VSCode can find the Libary, i use Cmake. I used Cmake on another linux machine with no problems. I think its related to the steam deck and steam os.
I a location in with the following files in usr/lib/cmake/glfw3 :
- glfw3Targets.cmake,
-... |
Try to Install GLFW on Steam Deck |
|opengl|cmake|include|glfw|steamos| |
null |
I was requested to look into using Apache Spark's MemoryStream to simulate a Kafka stream in a Java Spring Boot service. The documentation / online community is a bit small on this topic so I am seeking aid.
This is my implementation code.
```java
final DataStreamReader kafkaDataStreamReader = kafkaLoader.getStre... |
The string in green is of the format `<username>@<hostname>`. So in order to differentiate between your two servers, you need to change the hostname, to give you something like `ubuntu@ubuntu-slave`.
To do this, you need to add the [hostname configuration option][1] to your Vagrantfile:
```ruby
Vagrant.configur... |
I have specified a @Retryable annotation in a spring bean like below.
```
@EnableRetry
@Import({GrpcClientRetryConfig.class})
@Retryable(interceptor = "grpcClientRetryInterceptor", label = "ProfileGrpcClient")
public class ProfileGrpcClient {
public RateLimitConfig getRateLimitConfig()
```
```
@Compone... |
Why does MSVC never return struct in RAX for member-functions? |
|c++|assembly|visual-c++|x86-64| |
For windows being processed by a reduce function, the state involved should be just a single object (per key, per window), so hopefully the total volume of state involved won't be outrageous.
You can always use the RocksDB state backend, in which case the state will be kept on disk, with the active state in off-heap... |
`package:meta` provides a [`@nonVirtual` annotation](https://pub.dev/documentation/meta/latest/meta/nonVirtual-constant.html) to disallow overriding methods.
Note that annotations just provide *hints* to `dart analyze`. They won't actually prevent anything from violating the annotations, and they instead will cause... |
|java|swing| |
I don't think the symbol has a specific name, it is definitely a Sigma, just barred.
If you want to draw this in LaTeX, you can use the math versions of the `\Xlap` commands (where `X` is one of `l` `c` `r`) offered by the `mathtools` package, that allow printing a symbol without it taking any actual space.
Here I ... |
I have a makefile as follows
```
do-something:
sh ./Scripts/do-something.sh "$(name)"
```
and running it as follows:
```
make do-something name=Foo
```
calls the script as expected.
```
sh ./Scripts/do-something "Foo"
```
**The problem:**
The script also takes a couple of optional arguments, `--noB... |
Passing optional arguments from makefile to shell script |
|bash|makefile|zsh| |
Recently, I received a new requirement to import case data into Oracle's Argus system, but I can't proceed at all (unless I disable triggers). The main table for cases is CASE_MASTER, but when I insert data into it, even though I pass in ENTERPRISE_ID, it tells me that it cannot insert NULL into the ENTERPRISE_ID field... |
Restoring Postgres database using earthdistance, type "earth" does not exist |
|postgresql|search-path|earthdistance| |
Seriously, question exists five years and no nice facade?
import {lstatSync} from 'fs';
/**
* @param {string} path - The path.
* @returns {boolean} Whether path is a directory, otherwise always false.
*/
function isDir(path) {
try {
const stat = lstatSync(path);
... |
I have been unable to find out why on some projects the design screen will not show up. I have noticed that the buttons code, split, and design are available when the .xml file is selected. On some projects, these buttons show up when the kotlin file is selected. Found answers that suggest to clean the project, rebuild... |
|android|android-studio| |
## Context
I created a Lanterna TUI which works perfect on Ubuntu, and I am testing it on Windows 11. When I run the command with `javaw`, a separate terminal is created that is glitches as soon as one moves the cursor. Hence I tried to add JNA and jna-platform to the classpath. However the JNA is not being recognised... |
Let us construct a single command for switching both options accordingly
at once. First of all, it should toggle the `wrap` option anyway:
:set wrap!
Then, `guioptions` should be changed depending on whether wrapping is
enabled at the moment of command's execution. If text is wrapped, the
bottom scrollbar s... |
im Trying to Learn SQL But :) its not easy :D
Well i nead a Code to Look fore Value1
if value 1 is Pressent Then Paste Value2 In Collum X
so Exampel time
```
Tabel 1
Collums /ID/FIRST-NAME/LAST-NAME/PLACE/AGE/DO LIKE CAKE/
/1/Allan/Jakobsen/Germany/25/NULL/
/2/benny/Jakobsen/Denmark/65/... |
I'm planning to do canary/Blue-Green Deployment in AWS ECS.
How to route the specific set of 10 % users to canary and I don't want those 10% users to go back to base line environment. Those 10% users should always be with canary version. Rest 90% users in production environment. If we use R53 or Load balancers it will... |
Canary deployment using spinnaker in AWS ECS |
|amazon-web-services|amazon-ecs|continuous-deployment|aws-application-load-balancer|spinnaker| |
null |
We have a Xamarin iOS app that is building in DevOps pipeline using the XamariniOS@2 task. This worked quite fine for many years until a number of months ago when we changed vm image so we could update the xcode version to 14.2 to support iOS 16+. Since then, installs to devices fail due to the error:
```
Applicati... |
What changed from xcode 13.2.1 to 14.2 that would affect an app's entitlements? |
|ios|xcode|xamarin|azure-pipelines| |
null |
This is my first time make a post in here and appreciate any suggestion first!
Basically, I got two table that one is Incremental table and the other is Final table.
In the first day loading, Incremental table is like below
| ID | Code |
| --- | --- |
| 1 | A |
| 1 | B |
| 2 | C |
Therefore, Final table... |
Using MemoryStream to simulate Kafka stream |
|apache-spark|apache-kafka|spark-structured-streaming|memorystream|spark-java| |
|cmake|glfw|steamos| |
I am setting up a aurora postgres database and a rds proxy associated to the db, but I cannot connect to that db through the proxy.
So I was checking some basic configurations. Such as subnet routes table, security group inbound and outbound rules and Network ACLs, everything seems good, like shown in the screen sho... |
Cannot connect to the aurora postgres database through RDS proxy |
|postgresql|amazon-aurora|amazon-rds-proxy| |
null |
|r|function|error-handling|syntax-error|numerical-integration| |
I have the following view model:
```
@MainActor
final class ProfileViewModel: ObservableObject {
let authService: AuthService
@Published var userHandle: String = "Unknown"
nonisolated init(authService: AuthService, appState: AppState) {
self.authService = authService
appState.$userData
... |
Given a daily fact table, I want to create a measure for YTD sum (by month), but only summing the last available observation for each month.
The layout looks like:
[![enter image description here][1]][1]
using the `Date` date table to select a particular month, the `Date Copy` table to display each month for t... |
YTD sum by month, using only latest value for each month |
|powerbi|dax| |
I work on a symfony app that i elaborate on a distant server. My friend that developps the same app encounters a timeout when he launches the dev server and changes the url to the ip adress of the server. While i don't. Everythings works fine for me. The behavior is strange because when i launch the command symfony ser... |
Developping on a distant server an app symfony |
|server|symfony6| |
null |
```
public class Animal {
public Animal() { System.out.print("Animal"); }
public Animal(int age) { System.out.print("AnimalAge"); }
private boolean hasHorns() { return false; }
public static void main(String[] args) {
Animal animal = new Elk(5);
System.out.println("," + ... |
If I compile "Test.cpp" with "g++ -o Hello_World Test.cpp", I get "Hello_World.exe". If I run "g++ -o Hello_World Test.cpp" again, I get a collect 2 error.
[Collect 2 error during compiling](https://i.stack.imgur.com/lg6xP.png)
The goal is to compile Test.cpp into Hello_World.exe (but two times in a row). Here ar... |
Why does the .exe file become locked after compiling? |
|c++|compilation|collect| |
null |
would like to know, how I can connect my `strapi` project (that I have on my `github` and have deployed it on `railway.app`) with a `PostgreSQL` database that I also created on `railway.app`.
So far I have tried to use the variables on my `strapi` project (on `railway.app`):
ADMIN_JWT_SECRET *******
*******
API... |
Only past in Rows With Certen value |
|sql| |
null |
```
import React, { useState, useEffect } from "react";
import { Stage, Layer, Circle, Rect } from "react-konva";
import Konva from "konva";
import ColorPicker from "./ColorPicker";
interface Ball {
id: number;
x: number;
y: number;
radius: number;
color: string;
vx: number;
vy: number;
... |
When i move the mouse, the animation does not move at full screen, but when i am calling the console via f12, the reaction to the mouse works |
|reactjs|animation|canvas| |
null |
null |
How can I create an executable (from a JAR) with the --enable-preview option in Launch4J? |
{"Voters":[{"Id":20287183,"DisplayName":"HangarRash"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":162698,"DisplayName":"Rob"}]} |
There isn't actually an answer to this question yet, so I though I would add one for future reference.
The Common Locale Data Repository (CLDR) contains exemplar data for most defined locales available in CLDR. Exemplar data incluses the main/standard exemplars, i.e all the characters needed to write the language. A... |
If the id is dynamic and you can't use it, you can use class to select the element.
Your html element has `collapsed focus-visible` class.
If you don't want to use it, and rather use __filterButton__, you should edit your html and add __filterButton__ to classes.
(currently on your html, 'filterButton' is not de... |
Try this css code:
div.label ~ select
It returns any selects that are preceded by a div with class label. |
The easiest way to do this is to [set up a time-to-live policy](https://firebase.google.com/docs/firestore/ttl) on the collection that deletes documents after the date/time specified in a certain field of each document. Then in your code, add an additional field with the date/time two weeks into the future, and the pol... |
null |
Mac M1, Docker version 25.0.3
I enjoy a good keyboard shortcut. The most useful of my shortcuts so far has actually turned out to be simply opening specific applications with one press: "hyperkey + V" opens VS Code, "hyperkey + t" opens terminal, etc. i have found this approach to be much more useful than using "cmd... |
Open Docker Dashboard using keyboard shortcut |
|docker|macos|docker-compose|docker-container|docker-command| |
null |
I'm trying to make a button that has an image background and text. The text should be invisible and the bg image should be opaque. When you hover the button, the background should go black and the text appear at the same time, with a fading transition, but I cant get only one to display at a time.
I tried adding the... |
Background image of button disappears when I add text? |
|javascript|html|css|user-experience|mousehover| |
null |
How to resolve this Incremental loading with SQL? |
|sql|mysql|postgresql| |
null |