text:
Q: How can I say to jQuery hover all images by hovering the gallery I found a simple jquery script, that do the opacity of a image set to 0 by hovering an image from a list. I like the effect, but it is working only on 1 image in a ul packed gallery. My answer ist, how can I say to jquery, hey do this to all images in the ul, where the images are in lists listet, when I hover the the gallery div/ul?
edit: I use here two classes, grey and color. Under the grey class images is the color class image. The grey class will set to 0, then it will show up the color image. This is still working for hovering 1 image from that list, but I like to have this effect to all images together, at the same time by hovering the gallery_container div or the ul gallery. Can somebody help, how to write the jquery right for this?
HTML

jQuery
$(document).ready(function(){
    $("img.grey").hover(
    function() {
    $(this).stop().animate({"opacity": "0"}, "slow");
    },
    function() {
    $(this).stop().animate({"opacity": "1"}, "slow");
    });
});

CSS
.gallery li {
    float: left;
    margin-right: 20px;
    list-style-type: none;
    margin-bottom: 20px;
    display: block;
    height: 130px;
    width: 130px;
    position: relative;
}

img.grey {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
}

img.color {
    position: absolute;
    left: 0; top: 0;
}

A: Try.
$(".gallery_container").hover(
function()
{
    $(this).find('img').stop().animate({"opacity": "0.5"}, "slow");
},
function()
{
    $(this).find('img').stop().animate({"opacity": "1"}, "slow");
});

See Fiddle

