How to model manufacturing shift data with irregular production times?

Problem Setting:

Let’s say there are three shifts a day in a manufacturing plant. The plant suffers from irregular power supply thereby affecting in how it is functioning in time and the shift’s production. Therefore, you have the manufacturing process going on for a while and then pauses due to power outage(or lunch break) to be resumed when the power is back on. This on/off pattern of power is pretty much inconsistent and unpredictable.

Objective:

By mining data of the past history, I want to come up with a model that given a point in a day of a shift I want it to be able to forecast the production for the rest of the shift(possibly accounting for the likelihood of experiencing power outages).

I was hoping for some perspective and idea in how to go about making this problem a machine learning problem and some advise in picking techniques amenable to the problem.

Developer to Production Cashe

Magento 2.2
Hi all been using MAGE for about 2 months now and I am a Neophyte to front and back end. I am looking for a little guidance in changing form “developer” to “production” mode. I don’t use the CL, I use a combo of my FTP access and CMS.

  1. What is the order of changing modes?
  2. What cashe folders do I delete?

I changed modes by going to:

  1. app/etc/ and opening env.php
  2. then I changed MAGE_MODE’ => ‘developer’ to MAGE_MODE’ => ‘production’

I have read that I have to delete the files in the cash folders.

  1. What should I do first? Delete cashe or change modes?
  2. Which folders and which files should I clear from what file paths?(In the examples I have seen the file structure is different from mine).

I have read a few articles and posts on when to use which mode but I am still a little unclear. Could you give me examples of what mode to use for what?

  1. Developer mode: What tasks should I do in this mode?
  2. Production mode: What tasks should I do in this mode?

I hope this is not too tall an order to ask. So please forgive my newness to Magento. I really appreciate you offering your professional advice and time!!!!

Thank you so much !!!
Humbly,
the Mage_Neophyte

Production REP token contract migration process

What occurred during the production REP token contract migration scheduled to begin at 11AM PST on August 9th?

This is an automatic migration, meaning REP token holders do not need to do anything. While there is not an exact timeframe of how long migration will take, the estimation is 8 to 10 hours, assuming there are no hiccups and all goes well.

What happens during the estimated 8 to 10 hour migration period?

  • Is there migration code that handles the new REP token contract being minted 1:1 to all REP token holders or will this handle some degree of manual intervention (for exchanges or other parties)?
  • What method was used to validate the 1:1 minting based on all REP token balances at the time of the migration?

How do I rename a table with minimal downtime in a production postgres database?

I understand that renaming a table in postgres boils down to a simple catalog update. However, it also requires an ACCESS EXCLUSIVE lock to ensure transactions are safe.

What would be the ideal way to do this on an active table in production? Wouldn’t naively calling alter table foo rename to bar end up blocking newer transactions until the DDL can get its exclusive lock?

Would trying set lock_timeout TO '1s' and attempting the DDL multiple times until it can succeed be a better strategy? Or should I just bite the bullet and take my system offline for a minute or two and get it over with?

Is it known for sure that bases feel slippery because of the production of soap/surfactant?

Discussion around the question Why does bleach feel slippery? has started me thinking about the saponification explanation for the slippery feeling of basic solutions.

According to Wikipedia:

Alkaline drain openers can dissolve hair (containing proteins) and fats inside pipes via alkaline hydrolysis of amide and ester respectively:

$$ce{RCONH2(amide or proteins)+ OH− → NH3 + RCOO−}$$

$$ce{RCO2R’(ester or fats)+ OH− → R’OH + RCOO−}$$

and just above that:

Essentially, the hydroxide ions from the basic lye attack the carbonyl carbons of the fat, which eventually kicks off the hydrophobic tails of the triglyceride (tristearin/fat) to isolate glycerol.

So I am not sure if the “saponification” explanation for why a small amount of a fairly strong base feels slippery between thumb and forefinger really says that the reaction has produced a true soapy surfactant or that it should really say that it is lubrication by glycerol-like compounds that generate the intense slippery feeling.

Wikipedia also says:

The Stratum corneum (Latin for ‘horny layer’) is the outermost layer of the epidermis, consisting of dead cells (corneocytes). This layer is composed of 15–20 layers of flattened cells with no nuclei and cell organelles. Their cytoplasm shows filamentous keratin. These corneocytes are embedded in a lipid matrix composed of ceramides, cholesterol, and fatty acids. (emphasis added)

Corneocytes are keratinocytes and named as such because of the abundance of keratin protein filaments they contain.

I seem to remember my very smart high school chemistry teacher telling us that the breakdown of protein was also important, but I don’t remember the production of soap as being so central. So I’d like to ask if there is any actual empirical evidence – ideally with a scientific reference, that demonstrates which molecules present between the fingers in this situation is primarily responsible for the slippery feeling. Potential candidates might include:

  1. Soap/surfactant,
  2. Glycerol produced from hydrolysis of “finger lipids”,
  3. Broken down protein products, or
  4. the pre-existing inter-cellular lipid layers that would be exposed by the removal of successive layers of cells within the stratum corneum.

below: Epidermal layers, from here.

enter image description here

How do you determine if the production function has decreasing returns to scale?

How do you determine this for the production function $f(k,l) = k^{1.4}l^{0.5}$ ?

So far, I have found the marginal product of both labour and capital however, the marginal product of labour is diminishing but the marginal product of capital is rising. Therefore, how do I determine the overall effect? Does this function display diminishing or increasing returns to scale?

How to replace the production website with the development one?

I’ve been let down with a developer going AWOL half-way through a project and have had to learn as I go to get our new site sorted.

The current site is : ourdomain.co.uk/

We have the development site on : ourdomain.co.uk/beta2

How do I replace the live site ?

My plan is to backup, delete old site files and replace with files from /beta2 and use an extension I have for 301 redirects.

Please advise if this is a bad thing to do a better way.

Scaling Magento 2 on multiple containers in production with generated code

I’m working on some auto-scaling Kubernetes infrastructure to run Magento 2, and I noticed that when I start new containers, I can’t have the generated/ directory automatically compiled as part of the container image build—it seems like it needs a working Magento installation (which I’m not guaranteed to have when building the container) to compile.

So currently what I’m doing is, when a new container starts up (e.g. when autoscaling, or when updating code, and new containers are replacing old ones):

  • Check if Magento is installed.
  • If it is installed, run:
    • bin/magento module:enable --all
    • bin/magento setup:di:compile

This seems to work okay, and the new container works just like the old/existing ones—if I don’t do the compilation step, I just get lots of fatal exceptions until I do the compilation.

But my question is this: is there some other/better way of handling the generated/ directory when you want to run Magento on multiple hosts/containers?

Should I share the generated/ directory via NFS like I do for var/? It seems that reading code out of that directory would be a lot slower with NFS… and maybe the extra minute or so it takes to start a new container is worth the tradeoff to have each container compile/optimize it’s own DI code (vs. sharing the directory with other existing containers).