text:
Q: react-scripts parent folder node_modules error when running in child location When running react-scripts build (Create-React-App) in a sub folder (c:\Repos\web_app1\api_ui) with it's own package.json, node_modules folder, etc. I get the following error:
 react-scripts build

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "babel-loader": "8.0.4"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:

  c:\Repos\web_app1\node_modules\babel-loader (version: 7.1.4)

*

*Updating the parent folder's (c:\Repos\web_app1) babel-loader to v8.0.4 is not an option as web_app1 depends on babel-loader v7.1.4

*Deleting the node_modules in c:\Repos\web_app1 is not an option. This is the parent application and needs its own node_modules.

*My fix was adding SKIP_PREFLIGHT_CHECK=true to and .env file. This seems like a hack and I would like another fix that involves building through the preflight check.

*The package-lock.json in the sub folder (c:\Repos\web_app1\api_ui) has the correct babel-loader version (8.0.4), so why is it going to the parent folder?

Is there a way to ignore parent folder or higher tree node_modules when building react-scripts in a sub folder?

A: This puzzled me a lot too and I did some research, looking in to the source code of react-scripts version 4.0.3. This version requires babel-loader v. 8.1.0. With storybook installed (requiring version ^8.0.0), we get a different babel-loader in the top level node_modules so that we end up with:
|-src
|-node_modules
  |
  |-storybook 6.3.12
  |-babel-loader 8.2.6
  |-react-scripts 4.0.3
    |
    |-node_modules
      |
      |-babel-loader 8.1.0

I get the same error message as a lot of people have seen, and I think to myself, shouldn't any use of babel-loader in react-scripts get the babel-loader in its own node_modules, namely version 8.1.0? I can delete node_modules and package-lock.json any number of times and it seems the problem always persists.
How you describe it in the question is in fact how the package managers (at least npm) works, e.g. importing babel-loader from react-scripts WOULD give it version 8.1.0 from its own node_modules... but we forget about two things, that combined will cause problems:

*

*Package hoisting

*Transitive dependencies

Package hoisting
I won't go into details on when package hoisting occurs, but it happens. Basically, it amounts to a dependency package B of a dependency A being added to the project root node_modules (or some other parent node_modules) instead of to the node_modules of A.
So instead of
|-src
|-node_modules
  |
  |-A
    |
    |-node_modules
      |
      |-B

... we get ...
|-src
|-node_modules
  |
  |-A
    |
    |-node_modules (might exist anyway)
  |-B

Due to how npm works (and as you correctly understood it in the question), if B cannot be found in node_modules/A/node_modules, it will look in node_modules for the package, which makes this work. Hoisting can be an optimization when many packages all need compatible dependencies so that we, instead of storing N similar versions of the dependency, can store only one. It also simplifies the folder structure of the project root node_modules which is then easier to debug. As a matter of fact, the default is to hoist any packages that can be hoisted, e.g. that don't already exist in the node_modules to hoist to.
Usually, fallback to the naive strategy, with "all dependencies for a package in its own node_modules", is used whenever we have conflicting package versions. This is what has happened in the top example with two different versions of babel-loader; storybook really consists of several packages and multiple of them uses babel-loader version ^8.0.0. When storybook is installed before react-scripts, it takes the most recent version of babel-loader which meets the constraint, and it hoists it to the top-level node_modules. This then causes the familiar problems when react-scripts is installed. I have another project with the same setup, but where react-scripts was installed before storybook. There, babel-loader version 8.1.0 is hoisted instead, and since this package also meets the requirements of storybook (^8.0.0), no more babel-loader's are needed. Here, create-react-scripts does not complain. It is of course desirable that npm could figure this order out by itself, which is also optimal from a storage perspective (only one babel-loader instead of two), but as far as I know, npm uses alphabetical order when processing dependencies.
Transitive dependencies
Even though package A is a dependency of my project, A can have dependencies of its own. These are transitive dependencies with respect to my project.
Why doesn't it work?
In the source for react-script version 4.0.3, the file verifyPackageTree is responsible for running the check hat results in the boring error message in the question. This file is no longer around in later prereleases, but in it at the top, we find the comment:
// We assume that having wrong versions of these
// in the tree will likely break your setup.
// This is a relatively low-effort way to find common issues.

A few rows down it says:
// These are packages most likely to break in practice.
// See https://github.com/facebook/create-react-app/issues/1795 for reasons why.
// I have not included Babel here because plugins typically don't import Babel (so it's not affected).

Looking at the referenced thread, there is a discussion about why create-react-app breaks when non-compatible dependencies are installed with the same question as above... WHY doesn't it work?
The final conclusion seems to be that if, for example, react-scripts imports a package X that has been hoisted, this package won't reside in the node_modules under react-scripts but instead in the root node_modules, where (with respect to the topmost example) also babel-loader version 8.2.6 resides (as opposed to version 8.1.0 in the node_modules folder of react-scripts). Now if X were to import babel-loader, it would get the wrong babel-loader, e.g. NOT version 8.1.0 as expected but instead 8.2.6. In the thread this is considered a bug in npm even though I don't exactly know why it would be a bug. Perhaps, there could be some flag indicating whether it is ok to hoist a package or not because if hoisting altogether is considered a bug, it seems like as step backwards.
Because the writers of create-react-app can't know whether some dependency is hoisted or not, they have implemented this simple check which throws a warning. For advanced users they give a chance to opt out of the check with the SKIP_PREFLIGHT_CHECK flag. Also, it is good to remember that the error comes from create-react-app, not npm, so it really doesn't say anything about how npm works, only what the creators of create-react-app considers a problem (which was indeed equally confusing initially).


text:
Q: RabbitMQ not closing dead connections with unacked messages I'm having some problems with RabbitMQ and dead connections. I have a RabbitMQ server and many ec2 instances that connect and comsumes messagens from this server. The problem is that sometimes when I need to terminate an ec2 instance, its conection with RabbitMQ server is not closed.
Because of this we start to see unacked messages that never get back to the ready state. What I currenlty do is use rabbitmqctl to remove this connections and/or use a python script I wrote to kill any connection that is idle for more than X days.
I already tried using the heatrbeat[1] RabbitMQ option, but the problem still occurs. What I would like to do is to automatically close any "dead" (idle for a long time) connections.
Is this something I set in the client side, instead of the server side?
RabbitMQ is 3.3.4 and we use py-amqp[2] on the clients.
[1] https://www.rabbitmq.com/configure.html
[2] https://github.com/celery/py-amqp

A: We saw similar problems and we are using a PHP client which does not support heartbeat.
Our solution is to shut down all consumer processes before the instances are terminated, so all connections are disconnected cleanly. AFAIK EC2 will attempt a shutdown, and you will have a minute or so before the machine is powered off.
Example :
[1] https://unix.stackexchange.com/questions/48973/execute-a-command-before-shutdown

redpajama_set_name: RedPajamaStackExchange


text:
Q: Backup and restore of Azure sql database using c# I want to take backup of Azure sql database to my local system and then restore that backup to Azure sql database in c#. Can any body helps me out?Is it possible to do so?

A: Azure SQL Database does not support creating .bak files on-demand. Azure SQL DB automatically backups up all databases using native backups to enable you to Point-in-Time restore your database to any point in time within the databases retention period. However, these backups are not exposed and cannot be copied to the local system. To achieve what you want you can export a BACPAC file from a Azure SQL database to the local system using DACFx and also import it into a SQL Azure database from the local system. This article may be of help.


text:
Q: Intent service AsyncTask background setAdapter I have a intent service and In this service I use an asytask on background I want to do this :                                                                                expandableListView.setAdapter(expandableListAdapter);
But I can not do this

A: You cannot edit view from thread different from the activity thread.
I guess you're trying to do this in doInBackground (which is an other thread). To solve this issue you could execute this line in onPreExecute() method or onPostExecute(), executed respectively befor and after the doInBackground() method.

A: IntentService launching a worker thread and you can't handle View on it. In general to touch View in background thread used runOnUiThread(); or Handler with Runnable but runnable will be run on the thread to which this handler is attached to. In my mind you choose wrong sollution and need to use callback from Service and update View inside Activity or Fragment


text:
Q: Publish Google Sheet addon and sheet template I have developed a google sheet script which creates a custom menu. That menu item validates data in sheet but is based on a Google Sheet template which defined where user must enter each cell value for validation.
I want to publish the menu script as an addon. So, if user installs the addond but it's not using the google sheet template, data will not be validated as expected because he doesn't knows whre to enter each cell value.
Is there any chance to add the addon download the sheet template or any other workaround?
I published the Google Sheet to the web but that option removes menu bar, so user can't use the addon.
Which is the best approach for this kind of requirement?
Regards

A: Approach
A possible workaround would be making the template public and copy it in the active Spreadsheet when running the AddOn.
Here is an example:
function onOpen(e) {
  SpreadsheetApp.getUi().createAddonMenu()
      .addItem('Insert Template', 'copyTemplate')
      .addItem('Your validation function', 'validationFunction')
      .addToUi();
}

function copyTemplate() {
  let ss = SpreadsheetApp.getActiveSpreadsheet();
  let template = SpreadsheetApp.openById('template_id').getSheets()[0];
  let newss = template.copyTo(ss);
  newss.activate();
}

Reference
Sheet .copyTo()
.createAddonMenu()


text:
Q: Create an XML file using Javascript or PHP I have a XML file as follows:
<bracelets>
     <photo filename="b1.jpg" thumbnail="a1.jpg" description="aa" />
     <photo filename="b2.jpg" thumbnail="a2.jpg" description="aa" />
     <photo filename="b3.jpg" thumbnail="a3.jpg" description="aa" />
     <photo filename="b4.jpg" thumbnail="a4.jpg" description="aa" />
</bracelets>

I want to fetch all image names into a .php page.
I am using this now.
$bracelets = simplexml_load_file($bracelets_xml);
        x = xmlDoc.getElementsByTagName('photo')[0].attributes;
        for (i = 0; i < x.length; i++) {
            document.write(x[i].childNodes[0].nodeValue);
        }

