text:
Q: Resolving "discrete value supplied to continuous scale" error when attempting to edit binary logistic regression plot using ggplot2 I am using a binary logistic regression model to investigate the causes of populism in Denmark using the below regression model:
Denmark <- glm(popvt ~ trstprl + trstplt + stfgov + stfdem + mnactic + agegroup + eisced,
               data = dktrim,
               family = binomial(link = "logit"))

Where popvt is a two-level factor, trstprl/trstplt/stfgov/stfdem a set of integers ranging from 0-10, and mnactic, agegroup and eisced are four-, four- and three-level factors respectively.
After successfully running the regression I used sjPlot's plot_model to obtain a plot model of odds ratios for each independent variable, as shown here:
Plot of Odds Ratios in explaining support for populist parties in Denmark through this code:
plot_DK <- plot_model(Denmark)

I would like to reduce the scale of the x-axis for odds ratios to between 0.1 and 5.
But when I attempt to do so with the following I get the error:

Scale for 'x' is already present. Adding another scale for 'x',
  which will replace the existing scale. Error: Discrete value supplied
  to continuous scale

plot_DK + xlim(0.1, 5)

I had the same error when I used:
plot_DK + scale_x_continuous(0.1, 5)

I know that ggplot2 and sjPlot are definitely compatible as I was able to recolour the plot despite being unable to change the x-axis.
How do I resolve this error?


text:
Q: how running a program elevated I have two computers, say A and B, both running Windows 10 , build 1709,and having :

*

*current User only in Local group "users"

*with Local Administrator Account : enabled

*UAC : Enabled

*Printer Sharing : Enabled

I have tried my best to kept both computers identical as much as I can.
I want to run a program on both machines locally (no remote execution) with administrator rights and elevated.
On Computer A
Programs are running with elevated privileges, NO UAC message.
On Computer B
It shows some kinds of errors and UAC messages, for which I tried,

*

*Running program with psexec
psexec.exe -i -u administrator -p "password" -accepteula path\program.exe

That exits out showing error :
ERROR : "this operation need an elevation"
(original message : "L'opération demandée nécessite une élévation.")

*Running program with Runas
runas /noprofile /user:administrator path\program.exe

That exits out showing error :
ERROR : "740 : this operation need an elevation"
(original message : "740 : L'opération demandée nécessite une élévation.")

*Using cmd.exe to launch program
psexec.exe -i -u administrator -p "password" -accepteula cmd.exe /C start "xxxx" path\program.exe

In this case, program is running as Administrator but privileges are still not elevated.

*Now In the Running program,

*

*I have to give it admin rights (elevated privileges) using compatibility tab.

*After which program finally runs with elevated privileges but I got an UAC message.

*So, I disabled UAC for Administrator account and Now, It runs with elevated privileges and no UAC message.

This problem is not specific to this program only, rather other applications ( such as  Bitdefender, Anti-Ransomware, Fraps, Paint-Shop pro 6 ) are also showing it.
And None of this happens on Computer A.
Also, psexec options like -h or -s has never worked for me, neither on computer A. It shows an error on starting service. So on computer B, I have to :

*

*Launch it with cmd.exe

*Use compatibility,

*Disable UAC for administrator

I don't want to use compatibility and want to maintain UAC enabled, What I need to do to make computer B act like computer A. Basically doesn't show these UAC errors ?
So what could be the exact root cause and the solution for it ?

A: Psexec and runas didn't work properly because of UAC settings.
I used secpol.msc to see what default settings have been altered and restore them.
UAC settings are in local strategies / security options.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Load Javascript only once per user / browser session I have this modal that pop up on page load...
<script type="text/javascript">

jQuery(document).ready(function($) {
  setTimeout(function() {
    $.UIkit.modal('#newsletter-20').show();
  }, 3000);
});

</script>

It all work's fine but I need it to appear only once per user / browser session...Since I'm a noob I have no idea how to acheive that even after looking into this information > http://www.w3schools.com/js/js_cookies.asp
Tks for the help!

A: Determining whether your user session is active requires server side code. So, using a cookie is most likely the easier solution for you.
JSFIDDLE DEMO
$(document).ready(function() {
  var cookieValue = $.cookie("user-session");

  if (!cookieValue || !cookieValue.length) {
    setTimeout(function() {
      $.UIkit.modal('#newsletter-20').show();
      $.cookie("user-session", "1");
    }, 3000);
  }
});

Note: For $.cookie to work, you have to use a jQuery cookie plugin. The cdn link is this - https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js
But this is optional, if you want a traditional javascript way of getting and setting a cookie, you can use it too. But the jquery cookie way is way simpler.

