development strategy – Yet another child theme building question: Frankenchild themes

I’m about to build a new site based on a theme close to what I’m looking for. I understand the concepts around child theming & have read the caveats about overriding php or css files like the one described here.

Using such workarounds and calls from functions.php, is it possible to build a “Frankenchild theme” by taking chunks of a second (would-be parent) theme and patching them into the child theme? I’m not quite asking about creating a child of two parents; the child would only have one “official” parent.

As an example: Start with a Gantry basic theme and add custom taxonomy search capabilities & search results formatting (say a card-based carousel). Is that stepping over the line into plugin development?

java – Architectural problem for class combination (cartesian product) for save format strategy

Hello to everyone and thank you for any suggestion.

I have a family of subclasses of Track (Track is abstract).
Every concrete Track has a different number and types of fields (attributes) that extend the basic abstract track-fields.

Then I have a family of file-types that implement some methods (saveRow() etc..).
Every file is presumed to have different type of row-formatting (imagine csv tabs, headers etc..)

ex:

  • SimpleTrack: double lat, double lon, Calendar dateTime.
  • DetectionTrack: (as SimpleTrack) + boolean detection.
  • ..
  • CsvFile
  • TxtFile

When I create a new (X)Track and a (Y) file, they are independent by nature, but.. the row is a cartesian product of track & row types.

EDIT
(to be more clear): How can I have many concrete-tracks in one hand and many FileTypes in the other hand, and create well-formatted-rows (differents for every file) by tracks which have different data (columns, headers..)?
es:

  • XtrackRow(double a, double b, Calendar date) -> to -> CVSfile (tab delimited with headers)
  • XtrackRow(double a, double b, Calendar date) -> to -> TXTfile (formatted columns and title)
  • YtrackRow(double a, string, b, int c, double e) -> to CSV ..
  • YtrackRow …. -> to -> docx file (with another kind of table or tabulation)
    ..

I see two kinds of solutions:

  1. Tracks send (right)-formatted row to file: every track has to know which kind of format apply (to rows) to give them to save to any specific type of file.
  2. Tracks send raw-data to any kind of file which is responsible to format them: in this case, the file-class must know wich kind of data has to format (every track has diffrent contents, columns, headers..). Moreover, every track-class has to send different number and types of parameter..

The second solution seems to be more fitted to the Single-Responsibility principle.. but I have no Idea how to implement it.

I tried to use Bridge Pattern to solve this problem (using first solution):

abstract class Track{
  ...
  FileInterface file;

  Track(FileInterface fileType){
    this.file = fileType;
  }

  abstract String formatConcreteTrackRow();
  
  void sendRow(){
    String rowToSave = formatConcreteTrackRow();
    file.saveRow(rowToSave);
  }
}

By this way the problem is not already solved, because every concrete-track has to implement a set of methods which returs right formatted rowString: one for every file-type.
If I use a Strategy Pattern:

class SimpleTrack extends Track{
  ...
  RowFormatStrategy rowStrategy;
  
  @override
  String formatConcreteTrackRow(){
    return this.rowStrategy.getRowString("args")
}

but in this case.. every concrete-track require a different StrategyInterface, because every concrete-track has different number and types of arguments to elaborate..
If I do not use Strategy Pattern and I define a set of methods (formatCsvRow(args),formatTxtRow(args)..) I need to include a switch(fileType) loop to choose which method to use.. breaking SOLID principles.. 🙁

Moreover..
how to impose, for every new concrete-track to have right row-format methods for every existent file-template-row?
and.. How to impose, at the same time, for every new file-class to impose new templates and relative methods in every existent concrete-track?

To be honest, it’s also quite reductive impose formatConcreteTrackRow to be a String, but it’s over and over the main problem.

I’m not interested to maintain this kind of class structure, this is only the best solution I found trying to follow SOLID principles. If you can show me a better solution, my intent is to study and understand SOLID procedures to solve these kind of purposes.

(I looked around for similar questions, but I’m not even able to define the specific problem itself..)
Thank you very much.

java – Architettural problem for class combination (cartesian product) for save format strategy

Hello to everyone and thank you for any suggestion.

I have a family of subclasses of Track (Track is abstract).
Every concrete Track has a different number and types of fields (attributes) that extend the basic abstract track-fields.

Then I have a family of file-types that implement some methods (saveRow() etc..).
Every file is presumed to have different type of row-formatting (imagine csv tabs, headers etc..)

ex:

  • SimpleTrack: double lat, double lon, Calendar dateTime.
  • DetectionTrack: (as SimpleTrack) + boolean detection.
  • ..
  • CsvFile
  • TxtFile

When I create a new (X)Track and a (Y) file, they are independent by nature, but.. the row is a cartesian product of track & row types.

EDIT
(to be more clear): How can I have many concrete-tracks in one hand and many FileTypes in the other hand, and create well-formatted-rows (differents for every file) by tracks which have different data (columns, headers..)?
es:

  • XtrackRow(double a, double b, Calendar date) -> to -> CVSfile (tab delimited with headers)
  • XtrackRow(double a, double b, Calendar date) -> to -> TXTfile (formatted columns and title)
  • YtrackRow(double a, string, b, int c, double e) -> to CSV ..
  • YtrackRow …. -> to -> docx file (with another kind of table or tabulation)
    ..

I see two kinds of solutions:

  1. Tracks send (right)-formatted row to file: every track has to know which kind of format apply (to rows) to give them to save to any specific type of file.
  2. Tracks send raw-data to any kind of file which is responsible to format them: in this case, the file-class must know wich kind of data has to format (every track has diffrent contents, columns, headers..). Moreover, every track-class has to send different number and types of parameter..

The second solution seems to be more fitted to the Single-Responsibility principle.. but I have no Idea how to implement it.

I tried to use Bridge Pattern to solve this problem (using first solution):

abstract class Track{
  ...
  FileInterface file;

  Track(FileInterface fileType){
    this.file = fileType;
  }

  abstract String formatConcreteTrackRow();
  
  void sendRow(){
    String rowToSave = formatConcreteTrackRow();
    file.saveRow(rowToSave);
  }
}

By this way the problem is not already solved, because every concrete-track has to implement a set of methods which returs right formatted rowString: one for every file-type.
If I use a Strategy Pattern:

class SimpleTrack extends Track{
  ...
  RowFormatStrategy rowStrategy;
  
  @override
  String formatConcreteTrackRow(){
    return this.rowStrategy.getRowString("args")
}

but in this case.. every concrete-track require a different StrategyInterface, because every concrete-track has different number and types of arguments to elaborate..
If I do not use Strategy Pattern and I define a set of methods (formatCsvRow(args),formatTxtRow(args)..) I need to include a switch(fileType) loop to choose which method to use.. breaking SOLID principles.. 🙁

Moreover..
how to impose, for every new concrete-track to have right row-format methods for every existent file-template-row?
and.. How to impose, at the same time, for every new file-class to impose new templates and relative methods in every existent concrete-track?

To be honest, it’s also quite reductive impose formatConcreteTrackRow to be a String, but it’s over and over the main problem.

I’m not interested to maintain this kind of class structure, this is only the best solution I found trying to follow SOLID principles. If you can show me a better solution, my intent is to study and understand SOLID procedures to solve these kind of purposes.

(I looked around for similar questions, but I’m not even able to define the specific problem itself..)
Thank you very much.

java – Design pattern problem for class combination (cartesian product) for save format strategy

Hello to everyone and thank you for any suggestion.

I have a family of subclasses of Track (Track is abstract).
Every concrete Track has a different number and types of fields (attributes) that extend the basic abstract track-fields.

Then I have a family of file-types that implement some methods (saveRow() etc..).
Every file is presumed to have different type of row-formatting (imagine csv tabs, headers etc..)

ex:

  • SimpleTrack: double lat, double lon, Calendar dateTime.
  • DetectionTrack: (as SimpleTrack) + boolean detection.
  • ..
  • CsvFile
  • TxtFile

When I create a new (X)Track and a (Y) file, they are independent by nature, but.. the row is a cartesian product of track & row types.

I see two kinds of solutions:

  1. Tracks send (right)-formatted row to file: every track has to know which kind of format use to send formatted-row to a specific type of file.
  2. Tracks send raw-data to file which is responsible to format them: in this case, the file class must know wich kind of data has to format (headers, type of data..). Moreover, every track-class has to send different number and types of parameter..

The second solution seems to be more fitted to the Single-Responsibility principle.. but I have no Idea how to implement it.

I tried to use Bridge Pattern to solve this problem (using first solution):

abstract class Track{
  ...
  FileInterface file;

  Track(FileInterface fileType){
    this.file = fileType;
  }

  abstract String formatConcreteTrackRow();
  
  void sendRow(){
    String rowToSave = formatConcreteTrackRow();
    file.saveRow(rowToSave);
  }
}

By this way the problem is not already solved, because every concrete-track has to implement a set of methods which returs right formatted rowString: one for every file-type.
If I use a Strategy Pattern:

class SimpleTrack extends Track{
  ...
  RowFormatStrategy rowStrategy;
  
  @override
  String formatConcreteTrackRow(){
    return this.rowStrategy.getRowString("args")
}

but in this case.. every concrete-track require a different StrategyInterface, because every concrete-track has different number and types of arguments to elaborate..
If I do not use Strategy Pattern and I define a set of methods (formatCsvRow(args),formatTxtRow(args)..) I need to include a switch(fileType) loop to choose which method to use.. breaking SOLID principles.. 🙁

Moreover..
how to impose, for every new concrete-track to have right row-format methods for every existent file-template-row?
and.. How to impose, at the same time, for every new file-class to impose new templates and relative methods in every existent concrete-track?

To be honest, it’s also quite reductive impose formatConcreteTrackRow to be a String, but it’s over and over the main problem.

I’m not interested to maintain this kind of class structure, this is only the best solution I found trying to follow SOLID principles. If you can show me a better solution, my intent is to study and understand SOLID procedures to solve these kind of purposes.

(I looked around for similar questions, but I’m not even able to define the specific problem itself..)
Thank you very much.

c# – Strategy for Chrome timing out on a Database cleanup job which takes a long time

I have a notifications app which sends users notifications. It uses a .NET core backend, an angular frontend and Cosmos DB. Within this I have an API endpoint function which is linked to a button used to clean up inactive users’ records from the DB based on a selected time period.
This database job takes a long time to complete (up to 30 minutes) and is a problem because chrome’s maximum time out limit is only 5 minutes. This prevents a “Success, users deleted” message from showing up on the client side. What strategy or workaround can I use to avoid this problem?

API Endpoint

        (HttpDelete("CleanUpInactiveUsers/{years}"))
        public async Task<IActionResult> CleanUpInactiveUsers(string years)
        {
            try
            {
                await Queries.RemoveInactiveUsers(years);
                return Ok($"Users inactive for more than {years} have been deleted");
            }
            catch (Exception ex)
            {
                return StatusCode((int)HttpStatusCode.InternalServerError);
            }
        }

Frontend call

// getUsersWithCondition(args) returns the total number of users if args="All", 
// otherwise return no. of users who haven't been active for more than args=<years>
// deleteInactiveUsers() linked with API endpoint snippet above.
.
.
.
            case this.TaskEnum.CleanInactiveUsers:{

              this._apiService.showToast(true, 'Clean Up of inactive users has begun. You will be notified once completed.');

              this._apiService.getUsersWithCondition(item.Params('time')).subscribe((response:string) =>
              {
                this.finalCount = Number(response);
              });

              this._apiService.deleteInactiveUsers(item.Params('time')).toPromise().then(res =>
                {
                    this._apiService.showToast(true, 'Deleted '+ this.finalCount + ' User(s)');
                }
              ).catch((error) => EpDialogService.error({message: 'In App Notification', description: `An error ocurred while executing the task ${ item.Task }`}));
              break;
            }

development strategy – wp-insert-post execute from server?

I wanted to ask for help.

I am working on a project to develop a program to publish a post to many wordpress sites that aren’t on a multisite network but are all on the same server.

the requirements for this program is that it does not take delay for publishing so the post should be sent once onto the server and the server will have to add the post to many sites and the program also needs to filter the publishing of the post to sites with the requested categories.

I Have started to work on it. i found 2 solutions to adding a posts to a wordpress site:

  1. wp-insert-post and other functions in the wordpress documentation
  2. xml-rpc

for now i understand the program will be slipt into 3 parts:

  1. an interface where the sites with the similar category will be selected to the post.
  2. a program on the server that receives the publish request and the chosen sites to submit it to.
  3. a program to publish to the website.

if anyone has any tips and ideas to help or has worked on a similar project please help.

unity – How can I improve the current enemy spawning system for my strategy game

I’m currently making an RTS game for mobile where mini battles would take place on tiny battlegrounds.

The problem is that currently the player is spawning its units based on a currency system, whereas the enemy is spawning based on a timed system. The timed system would make sense in a tower defense game, but not here.

Here is a short clip of it in action: https://twitter.com/LewanayG/status/1378009426808950794

This is my current spawn script:

void Start()
    {
        //start spawning waves
        StartCoroutine(SpawnWaves());
    }

    IEnumerator SpawnWaves()
    {
        //before spawning the first enemies, wait a moment
        yield return new WaitForSeconds(startWait);
        while (true)
        {
            //if not all characters of this wave are spawned, spawn new enemy and that wait some time before spawning next enemy in this wave
            for (int i = 0; i < startEnemyCount; i++)
            {
                int random = Random.Range(0, enemies.Length);
                GameObject newEnemy = Instantiate(enemies(random), transform.position, transform.rotation) as GameObject;
                newEnemy.transform.parent = enemyParent.transform;
                
                yield return new WaitForSeconds(spawnWait);                         // to add some randomness between spawns
            }
            
            //make sure the next wave contains more enemies than this one
            startEnemyCount += extraEnemiesPerWave;
            //wait before starting the next wave
            yield return new WaitForSeconds(waveWait);
        }
    }

Under the current system, as long as the player has more units on the battleground than the current spawn rate of the enemy it will win, and its really difficult to balance this game based on the two spawn systems.

How do you suggest I handle this problem and the spawn system of enemy units?

❕NEWS – 100k BTC is beign donated to Miami 2.0 Blockchain Strategy Foundation | Proxies-free

There has been much talk recently of trying to integrate bitcoin and the blockchain community into the Miami financial economy. In support of this venture, Dubai, and in specific, the IBC Group, known for its private equity investment, has said that are donating close to 4.8 million dollars to Miami in the form of Bitcoin. This shows confidence from Dubai as well when it comes to the integration of Bitcoin into the Miami infrastructure and with such developments, it seems that the Bitcoin economy in Miami is not very far off.

Hashtag Strategy – How To Use Instagram Hashtags To Grow Your Business 2021 (SECRET STRATEGY)

Hashtag Strategy – How To Use Instagram Hashtags To Grow Your Business 2021 (SECRET STRATEGY) In this video I’ll walk you through each step of my own Instagram hashtag strategy which will let you be found as soon as you post something and keep getting found for months even years later…

So if you're looking for an overlooked and secret method to get ranked on high performing Instagram hashtags and to grow your Instagram organically – this hashtag strategy is the best tip out there for…

Hashtag Strategy – How To Use Instagram Hashtags To Grow Your Business 2021 (SECRET STRATEGY)