But currently I am only able to fetch one image.
How can I fetch all images instead?

A: If PHP is an option, have you looked at SimpleXML yet?
In your case:
    $bracelets_xml = <<<XML
    <bracelets>
            <photo filename="b1.jpg" thumbnail="a1.jpg" description="aa" />
            <photo filename="b2.jpg" thumbnail="a2.jpg" description="aa" />
            <photo filename="b3.jpg" thumbnail="a3.jpg" description="aa" />
            <photo filename="b4.jpg" thumbnail="a4.jpg" description="aa" />
    </bracelets>
XML;

$bracelets = new SimpleXMLElement($bracelets_xml);

foreach($bracelets -> photo as $photo) {
    $counter++;
    echo "Photo " . $counter . ":\r\n";
    echo "Filename : " . $photo['filename'] . "\r\n";
    echo "Thumbnail : " . $photo['thumbnail']. "\r\n";
    echo "Description : " . $photo['description']. "\r\n";
}

Obviously the output above isn't what you want, but you could output it however you want depending on the context.

A: Loop through all the elements returned by xmlDoc.getElementsByTagName('photo').

A: This line:
x=xmlDoc.getElementsByTagName('photo')[0].attributes;

Gets the first photo. Then you do things with it.
Change that to a for loop like the one you have for looping over the attributes.


text:
Q: How to input current date directly from datetime to pgfgantt I would like to input the current date taken from "datetime" into the "pgfgantt" package to update the date bar automatically at compilation.
The date seems to be in the correct format,
however when input to pgfgantt, it throws an error:
! Use of \\ganttchart doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
                                                  #2}\def \reserved@b {#3}\f...
l.23 ]{2014-06-01}{2014-07-30}

Working code is here (replace "today=2014-06-02" with "today=\dashdate\today" to reproduce error):
\documentclass[a4paper,10pt]{report}

\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{pgfgantt}
\usepackage{pgfcalendar}
\usepackage{ifthen}
\usepackage{datetime}

\newdateformat{dashdate}{\THEYEAR-\twodigit{\THEMONTH}-\twodigit{\THEDAY}}
%\dashdate\today

\begin{document}
\begin{preview}

\begin{ganttchart}[x unit=.3cm, hgrid,vgrid={dotted},time slot format=isodate,
today=
2014-06-02, %replace "2014-06-02" with "\dashdate\today" to reproduce error
today offset=.5,
today label=Current Date,
today label node/.append style={anchor=north west},
today label font=\itshape\color{red},today rule/.style={draw=blue, ultra thick}
]{2014-06-01}{2014-07-30}
\gantttitlecalendar{year, month=name, week} \\
\ganttbar{Task-1.1}{2014-06-01}{2014-06-03} \\
\ganttbar{Task-1.2}{2014-06-03}{2014-06-06} \\
\ganttmilestone{Milestone 1}{2014-06-06}

\end{ganttchart}
\end{preview}
\end{document}

Any ideas how I can make this work?

A: You can use today=\the\year-\the\month-\the\day.


text:
Q: REST Call to Sharepoint Online to add user to a site group not working. Either user not unique or Value not in range I got a REST API call to our SP Online Instance that is not working in any way:
Method: POST
Endpoint: https://xyz.sharepoint.com/sites/ATestSite/_api/web/sitegroups(5)/users
Header:
Accept application/json;odata.metadata=none
Content-type application/json

Content:
{'LoginName':'i:0#.f|membership|xxx.yyy@zzz.com'}

This results in a 400 error: Value does not fall within the expected range. I got the login name from the system when I looked up the siteuser through REST
if I change the content to {'LoginName':'xxx.yyy@zzz.com'}
I get a 404 error: The user does not exist or is not unique.
Anybody got any idea? Thanks in advance!

A: You can try following format
Post https://xyz.sharepoint.com/sites/ATestSite/_api/web/sitegroups(5)/users

{
    '__metadata':
{ 'type': 'SP.User' },
    'LoginName':'i:0#.f|membership|user@domain.com'
}

A: Try using below code. I just tried this at my end and it is working for me:
<script type="text/javascript" src="/sites/siteName/SiteAssets/jquery.min.js"></script>

<button type="button" onclick="addUserToGroup()"> Add User To Group </button>

<script type="text/javascript">
    function addUserToGroup() {
        var addUserToGroupEndpoint = _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups(38)/users";

        var payload = JSON.stringify({
            '__metadata': { 'type': 'SP.User' },
            'LoginName': 'i:0#.f|membership|meganb@tenant.onmicrosoft.com'
        });

        $.ajax({
            url: addUserToGroupEndpoint,
            type: "POST",
            data: payload,
            headers: {
                "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                "accept": "application/json;odata=verbose",
                "content-type": "application/json;odata=verbose"
            },
            success: function (data) {
                console.log("User Added to Group successfully!");
            },
            error: function (error) {
                console.log(error);
            }
        });
    }
</script>

Verify and use correct user LoginName in payload and group ID from your SharePoint site in REST endpoint.


text:
Q: Adding features/points/polygons to OpenLayers map I'm trying to get a bunch of markers/points/polygons to show up on my OpenLayers map, but nothing seems to show up and the vector_layer seems to only have two SVG attributes when it should have way more than that, so maybe I'm not creating the features correctly?
var vector_layer = new OpenLayers.Layer.Vector('Points', {
    styleMap: new OpenLayers.StyleMap({'default':{
        pointRadius: 6,
        labelYOffset: -15,
        labelOutlineColor: "white",
        labelOutlineWidth: 3,
        label: "BOOB",
        strokeColor: "#FF00FF",
        strokeOpacity: 1.0,
        strokeWidth: 6
    }})
});

polygonFeature = [];
polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588508.747252596 168674.954513992,588706.355881724 168104.100450511,588805.174332032 167818.655647441,588904.002207028 167533.198996286)');
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: 'Vallée de l\'impossible',
        color: '#00FF66',
        type: '5',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);
polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588591.788935473 168704.056645848,588799.712933324 168593.991578248,589007.644549979 168483.931724448)');
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: 'Trainerlift',
        color: '#00FF66',
        type: '5',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);
polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(589367.815099211 167613.858604876,589342.892993503 167453.459513931,589317.969563007 167293.056263815,589293.04480767 167132.648854482,589268.118727426 166972.237285751,589243.191322243 166811.821557544,589218.262592051 166651.401669799,589193.332536805 166490.977622361,589168.401156456 166330.54941513)');
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: '',
        color: '#00FF66',
        type: '5',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);
polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(589381.008650411 167618.595027528,589528.167834526 167597.665516203,589675.32803885 167576.739543001,589822.489263299 167555.81710792,589969.651507792 167534.898210995,590116.814772244 167513.982852311,590190.396786934 167503.526499788,590263.979056575 167493.071031836,590411.144360695 167472.162749675,590484.727395153 167461.709935416,590558.310684527 167451.258005792)');
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: 'Kaiseregg',
        color: '#00FF66',
        type: '5',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);
polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588032.051690777 168677.694251669,587854.411858591 168531.960867246,587727.027545819 168473.087930543,587604.551815243 168406.840665774,587597.086384338 168370.382898673,587586.346776547 168338.842624253,587572.267213375 168280.657156328,587617.379141907 168257.594442098,587674.670785861 168168.20828954,587692.528735376 168068.210711088,587678.42167755 167996.516748919,587671.368022863 167960.669460802,587664.314284324 167924.821967987,587647.392407747 167882.037079818,587614.905936395 167857.292284218,587579.166995959 167848.10676651,587531.979824223 167861.864699831,587488.295691056 167881.805865479,587448.741633028 167913.198156398,587407.948520243 167940.909752369,587367.155783926 167968.621499271,587352.395598283 168002.34037867,587387.659707869 168005.667732583,587471.24959004 167951.596495736,587523.332360333 167935.589860972,587588.546726326 167916.282148895,587595.567211413 167960.59637938,587598.66600232 167982.344965964,587605.028849588 167994.264361834,587630.924627957 168033.627737266,587665.855685172 168074.609313393,587656.466602515 168150.18764367,587608.510272684 168237.303976917,587546.823442271 168285.416528806,587556.537111271 168317.010308028,587566.250678296 168348.603937425,587585.677506407 168411.790746861,587709.592724068 168479.2623002,587833.505151093 168546.735653008,587874.498771181 168568.238839737,587915.535212451 168611.021736516,588014.954848258 168698.700956018,588030.412917213 168679.334411072)');
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: '',
        color: '#00FF66',
        type: '2',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);
polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {
        label: 'Schwyberg Schneeschuhtour',
        color: '#00FF66',
        type: '10',
        strokeColor: '#FF9966',
        strokeWidth: 10
    }
)]);

vector_layer.addFeatures(polygonFeature);

map.addLayer(vector_layer);

Here's a jsfiddle, it was based on another fiddle that works for OpenLayers, I just added my code above to it, might not work as I guess it needs to be in the same area/region?
http://jsfiddle.net/fAqae/

A: First, in your .push to polygonFeature you should not be pushing an array, so delete the array wrapping of the Vector. Second, you need a "new" in front of OpenLayers.Feature.Vector.
Here is the corrected code: http://jsfiddle.net/fAqae/2/


text:
Q: Elasticsearch aggregation only on specific entries in an array I'm new to Elasticsearch and can't figure out how to solve the following problem.
The easiest way to explain my problem is to show you an example.
The following array "listing" is part of all my files in Elasticsearch, but the entries vary, so the "person" with the "id" 42, might be in 50% of my files. What I'm trying to do is to get the average "ranking.position.standard" of all the persons with id 42 in all my files in Elasticsearch.
{
"listing": [
    {
        "person": {
            "id": 42
        },
        "ranking": {
            "position": {
                "standard": 2
            }
        }
    },
    {
        "person": {
            "id": 55
        },
        "ranking": {
            "position": {
                "standard": 7
            }
        }
    }
]
}