A: Here is update javascript:
$(document).ready(function(){
  $('.gallery').hover(function() {
    $('.gallery img').stop().animate({"opacity": "0"}, "slow");
  }, function() {
    $('.gallery img').stop().animate({"opacity": "1"}, "slow");
  });
}

A: Try something like this:

$('ul.gallery li a img.grey').hover(function(e){
e.preventDefault();
...
...
});

A: -Edit-
OP's desired effect is grayscale<->color, not opacity.
OP's ref: http://themes.quemalabs.com/elitist/
Updated fiddle: http://jsfiddle.net/bwbNH/

OP,
From what I understand, you want to fade out all images whenever the user hovers over any of the images. While I don't know your use case, this might be confusing as it's not exactly standard. In any case, I'd suggest binding your events to the parent ul.gallery and assigning the animation to its children: $(this).children('li')
Fiddle : http://jsfiddle.net/KaZFL/

JS
$(document).ready(function () {
    $(".gallery").mouseenter(function () {
        $(this).children('li').stop().animate({
            "opacity": "0"
        }, "slow");
    }).mouseleave(function () {
        $(this).children('li').stop().animate({
            "opacity": "1"
        }, "slow");
    });
});


text:
Q: How to see what files spotlight is currently indexing Spotlight has been driving me nuts, over working my poor Harddrive so that my whole computer goes to a crawl. (CPU usage is still pretty low, then again I do have a core i7).
I saw somewhere that there was a way to see what it was currently indexing but I don't remember where.
Any ideas as to see what it's indexing?
I want to see if it's some files that keep doing it, then just put that folder in the ignore list.

A: You can use the fs_usage command to see the list of files visited by the mdworker process:

sudo fs_usage -w -f filesys mdworker | egrep "open"

Hope it helps!

A: Have you tried
sudo opensnoop -p PID

where PID is the process ID of mdworker?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Combine GetType with Cast to convert List to List I am aware of the antipatern nature of this request, but maybe there is a better alternative.
In Brief
I have List<IBaseEntity> and want to convert to List<ActualEntity>. Though ActualEntity needs to come from reflection of what IBaseEntity actually is. It is one of 50+ potential classes
so something like this:
public void Install(List<IBaseEntity> list)
{
    var type = list.First().GetType();
    var typedList = list.Cast<?>(?).ToList()
    ThirdPartyClass.Install( typedList )
}

Just unsure how to get the type into the Cast
Details of Why
The Install method MUST be the concrete type as a 3rd party component is using that type to link to the a DbSet in EF. So the list of BaseEntity won't work. It throws an exception about not finding DbSet<IBaseEntity>. It needs to be DbSet<ConcreteClass>
I guarantee that IBaseEntity will ALWAYS be the same concrete class, but the method is called many times with each entity in the application. So doing a usual cast by specifying each concrete type won't be practical.
EF is OK with adding DbContext.AddRange(list)  and it seems to work out what IBaseEntity actually is and use the correct mapping.
Thanks in advance
** Update **
It was suggested that the calling method would know the type, unfortunately it is a little more complex, so let me explain that point.
There is a BaseSampleData<TEntity> : ISampleDataBuilder class which handles creating sample data, it maintains a list of primary keys of other entities etc.
Now the sticking point is a factory which assembles them
public class ProjectASampleDataFactory
{
    public class List<ISampleDataBuilder> GetBuilders(){
        return new List<ISampleDataBuilder> {
            new UserSampleData(), // ISampleDataBuilder<User>
            new BlogsSampleData(), // ISampleDataBuilder<Blogs>
            etc...
        }
    }
}

The issue is I need to have a List<ISampleData> which is the list of builders, but they don't intrinsically know of their type. So the caller actually doesn't know. the ??? are all different (see comments of above code block)
So I get a list which every entity follows, but although it is a List we just don't know which ActualEntity it is.

A: Can you control the caller of this method? Since the caller probably already knows what type it is processing, can you force them to provide the concrete type?
public void Install<T>(IEnumerable<IBaseEntity> list) where T:IBaseEntity
    => ThirdPartyClass.Install( list.Cast<T>().ToList() );

Even if you can't change the call site, you can call your method via reflection;
public void Install(List<IBaseEntity> list)
{
    var type = list.First().GetType();
    new Action<IEnumerable<IBaseEntity>>(Install<IBaseEntity>)
        .Method.GetGenericMethodDefinition()
        .MakeGenericMethod(type)
        .Invoke(this, new object[] { list });
}

A: Credit to Jeremy Lakeman for the idea to access the MethodInfo via an Action delegate.
Note, this requires C#8 to work, as it requires static lambdas to work.
public void Install(List<IBaseEntity> list)
{
    if (!(list.FirstOrDefault() is {} first))
        return;

    static void InstallImpl<T>(List<IBaseEntity> list) where T : IBaseEntity
    {
        ThirdPartyClass.Install<T>(list.OfType<T>().ToList());
    }

    new Action<List<IBaseEntity>>(InstallImpl<IBaseEntity>)
        .Method.GetGenericMethodDefinition()
        .MakeGenericMethod(first.GetType())
        .Invoke(null, new[] {list});
}

A: You might want to consider using a non generic List in your method in order to avoid passing e.g. a List<object> into a method that uses List<string>.
The keyword dynamic is made for exactly cases like this.
Have a look at this sample:
static void Main(string[] args)
{
    var objectList = new List<int>();
    objectList.Add(1);
    YourMethod(objectList);
}

static void YourMethod(IList objects)
{
    dynamic dynamicObjects = objects;
    FrameworkMethod(dynamicObjects);
}

static int FrameworkMethod(IList<int> typedList)
{
    return typedList.FirstOrDefault();
}


text:
Q: Compile Error: Illegal string literal: Line breaks are not allowed in string literals I am getting error for below statement.
string xmloutput = '<?xml version="1.0" encoding="UTF-8"?><ns2:gaTransactionType xmlns:ns2="http://abc.com">gaPaymentTransaction.xsd ">
    <merchantName>Test Merchant</merchantName>
    <merchantNumber>SNA_TEST</merchantNumber>
    <service>SNA_TEST_DONATION</service>
                <orderNumber>1001</orderNumber>
    <gaBatchAgency>SNA</gaoBatchAgency>
    <gaDocNoAgency>SNA</gaoDocNoAgency>
    <totalAmount>5000</totalAmount>
    <summaryDescription>This is a test.</summaryDescription>
                <test>test</test>
    <lineItemList>
        <lineItem>
            <gaoProductCode>SN000001</gaoProductCode>
            <gaoAgency>SNA</gaoAgency>
            <function>19000</function>
            <revenueSource>4612</revenueSource>
            <departmentRevenueSource></departmentRevenueSource>
            <accountingTemplate></accountingTemplate>
            <gaoDescription>BORDER FD</gaoDescription>
            <amount>5000</amount>
            <quantity>1</quantity>
        </lineItem>
    </lineItemList>
</ns2:gaTransactionType>';

A: You are facing this issue because you are trying to add multi line statement. You can't directly add this. You have two options here.

*

*Convert this into single line and then add
<?xml version="1.0" encoding="UTF-8"?><ns2:gaTransactionType xmlns:ns2="http://abc.com">gaPaymentTransaction.xsd "><merchantName>Test Merchant</merchantName><merchantNumber>SNA_TEST</merchantNumber><service>SNA_TEST_DONATION</service><orderNumber>1001</orderNumber><gaBatchAgency>SNA</gaoBatchAgency><gaDocNoAgency>SNA</gaoDocNoAgency><totalAmount>5000</totalAmount><summaryDescription>This is a test.</summaryDescription><test>test</test><lineItemList><lineItem><gaoProductCode>SN000001</gaoProductCode><gaoAgency>SNA</gaoAgency><function>19000</function><revenueSource>4612</revenueSource><departmentRevenueSource></departmentRevenueSource><accountingTemplate></accountingTemplate><gaoDescription>BORDER FD</gaoDescription><amount>5000</amount><quantity>1</quantity></lineItem></lineItemList></ns2:gaTransactionType>

*Second option to you need to do something like. Add them together and then use.
 string xmloutput = 'gaPaymentTransaction.xsd ">'+
    'Test Merchant '+
    'SNA_TEST'+
    'SNA_TEST_DONATION'+

            // complete code
    '</lineItem>'+
'</lineItemList>'+

'&lt/ ns2:gaTransactionType>';

A: I found a better solution for this issue, you should create a custom laber for your kml script, and inside the apex code you can assign the custom label value to your variable.


text:
Q: QGIS 3.10 and data dependencies I have one table call "LR - Données", with 2 attributes: 'LR nom français' and 'LR nom latin'.
I have a point layer in a geopackage call "Observations" with 2 attributes: 'Nom français' and 'Nom latin'.
The attribute 'Nom français' is a value relation:

The attribute 'Nom latin' is also a value relation:

Until here, everything works fine. But sometimes, the 'LR - Données' table has update. So I set a dependence in my layer 'Observations' with the 'LR- Données' table.
Here is my problem. When I change for example a latin name in my table 'LR - Données', the attribute in layer 'Observations' change, and the old value comes into (). Which is fine in a way, cause it shows me changes. But how can I update all the value in my attribute table to get all the new values?


text:
Q: webdriver.io continue script after page reload I'm writing an automated script with webdriver.io to fill in inputs/selects on a web page and take screenshots. What if a user action (such as changing the value of a select) causes the page to load in the middle of the automation script's execution? Is there a way to pick up where you left off in the script (let's say some inputs were already filled in at that point and they retain their value via session data but you want to continue filling in the rest of them).
As far as I can see once that page reloads the script stops executing.
If there is no way to pick up where you left off, then how do you trigger the script from the beginning by detecting a page load and then re-executing the script?
Responding to comments: I don't think I need to paste the code (although I will) because the question is really just how to detect a page load via webdriver.io when the page load occurs in the middle of script execution and is NOT initiated by the script itself.
UPDATE!!: I managed to solve this using waitForExist() and simply waiting for each input/select to exist before I interact with it. It's not ideal, but it works. If anyone has a better solution please let me know!
Here's the code:
webdriverio = require('webdriverio');

var tester = {};

tester.iter = 0;

var options = {
    desiredCapabilities: {
        browserName: 'chrome'
    }
};

var params = {
  [[I've removed these because it's private info]]
};

var fields = {
  deliveryCompany: 'ABC Inc',
  deliveryFirstname: 'John',
  deliveryLastname: 'Smith',
  deliveryStreet1: '123 Main St.',
  deliveryCity: 'Boston',

};

var execQueue = [];

var wrapFunction = function(fn, context, params) {
    return function() {
        fn.apply(context, params);
    };
};

var takeScreenshot = function(){
  console.log('take screenshot', this);
   this.saveScreenshot('./checkout.png')
  .click('input.CBSubmit').then(function(value) {
     this.waitForExist('#mjPaymentReview').then(function(){
        this.saveScreenshot('./review.png').then(function(){
          this.click('input.CBSubmit').then(function(){
            this.waitForExist('#mjCartFinal').then(function(){
              this.saveScreenshot('./confirmation.png').then(function(){
                this.end();
              });
            });//end wait for exists

          });//end click.then

        });// Save the screenshot to disk
      });//end pause.then

   });//end click.then

};//end takeScreenshot

function fillFields(driver, fields){

  driver.elements('select + .chosen-container').then(function(result){
    console.log('how many selects', result.value.length);
    tester.totalSelects = result.value.length;
  });

  //loop through all selects and inputs
 for(property in fields){
    var p = property;

    //closure to preserve value of property
    (function(p){
      //if chosen input then choose from list
     driver.isExisting('div.' + p + ' .chosen-results').then(function(result){

       if(result === true){

        driver.elements('div.' + p + ' select').then(function(result){
          //loop through each select (expiration date has two selections in one container)
          for(var i=0;i<result.value.length;i++){
            var s = result.value[i].ELEMENT;

            //closure
            (function(s){

            //find the name of each select
            driver.elementIdAttribute(s,'name').then(function(result){
              //find the chosen container after select
              var container = 'select[name=' + result.value + '] + .chosen-container';

              var selectName = result.value;
              //find corresponding a.chosen-single

              //this.debug()
              //click on a.chosen-single to activate chosen drop

              var qfunction = function(link, value){
                console.log('#################in qu function ###########', value);
                driver.click(link).then(function(){
                      this.keys([value, '\uE007']).then(function(){
                       tester.iter++;
                       console.log('tester.iter', tester.iter);
                       console.log('tester.totalSelects', tester.totalSelects);
                       if(tester.iter == tester.totalSelects-1){
                          takeScreenshot.call(this, null);
                        }
                        execQueue[tester.iter]();

                      });//end keys.then

                });//end click.then
              }//end qfunction

              execQueue.push(wrapFunction(qfunction, this, [container + ' a.chosen-single', fields[selectName]]));//end push

             if(execQueue.length == tester.totalSelects - 1){
              console.log('**********equal');

                  execQueue[tester.iter]();
              }//end if equal

              console.log('queue so far', execQueue.length);

            });//end elementIdAttribute

            })(s);//end closure

          }//end for selects in container

        });//end driver.elements

        }else{

         driver.addValue('input[name=' + p + ']', fields[p]);

        }

      })//end driver.isExisting

    })(p);

  }//end for each field

};//end fillFields

webdriverio
  .remote(options)
  .init()
  .url('https://' + params.domain + '/' + params.clientId + '/?scope=' + params.scope +  '&cart=' + params.cart + '&cfg=' + params.cfg + '&progress=' + params.progress + '&language=' + params.language + '&currencyId=' + params.currencyId) // navigate to the web page
  .then(function(result) {

    fillFields(this, fields);

  });


text:
Q: Approximating continuous function by the span of $\{\sin(nx)\}$ Let $f $ be continuous function on $[0,2\pi ]$ and $\int_0^{2\pi} f(x) \sin(nx) \, dx =0$ for all $n$ then prove that $f$ is identically zero.
Some of my friends claim that it is not true just because $\operatorname{span}\{\sin(nx)\}$ is not an algebra, but I am not convinced because I have seen odd power polynomial approximate continuous functions
through the origin. And it is similar to that problem but I am able to see the right one. Please could you help me?

A: Some of your friends are right. $\sin(x/2)$ is orthogonal to $\sin(nx)$ for $n=1,2,3,\cdots$, and $\sin(x/2)$ is not identically $0$. The correct $\sin$ functions are
$$
        \sin(x/2),\sin(x),\sin(3x/2),\sin(2x),\cdots.
$$
This is a complete orthogonal subset of $L^{2}[0,2\pi]$ (orthonormal when properly normalized.)


text:
Q: Puedo imprimir el objeto completo pero no un elemento del objeto js estoy trabajando en Angular.
Mediante un Factory le envio un objeto al Controller y quiero trabajar con dicho objeto pero no puedo acceder a los elementos del objeto, pero si hago un console.log() del objeto, entonces me muetra todos los datos.

Tengan en cuenta que SRConsulta es el Factory, en la imagen de abajo me imprime todo el objeto correctamente pero al querer acceder al valor: "edificio", este sale como undefined

Este es el codigo del Factory:
.factory('SRConsulta', function(SalasReunionesInstancia, SalasReunionesAreas, SalasReunionesEdificios, SalasReunionesPisos, Contactos, $rootScope, UserPermission) {
var r = {};
r.permisos = {};
var usuario = UserPermission.findByName({username: $rootScope.username}, function(usuario) {
    if(usuario.edificio) {
        r.permisos.edificio = usuario.edificio;
    }

    if(usuario.piso) {
        r.permisos.piso = usuario.piso;
    }
});

return r;

});
Alguien sabe? Gracias


text:
Q: mysql get distinct tokens from a string list I have a query in mysql that group concats records and gives a value having redundant tokens. Below is the output of the query:
Problem Area->ACC-HO->ACC-HO->Credit Note (C/N)->Problem description ->Problem description

But I want the distinct tokens of this string as below
Problem Area->ACC-HO->Credit Note (C/N)->Problem description

Is there a way to do this in the sql SELECT query itself?
EDIT
Here is schema and query
Below is my query:
SELECT
t2.transaction_id AS transaction_id,
GROUP_CONCAT(
CONCAT(
 t1.display_text,
 '->',
   (CASE (NOT EXISTS (SELECT 1 FROM mst_node a WHERE a.parent_node_id = t1.node_id))
      WHEN 1 THEN t1.display_text ELSE
      (SELECT b.display_text AS DISPLAY FROM mst_node b
      WHERE parent_node_id = t2.node_id AND b.display_seq = t2.entered_value)
     END)
     )
  ORDER BY t2.logtime_stamp SEPARATOR '->'
) AS display_text
FROM

mst_node t1
  JOIN trn_user_log t2
    ON t1.app_id = t2.app_id AND t1.node_id = t2.node_id
WHERE (t1.app_id = 105)
  AND t1.parent_node_id IS NOT NULL
  AND t1.save_as_default IS NULL
GROUP BY transaction_id,
  mobile_no
ORDER BY t2.transaction_id DESC,
  t2.logtime_stamp,
  t2.mobile_no

A: In you GROUP CONCAT add DISTINCT so it will only concatenate unique values.
SELECT GROUP_CONCAT(DISTINCT colName),....
FROM   ...
WHERE  ...
GROUP BY ...

SQLFiddle Demo

A: in your grouping clause, you can add another group by to group by this string column as well.
SELECT GROUP_CONCAT(myStringColumn),....
FROM   ...
WHERE  ...
GROUP BY myOtherColumn,myStringColumn

A: I was finally able to resolve my issue by using a UNION of two select queries and then doing a GROUP_CONCAT(DISTINCT column ORDER BY another_column).
Below is the query I used:
SELECT
transaction_id,
GROUP_CONCAT(DISTINCT display_text ORDER BY logtime_stamp SEPARATOR '->') AS display_text
FROM
 (SELECT
  t2.transaction_id AS transaction_id,
  t2.logtime_stamp,
  t1.display_text AS display_text
  FROM mst_node t1
  JOIN trn_user_log t2 ON t1.app_id = t2.app_id
   AND t1.node_id = t2.node_id
   WHERE (t1.app_id = 105)
   AND t1.parent_node_id IS NOT NULL
   AND t1.save_as_default IS NULL
  UNION
 SELECT t2.transaction_id AS transaction_id,t2.logtime_stamp,
  CASE(NOT EXISTS (SELECT 1 FROM mst_node a WHERE a.parent_node_id = t1.node_id))
  WHEN 1 THEN NULL
  ELSE (SELECT b.display_text AS display_text FROM mst_node b WHERE parent_node_id = t2.node_id AND b.display_seq = t2.entered_value)
  END AS display_text
FROM   mst_node t1 JOIN trn_user_log t2
      ON t1.app_id = t2.app_id AND t1.node_id = t2.node_id
  WHERE (t1.app_id = 105)
  AND t1.parent_node_id IS NOT NULL
  AND t1.save_as_default IS NULL
  ORDER BY transaction_id DESC,logtime_stamp
  ) AS T
  GROUP BY transaction_id
  ORDER BY transaction_id DESC,logtime_stamp


text:
Q: iPad simulator 5.1 shows blank white screen in Xcode 4.3 Guys. Please help me.. I've searched everywhere, but couldn't find a solution.
I'm using Xcode 4.3.2 and have the IOS 5.1 simulator installed.
The problem is the iPad simulator doesn't show the iPad's frame, just the contents. So, the home button isn't visible, thus can't be pressed.
But, unlike the iPad simulator, the iPhone simulator works fine.
Please help, guys..
Thank you

A: Use ⇧ +  ⌘  + h in place of the home button.
If you need to make the screen smaller, use ⌘+3 or ⌘+2 for the smallest and smaller screen sizes respectively.

A: Actually, I (and a colleague) have been seeing intermittent behavior, with the bezel sometimes showing up, and sometimes not, for the very same project (same version of iOS - 5.1, same build settings, etc).  This happens even when simulator is set to show a normal (non-retina) iPad... sometimes it has the bezel, sometimes not.
So I doubt this is intentional design.... seems like a bug to us.......


text:
Q: How to read console output of a process without redirecting standard output? I'm writing a GUI for a third-party console application and I wanted it to capture the output of the console window and add it to a text box in the GUI. This seemed like it was simple, all I had to do was to redirect the output stream of the target process.
But, when I do that the console application throws the error:

CTextConsoleWin32::GetLine: !GetNumberOfConsoleInputEvents

The current code I have which causes this error is this:
// This gets called once after the application has initialized.
private void StartServer()
{
    ProcessStartInfo processStartInfo = new ProcessStartInfo();
    processStartInfo.FileName = srcdsExeFile;
    processStartInfo.UseShellExecute = false;
    processStartInfo.CreateNoWindow = true;
    processStartInfo.RedirectStandardOutput = true;
    processStartInfo.RedirectStandardError = true;
    processStartInfo.RedirectStandardInput = true;

    serverProcess = Process.Start(processStartInfo);
    serverProcess.EnableRaisingEvents = true;
    serverProcess.Exited += new EventHandler(Server_Exited);
    serverProcess.OutputDataReceived += ServerProcess_OutputDataReceived;
    serverProcess.ErrorDataReceived += ServerProcess_ErrorDataReceived;
    serverProcess.BeginOutputReadLine();
    serverProcess.BeginErrorReadLine();
}

// This is (like seen above) an event handler for serverProcess.ErrorDataReceived.
private void ServerProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
    Console.Output.WriteLine("\n\nServer Error: " + e.Data + "\n\n");
}

// This is (like seen above) an event handler for serverProcess.OutputDataReceived.
private void ServerProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
    Console.Output.WriteLine(e.Data);
}

