instruction
stringlengths
0
30k
To avoid too long lines, you can do the following. Instead of: ``` with open(filename, 'wb') as file, request.urlopen(image.url) as response: pass ``` I, do for example: ``` f = lambda: open(filename, 'wb') r = lambda: request.urlopen(image.url) with r() as response, f() as file: pass ```
Why is it that when I inject `ILogger<MyClassName>` and call `Logger.LogInformation` I don't see that in Application Insights, but when I call `Logger.LogError` I do? Here is my code ```c# public async ValueTask DeleteMessageAsync(string chatId, int messageId) { Logger.LogInformation( ...
Why is ILogger.LogError working but not ILogger.LogInformation?
|c#|azure|azure-functions|azure-application-insights|
A repository can have any number of image tags. There is no stated limit for size. In practice, if an image layer gets much larger than 10 or 20 gigabytes, you may experience problems with push and pull. Your mileage may vary. There is no limit for builds or tags for public images. (This can be changed over a period...
null
I wrote a small `struct` used to sort dependencies between projects (it could be used to sort anything really, the interface used is just a `std::string`) in a container/solution. The dependencies are defined and fed from a json object (parsing is done using `boost::json`). Example dependencies: "container_de...
Oracle setting up on k8s cluster using helm charts enterprise edition
It is recommended to rewrite the DTO with a constructor applying the required parameters. If rewriting is not possible, implement a custom denormalization tool. Following approach ensures strict validation during deserialization. final class SimpleDtoDenormalizer implements DenormalizerInterface { ...
I'm trying to publish to the local repository but to set the artifact name explicitly. For example, say the org is "quick.fox" and the module is "core" with version being 1.1. What I get is: ```<repo>/quick.fox/core/1.1/core-1.1.jar``` What I'd like it to be: ```<repo>/quick.fox/core/1.1/prefix-core.jar```...
Defining an artifact name explicitly when publishing with Gradle
|maven|gradle|ivy|
I created a stand alone soap webserver in delphi. I use javascript in the front end to connect to the webserver. I know how to send username and password in the header of each request in javascript but I don't know how to read them in server side by Delphi. Can anyone help me to read the header of the requests?
How can I read the header of request to webserver
|delphi|soap|header|webserver|
I have a simple console application, that references small 3rd party COM interop .NET assembly. I want to trim unused code when publishing. [![enter image description here][1]][1] However, when I run trimmed piblished the application I get error: > Unhandled exception. System.IO.FileNotFoundException: File ...
It appears that it's important to express that you want the 7 specific items extracted by calling for tokens=1-7. Token 1 will be %%G, with each successive, stipulated token using %%H, %%I, etc. Wanting to express one line for each token comes by echoing them 1 echo command at a time for each token's variable, either...
Is there a way to uniquely identify the current Windows Terminal viewport within a WSL2 Ubuntu bash environment?
|gnu-screen|windows-terminal|
null
The program is placing the files to the path `Users/username/` instead of the `Oil and Cells folder`. Can I fix this issue with the compiling command? I used `gfortran -o Planar_Surfactant Planar_Surfactant.f` while inside of the `Oil and Cells` folder to compile the executable. `~ % /Users/username/Documents/BME...
My journey through creating a PDF form (upgrading old Zend PDF library to be able to do it) continues. I am struggling with checkbox and radio buttons, trying to get them displayed consistently. I did follow several guides and tips here and still there are differences in getting the button displayed in Chrome, Mozil...
Updated max input vars but table still shows error
|php|sql|database|phpmyadmin|
{"OriginalQuestionIds":[58177145],"Voters":[{"Id":5577765,"DisplayName":"Rabbid76","BindingReason":{"GoldTagBadge":"pygame"}}]}
I'm currently outlining a dialogue system in Unreal Blueprint. Im collapsing graphnodes per dialogue chunk to clean up the overview. I found that you can name Input and Output pins for those collapsed nodes and would like to use those to define dialogue lines and responses for convenience. To achieve this i have to som...
Found the answer in a related post. Took me hours of searching to find it... https://stackoverflow.com/questions/67423907/possible-to-use-lay-out-a-compose-view-in-an-activity-written-in-java/76612457#76612457?newreg=7e15da165ac149f2a61ff9685af9be59 > You don't necessarily need the AbstractComposeView. I was able t...
i am trying speed up my implementation of rolling zscore. What I'm doing: I've a matrix features (nxm). And each column of features I wanna apply a rolling window that are different from one column to the other. So right now, i 'm doing: - for each row >= maximum rollong window - for each column of feature - ...
I had the same issue in one of my projects. I discovered that in the build process, cx_Freeze was taking all the packages installed in the computer, so I sat up a virtual-environment on the root directory of the project to install there only the packages needed for my project, once this was done cx_Freeze chose only th...
why don't you create your json manually instead of using library. public String singleKeyValueToJson(){ JSONObject json=new JSONObject(); json.put(key,value); return json.toString(); }
I have two .3gp (or .wav) audio files that I have saved from the user's microphone. How can I concatenate these two audio files together in code into a single file?
In Hoppscotch v2024.3.0 how can I get or set the newly introduced request variables from a pre-request script? I tried using `pw.env.get("my_reqest_variable")` but it returns `undefined`.
get or set request variable in pre-request script in Hoppscotch
|hoppscotch|
add this on top of your controller: ```php /** * * @OA\Info( * version="1.0.0", * title="Organization", * description="test description", * @OA\Contact( * name="test", * email="test@test" * ), * ), * @OA\Server( * url="/api/v1", * ), */ class YourCo...
Interesting problem This would pull out the duration between two rows in your format [![enter image description here][1]][1] let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Convert" = Table.TransformColumns(Source,{{"Column1", each let a=_, b = Text.Replace(a,"Days...
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**: ![popup](https://i.stack.imgur.com/r7Z0N.png) Is there a way to query these menu items yourself? I was able to trigger the default im...
in the application I made using this library [react-native-tcp-socket](https://github.com/Rapsssito/react-native-tcp-socket), the server is created and the functions in the listen event work, but server.on('connection',() => {}) does not work **Server.js** ``` import TcpSocket from 'react-native-tcp-socket'; im...
react-native-tcp-socket connection event not working
|react-native|tcp|tcpserver|tcpsocket|
null
I am new to hadoop. So, I am assuming and it seems obvious that hadoop will have to keep track of the free space in each datanode. For the reason being, if new file saving request comes to hadoop, hadoop system will have to decide which datanodes to choose to store the incoming file. Now, each datanode keeps the...
how hadoop decide datanode free space
|hadoop|
I am using uuid as id for the MySQL db. But when I try to retrieve using id, it's returning null rather than the correct object. I crossed check the db using workbench, the record is there but its not retrieving when trying to do usig JPA. I have following classes BaseEntity: ``` @Getter(AccessLevel.PUBLIC) @Map...
I am using Polars (`{ version = "0.38.3", features = ["lazy", "streaming", "parquet", "fmt", "polars-io", "json"] }`) with Rust (`v1.77.0`) to process a large dataset (larger than available memory) inside a Docker container. The Docker container's memory is intentionally limited to 6GB using `--memory=20gb` and `--shm...
I am making a website with the option to change font-size. Every time when you refresh the page though, the font-size you selected returns to the original font-size. The code below shows the html and JavaScript code for how this function works: <!-- begin snippet: js hide: false console: true babel: false --> <!-...
Windows 11 Visual Studio 2015 I would like to filter double values. [enter image description here][1] [enter image description here][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...
|vba|filtering|
error CS1061: 'NavMeshSurface' does not contain a definition for 'IsPartOfPrefab' and no accessible extension method 'IsPartOfPrefab' accepting a first argument of type 'NavMeshSurface' could be found (are you missing a using directive or an assembly reference?) I dont know what to try or do
unity navmeshsurface prefab not found or whatever
|debugging|
null
I have a website for car and tow services for passenger cars and services which includes assistance and assistance for damaged cars in the North Only the pages I create will not be indexed for long. Please do a check. emdadrodbar.ir I used the yoast plugin and registered my sitemap in Google Search Console, but i...
The problem is that it takes a long time to index web pages in emdadrodbar.ir?
I want to update or insert 100,000 records into a database in a single batch process using some effective design pattern. Example: I have 1 million records in my table date range from 1/1/2020 to 1/1/2024 and if user updates any transaction in the middle, e.g. 1/1/2022, then based on that particular date I need to ...
I'm attempting to display a list of movies on a website using Jinja2 (a template engine for Python) and Bootstrap (a front-end framework). However, I'm having difficulty getting the movie cards to display correctly.When trying to display the movie cards using Jinja2 and Bootstrap, the cards aren't being displayed as ex...
{"Voters":[{"Id":1440565,"DisplayName":"Code-Apprentice"},{"Id":2395282,"DisplayName":"vimuth"},{"Id":6782707,"DisplayName":"Edric"}]}
I'm trying to develop a school schedule generator in JavaScript for a high school with various subjects, teachers, and classes. The goal is to create a balanced and efficient schedule that minimizes conflicts while considering teacher preferences and availability. The teacher’s subjects that he teaches are predeterm...
The problem in your code is that `winsound` accepts `.wav` files, not `.mp3`. You can use any online converter to convert your `.mp3` audio file to `.wav`. Then, it should work. >! (I have to admit, I didn't expect such a content for strings here 0_0)
I am having trouble reading a large .dat file into R. I am using ``` data <- read.table("...2018029_ascii/FRSS108PUF.dat", fill=TRUE) ``` This results in a large dataframe with V1, V2 as column names. I am using the ASCII file at this link: https://nces.ed.gov/pubsearch/pubsinfo.asp?pubid=2018029 ".....
null
To transform Sales Order into Item Fulfillment: var objItemFulfillment = record.transform({ fromType: record.Type.SALES_ORDER, fromId: salesOrderID, toType: record.Type.ITEM_FULFILLMENT, isDynamic: false }); Inventory Details are its own subrecords which may exist on each line...
Storing the prefered font-size in localStorage
|javascript|html|css|
Yes, it is, in WWDC 23, ScreenCaptureKit API were introduced to capture screenshots programmatically. Please refer here : **What’s new in ScreenCaptureKit** https://developer.apple.com/videos/play/wwdc2023/10136/?time=586
There is a feature that comes with `iOS 17`: [defaultScrollAnchor(_:)][1] ScrollView { ForEach(0..<50) { i in Text("Item \(i)") .frame(maxWidth: .infinity) .padding() .background(.blue) .clipShape(.rect(cornerRadius: 25)) ...
null
|database-design|database-normalization|first-normal-form|
|database-design|database-normalization|
I'd like to create an online quiz application. I have in mind several types of exercises, including those for filling in the blank: An exercise can require a user to enter the text: ``` Chemical energy produced by the ____ is stored in a small molecule called ____ ``` Or to pick an option from the given list: ...
Combining two wav files: import java.io.File; import java.io.IOException; import java.io.SequenceInputStream; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; public class WavAppender { pu...
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** I...
This approach will work (tested with Go 1.22) ```go func (sh StreamHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) { go func(done <-chan struct{}) { <-done fmt.Println("message", "client connection has gone away, request got cancelled") }(req.Context().Done()) //...
your namespaces in the begining of the controller file should match the herirechy of the data sturcture it should implement [PSR-4 autoloading standard][1]. check [laravel doc][2] for more details so namespace for DokterController should be namespace App\Http\Controllers\dokter; and the use should be...
null
I am having problems with gcc-11 C++ compiler when using multiple inheritance and I want to call a specific method of the base class and I write using A::m1 explicitely. Visual C++ 2022 works with this code, however gcc-11 fails and produces an error. This is the code: ``` struct Base { void m1(){} ...
I'm trying to implement a Batch Gradient Descent algorithm in python that takes in the training set, the learning rate, and the number of iterations as input arguments, and returns the weights. However, when I run it, within a few iterations the values for the parameters get exponentially large and eventually it return...
Batch Gradient Descent algorithm in python is returning huge values
|machine-learning|linear-regression|gradient-descent|
null
Our ASP.NET website is using `FormAuthentication`. After login success, it will add a cookie to client side. Here is the code. ``` FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, expiration, remember, roles, FormsAuthentication.FormsCookieName); HttpCookie ...
How does it work using ASP.NET FormAuthentication
|asp.net|webforms|owin|asp.net-authorization|asp.net-authentication|
null
null
null
null
The app crashes anytime I interact with just about any compose control. Just the release, the debug works fine. The error says: androidx.compose.ui.R$id is missing hide_in_inspector_tag The stacktrace is below. This definitely some sort of R8 issue. I've been adding things to proguard config and got to the p...
|azure|oauth-2.0|microsoft-graph-api|azure-app-registration|microsoft-oauth|
It appears that it's important to express that you want the 7 specific items extracted by calling for tokens=1-7. Token 1 will be %%G, with each successive, stipulated token using %%H, %%I, etc. Wanting to express one line for each token comes by echoing them 1 echo command at a time for each token's variable, either...
You can create a RandomRange class, you can create as many as you want and put into a list public class RandomRange { public int Start { get; set; } public int End { get; set; } public int Exception { get; set; } public RandomRange(int start, int end, int exception) ...
The reason I was getting trouble is because I was redirecting through my nav.php, which is an include file containing only the navbar information. When I put the window.location.href within my index.php, I was able to redirect with no issues.
I'm trying to restrict my solution using vpasolve() to only integers but I can't seem to find any equation or parameter that does that. Here is the code below if it helps, the variable I'm trying to restrict is N. Any guidance would be much appreciated. ``` clc clear syms t L S N height = 0.7; width = 0.1;...
SQL schema for a fill-in-the-blank exercise
|sql|hibernate|database-design|orm|database-schema|
**Problem** * Merge `fr` and `events` based on a match between `events['Earnings_Date']` and the exact or *next* date in `fr['Date']` (so: 'looking backward' from `fr`'s point of view), grouped by column 'Symbol'. Keep only the first match. **Setup** Let's add 2 symbols (one expecting a match, one expecting ze...
I have upgraded the ClickHouse version from 22.6.1.1985 to 24.3.1.2672, which has resolved the issue. This is due to the fact that prior to the update, ClickHouse (in its 2022 version) adjusted the Asia/Tehran timezone to UTC+4:30 after March 20th to accommodate daylight saving time. However, post-2022, Iran disconti...
I am tyring to display a video in the PDP page and wondering if its actually supported by Spartacus 6.5. I don't see any specific documantation about it but I can see a <cx-video> attribute in the Spartacus code which makes me believe that video files are supported. But I get a error **'cx-video' is not a known elemen...
Use video files in Spartacus PDP page using <cx-media