Thanks for your help!

A: First of all, do you store listings as an object or nested data type? I don't think it's going to work if it's an object, so try the following example:
PUT /test
{
  "mappings": {
    "_default_": {
      "properties": {
        "listing": {
          "type": "nested"
        }
      }
    }
  }
}

PUT /test/aa/1
{
  "listing": [
    {
      "person": {
        "id": 42
      },
      "ranking": {
        "position": {
          "standard": 2
        }
      }
    },
    {
      "person": {
        "id": 55
      },
      "ranking": {
        "position": {
          "standard": 7
        }
      }
    }
  ]
}

PUT /test/aa/2
{
  "listing": [
    {
      "person": {
        "id": 42
      },
      "ranking": {
        "position": {
          "standard": 5
        }
      }
    },
    {
      "person": {
        "id": 55
      },
      "ranking": {
        "position": {
          "standard": 6
        }
      }
    }
  ]
}

GET test/_search
{
  "size": 0,
  "aggs": {
    "nest": {
      "nested": {
        "path": "listing"
      },
      "aggs": {
        "persons": {
          "terms": {
            "field": "listing.person.id",
            "size": 10
          },
          "aggs": {
            "avg_standard": {
              "avg": {
                "field": "listing.ranking.position.standard"
              }
            }
          }
        }
      }
    }
  }
}

This has brought me the following result:
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 2,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "nest": {
      "doc_count": 4,
      "persons": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
          {
            "key": 42,
            "doc_count": 2,
            "avg_standard": {
              "value": 3.5
            }
          },
          {
            "key": 55,
            "doc_count": 2,
            "avg_standard": {
              "value": 6.5
            }
          }
        ]
      }
    }
  }
}

It does seem correct.


text:
Q: How to interpolate 2D function over a large curvilinear mesh? I have some surface data given as x_mesh, y_mesh, z_mesh.
x_mesh and y_mesh were generated from steps by longitude and latitude on a geotiff (so, their shapes are equal and regular but steps by x and y are not).
z_mesh is the height from tangential plane to Earth ellipsoid at the center of map.
I can easily plot the surface with matplotlib.pyplot.pcolormesh(x_mesh, y_mesh, z_mesh). It works.
Now I want to set a line by mouse and somehow take a Z profile under this line. I need some interpolator to make xy --> z, but don't know which one to use.
I tried to do this:
scipy.interpolate.interp2d(x_mesh, y_mesh, z_mesh)

But it gives me an error: OverflowError: Too many data points to interpolate
Don't you have any ideas how to interpolate such data?
P.S. The geotiff is not very big, it is 6K x 6K pixels. And I see that pcolormesh somehow interpolates the color value between pixels if I zoom in.


text: Q: JetBrain IDE project creation trouble I was creating a new project in JetBrain IDE (IdeaIC-2016.1.2). While creating a new project SDk i choose the JDK option and when i want to select the path i was looking for JDK in Java folder but instead there were only JRE 1.8.0_31 and JRE 1.8.0_91 instead of JDK version? What could be the problem?


text:
Q: creating a flexible django data model with dynamic number of foreign key entries I have trouble writing a django data model which can link multiple objects of the same type back to a single data entry. Here's are my current models:
class House(models.Model):
    name = models.CharField(max_length=200, unique=True)
    color = models.CharField(max_length=200, unique=True)

class Config(models.Model)
   name = models.CharField(max_length=200)
   nbr_houses = models.PositiveIntegerField()
   houses = models.ManyToManyField(House) # this does not work, since I can only map a house once back to Config.

I wanna do the following (pseudo-code):
# define a new config and enforce that is should have houses.
$ a = Config(name = 'new_config', nbr_houses = 3)
# associate individual houses with this config
$ a.houses[0] = House(pk= 1)
# associate the same house a second time with this config
$ a.houses[1] = House(pk= 1)
# associate a third house to config.
$ a.houses[2] = House(pk= 2)

I create a new Config object new_config and say that this configuration should have 3 houses. My model should then automatically check and force me to link the correct number of houses back to Config. Additionally, a House might reference back twice to the same configuration.
I was thinking of writing Config the following way
class Config(models.Model)
   name = models.CharField(max_length=200)
   nbr_houses = models.PositiveIntegerField()
   houses = models.ManyToManyField(House, related_name='house0')
   houses1 = models.ManyToManyField(House, related_name='house1')
   houses2 = models.ManyToManyField(House, related_name='house2')
   houses3 = models.ManyToManyField(House, related_name='house3')

to basically reflect the maximum number of associations possible, but that's kinda inflexible. What's a better way of accomplishing this?
EDIT: Imagine the following use case:
You want to write a computer game where you can define a complexity of a scene. Each scene is saved into a Config. Per scene, I can place x many houses. Houses don't differ, they are just templates. So a scene could be made of 10 red houses, 2 blue houses and 1 yellow house. So for each Config entry I want to able to associate a different amount of houses (objects). Maybe later there will also be horses :) I hope you get the idea.

A: The question was updated to explain that you potentially want to associate some number of each house with the config. In order to do this in Django you need a new model, that Django calls a intermediate model. Like this:
class ConfigHouses(model.Model):
    config = model.ForeignKey('Config')
    house = model.ForeignKey('House')
    count = model.PositiveIntegerField()
    class Meta:
        unique_together = ('config', 'house')

and then in the Config class you declare a ManyToManyField and assign the intermediate model to the through parameter:
class Config(model.Model):
    # ...
    houses = model.ManyToManyField('House', through = 'ConfigHouses')

To add houses to a config you create new instances of the intermediate model:
# Level 1 contains 4 red houses and 5 yellow houses
c = Config.objects.get_or_create(name = 'level-1')

red = House.objects.get_or_create(name = 'red')
ch = ConfigHouses(config = c, house = red, count = 4)
ch.save()

yellow = House.objects.get_or_create(name = 'yellow')
ch = ConfigHouses(config = c, house = yellow, count = 5)
ch.save()

After executing the above queries, the database will look something like this:
CONFIG TABLE
----------------
| pk | name    |
|----|---------|
|  1 | level-1 |
----------------

HOUSE TABLE
----------------
| pk | name    |
|----|---------|
|  1 | red     |
|  2 | yellow  |
----------------

CONFIGHOUSES TABLE
-------------------------------
| pk | config | house | count |
|----|--------|-------|-------|
|  1 |      1 |     1 |     4 |
|  2 |      1 |     2 |     5 |
-------------------------------

To find out how many houses of a particular type there are in a particular config, you query the intermediate table, either directly, or via either one of the models:
>>> ConfigHouses.objects.get(config = c, house__name = 'red').count
4
>>> c.confighouses.get(house__name = 'red').count
4
>>> yellow.confighouses_set.get(config = c).count
5

Original answer
(The original question did not make it clear that the many-to-many relation needed multiplicity, but I'm leaving the original answer in place in case it's useful.)
Your original idea (that houses should be a ManyToManyField) is the right idea. It's just that in order to refer to the House class before you define it, you need to pass the name of the class. See the Django documentation:

If you need to create a relationship on a model that has not yet been defined, you can use the name of the model, rather than the model object itself.

It's also bad idea to have a nbr_houses field because it could become incorrect if someone updates the many-to-many relation without also remembering to update the nbr_houses field. You can use houses.count() to get the number of related houses.
So your Config class should look like this:
class Config(models.Model)
   name = models.CharField(max_length=200)
   # The class House is not yet defined, so refer to it by name.
   houses = models.ManyToManyField('House')

And you can update the many-to-many relation using the RelatedManager interface: there are methods add, create, remove, clear, or you can just assign to it:
config.houses = House.objects.filter(color = 'red')


text:
Q: How to make a GIT branch based on a date? I know that we can do git checkout based on a date  (git checkout by date).
Example:
git checkout `git rev-list -n 1 --before="2009-07-27 13:37" master`

However, how can we create a GIT branch based on the date?

A: One way you could create a branch would be to just use git checkout -b from the commit on which you find yourself after doing the git checkout you described in your question.  That is, try the following:
git checkout `git rev-list -n 1 --before="2009-07-27 13:37" master`

and then
git checkout -b some_branch_from_above_date


text:
Q: Add after method with plugin on underscore methods I try to add plugin after a method that start with underscore like this : "_myMethod".
My plugin work, I can add method after normal method, but I can't add my method after the one with " _ " before name.

A: You shouldn't be using plugins for private or protected methods. As plugins only work for public methods.
By convention in Magento functions & variables that start with an underscore indicate that the variable or function is protected or private, hence why I am assuming you are trying to plugin into a private or protected method.

A plugin, or interceptor, is a class that modifies the behavior of public class functions by intercepting a function call and running code before, after, or around that function call .. readmore

A: Neither of these answers actually address the issue in the title: how to define an interceptor for a method which name begins with an underscore; although the assumption that the developer is likely to be trying to intercept a protected/private method, you sometimes stumble upon someone else's code that does't follow such convention.
On Magento 2.3.1 it works by simply prefixing after to the method name like in:
public function _doFoo(...)

public function after_doFoo(...)

In order to validate a new Plugin definition, I found this code useful
$pluginValidator = $objectManager->get(\Magento\Framework\Interception\Code\InterfaceValidator::class);
$pluginValidator->validate(FooPlugin::class, Foo::class);

You can see the internals of how the method names are being mapped in \Magento\Framework\Interception\Code\InterfaceValidator::getOriginMethodName

A: Magento 2 plugins cannot be used with any of the following,

*

*Objects that are instantiated before Magento\Framework\Interception is
bootstrapped

*Final methods

*Final classes

*Any class that contains at least one final public method

*Non-public methods (I think you are using private method)

*Static methods

*__construct

*Virtual types

You can read more about plugin from below link,
http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html


