Stop being auto-subscribed to GitHub repositories from an organisation

I’ve been joined to a GitHub “organisation” for some things I do at the day job occasionally (administrative and Debian packaging things). I’m not normally involved in the development of the stuff hosted by that GitHub organisation.

However, when someone creates a new repository on that organisation, I am automatically subscribed to it and need to manually unwatch it, all the time.

How can I stop being automatically subscribed to new repositories—ideally, for one particular organisation only?

Trying to install Wine on 18.04.2 but can’t add libwine and libicu60 repositories

Errors

I executed the following commands:

sudo dpkg –add-architecture i386

wget -nc https://dl.winehq.org/wine-builds/Release.key

sudo apt-key add Release.key

sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/

Then I got the following errors :

Err:10 http://in.archive.ubuntu.com/ubuntu/bionic/universe/amd64/libwine/amd64/3.0-1ubuntu1 bionic Release
404 Not Found [IP: 91.189.88.149 80]

Err:11 http://in.archive.ubuntu.com/ubuntu/bionic/main/i386/libicu60/i386/60.2-ubuntu3 bionic Release
404 Not Found [IP: 91.189.88.149 80]

Get:12 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Reading package lists… Done

E: The repository ‘http://in.archive.ubuntu.com/ubuntu/bionic/universe/amd64/libwine/amd64/3.0-1ubuntu1 bionic Release’ does not have a Release file.

N: Updating from such a repository can’t be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository ‘http://in.archive.ubuntu.com/ubuntu/bionic/main/i386/libicu60/i386/60.2-ubuntu3 bionic Release’ does not have a Release file.

N: Updating from such a repository can’t be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

End-of-Life v. End-of-Support v. Moving of Repositories

So, I am still using 14.04 at the moment and I know that end-of-support is coming at the end of this month unless you have extended security maintenance (which I don’t).

However, I am a bit confused as to what exactly will happen. Searching online, I have seen two terms floating around: end-of-support and end-of-life. From what I can tell, both are different from what Canonical means when they refer to a realse’s lifespan. The trouble I have is telling if there is a difference between the two. Some pages I read treat them interchangeably while others do not. Some posts I have read use end-of-life to refer to when the repositories get moved/archived; thus prevent things such as the auto-updated from working.

Regardless of which is which, when does the Ubuntu repository get archived? There doesn’t seem to be a mention of that at the information page and the online posts I found simply mention that it happens, not when.

DDD accessing reference values in Domain layer without repositories

So I have built a domain model and some logic into that. I have created two repositories for two aggregate roots.

My question is how to access to the reference data from these layers?. For example, say we have the following types Elder and Young.

Our application entry points expect Elder or Young as inputs. But, to validate and save this in the database (which has a foreign key to another table PERSON_TYPE which has these 2 values), I need to convert these IDs to store aggregate roots.

Could I create a PersonTypeRepository (in the domain layer) and use it when I persist my aggregate roots? Should this conversion happen in domain layer or should it happen in the application layer? For example, from a service

Object Oriented Design: Repositories and Inheritance

I have an OO design concern: let’s say in my model I have a base class – eg. class Account {} – and two subclasses that extend it – eg. class LocalAccount extends Account {} and class SocialAccount extends Account {}.

These Account entities are persisted, and I could retrieve them (or do more operations on them) through a typical Repository. Let’s say I have the following interface:

AccountRepository:

interface AccountRepository {     getAll(): Array<Account> ; } 

And I have some use-cases where I need to work with Accounts where I basically would inject the AccountRepository, eg.

class FooUseCase {      private AccountRepository accountRepository;      constructor(AccountRepository accountRepository) {         this.accountRepository = accountRepository;     }      public execute(): void {         // Use case logic where I would call accountRepository.getAll()     }  } 

And at this point is where I am actually struggling. After some analysis, I thought about having specific AccountRepository implementations:

LocalAccountRepository:

class LocalAccountRepository implements AccountRepository {      public getAll(): Array<LocalAccount> { /* implementation */ }  } 

SocialAccountRepository:

class SocialAccountRepository implements AccountRepository {      public getAll(): Array<SocialAccount> { /* implementation */ }  } 

This would be alright, as far as a use-case would just need to work with LocalAccount or SocialAccount entities. But, what would happen if I would just needed to work with Account entities?

I feel I could implement an AccountRepository, generic enough that could just return a list of Accounts, eg.

AccountRepositoryImpl:

class AccountRepositoryImpl implements AccountRepository {      public getAll(): Array<Account> { /* implementation */ }  } 

but I feel that at the public getAll(): Array<Account> I would somehow have to add some kind of switch/if-else statement to be able to create each type of Account object:

AccountRepositoryImple.getAll():

public getAll(): Array<Account> {     // Database access, query, etc.      // results iteration      let account: Account;      if (result.type === AccountType.Local) {         account = new LocalAccount(/* params */);     } else if (result.type === AccountType.Social) {         account = new SocialAccount(/* params */);     }      accounts.add(account);      // iteration end      return accounts; } 

Which clearly violates some design principles (every time a new Account is added would have to extend the if-else, etc.).

Any design improvement suggestions to my issues?

error adding Add kali linux repositories

1) Add Kali repositories & Update  2) View Categories 3) Install classicmenu indicator 4) Install Kali menu 5) Help   kat > 1  1) Add kali linux repositories 2) Update 3) Remove all kali linux repositories 4) View the contents of sources.list file   What do you want to do ?> 1 Executing: /tmp/tmp.sjbvOS10vq/gpg.1.sh --keyserver pgp.mit.edu --recv-keys ED444FF07D8D0BF6 gpg: requesting key 7D8D0BF6 from hkp server pgp.mit.edu gpgkeys: key ED444FF07D8D0BF6 can't be retrieved gpg: no valid OpenPGP data found. gpg: Total number processed: 0 gpg: keyserver communications error: keyserver helper general error gpg: keyserver communications error: unknown pubkey algorithm gpg: keyserver receive failed: unknown pubkey algorithm  1) Add kali linux repositories 2) Update 3) Remove all kali linux repositories 4) View the contents of sources.list file 