A: Have you looked into sessionStorage? Using sessionStorage, you can store a simple boolean flag locally per session, and then test for the existence of that flag before displaying your modal dialog.
The browser will clear the contents of sessionStorage when the browser is closed, which means the value is only persisted as long as the visitor is actively using their browser, or until you manually change the data back to a falsey value.
For example:
jQuery(document).ready(function($) {

    setTimeout(function() {

        if (!sessionStorage.previouslyVisited) {
            $.UIkit.modal('#newsletter-20').show();
            sessionStorage.previouslyVisited = true;
        }
    }

});


text:
Q: Change file when creating a repository from template - Gitlab I have a repository that I use as template, and it has some files that needs to be changed for each new repository. I have read the docs but couldn't find anything. How could I allow the user to update this variables when creating the repository, avoiding local changes?

A: According with the issue: https://gitlab.com/gitlab-org/gitlab/-/issues/26580 gitlab does not support parametrized projects.


text:
Q: Failure installing VTK from PyPI on x86_64 I know that VTK is now available as a wheel in PyPI (https://pypi.python.org/pypi/vtk/8.1.0) but I am not able to install it. Is there a way around this?
When I try this is what I get:
$ pip install vtk
Collecting vtk
  Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk

I have tried pointing to the wheel's URL but still the same problem.
$ pip install https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=49c8d620b2affe2dc2284048659115e5
vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.

Here is my platform information:
$ uname -a
Linux [hostname-withheld] 3.10.0-514.16.1.el7.x86_64 #1 SMP Fri Mar 10 13:12:32 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

A: So the problem has to do with the fact that the wheel files have the text 'manylinux1'.
First, find out which platforms pip checks for. You can do this using a handy feature in pip (found on https://github.com/tensorflow/tensorflow/issues/9722):
$ python -c 'from pip import pep425tags; print pep425tags.supported_tags'
[('cp27', 'cp27mu', 'linux_x86_64'), ('cp27', 'none', 'linux_x86_64'), ('py2', 'none', 'linux_x86_64'), ('cp27', 'none', 'any'), ('cp2', 'none', 'any'), ('cp26', 'none', 'any'), ('cp25', 'none', 'any'), ('cp24', 'none', 'any'), ('cp23', 'none', 'any'), ('cp22', 'none', 'any'), ('cp21', 'none', 'any'), ('cp20', 'none', 'any'), ('py27', 'none', 'any'), ('py2', 'none', 'any'), ('py26', 'none', 'any'), ('py25', 'none', 'any'), ('py24', 'none', 'any'), ('py23', 'none', 'any'), ('py22', 'none', 'any'), ('py21', 'none', 'any'), ('py20', 'none', 'any')]

The first result shows that we should swap the 'manylinux1' with simply 'linux':
$ wget https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=49c8d620b2affe2dc2284048659115e5
--2018-03-01 14:29:06--  https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Resolving pypi.python.org (pypi.python.org)... 151.101.16.223, 2a04:4e42:4::223
Connecting to pypi.python.org (pypi.python.org)|151.101.16.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48860459 (47M) [binary/octet-stream]
Saving to: 'vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl'

100%[====================================================================================================================================================================================================================>] 48,860,459  90.5MB/s   in 0.5s

2018-03-01 14:29:07 (90.5 MB/s) - 'vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl' saved [48860459/48860459]

Rename using a symbollic link:
$ ln -s vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl vtk-8.1.0-cp27-cp27mu-linux_x86_64.whl

Now install:
$ pip install vtk-8.1.0-cp27-cp27mu-linux_x86_64.whl

That should fix it!


text:
Q: If kotlin package has multiple main function, how can I call specific one? I want to test the main function for competitive programming.
Kotlin can have multiple main functions, however how to call specific one?
In other words, how to specify a function in the specific file?

A: It depends on compilation and execution tools:

*

*When you call "java -jar my-app.jar", JVM looks into the manifest file to find main class name.

*If you compile application with Gradle, you can define mainClassName as part of application plugin (which created executable jar).

*Maven tool has property for the main class too.

*IntelliJ Idea has independent settings, so you can specify multiple build configuration with different parameters. And you can put entry point there.


text:
Q: Equivalent of Splunk's lookup in Kusto Query Language I am trying to find the equivalent of Splunk Query Language's lookup command in Kusto Query Language.
Please help.

A: the 2 languages are not equal, so you won't always find an equivalent for each operator in one language in the other language.
that said, have a look at the docs for the Kusto lookup operator


text:
Q: How to display form in centre without scroll bar and blank area I am using this CSS to display Forms in center of the screen.
.Absolute-Center
{
    width: 40%;
    height: 50%;
    overflow: auto;
    margin: auto;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
}

Different forms have different number of elements. For example say Login Form have 4 elements, and Forgot password form have 2 elements and form-3 have 12 elements.
For me Login Form is display perfectly. PassWord Form showing some blank area in Bottom. and form-3 showing scroll bar to see bottom elements.
I don't want Blank area or scroll bar in any of the form.
What changes needed in this CSS Class to achieve that?

A: you need to remove the commented out lines:
.Absolute-Center {
    width: 40%;
    /* height: auto; */
    /* overflow: auto; */
    margin: auto;
    position: fixed;
    /* top: 0; */
    /* left: 0; */
    /* bottom: 0; */
    /* right: 0; */
}

Setting the height to 50% means that the height of the form will be fixed to 50% of the height of its container and setting overflow to auto means that if the form is to big to fit in that height, you'll get a scroll bar.  By removing these lines, you'll allow the browser to set the height of the form based on the content.  You'll also want to removed the top and bottom properties, as these stretch the div over the entire page.


text:
Q: OnClickListener is no longer functional. Somehow I seem to have butchered my onClickListener. For some reason all of a sudden when I click the goButton it simply does nothing. I've looked over the code quite a few times and cannot seem to spot what I have done wrong here. Any suggestions?
//This activity displays the start layout of the app
    public class StartActivity extends Activity implements OnClickListener {
        private AnimationDrawable mGoButtonAnimation;
        Button goButton;
        Context c;
        boolean isAirPlaneMode, isMDNPresent = false;// boolean values to check for
        // airplane mode and if the
        // sim populates the MDN
        int simState;
        TelephonyManager tm;
        boolean NetworkConnection = false;// boolean to check the Network
        // Availability
        AlertDialog mConfirmAlert = null;
        TextView text;
        TextView mUpdatetext;
        int version;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.start);
            Button goButton = (Button) findViewById(R.id.go_button);
            // Set GO button to drawable animation
            goButton.setBackgroundResource(R.drawable.go_button_animation);
            mGoButtonAnimation = (AnimationDrawable) goButton.getBackground();

            version = android.os.Build.VERSION.SDK_INT;
            tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
            // to read the SIM state
            simState = tm.getSimState();
            System.out.println("Sim State" + simState);
            if (tm.getLine1Number() == null) {
                showAlert("Insert an active  SIM.");
            }
            // to check for MDN
            else if (tm.getLine1Number().equalsIgnoreCase("")) {
                isMDNPresent = true;
            }

            String texts = "";
            CharSequence styledText = texts;

            goButton = (Button) findViewById(R.id.go_button);

            text = (TextView) findViewById(R.id.text);

            // text for go button
            texts = String.format(getString(R.string.start_text));

            styledText = Html.fromHtml(texts);

            text.setText(styledText);

            // to check for the network availability
            NetworkConnection = CheckNetworkAvailability
                    .CheckforNetworkAvailability(StartActivity.this);
            if (!NetworkConnection) {
                showAlert("Network is not available, Check for the Network Connections");
            }
            // to check for airplane mode
            isAirPlaneMode = isAirplaneModeOn(StartActivity.this);
            goButton.setOnClickListener(this);

        }

        public void onClick(View v) {
            if (v == goButton) {
                //

                if (simState == TelephonyManager.SIM_STATE_ABSENT) {
                    showAlert("Sim Card is absent, Please insert a   Sim Card");

                } else if (simState == TelephonyManager.SIM_STATE_UNKNOWN) {
                    showAlert("Sim Card is absent, Please insert a   Sim Card");
                } else if (isAirPlaneMode != false) {

                    showAlert("Please Insert a  Sim Card or Turn on the AirPlane Mode and Re-Run the app");

                } else if (simState == TelephonyManager.SIM_STATE_NETWORK_LOCKED
                        || simState == TelephonyManager.SIM_STATE_PIN_REQUIRED
                        || simState == TelephonyManager.SIM_STATE_PUK_REQUIRED
                        || simState == TelephonyManager.SIM_STATE_UNKNOWN) {

                    showAlert("Sim Card is absent, Please insert a  Sim Card");

                } else if (simState == TelephonyManager.SIM_STATE_READY) {
                    if (version < VERSION_CODES.ICE_CREAM_SANDWICH) {// Pre-ICS
                        if (isMDNPresent) {
                            // start SaveMDN activity
                            Intent i = new Intent(StartActivity.this, SaveMDN.class);
                            startActivity(i);
                            finish();
                        } else {
                            // start ActivityForPreICS activity
                            Intent i = new Intent(StartActivity.this,
                                    ActivityForPreICS.class);
                            startActivity(i);
                            finish();
                        }
                    } else {
                        // ICS and UP
                        if (isMDNPresent) {
                            // start SaveMDN activity
                            Intent i = new Intent(StartActivity.this, SaveMDN.class);
                            startActivity(i);
                            finish();
                        } else {
                            // start Update Activity
                            Intent i = new Intent(StartActivity.this,
                                    UpdateActivity.class);
                            startActivity(i);
                            finish();
                        }
                    }
                }

            }

        }

A: The culprit may be here.-
Button goButton = (Button) findViewById(R.id.go_button);

you're declaring a goButton locally inside onCreate method, and setting the listener to that variable. I'm guessing that onClick is actually being fired, but this condition.-
if (v == goButton)

may be failing. Update the first line.-
goButton = (Button) findViewById(R.id.go_button);

And remove an identical line you have below. Also, it'd be useful to debug step by step, to check if onClick isn't really called, or the problem is in the if condition indeed.


text:
Q: continuously deploy Angular2 app to Azure Web App using Release Management and angular-cli I am currently developing an Angular2 app and want to configure continuous integration and continuous deployment with azure release manager.
Things I got working so far: CI and CD to WebApp, home/site/wwwroot contains source files (no node_modules).
Things not working: App doesn't start. Browsing to url leads to the placeholder (e.g. 'Loading...'). On my local machine I would call 'npm install' and then 'npm start' wich in turn calls 'tsc && concurrently "tsc -w" "lite-server"'. From my understanding this is fine for a dev environment, but should not be used in production.
Things I have tried:

*

*adding 'npm install' to build step leads to extremely long build time bc of the download of the packages and long deployment time bc of the high number of packages

*adding 'npm install --production' shortens the build and deployment time, but running 'npm start' on the target machine fails because some missing packages (contained in DevDependencies)

*executing 'npm install' and 'npm start' on the target machine with console seems to work, but can't be automated

So the question(s) are:

*

*what is the proper way to build and deploy an Angular2 app on an Azure Web App?

*How to handle the node_modules?

Thank you in advance.
UPDATE: As i switched to angular-cli things are getting clearer now. On my dev machine i use "ng build" and "ng serve" to run locally. For deployment I use "ng build -prod" and deploy the contents of the created "dist" directory to production. Howewer, this is still a workaround as I can't get the build agent to  do these steps. I tried moving the angular-cli reference to "Dependencies" and then call "npm install" and "ng build -prod" on the agent to get the "dist" folder. My Deployment config would then copy the contents of the dist folder to the web app. Then "ng build -prod" step fails

'ng' is not recognized as an internal or external command

I sort of understand that I can't install and run any package on the build agent, but I would really like to use angular-cli to build the app since it includes webpack. Is there any possibility to get this working as described?

A: You can leverage Custom Deployment Script For Azure Web Apps using Git Deployment to achieve your requirement.
Specially for angular2, there are several modifications we should do in the package.json file to make the angular2 successfully being deployed to Azure Web Apps.

*

*Move all the dependencies modules in devDependeccies section to dependencies section.

*Use "postinstall": "typings install && tsc" instead of "postinstall": "typings install".

For question 2, you don't have to push the node_modules folder with your project. If you have it declared in your dependencies in your package.json then kudu will clone your project and run npm install –production to download the correct things.


text:
Q: Can anyone think of when a sub-request rewrite is useful? I found that one of the main things that cause .htaccess rewrite rulesets to do seemingly bizarre things is when Apache decides to try to apply them inside a subrequest.  This is to the extent that I now always use the [NS] flag on my rules or use a prefix rule
RewriteCond %{IS_SUBREQ}%{ENV:END} t|1             [NC]
RewriteRule ^                      -               [L]

(The %{ENV:END} bit just allows me to use E=END:1 to do the same as the V2.4 END flag.)
My Q is: can anyone give me of a good usecase where I wouldn't want to do this? (or alternatively where I would want to use the special -U or -F condition patterns).
I realise that there may be many that I haven't thought of, but the A tick goes to the first valid one.

A: I'd guess the typical situations where you'd want to apply rewrite rules to subrequests are more or less the same as the one where you'd use symlinks inside your document root.
For a plausible example, let's say you're using Server Side Includes, and have a bunch of files scattered around with suffixes like .html, .shtml and .htm, and perhaps some uppercase variants of these too.  At some point, you decide to standardize on the .html suffix, and rename all your files accordingly.  But you still have a bunch of legacy code and links that use the other suffixes, and rooting them all out will take a while.
In that case, you might want a rewrite rule like this:
RewriteRule ^(.*)\.s?html?$ $1.html [NC]

By applying this to subrequests too, you ensure that your Server Side Includes don't break because of the renaming.


text:
Q: Why I have this error in my trigger? MySQL I am creating a MySQL database, I want to create a trigger to change the amount of inventory available after a sale, but I get an error
This is the code of the trigger
DROP TRIGGER IF EXISTS tr_inventario;
CREATE TRIGGER tr_inventario AFTER INSERT ON factura FOR EACH ROW
    UPDATE producto INNER JOIN factura ON producto.IdProducto=factura.IdProducto
    SET producto.Invenatario=producto.Invenatario-factura.Cantidad
    WHERE producto.IdProducto=factura.IdProducto;

This is the INSERT that i want to do
INSERT INTO factura(FechaVenta, NombreCliente, IdProducto, IdEmpleado, Cantidad) VALUES (now(), 'María Guadalupe',3, 2, 2);

And this is the error that I get
Error Code: 1048. Column 'Invenatario' cannot be null

relational table

A: You don't need a JOIN:
DELIMITER $$

CREATE TRIGGER tr_inventario AFTER INSERT ON factura FOR EACH ROW
BEGIN
    UPDATE producto p
        SET p.Invenatario = p.Invenatario - new.Cantidad
    WHERE p.IdProducto = new.IdProducto;
END;


text:
Q: Creation of Batches from CSV resulting in erroneous state I'm trying to make batches from a CSV file written using CSVWriter of opencsv as:
CSVWriter writer = new CSVWriter(new FileWriter(filePath+createFileName), ',', CSVWriter.DEFAULT_QUOTE_CHARACTER);
And BufferedReader to read the written file. The Csv file is written and I think read operation also goes well. So, far its working good. But when I chose particular data to be written to Csv using the same operations, creation of batches comes under error out of it.
An Exception is coming stating "Failed to parse CSV. Found unescaped quote. A value with quote should be within a quote" which is making the Application to not behave in a manner expected.
After going through this error it seems there's some ""(double quote) or "(double quote) symbol present in the data. (I 've the data in form of "asdf","1.0","",,"def").
As far as my understanding I tried to apply Regex to find double quotes but couldn't find any, as after examining the file it doesn't contain the repeated double quotes. The link I followed is:Regular expression to find and replace unescaped Non-successive double quotes in CSV file
Thereafter in the code, I'm making use of: File tmpFile = File.createTempFile("bulkAPIInsert", ".csv"); to hold the data in a temporary file and then deleting it.
After replacing the above code with the following I somehow handled the coming exception but it futher lead to another one stating "Failed to parse CSV. EOF reached before closing an opened quote".
        File tmpFile = new File("bulkAPIInsert.csv");
I don't think the above workaround should be followed as it would be performance issues with the application.
By going through the CSVReader class I found a custom exception defined stating exactly the same Exception as I got. But I think it comes when a double quote is found within some double qoute (the cell value of CSV File). I referred the link as: https://github.com/mulesoft/salesforce-connector/blob/master/src/main/java/com/sforce/async/CSVReader.java
Can anybody suggest me where I'm doing wrong or any workaround for this Problem?
I'm sharing you the code snippet as:
Method1 then Method2 is called.
    Method1: private List<BatchInfo> createBatchesFromCSVFile(RestConnection connection,
            JobInfo jobInfo, String csvFileName) throws Exception {
        List<BatchInfo> batchInfos = new ArrayList<BatchInfo>();
        BufferedReader rdr = new BufferedReader(new InputStreamReader(
                new FileInputStream(csvFileName)));

        // read the CSV header row
        String hdr = rdr.readLine();
        byte[] headerBytes = (hdr + "\n").getBytes("UTF-8");
        int headerBytesLength = headerBytes.length;
//      I was making use of the following code which I replaced with the next line of code.
//      File tmpFile = File.createTempFile("bulkAPIInsert", ".csv");
        File tmpFile = new File("bulkAPIInsert.csv");
        // Split the CSV file into multiple batches
        try {
            FileOutputStream tmpOut = new FileOutputStream(tmpFile);
            int maxBytesPerBatch = 10000000; // 10 million bytes per batch
            int maxRowsPerBatch = 10000; // 10 thousand rows per batch
            int currentBytes = 0;
            int currentLines = 0;
            String nextLine;

            while ((nextLine = rdr.readLine()) != null) {
                byte[] bytes = (nextLine + "\n").getBytes("UTF-8"); //TODO
                if (currentBytes + bytes.length > maxBytesPerBatch
                        || currentLines > maxRowsPerBatch) {
                    createBatch(tmpOut, tmpFile, batchInfos, connection, jobInfo);
                    currentBytes = 0;
                    currentLines = 0;
                }
                if (currentBytes == 0) {
                    tmpOut = new FileOutputStream(tmpFile);
                    tmpOut.write(headerBytes);
                    currentBytes = headerBytesLength;
                    currentLines = 1;
                }
                tmpOut.write(bytes);
                currentBytes += bytes.length;
                currentLines++;
            }

            if (currentLines > 1) {
                createBatch(tmpOut, tmpFile, batchInfos, connection, jobInfo);
            }
        } finally {
            if(!tmpFile.delete())
                tmpFile.deleteOnExit();
            rdr.close();
        }
        return batchInfos;
    }

/**
     * Wait for a job to complete by polling the Bulk API.
     */
    Method2: private void awaitCompletion(RestConnection connection, JobInfo job,
            List<BatchInfo> batchInfoList) throws AsyncApiException {
        try{
            /****
            Some code
            **/
                BatchInfo[] statusList = connection.getBatchInfoList(job.getId())
                .getBatchInfo();
                for (BatchInfo b : statusList) {
                    if (b.getState() == BatchStateEnum.Completed) {
                        if (incomplete.remove(b.getId()))
                            //Do Something
                    }
                    else if(b.getState() == BatchStateEnum.Failed){

                        System.out.println("Reason: "+b.getStateMessage()+".\n  " +
                                "Number of Records Processed: "+b.getNumberRecordsProcessed());
                        throw (new Exception(""));
                    }
                }
            }
        }catch(Exception ex){log.debug(" Exception occurred.");}
    }