text:
Q: Accessing a row in Repeater I have a grid view in which there is a repeater I want to get the id of child comment but this is giving me parent comment id
protected void rChildComments_ItemCommand(object source, RepeaterCommandEventArgs e)
{
    Button btnDeleteChildComment = (Button)e.Item.FindControl("btnDeleteChildComment");

    if (e.CommandName == "DeleteChildComment")
    {
        Control c = e.Item.NamingContainer.Parent;

       // Guid mcID = new Guid(e.Item.Cells[0].Text);
        //MemberFacade.DeleteMemberPublicChildComments(mcID);
        //Response.Redirect("profile.aspx" + "?mid=" + ProfileID);

        DataGridItem DgItems = (DataGridItem)c.NamingContainer;
        string text = DgItems.Cells[0].Text;
    }
}

what should I do ?

A: You also need to find Child Comment Control like that
DgItems.FindContol


text:
Q: LINQ to SQL: errors from stored procedure are ignored after result set is returned I'm using LINQ to SQL to call a stored procedure.  This stored procedure currently returns a resultset and then has some raiserror statements being triggered after the resultset is retrieved (I'm writing tests for stored procedures, in case you're wondering why I'm doing this).
When LINQ to SQL calls the proc and it gets a resultset back, it seems to ignore all of the errors that I'm throwing because it got its resultset.  Is there a way to make it always throw a SqlException when I do a raiserror from SQL?

A: Interesting; that is a problem I have seen before when using an IDataReader, which is why I now religiously consume all the tables (even if I am only expecting one) - for example, if I am only expecting one table, something like:
    while (reader.Read())
    { // read data from first table

    }
    // read to end of stream
    while (reader.NextResult()) { }

The problem is that the error goes into the TDS at the point you raise it; so if you raise it after the SELECT then in follows table in the TDS - and if the reader doesn't read to the end of the stream they might not see it.
I'll be honest - my preferred answer to this is: raise all errors before data. This might mean doing the main SELECT into a temp-table (#table) or table-variable (@table). Beyond that - if it is critical to catch this error (and if the inbuilt LINQ-to-SQL code isn't helping), then perhaps fall back to ExecuteReader and something like the above.
I suspect (but I haven't checked) that you could also use DataContext.Translate<T> to do some of the ORM heavy-lifting; for example:
// cmd is our DbCommand, and ctx is our DataContext
using(var reader = cmd.ExecuteReader()) {
   var result = ctx.Translate<MyResultType>(reader).ToList();
   while(reader.NextResult()) {}
   return result;
}

A: Make sure that your Severity Level is greater than 10 when you call RAISERROR as per:
http://support.microsoft.com/default.aspx/kb/321903
RAISERROR('Stored Procedure Execution Failed',15,1)


text:
Q: How do i properly initialize a variable with a custom type This is the code in C#:
public bool IsNation(string country)
    {
        for (int i = 0; i < Nations.Count; i++)
        {

            if (Nations[i].Name == country)
            {
                return true;
            }
            else { return false; }

        }return true;

    }

In C# you must initialize variables. But what if you made one of your own like this below?
public class WorldMarket
    {
        public WorldMarket()
        {
            Nations = new List<NationBuilder>();
        }

        internal List<NationBuilder> Nations { get; set; }

        public void AddToWorldMarket(NationBuilder nation)
        {
            Nations.Add(nation);
        }

The main idea is that from this structure:
- wm
   - Nations
      - [0]
          - Name "USA"
          - stockpile
            - [0]
                - Name "Coal"
                - Quantity "quantity"
                - Value "value"
      - [1] //Same as above

Find the country Name "USA" or whatever name inside this structure with a function that by only inserting a string with a name it outputs {1 or 0}
or True or False (if type == bool).
My attempt is the first code presented in this question. It tries to "travel" the structure and find the Name Tag you input as country using this call.
IsNation(string country); where country can be whatever string input.
Question
If C# wants me to declare every variable with an initial value, how do i do it with this custom or whatever custom type i may do?

A: Initialize the variable in the constructor public WorkdMarket(). See code below :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            WorldMarket wm = new WorldMarket();
        }
    }
    public class WorldMarket
    {
        internal List<NationBuilder> Nations { get; set; }
        public WorldMarket()
        {
            Nations = new List<NationBuilder>() {
                new NationBuilder() {
                    name = "USA",
                    stockPiles = new List<StockPile>() {
                        new StockPile() { name = "Coal", quantity = 2, value = "value"},
                        new StockPile() { name = "Coal", quantity = 2, value = "value"}
                    }
                }
            };
        }

        public void AddToWorldMarket(NationBuilder nation)
        {
            Nations.Add(nation);
        }
    }
    public class NationBuilder
    {
        public string name { get; set; }
        public List<StockPile> stockPiles { get; set; }
    }
    public class StockPile
    {
        public string name { get; set; }
        public int quantity { get; set; }
        public string value { get; set; }
    }
}

A: The line you requested would be:
WorldMarket con = new WorldMarket();

However, this would initialize as a new WorldMarket object, which has no pre-populated values yet. If the nations are meant to be static, you could initialize all the nations within the WorldMarket class
public class WorldMarket
{
    public WorldMarket()
    {
         Nations = new List<NationBuilder>() {
            new NationBuilder() {
                name = "USA",
                ...
            },
            new NationBuilder() {
                name = "AUS",
                ...
            }
         }
    }
}

Or alternatively if you could have your isNation method within WorldMarket, that might work better such that.
public class WorldMarket()
{
    // various class constructor methods

    public int IsNation(string country)
    {
        // you could access Nations directly here
        for (int i = 0; i < Nations.Count; i++)
        {
            if (Nations[i].Name == country)
            {
                return 1;
            }
            // else { return 0; } -- this would exit the loop unnecessarily
        }
        return 0;
    }
}

and the usage in your main program would be something like
program static void Main(string[] args)
    {
        WorldMarket con = new WorldMarket();
        con.AddToWorldMarket(new NationBuilder() {
            name = "USA",
            ...
        }
        Console.WriteLine(con.IsNation("USA"));
    }
}


text:
Q: Is it possible to develop a new custom checkout page as same as default Checkout page in magento
I  am trying to make a new checkout page exactly same as default
  checkout page, is it possible to do default checkout page to a custom
  checkout page, what are the initial steps to achieve that.

A: Just copy the template/checkout folder into your own theme.
If your checkout folder is in app/design/base/default/frontend/tempalate/checkout then copy that into app/design/default/yourcustomtheme/checkout and set your design to that theme. Then you can do whatever you want to onepage or the cart page, whatever you want.


text:
Q: Getting rid of accents I want to remove accents from the following characters, I've thought about the following solution, which probably works, but feels wrong. Does anyone have any smarter way to do it ?
$document = str_replace('ç','c',$document); // get rid of cedille
$document = str_replace('Ç','c',$document);
$document = str_replace('é','e',$document); // get rid of accents on E
$document = str_replace('è','e',$document);
$document = str_replace('ë','e',$document);
$document = str_replace('ê','e',$document);
$document = str_replace('È','e',$document);
$document = str_replace('É','e',$document);
$document = str_replace('Ê','e',$document);
$document = str_replace('Ë','e',$document);
$document = str_replace('À','a',$document); // get rid of accents on A
$document = str_replace('Á','a',$document);
$document = str_replace('Â','a',$document);
$document = str_replace('Ã','a',$document);
$document = str_replace('Ä','a',$document);
$document = str_replace('Å','a',$document);
$document = str_replace('à','a',$document);
$document = str_replace('á','a',$document);
$document = str_replace('â','a',$document);
$document = str_replace('ã','a',$document);
$document = str_replace('ä','a',$document);
$document = str_replace('å','a',$document);
$document = str_replace('Æ','ae',$document); // get rid of Æ and Œ
$document = str_replace('æ','ae',$document);
$document = str_replace('Œ','oe',$document);
$document = str_replace('œ','oe',$document);
$document = str_replace('ì','i',$document); //get rid of accents on I
$document = str_replace('í','i',$document);
$document = str_replace('î','i',$document);
$document = str_replace('ï','i',$document);
$document = str_replace('Ì','i',$document);
$document = str_replace('Í','i',$document);
$document = str_replace('Î','i',$document);
$document = str_replace('Ï','i',$document);
$document = str_replace('ñ','n',$document); // get rid of accent on N
$document = str_replace('Ñ','n',$document);
$document = str_replace('ò','o',$document); // get rid of accents on O
$document = str_replace('ó','o',$document);
$document = str_replace('ô','o',$document);
$document = str_replace('õ','o',$document);
$document = str_replace('ö','o',$document);
$document = str_replace('Ò','o',$document);
$document = str_replace('Ó','o',$document);
$document = str_replace('Ô','o',$document);
$document = str_replace('Õ','o',$document);
$document = str_replace('Ö','o',$document);
$document = str_replace('ù','u',$document); // get rid of accents on U
$document = str_replace('ú','u',$document);
$document = str_replace('û','u',$document);
$document = str_replace('ü','u',$document);
$document = str_replace('Ù','u',$document);
$document = str_replace('Ú','u',$document);
$document = str_replace('Û','u',$document);
$document = str_replace('Ü','u',$document);
$document = str_replace('ý','y',$document); // get rid of accents on Y
$document = str_replace('ÿ','y',$document);
$document = str_replace('Ý','y',$document);
$document = str_replace('Ÿ','y',$document);
$document = str_replace('ž','z',$document); // get rid of accents on Z
$document = str_replace('Ž','z',$document);

Edit to answer a comment : a for/foreach loop is just moving the problem, basically I was wondering if there was any way to avoid using str_replace() 50(~) times.

A: You can use iconv + ASCII//TRANSLIT.
$text = 'ç œ æ Ê è';
$text = strtolower(iconv("UTF-8", "ASCII//TRANSLIT", $text));
echo $text; // print "c oe ae e e"

Replace UTF-8 with the encoding that you are using.
Since ASCII is a subset of many charset (like utf-8) there will no need to convert it back into the original encoding.


text:
Q: Why can I not have a static object in a class? Referring to the following:
class A { ... };

class B
{
    static A a; // this fails
    ...
    static A& getA() { static A a; return a; } // this works
    ...
};
...
B b;
b.a  <-- gives error: undefined reference to B::a

