dry Questions

6

Solved

My package version is defined in two places: __version__ = 1.2.3 in mypackage/__init__.py version = "1.2.3" in pyproject.toml (I am using Poetry) I have to update both whenever I bump t...
Semanteme asked 14/4, 2021 at 3:18

4

Solved

I have several hierarchies separately listed out below where first selector is the parent div, second is the image item within the div. But could I combine these somehow? .outdoors .how-to-image {...
Hagai asked 11/2, 2015 at 22:5

4

Solved

How it is possible to make a dry run with sed? I have this command: find ./ -type f | xargs sed -i 's/string1/string2/g' But before I really substitute in all the files, i want to check what it...
Dessert asked 22/12, 2010 at 20:55

3

Solved

I know that the topic isn't new and I found (and read) a few discussions. What I couldn't find is an answer to my still remaining question. How do others work around the problem of not being able t...
Collusion asked 12/10, 2020 at 15:57

2

I have the need to restrict access to certain files based on a query string parameter. I have an NGINX proxy server that sits in front of several other nginx web servers for load balancing. I have ...
Transfigure asked 19/2, 2013 at 19:40

2

Solved

I'm creating a GraphQL API using NestJS and TypeORM. Starting with the classic User entity I've created both the user.type.ts and the user.entity.ts as described by the Nestjs documentation. This i...
Hypogenous asked 10/12, 2020 at 16:39

5

Solved

When writing tests with JasmineJS I have many tests that have similar beforeEach/afterEach code. Is there a way to implement an inheritance model using JasmineJS test suites? I can group all test...
Bedard asked 26/6, 2013 at 10:40

1

Solved

I have just recently started using .Net MAUI. But now I'm wondering how to use a piece of code, e.g. a self-made navigation bar on all my pages, because it doesn't make sense to write the same code...
Flame asked 10/12, 2022 at 8:50

15

Solved

I want to use the same {% block %} twice in the same django template. I want this block to appear more than once in my base template: # base.html <html> <head> <title>{% block ...
Chavers asked 4/2, 2009 at 12:4

14

The goal is to build a program to convert scores from a '0 to 1' system to an 'F to A' system: If score >= 0.9 would print 'A' If score >= 0.8 would print 'B' 0.7, C 0.6, D And any value be...
Dygal asked 4/4, 2020 at 15:45

3

Solved

I have two enums: Main Menu Options public enum MainMenuOptions { EXIT("Exit"), VIEW_RESERVATIONS("View Reservations By Host"), CREATE_RESERVATION("Create A Reservatio...
Treadwell asked 3/1, 2022 at 18:40

6

Solved

I know it's not possible to inherit constructors in C#, but there's probably a way to do what I want to do. I have a base class that is inherited by many other classes, and it has an Init method t...
Deerhound asked 6/10, 2010 at 14:8

3

First of all, sorry for the bad title, but I find it somewhat difficult to summarize my issue in one short sentence... There's some code in our software which I'm quite unhappy with. It goes like t...
Nereid asked 21/9, 2021 at 20:4

5

I have some class which looks like this: struct A { void *stuff; int x; int foo() const; } And I have some functions which take parameters of this type, e.g. int bar(A a1, A2 a2); int baz(A2 a...
Weald asked 2/7, 2021 at 14:1

12

Solved

I have a some simple Java code that looks similar to this in its structure: abstract public class BaseClass { String someString; public BaseClass(String someString) { this.someString = someStri...
Irrupt asked 29/7, 2009 at 1:28

4

Solved

My simplest ASP.NET MVC 2 controllers make calls to my service layer and map view models to entities using AutoMapper. Everything looks fantastic and there is no repeated code. However, when I get...

3

Solved

According to the official Marshmallow docs, it's recommended to declare a Schema and then have a separate class that receives loaded data, like this: class UserSchema(Schema): name = fields.Str...
Unicuspid asked 23/8, 2017 at 6:11

2

Solved

I looking for best way manage state of form in React with TypeScript. My simple form have two values: login and password fields. I implement IState interface for form state and DRY handleChange met...
Hodess asked 2/2, 2019 at 13:24

3

Solved

I have some confusion about use of Controller with Repository Pattern while maintaining SOLID Principle. Consider, I have two types of Quotations Commercial Quotation Private Quotation And ther...
Almaalmaata asked 29/11, 2015 at 12:59

3

Solved

I am trying to use a trait as a typehint for my Laravel resource controllers. The controller method: public function store(CreateCommentRequest $request, Commentable $commentable) In which the...
Supersaturated asked 9/9, 2017 at 7:59

7

Solved

I want to accomplish something simple using gulp. I want to write a generic method to move files to an output directory from a particular source directory. pretend we have something like so var ...
Serapis asked 1/9, 2015 at 1:14

2

Solved

I have that Code example: from time import sleep import asyncio class bird: def __init__(self, sleeptime=1): self.var = sleeptime def wait_meep(self): sleep(self.var) print("Meep"...
Contrail asked 27/8, 2020 at 11:20

6

Solved

I am building an app with Symfony 2, and I am wondering, how could I handle errors when I try to read a index in an array that doesn't exist? Sadly this kind of errors don't throw exceptions, so I ...
Lunisolar asked 31/10, 2013 at 10:24

10

Solved

I'm using Django on Appengine. I'm using the django reverse() function everywhere, keeping everything as DRY as possible. However, I'm having trouble applying this to my client-side javascript. Th...
Chang asked 27/4, 2010 at 19:30

1

Solved

I am working with Elasticsearch persistence model, and have some common methods for each index. Given an Events Index, I have a service class where some methods are defined, the same goes for oth...
Indigested asked 24/4, 2020 at 12:25

© 2022 - 2025 — McMap. All rights reserved.