The getStateMessage() method of BatchInfo gives the discussed error messages.

A: Thanks "Hound Dog", helping me out.
Answer
The problem has been resolved by removing line-breaks for each cell.


text:
Q: Elastic Cloud vs Elastic Azure Marketplace Template I am developing an ASP.NET application that will be hosted on Azure, and that will be utilizing ElasticSearch (via NEST).  Looking at the deployment options for ElasticSearch, looks like I can use the Elastic Cloud to host my ElasticSearch engine (as an ElasticSearch service) and have my ASP.NET app communicate with it (not sure all the details at the moment).
Then I noticed there is an Elastic Azure Marketplace Template as well.  Does this use the ElasticSearch service in the Elastic Cloud behind the scenes, or is this really an engine hosted on Azure?  If the latter, I assume since everything is co-located on Azure, performance would be better.
Would like to know the differences between the two options, and the pros/cons for using one over the other knowing that I'll be hosting the ASP.NET application on Azure.

A: The marketplace solution is just a "bunch" of VMs. So its essentially a shortcut to deploy elastic search on your own vms. whereas Elastic Cloud is a SaaS service, you dont have to manage it. you just use it.
reading: https://www.bmc.com/blogs/saas-vs-paas-vs-iaas-whats-the-difference-and-how-to-choose/


text:
Q: SQL Server 2008 filters query using checkbox I have 5 CheckBox and i want to filter data in gridview using checkbox by Star Rating,
I want that if user checked CheckBox1 then it show data of Star Raing 1 and user select CheckBox1 and CheckBox2 then it show data of Star Rating 1 and 2 also. I dont want to bind GridView Data using C# Code.
<asp:CheckBox ID="CheckBox5" Text="5" runat="server" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox4" Text="4" runat="server" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox3" Text="3" runat="server" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox2" Text="2" runat="server" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox1" Text="1" runat="server" AutoPostBack="true" />

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource4" ShowHeader="False" AllowPaging="True"
AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<Columns>
    <asp:TemplateField>
        <ItemTemplate>
            <telerik:RadRating ID="RadRating1" Runat="server" DbValue='<%# Bind("star_rating") %>'>
            </telerik:RadRating>
        </ItemTemplate>
    </asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#7C6F57" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#E3EAEB" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F8FAFA" />
<SortedAscendingHeaderStyle BackColor="#246B61" />
<SortedDescendingCellStyle BackColor="#D4DFE1" />
<SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:travelconn %>"
SelectCommand="SELECT * FROM Table_P tp inner join Table_D td ON tp.id= td.id where
td.star_rating in (@star1,@star2,@star3,@star4,@star5)">
<SelectParameters>
<asp:ControlParameter ControlID="CheckBox1" Name="star1" PropertyName="Checked" />
<asp:ControlParameter ControlID="CheckBox2" Name="star2" PropertyName="Checked" />
<asp:ControlParameter ControlID="CheckBox3" Name="star3" PropertyName="Checked" />
<asp:ControlParameter ControlID="CheckBox4" Name="star4" PropertyName="Checked" />
<asp:ControlParameter ControlID="CheckBox5" Name="star5" PropertyName="Checked" />
</SelectParameters>
</asp:SqlDataSource>

I am using ASP.Net C# SQL Server 2008

A: You will need to create a split function inside you database,
Definition Of Split Function
CREATE FUNCTION [dbo].[split]
    (
      @delimited NVARCHAR(MAX),
      @delimiter NVARCHAR(100)
    )
 RETURNS @t TABLE (id INT IDENTITY(1,1), val NVARCHAR(MAX))
AS
BEGIN
  DECLARE @xml XML
  SET @xml = N'<t>' + REPLACE(@delimited,@delimiter,'</t><t>') + '</t>'

  INSERT INTO @t(val)
  SELECT  r.value('.','varchar(MAX)') as item
  FROM  @xml.nodes('/t') as records(r)
  RETURN
END

Stored Procedure
Then you need to create a stored procedure which will build sql query dynamically and use this split function to handle multiple comma deliminated list values from your drop down lists.
CREATE PROCEDURE GetData
    @DropDown1  VARCHAR(1000) = NULL,
    @DropDown2  VARCHAR(1000) = NULL,
    @DropDown3  VARCHAR(1000) = NULL
AS
BEGIN
 SET NOCOUNT ON;

 DECLARE @SQL NVARCHAR(MAX);

 SET @SQL = N' SELECT * FROM TableName WHERE 1 = 2 '
            + CASE WHEN @DropDown1 IS NOT NULL
                THEN N' OR ColumnName1 IN (SELECT Val FROM dbo.split(@DropDown1 )) '
                    ELSE N'' END
            + CASE WHEN @DropDown2 IS NOT NULL
                THEN N' OR ColumnName2 IN (SELECT Val FROM dbo.split(@DropDown2)) '
                    ELSE N'' END
            + CASE WHEN @DropDown3 IS NOT NULL
                THEN N' OR ColumnName3 IN (SELECT Val FROM dbo.split(@DropDown3)) '
                    ELSE N'' END

  EXECUTE sp_executesql @SQL
                       ,N'@DropDown1 VARCHAR(1000), @DropDown2 VARCHAR(1000), @DropDown3 VARCHAR(1000)'
                       ,@DropDown1
                       ,@DropDown2
                       ,@DropDown3
END

A: I would put this in a stored procedure and @star1,2, etc would be bit(1/0) variables..
SELECT * FROM Table_P tp inner join Table_D td ON tp.id= td.id where
(
 (td.star_rating =1 and @star1 = 1)
or
 (td.star_rating =2 and @star2 = 1)
or
 (td.star_rating =3 and @star3 = 1)
or
 (td.star_rating =4 and @star4 = 1)
or
 (td.star_rating =5 and @star5 = 1)
)


text:
Q: Protecting API for use from specific apps only Looking for a way to see how I can make sure that requests that originate from my mobile apps are only served by my server API.
This is to enable guest users to get to see the app but not get data exposed out for use by BOTs.
Is there an Android or iOS app property that helps with creating requests that help with this?

A:
Looking for a way to see how I can make sure that requests that originate from my mobile apps are only served by my server API.

As it is phrased now I read it more like that you want to ensure that you mobile app only sends and receives requests from your API server, not from an attackers API server pretending to be yours, or from an MitM attack. If this is the case then the solution is to add certificate pinning to your mobile app, but this should be always added to any mobile app.
I think what you mean here is that you want to ensure that your API server only replies to requests coming from a genuine instance of your mobile app. If this is the case then you are looking to lock down your API server to your mobile app and you have here a great challenge and several approaches to take.
Certificate Pinning
To implement certificate pinning in your mobile app I recommend you to read the article Securing HTTPS with Certificate Pinning:

In order to demonstrate how to use certificate pinning for protecting the https traffic between your mobile app and your API server, we will use the same Currency Converter Demo mobile app that I used in the previous article.
In this article we will learn what certificate pinning is, when to use it, how to implement it in an Android app, and how it can prevent a MitM attack.