Why can I not have a static A in class B, but it is fine to return it from a method?
[edit]
Just something curious:
struct C
{
    static const int x = 5;
};

int main()
{
    int k = +C::x;
    std::cout << "k = " << k << "\n";
    return 0;
}

output: k = 5

C::x is not defined in implementation-scope, neither is there an instance of C, and yet, with the unary + C::x is accessible ... !?

A: You most certainly can have exactly that.
What you've probably forgotten to do is define the object (exactly once) outside the class:
class B {
    // ...
};

A B::a;

Edit: based on edit to question, this is now basically a certainty instead of just a probability.


text:
Q: Android Tabs Menu. How to separate fragments I want to develop a top sliding menu as the following.

I have seen many tutorials, but everyone works with fragments that makes the same function. What should I use to work with fragments with their own function? And, can I also separate the fragments' code in various files? (1 file per fragment I mean).
I've understood that working with Activities in this context is deprecated (TabActivity)
This class was deprecated in API level 13.
New applications should use Fragments instead of this class; to continue to
run on older devices, you can use the v4 support library which provides a
version of the Fragment API that is compatible down to DONUT.

A: Use Toolbar with View Pager like below :
Xml File :
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabMode="fixed"
        app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"  />

Class file code like :
public class MainActivity extends AppCompatActivity {

private Toolbar toolbar;
private TabLayout tabLayout;
private ViewPager viewPager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    viewPager = (ViewPager) findViewById(R.id.viewpager);
    setupViewPager(viewPager);

    tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
}

private void setupViewPager(ViewPager viewPager) {
    ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
    adapter.addFrag(new OneFragment(), "ONE");
    adapter.addFrag(new TwoFragment(), "TWO");
    adapter.addFrag(new ThreeFragment(), "THREE");
    adapter.addFrag(new FourFragment(), "FOUR");
    adapter.addFrag(new FiveFragment(), "FIVE");
    adapter.addFrag(new SixFragment(), "SIX");
    adapter.addFrag(new SevenFragment(), "SEVEN");
    adapter.addFrag(new EightFragment(), "EIGHT");
    adapter.addFrag(new NineFragment(), "NINE");
    adapter.addFrag(new TenFragment(), "TEN");
    viewPager.setAdapter(adapter);
}

class ViewPagerAdapter extends FragmentPagerAdapter {
    private final List<Fragment> mFragmentList = new ArrayList<>();
    private final List<String> mFragmentTitleList = new ArrayList<>();

    public ViewPagerAdapter(FragmentManager manager) {
        super(manager);
    }

    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList.size();
    }

    public void addFrag(Fragment fragment, String title) {
        mFragmentList.add(fragment);
        mFragmentTitleList.add(title);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mFragmentTitleList.get(position);
    }
}

}
For more detail please follow below link :
Tabs with pager


text:
Q: could not load hiredis extension (undefined symbol: redisReaderFree) I'm trying to require hiredis in irb and it's already sending me an error:
irb(main):001:0> require "hiredis"
WARNING: could not load hiredis extension, using (slower) pure Ruby implementation.
=> true
irb(main):002:0>

Upon further investigation, I notice that it's crashing at this part of the code.
# hiredis-rb/lib/hiredis/connection.rb
module Hiredis
  begin
    require "hiredis/ext/connection"
    Connection = Ext::Connection
  rescue LoadError
    warn "WARNING: could not load hiredis extension, using (slower) pure Ruby implementation."
    require "hiredis/ruby/connection"
    Connection = Ruby::Connection
  end
end

So, I required the file hiredis/ext/connection and the error I get is the following error:
irb(main):001:0> require "hiredis/ext/connection"
LoadError: /home/***/projects/***/.gemset/extensions/x86_64-linux/2.1.0-static/hiredis-0.5.2/hiredis/ext/hiredis_ext.so:
undefined symbol: redisReaderFree -
/home/***/projects/***/.gemset/extensions/x86_64-linux/2.1.0-static/hiredis-0.5.2/hiredis/ext/hiredis_ext.so
from /home/***/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

I'm using Ubuntu and latest stable version of Redis (2.8.18). How do I fix this? Thanks!
EDIT:
So after looking at the hiredis-rb page: https://github.com/redis/hiredis-rb, it says that I should do the following:

To use hiredis with redis-rb, you need to require
  redis/connection/hiredis before creating a new connection.

So I did a require "redis/connection/hiredis" on irb and then require "hiredis" and everything worked fine, no more warnings.
But now the warnings don't happen at all anymore now. I assumed that I'd need to require "redis/connection/hiredis" everytime for it to work but now it just works. So I dunno why it's not warning me anymore now. I thought calling require "redis/connection/hiredis" during that irb session was only for that session, not all succeeding sessions.


text:
Q: Radio button only returns "on" when submitted I am very new to PHP and I am trying to display the value of a selected radio button in a string. But all I get returned is "on" instead of the value associated with the selection. Any help would be great!
<form action="Handle_form_PHP.php" method="post">

        Student

        <input type="radio" name="student" value ="student">

        Employee

        <input type="radio" name="student" value = "employee">

      <input type="submit" value="Submit">

</form>

This is the PHP I am using to print:
// Create a shorthand for the form data:
$fname = $_REQUEST['firstname'];
$lname = $_REQUEST['lastname'];
$address = $_REQUEST['address'];
$state1 = $_REQUEST['state1'];
$state2 = $_REQUEST['state2'];
$student = $_POST['student'];

// Print the submitted information:
echo "
Thank you,  $student , $fname $lname, for the filling out our survey:

We will Send you your report at:  $address, $state1$state2.
\n";

A: If your $_POST['student'] superglobal variable was holding a value of 'on', then the issue has nothing to do with method case-sensitivity.
The default value for a radio button is 'on' unless you provide a value attribute inside the radio button tag.
Let me prove it to you.  Go to [cringe] https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_form_checkbox then paste the following snippet in the left-side box, then Run, then Submit.
<!DOCTYPE html>

<form action="/action_page.php" method="get">
  <input type="radio" name="student" checked> Student

  <input type="submit" value="Submit">
</form>

This is submitting with a method of get (notice the lowercase get is inconsequential. post will behave the same way).  See that without a value in the student radio input, the submitted value is on.
If you write value="Red42" inside the radio input, you will no longer receive on; the submitted value is Red42.

A: use POST not post when saying method:
<form action="Handle_form_PHP.php" method="POST">

not
<form action="Handle_form_PHP.php" method="post">

For the record, the book was incorrect and had "post"


text:
Q: Total mass of a composite system with conservative forces There are plenty of sources online which just state that the total mass of a system with potential energy is simply equal to $\Sigma (E_k/c^2+m_0)+U/c^2$, the total energy of the system divided by $c^2$, where $U$ denotes the total potential energy of the system. How do you derive this?
I understand that without conservative forces at play, the total mass of the system is just $\Sigma (E_k/c^2+m_0)=\Sigma \gamma m_0 =\Sigma (f/a)$, how does potential energy get appended here? Is mass in this issue still a measure of inertia, as in how hard it is to change the total momentum of the system (i.e. something like $\dot{p}/a$)?
thanks


text:
Q: ssh bash -s meets array variable error The following script throws an error:
declare -a service_ports=(22 80 443 445)

ssh root@host 'bash -s' << EOF

export x=0
while [ \$x -le "${#service_ports[@]}" ]
do
  echo Port ${service_ports[\$x]} # ERROR HERE
  x=\$(( \$x + 1 ))
done

EOF

When I run this bash script I get:
./q.sh: line 6: $x: syntax error: operand expected (error token is "$x")

I need to escape the $x variable because I use a "bash -s" remote shell. When I remove the backslash I only access my local variable and not the one on the server where the script is executed.
Anyone know the solution to access the content of the array?

