Random snippets of all sorts of code, mixed with a selection of help and advice.
OpenIddict: Access and Refresh tokens generation
25 April 2026 @ 9:47 pm
I am using OpenIddict for authentication and authorization.
I would like to know if it's possible to log in a user during the account creation process.
The desired flow:
User hits POST /auth/register → account is created → server returns an access token and a refresh token (identical to the response from POST /connect/token).
My assumption is that I need to somehow trigger the token issuance pipeline. The only approach I can think of is making an internal HTTP call to /connect/token, but I don't think that's a correct or viable solution.
According to this thread: https://github.com/openiddict/openiddict-core/issues/1241, it seems possible to generate an access token programmatically, though it
Satellite Imagery Updates on Google maps
25 April 2026 @ 9:32 pm
Subject: Inquiry Regarding the Integration of Aerial Drone Imagery
To Whom It May Concern at the Google Maps Team,
I am writing to inquire about the possibility of integrating my high-resolution aerial drone photography into the Google Maps platform. Could you please outline the necessary steps, technical guidelines, and submission processes required to contribute this type of imagery? If my request falls outside your immediate purview, I would greatly appreciate it if you could refer me to the appropriate department or specific point of contact that handles aerial data contributions and third-party imagery partnerships. Thank you for your time and guidance.
Vlookup function syntax between two sheets
25 April 2026 @ 9:24 pm
Using lookup function on Google sheet, I always run into an error message after typing the syntax of what I want to do. Can anyone please tell me what is wrong. I have check my settings and everything thing is in order, yet I keep receiving the error message. I am stuck please and need help
Can I make a Docusaurus v3 theme with a small variation from an existing theme?
25 April 2026 @ 9:24 pm
Specifically, in theme-classic, we'd like to move the button for the page table of contents to the header (so it's always visible), when the page is too narrow for it to display in a sidebar on the right.
Or, is there a way to do this within the theme-classic?
How to get __builtin_vectorelements like macro in GCC for (vector_size(bitceil(N)*alignof(T)))?
25 April 2026 @ 6:02 pm
Are there any alternatives for __builtin_vectorelements in GCC?
Replacing vec_ext_countof for GCC with another solution might help.
#define isarray(a) __builtin_choose_expr(__builtin_types_compatible_p(typeof((a)[0]) [], typeof((a))), true, false)
#define countof(a) sizeof((a))/sizeof(typeof((a)[0]))
/* vec_ext(t,n) for LLVM SIMD Vector Extension */
#if defined(__clang__)
#define vec_ext(T,N) typeof(T __attribute__((ext_vector_type(N))))
#define rc_vec(src,n) (*(vec(typeof((src)[0]),n)*)__builtin_addressof(src))
#define rc_vec_ext(src,n) (*(vec_ext(typeof((src)[0]),n)*)__builtin_addressof(src))
#define vec_ext_countof(a) __builtin_vectorelements(rc_vec_ext(a,countof(a)))
#define isvector(a) !isarray(a) && \
__builtin_choose_expr( \
bitceil(vec_ext_countof(a)) == countof(a),true,false)
/* vec_ext(t,n) for GCC SIMD Vector Extension */
#elif defined(__GNUC__)
#define vec_ext(T,N) typeof(T __a
Error while doing Running a java file in Eclipse
24 April 2026 @ 10:16 am
I have a Java project which has several files, now inside one of the files, for testing purposes, i have created a main function and I am trying to run that single java file by right clicking and selecting Run as > Java Application. This file has no compilation issues and does not have any dependency. On Running, the console shows, that it cannot find a main class.
Exact error in Console : Error: Could not find or load main class com.ccs.cav.constants.Testing
My project has several compilation issues but I am not able to understand that why it is not able to run this single file even it does not have any issues ?
package com.ccs.cav.constants;
import java.util.HashSet;
public class Testing {
public static void main(String[] args) {
System.out.println("SK");
}
}
Combining multiple node displays in 3d-force-graph using .nodeThreeObject
23 April 2026 @ 12:47 pm
I am working on Vasturiano’s (mindblowing, spell-binding) 3d-force-graph, and having trouble combining (and separating) three seemingly very simple elements: a sprite, an image, and image text.
In addition to “scholars” represented in the visualization, I would like to represent “keywords” (using a hashtag .png), and “disciplines” (using a scholar cap .png). What ends up happening is that keywords (./hashtag.png), and disciplines (./discipline.png) are overlaid with the sprite image, and do not display any text labels: #keyword is (wrongly) overlaid with default node sprite, and label is missing.
A friendly user, @kikon, created this fiddle to represent my problem: [https://jsfiddle.net/otpx0jg9/]
I would like each scholar to be displayed by the default sprite (coloured ball), with
Validation error messages show up as "Invalid value" when trying to translate them in Express
3 March 2026 @ 3:16 pm
I installed i18next packages in my Express project and enabled i18next.
middleware\localization.ts:
import i18next from "i18next";
import Backend from "i18next-fs-backend";
import { LanguageDetector } from "i18next-http-middleware";
i18next
.use(Backend)
.use(LanguageDetector)
.init({
lng: "sr",
ns: ["validation"],
fallbackLng: "en",
backend: { loadPath: `../lang/{lng}/{ns}.json` }
});
And wrote a file that contains translations lang/sr/validation.json. https://pastebin.com/mXVNXgwa
I have many validation schemas with error messages that get translated by i18next, for example, registerSchema which is applied to the registration POST route.
validation\authSchemas.ts:
Bulk dataframe data to redshift database table how to insert very quickly
3 January 2024 @ 11:52 am
I tried many methods to insert data from dataframe to database.
No method helped me insert quickly it took 2 days and 3 days after that getting timeout error.
Here is few methods i tried
First method i converted dataframe to dictionary and tried uploading database
Here is the sample example of data looks like: Note: i'm sharing 20 rows of data but actually i have huge amount of data
conn = psycopg2.connect(
host= 'redshift-####-dev.)00000.us-east-1.redshift.amazonaws.com' ,
database= '*****',
user='****',
password='*****',
port= '5439'
)
print("Succesful Connection to RedShift Dev")
cur = conn.cursor ()
df_dic =[{'case_id': 69370, 'column_name': 'subject', 'split_text': 'working', 'split_text_cnt': 1, 'load_ts': '2023-
12-15'}, {'case_id': 69370, 'column_name': 'subject', 'split_text': 'scenes', 'split_text_cnt': 1, 'load_ts': '2023-12-15'}, {'
case_id': 69370, 'column_name': 'subject', 'split_text': 'i
Boto 3 Redshift client execute_statement lagging
20 September 2023 @ 3:38 pm
I'm trying to copy some data over from MySQL to RS. The table is 650,000-ish rows, so i'm doing it in batches of 10,000 or so and also using python's multiprocessing module. The first few iterations come out ok. The script pulls 10,000 rows and creates a csv file in S3 (Edited to mention that each such file is around 300Mb, so it's not really feasible to upload the whole data not in chunks, unfortunately), then copies the data from that file to the redshift table. But soon the script starts skipping chunks. It still uploads the batch file to S3, but the copying to the main table isn't happening. This last run took 34 minutes and here's a graph of the record ids (which should be from 1 to 650,000) that actually got copied to the table. You can see the jumps where a whole bunch of records didn't make it to the main table.