text:
Q: SpringXD Error when deploying Stream: StringDeserializer class could not be found I'm configuring my custom kafka source and I'm getting an error related to the     value.deserializer kafka property.
This is the config that I have:
<!--Consumer -->
<bean id="container1"
    class="org.springframework.kafka.listener.KafkaMessageListenerContainer">
    <constructor-arg>
        <bean class="org.springframework.kafka.core.DefaultKafkaConsumerFactory">
            <constructor-arg>
                <map>
                    <entry key="bootstrap.servers" value="localhost:9092" />
                    <entry key="enable.auto.commit" value="false" />
                    <entry key="auto.commit.interval.ms" value="100" />
                    <entry key="session.timeout.ms" value="15000" />
                    <entry key="group.id" value="bridge-stream-testing" />
                    <entry key="key.deserializer" value="org.apache.kafka.common.serialization.IntegerDeserializer" />
                    <entry key="value.deserializer" value="org.apache.kafka.common.serialization.StringDeserializer" />
                </map>
            </constructor-arg>
        </bean>
    </constructor-arg>

I see org.apache.kafka.common.serialization.StringDeserializer class indeed (I can click the class name and it takes me to the jar file.
Just in case this is the content in my pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.xd</groupId>
        <artifactId>spring-xd-module-parent</artifactId>
        <version>1.3.2.RELEASE</version>
    </parent>
    <groupId>ejemplos.spring</groupId>
    <artifactId>kafka-source-latest-api</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-kafka</artifactId>
            <version>2.1.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>0.10.0.1</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>spring-kafka</artifactId>
            <version>1.1.0.RELEASE</version>
        </dependency>

    </dependencies>

    <repositories>
        <repository>
            <id>pentaho-releases</id>
            <url>http://repository.pentaho.org/artifactory/repo/</url>
        </repository>
    </repositories>
</project>

These are the logs that I'm getting: https://gist.github.com/columb1a/2833f1ac751436df1caa730ce1a0eb37

A: Try to place kafka-clients jar into the shared /lib instead of module classpath. I just guess, but looks like that class is tried to be load by the Thread.currentThread().getContextClassLoader(); instead of module-specific.

A: I resolved my problem as follows: After having replaced the kafka-clients PLUS having added provided scope to the kafka-clients dependency in my pom file, my consumer is working properly (so far).


text:
Q: NHibernate: insert multiple items at once all! I am learning NHibernate now and I would like to know is it possible to save multiple objects to database in one operation.
For example, consider this test code
    private static void SaveTestBillNamesInSession(ISession session, params string[] names)
    {
        var bills = from name in names
                    select new Bill
                        {
                            Name = name,
                            DateRegistered = DateTime.Now,
                        };
        foreach (var bill in bills)
            session.SaveOrUpdate(bill);
    }

This loop here generates many INSERT statements which may be sub-optimal in SQL Server 2008 which allows to include multiple data rows in one INSERT statement.
Is it possible to rewrite this code to make use of this functionality - insert all the data in one operation?
Update
OK, now it's really started to send everything in a single batch. Many thanks to all!

A: There's something close to what you want.
If you set the adonet.batch_size configuration property to anything other than 0 (the default), NHibernate will send that many statements at once to SQL Server.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to make bars of different color in google charts? I have the following code which generates a column chart.
<script type="text/javascript">
 //google.charts.load('current', {packages: ['corechart', 'bar']});
   google.setOnLoadCallback(drawBar);

   function drawBar() {

  var data = google.visualization.arrayToDataTable([
    ['Number of Visits', 'Average Check Size',{ role: 'style' }],
    ['8+', 26.22, '#083874'],
    ['4-7', 30.34,'#94CAFC'],
    ['2-3', 24.09,'#EBBA25'],
    ['1', 27.95,'#F59E47']
  ]);

  var formatter = new google.visualization.NumberFormat({
fractionDigits: 1,
prefix: '$'
 });

formatter.format(data, 1);

            var view = new google.visualization.DataView(data);
            view.setColumns([0, 1,
                            { calc: "stringify",
                                sourceColumn: 1,
                                type: "string",
                                role: "annotation" }]);
  var options = {
    //chartArea: {width: '50%'},
    hAxis: {
      title: 'Average Check Size',
      titleTextStyle: {italic: false},
      minValue: 0,gridlines: { color: 'transparent'}
    },
    vAxis: {
    minValue: 0,
      title: 'Number of Visits',
      titleTextStyle: {italic: false},
      gridlines: { color: 'transparent'}},
      //colors: ['red','green','blue','yellow'],
    legend: {position: 'none'},
  };

  var chart = new google.visualization.ColumnChart(document.getElementById('chart_bar'));

  chart.draw(view, options);
}

The output is a column chart with annotations on each of the bars. I want to have a similar kind of output but all four bars must have different colors. How do I do that? Please suggest

A: You can use the style role. There are examples on google charts page. And here is a jsfiddle.
var data = google.visualization.arrayToDataTable([
         ['Element', 'Density', { role: 'style' }],
         ['Copper', 8.94, '#b87333'],            // RGB value
         ['Silver', 10.49, 'silver'],            // English color name
         ['Gold', 19.30, 'gold'],

       ['Platinum', 21.45, 'color: #e5e4e2' ], // CSS-style declaration
      ]);


text:
Q: breakdown voltage in BJT How breakdown voltage of common base configuration is higher than that of common emitter configuration??
in common base, break down is more or less similar to PN junction breakdown.
please explain how breakdown occurs in common emitter configuration???
I read because of transistor amplification, common emitter Breakdown has less value than PN junction breakdown. more explanation needed to understand clearly.

A: For the common-base configuration, the base is common ("grounded") and the collector-base breakdown voltage is determined with the emitter open so, as you write, the breakdown voltage is essentially that of a PN junction.
For the common-emitter configuration, the emitter is common and the collector-emitter breakdown voltage is determined with the base open.  In this mode, the base width modulation and impact ionization effects enhance the avalanche breakdown of the collector-base junction leading to a lower breakdown voltage.
See, for example, this.

A: In common-emitter schematic, the reverse CB current flows through the open BE junction and is amplified by h21e factor. This way the collector current raises h21e times faster than in common-base configuration and the avalanche breakdown will happen on lower voltages.


text:
Q: Spring Boot REST application with Jackson - how to handle arbitrary/unknown xml structures passed in? I am working with a Spring Boot REST application. We are using jackson to handle  deserialization of XML as well as JSON passed in the request body. An example of   an expected request body looks like this:
<formInput><formNum>999999</formNum><documentData>Completely unknown data structure here!</documentData></formInput>

In the documentData element, we will have a structure that is completely arbitrary/unknown on the server side. We don't care about the structure, because we only want to pass the xml that is nested in documentData on to another service.
The POJO that we are trying to map the request body onto looks like this:
@JsonDeserialize(using=FormInputJsonDeserializer.class)
public class FormInput {

    private String formNum
    private String documentData

    public String getFormNum() {
        return formNum
    }

    public void setFormNum(String formNum) {
        this.formNum = formNum
    }

    public String getDocumentData() {
        return documentData;
    }

    public void setDocumentData(String documentData) {
        this.documentData = documentData;
    }

}

The custom JsonDeserializer that we are trying to write:
public class FormInputJsonDeserializer extends JsonDeserializer<FormInput> {
    @Override
    public FormInput deserialize(JsonParser parser, DeserializationContext context)
            throws IOException, JsonProcessingException {

        FormInput formInput = new FormInput();

        String fieldName
        JsonToken currentToken
        while (parser.nextToken() != null) {
            currentToken = parser.getCurrentToken()
            if (currentToken.equals(JsonToken.END_OBJECT)) {
                continue
            }

            fieldName = parser.getCurrentName()

            // formNum handling not written yet

            if ("documentData".equalsIgnoreCase(fieldName)) {
                if (parser.getCurrentToken().equals(JsonToken.START_OBJECT)) {
                    // we are at the start of documentData, and we need to capture the
                    // entire documentData node as a String since we don't know
                    // its structure
                    JsonFactory jfactory = new JsonFactory()
                    StringWriter jsonStringWriter = new StringWriter()
                    JsonGenerator jGen = jfactory.createGenerator(jsonStringWriter)
                    jGen.copyCurrentStructure(parser) // points to END_OBJECT after copy
                    jGen.close()
                    String documentDataJsonStr = jsonStringWriter.getBuffer().toString()
                    println("documentDataJsonStr: " + documentDataJsonStr)
                }
            }
        }

        // rest of code omitted
    }

}

As I say, if the request body is xml, ideally I'd like to just keep it formatted as xml and assign that to the documentData String property. However I came up with the above custom deserialization code by following some other examples on StackOverflow. This parsing code ends up converting documentData to a JSON formatted String. Since I didn't know how to pass through the raw XML and get it mapped to the String property, I thought I could just convert the JSON formatted String back to a XML formatted String. A problem arises when we pass in a XML structure like this:
<formInput><formNum>9322</formNum><documentData><repeatLevel><subForm1><GROSS_DISTR>    13,004.31</GROSS_DISTR><GROSS_DISTR>    13,004.31</GROSS_DISTR><GROSS_DISTR>    13,004.31</GROSS_DISTR></subForm1></repeatLevel><repeatLevel><subForm1><GROSS_DISTR>    38,681.37</GROSS_DISTR><GROSS_DISTR>    38,681.37</GROSS_DISTR><GROSS_DISTR>    38,681.37</GROSS_DISTR></subForm1></repeatLevel></documentData></formInput>

After documentData is parsed in the deserialize method, the println statement shows the parsed JSON String as:
{"repeatLevel":{"subForm1":{"GROSS_DISTR":"    13,004.31","GROSS_DISTR":"    13,004.31","GROSS_DISTR":"    13,004.31"}},"repeatLevel":{"subForm1":{"GROSS_DISTR":"    38,681.37","GROSS_DISTR":"    38,681.37","GROSS_DISTR":"    38,681.37"}}}

This is actually not strictly valid JSON, due to the duplicate keys. I would have hoped that these would have been converted to JSON arrays, but that is not the case. So, I am unable to turn around and use something like the JSON.org libraries (JsonObject and XML) to convert the JSON String back to XML format (get an exception with a "duplicate key" error).
Does anybody have any suggestions or strategies for handling our situation?

A: You could try to use a JSONObject, add the @JsonIgnoreProperties("documentData") tag and extract documentData seperately from the raw data using substring()


text:
Q: Difficulties with the % Operator in Python myvar = "How are you ?"
print("%s %s") % (hello, myvar)

Its one of my python Task for University but it doesnt work ??
I use Python 3 could it be for 2 ??
And how would it look like for 3 then ?

A: You should move it inside brackets
print("%s %s" % (hello, myvar))

as in your case "%" is used in the context "NoneType tuple", while it should be used in a context "str tuple"

A: In python3, the print is a function unlike in python 2 where it is actually a statement.
so, as it is told, in python3 give the argument inside () ie
print(hello, myvar)


text:
Q: Bash find hashtags from string I'm new to shell scripting and I'm trying to find all hashtags from a string using grep, this is what I have but it only works for alphanumeric characters
echo '#fooFOO0' | grep -o '#[a-zA-Z0-9]'

A: If the hashtag finishes before , you can do
echo '#fooFOO0' | grep -Po '#.*?(?=<)'

.*? means non-greedy search.
(?=<) is look-ahead.

A: The following command print a line for each hashtag found:
❯ echo '#fooFOO0#foo #bar' | grep --fixed-strings --only-matching '#'
#
#
#

Options

*

*-F, --fixed-strings

Interpret PATTERN as a list of fixed strings (instead of regular expressions), separated by newlines, any of which is to be matched.

*-o, --only-matching

Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.

Warning: --count or -c won't give the number of hashtags (3) but the number of lines containing one (only 1 here).


text:
Q: unable to draw on multiple canvas How to load multiple canvas and enable drawing on it. Currently, It shows two canvas on my page but I can only draw in one canvas.
I have two records in database. foreach loop below make two canvas but I can only draw in only one canvas not on the both canvas. I should able to draw on both canvas and that is the things I want. I am looking for any help or any tips on  how should I do so that I can draw on all canvas generated dynamically.

        <canvas  id="can_{{$draw->id}}" width="1200" height="400"
            style="position:absolute;top:10%;left:10%;border:2px solid;">
        </canvas>

Below is the js code that allows user to draw on image of canvas

A: Try something similar to this. Add the context to an array and see if you can draw to both. Not exactly sure the context thing is your problem but I think it is.

let canvas1 = document.getElementById("c1");
let canvas2 = document.getElementById("c2");
let ctx1 = canvas1.getContext("2d");
let ctx2 = canvas2.getContext("2d");

let ctx = [ctx1, ctx2];

function draw() {
  ctx.forEach((ctx, i) => {
    ctx.fillStyle = "lightblue";
    ctx.fillRect(10, 10, 100, 100)
  });
}
draw()
<canvas id='c1'></canvas>
<canvas id='c2'></canvas>

Adding what @Kaiido said for performance

let canvas1 = document.getElementById("c1");
let canvas2 = document.getElementById("c2");
let ctx1 = canvas1.getContext("2d");
let ctx2 = canvas2.getContext("2d");

ctx1.fillStyle = "lightblue";
ctx1.fillRect(50, 50, 100, 100)

ctx2.drawImage(canvas1, 0, 0)
<canvas id='c1'></canvas>
<canvas id='c2'></canvas>

A: Here's a solution that makes use of the fact we know which canvas generated a mouse event. Since we know that, we can use it to get the context of the correct canvas.
I show a message for mousemove and mousedown, indicating which canvas triggered the event.
<!doctype html>

    <canvas name='canvas1'></canvas><canvas name='canvas2'></canvas>


text:
Q: How to do regex pattern multiple matching C I am trying to find all the email address links for all the USA senators, I want to do this by Wget and then doing pattern matching with regex. Then I need to print the matches out to the screen.
This is the problem that I need to have this program do

Part 2: Add to the program a section that loads and parses the
  downloaded file extracting all of the web addresses. Your program must
  generate a listing on the screen of the extracted web addresses  when
  it is run.

*

*Note that the web list must be perfect - no extra characters - to get full credit.

Is there a way to return all matches of the regex from a string (if so, how would I go about doing it)
Unless I am mistaken, I have only found regex functions that would end up finding a single occurrence of the regex and not all of them.
Here is my current regex that I am going to be using
Contact:\s+<a\s+(?:[^>]*?\s+)?href=(["'])(.*?)\1

This regex seems to work perfectly, for what I am looking for.
This is my current setup for code for the program, just don't know how I would go about implementing the Regex
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>

int main() {

    // initiate all used Variables
    FILE *file;
    char *buffer;
    long size;

    //Wget on Senate webpage
    system("wget -q http://www.senate.gov/general/contact_information/senators_cfm.cfm");

    // Attempt to open file
    file = fopen("senators_cfm.cfm", "r");

    if(file == NULL){

        printf("Was unable to open file \n");
        return 1;

    }

    //Attempt to read to end of file
    fseek(file, 0L, SEEK_END);

    //Determine the number of bytes that were in the file
    size = ftell(file);

    //Attempt to allocate the number of bytes needed
    buffer = (char*) calloc(size, sizeof(char));
    if(buffer == NULL){

        printf("Unable to allocate memory needed \n");
        return 1;
    }

    //Reset the reader to start of file
    rewind(file);

    //Read whole file into buffer
    fread(buffer, sizeof(char), size, file);

    //This is where I will be implementing the regex (or at least the call
    //to the function)

    //Close file
    fclose(file);

    //Free all information that we allocated memory for
    free(buffer);

    unlink("senators_cfm.cfm");
    return 0;
}


text:
Q: Log for android app in play console vitals I have an app in google play and for some reason, I get a rare IllegalArgumentException for a method with multiple args. It happens in 0.004% according to google statistics (in my app usage), so there is no way I can reproduce it to know how to solve it, and google play vitals doesnt provide any usable info to what arg was a NULL.
There are a lot of log.X (x = d, e, w...) and I know the basics, but what I dont understand is, can I use some of them to get info on an argument that was NULL when user was using the app? Can I write a log.e("TAG", arg4.toString()), put it in try/catch block and build it for production, so when crash happens, it will print the value of arg4 in google play vitals?
If not, how do I find out which arg was NULL in such a rare case?

A: The Vitals section in the Play Console reports crashes, not logs, so you can either catch the exception and throw another one containing more data in the message, but AFAIK the message of the exceptions is often removed before being displayed in the Play Console in case it reveals private data about the user.
Another option is to integrate with Firebase and store and collect data, but that might be more effort that it's worth putting in.
If I were you I would check in the source code (of your app, the library you're using, or Android source) what line throws the Illegal argument exception and check what argument is checked at this line.
Finally if that's not an option, you could throw an exception yourself in your code before calling that method, checking if each argument is non null. Depending which line throws, you'll know which argument was null.


text:
Q: Two modals opening from a single link I have some code that opens a modal that contains a form when a marker is placed on a layer in leaflet. It all worked well with out any issues. I copied this code so I could make a second button to control the opening of another modal containing a different form. I changed the link information but when the button is clicked the
L.DomEvent.on(link, 'click', L.DomEvent.stop)
                  .on(link, 'click', L.bind(this.startCreating, this));

Opens up both forms at the same time or opens one then when closed and clicked againit will open both. Im not sure whats going on because each modal has a different ID.
Here is a live example of the map with the modals. Click the small elements/buttons on the left under the zoom control and drag the new market and click again to set its place on the map.
Leaflet Map with modals
Here is the JS code that should call the first modal called eventDataModal. The main link in the code is near the top:
L.MarkerControl = L.Control.extend({

    options: {
        position: 'topleft',
        url: 'http://echostorm.mynetgear.com:8080/geoserver/usa/ows',
        userName: 'wfspost',
        password: 'createfeature'
    },

    map: null,
    marker: null,
    binded: false,

    onAdd: function (map) {

        this.map = map;

        var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'),
            // link = L.DomUtil.create('a', 'glyphicon glyphicon-map-marker', container);
            link = L.DomUtil.create('a', 'glyphicon glyphicon-eye-open', container);

        link.href = '#';
        link.title = 'Create a new visual report';

        link.innerHTML = '';
        L.DomEvent.on(link, 'click', L.DomEvent.stop)
                  .on(link, 'click', L.bind(this.startCreating, this));

        map.on("editable:drawing:commit", L.bind(this.onMarkerAdd, this));

        return container;
    },

    startCreating: function() {
        this.marker = this.map.editTools.startMarker();
    },

    onMarkerAdd: function(e) {
        this.nearestFeature = null;
        this.findNearestPoints(e.layer.getLatLng());
    },

    onFormClosed: function() {
        if (this.marker!=null) {
            this.map.editTools.featuresLayer.removeLayer(this.marker);
            this.marker = null;
        }
    },

    findNearestPoints: function(latlng) {

         var defaultParameters = {
            service: 'WFS',
            version: '1.0.0',
            request: 'GetFeature',
            typeName: 'usa:within5mi',
            maxFeatures: 5,
            outputFormat: 'text/javascript',
            format_options: 'callback: nearestPoints',
            srsName: 'EPSG:4326',
            viewparams: 'radius:802;lon:'+latlng.lng+';lat:'+latlng.lat,

        };

        var parameters = L.Util.extend(defaultParameters);

        $.ajax({
            jsonp: false,
            url: this.options.url + L.Util.getParamString(parameters),
            dataType: 'jsonp',
            jsonpCallback: 'nearestPoints',
            success: L.bind(this.handleNearestPoints, this)
        });
    },

    handleNearestPoints: function(data) {
        this.clearModal();
        this.setModalDate();

        if (data && data.type=="FeatureCollection"
            && data.features && data.features.length
            && data.features.length > 0) {
            this.fillModal(data.features[0]);
        }

        this.openPopup();
    },

    formatDate: function(date) {
        var day = date.getDate();
        return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+(day < 10 ? "0"+day : day);
    },

    clearModal: function() {
        $('#eventDataModal').find('input').each(
            function() {
                $(this).val("");
            }
        );

        $('#eventDataModal').find('textarea').each(
            function() {
                $(this).val("");
            }
        );
    },

    setModalDate: function() {
        $("#form-patrolDate").val(this.formatDate(new Date()));
    },

    fillModal: function(feature) {
        var props = feature.properties;

        $("#form-region").val(props["Region"]);
        $("#form-circuitID").val(props["Circuit_ID"]);
        $("#form-circuitName").val(props["Circuit_Name"]);
        $("#form-vendor").val(props["Vendor"]);
        $("#form-quad").val(props["Quad"]);

    },

    openPopup: function() {
        this.bindEvents();
        $('#eventDataModal').modal('show');
    },

    bindEvents: function() {
        if (!this.binded) {
            $('#eventDataModal').on('hidden.bs.modal', L.bind(this.onFormClosed, this));
            $("#saveEventDataModal").on('click', L.bind(this.onSave, this))
            this.binded = true;
        }
    },

    onSave: function() {
        var properties = this.getFormData(),
            request = this.wfsBody("usa", "usa:pecotest", "geom", properties);
            console.log(request);
            this.makeRequest(request);
    },

    makeRequest: function(body) {

        $.ajax({
            method: "POST",
            crossDomain: true,
            url: this.options.url,
            contentType: "text/xml",
            dataType: "text",
            data: body,
            headers: {
                "Authorization": "Basic " + btoa(this.options.userName + ":" + this.options.password)
            },
            jsonpCallback: 'datasave',
            success: L.bind(this.onDataSave, this),
            failure: function(r){console.log("AJAX Failure!");console.log(r);}
        });
    },

    onDataSave: function(data) {
        console.log(data);
    },

    getFormData: function() {
        var result = {};

        $('#eventDataModal').find('input').each(
            function() {
                if (this.type=="checkbox") {
                    result[this.name] = this.checked ? "Yes" : "No";
                } else {
                    result[this.name]=$(this).val();
                }
            }
        );

        $('#eventDataModal').find('textarea').each(
            function() {
                result[this.name]=$(this).val();
            }
        );

        return result;
    },

    wfsBody: function(namesapce, typeName, geometryField, properties) {
        var xml;
        xml ='<wfs:Transaction service="WFS" version="1.0.0"';
        xml += ' xmlns:wfs="http://www.opengis.net/wfs"';
        xml += ' xmlns:usa="http://census.gov"';
        xml += ' xmlns:gml="http://www.opengis.net/gml">\n';
        xml += '   <wfs:Insert>\n';
        xml += '      <'+typeName+'>\n';
        xml += '        <usa:'+geometryField+'>\n';
        xml += this.marker.toGML()+"\n";
        xml += '        </usa:'+geometryField+'>\n';

        for (var k in properties) {
            if (properties.hasOwnProperty(k)) {
                xml += "<"+namesapce+":"+k+">";
                xml += properties[k];
                xml += "</"+namesapce+":"+k+">\n";
            }
        }

        xml += '      </'+typeName+'>\n';
        xml += '   </wfs:Insert>\n';
        xml += '</wfs:Transaction>\n';

        return xml;
    }

});

L.Marker.include({
toGML: function(){
    var latlng = this.getLatLng(),
        xml;

    xml = '<gml:Point srsName="EPSG:4326"><gml:coordinates cs=","
 decimal="." ts=" ">';
    xml += latlng.lng + ',' + latlng.lat;
    xml += '</gml:coordinates></gml:Point>';

    return xml;
 }
});

Here is the corresponding HTML for the modal evenDataModal

        <button type="button" class="close" data-dismiss="modal" aria-
        label="Close">×</button>

Create New Visual Report

        <form action="php\new_peco_visual_report_db_insert.php
            method="POST">

            ID Code
            <input type="number" class="form-control" id="form-priority"
             name="ID_Code" placeholder="ID_Code">

            Region
            <input type="text" class="form-control" id="form-region"
              name="Region" placeholder="region">

            Circuit ID
            <input type="number" class="form-control" id="form-circuitID"
             name="Circuit_ID" placeholder="Circuit ID">

            Circuit Name
            <input type="text" class="form-control" id="form-circuitName"
             name="Circuit_Name" placeholder="Circuit Name">

            Patrol Date
            <input type="date" class="form-control" id="form-patrolDate"
              name="Patrol_Date" placeholder="Patrol Date">

            Vendor
            <input type="text" class="form-control" id="form-vendor"
             name="Vendor" placeholder="Vendor">

            Repair Number
            <input type="text" class="form-control" id="form-repairNumber"
              name="Repair_Number" placeholder="Repair Number">

             Problem
              Description
            <input type="text" class="form-control" id="form-
             problemDescription" name="Problem_Description"
              placeholder="Problem
              Description">

            Priority
            <input type="number" class="form-control" id="form-urgency"
              name="Urgency" placeholder="Urgency">

            Circuit Portion
            <input type="text" class="form-control" id="form-circuitPortion"
              name="Circuit_Portion" placeholder="Circuit Portion">

            Quad
            <input type="text" class="form-control" id="form-quad"
             name="Quad" placeholder="Quad">

            Location
            <input type="text" class="form-control" id="form-location"
             name="Location" placeholder="location">

            PolSub
            <input type="number" class="form-control" id="form-polSub"
              name="PolSub" placeholder="PolSub">

            Pole Number
            <input type="number" class="form-control" id="form-poleNumber"
             name="Pole_Number" placeholder="Pole Number">

            Aerial Name
            <input type="text" class="form-control" id="form-aerialName"
             name="Aerial_Name" placeholder="Aerial Name">

            Work Required?
            <input type="text" class="form-control" id="form-workRequired"
             name="Work_Required" placeholder="Work Required">

            GPS Longitude
            <input type="text" class="form-control" id="form-long"
             name="long" placeholder="long">

            GPS Latitude
            <input type="text" class="form-control" id="form-lat" name="lat"
              placeholder="lat">

            Comments
            <textarea class="form-control" id="form-comments"
             name="Comments" rows="3"></textarea>

       </form>

        <button type="button" class="btn btn-default" data-
          dismiss="modal">Close</button>
        <button type="sumbit" class="btn btn-primary"
          id="saveEventDataModal">Save</button>

Here is the code for that should call the second modal called evenDataModal2
L.MarkerControl2 = L.Control.extend({

    options: {
        position: 'topleft',
        url: 'http://echostorm.mynetgear.com:8080/geoserver/usa/ows',
        userName: 'wfspost',
        password: 'createfeature'
    },

    map: null,
    marker: null,
    binded: false,

    onAdd: function (map) {

        this.map = map;

        var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'),
            // link = L.DomUtil.create('a', 'glyphicon glyphicon-map-marker', container);
            link = L.DomUtil.create('a', 'glyphicon glyphicon-fire', container);

        link.href = '#';
        link.title = 'Create a new thermal report';

        link.innerHTML = '';
        L.DomEvent.on(link, 'click', L.DomEvent.stop)
                  .on(link, 'click', L.bind(this.startCreating, this));

        map.on("editable:drawing:commit", L.bind(this.onMarkerAdd, this));

        return container;
    },

    startCreating: function() {
        this.marker = this.map.editTools.startMarker();
    },

    onMarkerAdd: function(e) {
        this.nearestFeature = null;
        this.findNearestPoints(e.layer.getLatLng());
    },

    onFormClosed: function() {
        if (this.marker!=null) {
            this.map.editTools.featuresLayer.removeLayer(this.marker);
            this.marker = null;
        }
    },

    findNearestPoints: function(latlng) {

         var defaultParameters = {
            service: 'WFS',
            version: '1.0.0',
            request: 'GetFeature',
            typeName: 'usa:within5mi',
            maxFeatures: 5,
            outputFormat: 'text/javascript',
            format_options: 'callback: nearestPoints',
            srsName: 'EPSG:4326',
            viewparams: 'radius:802;lon:'+latlng.lng+';lat:'+latlng.lat,

        };

        var parameters = L.Util.extend(defaultParameters);

        $.ajax({
            jsonp: false,
            url: this.options.url + L.Util.getParamString(parameters),
            dataType: 'jsonp',
            jsonpCallback: 'nearestPoints',
            success: L.bind(this.handleNearestPoints, this)
        });
    },

    handleNearestPoints: function(data) {
        this.clearModal();
        this.setModalDate();

        if (data && data.type=="FeatureCollection"
            && data.features && data.features.length
            && data.features.length > 0) {
            this.fillModal(data.features[0]);
        }

        this.openPopup();
    },

    formatDate: function(date) {
        var day = date.getDate();
        return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+(day < 10 ? "0"+day : day);
    },

    clearModal: function() {
        $('#eventDataModal2').find('input').each(
            function() {
                $(this).val("");
            }
        );

        $('#eventDataModal2').find('textarea').each(
            function() {
                $(this).val("");
            }
        );
    },

    setModalDate: function() {
        $("#form-patrolDate").val(this.formatDate(new Date()));
    },

    fillModal: function(feature) {
        var props = feature.properties;

        $("#form-region").val(props["Region"]);
        $("#form-circuitID").val(props["Circuit_ID"]);
        $("#form-circuitName").val(props["Circuit_Name"]);
        $("#form-vendor").val(props["Vendor"]);
        $("#form-quad").val(props["Quad"]);

    },

    openPopup: function() {
        this.bindEvents();
        $('#eventDataModal2').modal('show');
    },

    bindEvents: function() {
        if (!this.binded) {
            $('#eventDataModal2').on('hidden.bs.modal', L.bind(this.onFormClosed, this));
            $("#saveEventDataModal2").on('click', L.bind(this.onSave, this))
            this.binded = true;
        }
    },

    onSave: function() {
        var properties = this.getFormData(),
            request = this.wfsBody("usa", "usa:pecotest", "geom", properties);
            console.log(request);
            this.makeRequest(request);
    },

    makeRequest: function(body) {

        $.ajax({
            method: "POST",
            crossDomain: true,
            url: this.options.url,
            contentType: "text/xml",
            dataType: "text",
            data: body,
            headers: {
                "Authorization": "Basic " + btoa(this.options.userName + ":" + this.options.password)
            },
            jsonpCallback: 'datasave',
            success: L.bind(this.onDataSave, this),
            failure: function(r){console.log("AJAX Failure!");console.log(r);}
        });
    },

    onDataSave: function(data) {
        console.log(data);
    },

    getFormData: function() {
        var result = {};

        $('#eventDataModal2').find('input').each(
            function() {
                if (this.type=="checkbox") {
                    result[this.name] = this.checked ? "Yes" : "No";
                } else {
                    result[this.name]=$(this).val();
                }
            }
        );

        $('#eventDataModal2').find('textarea').each(
            function() {
                result[this.name]=$(this).val();
            }
        );

        return result;
    },

    wfsBody: function(namesapce, typeName, geometryField, properties) {
        var xml;
        xml ='<wfs:Transaction service="WFS" version="1.0.0"';
        xml += ' xmlns:wfs="http://www.opengis.net/wfs"';
        xml += ' xmlns:usa="http://census.gov"';
        xml += ' xmlns:gml="http://www.opengis.net/gml">\n';
        xml += '   <wfs:Insert>\n';
        xml += '      <'+typeName+'>\n';
        xml += '        <usa:'+geometryField+'>\n';
        xml += this.marker.toGML()+"\n";
        xml += '        </usa:'+geometryField+'>\n';

        for (var k in properties) {
            if (properties.hasOwnProperty(k)) {
                xml += "<"+namesapce+":"+k+">";
                xml += properties[k];
                xml += "</"+namesapce+":"+k+">\n";
            }
        }

        xml += '      </'+typeName+'>\n';
        xml += '   </wfs:Insert>\n';
        xml += '</wfs:Transaction>\n';

        return xml;
    }

});

The corresponding HTML for eventDataModal is exactly the same as the above html code except the id has been changed to eventDataModal2


text:
Q: Add custom sorting algorithm to TableColumn here's my problem:
Set a custom sorting algorithm for the default sorting of a TableColumn.
Background:
As an example column, I want to use a column that represents IPv4 addresses as a String. So the default sorting is lexicographic (1.1.1.1, 1.1.1.10, 1.1.1.2). But I would like to have a numerical sorting (1.1.1.1, 1.1.1.2, 1.1.1.10).
The sorting algorithm is not the problem. I can trigger this sorting with a Button and the display in the TableView is correct. But what I want to do is to click on the column header and thereby call up my sorting algorithm.
General conditions:
The data in the table is in an ObservableList, which is wrapped in a SortedList.
My question at this point is: How can I realize this?

A: You need to bind your comparators. When you click on a column's header, the column's comparator will be used, if you click again, the reversed order of that comparator will be used. If you're using a SortedList, and you have a different comparator for each column, bind the comparator property of the list to the table's comparator property. This way, when you click on the header, your list will also be notified and your data will be updated:
columnA.setComparator(comparator1);
columnB.setComparator(comparator2);
columnC.setComparator(comparator3);

ObservableList<MyData> items = FXCollections.observableArrayList();
SortedList<MyData> sortedList = new SortedList<>(items);
sortedList.comparatorProperty().bind(tableView.comparatorProperty());

tableView.setItems(sortedList);


text:
Q: Typescript как вернуть тип ключа Пишу рендерер и не могу найти инфы, как правильно вернуть именно тип определённого свойства типа, передавая ключ в другом поле.
Может кто подскажет или укажет, что не так делаю? :(
type TUser = {
    age: number,
    initials: {
        name: string
    }
}

type TRendererFunctionArgs<TValues> = {
    value: TValues[keyof TValues],
}

type TRenderer<TValues> = {
    name: keyof TValues,
    renderer: ({ value }: TRendererFunctionArgs<TValues>) => string,
}

const renderer : TRenderer<TUser> = {
    name: 'initials',
    renderer: ({ value }) => value.name, // <--- Тут проблема, т.к. value : value: number | {name: string}
}

A:

type TUser = {
    age: number,
    initials: {
        name: string
    }
}

type TRenderer<TValues> = { [K in keyof TValues]-?: {
    name: K;
    renderer: ({ value }: { value: TValues[K] }) => string;
} }[keyof TValues];

const renderer : TRenderer<TUser> = {
    name: 'initials',
    renderer: ({ value }) => value.name
}


text:
Q: RLC circuit: change R and C because of constraint in L I am trying to build this circuit, but I can only find 47 μH inductors. Is there any way I can change R and C to get an equivalent circuit?

A: There are plenty of 470uH inductors for sale on, for example, Ebay https://www.ebay.co.uk/itm/281770277470
Have you tried simulating it to see the effect of using inductors 1/10 the the value specified? You would have to use capacitors with 10 times the value, 10uf, to obtain the same frequency response. The inductors have almost negligible resistance compared to the resistors, so provided the substitute parts are similar you would probably not have to change the resistors.
One downside of using components so far removed from the ones specified is that 10uF capacitors are going to be quite a bit bigger, expensive and possibly harder to obtain. Don't forget they will have to be non-polar, electrolytics are no good for this application.


text:
Q: How can I store divs content into an array? Hello this is my first post, i have been learning javascript for a week.
I want to make a little app that calculate how much do you spend on subscription per month.
You can add a new subscription with the name and the subscription price with two inputs --> and it creates 2 new div(one is subscriptionName the other is subscriptionPrice) they are store into a new div (newSubscription).
Now i would like to store all the subscriptionPrice var into an array and addition all of them.
(is it the right logic to apply ? maybe im wrong).
I also thought about doing the addition of the :
.abo-list > .abo:nth-child(1) > .abo-price
.abo-list > .abo:nth-child(1+1) > .abo-price
...
I have tried with this technic but the consol do not show even the first oneAboPrice.
 var pricesValues = [];
for (var i = 0; i < oneAboPrice.length; i++) {
    pricesValues.push(oneAboPrice[i].textContent);
}
console.log(pricesValues); /*dont show the values of every oneAboPrice*/

//Selectors
const nameInput = document.querySelector('.name');
const price = document.querySelector('.price');
const validate = document.querySelector('.validate');
const abosList = document.querySelector('.abo-list');
const montantTotal = document.querySelector('.montant-total');

//event listeners

validate.addEventListener('click', addAbo);
abosList.addEventListener('click', clickModify);

//functions
function addAbo(event){
    event.preventDefault();
    //creating the NewAbo DIV
    const Abodiv = document.createElement('div');
    Abodiv.classList.add('abo');
    //creating a LI
    const newAbo = document.createElement('li');
    newAbo.innerText = nameInput.value + ' ' ;
    newAbo.classList.add('abo-item');
    Abodiv.appendChild(newAbo);
    //creating a div Price of one Sub
    const oneAboPrice = document.createElement('div');
    oneAboPrice.classList.add('abo-price');
    oneAboPrice.innerText = price.value;
    Abodiv.appendChild(oneAboPrice);
    //modify button
    const modifyAbo = document.createElement('button');
    modifyAbo.innerHTML = '';
    modifyAbo.classList.add('modifyAbo');
    Abodiv.appendChild(modifyAbo);
    //trash button
    const trashAbo = document.createElement('button');
    trashAbo.innerHTML = '';
    trashAbo.classList.add("trashAbo");
    Abodiv.appendChild(trashAbo);
    //append to Abo-list
    abosList.appendChild(Abodiv);

    //total Amount of every newAboPrice

    //reset input value
    nameInput.value ="";
    price.value="";

    //store every .abo price (oneAboPrice)value into an array (this is where i need help)
    var pricesValues = [];
    for (var i = 0; i < oneAboPrice.length; i++) {
        pricesValues.push(oneAboPrice[i].textContent);
    }
    console.log(pricesValues); /*dont show the values of every oneAboPrice*/

    montantTotal.innerHTML = parseFloat(oneAboPrice.textContent); /* + oneAboPrice nth:child(2) + ....*/
}

function clickModify(e) {
    const item = e.target;
    //Delete newAbo
    if(item.classList[0] === "trashAbo"){
        const abo = item.parentElement;
    abo.remove();
    }
    //modify newAbo (To do)

}
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins&family=Saira+Extra+Condensed:wght@500&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.content-container{
    display: flex;
    justify-content: space-around;
}

.abo{
    display: flex;
    justify-content: space-between;
    list-style-type: none;
}

.abo li{
    flex: 1;
}
.fa-trash{
    pointer-events: none;
}

.abo-price{
    background: red;
}
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="style.css">
    <title>Gestionnaire d'abonnements</title>

Nom de l'abonnement
<input type="text"  class="name" placeholder="netflix">

Prix mensuel
<input type="number" class="price" placeholder="13,49">
            <input type="button" value="Valide" class="validate">

MES ABOS

A: I understand that you want to show the array of all items using this loop:
for (var i = 0; i < oneAboPrice.length; i++) {
    pricesValues.push(oneAboPrice[i].textContent);
}

The problem is, oneAboPrice is not the all items that you want, it's a new element that you just created with this code:
//creating a div Price of one Sub
const oneAboPrice = document.createElement('div');
oneAboPrice.classList.add('abo-price');
oneAboPrice.innerText = price.value;
Abodiv.appendChild(oneAboPrice);

Solution
So, to correctly loop through all items, this is what the loop should be:
document.querySelectorAll('.abo-price').forEach(item => {
    pricesValues.push(parseFloat(item.innerHTML));
});

Let's me explain. document.querySelectorAll('.abo-price') will select all of your oneAboPrice at the time being. Then you can use item.innerHTML to get the text inside of each item, not item.textContent.

//Selectors
const nameInput = document.querySelector('.name');
const price = document.querySelector('.price');
const validate = document.querySelector('.validate');
const abosList = document.querySelector('.abo-list');
const montantTotal = document.querySelector('.montant-total');

//event listeners

validate.addEventListener('click', addAbo);
abosList.addEventListener('click', clickModify);

//functions
function addAbo(event) {
  event.preventDefault();
  //creating the NewAbo DIV
  const Abodiv = document.createElement('div');
  Abodiv.classList.add('abo');
  //creating a LI
  const newAbo = document.createElement('li');
  newAbo.innerText = nameInput.value + ' ';
  newAbo.classList.add('abo-item');
  Abodiv.appendChild(newAbo);
  //creating a div Price of one Sub
  const oneAboPrice = document.createElement('div');
  oneAboPrice.classList.add('abo-price');
  oneAboPrice.innerText = price.value;
  Abodiv.appendChild(oneAboPrice);
  //modify button
  const modifyAbo = document.createElement('button');
  modifyAbo.innerHTML = '';
  modifyAbo.classList.add('modifyAbo');
  Abodiv.appendChild(modifyAbo);
  //trash button
  const trashAbo = document.createElement('button');
  trashAbo.innerHTML = '';
  trashAbo.classList.add("trashAbo");
  Abodiv.appendChild(trashAbo);
  //append to Abo-list
  abosList.appendChild(Abodiv);

  //total Amount of every newAboPrice

  //reset input value
  nameInput.value = "";
  price.value = "";

  //store every .abo price (oneAboPrice)value into an array (this is where i need help)
  var pricesValues = [];
  document.querySelectorAll('.abo-price').forEach(item => {
    pricesValues.push(parseFloat(item.innerHTML));
  });

  console.log(pricesValues); /*dont show the values of every oneAboPrice*/

  montantTotal.innerHTML = parseFloat(oneAboPrice.textContent); /* + oneAboPrice nth:child(2) + ....*/
}

function clickModify(e) {
  const item = e.target;
  //Delete newAbo
  if (item.classList[0] === "trashAbo") {
    const abo = item.parentElement;
    abo.remove();
  }
  //modify newAbo (To do)

}
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins&family=Saira+Extra+Condensed:wght@500&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.content-container {
  display: flex;
  justify-content: space-around;
}

.abo {
  display: flex;
  justify-content: space-between;
  list-style-type: none;
}

.abo li {
  flex: 1;
}

.fa-trash {
  pointer-events: none;
}

.abo-price {
  background: red;
}
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer"
  />
  <link rel="stylesheet" href="style.css">
  <title>Gestionnaire d'abonnements</title>

Nom de l'abonnement
<input type="text" class="name" placeholder="netflix">

Prix mensuel
<input type="number" class="price" placeholder="13,49">
      <input type="button" value="Valide" class="validate">

MES ABOS

A: Here is a complete version
I know it is a lot different from your code, but it is all recommended methods

//Selectors
const nameInput = document.querySelector('.name');
const price = document.querySelector('.price');
const validate = document.querySelector('.validate');
const abosList = document.querySelector('.abo-list');
const montantTotal = document.querySelector('.montant-total');

//event listeners

validate.addEventListener('click', addAbo);
abosList.addEventListener('click', clickModify);

let abos = []; // the main array

const render = () => {
  let sum = 0;
  abosList.innerHTML = abos.map(({name,price}) => { // grb the name and price from the object array
    sum += price; // sum it for the montantTotal
    // create an array of template literals
    return `

${name}

${price}

  <button type="button" class="modifyAbo"></button>
  <button type="button" class="trashAbo"></button>

`
  }).join(""); // and join them with nothing

  montantTotal.innerHTML = sum.toFixed(2)

}

function addAbo(event) {
  event.preventDefault();
  abos.push({ name: nameInput.value, price: +price.value }); // create an array of names,prices
  //reset input value
  nameInput.value = "";
  price.value = "";
  render(); // show the array
}

function clickModify(e) {
  const item = e.target.closest('button');
  //Delete newAbo
  if (item.classList.contains("trashAbo")) {
    const parent = item.closest('div')
    const name = parent.querySelector('li').textContent; // save the name
    parent.remove(); // before removing
    abos = abos.filter(item => item.name != name); // remove the object with the name from the array
  } else if (item.classList.contains("modifyAbo")) {
    const parent = item.closest('div');
    const aboName = parent.querySelector('li').textContent; // copy from the div
    const aboPrice = +parent.querySelector('.abo-price').textContent; // copy from the div
    nameInput.value = aboName; // set the form values
    price.value = aboPrice;    // so they can be edited
    abos = abos.filter(item => item.name != aboName); // remove the abo so valide will add it back
  }
  render()
}
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins&family=Saira+Extra+Condensed:wght@500&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.content-container {
  display: flex;
  justify-content: space-around;
}

.abo {
  display: flex;
  justify-content: space-between;
  list-style-type: none;
}

.abo li {
  flex: 1;
}

.fa-trash {
  pointer-events: none;
}

.abo-price {
  background: red;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<title>Gestionnaire d'abonnements</title>

Nom de l'abonnement
<input type="text" class="name" placeholder="netflix">

Prix mensuel
<input type="number" class="price" placeholder="13,49">
    <input type="button" value="Valide" class="validate">

MES ABOS

A: If your only purpose is to get the total value of all subscriptions, you don't need an array. just call the function below every time a new subscription is added (call it inside addAbo).
// this will select all the `div` items with the class `.abo-price`
const subscriptionEls = document.querySelectorAll('.abo-price');

function calculateTotal() {
  let total = 0;

  // loop through each '.abo-price' element
  subscriptionEls.forEach((el) => {
    const textValue = el.innerText; // '12,49' (string)
    const numericValue = parseInt(textValue); // 12,49 (number)
    total += numericValue; // add each numerical value to the total
  })

  montantTotal.innerText = total;
}


text:
Q: How to add wildcard on text using BluePrism code stage? I Have a file name like that "Informe_Pro_Bra-201712110918.xlsx", i can fixe name and date but hours no because it's variable. So i want using code stage of BluePrism (C#) put the last  4 caracters "HHMM" as wilcards, to get others files in this date even with different extension. What do for that?
Help Please

A: For searching files you can use for that object "Utility - File Management", action: "Get files".
there are two inputs:

*

*Folder

*Patterns CSV

Please use Pattern:
"Informe_Pro_Bra-20171211*.xlsx"

That way you can quickly find the file that you're looking for.

A: Get the all file in the collection and then apply the filter like
"FileName like 'Info_*.xlsx'"

You will be getting another collection with filtered one loop through it.
As we're already having the path append the FileName and generate the dynamic path like
[FTP_Path]&"\"&[Collection.Filename]


text:
Q: Trying to place marquee in a precise location over an Image. Have the Image in a parent div. Within that parent div, I have the marquee div Can not locate a div within a parent div....
I will show code below....  Have tried all the position: absolute; position: fixed; etc... in the .main the .marq and the .geek1 sections.  I copied this code from elsewhere, I am in way over my head, miracle I got this far! I am trying to get the .geek1 text to scroll across the Image just below the Last Heard in the gray area. Need the most simple solution. Thanks a lot!
<!DOCTYPE html>

<title>Marquee Tag</title>

<marquee class="marq" bgcolor = "636562" direction = "left" loop="" >

2 &nbsp N &nbsp K4WZV &nbsp Robert

</marquee>

Looking for any help anyone can provide....

A: I don't think so but maybe z-index should help alot. I'm not sure what are you trying to do tell me where you want to put the gray area.

A: Try This code
<!DOCTYPE html>

<title>Marquee Tag</title>

    <marquee class="marq" bgcolor = "636562" direction = "left" loop="" >

2 &nbsp N &nbsp K4WZV &nbsp Robert

    </marquee>

thank you


text:
Q: loading images from array list using picasso library hi im still new to android
i was displaying some dummy images in a grid view, i have a custom adapter that uses a view holder, it puts a string array and type array into an array list and displays it in the gridview this all works fine,
then i realised my images i wanted to use were far too large and found the picasso library, seems very powerful and easy to use but im unsure what to pass into the load method as it wants a type array and my type array is in an array list im sure this is a simple fix but i cant see it,
my images are in the app
here is my imageId and viewholder class
 class imageIds
{
    int imageId;
    String imageNames;

    imageIds(int imageId, String imageNames)
    {
        this.imageId = imageId;
        this.imageNames = imageNames;
    }
}
class ViewHolder
{
    ImageView myView;
    ViewHolder(View view){
        myView = (ImageView) view.findViewById(R.id.imageView);
    }
}

this is the beginning of my adapter where i declare and initialize my arrays
 class myAdapter extends BaseAdapter{
        ArrayList<imageIds> list;
    Context context;
    myAdapter(Context context)
    {
        this.context = context;
    list = new ArrayList<imageIds>();
    Resources res = context.getResources();
    String[] tempWallpaperNames = res.getStringArray(R.array.wallpaper_list);

        int[] tempWallPaperImages = {R.drawable.ic_home,R.drawable.ic_photos,R.drawable.ic_home,
                R.drawable.ic_photos,R.drawable.ic_photos,R.drawable.ic_photos,R.drawable.ic_home,
                R.drawable.ic_home,R.drawable.ic_photos,R.drawable.ic_home};
            for (int i = 0; i<10;i++)
            {
                imageIds tempWallpaper = new imageIds(tempWallPaperImages[i],tempWallpaperNames[i]);
                list.add(tempWallpaper);
            }
    }

and here is my adapter get view method
@Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View row = convertView;
        ViewHolder holder = null;
        if (row == null){

            LayoutInflater inflater = (LayoutInflater)
            context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            row = inflater.inflate(R.layout.grid_images,parent,false);
            holder = new ViewHolder(row);
            row.setTag(holder);
        }
        else{
          holder = (ViewHolder) row.getTag();
        }

        imageIds wallPapers = list.get(position);
        holder.myView.setImageResource(wallPapers.imageId);

        holder.myView.setTag(wallPapers);

        Picasso.with(getActivity())
                .load(imageIds[position])
                .placeholder(R.drawable.ic_photos)
                .error(R.drawable.ic_drawer)
                .noFade().resize(120,120)
                .centerCrop().into(holder.myView);
        return holder.myView;

        return row;
    }
}

android studio is telling me an expression is expected here
.load(imageIds[position])

thanks for any help

A: load expects the actual image filename or a resourceId.
i'm assuming the imageNames holds the location/filename or you could use the imageId.
change
.load(imageIds[position])

To
.load(imageIds[position].imageNames) or .load(imageIds[position].imageId)

Update
You are already using list.get(position) so you are only returning one item in the wallPapers variable.
So the code should be .load(wallPapers.imageId)


text:
Q: multiprocessing Event subclassing I have attempted to subclass Event from multiprocessing, but it doesn't work, does anyone know why?
from multiprocessing import Event

class MyEvent(Event):
     def __init__(self):
         self.__init__()

I get the following error message:
TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str

A: multiprocessing.Event is actually a function that returns an instance of multiprocessing.synchronize.Event. You would need to subclass that class directly.
(Note also that your __init__ method is very strange, and will cause an infinite recursion. I suspect you meant to call super(); but if you are not actually doing anything in that method, it is better not to define it at all.)


text:
Q: Infinite Reload With Rotating State Param in Facebook Application Infinite Reload With Rotating State Param in my facebook web app, this problem occur suddenly and suddenly all fb app on my server stop working
Page is refreshing again and again and not able to open ,
script work fine in other serverbut fails to work in this , is there any server config to handle facebook app.
You can chk issue at Link - gomandi.com/visit/
State Token is Refreshing again and again in all website hosted in my server , Looks like some Server confiG. issue is there . Can anyone help me with this.as i am my server support team unable to find this issue why my server fails to connect with fb server or viceversa.
SAME APP WORK IN OTHER SERVER !!

A: Based upon the comments on the question above, what you need to do is to create a brand new app for the different domain names.  So you can have specific URLs for each domain specified in each of the app's app settings.  So if there are three domains, then I'd recommend three apps configured correctly to point to each of those three domains.


text:
Q: Есть ли в node.js что-то наподобие input? Мне нужно запросить строковые данные у пользователя, которые затем будут помещены в глобальную переменную для дальнейшей работы с ней. Как это реализуется?

A: Если нужно прям взаимодействовать в форме диалога через консоль , как вариант запускать приложение с аргументами  (например node test.js hello=world)  и при старте приложения считывать параметры и сохранять
const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

let GlobalAnswer = 'nothing';

rl.question('What do you think of Node.js? ', (answer) => {
  if (!answer) {
      answer = GlobalAnswer;
  }
  // TODO: Log the answer in a database
  console.log(`Thank you for your valuable feedback: ${answer}`);

  rl.close();
});

A: Есть read_line пакет
npm i readline
(async()=>{
    const readline = require('readline');
    const rl = readline.createInterface({input: process.stdin, output: process.stdout});
    const key = await new Promise((r)=>{rl.question('Type: ', r)});
    console.log(key);
})();


text:
Q: Locks in database queries Are locks implicitly applied when we query over mysql through sql?
What type of locks are applied when i do a read from db, write from db? How does this locks function in databases that are used for real time applications?

A: Q: Are locks implicitly applied when we query over mysql through sql?
A: Yes.
Q: What type of locks are applied when i do a read from db, write from db?
A: That depends on the storage engine (MyISAM, InnoDB, et al.)
MyISAM takes "table level" locks. It uses "share" locks for read, and "exclusive" lock for writes.
InnoDB uses both "table level" and "row level" locks, and is influenced by the session isolation level (REPEATABLE-READ, READ-COMMITTED, et al.)
A complete discussion of MySQL locking is much to deep for an answer on StackOverflow.
Q: How does this locks function in databases that are used for real time applications?
A: The lock mechanisms function the same, the storage engine doesn't really differentiate between applications that are "real time" or otherwise. There is no specific "real time" setting for InnoDB locking.
Our application requirements will influence our database design and implementation decisions.


text:
Q: Achieve forms in react native Can we achieve UI like below screenshot in react native, rather forms ?
Are those possible ?

A: If you would like to build forms in react native you may use tcomb-form-native. It provides an easy interface to quickly build a form.
EDIT:
To build the exact same UI, you would have to restrict the widths of the elements using Flexbox.


text:
Q: How to divide web pages in blocks with sailsjs I am starting developing with Sailsjs and I would like to know how to divide a webpage into differents blocks.
for example  :
in layout.jade i have
doctype html
html(lang="fr")
head

body
    div(class='container')
        div(class='row')
            div(class='col-md-12')
                block header
                    h1 header
                div(class='row')
                    div(class='col-md-8')
                        block content
                    div(class='col-md-4')
                        block right
                block footer

then in my controller1/index.jade i have
extends layout
    append content
        p
            some content

So when I type http://myserver.com/controller1/index in the browser, it works.
How to append some code in the block right form the result of another controller ? (I don't want to append some code to the block right directly in the controller1/index.jade file, to make the file as shorter as possible).
So I guess we can call another method of the controller inside the jade file ?
For example i would like to put a code like :
append right
    =call('controller2/action1')

at the end of the controller1/index.jade file.
The purpose of my question is to figure out how divide the html parts of a webpage like we can do it with php using include method (for example).
Thank you
Benjamin


text:
Q: NSMutable Array to XML file I have an NSMutableArray of custom objects called Clip. Each clip Object has some NSString properties (clipName,tcIn, tcOut, file path and so on..). How do I write an xml File on disk where each clip in the array is a node of the xml file and its properties are elements of the node?
Thanks in advance
Dario

A: I think this is what should do you:
//Create xml string
NSMutableString *xmlString = [[NSMutableString alloc] init];

//Add all the data to the string
[xmlString appendFormat:@"<clips>"];
for (Clip *c in clipsArray)
{
    [xmlString appendFormat:@"\n\t<clip>"];
    [xmlString appendFormat:@"\n\t\t<clipName>%@</clipName>", c.clipName];
    [xmlString appendFormat:@"\n\t\t<tcIn>%@</tcIn>", c.tcIn];
    ...
    [xmlString appendFormat:@"</clip>"];
}
[xmlString appendFormat:@"</clips>"];

//Create a variable to represent the filepath of the outputted file
//This is taken from some code which saves to an iPhone app's documents directory, it might not be ideal
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *finalPath = [documentsDirectory stringByAppendingPathComponent:@"output.xml"];

//Actually write the information
NSData *data = [xmlString dataUsingEncoding:NSUTF8StringEncoding];
[[NSFileManager defaultManager] createFileAtPath:finalPath contents:data attributes:nil];


text:
Q: Destructive Git Commits? I'm starting to learn Git, which, so far, is great. I'm just confused on one area, this could just be a misunderstanding.
Suppose that John is working in the "john" directory and Bob is working in the "bob" directory.
If John's code isn't the final item we desire for the "john" directory and Bob pulls from the dev branch, Bob will get all of John's "bad" code, correct?
So, Bob applies a simple fix to the "bob" directory and pushes to the production branch. Doesn't John's bad code in the "john" directory sneak onto the production branch through Bob's push?
Does this even happen?
How is this avoided?
Thank you all!

A: There's a distinction between pushing dev -> production and committing a fix to the production branch directly.  The latter is safe for bob.
The only way to know code is safe is to test it before pushing it.  This could be a QA team, regression/unit tests, etc.

A: You usually will not commit "broken code" into develop, or master (that are the common names). The develop branch is usually for code "that should work", master is for "stable code" (something like trunk in svn). If you want to create something new, create a new branch for it, for example feature/myFeature. Now everybody knows, that this code may, or may not be complete and will usually avoid to merge it into their own branch. Once you are done ("it should work"), merge it back into develop.
However, even if you scenario happens, git will recognize, that this bad code is already part of develop, and will not apply it again.


text:
Q: Как передать значение в другой файл? извиняюсь за такой глупый вопрос, но как мне с одного файла
передать в другой файл в amount число?
допустим я хочу с файла A: передать 10 в файл Б: amount?

async function crystal() {
    const response = await axios.get('https://api.crystalpay.ru/v1/?', {
        params: {
            s: '',
            n: '',
            o: 'invoice-create',
                amount: '',
                lifetime: '1440',
                callback: 'localhost',
                extra: ''
            }
    })
    // console.log(response);
    return response.data.id
}

module.exports.crystal = crystal


text:
Q: Django UnicodeDecodeError While inserting arabic letters i'm trying to input Arabic letters while using django command python manage.py createsuperuser
and it gives me always this error, what should i do to solve this?
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 61, in execute
    return super().execute(*args, **options)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 111, in handle
    input_value = self.get_input_data(field, message)
  File "/home/mohammed/PycharmProjects/PatientStatus/venv/lib/python3.8/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 176, in get_input_data
    raw_value = input(message)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd8 in position 4: invalid continuation byte


text:
Q: Extjs 4 listen events for grid's selection model in controller I have a grid and controller for it.
I try listen for 'select' event for the grid.
The code is:
Ext.define('Icc.controller.Questionnaires', {
  extend: 'Ext.app.Controller',

  stores: ['Questionnaires'],

  models: ['Questionnaire'],

  views: ['QuestionnairesGrid'],

  init: function() {
      this.control({
        'mygrid > selectionmodel': {
            // do what I need here
        }
      });
  }
});

How it can be done correctly?

A: I found the way to do that:
init: function() {
    this.control({
        'questionnairesgrid': {
            selectionchange: this.selectionChange
        }
    });
},

Strange that I can listen events for selection model for the grid itself...


text:
Q: Find all positive integers $a$ and $b$ such that $(1 + a)(8 + b)(a + b) = 27ab$. Here's the problem I'm having difficulties with:

Find all positive integers $a$ and $b$ such that $$(1 + a)(8 + b)(a + b) = 27ab\,.$$

Does anyone have an idea how to do this? Any detailed solution is welcome! :)

A: Using Hölder's inequality,
$$27ab = (a+1)(8+b)(b+a) \geqslant \left(2\sqrt[3]{ab}+\sqrt[3]{ab} \right)^3=27ab$$
Hence we are looking for the equality case for Hölder, which is when $a:8:b=1:b:a \implies (a, b)=(2, 4)$.
In fact, this is the only solution among positive reals, not just positive integers.

A: This is a supplementary solution, where I solve for all $(a,b)\in\mathbb{Z}\times\mathbb{Z}$ such that $$(1+a)(8+b)(a+b)=27ab\,.$$ From $(1+a)(8+b)(a+b)-27ab=0$, we have
$$(8+b)a^2+\big((8+b)(b+1)-27b\big)a+b(8+b)=0\,.$$
The discriminant of this quadratic polynomial with respect to $a$ is
$$\begin{align}\big((8+b)(b+1)-27b\big)^2-4\cdot(8+b)\cdot b(8+b)&=b^4-40b^3+276b^2-544b+64\\&=(b-4)^2(b^2-32b+4)\,.\end{align}$$
We require that $(b-4)^2(b^2-32b+4)$ be a perfect square.  If $b=4$, then $$12(a-2)^2=12\left(a^2-4a+4\right)=0\,,$$ so $a=2$.  If $b\neq 4$, then $$(b-16)^2-252=b^2-32b+4=c^2$$
for some integer $c$.  Thus, $$d^2-c^2=252\,,$$ where $d:=b-16$.
Since $4\mid 252$ but $8\nmid 252$, both $c$ and $d$ are even.  Let $c:=2p$ and $d:=2q$, so that $$(q+p)(q-p)=q^2-p^2=\frac{d^2-c^2}{4}=63\tag{*}\,.$$
Therefore, the possible values of $(q+p,q-p)$ are $$(-63,-1)\,,\,\,(-21,-3)\,,\,\,(-9,-7)\,,\,\,(-7,-9)\,,\,\,(-3,-21)\,,\,\,(-1,-63)\,,$$ $$(1,63)\,,\,\,(3,21)\,,\,\,(7,9)\,,\,\,(9,7)\,,\,\,(21,3)\,,\text{ and }(63,1)\,.$$
Thus, $b-16=d=2q=(q+p)+(q-p)$ takes the $6$ values
$$-64,-24,-16,+16,+24,+64\,.$$
Ergo, $b\in\{-48,-8,0,32,40,80\}$, resulting in the following solutions $(a,b)$:
$$(80,-48)\,,\,\,(0,-8)\,,\,\,(-1,0)\,,\,\,(0,0)\,,\,\,(-5,32),(-16,40)\,,\text{ and }(-55,80)\,,$$
as well as the pair $(2,4)$ found earlier.
Using (*), we can also find all rational solutions.  By setting $r:=q+p$, the rational solutions $(a,b)\neq (2,4)$ take the form
$$\left(-\frac{(3+r)(7+r)}{21+r},\frac{(7+r)(9+r)}{r}\right)\text{ for }r\in\mathbb{Q}\setminus\{0,-21\}\,,\tag{#}$$
and
$$\left(-\frac{(9+r)(21+r)}{r(3+r)},\frac{(7+r)(9+r)}{r}\right)\text{ for }r\in\mathbb{Q}\setminus\{0,-3\}\,.\tag{@}$$
By the way, I just realized that with the transformation $r\mapsto\dfrac{63}{r}$, the two solutions (#) and (@) are identical.  (The same parametrization also works if you want to solve for real solutions $(a,b)\neq (2,4)$, or even complex solutions $(a,b)$, where $r:=-6\pm3\sqrt{3}\text{i}$ gives rise to the pair $(a,b)=(2,4)$.)

A: This is not a complete solution, but it points the way to one, and its simplicity, I think, makes it worth mentioning.
By expanding out the product and rearranging the results, we obtain the equivalent equation to solve,
$${8+8a\over b}+{8+b\over a}=18-a-b$$
Since the left hand side is positive, the right hand side limits the possibilities for $a$ and $b$ to a small enough set for brute force to take over.


text:
Q: Api Pagination Call to undefined method stdClass::links() on laravel 8 hello can you help me? so i am paginating on server side, but when i try to display on client side i get error like this...
i can say I can't use firstItem(), Thanks for your response, I hope this gets the answer..
In Controller
$response = Http::withHeaders([
            'X-Authorization'  =>  'NkKeAs7Og8O6WcNste9OsAjkui2pSZnjZr6WOcDf1EjU1UDPuz88CATNqFI2rkSN'
        ])->get('http://www.Api.net/api/get-produk', [
            'type_product'  => $filter,
            'limit'      => $request->length,
            'offset'      =>  $request->start,
        ]);
        $data = json_decode($response);

In Rest API
$produk = Daftarproduk::select('cat_number', 'brand', 'nama_produk', 'host', 'reactivity', 'clone_type', 'application', 'pack_size', 'type_product', 'pack_category', 'price')
            ->where('type_product', $request->get('type_product'))
            ->offset($request->offset)
            ->limit($request->limit)
            ->paginate();

In View

                @foreach ($produk->data as $item)

                        {{ $loop->iteration }}
                        {{ $item->cat_number }}
                        {{ $item->brand }}
                        {{ $item->nama_produk }}
                        {{ $item->host }}
                        {{ $item->reactivity }}
                        {{ $item->clone_type }}
                        {{ $item->application }}
                        {{ $item->pack_size }}
                        {{ $item->type_product }}
                        {{ $item->price }}

                @endforeach

            Showing
            {{ $produk->firstItem() }}
            to
            {{ $produk->lastItem() }}
            of
            {{ $produk->total() }}
            Entries

            {{ $produk->links() }}


text:
Q: Problem building the signal interceptor during the Molecular Level? I have a problem in building the signal interception, it always tells me to use the power from one grid, which I've done but it doesn't work at all.
Is this a bug or there is a certain way of connecting them?

A: You need all components to be linked together with wires, except the pad which goes underneath the emitter.
The safest way to be sure everything is linked properly is to connect all three large generators (needed to get the required 27 energy), the console and the dish to the emitter.
Your layout should look like this:

Be sure your pad is snapped correctly under the emitter. It will draw its power automatically from it, you don't need to use a wire.
NOTE: If you decided to build the Signal Interceptor with the BoS at the Boston Airport, you will need to get rid of the rugs in order to snap the emitter to the pad.
With rugs (Cannot place it correctly):

Without rugs (Snaps into place):

Failing to place the pad under the emitter will trigger the generic "make sure they are on the same grid" sentence.

A: The easiest way to ensure that "power is coming from one grid" is to plug them into each other. If you connect each component of the signal interceptor together with wire then they'll all be on the same grid.


text:
Q: pt-kill - how to securely allow access to mysql server when running as service I know how to run pt-kill as systemd service:
[Unit]
Description = pt-kill myUser
After=syslog.target mysql.service
Requires=mysql.service
[Service]
Type = simple
PIDFile = /var/run/ptkill.pid
ExecStart = /usr/bin/pt-kill -uxxx -pxxx --daemonize --pid=/var/run/ptkill.pid --log=/var/log/ptkill.log --match-user myUser --match-state "Sending data" --busy-time 640 --kill-query --print
Restart=on-abort
[Install]
WantedBy=multi-user.target

However, this way another system user can see the mysql root password via ps -e -o pid,unit,cmd:
7786 ptkill.service perl /usr/bin/pt-kill -uxxx -pxxx --daemonize --pid=/var/run/ptkill.pid --log=/var/log

I tried adding User=root to the [Service]-section, because root user has protected /root/.my.cnf where passwordless access to mysql is configured. Sadly this doesn't work (I got no permission to access mysql without specifying user... when starting ptkill.service, I think the protected .my.cnf does not get loaded when starting the ptkill.service).
I also tried adding parameters "-umyUser -p`cat /path/to/my/password`" which does not work either.
How to securely run pt-kill as a system service pt-kill and how to securely let it access the mysql server?

A: I hope you are not one of my workmates :-) He had to setup a very similar configuration than yours a few weeks ago- you can check our packages if that helps you: Source deb, puppetization.
I told him to use socket-based authentication, it is the same method we use for non-human accounts that only need local-only permissions (icinga, prometheus). You only need to enable the plugin and tell the account with the same name as the account the service is going to run as to use it, so no password is required. Because there is no password, it cannot be stolen, so a compromise of the host would not escalate to a worse issue. Also less things that are private to handle. Unless there is a MySQL bug, the account is as secure as your OS account. You have to create a non-root account for both MySQL (auth_socket will provent password-based authentication and will lock it to localhost only) and the OS (system user with locked login), or otherwise it would defeat the point of it.
If for some reason you cannot use the above, you can still use password-based authentication, but set it on its own configuration file only readable by the user (non-root) that you start the service as.
The point is always to provide the least amount of permissions you can to a service. Root usage not only give the maximum amount, it also overlaps some OS (logging, limits, etc.) and mysql limits (max_connections) you don't want to, even if it effectively has a lots of permissions to kill other processes.


text:
Q: How to Remove Default Web Browser Option I installed Private Internet Access VPN and then uninstalled it with CleanMyMac. As far as I can tell there is no PIA folders or files left on the computer (I could be wrong of course). I noticed that in the default web browser options under system preferences, Private Internet Access is listed as an option. How would I go about removing this? Do I have to edit a .plist file? Where would the available default web browser options be kept in MacOS Serra? Thank you.

A: Open system preferences and go to general (or search for default web browser).
Set Safari as the default.

A: It seems that the answer to this question is on Private Internet Access' own website. HelpDesk Running the command they provide in the terminal fixes the problem I had.


text:
Q: Angular: On Refresh - Resources Not Found ( Auto-change the Request URL) Problem Statement
Steps Followed:

*

*open http://localhost:4200 (index file get successfully loaded)

*open http://localhost:4200/customers (UI successfully loaded)

Header: No Resource/File with Status Code 404)
Note the Request URL of manifest.json  http://localhost:4200/manifest.json

*Press Refresh Button

Case 1: URL becomes http://localhost:4200/customers/ (only index file loads without UI for /customers)
Note the URL of manifest.json is http://localhost:4200/customers/manifest.json with Status Code 404

Case 2: Multiple Resouces Not Found because of the wrong Request URL

Project Structure

index.html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <base href="">

  <link rel="stylesheet" href="/assets/vendors/w3/w3css4w3.css">
  <link rel="stylesheet" href="/assets/vendors/bootstrap/dist/css/bootstrap.css">
  <link rel="stylesheet" href="/assets/vendors/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="/assets/vendors/themify-icons/css/themify-icons.css">
  <link rel="stylesheet" href="/assets/vendors/flag-icon-css/css/flag-icon.min.css">
  <link rel="stylesheet" href="/assets/vendors/selectFX/css/cs-skin-elastic.css">

  <link rel="stylesheet" type="text/css" href="/assets/vendors/chosen/chosen.min.css">
  <link rel="stylesheet" href="/assets/css/style.css">

  <link rel="stylesheet" href="../../../assets/vendors/datatables.net-bs4/css/dataTables.bootstrap4.min.css">

  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="manifest" href="manifest.json">
  <meta name="theme-color" content="#1976d2">
</head>
<body>
  <app-root></app-root>
  <script src="/assets/vendors/jquery/dist/jquery.min.js"></script>
  <script src="/assets/vendors/popper.js/dist/umd/popper.min.js"></script>
  <script src="/assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
  <script src="/assets/js/main.js"></script>
  <script src="/assets/vendors/chosen/chosen.jquery.min.js"></script>

    <!-- //filters -->
    <script src="/assets/vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <!-- //css effects -->
    <script src="/assets/vendors/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
    <!-- //filters -->
    <script src="/assets/js/init-scripts/data-table/datatables-init.js"></script>
  <noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>

manifest.json
{
  "name": "MyAppName",
  "short_name": "MyAppName",
  "theme_color": "#1976d2",
  "background_color": "#fafafa",
  "display": "standalone",
  "scope": "/",
  "start_url": "/",
  "prefer_related_applications": true,
  "icons": [
    {
      "src": "assets/icons/icon-72x72.png",
      "sizes": "72x72",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-384x384.png",
      "sizes": "384x384",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

angular.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "MyAppName": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/MyAppName",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/manifest.json"
            ],
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "es5BrowserSupport": true
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ],
              "serviceWorker": true,
              "ngswConfigPath": "src/ngsw-config.json"
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "MyAppName:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "MyAppName:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "MyAppName:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/manifest.json"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "MyAppName-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "MyAppName:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "MyAppName:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "MyAppName"
}

app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

//imports Component

const routes: Routes =
[
  {path:'customer/new',component:CreateCustomerAccountComponent,},
  {path:'customers',component:CustomersComponent},
  {path:'customers/:id/history',component:CustomerBuyHistoryComponent},
  {path:'items',component:ItemsComponent},
  {path:'item/new',component:CreateItemComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
export const routingComponents=
[
  Components
]

***ng --version***

Angular CLI: 7.3.9
Node: 12.3.1
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@angular/pwa                      0.12.4
@ngtools/webpack                  7.3.9
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

A: Put a slash in your index.html
<base href="/">

A: Adding a / in <base href="/"> in index.html solved the issue.
Why?
<base href="/"> is your root base path, all the resources, and assets in your application are referenced based on this.
This means that your app would start from root folder i.e locally it would consider localhost:4200/ and on a server it would consider root folder.
When you run your app, it may confuse your browser as your files are not at the root path and could through 404.


text:
Q: How to shrink /home and extend /root partitions

I want to shrink my /home to about 15G, and then extend my / to fill up that remaining space.
How can I do this?
In GParted, I can't seem to shrink /home because there is no free space after it I assume
The same goes for extending /

A: Note: You really need a larger HDD/SSD
Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.
Keep these things in mind:

*

*always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

*a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

*a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

*if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

*you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window
Do the following...
Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

*

*boot to a Ubuntu Live DVD/USB

*start gparted

*resize the right side of /dev/nvme0n1p7 (home) and reduce that partition by 5-10G

*move the /dev/nvme0n1p7 (home) partition all the way right

*move the /dev/nvme0n1p6 (swap) partition all the way right

*resize the right side of /dev/nvme0n1p5 (/) all the way right

*click the Apply icon


text:
Q: I enable WebGPU in Chrome DEV, and it still doesn't work So, I have enabled the #enable-unsafe-webgpu flag and I even get a warning when opening Chrome, that "WebGPU is enabled and stability will suffer". Yet, when trying to access any WebGPU example website, I get an error, stating that my browser doesn't support WebGPU / WebGPU is not enabled. What can I do?
I am using Ubuntu 20.04 and Chrome Version 103.0.5056.0 (Official Build) dev (64-bit)
Thanks

A: For now on Linux Chrome Dev, you can use WebGPU by launching Chrome via cmd line like this:
google-chrome-unstable --enable-unsafe-webgpu --enable-features=Vulkan,UseSkiaRenderer

(Basically you need the extra --enable-features=Vulkan,UseSkiaRenderer on Linux as indicated in the F12 developer console)

A: I haven't tried it out but, according to developer.chrome.com/docs/web-platform/webgpu/, experimental can be enabled. From the article:
From :

Linux experimental support is available by running Chrome with --enable-features=Vulkan

A: WebGPU on a HTML-5 canvas is work in progress, no release yet
For use in a browser (that is: other people too) I'd stick with WEBGL2 for now.. as a user, I don't like to install programs that call themselves "unstable" or options that are called "unsafe". In the default version of Chrome the flag set option was removed (?) but Chrome seems to copy the setting of Chrome Canary without notice (?) all that does not indicate trust at this moment.. which is reenforced when I open the Webkit page https://webkit.org/demos/webgpu/ and see warnings all over the place.
You can test WebGPU without the need for a browser
I'm certainly going to use WebGPU when it comes out. If you want a "sneak preview" there are RUST/Wasm and CPP/Wasm solutions without the need for a browser to render it, I tried https://github.com/cwoffenden/hello-webgpu


text:
Q: Remove layout options from CMS I'm building a Magento theme that uses only a left column template and a single column template. How do I remove the layout options for a right column template or a three column template in the CMS?
I see that the default page.xml includes this code:
<page_two_columns_right translate="label">
    All Two-Column Layout Pages (Right Column)
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>

        <action method="setIsHandle"><applied>1</applied></action>
        <action method="setLayoutCode"><name>two_columns_right</name></action>
    </reference>
</page_two_columns_right>

<page_three_columns translate="label">
    All Three-Column Layout Pages
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>

        <action method="setIsHandle"><applied>1</applied></action>
        <action method="setLayoutCode"><name>three_columns</name></action>
    </reference>
</page_three_columns>

How do I override these options or remove them?

A: You don't want to/should not remove those codes from page.xml. Eventhough you are not using other page layouts, removing their definition from page.xml is utter nonsense !!
What you need to do is, you should use the required page layout in your CMS Pages. You can do this in many ways. The most elegant way is putting a layout update via local.xml
File : app\design\frontend\[your-package]\[your-theme]\layout\local.xml
<layout>
    <cms_page_view>
        <reference  name="root">
            <action method="setTemplate">
                <template>3columns.phtml</template>
            </action>
        </reference>
    </cms_page_view>
</layout>

Or you can simply open the CMS Page from admin  side and under design section, you need to put this code. Please note, in this case, the layout of the selected CMS Page only changes.
<reference  name="root">
    <action method="setTemplate">
        <template>3columns.phtml</template>
    </action>
</reference>

A: I'm not sure, it feels like I'm understanding your question in another way than Rajeev.
Sure you can delete this. As you can see in \Mage_Page_Model_Config I can't find any to delete the pageLayouts later, so we have to avoid that they are added, this can only be done by editing the config.xml file of the Mage_Page module.
Ben explains why and a better(?) alternative!


text:
Q: Filtering objects by a search I am trying to filter a list of products by a search parameter that will check for products that have the property name and seller.store.name similar (LIKE in php) to the search parameter.
viewAll: async (req, res) => {
    const search = req.query.search || '';
    const user = User.find({ store.name: { $regex: search, $options: 'i' } });

    const filter = search ? {
        name: { $regex: search, $options: 'i' },
        seller: { user }
    } : {};

    const products = await Product.find({ ...filter })
        .populate('store', 'store.name store.img');

    res.send({ products });
},

I am running into two problems.

*

*I cannot compare the store.name property using the db.collection.find method. I am getting the error ',' expected.ts(1005). I have tried using both store.name and store['name'].

*I would like the filter to be similar to the LIKE keyword in PHP and not an exact match. I'm not sure what function or options I should be using.

These are my models:
product.js
const mongoose = require('mongoose');

const productSchema = mongoose.Schema({
    name: { type: String, required: true },
    description: { type: String, required: true },
    seller: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
    image: { type: String, required: true },
    price: { unitPrice: Number, unit: String, required: true },
    stock: {
        amtAvail: Number,
        amtSold: {
            type: Number,
            default: 0,
        },
        required: true
    },
    active: { type: Boolean, required: true, default: true }
}, {
    timestamps: true
});

const Product = mongoose.model('Product', productSchema);

module.exports = Product;

user.js
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
    name: { type: String, required: true, unique: true },
    email: { type: String, required: true, unique: true },
    password: { type: String, required: true },
    isSeller: { type: Boolean, default: false, required: true },
    store: {
        type: Object,
        name: { type: String, required: true, unique: true },
        description: { type: String, required: true },
        img: {
            profile: String,
            header: [String]
        },
        contact: {
            line: String,
            phone: Number,
            accountNumber: Number
        }
    },
    address: String,
}, {
    timestamps: true
});

const User = mongoose.model('User', userSchema);

module.exports = User;

Any help and ideas would be greatly appreciated!