A: You can quote the here document terminator declaration to avoid having to escape anything in the input string (of course that also means you can't inject the value of a local variable in the remote script):
my_command << 'EOF'
foo $bar
[...]
EOF

If you need to inject local variable contents, you could instead go for mixed quotes:
my_input='some $literal$ strings'
my_input="${my_input}${my_variable}"
[...]

Also, you can simplify your command in several ways:

*

*You shouldn't have to specify bash -s when running a remote command, unless that is different from your default shell.

*There's no point in exporting variables which are not used in subsequent script calls

*You don't need to declare -a when you assign an array literal immediately


text:
Q: Batch file to Copy some lines from one text file to another text file I write batch file, and I have a problem:
I want that to write all lines from the current date until the end of the file
example of text file :
not copy this line.
not copy this line.
not this line.
5/02/2016  10 20 30 45 05 56 70 (from here )
5/03/2016  10 20 30 45 05 56 70
5/04/2016  10 20 30 45 05 56 70
5/05/2016  10 20 30 45 05 56 70

My code:
@ECHO OFF
set filename=abc.txt
set filename2=outFile.txt
set find=find.txt
set sourceFolder=c:\1\
IF EXIST "%find%" DEL "%find%"
IF EXIST "%filename2%" DEL "%filename2%"
IF EXIST "SAMPLE_text01.txt" DEL "SAMPLE_text01.txt"
set currentdate=%date%
set newdate=%currentdate:~5,11%
echo %newdate% >> %sourceFolder%%find%

findstr /g:%sourceFolder%%find% %sourceFolder%%filename% > %sourceFolder%%filename2%

set count=0

for /f "tokens=*" %%i in ('findstr /g:%sourceFolder%%find%
"%sourceFolder%%filename%"') do (

    rem echo count is %count%
    set /a count+=1
    echo.%* >> temp.txt
)

pause

A: Supposing the date format in your text file is the same as returned by the built-in environment variable %DATE%, the following script -- let us call it lines-from-today-on.bat -- should work for you:
@echo off
setlocal EnableExtensions DisableDelayedExpansion

rem Define constants here:
set "INFILE=%~1"
if not defined INFILE set "INFILE=%~dpn0.txt"
set "OUTFILE=%~2"
if not defined OUTFILE set "OUTFILE=con"

> "%OUTFILE%" (
    set "FLAG="
    for /F "delims=" %%L in ('
        findstr /N /R "^" "%INFILE%"
    ') do (
        set "LINE=%%L"
        setlocal EnableDelayedExpansion
        for /F "tokens=1 eol= " %%F in ("!LINE:*:=!") do (
            endlocal
            if "%%F"=="%DATE%" (
                set "FLAG=#"
            )
            setlocal EnableDelayedExpansion
        )
        if defined FLAG echo(!LINE:*:=!
        endlocal
    )
)

endlocal
exit /B

To use it, call it by providing the input file as a command line argument (text file sample.txt in the current directory in this example):
lines-from-today-on.bat sample.txt

This displays the extracted lines on the console. To output them into another text file (return.txt here), provide another argument:
lines-from-today-on.bat sample.txt return.txt

A: Since the Batch language doesn't have a date object, I find it convenient to employ a helper language that does.  With JScript, for example, you can use the less-than / greater-than comparisons on date objects, and formatting of dates is a little more forgiving.  (Will the text files always have a zero-padded day and a non-zero-padded month?  JScript's new Date() constructor will work the same either way.)
Save this with a .bat extension and see what you think.
@if (@CodeSection == @Batch) @then
@echo off & setlocal

set "in=abc.txt"
set "out=outfile.txt"
set "found="

rem // redirect output to outfile
> "%out%" (
    rem // for each line of the text file...
    for /f "usebackq delims=" %%I in ("%in%") do (
            rem // use JScript to check whether line contains a date of today or future
            if not defined found call :isCurrent "%%~I" && set "found=1"
            if defined found echo(%%I
        )
    )
)

goto :EOF

:isCurrent <date>
cscript /nologo /e:JScript "%~f0" "%~1"
exit /b %ERRORLEVEL%

@end // end batch / begin JScript hybrid code

try {
    var today = new Date(new Date().toDateString()), // truncate to midnight
        otherDate = new Date(WSH.Arguments(0).match(/\b\d+\/\d+\/\d+\b/)[0]);
}
catch(e) { WSH.Quit(1); } // exits non-zero if argument contains no dates

// exits non-zero if otherDate is earlier than today
WSH.Quit(!(today <= otherDate));


text:
Q: Change scrapy logging level does not work I crate my first spider, but I would like to see only my output and no INFO or DEBUG messages. According to scrapy documentation I should use --loglevel/-L LEVEL but when I start my scrapy like this:
scrapy crawl -L WARNING myspider
or
scrapy crawl --loglevel=WARNING myspider

I can see all INFO messages. How can I change that, what am I doing wrong? Thank you.
UPDATE1:
Versions:
Scrapy 1.5.1
Python 3.6.5
My spider class:
class specialspider(scrapy.Spider):

    name = 'myspider'

    start_urls = [
        "https://webpage.cz/",
    ]

    def start_requests(self):
        for url in self.start_urls:
            yield scrapy.Request(url=url, callback=self.parse)

    def parse(self, response):
        print(response.url)


text:
Q: React native : animated node with tag 2 does not exist (not using animation) I don't use any animation in my code but when i start the app on an android device (emulator or real device) the error "Animated node with tag 2 does not exists"
When i start the project on web it does work however
I heard about a fix on internet but it seems like the fix wouldn't work with expo 40+ and just break more things
my app.js:

import React, {useEffect, useState} from 'react';
import {Button, FlatList, StyleSheet, Text, TouchableOpacity, View, Alert} from 'react-native';
import {NavigationContainer} from "@react-navigation/native";
import { createStackNavigator } from '@react-navigation/stack';
import Designation from "./Designation";
import ProjetList from "./Localisation/ProjetList";
import ParcelleList from "./Localisation/ParcelleList";
import AdresseList from "./Localisation/AdresseList";
import EmplacementList from "./Localisation/EmplacementList";
import Segmentlist from "./Localisation/Segmentlist";
import CompartimentList from "./Localisation/CompartimentList";

const Stack = createStackNavigator();

const App = () => {

    return (
        <>
            <View style={styles.Bann}>
                <Text>AGORA</Text>
            </View>
            <NavigationContainer>
                <Stack.Navigator>
                    <Stack.Screen
                        name="ProjetList"
                        component={ProjetList}
                    />
                    <Stack.Screen
                        name="ParcelleList"
                        component={ParcelleList}
                    />
                    <Stack.Screen
                        name="AdresseList"
                        component={AdresseList}
                    />
                    <Stack.Screen
                        name="EmplacementList"
                        component={EmplacementList}
                    />
                    <Stack.Screen
                        name="SegmentList"
                        component={Segmentlist}
                    />
                    <Stack.Screen
                        name="CompartimentList"
                        component={CompartimentList}
                    />

                    <Stack.Screen
                        name="Designation"
                        component={Designation}
                    />
                </Stack.Navigator>
            </NavigationContainer>
        </>
    );
};

let styles = StyleSheet.create({
    Bann: {
        alignItems: "center",
        justifyContent: "center",
        height: 100,
        backgroundColor: "grey",
        fontSize: 35,
    }
});

export default App;

my first page that is shown :
import React, {useEffect, useState} from 'react';
import {createStackNavigator} from "@react-navigation/stack";
import {Alert, Button, StyleSheet, Text, TouchableOpacity, View} from 'react-native';

const ProjetList = ({navigation} ) => {
    let id = 'id :';
    const [data, setData] = useState([]);

    useEffect(() => {
        fetch('http://10.0.2.2:80/projets')
            .then(response => {console.log(response);return response.json();})
            .then((json => {console.log(json);setData(json);}))
            .catch(error => console.error(error));
        console.log(data);
    }, []);

    return(

        <>
            <View>
                <Text>Test fetch : {id + ' '+data}</Text>
            </View>
            <View style={{flexDirection: "row", justifyContent: "center", paddingBottom: 40}}>

                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Localisation"
                                  onPress={() => navigation.navigate('ProjetList')}>

                    <Text>Localisation</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Désignation"
                                  onPress={() => navigation.navigate('Designation')}>

                    <Text>Désignation</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Composition"
                                  onPress={() => navigation.navigate('Composition')}>

                    <Text>Composition</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Condition"
                                  onPress={() => navigation.navigate('Condition')}>

                    <Text>Condition</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Dépose"
                                  onPress={() => navigation.navigate('Dépose')}>

                    <Text>Dépose</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Dimensions"
                                  onPress={() => navigation.navigate('Dimensions')}>

                    <Text>Dimensions</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer}
                                  title="Illustrations"
                                  onPress={() => navigation.navigate('Illustrations')}>

                    <Text>Illustrations</Text>
                </TouchableOpacity>
            </View>

            <View style={{flexDirection: "row", justifyContent: "center", paddingBottom: 20}}>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="ProjetList"
                                  onPress={() => navigation.navigate('ProjetList')}>

                    <Text>Projet</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="ParcelleList"
                                  onPress={() => navigation.navigate('ParcelleList')}>

                    <Text>Parcelle</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="AdresseList"
                                  onPress={() => navigation.navigate('AdresseList')}>

                    <Text>Adresse</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="EmplacementList"
                                  onPress={() => navigation.navigate('EmplacementList')}>

                    <Text>Emplacement</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="SegmentList"
                                  onPress={() => navigation.navigate('SegmentList')}>

                    <Text>Segment</Text>
                </TouchableOpacity>
                <TouchableOpacity style={styles.BoutonContainer2}
                                  title="CompartimentList"
                                  onPress={() => navigation.navigate('CompartimentList')}>

                    <Text>Compartiment</Text>
                </TouchableOpacity>
            </View>

            <View style={{flexDirection: "row"}}>
                <View style={{backgroundColor: "grey", marginLeft: 20, height: 600, width: 300, alignItems:'center'}}>
                    <Text style={{marginVertical: 30}}>Test</Text>
                </View>
                <View>

                </View>
            </View>
        </>
    );
};

let styles = StyleSheet.create({
    BoutonContainer: {
        flex: 1,
        backgroundColor: "#1E90FF",
        alignItems: "center",
        justifyContent: "center",
        margin: 10,
        height: 20,
        paddingHorizontal: 30,
        paddingVertical: 15,
    },
    BoutonContainer2: {
        flex: 1,
        backgroundColor: "#00BFFF",
        alignItems: "center",
        justifyContent: "center",
        margin: 10,
        height: 15,
        paddingHorizontal: 28,
        paddingVertical: 13,
    }
});

export default ProjetList;

also, my package.json just in case :

{
  "main": "index.js",
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "start": "react-native start"
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "body-parser": "^1.19.0",
    "expo": "~41.0.1",
    "expo-splash-screen": "~0.10.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.5.4",
    "express": "^4.17.1",
    "mysql": "^2.18.1",
    "node-fetch": "^2.6.1",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "^0.64.1",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-my-sql-connection": "^1.0.4",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-unimodules": "~0.13.3",
    "react-native-web": "^0.16.3",
    "react-navigation": "^4.4.4"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0"
  },
  "private": true
}

A: Replacing TouchableOpacity with TouchableNativeFeedback fixed the crash issue for me.


text:
Q: How to use a clock within a while loop i'm coding a game and I've been trying to implement a pause game functionality where when the user presses R the game will pause, and after x time when R is pressed again, the game will resume. I have gotten this to work when user presses R, and when any other key such as M is pressed the game will resume as normal. However, when I assign R to both pause and unpause events, the initial R is detected for both pause and unpause, and the game pauses for a fraction of a second and resumes. I've tried implementing timers and counters inside my pause loop but to no avail. what I really want to do is make it so that the user must wait x amount of time before R is pressed again, this will fix the problem, but I can't get clock.getElapsedTime to work within the loop for some reason. Why is this? here's my current code:
case sf::Keyboard::R:
        pause = true;
        break;

//pause game
        clock1.restart();
        while (pause)
        {
            //cout << clock1.getElapsedTime.asSeconds();

            //if (clock1.getElapsedTime.asSeconds() > 1.0)
            //{
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::R))
                    pause = false;
            //}
        }