The above code does work for a minute or so while the external application is doing its initialization, but crashes after a specific point in the initialization process.
After doing some research it turns out that the third-party console application relies on the output stream to be a console, which is why it crashes when I try to redirect it. Trying to access the output stream without redirecting it also causes an error saying I have to redirect it first.
Which brings me to my actual question:
Is it possible to read the output of the console application without redirecting the output stream?

A: So this has been asked several times in the past couple of years.
I just run into the same issue and solved it in C++ but the same technique should apply to any other programming language since this is a WinAPI specific problem.
I've describe a solution for anyone that wishes to create an srcds server using CreateProcess and redirect input & output on windows.
This github repo put together how Console Handls & Standard Handles work together inside windows.
https://github.com/rprichard/win32-console-docs
Also the microsoft documentation of
https://learn.microsoft.com/en-us/windows/console/creation-of-a-console
I highly recommend to read about this as this makes it very obvious why srcds fails when redirecting the standard input.
The problem
a) Windows Console Handle is not equal to StandardInput and Output Handles.
b) And in windows there is no way to redirect Console handles.
c) GetNumberOfConsoleInputEvents requires a valid console handle with an input handle that is not a file, pipe. It must be a ConsoleHandle!
Since no one actually looks at why GetNumberOfConsoleInputEvents fails while it should be obvious after reading the documentation.
https://learn.microsoft.com/en-us/windows/console/getnumberofconsoleinputevents
It clearly states:

hConsoleInput [in]
A handle to the console input buffer. The handle must have the
GENERIC_READ access right. For more information, see Console Buffer
Security and Access Rights.

But here
https://github.com/rprichard/win32-console-docs#allocconsole-attachconsole-modern
it's explained that when you redirect the pipe it pretty much breaks the console input buffer. So you have to actually work with the console input buffer and not with the StdHandles.
The solution
Luckily the WinAPI provides several options for us to get access to an existing process's std handles. It's just very tricky and not well documented!
You can attach to a Console and grab the STDHandles. Duplicate them and do whatever you like.
Note that AttachConsole(ProcessId) requires you that the current process has no console attached so you must call FreeConsole();
Here's a code how to send a single letter to an another application's console using WinAPI. You can also grab the console handle and write to it any time Using GetStdHandle.
        int ProcessId = GetProcessId(ProcessInfo.hProcess);
        if (ProcessId <= 0)
        {
            printf("Process terminated.\n");
            break;
        }
        printf("Process Id: %d\n", ProcessId);

        FreeConsole();
        if (!AttachConsole(ProcessId))
        {
            printf("Attach failed with error: %d\n", GetLastError());
            exit(1);
        }

        INPUT_RECORD ir[2];
        ir[0].EventType = KEY_EVENT;
        ir[0].Event.KeyEvent.bKeyDown = TRUE;
        ir[0].Event.KeyEvent.dwControlKeyState = 0;
        ir[0].Event.KeyEvent.uChar.UnicodeChar = 'u';
        ir[0].Event.KeyEvent.wRepeatCount = 1;
        ir[0].Event.KeyEvent.wVirtualKeyCode = 'U';
        ir[0].Event.KeyEvent.wVirtualScanCode = MapVirtualKey('U', MAPVK_VK_TO_VSC);

        ir[1].EventType = KEY_EVENT;
        ir[1].Event.KeyEvent.bKeyDown = FALSE;
        ir[1].Event.KeyEvent.dwControlKeyState = 0;
        ir[1].Event.KeyEvent.uChar.UnicodeChar = 'u';
        ir[1].Event.KeyEvent.wRepeatCount = 1;
        ir[1].Event.KeyEvent.wVirtualKeyCode = 'U';
        ir[1].Event.KeyEvent.wVirtualScanCode = MapVirtualKey('U', MAPVK_VK_TO_VSC);

        DWORD dwTmp = 0;
        WriteConsoleInputA(GetStdHandle(STD_INPUT_HANDLE), ir, 2, &dwTmp);

        FreeConsole();
        if (!AttachConsole(ATTACH_PARENT_PROCESS))
        {
            printf("Attach failed with error: %d\n", GetLastError());
            exit(1);
        }