So the article will guide you through an actual implementation of certificate pinning in an example app that you can find in this repo.
Lockdown the API server to the Mobile APP
I recommend you to read this answer I gave to the question How to secure an API REST for mobile app?, especially the sections Securing the API Server and A Possible Better Solution.
Encrypted Key Generation in the Mobile Aapp
I saw this in one of your comments to another answer(you should also add it to your question):

I am looking at a secure way of creating an encrypted key in the app that can only be decrypted on the server.

You can indeed create one securely with the help of the Android Security Library:

The Security library provides an implementation of the security best practices related to reading and writing data at rest, as well as key creation and verification.

I go in more detail about in this answer for the question Store Client Certificate and key (.pem) in Android securely, that contains some code samples.
Do You Want To Go The Extra Mile?
In any response to a security question I always like to reference the excellent work from the OWASP foundation.
For APIS
OWASP API Security Top 10

The OWASP API Security Project seeks to provide value to software developers and security assessors by underscoring the potential risks in insecure APIs, and illustrating how these risks may be mitigated. In order to facilitate this goal, the OWASP API Security Project will create and maintain a Top 10 API Security Risks document, as well as a documentation portal for best practices when creating or assessing APIs.

For Mobile Apps
OWASP Mobile Security Project - Top 10 risks

The OWASP Mobile Security Project is a centralized resource intended to give developers and security teams the resources they need to build and maintain secure mobile applications. Through the project, our goal is to classify mobile security risks and provide developmental controls to reduce their impact or likelihood of exploitation.

OWASP - Mobile Security Testing Guide:

The Mobile Security Testing Guide (MSTG) is a comprehensive manual for mobile app security development, testing and reverse engineering.

A: You can pass the package name (Android)/Bundle identifier(iOS app) of the application in req. params to validate the request from your app only.
In this way you can check the bundle identifier/package name on your server and based on that you can restrict the user to allow/disallow api usage.
Another way is the user of api key/token.
you can create the unique token/key on your server and given to the mobile app developer and ask then to send that in every api request.
So when you get the request on server you can validate that api key/token on server. If key/token is not valid then disallow the user to access your api.


text:
Q: AD and Exchange Migration - 2003 to 2008 R2 I am working on a project where we need to migrate a 2003 AD domain to a 2008 R2, they also have exchange 2003 in place, and all users account would need to be migrated to exchange 2010.
So, what I know, is that we are going to create a trust between 2003 domain and 2008 R2 domain, after the trust has established I am planning to run the ADMT 3.2 so that I can migrate all users,groups etc, but how about exchange???? I know that I can dump the mailboxes to a pst file and then do the import... but what happened with the user mailbox after the migration??? it will still point to exchange 2003? if so, i will need to brake that in order to create the mail on exchange 2010, or not??? How can I a accomplish this task???
We only have 150 users, and the exchange DB is around 40GB, also any advise on the AD migration would be really appreciated.
Thanks!

A: You have to do a cross-forest migration of Exchange after doing ADMT. Or use a 3rd-party tool to do the same thing. Or export to PST and import on the new server.
ADMT doesn't do Exchange, and in fact specifically strips out the MSExch attributes on groups and users, so you have to re-apply email addresses on DLs, and then mail-enable them, etc.


text:
Q: React and ReactDOM undefined but installed I'm just trying to make a simple react app with a .tsx transpiler, but the react and react-dom are undefined upon import:
This is my entry file and only typescript file:
index.tsx
import React from 'react';
import ReactDOM from 'react-dom';

console.log(ReactDOM);

ReactDOM.render(
SUCCESS!
, document.getElementById('root'));

Console output errors:
undefined
Uncaught TypeError: Cannot read property 'render' of undefined

The ReactDOM object is output as 'undefined' so the render() fails on undefined object. Installed the React and ReactDOM modules the normal way with 'npm install --save-dev react react-dom' and that verified both react folder exist under node_modules.
webpack.config.js
var path = require('path');
var webpack = require('webpack');

module.exports = {
  entry: './src/js/index.tsx',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
    publicPath: '/dist'
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js', '.jsx']
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader'
        ]
      },
      {
        test: /\.tsx?$/,
        loader: 'ts-loader',
        exclude: /node_modules/
      }
    ]
  },
  plugins: [

  ]
};

package.json
{
  "name": "helloworld",
  "version": "1.0.0",
  "description": "Hello there",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack-dev-server",
    "build:prod": "webpack -p"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "awesome-typescript-loader": "^3.2.3",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-env": "^1.6.0",
    "babel-preset-react": "^6.24.1",
    "css-loader": "^0.28.7",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "style-loader": "^0.19.0",
    "ts-loader": "^2.3.7",
    "typescript": "^2.5.3",
    "webpack": "^3.7.1",
    "webpack-dev-server": "^2.9.1"
  }
}

A: The proper syntax for importing all the exports of a module in TypeScript into a single name is:
import * as React from 'react';
import * as ReactDOM from 'react-dom';

(Notice the * as part)
The syntax you're using will instead import the default export, which React does not provide AFAIK. (Hence undefined.)
The situation is a bit confusing because IIRC babel will expose the whole module.exports object as the default export if no default export is provided, but TypeScript will not.
PS: Also make sure you install @types/react and @types/react-dom as dependencies via npm so you get full autocompletion and type checking.

Edit (2018-04-04): As of TypeScript 2.7, the answer above is no longer entirely accurate.
The new --esModuleInterop compiler option provides import semantics more closely aligned with Babel and with the ES6 modules spec.
With the option enabled CommonJS module.exports will be mapped to ES6 default export ... by the TypeScript compiler, so import foo from 'bar' should now work without any issues just like on Babel.
Keep in mind that --esModuleInterop is currently disabled by default to allow for a smoother transition, but the TypeScript docs recommend enabling it for both new and existing projects.
(You can enable it via the command line or via a tsconfig.json file)
Note: The import * as foo from 'bar' syntax is still valid, but it's now only used in the cases where you want to group all non-default exports under a single identifier. (Not as common)
For more info on the change and the problems it addresses, see the Relevant section of the Release Notes for TypeScript 2.7

A: Faced the same issue. In my case, this happens due to upgrading only react without React dom.

For example - React: 17.x and React-DOM: 16.x

Try below command which helped to resolve this issue.
npm update react react-dom --depth 4


text:
Q: Как Исправить функцию click добрий день
надо написать предупреждения про переход на другую страницу на мобильной версии при клике
есть функция на jquery при клик
if('html').css({maxWidth: '800px'})

$( "#carouselExampleIndicator" ).click(function() {
    alert('you definitely want to go to another page'
)
    })
не могу понять где ошибка зарание спс

A: Если Вам надо, чтобы алерт выскакивал только при разрешении экрана до 800px, то это можно сделать так:

let link = document.getElementById('link');

link.onclick = function() {
   if(window.matchMedia('(max-width: 800px)').matches) {
     alert('Точно перейти?');
   }
}
Ссылка

А если Вам надо, чтобы в принципе ссылка была видна только на экранах до 800px, то можно использовать медиа-запрос:

let link = document.getElementById('link');

link.onclick = function() {
     alert('Точно перейти?');
}
#link {
  display: none;
}
@media screen and (max-width: 800px) {
  #link {
    display: inline;
  }
}
Ссылка

A: Вот пример обычного перехода по ссылке, где пользователь, прежде должен подтвердить действие. Вам просто нужно добавить условие внутри события клик на проверку мобильного устройства.

$(document).on('click', 'a', function(e) {
  e.preventDefault();
  if (confirm('You definitely want to go to another page?')) {
    location.href = $(this).attr('href');
  }
});

Уйти со Stackoverflow навсегда в поиск


text:
Q: use javascript to change
* style I have defined styles for

#mainNav{clear:both;background-image: url(../images/bg_menu.jpg);width:975px;height:43px;color:#fff;margin-top:-25px;}
#mainNav ul{list-style: none;padding: 0;margin: 0;}
#mainNav ul li{line-height:43px;float:left;background-image: url(../images/bg_menu.jpg);font-size:15px;font-weight:normal;text-align:center;cursor:default;padding:0px 15px;}
#mainNav ul li:hover{background:#332a03;color:#f7df84;}

Home

Training and Workshops

Community Consultations

Community Surveys

Program and Facility Assesments

Reports

I now want to go back and change the padding for the
 to '0px 14px' because for some reason it doesn't render right only on Firefox on Mac. So I have this script so far...
var browser = "other";
var OpSys = "other";
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
    browser = "Firefox";
}
if (navigator.userAgent.indexOf('Win') != -1) {
    OpSys = "Macintosh";
}
// if its a Mac and Firefox, then change the padding
if (OpSys == "Macintosh" && browser == "Firefox") {
    // how do I change the padding for each
 ?
}

A: Using jQuery:
jQuery("div#mainNav li").each(function() {
   var $li = jQuery(this);
   $li.css("padding", "0px 14px 0px 0px");
});

Without jQuery:
var liArr = document.getElementsByTagName("LI");

for(var i = 0; i < liArr.length; i++) {
    var parent = liArr[i].parentNode;
    var grandParent = parent.parentNode;

    if(grandParent != null && grandParent.id == "mainNav") {
       liArr[i].style.padding = "0px 14px 0px 0px";
    }
}


text:
Q: How do medium to large development teams constantly push changes to a DVCS? The company I work for is attempting to get off of StarTeam, a centralized VCS, and hopefully into something better. I don't want to just pick SVN because it's the "easy option" (most similar to what we do today). Can someone help me understand how a medium to large team of developers changing roughly 150 files per day can operate on a DVCS like Git or Mercurial?
We have:

*

*50 developers working on a single repository that has

*15 years of history

*15,000 files (mostly code/text)

*Approximately 150 single file check-ins a day

*Need to pull changes from central every day due to our unique language's requirements and data structure

After days of research and experimenting, I understand the processes and workflows of both Git and Hg. What I don't understand is how large teams that need to make changes, often to single files, very quickly can operate with the restraints of the systems?
For example: I might be working on 3 different things and a developer comes up to me presenting a small issue. I do a little research, make the necessary 1 line change, and check in the file. From what I can tell, with git I would need to commit the change, stash all my other changes, pull, push, apply stash, deal with any merges applying my stash over recently pulled code might present. Is there a better way?
I've read the article about Facebook switching from Git to Mercurial. How do they manage thousands of check-ins a day on a 40,000 file repository? I can't fathom how that would work with the pull/push model of a DVCS. There must be something I'm missing about the workflow or functionality of these systems. Maybe they don't need to pull/re-base every day?
Any help is appreciated.