Retrieving spring repositories in an elegant way

My goal is to prevent putting all necessary repositories for SpringControllers into the constructor of each one to retrieve access.

I found in this SO-Question How to retrieve spring data repository instance for given domain class?

the following answer I am trying to utilize,

@Service public class GenericRepository {    @Autowired   private WebApplicationContext appContext;    Repositories repositories = null;    public GenericRepository() {       repositories = new Repositories(appContext);   }    public JpaRepository getRepository(AbstractPersistable entity) {       return (JpaRepository) repositories.getRepositoryFor(entity.getClass());   }    public Object save(AbstractPersistable entity) {       return getRepository(entity).save(entity);   }    public Object findAll(AbstractPersistable entity) {       return getRepository(entity).findAll();   }    public void delete(AbstractPersistable entity) {       getRepository(entity).delete(entity);   } } 

but I think (due to the fact I am new to spring) I have some misunderstandings. My first question is does this solution help me retrieve any repository in my current context? The follow-up question would be how do I pass a class to get the correct repository.

For example I have defined a repository

public interface ARepository extends JpaRepository<MyObject, Long> {..} 

and further for B to Z and all of them have special interfaces with @Query definitions. I need to access them all from

@RestController public class AlphabetController {..} 

Currently I would creating a constructor this way

public AlphabetController(ARepository arepository, BRep...) {     this.arepository = arepository;     this.brepository = brepository;     ... } 

is there a better way?

How to get a decoupled design without injecting repositories inside entities

I am facing the following situation:

I have to develop a system that has to calculate the price of a car so i need to calculate the prices of all the Pieces that make up the car and then total them.

We have two main entities:

public class Car {     public int Id{get;}     public List<PieceOfCar> Pieces{get;}     }  public abstract class PieceOfCar {     public double UnitCost{get;}     public double  Transportation{get;}     public string  IdOriginCountry{get;}     public abstract double GetTaxPrice();    {         //how do i design this part?    } } 

Depending on the IdOriginCountry, the PieceOfCar Taxes should be calculated in different ways.

For example in USA:

List<TaxUSA> taxesInUSa= TaxesRepository.GetTaxFromUSA(); //different type of objets are used to calculate double taxUsa = UnitCost* taxesInUSa.TaxTrump + Transportation* taxesInUSa.TaxClinton; 

In India:

List<TaxIndia> taxesInIndia = TaxesRepository.GetTaxFromIndia(); //different type of objets are used to calculate double taxCost = (UnitCost + Transportation)^ taxesInIndia.BadulakeTax ; 

As you see, each piece of car, depending on the IdOriginCountry, have different calculations formulas and different requirements of data. USA parts needs some objects, and Indian parts needs others.

How you will solve that problem?

I tried the factory method pattern, but i was forced to inject the TaxesRepository inside the PieceOfCar entities, so i don’t think its a good idea. Pieces of car are actually extracted from a repository, so i want all entities without dependencies to any repository.

Example:

public IndiaPieceOfCar:PieceOfCar() {      public IndiaPieceOfCar(TaxRepository taxesRepo)      {//TaxRepository  injected}       public override double GetTaxPrice();      {          var taxesIndia= TaxesRepository.GetTaxFromIndia(); //different type of objets are used to calculate         return (UnitCost + Transportation)^ taxesIndia.BadulakeTax ;      }   } 

I would like to get the tax calculation decoupled. What would you suggest?

Factory method will do the job if the parameter for all the GetTaxPrice() were the same for all IdOriginCountries, but I am not that lucky and each country requires specific set of parameters.

Also the info retrieved by the taxesRepositories is an array of objects, it will be nice if it is not retrieved every time I create a PieceOfCar instance. If you need more info please let me know.

Multi module Maven project or separate repositories?

Consider the following architecture:

  • Application A
  • Application B
  • Commons-Util

A and B share a lot of functionality. That’s why we plan to extract the shared code into a commons library.

I am aware of the advantages and disadvantages of multi modules vs. separate repositories. However, I’m not sure for what to go in this specific case.

  • A and B should be releaseable and deployable separately (+ separete repos)
  • A and B should always depend on the same Commons-Util library (+ multi module). Therefore, dependency management should be at a central place (+ multi module).
  • Team A and Team B should be independant (+ separate repos)
  • No other projects besides A and B are using Commons-Util (+ multi module)

What’s the best solution in this case?