So the solution is simply to to write to the Console Input Buffer by attaching to the console of an SRCDS process.
Simply call AttachConsole and FreeConsole. and WriteConsoleInput.
To read the ouptut you can just call ReadConsoleOutput
For further reading visit the documentation:
GetNumberOfConsoleInputEvents
https://learn.microsoft.com/en-us/windows/console/getnumberofconsoleinputevents
AttachConsole
https://learn.microsoft.com/en-us/windows/console/attachconsole
FreeConsole
https://learn.microsoft.com/en-us/windows/console/freeconsole
WriteConsoleInput
https://learn.microsoft.com/en-us/windows/console/writeconsoleinput
ReadConsoleOutput
https://learn.microsoft.com/en-us/windows/console/readconsoleoutput


text:
Q: packages.config: Null or empty package id I'm trying to enter my Package Manager Console, and it's giving me the following error:
An error occurred while reading file 'C:\Users\rein.shope\Documents\Visual Studio 2015\Projects\Vidly\Vidly\packages.config': Null or empty package id
The error is displayed both in a ribbon on top of the window (with a "Restore" button that does nothing on click) and in red text within the window. The console will not allow me to input commands.
Contents of packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package Id="Antlr" version="3.4.1.9004" targetFramework="net452" />
  <package Id="bootstrap" version="3.0.0" targetFramework="net452" />
  <package Id="EntityFramework" version="6.1.3" targetFramework="net452" />
  <package Id="jQuery" version="1.10.2" targetFramework="net452" />
  <package Id="jQuery.ValIdation" version="1.11.1" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.Agent.Intercept" version="1.2.1" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.DependencyCollector" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.JavaScript" version="0.22.9-build00167" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.Web" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.WindowsServer" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.0.0" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net452" />
  <package Id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.CodeDom.ProvIders.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
  <package Id="Microsoft.jQuery.Unobtrusive.ValIdation" version="3.2.3" targetFramework="net452" />
  <package Id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
  <package Id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.MicrosoftAccount" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Owin.Security.Twitter" version="3.0.1" targetFramework="net452" />
  <package Id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
  <package Id="Modernizr" version="2.6.2" targetFramework="net452" />
  <package Id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
  <package Id="Owin" version="1.0" targetFramework="net452" />
  <package Id="Respond" version="1.2.0" targetFramework="net452" />
  <package Id="WebGrease" version="1.5.2" targetFramework="net452" />
</packages>

All of the Id fields seem to be intact. A Google search returns nothing for "null or empty package id".

A: Try to change all Id to id (lower case). It solved for me.

A: I had the same Problem , strangely this is what happened to packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package MovieID="Antlr" version="3.5.0.2" targetFramework="net472" />
  <package MovieID="bootstrap" version="3.4.1" targetFramework="net472" />
  <package MovieID="jQuery" version="3.3.1" targetFramework="net472" />
  <package MovieID="jQuery.ValiMovieIDation" version="1.17.0" targetFramework="net472" />
  <package MovieID="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net472" />
  <package MovieID="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net472" />
  <package MovieID="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net472" />
  <package MovieID="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net472" />
  <package MovieID="Microsoft.CodeDom.ProvMovieIDers.DotNetCompilerPlatform" version="2.0.0" targetFramework="net472" />
  <package MovieID="Microsoft.jQuery.Unobtrusive.ValaMovieIDation" version="3.2.11" targetFramework="net472" />
  <package MovieID="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net472" />
  <package MovieID="Modernizr" version="2.8.3" targetFramework="net472" />
  <package MovieID="Newtonsoft.Json" version="11.0.1" targetFramework="net472" />
  <package MovieID="WebGrease" version="1.6.0" targetFramework="net472" />
</packages>

notice that all d letters turn into MovieID
I think it's a bug , I'm using VS community 2019 the latest version
you can fix it manually

A: My guess this ocurred due to resharper or some simillar tool. Initially I renamed variable name and resharper applied it to all files in project, even packages.config.
So it is better to look after this feature :)
Renaming back to id solved this problem


text:
Q: OneLogin - How can I retrieve user password needed for 3rd party API calls? We're using OneLogin w/Active Directory to achieve Single Sign On with a SAML enabled 3rd party application.  We would additionally like to perform API calls related to the 3rd party app.  The API calls require a 'basic authentication' header which depend on the 3rd party app's username and password being available.  Is it possible to retrieve the username/password information through OneLogin for a SAML integrated application?
From what I understand, apps integrated via SAML or OAuth do not store their passwords with OneLogin.  Which means I cannot look them up in our integrated Active Directory (they would be encrypted anyway).  However... if during user provisioning, I were to force all 3rd party accounts to have the same username/password as the OneLogin account... might that work?
Any assistance or suggestions would be appreciated.  I have some flexibility to work with here as we have not yet created any OneLogin or 3rd party accounts.

A: Passwords are not provided by the SAML protocol.
You will find this thread interesting:

*

*SAML assertion with username/password - what do the messages really look like?
Alternatives:

*

*Use SAML on the API calls (Oauth2 SAML2 token).

*When provisioning the user account on the 3rd party app, force the user to set a local password to be used on the API calls.