A: I hope, it will be closed quickly as flame-war source, but...

I don't want to just pick SVN because it's the "easy option"

Excuse me, do you want to work productively or to suffer? Due to your last (not very clear) requirement real CVCS with rather good branching|merging may be better choice (see What does SVN do better than Git? f.e.) than any DVCS in pseudo-CVCS mode

After days of research and experimenting, I understand the processes and workflows of both Git and Hg.

Rather rough and shallow understanding, BTW. Even in Git you have

*

*"Branches" (while hit-branches aren't branches per se for other DVCSes)

*Mutable history

*DAG

For example: I might be working on 3 different things

VCS-agnostic way in common (with Mercurial in mind, git-boys may want to adopt it to Git)
You created 3 branches ("Task-based development", "Branch per task" strategy) with some (any) amount of commits in each

and a developer comes up to me presenting a small issue

*

*commit your current Working dir "as is"

*return to the point of divergence of your local history (last shared changeset?)

*"do a little research, make the necessary 1 line change, and check in the file"

*developer pull part of (your) repository with your last chanseset on top

*you can return back to the breakpoint and continue to work

A:
I've read the article about Facebook switching from Git to Mercurial. How do they manage thousands of check-ins a day on a 40,000 file repository? I can't fathom how that would work with the pull/push model of a DVCS. There must be something I'm missing about the workflow or functionality of these systems. Maybe they don't need to pull/re-base every day?

First of all, Facebook doesn't use Mercurial in a purely DVCS fashion. They use the remotefilelog extension (which they wrote themselves) to only pull changesets on demand (this works because of how Mercurial stores history so that history accesses can mostly be localized). They also use MySQL and memcached for their backend servers to improve scalability.
For the rebase/merge bottleneck (when dozens of developers need to integrate their work in the main branch simultaneously), they have a work in progress feature to have this done mostly server-side; I note that this bottleneck is in part the result of (1) using a monorepo and (2) using trunk-based development, a problem that not every large organization will have.

For example: I might be working on 3 different things and a developer comes up to me presenting a small issue. I do a little research, make the necessary 1 line change, and check in the file. From what I can tell, with git I would need to commit the change, stash all my other changes, pull, push, apply stash, deal with any merges applying my stash over recently pulled code might present. Is there a better way?

You can use the new Git worktree feature (or, for Mercurial, hg share) to have multiple checkouts of the same repository and work on them independently. Bazaar and Fossil have always been able to do that natively; Fossil also has the autosync feature to operate in an SVN-like fashion (with caveats) and Bazaar has always been able to work in a quasi-centralized fashion with commits going directly to the server. In particular, having "only a single checkout per repository" is largely a historical Git artifact and not representative of DVCS systems (and, as I noted, gone as of the more recent Git versions).
That said, you generally have to commit -> pull -> merge or rebase -> push for changes to the main branch; this is a tradeoff. The distributed model allows you have to have easy local versioning so that work in progress doesn't go straight to the main repository before it is ready. It also generally assumes that most of your work will happen on a personal branch so that 90% of the time it's really just commits (with the occasional push).
Note that you won't have more or less conflicts than in a centralized VCS; they may just appear at different points.

All that said, if you're happy with your current VCS and you can't identify unambiguous benefits from switching, it's probably not worth changing your VCS. Switching VCSs incurs a measurable cost (rebuilding your repo, retraining your developers, adjusting workflows, adjusting the surrounding tooling, unexpected transition issues) and these costs need to be offset by equally measurable benefits to make them worthwhile.

A:
I might be working on 3 different things and a developer comes up to me presenting a small issue. I do a little research, make the necessary 1 line change, and check in the file. From what I can tell, with git I would need to commit the change, stash all my other changes, pull, push, apply stash, deal with any merges applying my stash over recently pulled code might present. Is there a better way?

Yes: since Git 2.5, you can clone your repo once, but checkout multiple times.
If you create a new branch, you can create it in a separate working tree folder, leaving your current environment undisturbed.
See "Multiple working directories with Git?".


text:
Q: Adding a custom symbol next to y-axis label Is there any way to add a custom symbol alongside a y-axis label in ggplot? I would like to add a small circle next to each racer's name indicating their respective line color a la image below (also recognize Maria's blue is more purple, but that's MS Paint for you).

library(ggplot2)
library(scales)
dat <- data.frame(name = c(rep("bill", 3), rep("maria", 3), rep("claudio", 3)),
                  lap = rep(0:2, 3),
                  pos = c(1, 1, 2,
                          2, 3, 1,
                          3, 2, 3))

dat %>%
  ggplot(aes(x = lap, y = pos, color = name)) +
  geom_line() +
  scale_y_reverse(breaks = 1:3,
                  labels = function(x) {
                    dat$name[dat$lap == 0][order(dat$pos[dat$lap == 0])][x]
                    },
                  sec.axis = sec_axis(function(x) x,
                                      breaks = 1:3, labels = label_ordinal())) +
  scale_x_continuous(breaks = pretty_breaks(3)) +
  theme(legend.position = "none")

A: This is not an answer to your question but an alternative solving a similar problem. Instead of trying to fiddle around with symbols, you could use the ggtext() package to colour the text itself the same as your lines.
You'd need 3 things:

*

*Colour the text in html syntax

*Provide the coloured text as the labels argument

*Set the theme element to interpret the text as markdown

library(ggplot2)
library(scales)
library(ggtext)
#> Warning: package 'ggtext' was built under R version 4.0.3

dat <- data.frame(name = c(rep("bill", 3), rep("maria", 3), rep("claudio", 3)),
                  lap = rep(0:2, 3),
                  pos = c(1, 1, 2,
                          2, 3, 1,
                          3, 2, 3))

colors <- hue_pal()(3)[c(1,3,2)]
labels <- glue::glue("{unique(dat$name)}")

ggplot(dat, aes(x = lap, y = pos, color = name)) +
  geom_line() +
  scale_y_reverse(breaks = 1:3,
                  labels = labels,
                  sec.axis = sec_axis(function(x) x,
                                      breaks = 1:3, labels = label_ordinal())) +
  scale_x_continuous(breaks = pretty_breaks(3)) +
  theme(legend.position = "none",
        axis.text.y.left = element_markdown())

Created on 2021-01-03 by the reprex package (v0.3.0)
EDIT: If you insist on the circle, you can take the same approach to colour a unicode circle character. Use the code below instead of the previous labels.
labels <- glue::glue("{unique(dat$name)} \u25CF")


text:
Q: How to use the HTML  tag together with OpenLayers 3 raster layers? In order to include interaction to my OpenLayers 3 raster layer, I would like to use something similar to the HTML <area> tag (http://www.w3schools.com/tags/tag_area.asp). The aim is to click on certain regions on a raster layer (without projection) to trigger an event.
I haven't found anything on the web and would like to hear your experiences, comments etc.
One idea so far is to use an <img> with a transparent gif image (1x1 px) and then extended over the map extent.
<img src="/img/transparent.gif" width="1024" height="1024" usemap="#mapImg">
<map id="mapImg">
    <area id='area1' shape='poly' coords='...'>
    <area id='area2' shape='poly' coords='...'>
    <area id='area3' shape='poly' coords='...'>
</map>

A: Create an invisible JSON layer that you put on top of the raster layer. Then use the OL3 map click event to get the coordinate of the click and thus the corresponding clicked area.
Note that you dont need a projection with real world coordinates. You can simply pretend your raster layer has WGS84 coordinates and then draw geojson layers on it.
see fiddle http://jsfiddle.net/n66nxdbo/3/ for a Leaflet example.


text:
Q: Is there a way to prevent wild Pokémon from running away in battle? I recently failed to catch a shiny Pokémon after it ran away from a battle. I know previous Pokémon games have had moves that prevent wild Pokémon from running away, but I don't know if they exist in Legends.
Does Pokémon Legends Arceus have a way to prevent wild Pokémon from running away from a battle?

A: Apparently, NO.
Old games used to have moves like Mean Look, Block and Spiderweb which prevented the target from switching out or fleeing.
Similar moves were Clamp, Sand Tomb, Fire Spin, Whirlpool and Wrap that inflected damage while preventing switching and escape.
And none of these are present in Pokemon Legends: Arceus, so I really doubt this is possible.
I searched for the whole attack list with no avail.

A: As said here, you can stun them to slow them down (or another stealth approach), but I don't think there is a way to completely guarantee them from running away.


text:
Q: why does console.table not display the last entry i am missing something exceedingly obvious, but it appears on my chrome browser Version 103.0.5060.134 (Official Build) (64-bit) the final entry is missing:
const objectTest = { 'one' : 'this is object one' , 'two' : 'this is object two' , 'three' : 'this is object three' } ;
console.table (objectTest) ;     // appears to skip the final entry
console.log(objectTest.three) ;  // final entry is available

what must i do to get console.table to display the last entry?
i would like to start using console.table in addition to JSON.stringify but only if i can get it working properly.
What's even more peculiar to me is that firefox seems to work correctly.
EDIT:  its working fine on chrome 100-102 and chrome 104-105.  its just appears to be not working properly on chrome 103.  i tried this out on browserstack.
but again, i am assuming that i am doing something incorrect.

A: I can reproduce in Chrome 103.0.5060.134:

However, as you can see, the last entry is not really missing, it's just hidden beneath that unnecessary horizontal scrollbar. If you select the text in the table, you can still copy it and also spot the selection:

The bug has already been reported at least five times:

*

*Issue 1339628: console.table is missing last element in array

*Issue 1340625: console.table horizontal scrollbar obscures last row

*Issue 1344504: console.table does not show all properties

*Issue 1346599: unnecessary scroll bars in console.table obscure content

*Issue 1347572: console.table() displays a horizontal scrollbar overlaying the last table row.

This has been fixed and the fix will roll out soon into Stable channel.


text:
Q: How would one access the events data from a web calendar for use in displaying in a mobile app? I've got a calendar that has iCalendar standard integration, but I'm not sure how to really get the data from the iCal link and bring it over to the iOS app I'm developing. I'm using JTAppleCalendar, and I've watched his video on how to stream data from a server, but I'm still not quite sure how to get the iCal event data into a form/place that is able to be utilized by the app.
I've already searched around and watched videos but I was unable to find an answer. I've also tried importing the calendar to google calendar for use through that API, but I'm unable to get that working either.
I want to be able to have the calendar remain public and for the user to be able to see the events without having to sign in to anything (like google for example) or have to add the iCal on their own for it to work.
This may be a simple question, but I'm still in the very early stages of learning iOS dev, so sorry about that.


text:
Q: How to change the text's position in a JTextArea Normally, in a JTextArea, the text starts in the upper left corner. I want it to be in the lower left corner. How can you do this?

(apologies if my handwriting is unreadable)

A: You could anchor a JTextArea to the BorderLayout.PAGE_END location of a container and allow the text to scroll up.

public class BaseTextAreaDemo {

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
                }

                final JFrame frame = new JFrame("Base JTextArea App");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setLayout(new BorderLayout());
                JPanel textAreaPanel = getBaseTextArea();
                JScrollPane scrollPane = new JScrollPane(textAreaPanel)  {
                    @Override
                    public Dimension getPreferredSize() {
                        return new Dimension(300, 230);
                    }
                };

                frame.add(scrollPane);
                frame.pack();
                frame.setLocationByPlatform(true);
                frame.setVisible(true);
            }

            private JPanel getBaseTextArea() {
                JTextArea textArea = new JTextArea();
                textArea.setLineWrap(true);
                textArea.setWrapStyleWord(true);
                textArea.append("bla bla bla\n");
                textArea.append("new text here");
                JPanel panel = new JPanel(new BorderLayout());
                panel.setBackground(textArea.getBackground());
                panel.setBorder(textArea.getBorder());
                textArea.setBorder(null);
                panel.add(textArea, BorderLayout.PAGE_END);

                return panel;
            }
        });
    }
}