A: Try placing sf::sleep(sf::seconds(0.1)); BEFORE your while loop. I had the same problem. Somehow if I would read the value of isKeyPressed() for the same letter consequently it would not change at the time I read it the second time and would assume it's still pressed. Placing a little pause there solved my problem, so try if it does solve it in your case.
Please tell me if it works, I am interested


text:
Q: Aframe 1.0.4 - setting scene.environment does not update materials So I saw an old post here:
https://discourse.threejs.org/t/is-there-a-way-to-increase-scene-environment-map-exposure-without-affecting-unlit-materials/13458/4
That says... "If you apply the env map to Scene.environment, it is automatically used as the environment map for all physical materials in the scene (assumed the material's envmap is not set)."
So tried this using an Aframe component on the scene:
AFRAME.registerComponent('setenvironment', {
  init: function () {
    var sceneEl = this.el;
    var loader = new THREE.CubeTextureLoader();
    loader.setPath('./');

    var textureCube = loader.load([
      './images/py.png', './images/pz.png',
      './images/nx.png', './images/ny.png',
      './images/px.png', './images/nz.png'
    ]);
    textureCube.encoding = THREE.sRGBEncoding;
    sceneEl.object3D.environment = textureCube;
  }
});

The environment attribute is successfully set, but the other objects materials still have envMap set to null and the environment lighting does not take effect on the materials.
Any ideas?

A: aframe 1.0.4 uses three.js revision 111dev. The scene's environment property was introduced in revision 112 (source).
If you use the aframe master build - it seems to be working properly (as its based on three.js r119).
Otherwise, you'll have to iterate through the meshes, and set the material.envMap property manually.


text:
Q: Regular expression: "string+number+string" sorry about simple question.
I need to check if the string include, this pattern.
somestring 532:

for more information,  string + one space + number > 0 + ':'

A: You can try with following regex:
^[a-zA-Z]+ [1-9]\d*:$

A: You can just do:
([a-zA-Z]+)\s([1-9]\d*):


text:
Q: How to get the url variable in Django? I have something like that in my views.py:
class CommentMixin(object):
    def get_context_data(self, **kwargs):
        context = super(MenuMixin, self).get_context_data(**kwargs)
        context['comments'] = Comments.objects.filter(post=xxxxxxxxxxxxx).order_by('-pub_date')
        return context
...

class PostDetailView(CommentMixin, generic.DetailView):
    model = models.Post

PostDetail = PostDetailView.as_view()
PostList = PostList.as_view()

and a fragment of comment.html:
{% for comment in comments %}

{{comment.author}}

Dodano dnia {{comment.pub_date}}

{{comment.content}}

Fragment of urls.py:
url(r'^post/(?P<slug>[\w\-_]+)/$', 'page.views.PostDetail', name='post-detail'),

I want replace the xxxxxxxxxxxxx by the post on that  page. The url format is looking like this:
http://localhost:8000/post/my-post-name/

A: DetailView stores object in self.object.
And in get_context_data you can use it in filter:
context['comments'] = Comments.objects.filter(post=self.object).order_by('-pub_date')


text:
Q: Lualatex/Japanese document compiles fine in TeXstudio, but not MacTex I'm having trouble compiling the following document.
I have done a fresh install of MacOS 10.14 and installed the full size MacTex 2018 distribution directly from TUG. I have also upgraded all packages using the TexLive Utility.
Then, I installed TexStudio 2.12.14 from MacPorts and tried to compile the following document:
%% start of file `template.tex'.
%% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.

\documentclass[11pt,a4paper]{moderncv}
\usepackage[ngerman]{babel}

\moderncvstyle{classic}
\moderncvcolor{grey}

\usepackage{luatexja-fontspec}
\setmainjfont[BoldFont=IPAexGothic]{IPAexMincho} % \mcfamily
\setsansjfont{IPAexGothic} % \gtfamily
\newjfontfamily\jisninety[CJKShape=JIS1990]{IPAexMincho}
\renewcommand*{\namefont}{\fontsize{18}{20}\mdseries\upshape}
\renewcommand*{\titlefont}{\fontsize{18}{20}\mdseries\upshape}

\usepackage{multicol}
\usepackage{fontawesome}
\usepackage{footmisc}
\usepackage[scale=0.75]{geometry}
\setlength{\hintscolumnwidth}{3.5cm}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\renewcommand{\arraystretch}{1.3}
\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.2\hsize}X}

\usepackage{booktabs}

% personal data
\name{芭蕉}{松尾}
\address{123-3456}{日本語をかきましょう。}{日本語をかきましょう。}
\email{sth@mail.net}

%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}

%-----       resume       ---------------------------------------------------------

\makecvtitle

\section{headline}

\cvitem{ghi}{\textit{this should actually compile just fine}}
\section{headline}
\cventry{00/2011 -- 03/2023}{Input}{More}{Input}{}{
    \begin{itemize}
        \item I studied.
\end{itemize}}
\cventry{00/2011 -- 03/2023}{Input}{More}{Input}{}{
    \begin{itemize}
        \item Stuff
\end{itemize}}

\section{headline}

\cventry{00/2011 -- 03/2023}{Input}{More}{Input}{}
{Stuff and stuff
    \begin{itemize}
        \item This is one.
        \item And another one.
    \end{itemize}}

\section{headline\footnotemark}
\cvitemwithcomment{日本語}{C1/C1/C1}{}

\footnotetext{This is a footnote}

\end{document}

I get the following error (scroll down):
LaTeX Font Warning: Font shape `JY3/IPAexMincho(0)/m/sl' undefined
(Font)              using `JY3/IPAexMincho(0)/m/n' instead on input line 52.

LaTeX Font Info:    Try loading font information for OT1+lmr on input line 52.
(/usr/local/texlive/2018/texmf-dist/tex/latex/lm/ot1lmr.fd
File: ot1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info:    Try loading font information for OML+lmm on input line 52.

(/usr/local/texlive/2018/texmf-dist/tex/latex/lm/omllmm.fd
File: omllmm.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info:    Try loading font information for OMS+lmsy on input line 52.

(/usr/local/texlive/2018/texmf-dist/tex/latex/lm/omslmsy.fd
File: omslmsy.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info:    Try loading font information for OMX+lmex on input line 52.

(/usr/local/texlive/2018/texmf-dist/tex/latex/lm/omxlmex.fd
File: omxlmex.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <10> on input line 52.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <7> on input line 52.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <5> on input line 52.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 6.73553pt on input line 52.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 4.8111pt on input line 52.

(/usr/local/texlive/2018/texmf-dist/tex/latex/microtype/mt-mvs.cfg
File: mt-mvs.cfg 2006/07/05 v1.1 microtype config. file: Marvosym Euro (RS)
)
\makecvheadpicturebox=\box113
\makecvheaddetailswidth=\skip88
\makecvheadpicturewidth=\skip89
\makecvheadnamebox=\box114

! Undefined control sequence.
MT@font@list .../sl/10 ,JT3/IPAexMincho(0)/m/n/10
                                                  ,JY3/IPAexMincho(0)/m/n/10...
l.52 \makecvtitle

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 17.31995pt on input line 52.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 17.31995pt on input line 52.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <10.95> on input line 53.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <8> on input line 53.
LaTeX Font Info:    External font `lmex10' loaded for size
(Font)              <6> on input line 53.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 7.69775pt on input line 53.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 5.77332pt on input line 53.
LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 13.85594pt on input line 53.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 13.85594pt on input line 53.

LaTeX Font Warning: Font shape `JT3/IPAexMincho(0)/m/it' undefined
(Font)              using `JT3/IPAexMincho(0)/m/n' instead on input line 55.

LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 10.53629pt on input line 55.

LaTeX Font Warning: Font shape `JY3/IPAexMincho(0)/m/it' undefined
(Font)              using `JY3/IPAexMincho(0)/m/n' instead on input line 55.

LaTeX Font Warning: Font shape `JT3/IPAexMincho(0)/bx/n' undefined
(Font)              using `JT3/IPAexMincho(0)/m/n' instead on input line 60.

LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/m/n' will be
(Font)              scaled to size 10.53629pt on input line 60.

LaTeX Font Warning: Font shape `JY3/IPAexMincho(0)/bx/n' undefined
(Font)              using `JY3/IPAexMincho(0)/m/n' instead on input line 60.