text:
Q: Bower troubles - Node.js I'm working on my first webapp using node.js. I am having some trouble trying to install bower.
User@Users-MacBook-Pro-2 my-application (master) $ npm install -g bower
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/bower/node_modules'
npm ERR! error rolling back  bower@1.3.5 { [Error: EACCES, unlink '/usr/local/lib/node_modules/bower/node_modules']
npm ERR! error rolling back   errno: 3,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/bower/node_modules' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/bower/node_modules'
npm ERR!  { [Error: EACCES, unlink '/usr/local/lib/node_modules/bower/node_modules']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/bower/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/bower/node_modules'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/User/workspace/my-application/npm-debug.log
npm ERR! not ok code 0
User@Users-MacBook-Pro-2 my-application (master) $
I've tried using sudo (which of course is not the optimal solution), but that doesn't solve the problem for me. I've also searched around for other solutions (Bower Installation Errors), but nothing has worked so far. Does anyone know how I can solve this issue?

Thanks for your time!

--EDIT-- Using sudo I get the following:

User@Users-MacBook-Pro-2 my-application (master) $ sudo npm install -g bower
Password:
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/bower-config
npm http GET https://registry.npmjs.org/archy
npm http GET https://registry.npmjs.org/bower-endpoint-parser
npm http GET https://registry.npmjs.org/bower-logger
npm http GET https://registry.npmjs.org/bower-json
npm http GET https://registry.npmjs.org/bower-registry-client
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/cardinal
npm http GET https://registry.npmjs.org/chmodr
npm http GET https://registry.npmjs.org/decompress-zip
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/fstream-ignore
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/handlebars
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/insight
npm http GET https://registry.npmjs.org/is-root
npm http GET https://registry.npmjs.org/junk
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/lockfile
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mout
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/opn
npm http GET https://registry.npmjs.org/osenv
npm http GET https://registry.npmjs.org/p-throttler
npm http GET https://registry.npmjs.org/promptly
npm http GET https://registry.npmjs.org/retry
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/request-progress
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/shell-quote
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/stringify-object
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/tmp
npm http GET https://registry.npmjs.org/update-notifier
npm http GET https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/bower-config
npm http 304 https://registry.npmjs.org/archy
npm http 304 https://registry.npmjs.org/bower-logger
npm http 304 https://registry.npmjs.org/bower-endpoint-parser
npm http 304 https://registry.npmjs.org/bower-json
npm http 304 https://registry.npmjs.org/bower-registry-client
npm http 304 https://registry.npmjs.org/cardinal
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/chmodr
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/fstream-ignore
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/handlebars
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/insight
npm http 304 https://registry.npmjs.org/junk
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/lockfile
npm http 304 https://registry.npmjs.org/decompress-zip
npm http 304 https://registry.npmjs.org/mout
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/opn
npm http 304 https://registry.npmjs.org/osenv
npm http 304 https://registry.npmjs.org/p-throttler
npm http 304 https://registry.npmjs.org/promptly
npm http 304 https://registry.npmjs.org/retry
npm http 304 https://registry.npmjs.org/is-root
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/request-progress
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/shell-quote
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/stringify-object
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/tmp
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/strip-ansi
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/lodash.debounce
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/object-assign
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/strip-ansi
npm http GET https://registry.npmjs.org/throttleit
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/object-assign
npm http 304 https://registry.npmjs.org/async
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/mout/time.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/mout/time.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/mout/time.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/bower/node_modules/.bin'
npm ERR! error rolling back  bower@1.3.5 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/bower/node_modules/.bin']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/bower/node_modules/.bin' }
npm ERR! Error: No compatible version found: chalk@'^0.4.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0"]
npm ERR!     at installTargetsError (/usr/local/Cellar/node/0.10.15/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR!     at /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/lib/cache.js:638:10
npm ERR!     at RegClient.get_ (/usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:105:14)
npm ERR!     at RegClient.<anonymous> (/usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:41:12)
npm ERR!     at fs.js:266:14
npm ERR!     at /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:103:5
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/bower/node_modules/semver'
File exists: /usr/local/lib/node_modules/bower/node_modules/semver
Move it away, and try again.

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/semver
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/semver/semver.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/throttleit
npm ERR! Error: ENOENT, chown '/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/bower/node_modules/tmp/test'
File exists: /usr/local/lib/node_modules/bower/node_modules/tmp/test
Move it away, and try again.

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/tmp/test
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/tmp/test/graceful.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/extractors.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/extractors.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/decompress-zip/lib/extractors.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/lodash.debounce
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/bower-json/test/test.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/bower-json/test/test.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/bower-json/test/test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/inquirer/lib/prompts/checkbox.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/inquirer/lib/prompts/checkbox.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/inquirer/lib/prompts/checkbox.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/retry/test/integration/test-retry-operation.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/read
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/fstream/lib/dir-writer.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/fstream/lib/dir-writer.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/fstream/lib/dir-writer.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/configstore
npm http 304 https://registry.npmjs.org/configstore
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/request/request.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/request/request.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/request/request.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/q/q.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/q/q.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/q/q.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/lodash.isfunction
npm http GET https://registry.npmjs.org/lodash.isobject
npm http GET https://registry.npmjs.org/lodash.now
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/bower/node_modules/handlebars/dist/handlebars.amd.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.15/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/User/workspace/my-application
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /usr/local/lib/node_modules/bower/node_modules/handlebars/dist/handlebars.amd.js
npm ERR! fstream_path /usr/local/lib/node_modules/bower/node_modules/handlebars/dist/handlebars.amd.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/read
npm http 304 https://registry.npmjs.org/uuid
npm http 304 https://registry.npmjs.org/lodash.now
npm http 304 https://registry.npmjs.org/lodash.isobject
npm http GET https://registry.npmjs.org/mute-stream
npm http 304 https://registry.npmjs.org/lodash.isfunction
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/lodash._isnative
npm http GET https://registry.npmjs.org/lodash._objecttypes
npm http 304 https://registry.npmjs.org/mute-stream
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/aws-sign
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/lodash._isnative
npm http 304 https://registry.npmjs.org/lodash._objecttypes
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/underscore
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/User/workspace/my-application/npm-debug.log
npm ERR! not ok code 0
User@Users-MacBook-Pro-2 my-application (master) $

I updated node, using the instructions here
Now, however, npm does not seem to be working. Every time I use the npm command I get the following error thrown back at me:
User@Userss-MacBook-Pro-2 my-application (master) $ sudo npm install nodejs-inherits*

module.js:340
    throw err;
      ^
Error: Cannot find module 'abbrev'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:10:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
User@Users-MacBook-Pro-2 my-application (master) $

A: Try uninstalling and updating node. That did it for me.


text:
Q: React-Widgets DateTimePicker: Prevent keyboard input or copy pasting I am trying to use the DateTimePicker component from react-widgets
Is it possible to disable keyboard input (and copy pasting) for the DateTimePicker input field and only constrain dropdown selection.
The disable API disables everything, including the dropdown selection menu. My intent is to constraint which values the user is allowed to select, and I can only do it from the dropdown menu.

A: Try this:
<DateTimePicker
  inputProps={{
    component: props => <input {...props} readOnly />
  }}
/>

There's an active issue in react-widgets
repo to allow to set readOnly for just the input, which would accomplish this task more elegantly.

A: I solved it by handling onChangeRaw that listens for changes on the input and setting the current field value to empty string.
<DatePicker
  value={this.state.startDate}
  onChangeRaw={event =>
      this.setState({startDate: ''})}
  onChange={value =>
      this.setState({startDate: value})}
/>


text:
Q: Android Studio slow download during setup I wanted to install Android Studio as I'm new to Android programming but after initial install, it downloads the packages sooooo slowly compared to normal downloads on my home internet.
Things I've tried:

*

*installing packages through the SDK manager but the download speed is the same, reporting 10KB/s.

*these old answers: Slow SDK download through Android SDK manager

*placing my PC in my routers DMZ

*removing my router to directly connect to my modem

*other compters
Is there a completely offline install for Android studio, like other software (i.e. Google Chrome)? Then I could use a download manager to get it quickly.

A: Sometimes the slowness is also related to antivirus.
In my case, Java Platform was doing all the download process in the background when using Android SDK Manager.

If someone is experiencing a slow download, an alternative is forcing Android SDK Manager to use http connection and not https.
The download process itself is really annoying, takes forever anyway as we can notice. There should be mirrors for those files to accelerate this download process.

A: Disable https AND disable use cache solved the problem for me

A: Copy the download link
And paste it in chrome's address bar if you have IDM it it will ask you to download it.

A: Check on "force https" in the SDK Manager settings.

A: i tried many options. but my speed was limited always.
so i directly download the missing tools from internet (with my max speed possible) and placed it with the installation files.
to know the files missing, i tried to open it without internet connection and it showed me some missing tools. so i manually downloaded it from internet.


text:
Q: How to strip quotes from the script arguments in batch files? Suppose you're writing a Batch script in which you want to strip the quotes from a string.
If the string is stored in a regular Batch variable, you would do this:
set name="John"
echo %name:"=%

If the string is stored in a positional parameter, you would do this:
echo %~1

How would you go about achieving the same effect for script arguments, specifically the %* variable? When I try to use the same notation I use for positional paramters, I get this:
> echo echo %~* > script.cmd

> script "123" "456"
The following usage of the path operator in batch-parameter
substitution is invalid: %~*

For valid formats type CALL /? or FOR /?
script was unexpected at this time.

How can I make this work? Is there any special syntax for this that I'm not aware of? Any help would be appreciated, thanks!

A:
Suppose you're writing a Batch script in which you want to strip the quotes from a string.
If the string is stored in a regular Batch variable, you would do this:
set name="John"
echo %name:"=%

Your assertion is incorrect.  A better convention when working with string values is always to set "variable=value" with the "variable=value" pair quoted, then add quotation marks explicitly when needed upon retrieval, rather than upon assignment.  For example:
@echo off
setlocal

set "xml=<node>Text</node>"
for /f "tokens=2 delims=<>" %%I in ("%xml%") do echo Text: %%I

And thus, the quotation marks are not included in the variable value, but whatever special characters are quoted avoid being interpreted inappropriately.  Even though this isn't really what you're asking, it's still a fundamental convention that's worth practicing.

If the string is stored in a positional parameter, you would do this:
echo %~1
How would you go about achieving the same effect for script arguments, specifically the %* variable?

True, you can use tilde notation for individual arguments with a numeric index, but not for the %* collection.  To solve your riddle, you'd have to iterate through %* either with a for...in or shift...goto loop.  for...in is the more efficient choice.  Here's one of a hundred possible paths to a working solution.
@echo off
setlocal enabledelayedexpansion

set "argv[0]=%~0"
set idx=1

for %%I in (%*) do (
    set "argv[!idx!]=%%~I"
    set /a ubound = idx, idx += 1
)

for /L %%I in (0,1,%ubound%) do echo %%I: !argv[%%I]!

rem // or you could also:
rem // set argv[


text:
Q: Two Javascript unable to create two iframes , only last javascript creating iframe I have these two scripts for creating iframe on page dynamically, but only last one works, but if I use them each on separate page both work fine.
<script id='vr_NTgtLxxx'>
window.options = {
    api_key: 'NTgtLxxx',
    height: '100%',
    width: '100%',
    min_height: '1000px'
};
var s = document.createElement('script');
s.src = "http://www.example.com/embed.js";
s.async = true;
document.body.appendChild(s);
</script>

<script id='vr_My0tNxxx'>
window.options_search = {
    api_key_search: 'My0tNxxx',
    height: '100%',
    width: '100%',
    min_height: '1000px',
    'title': 'search'
};
var sa = document.createElement('script');
sa.src = "http://www.example.com/embed-search.js";
sa.async = true;
document.body.appendChild(sa);
</script>

Here is the iframe building code

window.onload=function(){
        var container_s=document.createElement("div");
            container_s.setAttribute("id", "div_");

        var span_s =document.createElement("span_s");
            span_s.setAttribute("id", "span_s_");
            span_s.style.fontFamily="arial";
            span_s.style.fontWeight="bold";
            span_s.style.textAlign="center";
            span_s.style.display ="Block";

        var loader_message_s = document.createTextNode("....");
            span_s.appendChild(loader_message_s);
            container_s.appendChild(span_s);

        var ifrm_s = document.createElement("iframe");
        ifrm_s.setAttribute("src","SRC_URL");
        ifrm_s.style.width = "100%";
        ifrm_s.style.minHeight = "1000px";
        ifrm_s.frameBorder=0;
        if(window.options_search.width){
            ifrm_s.style.width = window.options_search.width;
        }
        ifrm_s.style.height = "100%";
        if(window.options_search.height){
            ifrm_s.style.height = window.options_search.height;
        }
        if(window.options_search.min_height){
            ifrm_s.style.minHeight  = window.options_search.height;
        }

        if(window.options_search.border){
            ifrm_s.style.border = window.options_search.border;
        }
        ifrm_s.setAttribute("id", key_search_s);
        ifrm_s.setAttribute("onload", 'frameload_s("span_s_'+key_search_s+'")');
        container_s.appendChild(ifrm_s);
        var s_s = document.getElementById("vr_"+key_search_s);
        s_s.parentNode.insertBefore(container_s, s_s);
}

Here I have added code for creating iframe

A: The issue relays in overriding window.onload function definition. Use addEventListener(event, callback) instead.
Here's a simplified example reducing the same problems.

window.onload = function(){
  console.log('Window loaded #1'); // Will not excecute
}
window.onload = function(){
  console.log('Window loaded #2'); // Window loaded #2
}

Working solution using addEventListener

window.addEventListener('load', function(){
    console.log('Window loaded #1'); // Window loaded #1
});
window.addEventListener('load', function(){
    console.log('Window loaded #2'); // Window loaded #2
});


text:
Q: How can I plot a list of numpy arrays on subplots in one Figure? I have a list of NumPy arrays given below
score_list=[[**0.9442483660130718**, 0.957908496732026, 0.9499346405228758,
0.9475163398692809, 0.6247058823529412, 0.9475816993464052],
[**0.9420261437908496**, 0.9638562091503268, 0.9407189542483659, 0.9415686274509802,
0.6270588235294118, 0.951111111111111],
[**0.9396078431372549**, 0.9602614379084967, 0.9451633986928104, 0.9486928104575162,
0.6271241830065359, 0.9534640522875816],
[**0.944313725490196**, 0.960326797385621, 0.9404575163398691, 0.9485620915032679,
0.6235947712418302, 0.9487581699346406],
[**0.9431372549019608**, 0.9591503267973855, 0.9452287581699346, 0.9523529411764704,
0.6270588235294118, 0.9511111111111111],
[**0.9384967320261437**, 0.9614379084967319, 0.9463398692810456, 0.9486928104575163,
0.6247058823529412, 0.9546405228758169],
[**0.9454901960784313**, 0.9615686274509803, 0.9452287581699345, 0.9486928104575163,
0.6224183006535948, 0.9534640522875816],
[**0.9407189542483659**, 0.9591503267973855, 0.9428104575163396, 0.9475816993464052,
0.6258823529411766, 0.9534640522875816],
[**0.9442483660130719**, 0.9661437908496733, 0.9439869281045752, 0.9415686274509802,
0.6235947712418302, 0.9569934640522875],
[**0.9442483660130718**, 0.9580392156862745, 0.9440522875816992, 0.9474509803921568,
0.6247712418300654, 0.951111111111111]]

I converted the Numpy array to a dataframe to get:
       0         1         2         3         4         5
0  0.944248  0.957908  0.949935  0.947516  0.624706  0.947582
1  0.942026  0.963856  0.940719  0.941569  0.627059  0.951111
2  0.939608  0.960261  0.945163  0.948693  0.627124  0.953464
3  0.944314  0.960327  0.940458  0.948562  0.623595  0.948758
4  0.943137  0.959150  0.945229  0.952353  0.627059  0.951111
5  0.938497  0.961438  0.946340  0.948693  0.624706  0.954641
6  0.945490  0.961569  0.945229  0.948693  0.622418  0.953464
7  0.940719  0.959150  0.942810  0.947582  0.625882  0.953464
8  0.944248  0.966144  0.943987  0.941569  0.623595  0.956993
9  0.944248  0.958039  0.944052  0.947451  0.624771  0.951111

This is my python code:
sizes = np.arange(10,110,10)
plt.plot(sizes, score_list, 'o-', color="blue", label="Scores",
     linestyle = '--')

plt.legend()
plt.show()

The code is plotting all the arrays on a single plot (see pictureenter image description here
I want to generate a line plot for each array in the list such that the value in the first position of each array is plotted on the first figure in the subplot (as bolded in the numpy array). Also, the value in the second position of each array is plotted in the second figure in the subplot, and others as well. For instance, in the attached image, I want to plot each line on subplots(2,3), all in a figure.


text:
Q: how to permanently disable ubuntu updates & hide install updates button pic included how to permanently disable ubuntu updates pop up & hide or remove Install Updates button pic included see below:

A: To disable the update notifier, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
gconftool -s --type bool /apps/update-notifier/auto_launch false

Note: Keep in mind that doing so won't keep your system updated with security and other important updates.
To disable updates, in terminal do:
sudo gedit /etc/apt/apt.conf.d/10periodic

When it opens change the "1" to "0" as shown in the image below, and

Then change the Automatically Check for Updates to "Never" as shown in the image below.

Source for the last part complements of Guillermo G.


text:
Q: maven-help-plugin:evaluate with 'project.groupId' expression give back 'org.apache.maven' instead of 'com.myproject' without error code I would like use maven-help-plugin:3.2.0:evaluate to grab information from my pom project, but the result was not what I expected.
Please read the edit at the end!
I try to use it after checkout an existing git branch.
Usually it works on most project, first time I hasn't got any solution...
Search in the web give me about 900 result, so I haven't any idea now.
I try it with maven 3.6.2 with AdoptOpenJDK Java 11
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId
expected myartifact, but got standalone-pom
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.groupId
expected com.myproject, but got org.apache.maven
mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId
expected 1.0.0-SNAPSHOT, but got 1
Has anyone any idea?
My pom.xml listed bellow, I don't use parent pom in this project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.myproject</groupId>
    <version>1.0.0-SNAPSHOT</version>
    <artifactId>myartifact</artifactId>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
    </properties>

            <!--
    <distributionManagement>
    ... my dmans
    </distributionManagement>
            -->

            <!--
    <repositories>
    ... my repos
    </repositories>
            -->

    <build>
        <plugins>

            <!--
            <plugin>
            ... my plugins which not in org.apache.maven
            </plugin>
            -->

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.5</version>
                <configuration>
                    <append>true</append>
                </configuration>
                <executions>
                    <execution>
                        <id>before-unit-test-execution</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${sonar.jacoco.reportPath}</destFile>
                            <propertyName>surefire.jacoco.args</propertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <skipTests>${skip.surefire.tests}</skipTests>
                    <groups>unit</groups>
                    <systemProperties>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    </systemProperties>
                    <argLine>-Xmx2048m -XX:MaxPermSize=256m ${surefire.jacoco.args}</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

EDIT:
The original problem was solved because the branch name was wrong.
So the right question is: Why run Maven with this result, and why don't stop with error exit code?
Thanks

A: Sorry guys it was my fault.
The examinated branch was misspelled in the citated project, and I haven't see the whole error log in that environment.
But I dont'know why run maven without error exit code in that case...


text:
Q: When do I need android.hardware.location.gps and android.hardware.location.network? Google is informing by email of changes to the Android location permissions:

We're making a change on October 15th, 2016 that will affect apps
targeting API version 21 (Android 5.0, Lollipop) or higher that use
ACCESS_FINE_LOCATION but don't explicitly have the
"android.hardware.location.gps" uses-feature. Going forward, these
apps will be available to install on devices that don't have GPS
hardware. In most cases this won't be an issue since Wi-Fi and Cell-ID
based location provides high enough fidelity for the typical operation
of these apps. However, any apps that require GPS hardware, such as
GPS navigators, should explicitly add the
"android.hardware.location.gps" uses-feature to their manifest.
If your app requires GPS to function properly and you do not include
in your manifest declaration, your users may have a poor app
experience.
Also, if you're using the fused location provider and wish to receive
the most accurate location samples from GPS (i.e. with
PRIORITY_HIGH_ACCURACY), you must include the
"android.hardware.location.gps" feature in your app's manifest to
ensure that Google Play only distributes your app to devices with GPS
sensors.
You can read more about this change in the Android Developers Help
Center.

From the Android Developers Help Center

In order to receive location updates from NETWORK_PROVIDER or GPS_PROVIDER, you must request the user's permission by declaring either the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission, respectively, in your Android manifest file. Without these permissions, your application will fail at runtime when requesting location updates.
If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the ACCESS_FINE_LOCATION permission, because it includes permission for both providers. Permission for ACCESS_COARSE_LOCATION allows access only to NETWORK_PROVIDER.
Caution: If your app targets Android 5.0 (API level 21) or higher, you must declare that your app uses the android.hardware.location.network or android.hardware.location.gps hardware feature in the manifest file, depending on whether your app receives location updates from NETWORK_PROVIDER or from GPS_PROVIDER. If your app receives location information from either of these location provider sources, you need to declare that the app uses these hardware features in your app manifest. On devices running verions prior to Android 5.0 (API 21), requesting the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission includes an implied request for location hardware features. However, requesting those permissions does not automatically request location hardware features on Android 5.0 (API level 21) and higher.

I am using the fused location provider, targeting API 21, and using ACCESS_FINE_LOCATION. I don't specifically care whether GPS is available, only that the most accurate location is reported.

*

*Based on the first quotation, I think I do not have to make any changes.

*Based on the second quotation, I think I need both android.hardware.location.gps and android.hardware.location.network. Or is this only for LocationManager and not fused location?

Do I need android.hardware.location.gps and android.hardware.location.network or not?

A: From my understanding, it is sufficient to read the documentation for the uses-feature element to understand how applications are filtered in Google Play based upon implicit and explicit uses-feature entries:

Google Play filters the applications that are visible to users, so that users can see and download only those applications that are compatible with their devices. One of the ways it filters applications is by feature compatibility.
To determine an application's feature compatibility with a given user's device, Google Play compares:
Features required by the application — an application declares features in  elements in its manifest
  with...
  Features available on the device, in hardware or software — a device reports the features it supports as read-only system properties.

...

If a feature is explicitly declared as being required, Google Play adds the feature to the list of required features for the application. It then filters the application from users on devices that do not provide that feature.
If a feature is explicitly declared as not being required, Google Play does not add the feature to the list of required features. For that reason, an explicitly declared non-required feature is never considered when filtering the application. Even if the device does not provide the declared feature, Google Play will still consider the application compatible with the device and will show it to the user, unless other filtering rules apply.

The implicit uses-feature items for location permissions are:
ACCESS_COARSE_LOCATION

*

*android.hardware.location

*android.hardware.location.network (Only when target API level is 20 or lower.)

ACCESS_FINE_LOCATION

*

*android.hardware.location

*android.hardware.location.gps (Only when target API level is 20 or lower.)

The change described in Google's email message is that the implicit uses-feature items for android.hardware.location.gps will not be present in API 21+ with ACCESS_FINE_LOCATION. The analogous situation appears to be true for ACCESS_COARSE_LOCATION and android.hardware.location.network.
Google encourages explicit enumeration of all uses-feature entries, but still provides implicit entries based on permissions. From the following documentation excerpt, I think there is no difference between omitting a uses-feature and declaring it not required, unless there is an implicit uses-feature entry.

If a feature is explicitly declared as not being required, Google Play does not add the feature to the list of required features.

Your application's use case determines what uses-feature entries should be present. Here are some example use cases, with all uses-feature entries being required unless otherwise stated:

*

*Application uses GPS explicitly from LocationManager or application needs GPS' high accuracy. This is the example given in Google's email.

*

*ACCESS_FINE_LOCATION

*android.hardware.location (implicit)

*android.hardware.location.gps (implicit up to API 20)

*Uses Network location explicitly

*

*ACCESS_COARSE_LOCATION

*android.hardware.location (implicit)

*android.hardware.location.network (implicit up to API 20)

*Uses both GPS and Network

*

*ACCESS_FINE_LOCATION

*android.hardware.location (implicit)

*android.hardware.location.gps (implicit up to API 20)

*android.hardware.location.network

*Uses at least one of GPS and Network. This is my FusedLocationProviderApi case in the original question.

*

*ACCESS_FINE_LOCATION/ACCESS_COARSE_LOCATION

*android.hardware.location (implicit)

*Uses location if available, still allows application installation if not available

*

*ACCESS_FINE_LOCATION

*android.hardware.location required=false (override implicit)

*android.hardware.location.gps required=false (override implicit up to API 20)

A: The second quotation is telling you that you need either android.hardware.location.network or android.hardware.location.gps, if you specifically need one or the other location provider.
If you want updates via GPS, you need android.hardware.location.gps.
If you want updates via the WiFi and cellular networks, you need android.hardware.location.network.
If you want updates from both the network and GPS, you should include both <uses-feature> elements.
If you don't specify either, your device may be installed on devices without that provider. For example, it may be installed on a device without a GPS, cellular network, or Wi-Fi chip.
In other words, getting location requires either the network location feature or the GPS feature. If you don't declare that your application needs one or the other, you may not get location updates at all.
API 21 vs 20 and below
Note that the above is only true for API 21 and above.
Prior to API 21, requesting the ACCESS_COARSE_LOCATION permission implied the location.network feature, wheras requesting ACCESS_FINE_LOCATION implied the location.gps feature (see <uses-feature>).
The only change right now is that, for API 21+, any app requesting ACCESS_FINE_LOCATION will soon be available to install on devices without GPS. If your app previously assumed GPS was available (and needs GPS), you need to make sure you have the explicit request for android.hardware.location.gps.
Google says that network location providers are now good enough for a fine location, thus, the change.

A: TL;DR: No, you don't have to add uses-feature to your manifest, but depending, you might.
complete answer:
uses-feature of the manifest is only so that Google Play can filter out devices that does not contain a feature that is necessary for the application to execute correctly. (Examples are GPS for a turn-by-turn navigation app, or Camera for a camera app).
Read carefully this quote:

any apps that require GPS hardware, such as GPS navigators, should explicitly add the "android.hardware.location.gps" uses-feature to their manifest
(...)
and wish to receive the most accurate location samples from GPS

As you mention, you only care that the FusedLocationProvider gives you the best location available to the device is installed. That means, even though you're requesting PRIORITY_HIGH_ACCURACY, your app might get installed on devices that does not contain GPS and will never get a location as accurate as a GPS, or maybe even (in some very rare odd case), be installed on device that does not contain any location provider.
edit:

Based on the second quotation, I think I need both android.hardware.location.gps and android.hardware.location.network. Or is this only for LocationManager and not fused location?

I just went digging on the docs https://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features and found it very interesting, there're 3 possibilities:

*

*android.hardware.location

*android.hardware.location.gps

*android.hardware.location.network

so based on that, if your application cannot work without any form of location you should use the first one android.hardware.location, else, if your app uses location but it's not essential to its funcionality, you can be free to not include anything

A: Quick and simple solution:
App needs to updates via GPS use android.hardware.location.gps.
If you want updates via the WiFi and cellular networks, you need android.hardware.location.network.
Add below lines to your manifests file based on your location data requirements:
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />

Hope this helps..

A: On your first point:

Based on the first quotation, I think I do not have to make any
  changes.

You don't need to make any changes because you are using FusedLocation which automatically detects GPS  and NetworkProvider as per availability and gives you the best estimate location (You need to add ACCESS_FINE_LOCATION permission to get High Accuracy). So even if you're targeting API above 21 you don't need to change anything in your app -FusedLocation will work as before.
And on your second point:

Based on the second quotation, I think I need both android.hardware.location.gps and android.hardware.location.network. Or is this only for LocationManager and not fused location?

You just need to ignore it because you're using FusedLocation API and you are not using LocationManager API which you replaced by FusedLocation. So second Quotation is only for apps which use LocationManagar.
NETWORK_PROVIDER and GPS_PROVIDER are part of LocationManager Not FusedLocation API

A: Yes you need both the permissions if you are using fused provider.
ACCESS_COARSE_LOCATION - To receive location updates from NETWORK_PROVIDER. Adding android.hardware.location.network feature permission is enough.
ACCESS_FINE_LOCATION   - To receive location updates from both NETWORK_PROVIDER and GPS_PROVIDER. You should add both android.hardware.location.gps and android.hardware.location.network feature permissions. Applicable for also fused location.


text:
Q: Elasticsearch query using NEST & QueryRaw I have the following Elastic Search query:
 {
    "query": {
        "filtered": {
            "query": {
                "multi_match": {
                    "query": "main",
                    "type": "cross_fields",
                    "fields": [
                        "field1^5",
                        "test",
                        "field2",
                        "abc"
                    ],
                    "operator": "and"
                }
            }
        }
    },
    "sort": [],
    "from": 0,
    "size": 20
}

I am trying to run this query using NEST client for Elastic Search & using "QueryRaw" attribute but getting Error.
Can someone please provide some input where I am going wrong
var uri = new Uri("Elastic_Search_Cluster_Name");
var settings = new ConnectionSettings(uri, defaultIndex: "testIndex");
var client = new ElasticClient(settings);
var resp=client.Search<dynamic>(q =>
q.Type("mappingType").QueryRaw(inputRequest.ToString())
);

Error Log:
Failed to execute phase [query], all shards failed; shardFailures {[27THF3S_QuaBLRj11MgqfA][testIndex][0]: RemoteTransportException[[pdm64-ironman][inet[/server]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[testIndex][0]: query[abc:main field2:main test:main field1:main^5.0],from[-1],size[-1]: Parse Failure [Failed to parse source [{
  "query": {
  "filtered": {
    "query": {
      "multi_match": {
        "query": "main",
        "type": "cross_fields",
        "fields": [
          "field1^5",
          "test",
          "field2",
          "abc"
        ],
        "operator": "and"
      }
    }
  },
  "sort": [],
  "from": 0,
  "size": 20
}
}]]]; nested: ElasticsearchParseException[Expected field name but got START_ARRAY "sort"]; }{[b5YxyDCcQEmSlCd9y3Sfww][testIndex][1]: RemoteTransportException[[pdm65-hulk][inet[/server]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[testIndex][1]: query[abc:main field2:main test:main field1:main^5.0],from[-1],size[-1]: Parse Failure [Failed to parse source [{
  "query": {
  "filtered": {
    "query": {
      "multi_match": {
        "query": "main",
        "type": "cross_fields",
        "fields": [
          "field1^5",
          "test",
          "field2",
          "abc"
        ],
        "operator": "and"
      }
    }
  },
  "sort": [],
  "from": 0,
  "size": 20
}
}]]];

A: The entire search request cannot be passed into QueryRaw. You can only pass the JSON request that is supposed to be included inside a "query" object into QueryRaw. Hence if you pass the below JSON body into QueryRaw it should work.
{
   "filtered": {
      "query": {
         "multi_match": {
            "query": "main",
            "type": "cross_fields",
            "fields": [
               "field1^5",
               "test",
               "field2",
               "abc"
            ],
            "operator": "and"
         }
      }
   }
}

But "sort", "from" and "size" objects are not inside "query" and hence Nest fails to parse your request.
What your Nest code should look like is as below:
var uri = new Uri("Elastic_Search_Cluster_Name");
var settings = new ConnectionSettings(uri, defaultIndex: "testIndex");
var client = new ElasticClient(settings);
var resp = client.Search<dynamic>(q => q
    .Type("mappingType")
    .QueryRaw(<raw query string>)
    .From(0)
    .Size(20)
);

I left out Sort() in the above Nest search request because you were not doing anything with it anyways.


text:
Q: Rails 4 + Sprockets: Allowing the use of js.erb files I am attempting to use ES6 syntax in my Rails 4 app and have had some success between the use of sprockets-es6 (0.9.2), sprockets-rails (3.0.4) and sprockets (3.6.0).
The only issue I'm having is that my files need to end in .es6 in order to enable proper compilation and I'd like to be able to use a .es6.erb or .js.erb file type to allow me to use embedded ruby <%= foo %>.
Does anyone know of a way around this?

A:
This question is a few years old and the OP specifies Sprockets 3.6. But I'm guessing many will find this question when looking for a solution to using erb files with a more modern version of sprockets.

If you're using Sprockets 4 and want to use .js.erb you'll need to 'register_mime_type'.
e.g. add the following to a new file called ./config/initializer/register_mime_type.rb
Sprockets.register_mime_type 'application/javascript', extensions: ['.js.erb']

This is described in Extending Sprockets.


text:
Q: Sum values of array with same key and values I'm trying to sum a value of an array with the same employee no.
Here's the example of the array I'm trying to sum.
0 => array:10 [▼
    "employee_no" => "04052018"
    "employee_id" => 317
    "company_id" => 4
    "name" => ""
    "monthly_salary" => 14000.0
    "daily_salary" => 537.0
    "work_hours" => 8
    "sss_deduction" => 0
    "pagibig_deduction" => 100
    "philhealth_deduction" => 192

and
0 => array:10 [▼
"employee_no" => "04052018"
"employee_id" => 317
"company_id" => 4
"name" => ""
"monthly_salary" => 14000.0
"daily_salary" => 537.0
"work_hours" => 8
"sss_deduction" => 0
"pagibig_deduction" => 100
"philhealth_deduction" => 192

they are duplicates array in which i want to get the sum of work hours only to have this result
0 => array:10 [▼
"employee_no" => "04052018"
"employee_id" => 317
"company_id" => 4
"name" => ""
"monthly_salary" => 14000.0
"daily_salary" => 537.0
"work_hours" => 16
"sss_deduction" => 0
"pagibig_deduction" => 100
"philhealth_deduction" => 192

There are about 24 and more occurrences if this array in my result set in which i want to merge as one summing up the total work hours
Tried this one but getting no luck
foreach ($employee_attendance as $row){

    if($row['employee_id'] === $row['employee_id']){
        $payroll_data['work_hours'] += $row['total_hours'];
    }
    $payroll[] = $payroll_data;
}

A: The best would be to get it sorted out from Eloquent queries itself. However, if you wish, you can also use Collections' methods such as groupBy and each to filter the values based on employee ID and do a sum on them. Finally, have a result variable to store all the results.
Snippet:
$result = [];

$arr = $arr->groupBy('employee_no')->each(function($item,$key) use (&$result){
                $sum = $item->sum('work_hours');
                $emp_data = $item->first();
                $emp_data['work_hours'] = $sum;
                $result[] = $emp_data;
        });

Full Code:
<?php

$arr = collect([
        [
            "employee_no" => "04052018",
            "employee_id" => 317,
            "company_id" => 4,
            "name" => "",
            "monthly_salary" => 14000.0,
            "daily_salary" => 537.0,
            "work_hours" => 8,
            "sss_deduction" => 0,
            "pagibig_deduction" => 100,
            "philhealth_deduction" => 192
        ],
        [
            "employee_no" => "04052018",
            "employee_id" => 317,
            "company_id" => 4,
            "name" => "",
            "monthly_salary" => 14000.0,
            "daily_salary" => 537.0,
            "work_hours" => 8,
            "sss_deduction" => 0,
            "pagibig_deduction" => 100,
            "philhealth_deduction" => 192
        ],
        [
            "employee_no" => "04052019",
            "employee_id" => 317,
            "company_id" => 4,
            "name" => "",
            "monthly_salary" => 14000.0,
            "daily_salary" => 537.0,
            "work_hours" => 80,
            "sss_deduction" => 0,
            "pagibig_deduction" => 100,
            "philhealth_deduction" => 192
        ]
    ]);

    $result = [];

    $arr = $arr->groupBy('employee_no')->each(function($item,$key) use (&$result){
                $sum = $item->sum('work_hours');
                $emp_data = $item->first();
                $emp_data['work_hours'] = $sum;
                $result[] = $emp_data;
           });

    print_r($result);

A: As what others said, it's better to group and sum those work hours when you retrieve it from the database.
But in case you still want to do it like what you explained above, it can be done like this although it might not be the best way
foreach ($employee_attendance as $row){
    // Check if this is the first occurence of the employee number or not
    if (!isset ($payroll_data[$row['employee_no']]['work_hours']) ) {
        // First occurence will set the total hours to the current loop work hours
        $payroll_data[$row['employee_no']]['work_hours'] = $row['work_hours'];
    } else {
        // Second occurence and so on will sum previous total work hours
        $payroll_data[$row['employee_no']]['work_hours'] += $row['work_hours'];
    }
}

And the $payroll_data structure will be like this:
[
    "04052018" => [
        "work_hours" => 16 // Total work hours of this employee number
    ],
    // Repeat for other employee number
]

Hence, it's easier for you to check the employee number with their total working hours as well.


text:
Q: Filter out a member from SSRS (MDX) Ok, So I have a dim called Employee that has Employee_ID and the ID I am trying to filter out from the report table is &[12345].
How would I go about filtering out a record for just that employee ID from my report table?

A: You can use the Except function:
Except('a set that contains employees', {'the employee you want to exclude'})