instruction stringlengths 0 30k ⌀ |
|---|
|arcgis|census| |
null |
I have setup a postgres:13.3 docker container and scram-sha-256 authentication.
Initially, I ran:
```
docker run -d --name my-postgres13 -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=fbp123 -e POSTGRES_DB=mydb -e POSTGRES_HOST_AUTH_METHOD=scram-sha-256 -v pgdata13:/var/lib/postgresql/data postgres:13... |
In GLSL I iterate over a float buffer, that contains the coordinates and a couple properties of elements to render. I was curious about shaders (don't have much experience with them) and wanted to obsessively optimise it. When looking at how it gets compiled (I'm using WebGL+Spector.js), I notice that in the loop where... |
Usually using a variable is an additional overhead, but in your case Chrome was able to provide the same performance. But if a variable is reused, that could actually boost performance. So the rule could be - don't create unnecessary variables.
Also note that JS engine could optimize code while compiling so in reali... |
The data returned from `useSearch` needs to be an array in order for you to map it, so in your `useSearch` hook you need to only get the `value` array if you want to only render the results.
```javascript
// in useSearch hook
// we only take the array of webpages value
// looking from your console.log screenshot... |
I have been learning python for about a year. I need to understand using unicode glyphs. In particular. In particular this set: https://unicode.org/charts/PDF/U11D60.pdf
I tried this and when I tried to print it, i didn't get the expected glyph;
```
a = '\u11D72'
print(a)
```
I'm using vscode on a mac. What... |
Question about unicode assignments in python |
|python|macos|python-3.11| |
Call [`Language.Haskell.TH.Syntax.addDependentFile`](https://hackage.haskell.org/package/template-haskell-2.8.0.0/docs/Language-Haskell-TH-Syntax.html#v:addDependentFile), then [wait for this cabal issue to get fixed](https://github.com/haskell/cabal/issues/4746).
As a workaround, you can add a comment to some relev... |
I follow the Nicholas Renotte tutorial "Build a Deep Facial Recognition App"(Python). But at the part 4 I faced a problem, here is the code:
# Siamese L1 Distance class
class L1Dist(Layer):
# Init method - inheritance
def __init__(self, **kwargs):
super().__init__()
# Magic happens here ... |
WebSecurityConfigurerAdapter is deprecated now (spring security 6.0 and higher)
So we can rewrite the above code as
@Configuration
@EnableWebSecurity
public class SecurityConfig{
public SecurityFilterChain
filterchain(HttpSecurity http) throws
Exception {
http.authorizeRequest... |
error CS0029: Cannot implicitly convert type 'System.Threading.Tasks.Task<Firebase.Auth.AuthResult>' to 'Firebase.Auth.FirebaseUser'
public void OnClickSignIn()
{
Copy
FirebaseAuth auth = FirebaseAuth.DefaultInstance;
Debug.Log("Clicked SignIn");
string emailText = emailSignin.GetComponent<TMP_InputFi... |
Cannot implicitly convert type 'System.Threading.Tasks.Task (firebase) |
|c#|visual-studio|unityscript| |
null |
In my case since I had 30+ other tables with data I wouldn't afford to lose, what I did is,
1. I backed up and deleted the `migrations` folder from the app containing the table
2. I Deleted the `django_migrations` table
3. I created a new database and changed the project database to the new database
4. I run Djan... |
I am trying to figure out how possibly I could reuse the tabview with textboxes in my GUI python app using CTK. My current approach deletes all tabviews and creates new one with textbox to fill with data.
This is very problematic since it really distorts and lags my GUI everytime tabviews are re-created. I am lookin... |
I wanna see my look id in corresponding bigquey job labels. My objective is to efficiently track Looker queries within BigQuery. Could you please provide guidance on achieving this integration? Thanks |
Can i add new label called looker-context-look_id in BigQuery connection(Looker) |
|python|google-bigquery|looker| |
I believe this will work in `2010`:
B1: =IF(A1="Name","Group",IF(A2="Name","", INDEX($A$1:A1,LOOKUP(2,1/($A$1:A1="Name"),ROW($A$1:A1))-1)))
and fill down.
***Algorithm***
- If the adjacent cell in Column A = "Name" then enter "Group"
- If the next cell down in column A = "Name" then leave a blank
- ... |
I have a script to send an email with mailR. So far so good.
But when I want to add a folder as an attachment, then it won't send the mail (the script is fine and there's no error).
The name of the file in my folder change every week, so the attachment has to be the folder name and then it must send the file in it. ... |
R script (mailR) all files from folder as attachment |
|r|email|attachment|send| |
null |
I'm writing a bot to "archive" messages (move them but keep details of author etc) and threads to a specified channel based on date(s).
I'm nearly there but I can't see how to delete the thread that is posted under the channel name:
[Screenshot](https://i.stack.imgur.com/mPyPc.png)
I can delete the messages in t... |
{"Voters":[{"Id":1745001,"DisplayName":"Ed Morton"}],"DeleteType":1} |
Delete defaultProject from angular.json file if it exists.
defaultProject has been deprecated.
See https://github.com/angular/angular-cli/issues/11111 |
I own a vps. There we have three minecraft servers and one discord bot. we also have a local mongoDB running on the vps. I have connected to it using node.js mongoose library. I am talking about the discord bot in this case. When I create documents in the mongodb, it works, and the code reads everything. Suddenly, afte... |
Hibernate: JOIN inheritance question - why the need for two left joins |
|sql|hibernate|join|hibernate-mapping| |
guard let url = URL(string:"https://blaaaajo.de/getHiddenUsers.php") else { return }
let postString = "blockedUsers=245,1150"
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = postString.data(using: String.Encoding.utf8);
do{
... |
I'm having problems setting up HTTPS in my Spring Boot application. The application is hosted on an AWS EC2 server with Ubuntu 20. When I try to access the application via Postman using HTTPS, I get a timeout in the server response.
Spring Security configuration:
```java
@EnableWebSecurity
public class SecurityCo... |
I have a dataset which contains the order, species, and various trait data of species of birds. I am trying to make it so it only keeps data on certain orders. Normally when I am subsetting by species I merge datasets so that only those with the same row names, i.e. species names, are kept in the new data frame, but it... |
The `graphiql` endpoint is available with this dependency `spring-boot-starter-graphql`. Keep the following dependency only in pom.xml for graphQL and enable the graphiQL in `application.properties` with the following line `spring.graphql.graphiql.enabled=true`.
```
<dependency>
<groupId>org.springframework.boot<... |
Either explicitly close the output file:
```js
const dsGeoJSON2 = gdal.open('./upload2/objects.geojson');
const out2 = gdal.vectorTranslate(
'./upload2/objects.dxf',
dsGeoJSON2,
['-f', 'DXF']
).close();
```
either simply quit the program.
The flushing/closing of the file runs when the GC collects... |
When I use Xcode15 create complications with Apple Watch, `getLocalizableSampleTemplate` not display as expected, how to fix this error?
Expect the code to show the actual effect (without using the WidgetKit framework)
```
func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handl... |
You don't need to access in `shadow-root` on newly opened tab. Saving pdf file is much easier, using Chrome driver options.
You can just pass preferences to chromedriver that will automatically save your pdf file to directory on print actions.
```python
import json
import sys
import time
from selenium import ... |
Keras similarity calculation. Enumerating distance between two tensors, which indicates as lists |
|python|tensorflow|machine-learning|keras| |
null |
{"Voters":[{"Id":3889449,"DisplayName":"Marco Bonelli"},{"Id":9952196,"DisplayName":"Shawn"},{"Id":3440745,"DisplayName":"Tsyvarev"}]} |
Needed some help on the ZKA security scheme as explained below:
1. In deriving session key, it says to use ZKA master key, random number and control mask. Any idea how control mask value is constructed. I believe its same for all transactions but how is it constructed for PAC?
2. Is control mask and control vector... |
HSM ZKA control mask values |
|security|hardware-security-module| |
null |
The 'shaky' hover problem arises because as the element moves up it is no longer hovered, so it comes back down and then it's hovered again and so on....
This snippet moves the hover up one level so hovering on that causes the top card to move up but the hover remains on the parent.
<!-- begin snippet: js hide: f... |
I'm student in practicing PintOS Project.
In Programming Project 3(Virtual Memory), I got ploblems about "preprocess in compiling" (C program).
I had tried all attempt that do my best, but I'm absolutely lost at this point on how to fix it.
Finally i come to here, had to ask you about this issue.
**error**
T... |
{"Voters":[{"Id":1773237,"DisplayName":"Hhovhann"}],"DeleteType":1} |
I have a domain specific JSON object for which I want to store in a vector db. I would be using embedding models like sentence=transformer or openai's text-embedding-002.
Questions are:
a) Can these models efficiently compute proper embeddings for these json objects?
b) Even if they can compute embeddings how eff... |
How do I embed json documents using embedding models like sentence-transformer or open ai's embedding model? |
|openai-api|large-language-model|sentence-transformers|openaiembeddings| |
This would best be accomplished in the following manner:
- Set the `background-color` of the body to what you want the bottom half to be.
- Set the `background-color` of the element and give it the `clip-path`.
This will ensure you always have the nice separation.
<!-- begin snippet: js hide: false con... |
Try this.
> Map(`[<-`, my_list, '.k', value=lapply(my_list, `[`, 'id') |>
+ unlist() |>
+ duplicated() |>
+ split(sapply(my_list, nrow) |> {
+ \(.) mapply(rep.int, seq_along(.), .)
+ }())) |>
+ lapply(subset, !.k, select=-.k)
[[1]]
... |
When a user right-clicks and drags a file into a different directory, they are presented with a small context menu that includes entries such as **Copy here** and **Move here**:

Is there a way to query these items yourself. I'm already doing this for the regular right... |
I am busy with creating a REST API where you can load company details and then load products for each company, each with their own enpoints
POST /company-details
POST /products
Company details have details in a request body as
companyName
uniqueCode
description
contact
location... |
I used to develop a simple price tracking application for myself with Android Studio. I paused my project for few month and got back to it recently. I noticed that my application is crashing on startup with nothing in the logcat.
I use my personal phone for development, tethered with USB, Xiaomi Android 13.
What is... |
Android studio crash, nothing in logcat |
|android|kotlin|android-studio|adb|logcat| |
We can do that with a [lifecycle precondition][1] in a null_resource
A couple of things before we dive into the code:
- Your code has two `sc1_default` variables I'm assuming that the second one was a typo and it what we need there is `sc1_default`
- For additional validation use `type` in the variables, it's a go... |
How do I keep only specific rows based on whether a column has a specific value? |
|r|subset| |
I am developing a .Net 8.0 application, using Repository pattern and database first approach.
Program.cs file:
```
builder.Services.ConfigureRepositoryManager();
builder.Services.ConfigureSqlContext(builder.Configuration);
```
ServiceExtensions.cs file:
```
public static void ConfigureRepositoryManager(th... |
Repository manager receives the wrong connection string in .net core |
|c#|.net|.net-core|repository-pattern| |
null |
As shown below, within the mqst environment, there are two different python binary files: python and python3. But they have the same version, being 3.12. If I do
```
which python
```
I get the python file path. And I will get the python3 file path if I do
```
which python3
```
Does anyone knows why this is th... |
Conda has two different python binarys (python and python3) with the same version for a single environment. Why? |
|python|anaconda|environment|miniconda| |
null |
`systemctl` is systemd, which is Linux only.
`brew services start mariadb` is for MacOS.
[ref](https://mariadb.com/kb/en/installing-mariadb-on-macos-using-homebrew/) |
I switched from `VCL` to `Firemonkey` frame work and I noticed that `TGrid`/`TStringgrid` doesn't have multi select option in it. However, all I could find is these 2 articles
https://www.developpez.net/forums/showthread.php
https://www.tek-tips.com/faqs.cfm?fid=6650
but they seem to be outdated.
I want to ... |
Working on a class library I´d like to add logging to a number of classes. I use `Psr\Log\LoggingInterface` to give the classes access to a logger object. But how do I set the logger in all classes in a decent way. There is a dependency to the logger as it is being used everywhere in the classes
I can use
## Cons... |
How to add logging to an abstract class in php |
|php|oop|dependency-injection| |
There's no nice way of combining optionals in situations like this.
You could possibly look at `Optional.ifPresent` if you like lambdas;
```
usrDb.ifPresent(u -> {
roleDb.ifPresent(r -> u.getRoles().add(r));
}
```
Alternatively use `Optional.isPresent`
```
if (usrDb.isPresent() && roleDb.isPresent()) {... |
Can someone explain me why i get error " INSERT statement conflicted with the FOREIGN KEY constraint "FK_ArticleTag_Tags_ArticleId". The conflict occurred in database "Blog", table "dbo.Tags", column 'TagId'".
```
public class Article
{
public Article()
{
Comments = new HashSet<Comment>();
... |
Entity framework 8 dbcontext - cant some rows in many to many relationship |
|entity-framework| |
null |
*There is very good post about trimming 1fr to 0: https://stackoverflow.com/questions/52861086/why-does-minmax0-1fr-work-for-long-elements-while-1fr-doesnt*
In general I would like to have a cell which expands as the content grows, but within the limits of its parent.
Currently I have a grid with cell with such ... |
MongoDB documents are randomly deleted after a few hours |
|node.js|mongodb|discord.js| |
null |
I'm writing a bot to "archive" messages (move them but keep details of author etc) and threads to a specified channel based on date(s).
I'm nearly there but I can't see how to delete the thread that is posted under the channel name:
[Screenshot](https://i.stack.imgur.com/mPyPc.png)
I can delete the messages in... |
here you are creating a Python array by the statement <br>
`[torch.sin(theta)*torch.cos(phi), torch.sin(theta)*torch.sin(phi), torch.cos(theta)]`<br>
if you want to perform a multiplication on this you may have to convert the list into a torch tensor
you can do this by <br>
`torch.tensor([torch.sin(theta)*torch.c... |
{"OriginalQuestionIds":[21697188],"Voters":[{"Id":6196568,"DisplayName":"shingo"},{"Id":7733418,"DisplayName":"Yunnosch"},{"Id":9214357,"DisplayName":"Zephyr"}]} |
I have an error message that I understand, but I don't know how to resolve it. The 'add' call works without HTTP and 'rxMethod.' However, this method cannot be loaded outside of the constructor. What am I doing wrong?
addEntity: (entityToPush: entity) => {
return rxMethod(pipe(
ta... |
Create Entity with signalStore and rxMethod |
|angular|signals|ngrx|store|angular17| |
I got the same error and as @andrew suggested opening a new terminal after installing helped me. Just posting here if anyone comes across this issue. |
I created `person` table as shown below:
```sql
CREATE TABLE person (
id INTEGER,
name VARCHAR(20),
age INTEGER
);
```
Then, I created `my_func()` which returns the record `ROW(1,'John'::VARCHAR,27)` as shown below:
```sql
CREATE FUNCTION my_func() RETURNS trigger
AS $$
BEGIN
RETURN ROW(1,'Jo... |
null |
I switched from `VCL` to `Firemonkey` frame work and I noticed that `TGrid`/`TStringgrid` doesn't have multi select option in it. However, all I could find is this article(2013 release)
https://pictoselector.wordpress.com/2013/05/28/adding-multiselect-to-firemonkeys-tgrid/
but they seem to be outdated.
I want to ac... |
when i try to launch the jar file that i build from my kotlin program on desktop in the intillij IDE it work perfectly but when i try to run it using JAR with the terminal it show me this error
"Exception in thread "main" java.lang.NoClassDefFoundError: io/github/jan/supabase/SupabaseClientBuilder
at org.mai... |
getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError" |
|java|kotlin|gradle|desktop|supabase| |
null |
I am currently trying to make a Discord Bot with Python which when authenticated with a user is able to join the user onto a server. This is the guide I followed: https://dev.to/dandev95/add-a-user-to-a-guild-with-discord-oauth2-in-python-using-requests-595f
Sadly, it did not work. Therefore I changed the code a bit a... |