Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for toraritte
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Question | — |
How to sort the output of meta / slash commands in `psql`? For example, how to sort the output below by the values in "Column" in the `psql` shell itself? ``` mydb=> \d authuser Table "public.authuser" Column | Type | Collation | Nullable | Default +-----... (more) |
— | 8 days ago |
Answer | — |
A: What determines where the focus goes back to when clicking on a browser's back button? Short answer The HTML specification only addresses scroll position restoration behavior, so the main factors that influences where focus will land when navigating the browser history are: user agent implementations JavaScript accessibility attributes browser extensions At the moment, ... (more) |
— | 29 days ago |
Answer | — |
A: How to merge Django model query results? Just found the How Can I Combine Two or More QuerySets in a Django View? article by James W. that perfectly answers my question (and just learned that a "Django model query" is called a `QuerySet`). To sum up: Do the `QuerySet`s belong to the same model? 1. YES: use to `|` union operator. ... (more) |
— | about 1 month ago |
Question | — |
How to merge Django model query results? I have to modify a legacy Django web application where there are 2 tables to store the same information using the same database structure, and the only difference is the names of the tables (and the corresponding Django models): + `ProgramAAssignments` model for `programaassignments` table + `Pro... (more) |
— | about 1 month ago |
Question | — |
What determines where the focus goes back to when clicking on a browser's back button? As far as I can tell, it is in part determined by the HTML spec's History API1, specifically the value of `history.scrollRestoration`. Quoting the HTML spec's scroll restoration mode paragraph: > + `"auto"` > The user agent is responsible for restoring the scroll position upon navigation. > ... (more) |
— | about 1 month ago |
Question | — |
Why does `let map f = id >=> switch f` work in F#? Asked How to implement `map` using the fish (>=>, Kleisli composition) operator in F#? a couple of hours ago, and r's answer blew my mind: ``` let map f = id >=> switch f ``` It is perfect in its simplicity, but when I look at the type signatures, it is not supposed to work. I've been at it f... (more) |
— | about 2 months ago |
Question | — |
How to implement `map` using the fish (>=>, Kleisli composition) operator in F#? I'm learning monadic composition through Scott Wlaschin's Railway-oriented Programming post. Once`bind`, `switch`, and `>=>` functions are defined, he introduces `map` to show how to "turn a one-track function into a two-track function". That is: ``` f: a -> b => f': T -> T ``` The imp... (more) |
— | about 2 months ago |
Question | — |
Why does RFC 3986 (URI generic syntax) declare the "host" component to be case-insensitive when the syntax rules show it to be case-sensitive? First, a reminder to future self (the figure RFC 3986, Section 3. Syntax Components complemented with Section 3.2. Authority): ``` The following are two example URIs and their component parts: userinfo host port | | | ... (more) |
— | about 2 months ago |
Answer | — |
A: How to start creating a Giraffe web project and how to serve it? I have to keep reminding myself that > a Giraffe project plugs into the ASP.NET Core pipeline or is itself an ASP.NET Core application , so if I can't find answers to my questions in the Giraffe docs, then it is probably because it is an ASP.NET Core topic (or an F# / .NET / etc. one). How ... (more) |
— | about 2 months ago |
Question | — |
How to start creating a Giraffe web project and how to serve it? Having some trouble with `giraffe-template` on Mac M1, so decided to set up a Giraffe project manually. Started following the Doing it manually section of the Giraffe README, but got stuck right away, and I also couldn't see mentioned anywhere how the project could be served. > For the record, the... (more) |
— | about 2 months ago |
Answer | — |
A: .NET dependency management: `dotnet add package` vs. Paket? Based on what I know so far, there is no difference. Paket has been created more than 10 years ago to address (perceived?) shortcomings of NuGet. (Reading the .NET history made my head spin, and looks like things started to speed up significantly after the 2020s.) Paket has features that may be... (more) |
— | about 2 months ago |
Question | — |
.NET dependency management: `dotnet add package` vs. Paket? Many older projects (i.e., older than 5 years) provide instructions to the Paket .NET dependency manager (e.g., Suave), so I started digging into it, got confused, then gave up for while because errors kept cropping up and I just wanted to make progress. I reached a point in my project where I hav... (more) |
— | about 2 months ago |
Question | — |
How to write a function that only accepts a list of `Error string` `Results` in F# on the level of types? For example, given a `mergeErrors` function where input is always a list of `Error string`s, ```fsharp let es = [ Error 1; Error 2; Error 3 ] let mergeErrors (errors: Result list) : Result = errors |> List.map (function | Error e -> e) |> Error mergeErrors (es: Result list)... (more) |
— | 4 months ago |
Question | — |
What is a "sealed" type in F# and why doesn't the type test pattern operator (:?) work on it out of the `box`? The F# language guide (see Signatures article) has a very sparse definition of what a "sealed" type is: > |Attribute|Description| > |--- |--- | > |`[]`|For a type that has no abstract members, or that should not be extended.| > |`[]`|For a type that is an interface.| I searched the entire PD... (more) |
— | 4 months ago |
Answer | — |
A: How to change the color of a cell to a user defined value while keeping its existing style using NPOI from F#? Solved this by writing my own clone function: ```fsharp open System.Reflection let cloneCellStyle (cell: NPOI.XSSF.UserModel.XSSFCell) = let original = cell.CellStyle // printfn "ORIGINAL: %A" original.FontIndex let workbook = cell.Sheet.Workbook let copy = workbook.Create... (more) |
— | 4 months ago |
Question | — |
How to change the color of a cell to a user defined value while keeping its existing style using NPOI from F#? The answer provided in the How to set the cell color to a user defined value using NPOI from F#? thread solves the problem of how to set the right properties using F#, but it uses a new `ICellStyle` object and overwrites the existing style with it. Re-writing the function (see below) to setting th... (more) |
— | 4 months ago |
Answer | — |
A: How to set the cell color to a user defined value using NPOI from F#? I failed to notice that a cell's `CellStyle` property returns the generic `ICellStyle`, which has to be cast down to `NPOI.XSSF.UserModel.XSSFCellStyle` in order to gain access to the `FillBackgroundXSSFColor` and `FillForegroundXSSFColor` properties. Also, here's a summary of which property does ... (more) |
— | 4 months ago |
Question | — |
How to set the cell color to a user defined value using NPOI from F#? As far as I can tell (from F# at least), cell can only be colored using predefined `NPOI.SS.UserModel.IndexedColors`. From the available methods / properties, ``` val it: ICellStyle = NPOI.XSSF.UserModel.XSSFCellStyle { ... FillBackgroundColor = -494s; FillBackgroundColorColor... (more) |
— | 4 months ago |
Answer | — |
A: What is the difference between `static let` and `static member` in F#? Paraphrasing the F# language guide's `let` Bindings in Classes article: > A `let` binding in a class creates a private field or function; > to expose data or functions publicly, declare a property or a member > method. > > + An instance `let` binding is a `let` binding that is not preceded by... (more) |
— | 4 months ago |
Question | — |
What is the difference between `static let` and `static member` in F#? Taking the example from this Stackoverflow question: ``` type Vector2D(dx : float, dy : float) = static let zero = Vector2D(0.0, 0.0) static let onex = Vector2D(1.0, 0.0) static let oney = Vector2D(0.0, 1.0) /// Get the zero vector static member Zero = zero ///... (more) |
— | 4 months ago |
Answer | — |
A: What does F#'s `box` keyword do and where is it documented? `box` and `unbox` are operators documented in the F# Core API Reference; it tersely states that they box / unbox (respectively) a strongly typed value. + `box a` returns value `a` "wrapped" in a .NET `System.Object` instance "wrapped" here simply means that `a` is upcast to `System.Object`: ... (more) |
— | 5 months ago |
Question | — |
What does F#'s `box` keyword do and where is it documented? The Null Values article in the F# Language Reference show an example that uses it, but it does not explain what it does exactly. > You can use the following code to check if an arbitrary value is > `null`. > > match box value with > | null -> printf "The value is null." > | -> p... (more) |
— | 5 months ago |
Answer | — |
A: How does a client verify a server's SSL certificate? What are the specific steps? Found this old article at the bottom of the search results to be the best explanation to date: (The longer version is here, SSL Handshake (Sun Java System Directory Server Enterprise Edition 6.0 Reference). If it doesn't work, here's the archived version.) > ### Server Authentication During S... (more) |
— | 6 months ago |
Question | — |
How does a client verify a server's SSL certificate? What are the specific steps? I have little to no idea what happens after a client obtains the server's certificate. It has to make sure that it (somehow) valid, but how? (more) |
— | 6 months ago |
Answer | — |
A: How to programmatically evaluate Excel data validations using .NET? 0. State of the art (as 11/22/2023) The `NPOI.SS.Formula.DataValidationEvaluator` class seems to mirror Apache POI's `DataValidationEvaluator` class, but NPOI's version only implemented the `IsType` method thus far. (For reference, here's Apache POI's `isType`.) There also seems to be no .NET E... (more) |
— | 6 months ago |
Question | — |
How to programmatically evaluate Excel data validations using .NET? What I would like to do: 1. Set a cell value. 2. Check with a program if cell values conform to data validation rules. I could extract all the information needed to create a validation function, but I don't want to re-invent the wheel. What I have in mind is along the lines of how NPOI allo... (more) |
— | 6 months ago |
Answer | — |
A: Drop-down values in Excel cells are not specified in Data Validation rules and global search didn't find them in workbook, so where do they come from? It took a day and a half, but found it: 1. LEFT column's valid values, `Assessed` and `Pending` Started with the left column, because if it is not set, then the right column is "inactive", so it clearly has to trigger something. After several global workbook searches on the string `Pending`, I ... (more) |
— | 6 months ago |
Question | — |
Drop-down values in Excel cells are not specified in Data Validation rules and global search didn't find them in workbook, so where do they come from? On top of values seemingly coming from nowhere in multiple columns, they also affect each other's behavior: In the GIF below, if the cells in the left column have no value selected, then there is no dropdown in the cells in the right column and they also don't accept arbitrary values (as a validation... (more) |
— | 6 months ago |
Answer | — |
A: Which .NET project can programmatically validate a cell's value out of the box based on Excel data validation constraints? Here's a list of popular Excel .NET projects that don't have this functionality: | | Has built-in cell validation? | |--------------|-------------------------------| | Open XML SDK | no | | NPOI | no | | EPPlus | no? (see section 3. belo... (more) |
— | 6 months ago |
Question | — |
Which .NET project can programmatically validate a cell's value out of the box based on Excel data validation constraints? Are any of the popular Excel .NET projects have a functionality similar to Apache POI's `DataValidationEvaluator` class? (more) |
— | 6 months ago |
Question | — |
How to "materialize" Ionide function signature type hints as comments? For example, given this function head, this is the hint that is generated: ```fsharp let updateCell workbook sheetIndex rowIndex columnIndex value = // XSSFWorkbook -> int -> int -> int -> string -> unit ``` Helpful, but this hint cannot be saved with the source code, and it also cannot be c... (more) |
— | 6 months ago |
Question | — |
Where is the `.fsproj` project file documented? More specifically: Is there a dedicated docs page listing "properties" that are idiosyncratic to F# `.fsproj` project files? Why am I asking? Started learning F# a couple of days ago, but just now starting to realize that I will also have to learn the .NET ecosystem as well: Came across the ... (more) |
— | 6 months ago |
Question | — |
How to automatically add package reference into project file after installing .NET package? Just getting into F#, finally figured out how to add .NET packages to projects, but the way I managed to get it to work doesn't make sense. Once the package is installed (either with `nuget` or `paket`), I have to manually add a reference to the project file (either by editing it directly or with `do... (more) |
— | 6 months ago |
Answer | — |
A: How to create and manipulate (read/write) Excel (XLSX) documents with complex rules using general programming languages? All of these projects use Microsoft's OpenXML SDK for Office behind the scenes: 1. .NET (F#, C#) The F# Guide recommends NPOI, which also seems to be the most popular and most up-to-date, but there are others as well (ClosedXML, EPPlus). 2. Elixir + `elixlsx` seems to be only for manipula... (more) |
— | 6 months ago |
Question | — |
How to create and manipulate (read/write) Excel (XLSX) documents with complex rules using general programming languages? Our organization (blindness non-profit in California) is obligated to submit reports to grant organizations (e.g., Department of Rehabilitation) on a regular basis. Most of the time, this means exporting data from our case management system and copying it manually into an Excel template file containi... (more) |
— | 6 months ago |
Answer | — |
A: What are the benefits of starting a Git repo with an empty commit? Quoting an answer from SO: > Perhaps there was an advantage years ago prior to version 1.17.12 which added the `--root` option to rebase. Nowadays though, I can't think of any reason to start with an empty commit for a new repository. > > However, there may still be some minor advantages when r... (more) |
— | 6 months ago |
Question | — |
What are the benefits of starting a Git repo with an empty commit? Found an article about starting a repo with an empty commit. Read the post a couple of times, but still don't understand the reasoning: 1. > ##### 1. `git log` and other commands blow up with terrifying error messages. > ##### 2. You can’t `git reset` back to that initial state. Based on... (more) |
— | 6 months ago |
Answer | — |
A: What is the point of triggering CI/CD with an empty git commit? Based on the SO comments, this is not a good general practice, and I believe the point of the posts mentioned in the question is that + it can be done (but one probably shouldn't) + this can be used to test a CI/CD build service/system without having to add a contrived change. It seems that a ... (more) |
— | 6 months ago |
Question | — |
What is the point of triggering CI/CD with an empty git commit? I read posts (e.g., 1, 2, 3) that recommend triggering a CI build process by pushing an empty git commit. I don't understand how this is a good idea as the commit history will be peppered with meaningless entries, and they can't be removed without re-writing the hashes (e.g., `git rebase --intera... (more) |
— | 6 months ago |
Question | — |
How to programmatically click through a list of elements if one has to wait for a click to load a set of predefined new elements? I would like to download the old-time radio show I Love a Mystery from the OTRR website. I figured out how to construct the list of right URLs, ```javascript const urlStub = "https://otrr.org/OTRRLibrary/jukebox/"; copy(Array.from( document.getElementsByTagName('a')). map( a => `"$... (more) |
— | 7 months ago |
Question | — |
What software architecture are available for developing an application with multiple business domains that only share some common aspects? > NOTE\ > The meaning of the word "program" below is > > > (PROGRAM) A federal or state initiative that offers grants for non-profits so that they can provide service at low cost or free of charge. > > and not a software application or online service. When I mean software, I use "application". ... (more) |
— | 7 months ago |
Question | — |
How to implement a relationship between 2 tables where the type of participation is mandatory and RESTRICT rule for both? Found the example below in a book teaching logical database design, but I'm stuck on how one would implement this in PostreSQL: ![enter image description here][1] The diagram reflects the following business rule: > An instructor must teach one class, but no more than eight classes. This i... (more) |
— | 7 months ago |