(load cache: /Users/david/Library/texlive/2018/texmf-var/luatexja/extra_lmromans
lant10-regular.luc)
LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/m/sl' will be
(Font)              scaled to size 10.53629pt on input line 60.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/m/sl' will be
(Font)              scaled to size 10.53629pt on input line 60.
LaTeX Font Info:    Font shape `JT3/IPAexMincho(0)/bx/n' will be
(Font)              scaled to size 10.53629pt on input line 64.
LaTeX Font Info:    Font shape `JY3/IPAexMincho(0)/bx/n' will be
(Font)              scaled to size 10.53629pt on input line 64.

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `\footnotemark' on input line 76.

And a bunch of warnings alongside the way:

*

*You have requested package moderncvheadi', but the package provides
moderncvheadi'.

*Font shape JT3/mc/m/it' undefined(Font) usingJT3/mc/m/n' instead

*Font shape JT3/IPAexMincho(0)/m/sl' undefined(Font) using
JT3/IPAexMincho(0)/m/n' instead

*Some font shapes were not available, defaults substituted.

I thought it had something to do with the font (IPAexMincho) not being present, but the package ipaex is actually installed (included in MacTex, although I'm not sure if that's the one I need, because in Linux the packages are named differently).
Also, this document here compiles perfectly fine, so it cannot be a missing font:
\documentclass{ltjsarticle}

\usepackage{luatexja-fontspec}

\setmainfont[Ligatures=TeX]{TeXGyreTermes}
\setsansfont[Ligatures=TeX]{TeXGyreHeros}
\setmainjfont[BoldFont=IPAexGothic]{IPAexMincho}
\setsansjfont{IPAexGothic}
\newjfontfamily\jisninety[CJKShape=JIS1990]{IPAexMincho}

\begin{document}

mainのフォント.  {\bfseries boldのフォント.  }{\sffamily\gtfamily sansのフォント.  }

通常の「辻」.  {\jisninety JIS90字形の「辻」.  }

\end{document}

Help would be much appreciated :)
I have also tried to use another frontend, TexMaker 5.0.3 installed as dmg from the respective website.
Here is the corresponding file list to the first document, it is more up to date than on my Linux machine (which compiles fine):
 *File List*
moderncv.cls    2015/07/28 v2.0.0 modern curriculum vitae and letter document cl
ass
  size11.clo    2018/09/03 v1.4i Standard LaTeX file (size option)
etoolbox.sty    2018/08/19 v2.5f e-TeX tools for LaTeX (JAW)
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
  luatex.def    2018/01/08 v1.0l Graphics/color driver for luatex
colortbl.sty    2018/12/12 v1.0d Color table columns (DPC)
   array.sty    2018/12/30 v2.4k Tabular extension package (FMi)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
 fontenc.sty
   t1enc.def    2018/08/11 v2.0j Standard LaTeX file
   t1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
 lmodern.sty    2009/10/30 v1.6 Latin Modern Fonts
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
fancyhdr.sty    2019/01/31 v3.10 Extensive control of page headers and footers
tweaklist.sty
    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
  xparse.sty    2018-10-17 L3 Experimental document command parser
   expl3.sty    2019-02-15 L3 programming layer (loader)
expl3-code.tex    2019-02-15 L3 programming layer
l3pdfmode.def    2019-02-15 v L3 Experimental driver: PDF mode
microtype.sty    2018/01/14 v2.7a Micro-typographical refinements (RS)
microtype-luatex.def    2018/01/14 v2.7a Definitions specific to luatex (RS)
microtype.cfg    2018/01/14 v2.7a microtype main configuration file (RS)
moderncvcollection.sty    2015/07/28 v2.0.0 moderncv collections
moderncvcompatibility.sty    2015/07/28 v2.0.0 modern curriculum vitae and lette
r compatibility patches
   babel.sty    2018/11/13 3.27 The Babel package
 ngerman.ldf    2018/12/08 v2.11 German support for babel (post-1996 orthography
)
moderncvstyleclassic.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter
 style scheme: classic
moderncviconsmarvosym.sty    2015/07/28 v2.0.0 modern curriculum vitae and lette
r icons: marvosym
    tikz.sty    2019/02/02 v3.1.1 (3.1.1)
     pgf.sty    2019/02/02 v3.1.1 (3.1.1)
  pgfrcs.sty    2019/02/02 v3.1.1 (3.1.1)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2019/02/02 v3.1.1 (3.1.1)
  pgfsys.sty    2019/02/02 v3.1.1 (3.1.1)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2019/02/02 v3.1.1 (3.1.1)
pgfsysprotocol.code.tex    2019/02/02 v3.1.1 (3.1.1)
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2019/02/02 v3.1.1 (3.1.1)
pgfcomp-version-1-18.sty    2019/02/02 v3.1.1 (3.1.1)
  pgffor.sty    2019/02/02 v3.1.1 (3.1.1)
 pgfkeys.sty
 pgfkeys.code.tex
 pgfmath.sty
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
moderncvheadi.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter header
 variant: 1
moderncvbodyi.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter body v
ariant: 1
    umvs.fd
moderncvcolorgrey.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter co
lor scheme: grey
luatexja-fontspec.sty    2019/01/28 fontspec support of LuaTeX-ja
l3keys2e.sty    2018-10-17 LaTeX2e option processing using LaTeX3 keys
luatexja.sty    2019/01/28 Japanese Typesetting with Lua(La)TeX
luatexja-core.sty    2017/11/12 Core of LuaTeX-ja
luatexbase.sty    2015/10/04 v1.3 luatexbase interface to LuaTeX
ctablestack.sty    2015/10/01 v1.0 Catcode table stable support
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
pdftexcmds.sty    2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
   ifpdf.sty    2018/09/07 v3.3 Provides the ifpdf switch
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
atbegshi.sty    2016/06/09 v1.18 At begin shipout hook (HO)
everyhook.sty    2014/11/26 v1.2 (SVN Rev: 12)\ Hooks for low level TeX everyX p
rimitives.
svn-prov.sty    2010/04/24 v3.1862 Package Date/Version from SVN Keywords
ltj-base.sty    2017/05/05
ltj-latex.sty    2018/08/24 LaTeX support of LuaTeX-ja
lltjfont.sty    2019/01/29 Patch to NFSS2 for LuaTeX-ja
   tuenc.def    2018/08/11 v2.0j Standard LaTeX file
everysel.sty    2011/10/28 v1.2 EverySelectfont Package (MS)
lltjdefs.sty    2019/02/11 Default font settings of LuaTeX-ja
lltjcore.sty    2018/06/15 Patch to LaTeX2e Kernel for LuaTeX-ja
filehook.sty    2011/10/12 v0.5d Hooks for input files
lltjp-geometry.sty    2018/01/19 Patch to geometry for LuaTeX-ja with vertical w
riting mode
luatexja-compat.sty    2018/03/29 Compatibility with pTeX
fontspec.sty    2019/02/12 v2.7b Font selection for XeLaTeX and LuaLaTeX
fontspec-luatex.sty    2019/02/12 v2.7b Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
   tuenc.def    2018/08/11 v2.0j Standard LaTeX file
fontspec.cfg
luatexja-fontspec-26h.sty    2019/01/28 fontspec support of LuaTeX-ja
multicol.sty    2018/12/27 v1.8v multicolumn formatting (FMi)
fontawesome.sty    2016/05/15 v4.6.3.1 font awesome icons
fontawesomesymbols-generic.tex
fontawesomesymbols-xeluatex.tex
footmisc.sty    2011/06/06 v5.5b a miscellany of footnote facilities
geometry.sty    2018/04/16 v5.8 Page Geometry
  ifvtex.sty    2016/05/16 v1.6 Detect VTeX and its facilities (HO)
tabularx.sty    2016/02/03 v2.11b `tabularx' package (DPC)
 ltablex.sty    2014/08/13 v1.1 Modified tabularx
longtable.sty    2014/10/28 v4.11 Multi-page Table package (DPC)+ FMi change
    tabu.sty    2019/01/11 v2.9 - flexible LaTeX tabulars (FC+tabu-fixed)
varwidth.sty    2009/03/30 ver 0.92;  Variable-width minipages
booktabs.sty    2016/04/27 v1.618033 publication quality tables
hyperref.sty    2018/11/30 v6.88e Hypertext links for LaTeX
hobsub-hyperref.sty    2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2016/05/16 v1.14 Construct package bundles (HO)
 intcalc.sty    2016/05/16 v1.2 Expandable calculations with integers (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
luatex-loader.sty    2016/05/16 v0.6 Lua module loader (HO)
pdfescape.sty    2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2016/05/16 v1.4 Expandable calculations on big integers (HO)
  bitset.sty    2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty    2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty    2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
 hopatch.sty    2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty    2016/05/16 xcolor patch
atveryend.sty    2016/05/16 v1.9 Hooks at the very end of document (HO)
refcount.sty    2016/05/16 v3.5 Data extraction from label references (HO)
 hycolor.sty    2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
 auxhook.sty    2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
  pd1enc.def    2018/11/30 v6.88e Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
   puenc.def    2018/11/30 v6.88e Hyperref: PDF Unicode definition (HO)
 hluatex.def    2018/11/30 v6.88e Hyperref driver for luaTeX
rerunfilecheck.sty    2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
lltjp-array.sty    2018/03/29 Patch to array for LuaTeX-ja
lltjp-footmisc.sty    2017/05/05 Patch to footmisc for LuaTeX-ja
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
  mt-cmr.cfg    2013/05/19 v2.2 microtype config. file: Computer Modern Roman (R
S)
 nameref.sty    2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty    2016/05/16 v1.5 Cleanup title references (HO)
20190421_test_CV.out
20190421_test_CV.out
  ot1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
  omllmm.fd    2009/10/30 v1.6 Font defs for Latin Modern
 omslmsy.fd    2009/10/30 v1.6 Font defs for Latin Modern
 omxlmex.fd    2009/10/30 v1.6 Font defs for Latin Modern
  mt-mvs.cfg    2006/07/05 v1.1 microtype config. file: Marvosym Euro (RS)
 ***********

A: So the culprit was TeXlive 2018, everything works with TeXlive 2019 (pretest) (and 2017 for that matter).


text:
Q: How to read a value from Jenkins job console and then pass it over to the Test results report? My Maven-based jobs in Jenkins are triggered automatically on a pre-scheduled basis and are creating certain orders with unique numbers and writing them down into job's build output console.
Is there any way to retrieve these order numbers from the job's build output console and further to insert them into a final Tests Results Aggregator html report (every order number should be placed against its correspondent Jenkins job name)?
Thanks

A: This doesn't sound like a good idea. The optimal way would be to make your test write these to somewhere it's accessible. But if you really want to process the console out there are a few ways to do this.
Following is a groovy way of doing this.
pipeline {
    agent any
    stages {
     stage("Echo") {
                steps{
                    echo "12345667"
                    echo "12345667"
                    echo "12345667"
            }
        }
        stage('Get console output') {
            steps{
              script {
                // Retrive the console output
                def consoleLog = Jenkins.getInstance().getItemByFullName(env.JOB_NAME).getBuildByNumber(Integer.parseInt(env.BUILD_NUMBER)).logFile.text
                echo "$consoleLog"
               // Do string processing here
              }
            }
        }
    }
    post {
        success {
            echo "Success"
        }
    }
}

You can also use the following URL to retrieve the console text.
Externally: http://localhost:8080/job/JOBNAME/BUILDNUMBER/consoleText
Within the same pipeline: ${BUILD_URL}/consoleText