text:
Q: Obtener datos de una tabla dínamica en php usando javascript Tengo el siguiente código, debo traerme los datos de la fila actual usando javascript o jquery, intenté con ambos pero no funcionan bien, no traen el dato o lo traen en blanco. La idea es poner los datos en un modal poco despúes, pero no logró pasar de la prueba de obtener los datos
Este es el código que se trae los datos:
<?php
session_start();
if (!isset($_SESSION['id_user'])) {
  echo "";

}else{
require("../../php/connection.php");
$conn = DBManager::con();

$query ="SELECT * FROM `servicios`, `estado_varios`, `categoria_servicio`
WHERE servicios.estado = estado_varios.id_estado
AND servicios.id_categoria = categoria_servicio.id_categoria_serv";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC); //Agarra los datos de la fila
?>

Aquí se genera la tabla en sí

    ID
        Nombre del servicio
        Categoria del servicio
        Estado
    Acción

    <?php
    while($row = mysqli_fetch_array($result)){   //Creates a loop to loop through results
        echo "
". $row['id_servicio'] ."	" . $row['nombre_servicio'] . "	" . $row['categoria'] . "	" . $row['nombre_estado'] ."	";
        echo "<button onclick='llamar_datos()' class='btn btn-primary' id='modificar' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>
";
    }
    ?>

La idea es que al presionar el boton llamado modificar, este llame a un código javascript que se agarra los datos de la fila en donde este
Esto es lo que intenté
function llamar_datos(){
  var id = $(this).closest('tr').find('#nombre_servicio').text();
  alert(id);
}

Así es como luce la tabla

A: Cuando declaras que onclick gatilla un cierto handler, a menos que le pases un argumento éste no tiene cómo saber a cuál fila te refieres. Mira por ejemplo la diferencia entre invocar al handler pasándole el elemento mismo vs nada.

function ejecutar_sin_argumento() {
  alert(this.id)
}

function ejecutar_con_argumento(element) {
  alert(element.id)
}
<button onclick="ejecutar_sin_argumento()" id="el_boton">Pínchame y te dijo mi Id</button>

<button onclick="ejecutar_con_argumento(this)" id="el_boton2">Yo sí te digo mi Id</button>

Lo que una función entiende por  this es abstracto en este punto. Cuando usas el clásico
jQuery('#elemento').on('click',function() {
   // como function tiene scope propio,
   // `this`  es el elemento
})

El scope es distinto a cuando usas
jQuery('#elemento').on('click',() => {
   // no tiene scope propio, así que
   // `this`  apunta al scope superior
})

En tu caso, no tiene caso esperar que el scope se transfiera mágicamente.
Y cómo hace jQuery para adivinar el this?
Pensemos en un listener declarado como
   jQuery(...).on('click', function() {
          alert(this.id);
   });

La función ahí parece no tener parámetros, pero en javascript (así como en PHP y otros lenguajes) nada impide llamarla con argumentos extra y cuando son funciones clásicas (no arrow) puedes acceder a los argumentos  recibidos, en el objeto arguments.
jQuery se vale de eso para identificar qué evento invocó el handler, y si sabe el evento entonces también sabe el elemento, pues viene en la propiedad target del evento. Es como si hiciera:
const EventHandler = function() {
let evento = arguments[0];
alert(evento.target.id);
}
Veamos la comparación entre el handler con "función clásica" que adivina cosas misteriosamente, vs un intento de hacer lo mismo en una arrow function, vs la manera correcta para no perder de vista qué es lo que viaja de un handler a otro...

$('#el_boton_A').on('click', function() {
  alert('Puedo inferir el ID porque tengo scope propio. ID=' + this.id);
});
$('#el_boton_B').on('click', () => {
  alert(window === this ? 'No tengo scope. `this` es igual a `window`' : this.id);
});
$('#el_boton_C').on('click', (event) => {

  alert('no tengo scope pero recibí el evento. ID= ' + event.target.id);
});
button {
  padding: 5px;
  background: white;
  border-radius: 3px;
  border: 1px solid #369;
  width: 250px;
  display: block;
  margin: 0.5em;
  font-weight: bold;
}

<button style="color:#036" id="el_boton_A">`function()`  clásica, infiere el ID</button>

<button style="color:#900" id="el_boton_B">Arrow, no tiene scope propio ni `this` </button>

<button style="color:#373" id="el_boton_C">Esta arrow recibe el evento explícito</button>

Entonces, volviendo a tu tabla dinámica
si vas a usar onclick, preocúpate de pasarle algún argumento. Si vas a declarar un listener sobre las filas, utiliza el argumento que te llegará aunque no lo hayas pedido. Ese argumento contiene al target que recibió el click.

function llamar_datos1() {
  var id = $(this).closest('tr').find('#nombre_servicio').text();
  alert(id);
}
document.querySelector('#modificar2').addEventListener('click', (event) => {
  alert('event.target.id: ' + event.target.id);
});

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">

      ID
      Nombre del servicio
      Categoria del servicio
      Estado
      Acción

      1
      Un servicio
      Plomería
      Pendiente
      <button onclick='llamar_datos1()' class='btn btn-primary' id='modificar' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>

      2
      Otro servicio
      Carpintería
      Aprobado
      <button class='btn btn-primary' id='modificar2' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>

Cuando hayas resuelto esta parte, te vas a encontrar tarde o temprano con un problema ocasionado porque todas tus filas tienen el mismo ID en la primera y segunda columnas. Eso puede pasar desapercibido en tanto uses una búsqueda relativa como closest() pero no es correcto.

A: En tu código se observan malas prácticas como son:

*

*Asignar el mismo ID a varios elementos en el HTML que se produce en esta parte while($row = mysqli_fetch_array($result)){ En el código de ejemplo no he asignado ninguno de esos IDs repetitivos porque no se necesitan, no al menos para el propósito de la pregunta. Si necesitas IDs por algún motivo asígnalos, pero garantizando que sean únicos. Y si no los necesitas, no los asignes, ¿para qué recargar el contenido innecesariamente?

*Usar funciones in-line, que viola el principio de Separación entre estructura y comportamiento
Dicho eso, y tratándose de una tabla, la cual se supone siempre va a tener la misma cantidad de celdas en este contexto, puedes fácilmente recoger los valores de las celdas que quieras en el botón en el que se haya hecho click.
En este código, basado en Javascript puro (puedes hacer algo parecido en jQuery pero te aconsejo que dependas lo menos posible de librerías externas), haremos lo siguiente:
Primero vamos a alcanzar todos los botones que estén en la tabla cuyo id es table-id usando querySelectorAll().
Luego vamos a escuchar los clicks que ocurran en todos esos botones mediante eventos. Esto sustituye tu función in-line (no necesitas asignarla en el while). Aquí he metido toda la lógica dentro de la misma asignación del listener, pero puedes asignar una función aparte... Realmente no es necesario.
Después usaremos parentNode para referirnos a todas las celdas de la fila del botón sobre el que se hizo click.
Y finalmente obtendremos el valor de aquellas celdas que nos interesan usando su índice (en este caso sólo interesan las tres primeras celdas)... Cabe decir que en este punto cualquier otro tipo de lectura es posible, según la necesidad. Aquí lo he hecho a mano por simplificad y porque son pocos valores, pero en una tabla con muchas celdas puedes aquí hacer una lectura basada en un bucle u otra función avanzada de Javascript, por ejemplo, si necesitaras crear un objeto a partir de los valores de las celdas o cosas así.

document.addEventListener("DOMContentLoaded", function(event) {
  /*
    Referencia sólo a los button dentro de table-id
  */
  const allButtons = document.querySelectorAll('#table-id td button');

  /*
    Escuchamos los clicks de cualquier button
  */

  allButtons.forEach(function(elem) {
    elem.addEventListener("click", function() {
      /*
        Referencia a todas las celdas de la fila actual
      */
      let allCells = elem.parentNode.parentNode.cells;

      /*
        Obtienes los valores que te interesan
      */
      cellA = allCells[0].textContent;
      cellB = allCells[1].textContent;
      cellC = allCells[2].textContent;
      /*
        Usar valores donde los requieras
        Test ...
      */
      console.log(cellA, cellB, cellC);

    });
  });
});

      ID
      Nombre del servicio
      Categoria del servicio
      Estado
      Acción

      1
      Servicio1
      Categoría1
      Estado1
      <button class='btn btn-primary' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>

      2
      Servicio2
      Categoría2
      Estado2
      <button class='btn btn-primary' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>

      3
      Servicio3
      Categoría3
      Estado3
      <button class='btn btn-primary' name='modificar' data-toggle='modal' data-target='#GSCCModal'>Modificar</button>

Post-Data
Ahora que el código funciona y habiendo leído que quieres pasar los datos de las celdas a un modal, dejo caer la duda de que quiza no necesites un modal. Hoy día puedes actualizar parte del mismo contendor de forma dinámica, ganado en UX (experiencia de usuario) y en recursos. Imagina que incorporas tu "modal" en la misma página y lo muestras o lo ocultas según quieras, que le das un fondo de otro color etc... pues eso, cuando leo modal pienso en Windows 3.0 (eran los años 90 y las ventanas que emergían eran lo máximo). Eso quedó atrás hace mucho tiempo... Hoy día usar modales es cas siempre una pésima experiencia de usuario.


text:
Q: Library to SDK in Android I've been searching for info about it on the internet but I haven't found anything.
The point is that I want to transform my library for android, which I'm using for advertising, into an sdk to make it available for other developers.
My library is mainly an extension of the Application class and I don't know if this should be the way an sdk is made, mainly because it seems weird to me that a .jar extends the Application class.
So, I'm asking for some advices/tips/guidelines or whatever you could tell me in order to build an sdk.


text:
Q: Qt/C++: Icons not showing up when program is run under windows O.S I am using QT 4.7.0. I have created a project in Windows. I am using some icons on buttons, but when I move the .exe file to another Windows machine the icons don't show. If I run the program in the on the development machine, the icons appear.
I created a qrc file and added the icons to it.

A: Probably you are having a plugin issue. QT comes with many plugins and your application can not find them on new target.
Check out this this link. Copy the plugins to new target and use qt.conf method to indicate plugin paths.

A: Your code needs to reference the icons in the resource bundle and not the icons with harddisk paths, e.g.
QIcon icon(":/resources/icon.ico");

and not
QIcon icon("resources/icon.ico");

Profiling a debug version on the target machine with depends.exe will help you show, whether OrcunC or my guess is correct.

A: I think you need to link the image plugin dlls at run time.
copy necessary dlls in the plugins folder from your Qt directory into your deployment directory and load it.
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QString sDir = QCoreApplication::applicationDirPath();

    a.addLibraryPath(sDir+"/plugins");

    //*********** do your things

    return a.exec();
}

A: Another way to solve a problem is qrs

A: Please see this page if you can not solve it currently.
Click Setting the Application Icon on Windows.


text:
Q: GERRIT_REFSPEC not recognized during scm git checkout - Jenkinsfile declarative I have a declarative pipeline that uses a kubernetes agent.
pipeline {
    agent {
        kubernetes {
            yamlFile "file.yml"
        }
    }
...
}

The pipeline is started by a Gerrit trigger, the GERRIT_REFSPEC parameter is provided by this trigger.
During scm git checkout a first git fetch is made successfully (GERRIT_RESPEC is recognized), the second one fails (GERRIT_RESPEC is NOT recognized).
Triggered by Gerrit: https://[gerrit-server]
Checking out git ssh://[gerrit-server]/[project] into [workspace] to read Jenkinsfile
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
using credential gerrit
 > git rev-parse --resolve-git-dir [workspace]/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://[gerrit-server]/[project] # timeout=10
Fetching upstream changes from ssh://[gerrit-server]/[project]
 > git --version # timeout=10
 > git --version # 'git version 2.30.2'
using GIT_SSH to set credentials [gerrit-server]
 > git fetch --tags --force --progress -- ssh://[gerrit-server]/[project] refs/changes/11/111111/11:refs/changes/11/111111/11 # timeout=10
 > git rev-parse refs/remotes/origin/refs/changes/11/111111/11^{commit} # timeout=10
 > git rev-parse refs/changes/11/111111/11^{commit} # timeout=10
Checking out Revision [revision-id] (refs/changes/11/111111/11)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f [revision-id] # timeout=10
Commit message: "[commit-message]"
First time build. Skipping changelog.
Running in Durability level: MAX_SURVIVABILITY
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune -- origin +refs/heads/$GERRIT_REFSPEC:refs/remotes/origin/$GERRIT_REFSPEC" returned status code 128:
stdout:
stderr: fatal: couldn't find remote ref refs/heads/$GERRIT_REFSPEC
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2681)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2102)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:86)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:624)
    at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:365)
    at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
    at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
    at org.jenkinsci.plugins.workflow.multibranch.ReadTrustedStep$Execution.run(ReadTrustedStep.java:101)
    at org.jenkinsci.plugins.workflow.multibranch.ReadTrustedStep$Execution.run(ReadTrustedStep.java:82)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate2(ACL.java:449)
    at hudson.security.ACL.impersonate(ACL.java:461)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE

I've seen some other suggestions to disable Lightweight checkout option, but this is already disabled in my case.
If I use a node label (node being manually added to Jenkins) instead of kubernetes the scm git checkout phase succeeds.
agent { label [physical-node-label] }

Is there any way to have the scm git checkout phase succeeded with a Kubernetes agent, without changing the pipeline from declarative to scripting?
Versions used:

*

*Jenkins: 2.303.1

*Kubernetes plugin: 1.30.1

*Git plugin: 4.8.2

*Gerrit trigger plugin: 2.34.0

A: In the "git fetch" command which worked, the following parameter was used:
refs/changes/11/111111/11:refs/changes/11/111111/11

This is the same as:
$GERRIT_REFSPEC:$GERRIT_REFSPEC

Which is the correct way to perform the fetch.
But in the failed "git fetch" command, the following parameter was used:
refs/heads/$GERRIT_REFSPEC:refs/remotes/origin/$GERRIT_REFSPEC

Which will be replace to:
refs/heads/refs/changes/11/111111/11:refs/remotes/origin/refs/changes/11/111111/11

Which is totally wrong.
I don't know why this is happening :-(

A: After multiple attempts I was able to "solve" the problem by adding the yaml content directly in groovy instead of using yamlFile. I would have preferred to have the yaml outside, but I have to continue with it inside due to this error.


text:
Q: Upgrading asp.net core from 2.1.0 to 2.1.5 I'd like to upgrade .net core on my website from 2.1.0 to 2.1.5.
My app is using the nuget package Microsoft.AspNetCore.All (2.1.0) and Microsoft.EntityFrameworkCore.Tools (2.1.0) which I uninstalled and then replaced with Microsoft.AspNetCore.All (2.1.5) and Microsoft.EntityFrameworkCore.Tools (2.1.4).
The app compiles fine but when I run it it fails with:
The program '[10808] dotnet.exe' has exited with code -2147450730 (0x80008096).
Verbose logs are written to:
C:\Users\chris\AppData\Local\Temp\vscode-chrome-debug.txt
The program '' has exited with code -1 (0xffffffff).

