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.
Search
Many languages support the concept of functors or function objects which are classes only containing a method/member function. Most notably C++ STL was designed around this - whenever you declare ...
The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user h...
I agree with you in that using MutableLiveData for achieving this feels wrong. I think this is because: LiveData is meant for sending data to LifecycleOwners such as Activity or Fragment, abstra...
I made carousel image slider by following tutorials. To slide images , I made the below function. const moveToSlide = (track, currentSlide, targetSlide) => { track.style.transform = 'translat...
Rather than re-iterate all of its points, I will link Netlify's reasoning in To WWW or Not WWW . It's a very eloquent article. That said, I'll try to summarize in my own words: You need to us...
Just to confirm the terminology commonly used in mobile app development: Native apps - Written in compiled languages compatible with the target platform, uses platform-specific APIs. Hybrid app...
A standard form tag such as <input type="captcha"> won't exist. Browsers are not to be trusted to self-regulate a Captcha service. Without getting into specific examples, there are browser e...
I have a column that is a concatenation of 5 other columns plus a join to a different table. UPDATE db.a JOIN db.b ON fk_b = b.pk SET concat_field = CONCAT(field1,field2,field3,b.field,field4,fi...
Found the problem: I wasn't using router in some links and the whole app was restarted.
My vote is also for moving such Qs. Main arguments: PU already contains some Qs related to office suite and they're OnTopic there. This kind of Qs doesn't fit well to software development. So i...
I don't think this is possible in MySQL due to its computed columns limitations: Literals, deterministic built-in functions, and operators are permitted. A function is deterministic if, given th...
I would like to maintain a log that is available to several modules in my Angular 8 system. So I created the following service: @Injectable({ providedIn: 'root' }) export class LogService { ...
I have reached OpenAI's support and one way to generate more accurate multiline responses is to use a clear separator between each question and answer block of text. My final working code is the fo...
I am interested in finding out all the aspects I need to cover in order to correctly assess if a user has stopped interacting with a web page. So far, I found the following: Idle Detection API -...
Many questions and answers on Software might involve a lot of code that typically require more width and/or height to be displayed in a way that is easy to read. Why simply not enforce resize: non...
It's worth noting that logging out a user goes way beyond not fetching a token, because your UI needs to inform the user he is about to be (or has been) logged out. And if your UI closes or locks i...
During a presentation of a pipeline configuration, a colleague showed a SonarQube integration and one of its reports. A warning was caused by overrunning the max value for the code complexity thres...
I would like to ask a question about the pros/cons of using a library or more generally a way of assertion of complex data models. This is more related to testing than it is to actual coding, but ...
See this picture How do you answer in that thread? Hmm, there are two buttons. One says "show more". I click on that and the thread collapse. Is that "more"? Ok, so I click on the thread agai...
I use the devise authentication gem for a Rails application and it's very convenient. Typically I want my users to confirm their registration by email. Therefore the User model looks like class U...
I am attempting to write a program to simulate Hunt The Wumpus in the K programming language. The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangu...
If you do not mind having so much code on a single line, the builder pattern might be useful here. Something along the lines: Note: the example is adapted based on an implementation I have done in...
I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...
You should be able to pre-set confirmed_at when you create the User instance: user = User.new(confirmed_at: DateTime.now) # plus any other details you want user.save!
Syntax-wise it is a function specifier and may in theory appear everywhere where inline (or rather the syntax item function-specifier:) can appear, since the standard doesn't say otherwise. Though ...