instruction
stringlengths
0
30k
My task is to create a tool that, based on (specific) input data, will generate a 'grid' of employees' working hours and spit out specific shifts 6-14; 7-15; 10-20 etc etc. The general operation of such a macro, let's say I have one, the problem begins when the macro must have a requirement that in a given row (the ...
I'm building my first React-Native app that I would like to monetize. The app will expect users' input. This input will be used as a parameter for API calls to ChatGPT. Short app configuration description: - make API calls to ChatGPT and store the response (in DB) - Display stored data - Sign in/Sign Up I com...
Add this to your container in `docker-compose.yml`. ``` extra_hosts: - "host.docker.internal:host-gateway" ``` If you keep getting errors, change listen_addresses in `postgresql.conf` ``` listen_addresses = '*' ``` And add these lines to your `pg_hba.conf` ``` host all all 0.0.0.0/0 scram-sha-256 host...
I had a try with *Google Sheets* and used "*search and replace*" with `^(.{2,})\1(.*)$` and it worked. I tested `(.*)\1` and also `(.*?)\1` as you mentioned, and effectively it doesn't work. It should also work with `^(.+?)\1`. So the problem was just that `*` would match zero times and `+` would force at leas...
4 years later and this issue arises for a different reason. Leaving this answer here to help others. If you encounter "Bad File Descriptor" when using Python, Pip or Poetry on Windows: It is possible that Windows Security is blocking access to your files. It may do this as part of Controlled Folder Access, as par...
I wait until the page is loaded and use the "DOMContentLoaded" method to add eventhandlers on some p tags. This works until I open and close the modal, then the page/js freezes. Why does it freeze? ``` <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initi...
function insertDash(str) str = string.gsub(str, "(%d)(%a)", "%1-%2") -- digit-letter str = string.gsub(str, "(%a)(%d)", "%1-%2") -- letter-digit str = string.gsub(str, "(%a)(%a)(%a)(%a)", "%1%2-%3%4") -- 4 letters to 2 letters and 2 letters return str end Examples: print(inser...
My drawables are on the folder drawable-xxhdpi and the background size is 1080 x 1920. For the screens with this resolution, all is OK. But when I test on a samsung A34 for example with the resolution 1080 X 2340, I have a black strip under my screen game and I don't know how to scale my background and the position...
There are quite interesting and accurate answers. Using switch seems to be the most beautiful approach as long as it uses the new java 14+ syntax. One recommendation with that one is to keep switches small. There's no any rule of thumb to say it should only have 3 or 5 cases, but keep them small enough for you and ...
I've changed `thymeleaf-spring5:3.1.2.RELEASE` to `thymeleaf:3.1.2.RELEASE` library because I hadn't found any solution for that problem. And it now works as expected.
I have code which executes a large number of summarise and it takes ages to run. eg: library(dplyr) df <- data.frame(Letter = letters, Num = c(1 : (26*10) )) for (x in 1:10000){ df_sum_Tot = summarise(df, Sum_Num = sum(Num) ) df_sum_Letter = summarise(df, Sum_Num = sum(N...
Should I set Back-End for my React Native application?
|react-native|mobile-application|
You can remove by using the following command and try! pnpm remove @types/mime
|spring-boot|spring-cloud|spring-cloud-kubernetes|
I have a list of dfs: my_list <- list(structure(list(col1 = c("v1", "v2", "v3", "V2", "V1"), col2 = c("wood", NA, "water", NA, "water"), col3 = c("cup", NA, "fork", NA, NA), col4 = c(NA, "pear", "banana", NA, "apple")), class = "data.frame", row.names = c(NA, -5L)), structure(list(col1 = c("v1", "v2"), col2 = c(...
I came up with a query myself. Not sure if a simpler solution exists. ``` SELECT DISTINCT * FROM ( SELECT group_concat(v2_id ORDER BY v2_sort_me ASC) FROM ( SELECT v1.id AS v1_id, v2.id AS v2_id, v1.sort_me AS v1_sort_me, v2.sort_me AS v2_sort_me FROM t v1 JOIN t v2 ON abs(v1.val...
You need to center your [`rolling`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rolling.html) windows with `center=True`: ``` window = 12 hourly = df.resample(rule="h").median() hourly["ma"] = hourly["TEC"].rolling(window=window, center=True).mean() hourly["hour"] = hourly.index.hou...
{"OriginalQuestionIds":[13704315],"Voters":[{"Id":205233,"DisplayName":"Filburt"},{"Id":20643658,"DisplayName":"Black cat"},{"Id":4961700,"DisplayName":"Solar Mike"}]}
This XPath expression will return text of all "u" tags excluding the text of any "desc" or "anchor" tags within them: TEI//u//text()[not(ancestor::desc) and not(ancestor::anchor)]
What worked for me was this. Under selenium 4.18.1. options = webdriver.FirefoxOptions() options.add_argument("-profile") options.add_argument(profile_path) driver = webdriver.Firefox(options=options)
I have an HTML/CSS/JS website where I'm embedding facebook posts, and adding some text (with various info and action buttons) to the top of each post. I'm adding the text that goes above each post dynamically in Javascript, so that the embedded post (iframe) is in a separate container than the text that goes above it. ...
CSS / Add margin-top to embedded facebook post
|html|css|
A more concise version of the code would be to use the `to*Part()` functions on a `Duration`, e.g. ``` val duration = java.time.Duration.ofMillis(delta) val hours = duration.toHours() val minutes = duration.toMinutesPart() val seconds = duration.toSecondsPart() return if (hours == 0L) { ...
I have this JSON expression `'{"uid":false,"token":null,"ma":null,"question":[{"questionId":47599,"answerId":190054,"answer":1}],"iframe":true,"ref":"<SOMEREFERRER>","ts":1711214476}'` that a webclient (in this case, Google Chrome and Firefox on iOS) wants to send to a webserver. It is a reply on a survey form an...
C: Shared variable read from low priority thread in preemptive scheduling
|c|multithreading|embedded|mutex|critical-section|
I have some python code: ``` class Meta(type): def __new__(cls, name, base, attrs): attrs.update({'name': '', 'email': ''}) return super().__new__(cls, name, base, attrs) def __init__(cls, name, base, attrs): super().__init__(name, base, attrs) cls.__init__ = Meta.fun...
More Efficient Summarise / Summarize in R
|r|dplyr|
My drawables are on the folder drawable-xxhdpi and the background size is 1080 x 1920. For the screens with this resolution, all is OK. But when I test on a samsung A34 for example with the resolution 1080 X 2340, I have a black strip under my screen game and I don't know how to scale my background and the position...
{"Voters":[{"Id":10141885,"DisplayName":"halt9k"}]}
1)I need to perform a filtered search using a custom filter object that contains the query parameters supported by my API. I have devised a solution that works, but I'm not sure if it's the best way to implement it. Let's assume that my API accepts 10 different query parameters, while my ContractDto only has a few f...
LazyDataModel, custom filter with search button
|jsf|primefaces|
null
It's a simple project localhost in spring Boot, Java 11 Correto and everything is configured automatically using the spring-boot-starter-data-redis module. It has a postGres database. But I get failure when running the spring boot app. dependency project pom.xml ``` <parent> <groupId>org.springframework.boot</...
I am currently trying to extract cells' background color from a xlsx file: [image](https://i.stack.imgur.com/LP3nn.png) I've tried two ways obtained from other stackoverflow posts: 1) ``` wb = load_workbook(excel_file, data_only = True) sh = wb[wb.sheetnames[0]] rows = sh.max_row cols = sh.max_column bc...
Get correct background color for merged cells in xlsx file
|python|excel|openpyxl|cell|background-color|
null
null
You mean something like this? <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const addLargeNumbers = (strNum1, strNum2) => { // Start from the end of both strings let result = ''; let carry = 0; let i = strNum1.length - 1; let...
It's looks like work, the only is filter the value when you received the new values this.filterInput$ .pipe( debounceTime(300), distinctUntilChanged(), filter((query) => query?.length >= 3), ) .subscribe((filterValue) => { this.adminUserService.filterPermi...
When a class has been specified in a use statement, it can be referred to by the final element of the fully namespaced class name. Evidently PHP knows from the short name the identity of the class. Is there a way to obtain this information? Or is there any other way to deal with the issue - I want to know if the cla...
Practically, there is no difference, especially since you are using immutable `Map`s (as opposed to `MutableMap`). I used Amazon's `corretto-18` to compile your code and inspected the bytecode. Those are the conclusions I got from doing so: `println(mappings["PL"]!!)` compiles to the following bytecode: ```byteco...
I try to have a button to add ppl to the enlistment of a game. i have a function in another cog that updates the enlistment. so once someone press the button i want it to run that function it adds the person to a mySQL database and then the enlistment cog runs it and displays it on an message in the discord. ``` ...
I have a column in excel open in power query that has dates. the format is m/d/yy hh:mm;@. example :1/3/2023 6:00:00 AM. this is considered as January 3rd. I want to change it to be march, meaning I want the 3 to be the month and 1 to be the day, so it becomes 1st march. I made sure the column is of type date, I wen...
change date in excel from MDY to DMY
|excel|
null
Just chain up your 2 queries with `$unionWith` ```js db.collection.aggregate([ { "$sort": { "insertedAt": 1 } }, { $limit: 1 }, { "$unionWith": { "coll": "collection", "pipeline": [ { "$sort": { "insertedAt": -1 } ...
*Adequate block deployment is not working html/css. Blocks do not work properly. There are blocks, and if you click on one block, the next block expands, this happens on the tablet version, what to do?* **Example: in the picture, when one block is expanded, another block is expanded behind it.I want to make sure that w...
null
The problem below is from book: "Modern compiler implementation in C", chapter03, 3.3.(d) > Write an unambiguous grammar for balanced parentheses and brackets, where a closing bracket also closes any outstanding open parentheses (up to the previous open bracket). > > Example: [([](()[(][])]. > > Hint: Firs...
I'm deleting your post because this seems like a programming-specific question, rather than a conversation starter. With more detail added, this may be better as a Question rather than a Discussions post. Please see [this page](https://stackoverflow.com/help/how-to-ask) for help on asking a question on Stack Overflow. ...
null
Whether a type is considered statically or dynamically sized type depends on whether we know its size at _compile_ time. For example, we know that an `i32` is 4 bytes in size, and we know this at compile time, so this is a statically sized type. We _do_ know the size of a slice when we produce it, but that happens ...
Super new to JS and could use some help when it comes to using outside sources in my workflow, specifically, the date range slider at the top of this page https://ghusse.github.io/jQRangeSlider/ The site does a good job of explaining how to get started but I cannot seem to get the slider into my file. How can I go a...
Using JQuery Date Slider
|javascript|jquery|date|slider|
null
I am trying to add https://github.com/coffee-and-fun/google-profanity-words to my website, but the only option I see is using Node.js which is not option for me since I need to install it on server and using from there(correct me if I am wrong) I found some cdn like this one - https://www.skypack.dev/view/@coffeeand...
Adding google-profanity-words to web page
|javascript|node.js|web|
Here is one possible option using [`cKDTree.query`][1] from [tag:scipy]: ```py from scipy.spatial import cKDTree def knearest(gdf, **kwargs): notna = gdf["PPM_P"].notnull() arr_geom1 = np.c_[ gdf.loc[notna, "geometry"].x, gdf.loc[notna, "geometry"].y, ] arr_geom2 = np.c_...
In a desktop application (written in Electron), I'm trying to implement a feature that will allow the user to open the application in full screen or return it to the reverse state (initially the application does not open in full screen). I already have working functionality. What I've done: main.ts ipcM...
Very Simple Go to nav.html replace the logout button class with the following code : <li class="nav-item"> <form method="post" action="{% url 'user-logout' %}"> {% csrf_token %} <button type="submit" class="nav-link text-whit...
using float and clear properties. Set the dimensions in compliance with the proportions in the figure, but keep in mind that this composition represents the layout of a web page, so blocks should not overlap each other; blocks should occupy the entire width of the page (regardless of screen resolution and browser win...
How to write this OOP true? (Python, metaclass)
|python-3.x|oop|metaclass|
null
How to avoid being struct column name written to a json file? While writing the df to the json file? Using databricks pyspark write method. ```Df.write.option("header", "false").mode("overwrite).json(path)``` Tried option("header", "false") Sample json file: ```{"struct_col_name":{"actual_struct_data_col":...
It's a bit ugly, but we can do something like this if you are OK defining the pattern for a limited number of locales and set a sensible default for the other locales. ```php $formatter = match ($lang) { 'en' => new \IntlDateFormatter($lang, pattern: "MMMM d 'at' h:mm a"), 'es' => new \IntlDateFormatter...
You can try changing **`data-bs-spy="scroll"`** into **`data-spy="scroll"`**. Here is a link to an example from the bootstrap documentation that shows the use of `data-spy="scroll"` https://getbootstrap.com/docs/4.0/components/scrollspy/#example-in-navbar
null
IN MbedTls with RSA in a C-programm encryption/decryption works when using separate buffers (for plainText, cipherText, and decryptedText, i.e. the content of plainText and decryptedText is the same), but not when using just one buffer to perform in-place encryption/decryption as i get gibberish/not correctly encrypted...
how to use only block layout in this css code?
|html|css|
null
If you upload an image, try these steps: - Convert your image into DataURI. - Then this string insert to GIST as a text file If you want to convert back, there are several options. For example, this: https://stackoverflow.com/questions/17591148/converting-data-uri-to-image-data
I have a problem with `drop_na()` function. I wanted to clean the dataset and erase the "NA" values, but when I entered the code, all datas are disseapperad. I do not understand why it happens. You can see clearly what my codes are in this picture: [![enter image description here][1]][1] ``` library(tidyverse...
|r|
If you have a venv folder, you need to activate it before running the Flask server. To do this, use the [preLaunchTask][1] option. The task is declared inside `.vscode/tasks.json`. `.vscode/launch.json`: { "version": "0.2.0", "configurations": [ { "name": "Pytho...
i tried new thing as shown below and it works. using new_t = map<string,int> ; map<string,new_t> easy_map; easy_map.insert(make_pair("A",map<string,int>())); easy_map.insert(make_pair("B",map<string,int>())); easy_map["A"].insert(make_pair("A",2)); easy_map["B"].insert(make_pair("...
--Remove Duplciates[SKR] --Option A: select * --delete t from( select rowNumber=row_number() over (partition by SomeKey order by SomeKey), SomeKey from YourTable m )t where rowNumber > 1 --Option B: with cte as ( select rowNumber=row_number() over (partition by SomeKey order by SomeKey), SomeK...
I have a json like [ { "url": "https://drive.google.com/file/d/1tO-qVknlH0PLK9CblQsyd568ZiptdKff/view?usp=share_link", "title": "&#8211; Flexibility" }, { "url": "https://drive.google.com/open?id=11_sR8X13lmPcvlT3POfMW3044f3wZdra", "title": "&#8211; Prono...
Since i updated 2FA in order to put trusted device, i have this error after the log in and security code entered: **Key provided is shorter than 256 bits, only 64 bits provided** What i do ? i update my User.php to add : /** * @ORM\Column(type="integer") */ private int $trustedVersion; ...
I am working on a project in the Node.js environment that via dbus-native interfaces with Connman. What I need to do is create some code that allows it to connect to a secure wifi network. I went to implement the Agent and the RequestInput function and from another file I go to call the Connect(), but once it is called...
After some testing I found the superblock of a file system can be accessed from block_device using below cod: struct super_block *sb = bdev->bd_holder; I've confirmed this with vfst, ext2,3,4, xfs file systems.
Make suitable changes as needed ``` import psycopg2 def create_function(sql_query): try: # Connect to your PostgreSQL database conn = psycopg2.connect( dbname="your_database", user="your_username", password="your_password", host="your_hos...
I try to use Symfony/Messenger with a web service. I don't understand why the queue don't retry 3 times when I have a critical error. This is my messenger configuration: framework: messenger: # Uncomment this (and the failed transport below) to send failed messages to this transport for ...
Symfony - Key provided is shorter than 256 bits, only 64 bits provided
|php|symfony|base64|symfony5|symfony5.4|
{"OriginalQuestionIds":[10526995],"Voters":[{"Id":3959875,"DisplayName":"wOxxOm","BindingReason":{"GoldTagBadge":"google-chrome-extension"}}]}
You can define the event handler within your initialization. For example, with your code: <!-- begin snippet: js hide: true console: true babel: false --> <!-- language: lang-js --> var mySwiper = new Swiper('.swiper-container', { loop: true, slidesPerView: 1, autoplay: { ...
Although it's difficult to describe, there's a really good explanation in this YouTube video. https://youtu.be/T6IvImk66m8?si=N1D0IA2Irx9-_CyX
``` INCLUDE Irvine32.inc INCLUDELIB Irvine32.lib INCLUDELIB kernel32.lib INCLUDELIB user32.lib .data A SBYTE 10d ; A is an 8-bit signed integer B SBYTE 2d ; B is an 8-bit signed integer cc SBYTE 20d ; C is an 8-bit signed integer D SBYTE 5d ; D is an 8-bit signed integer .code main P...