The contents of the log file are:
OS: win32 ia32
Adapter node: v6.4.0 ia32
vscode-chrome-debug-core: 6.7.7
1:07:08 PM, 10/28/2018
debugger-for-chrome: 4.8.2
From client: initialize({"clientID":"visualstudio","clientName":"Visual Studio","adapterID":"chrome","locale":"en-US","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path","supportsVariableType":true,"supportsRunInTerminalRequest":true,"supportsHandshakeRequest":true,"supportsMapURLToFilePathRequest":true,"supportsLaunchUnelevatedProcessRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true,"supportsEvaluateForHovers":true,"supportsLoadedSourcesRequest":true,"supportsRestartRequest":true,"supportsSetExpression":true,"supportsLogPoints":true}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/initialize","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","successful":"true","timeTakenInMilliseconds":"21.930325","requestType":"request"}}}
From client: launch({"noDebug":false,"name":"Attach to Chrome program from Visual Studio","type":"chrome","request":"launch","breakOnLoad":true,"breakOnLoadStrategy":"instrument","_clientOverlayPausedMessage":"Paused in Visual Studio","trace":true,"sourceMaps":true,"showAsyncStacks":true,"smartStep":false,"url":"https://localhost:44346/","runtimeExecutable":"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","runtimeArgs":"","userDataDir":"C:\\Users\\chris\\AppData\\Local\\Microsoft\\VisualStudio\\15.0_0fe76bd1\\WebTools\\ChromeUserData_B1BEBFE6_B40C53F9-A0F2-4A03-9E6B-7ED75B1562AA","webRoot":"C:\\Develop\\Websites\\Paranormal\\Paranormal\\wwwroot","port":52097})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","request":"launch","args":["noDebug","name","type","request","breakOnLoad","breakOnLoadStrategy","_clientOverlayPausedMessage","trace","sourceMaps","showAsyncStacks","smartStep","url","runtimeExecutable","runtimeArgs","userDataDir","webRoot","port","pathMapping","sourceMapPathOverrides","skipFileRegExps"]}}}
spawn('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', ["--remote-debugging-port=52097","--no-first-run","--no-default-browser-check","--user-data-dir=C:\\Users\\chris\\AppData\\Local\\Microsoft\\VisualStudio\\15.0_0fe76bd1\\WebTools\\ChromeUserData_B1BEBFE6_B40C53F9-A0F2-4A03-9E6B-7ED75B1562AA","about:blank"])
Getting browser and debug protocol version via http://127.0.0.1:52097/json/version
Discovering targets via http://127.0.0.1:52097/json/list
Got browser version: Chrome/70.0.3538.77
Got debug protocol version: 1.3
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetDebugProtocolVersion","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2"}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","numTargets":2}}}
Attaching to target: {"description":"","devtoolsFrontendUrl":"/devtools/inspector.html?ws=localhost/devtools/page/E7890F76DD756B29A4C2FF36774AAF53","id":"E7890F76DD756B29A4C2FF36774AAF53","title":"","type":"page","url":"about:blank","webSocketDebuggerUrl":"ws://127.0.0.1:52097/devtools/page/E7890F76DD756B29A4C2FF36774AAF53"}
WebSocket Url: ws://127.0.0.1:52097/devtools/page/E7890F76DD756B29A4C2FF36774AAF53
→ To target: "{\"id\":1,\"method\":\"Console.enable\"}"
→ To target: "{\"id\":2,\"method\":\"Debugger.enable\"}"
→ To target: "{\"id\":3,\"method\":\"Runtime.enable\"}"
→ To target: "{\"id\":4,\"method\":\"Runtime.runIfWaitingForDebugger\"}"
→ To target: "{\"id\":5,\"method\":\"Runtime.run\"}"
→ To target: "{\"id\":6,\"method\":\"Page.enable\"}"
→ To target: "{\"id\":7,\"method\":\"Network.enable\",\"params\":{}}"
← From target: {"id":1,"result":{}}
← From target: {"id":2,"result":{"debuggerId":"(872A917ED166C84EB9028E8737093920)"}}
← From target: {"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"://","name":"","auxData":{"isDefault":true,"type":"default","frameId":"E7890F76DD756B29A4C2FF36774AAF53"}}}}
← From target: {"id":3,"result":{}}
← From target: {"id":4,"result":{}}
← From target: {"error":{"code":-32601,"message":"'Runtime.run' wasn't found"},"id":5}
← From target: {"id":6,"result":{}}
← From target: {"id":7,"result":{}}
→ To target: "{\"id\":8,\"method\":\"Debugger.setBlackboxPatterns\",\"params\":{\"patterns\":[\"^chrome-extension:.*\"]}}"
→ To target: "{\"id\":9,\"method\":\"Schema.getDomains\"}"
← From target: {"id":9,"result":{"domains":[{"name":"Inspector","version":"1.2"},{"name":"Memory","version":"1.2"},{"name":"Page","version":"1.2"},{"name":"Emulation","version":"1.2"},{"name":"Security","version":"1.2"},{"name":"Network","version":"1.2"},{"name":"Database","version":"1.2"},{"name":"IndexedDB","version":"1.2"},{"name":"CacheStorage","version":"1.2"},{"name":"DOMStorage","version":"1.2"},{"name":"CSS","version":"1.2"},{"name":"ApplicationCache","version":"1.2"},{"name":"DOM","version":"1.2"},{"name":"IO","version":"1.2"},{"name":"DOMDebugger","version":"1.2"},{"name":"DOMSnapshot","version":"1.2"},{"name":"ServiceWorker","version":"1.2"},{"name":"Input","version":"1.2"},{"name":"LayerTree","version":"1.2"},{"name":"DeviceOrientation","version":"1.2"},{"name":"Tracing","version":"1.2"},{"name":"Animation","version":"1.2"},{"name":"Accessibility","version":"1.2"},{"name":"Storage","version":"1.2"},{"name":"Log","version":"1.2"},{"name":"Runtime","version":"1.2"},{"name":"Debugger","version":"1.2"},{"name":"Profiler","version":"1.2"},{"name":"HeapProfiler","version":"1.2"},{"name":"Schema","version":"1.2"},{"name":"Target","version":"1.2"},{"name":"Overlay","version":"1.2"},{"name":"Performance","version":"1.2"},{"name":"Audits","version":"1.2"},{"name":"HeadlessExperimental","version":"1.2"}]}}
→ To target: "{\"id\":10,\"method\":\"Debugger.setAsyncCallStackDepth\",\"params\":{\"maxDepth\":4}}"
← From target: {"method":"Page.frameResized","params":{}}
← From target: {"id":8,"result":{}}
← From target: {"id":10,"result":{}}
→ To target: "{\"id\":11,\"method\":\"Runtime.evaluate\",\"params\":{\"expression\":\"navigator.userAgent\",\"silent\":true}}"
→ To target: "{\"id\":12,\"method\":\"Browser.getVersion\"}"
To client: {"seq":0,"type":"response","request_seq":2,"command":"launch","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/launch","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","successful":"true","timeTakenInMilliseconds":"872.118059","requestType":"request","doesHostSupportLaunchUnelevated":"true"}}}
← From target: {"id":12,"result":{"protocolVersion":"1.3","product":"Chrome/70.0.3538.77","revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","jsVersion":"7.0.276.32"}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"target-version","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77"}}}
← From target: {"method":"Debugger.scriptParsed","params":{"scriptId":"18","url":"","startLine":0,"startColumn":0,"endLine":0,"endColumn":19,"executionContextId":1,"hash":"3a6f8cb8708878331cc2be2ec90de0ab25738855","executionContextAuxData":{"isDefault":true,"type":"default","frameId":"E7890F76DD756B29A4C2FF36774AAF53"},"isLiveEdit":false,"sourceMapURL":"","hasSourceURL":false,"isModule":false,"length":19}}
→ To target: "{\"id\":13,\"method\":\"Debugger.getPossibleBreakpoints\",\"params\":{\"start\":{\"scriptId\":\"18\",\"lineNumber\":0,\"columnNumber\":0},\"end\":{\"scriptId\":\"18\",\"lineNumber\":1,\"columnNumber\":0},\"restrictToFunction\":false}}"
← From target: {"id":11,"result":{"result":{"type":"string","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"}}}
Target userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
→ To target: "{\"id\":14,\"method\":\"Network.setCacheDisabled\",\"params\":{\"cacheDisabled\":false}}"
← From target: {"id":13,"result":{"locations":[{"scriptId":"18","lineNumber":0,"columnNumber":0}]}}
To client: {"seq":0,"type":"event","event":"initialized"}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"VM18","path":"<eval>/VM18","sourceReference":1000}}}
← From target: {"id":14,"result":{}}
From client: setBreakpoints({"source":{"path":"c:\\Develop\\Websites\\Paranormal\\Silverdex.FFMpeg\\FFmpegMediaInfo.cs","sources":[],"checksums":[]},"breakpoints":[{"line":473,"column":13}],"lines":[473]})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"setBreakpointsRequest","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","fileExt":".cs"}}}
SourceMaps.setBP: c:\Develop\Websites\Paranormal\Silverdex.FFMpeg\FFmpegMediaInfo.cs can't be resolved to a loaded script. It may just not be loaded yet.
Paths.setBP: No target url cached yet for client path: c:\develop\websites\paranormal\silverdex.ffmpeg\ffmpegmediainfo.cs.
→ To target: "{\"id\":15,\"method\":\"DOMDebugger.setInstrumentationBreakpoint\",\"params\":{\"eventName\":\"scriptFirstStatement\"}}"
From client: setBreakpoints({"source":{"path":"c:\\Develop\\Websites\\Paranormal\\Silverdex.FFMpeg\\FFmpegMediaInfo.cs","sources":[],"checksums":[]},"breakpoints":[{"line":473,"column":13}],"lines":[473]})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"setBreakpointsRequest","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","fileExt":".cs"}}}
From client: setExceptionBreakpoints({"filters":[]})
→ To target: "{\"id\":16,\"method\":\"Debugger.setPauseOnExceptions\",\"params\":{\"state\":\"none\"}}"
SourceMaps.setBP: c:\Develop\Websites\Paranormal\Silverdex.FFMpeg\FFmpegMediaInfo.cs can't be resolved to a loaded script. It may just not be loaded yet.
Paths.setBP: No target url cached yet for client path: c:\develop\websites\paranormal\silverdex.ffmpeg\ffmpegmediainfo.cs.
← From target: {"id":15,"result":{}}
To client: {"seq":0,"type":"response","request_seq":3,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":1000,"verified":false,"message":"Breakpoint set but not yet bound"}]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/setBreakpoints","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","successful":"true","timeTakenInMilliseconds":"8.656402","requestType":"request"}}}
To client: {"seq":0,"type":"response","request_seq":4,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":1001,"verified":false,"message":"Breakpoint set but not yet bound"}]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/setBreakpoints","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","successful":"true","timeTakenInMilliseconds":"4.619639","requestType":"request"}}}
← From target: {"id":16,"result":{}}
To client: {"seq":0,"type":"response","request_seq":5,"command":"setExceptionBreakpoints","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/setExceptionBreakpoints","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","successful":"true","timeTakenInMilliseconds":"5.50894","requestType":"request"}}}
From client: configurationDone({})
→ To target: "{\"id\":17,\"method\":\"Page.navigate\",\"params\":{\"url\":\"https://localhost:44346/\"}}"
To client: {"seq":0,"type":"response","request_seq":6,"command":"configurationDone","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/configurationDone","data":{"Versions.DebugAdapterCore":"6.7.7","Versions.DebugAdapter":"4.8.2","Versions.Target.CRDPVersion":"1.3","Versions.Target.Revision":"@0f6ce0b0cd63a12cb4eccea3637b1bc9a29148d9","Versions.Target.UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36","Versions.Target.V8":"7.0.276.32","Versions.Target.Project":"Chrome","Versions.Target.Version":"70.0.3538.77","successful":"true","timeTakenInMilliseconds":"2.013444","requestType":"request"}}}
From client: disconnect({"terminateDebuggee":true})

Can anyone tell me what I'm doing wrong and how I can make the upgrade stick?

A: I had the same issue and noticed that I was missing a runtime as indicated in your log above. The fix is to make sure you have the correct .Net Core SDK/runtimes installed
Installed .Net Core SDK/runtimes


text:
Q: How to multiply from 12 all the way to 1 with a 'for' function with R language My question is related to calculate the multiplies of 12 (factorials) in a for loop:
I spent a lot of time on this but can`t solve it!
It is important to use a function with a 'for' loop!
So far: I had tried doing
for(i in 1:12){
   prod(i)
}

and also
for(i in 1:12){
   print(prod(i)
}

and also
for(i in 1:12){
   prod(i)
}

and also
for(i in 1:12){
   print(prod(i)
}

and also
many other code, and it does not work

A: For:
my_factorial<-function(x){
  y<-1
  for(i in 1:x) {
    y<-y*((1:x)[i])
  }
  return(y)
}
my_factorial(12)

is the same as:
factorial
factorial(12)

OR
You can use gamma for factorials:
x = 12
gamma(x+1)

is the same as:
12*11*10*9*8*7*6*5*4*3*2*1
[1] 479001600

result:
[1] 479001600

A: If you want product of first numbers at each iteration
b=vector()
for (i in 1:12){
  b[i]=i
  print(prod(b))
}

[1] 1
[1] 2
[1] 6
[1] 24
[1] 120
[1] 720
[1] 5040
[1] 40320
[1] 362880
[1] 3628800
[1] 39916800
[1] 479001600

This will be like
1
1*2
1*2*3
.
.
.
1*2*3*4*5*6*7*8*9*10*11*12

But if you want just the product of the 12 first positive integers then you do not need a for loop. just use product function.
prod(1:12)
[1] 479001600

A: After a long time of critical thinking and studying other people's code,
I was able to finally create a more simple code that finds the factorials up to 12
b <- 1:12

This gives b a vector from 1 to 12
for(i in 1:1){
    print(prod(b))
}

this function tells r that:
for i, the variable of the sequence, in 1 line
please print the product of b
Answer:
[1] 479001600