text:
Q: Dynamic script tag security I am analyzing whether using dynamic script tags to do requests to some third party servers
is a good idea. Stackoverflow and a few other site had a couple of topics about these and I'm still left unsure that it's a good idea.
App is on server B.
Third party API is on server A.
If server B application is pulling server A's javascript API library, which in turn uses dynamic  tags to make calls to server A, I am guessing that the API library and the
returning code from the API itself is still within server B's domain sandbox ?
There are a couple of things I'm thinking of as well:
I am also evaluating whether it's more advisable to actually pull the library code to server B, vet it for security, host the JS source ourselves so that we don't blindly accept it just in case it changes over time.
In addition to that, I would make changes to server A's API library to make calls via our
proxy, which would whitelist domains along with logging every request long with a couple of other things, like making sure that only json and valid json is returned back to the client ...
Obviously I would like to avoid having to deal with this hot potato issue, but the decision to use this API has so far overriden my substantiated or not security worries.
Is there literature that holds weight that supports either side?

A: The domain that is hosting the JavaScript (or json)  has no influence on the Same-Origin Policy.  It is entirely dependent on the domain that loads the script via a <script> tag.    That being said it maybe possible to load JSON from another domain with out their consent,  by using "json callback hackery" .
I am not aware of any attack pattern involved in a client loading malicious JSON.   I can't think of a scenario when this would provide any impact what so ever.  It is a good idea to limit the scope of your proxy with a white list.


text:
Q: Catch all block doesn't catch DirectoryNotFoundException I have received the support ticket that makes me (uncomfortably) numb.
The WPF application has the following code to remove temporary directory:
try
                {
                    Directory.Delete(dir, true);
                }
                catch
                {
                    // ignored
                }

The main window' dispatcher unhandled exception handler just shows the dialog box with the info on exception (including the stack). And here it is:

System.IO.DirectoryNotFoundException: Could not find a part of the
  path 'C:\Users\xxx\AppData\Local\Temp\6\86248143'.    at
  System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.Directory.Delete(String fullPath, String userPath,
  Boolean recursive, Boolean checkHost)    at the method calling
  Directory.Delete

Can anybody point me out why the exception was not caught in the catch all block?

A: Just make sure that CheckBox is not checked. It ignores the try catch blocks and "breaks when that exception type is thrown"
Note; I guess it was Visual Studio.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Get name of test method in setUp (Xcode) I want to append a message to a log that includes the name of the test method that is about to be run. I want to do this in my setUp method in my test superclass so I don't have repeated code everywhere.
I wanted to do something like this:
- (void) setUp {
    [super setUp];
    [self log:@NSStringFromSelector(_cmd)];
}

However, _cmd always gives "setUp" as its string, whereas I want "test00TestTheThing"
Is there a way to do this?

A: Don't know if it's still relevant but if someone needs it:
you can use the self.name and then you'll get the name of the class with the name of the test.
To remove the class name and just stay with the test name, use the replacingOccurrences func
example:
class ClassName: XCTestCase {
    override func setUp() {
      // get the name and remove the class name and what comes before the class name
      var currentTestName = self.name.replacingOccurrences(of: "-[ClassName ", with: "")

      // And then you'll need to remove the closing square bracket at the end of the test name

      currentTestName = currentTestName.replacingOccurrences(of: "]", with: "")
    }

A: I found this:
self.name

However, this gives me "-[AppUITests test00TestTheThing]"


text:
Q: How can I get a PropertyGrid to show a SaveFileDialog? I have a property grid control where I want to be able to display a SaveFileDialog as the user is in the process of exporting data to a new file.  I can easily hook up an OpenFileDialog with a FileNameEditor but there doesn't seem to be an equivalent class for saving files.
Is there an existing class that I can specify in the System.ComponentModel.Editor attribute so that a SaveFileDialog is displayed?

A: This works fine:
public class SaveFileNameEditor: UITypeEditor
{
    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    {
        return UITypeEditorEditStyle.Modal;
    }

    public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
    {
        if (context == null || context.Instance == null || provider == null)
        {
            return base.EditValue(context, provider, value);
        }

        using (SaveFileDialog saveFileDialog = new SaveFileDialog())
        {
            if (value != null)
            {
                saveFileDialog.FileName = value.ToString();
            }

            saveFileDialog.Title = context.PropertyDescriptor.DisplayName;
            saveFileDialog.Filter = "All files (*.*)|*.*";
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                value = saveFileDialog.FileName;
            }
        }

        return value;
    }
}

A: So the object that you set in the propertyGrid1.SelectedObject needs a public property like the following:
            private string _saveFile;
    [BrowsableAttribute(true)]
    [EditorAttribute(typeof(SaveFileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
    public string SaveFileEditorVlad
    {
        get { return _saveFile; }
        set { _saveFile = value; }
    }

in order to make Stewy's answer work :) Then at runtime, when you edit the this property, the ellipsis will show and you'll be able to select a file to Save As.

A: I don't think there is. You will have to write your own editor derived from UITypeEditor. It should not be that difficult.


text:
Q: Windows Form App Crashing With While Loops First of all I would like to apologize for the messy code. Currently in my freshman year of college and had a question neither myself or my friends could figure out. The problem asks to accept an input from the user for dollars and find how many twenties, tens, fives, and ones will add to the least number of bills. Building the solution causes no error, but once ran and data is input it crashes instantly. I tried using the debugger to no avail, as well as changing the code (adding 'if' 'then' statements, etc.) I'm generally new to 'while' loops, and coding in general, so if I am making a stupid mistake feel free to roast me.
Thank you in advanced!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Dollars
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {

    }

    private void btnFindDem_Click(object sender, EventArgs e)
    {
        int twenties;
        int tens;
        int fives;
        int singles;
        int totDollars;
        int sub1;
        int sub2;
        int sub3;
        int sub4;
        totDollars = Convert.ToInt32(txtDollars.Text);
        twenties = 0;
        tens = 0;
        fives = 0;
        singles = 0;
        sub1 = totDollars;
        sub2 = totDollars;
        sub3 = totDollars;
        sub4 = totDollars;
        lstOut.Items.Add("Total dollars = " + totDollars.ToString("c"));
            while (totDollars >= 20)
                {
                    sub1 = sub1 - 20;
                    twenties = twenties + 1;
                }
            while (totDollars >= 10)
                {
                    sub2 = sub2 - 10;
                    tens = tens + 1;
                }
            while (totDollars >= 5)
                {
                    sub3 = sub3 - 5;
                    fives = fives + 1;
                }
            while (totDollars >= 1)
                {
                    sub4 = sub4 - 1;
                    singles = singles + 1;
                }
        lstOut.Items.Add("Twenties: " + twenties);
        lstOut.Items.Add("Tens: " + tens);
        lstOut.Items.Add("Fives: " + fives);
        lstOut.Items.Add("Ones: " + singles);

        }
    }
}

A: You aren't adjusting the value of the variable you are using in the while loop conditions. This:
sub1 = totDollars;
sub2 = totDollars;
sub3 = totDollars;
sub4 = totDollars;
lstOut.Items.Add("Total dollars = " + totDollars.ToString("c"));
    while (totDollars >= 20)
        {
            sub1 = sub1 - 20;
            twenties = twenties + 1;
        }

should be
lstOut.Items.Add("Total dollars = " + totDollars.ToString("c"));
    while (totDollars >= 20)
        {
            totDollars = totDollars - 20;
            twenties = twenties + 1;
        }

and the similar change made to the other while loops

A: First ensure that the value in txtDollars.Text is indeed an integer, or else the program will crash;
The conditions being used by the while loops to continue are never changing.  So the while loop will never end.
while (totDollars >= 20)
{
    sub1 = sub1 - 20;
    twenties = twenties + 1;
}

totDollars never changes, so it'll always be greater than 20 and never end.  The quick way around this is to remove the sub variables like the following.
while (totDollars >= 20)
{
    totDollars = totDollars - 20;
    twenties = twenties + 1;
}

I've also included another version of the method, with some code optimizations. You'll notice the use of the -=, ++, and -- operators. It's really handy to know these.  Also, note there are some neat ways you can declare a variable and set the value in one step.
private void btnFindDem_Click(object sender, EventArgs e)
{
    int twenties = 0,
        tens = 0,
        fives = 0,
        singles = 0,
        totDollars = Convert.ToInt32(txtDollars.Text);
    lstOut.Items.Add("Total dollars = " + totDollars.ToString("c"));
    while (totDollars >= 20)
    {
        totDollars -= 20;
        twenties++;
    }
    while (totDollars >= 10)
    {
        totDollars -= 10;
        tens++;
    }
    while (totDollars >= 5)
    {
        totDollars-= 5;
        fives++;
    }
    while (totDollars >= 1)
    {
        totDollars--;
        singles++;
    }
    lstOut.Items.Add("Twenties: " + twenties);
    lstOut.Items.Add("Tens: " + tens);
    lstOut.Items.Add("Fives: " + fives);
    lstOut.Items.Add("Ones: " + singles);
}


text:
Q:  tag not working in WordPress I am trying to use Trademark & Registered/Copyright symbols smaller in a WordPress site, but doing some of the standard methods for CSS were not working, and using what I have below maybe somebody has an idea on how I could expand.
Traditional/Normal way I would have done this:
Awesomesauce ® would look like Awesomesauce® (the R is smaller than other text).
In the theme I am using, it was not doing that with that tag

I then tried  just see if it would do anything different.  No luck.
So, I then approached it from a JavaScript side of things.
I started with my H1 tag
jQuery(function($){
  var $el = $(".section_header .post_title");
  var t = $el.text();
  t = t.replace('®','®');
  $el.html(t);
});

Since that works, how would I make the same work for body text because I cannot get it to work using the following code
jQuery(function($){
  var $el = $(".wpb_text_column .wpb_wrapper p");
  var t = $el.text();
  t = t.replace('®','®');
  $el.html(t);
});

jQuery(function($){
  var $el = $(".section_header .post_title");
  var t = $el.text();
  t = t.replace('®','®');
  $el.html(t);
});

What the HTML section looks like:

A: It's very normal that WP themes overwrite default browser style.
Try adding this to your custom.css file:
sup {
    vertical-align: super;
    font-size: smaller;
}

If you don't use custom style or child theme (Why use a Child Theme)
Then, add that code at the very bottom of your theme style css file.

A: I don't think that your issue is WordPress not recognizing the "sup" element.  I support a few WordPress sites and "sup" works just fine whenever I use it.  In your case, it appears that you are trying to use javascript (jQuery in particular within your WordPress site.  WordPress does not process javascript reliably when found within a page.  The documentation that I have read states that it is  unsupported to use your own javascript on WordPress pages.  However, I have succeeded in using Javascript in some pages within my WordPress site but with rather inconsistent results overall.  I recommend that you format your text directly within the WordPress WYSIWYG editor as follows:
AWESOMESAUCE®


text:
Q: how to make widgets in c# for desktops apps I am doing a desktop application for calendars,sticky notes,diary,todolist,reminders and sending and receiving e-mail. I want to make a widget for all this.Wiget should also display messages if new mail is received. but i dont know from where to start making a widget.let me know is there are some controls in visual studio to make widgets or not.From where is should start.

A: You're looking for WPF. It's a steep learning curve, but you'll be able to virtually make any app you want. It supports real transparency, you can design the app the way you want without borders. You're looking for Window.WindowStyle = WindowStyle.None. Start from here.
Note that it won't be a 'widget' as the clock widget in Windows 7 for example. You'll make a normal desktop app (.exe) but with special functionality.
Bottom line, you can do that (and more) in WPF but you'll want to be comfortable around it first.


text:
Q: Azure notifications hubs in api net.core 1.1 I'm looking for the entire network and I can not find anything clear.
I would like to know if it is possible to send notifications with the azure client in an api rest created with net.core 1.1.
The notifications of their own should reach the platforms configured in azure portal.
I explain my structure.
1. I have a backen (api) created with net.core 1.1, published in azure which maintains a database.
2. I have a croos-platform application, which I want to get the notifications sent from the api.
Say this with an asp.net api if  works, but create my new api an net.core and from here I am not able to install any azure client that can send the notifications. (Nuget Microsoft.Azure.notificationHub is not complatible With net.core)
Package Microsoft.Azure.NotificationHubs 1.0.8 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Azure.NotificationHubs 1.0.8 supports: net45 (.NETFramework,Version=v4.5)
    One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Does anyone know an example or a small guide where you can do this ???
Thank you very much

A: thank you very much for your response.
But if you looked good, what I wanted was to use Azure.notificationsHub in my net.core project.
In the end I have achieved it in the following way.
In my file project.json
The first thing to change is the framework, which has to be the following way.
Before

After

Now it is possible to work with any nuget package in your net.core project, among others Azure.notificationsHub

Once this is done, you only have to create a method to send notifications

I hope it will help anyone who has the same problem. I tested and working perfectly.
Regards.

A: As Microsoft Azure Notification Hubs 1.0.8 noted that:

Please note that this package requires .Net Framework 4.5 Full Profile.

I found a feedback about Microsoft.Azure.NotificationHubs add support for .NET CORE. I assumed that you could generate the authorization token and directly access the APIs from Notification Hubs REST APIs for a workaround to achieve your purpose. And here is a git sample about azure-notifications Send REST, you could refer to it for implementing the notification service in your .Net Core Web API project.


text:
Q: django - how can I write data to an external Mongo database? I have a Django app that is using PostgreSQL.  Everything is fine.  However, I have a situation in which it would be very convenient for my Django app to update the Mongo database of an entirely different app that is running a different server, etc.  How can I do this?

A: I dont know what Django is or how you are talking to Postgress, but ultimately, it boils down to using  one of the MongoDB supported language drivers in order to communicate with MongoDB.  The programming languages supported are here: drivers

A: One option to consider is MongoEngine, an Object-Document Mapper (ODM) that implements a declarative API similar to Django. You can then use Django's support for multiple databases to route requests appropriately.
See:

*

*Django Support in MongoEngine

*Django documentation: Multiple databases


text:
Q: Search string which contains multiple words using CATSEARCH query in PL/SQL String record : Blueoba Mountain Company
SQL Query :
SELECT from table
WHERE CATSEARCH(account_partner_name_type,'%Blueoba% %Mountain% %Company%', NULL) > 0)
where rn <=500;

If I write the full name of the string in the query (i.e.%Blueoba% %Mountain% %Company%) then it gives me the record.
But if I write %Blueoba% %Mountain% %Comp% or %Blue% %Company% or %Comp% then its not returning any record.
So ideally, if I write a word %comp% then it should search all the records which contains 'comp' word and show the records but its not showing.
Can anybody suggest something?

A: You can try using wild card characters
SELECT * from table
WHERE account_partner_name_type like '%Blueoba%'
and rn <=500;


text:
Q: Not able to rename pdf file while downloading in Javascript I am trying to download the pdf file from the server using javascript.
This is my url.
https://domainurl.amazonaws.com/f6c3b-72c3-4a5-b489-c798e64c4d.pdf?....
I tried in two ways.

*

*The current name of the file is fetching from url (f6c3b-72c3-4a5-b489-c798e64c4d.pdf). The below method is not overriding the existing name because of cross origin request.
 var link = document.createElement("a");
 link.href = uril;
 link.download = `test.pdf`;
 document.body.appendChild(link);
 link.click();
 document.body.removeChild(link);```

*In the second method, i am trying to get that pdf using axios request. server is blocking this because of cors issue.
     axios({
     url: 'http://api.dev/file-download', //your url
     method: 'GET',
     responseType: 'blob', // important
 }).then((response) => {
     const url = window.URL.createObjectURL(new Blob([response.data]));
     const link = document.createElement('a');
     link.href = url;
     link.setAttribute('download', 'file.pdf'); //or any other extension
     document.body.appendChild(link);
     link.click();
 }); ```

is there any other way to download pdf file using javascript?


text:
Q: Msgbox if YES or NO This should be super easy! The code merely consists of a message box with a Yes or No choice. Given that choice, a corresponding string is written into cell A1. I see no problem with it compared to google's script examples. What am I missing?
function msgbox() {

var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getActiveSheet();

var answer = Browser.msgBox("Confirm", "Does this work?", Browser.Buttons.YES_NO);

//if user clicks yes
if(answer === Browser.Buttons.YES) {
    //then enter YES into cell A1
    s.getRange("A1").setValue() === "YES";
    } else {
    //else enter NO into cell A1
    s.getRange("A1").setValue() === "NO";
    };
}

A: I have never used Google App Scripts, but based on my other programming experiences, I feel like
s.getRange("A1").setValue() === "YES";

might be the problem. Usually, the '===' operator is used to compare 2 values.
'aaa' === 'aaa' --> return true

In your case, don't you want to set a value?
s.getRange("A1").setValue("YES");

is what I would feel appropriate.

A: You are simply using setValue() the wrong way.
Refer to the documentation here.
It should simply be s.getRange("A1").setValue('YES')


text:
Q: Force WPF ListView to update DesiredSize before being rendered I have a WPF ListView with "Auto" column widths. After rendering, the column widths correctly match content, that is ok.
I need to determine the correct (rendered) DesiredSize of the ListView right after assigning to ItemsSource, prior to rendering.
The problem is that calling Measure() breaks the Auto width behavior - it resizes the columns to match header content:
listView.ItemsSource = myCollection;
// now listView.DesiredSize is 0
listView.Measure(new Size(2000, 2000));  // this breaks "Auto" widths

The only hack that comes to my mind is adding spaces to headers manually.


text: Q: Finding maxima or minima of quasilinear function I am trying to optimize function given as $ f(x_k) =\frac{b+mx_k}{c-mx_k}$ with $0 \leq x_k \leq 1$,  $\sum x_k = 1$ , $c-mx_k > 0$ and $b, c, m$ are constants. I am a newbie, as per my understanding, this is is well known fractional function and is quasilinear with only variation in denominator i.e. negative slope $-m$. The graph of function in single dimension is given below. I am puzzled if the function has some unique minima or maxima or some thing else. I would appreciate any help. function graph


text:
Q: Parallel Reduction in CUDA for calculating primes I have a code to calculate primes which I have parallelized using OpenMP:
    #pragma omp parallel for private(i,j) reduction(+:pcount) schedule(dynamic)
    for (i = sqrt_limit+1; i < limit; i++)
    {
            check = 1;
            for (j = 2; j <= sqrt_limit; j++)
            {

                    if ( !(j&1) && (i&(j-1)) == 0 )
                    {
                            check = 0;
                            break;
                    }

                    if ( j&1 && i%j == 0 )
                    {
                            check = 0;
                            break;
                    }

            }
            if (check)
                pcount++;

    }

I am trying to port it to GPU, and I would want to reduce the count as I did for the OpenMP example above. Following is my code, which apart from giving incorrect results is also slower:
__global__ void sieve ( int *flags, int *o_flags, long int sqrootN, long int N)
{
    long int gid = blockIdx.x*blockDim.x+threadIdx.x, tid = threadIdx.x, j;
    __shared__ int s_flags[NTHREADS];

    if (gid > sqrootN && gid < N)
            s_flags[tid] = flags[gid];
    else
            return;
    __syncthreads();

    s_flags[tid] = 1;

    for (j = 2; j <= sqrootN; j++)
    {
            if ( gid%j == 0 )
            {
                    s_flags[tid] = 0;
                    break;
            }
    }
    //reduce
    for(unsigned int s=1; s < blockDim.x; s*=2)
    {
            if( tid % (2*s) == 0 )
            {
                    s_flags[tid] += s_flags[tid + s];
            }
            __syncthreads();
    }
    //write results of this block to the global memory
    if (tid == 0)
            o_flags[blockIdx.x] = s_flags[0];

}

First of all, how do I make this kernel fast, I think the bottleneck is the for loop, and I am not sure how to replace it. And next, my counts are not correct. I did change the '%' operator and noticed some benefit.
In the flags array, I have marked the primes from 2 to sqroot(N), in this kernel I am calculating primes from sqroot(N) to N, but I would need to check whether each number in {sqroot(N),N} is divisible by primes in {2,sqroot(N)}. The o_flags array stores the partial sums for each block.

EDIT: Following the suggestion, I modified my code (I understand about the comment on syncthreads now better); I realized that I do not need the flags array and just the global indexes work in my case. What concerns me at this point is the slowness of the code (more than correctness) that could be attributed to the for loop.  Also, after a certain data size (100000), the kernel was producing incorrect results for subsequent data sizes. Even for data sizes less than 100000, the GPU reduction results are incorrect (a member in the NVidia forum pointed out that that may be because my data size is not of a power of 2).
So there are still three (may be related) questions -

*

*How could I make this kernel faster? Is it a good idea to use shared memory in my case where I have to loop over each tid?

*Why does it produce correct results only for certain data sizes?

*How could I modify the reduction?
__global__ void sieve ( int *o_flags, long int sqrootN, long int N )
{
unsigned int gid = blockIdx.x*blockDim.x+threadIdx.x, tid = threadIdx.x;
volatile __shared__ int s_flags[NTHREADS];

s_flags[tid] = 1;
for (unsigned int j=2; j<=sqrootN; j++)
{
       if ( gid % j == 0 )
            s_flags[tid] = 0;
}

__syncthreads();
//reduce
reduce(s_flags, tid, o_flags);
}

A: While I profess to know nothing about sieving for primes, there are a host of correctness problems in your GPU version which will stop it from working correctly irrespective of whether the algorithm you are implementing is correct or not:

*

*__syncthreads() calls must be unconditional. It is incorrect to write code where branch divergence could leave some threads within the same warp unable to execute a __syncthreads() call. The underlying PTX is bar.sync and the PTX guide says this:

Barriers are executed on a per-warp basis as if all the threads in a
  warp are active. Thus, if any thread in a warp executes a bar
  instruction, it is as if all the threads in the warp have executed the
  bar instruction. All threads in the warp are stalled until the barrier
  completes, and the arrival count for the barrier is incremented by the
  warp size (not the number of active threads in the warp). In
  conditionally executed code, a bar instruction should only be used if
  it is known that all threads evaluate the condition identically (the
  warp does not diverge). Since barriers are executed on a per-warp
  basis, the optional thread count must be a multiple of the warp size.

*Your code unconditionally sets s_flags to one after conditionally loading some values from global memory. Surely that cannot be the intent of the code?

*The code lacks a synchronization barrier between the sieving code and the reduction, this can lead to a shared memory race and incorrect results from the reduction.

*If you are planning on running this code on a Fermi class card, the shared memory array should be declared volatile to prevent compiler optimization from potentially breaking the shared memory reduction.

If you fix those things, the code might work. Performance is a completely different issue. Certainly on older hardware, the integer modulo operation was very, very slow and not recommended. I can recall reading some material suggesting that Sieve of Atkin was a useful approach to fast prime generation on GPUs.


text:
Q: How to use Linux command to kill all remote ip except myself? I need a way to kill all remote users, so that all of them can be forced to disconnect, assuming they are all logged in through the root account including me, can I kill them except myself.
I know it's possible to use
w

command checks all logged in users and kills a process through pts/num
pkill -kill -t pts/num #Kick out someone

But suppose you want to kick all pts/num except yourself
Or how to use kill -9 to kill process rule by all of pts/num except myself


text:
Q: What does the '>' do? What does        ls > list and         ls >> list         do?  They don't seem to do anything on my system.

A: ls > list

Creates a new file named list and adds the contents of ls command into that file.
You can check the contents of the file list by typing the command as,
cat list

Now, for the second command,
ls >> list

It will append the contents of the ls command to the file named list. So the difference would be if you execute this command 5 times, the output of ls command would be written 5 times to the list file but for the first command each and every time, the output would be overwritten.

A: If you're making
ls > list
and then
ls >> list
you can see the difference by just typing
cat list
after each time.


text:
Q: Why are there 128bit load functions for SSE? I'm poking around in somebody else's code and currently trying to figure out why _mm_load_si128 exists.
Essentially, I tried replacing
_ra = _mm_load_si128(reinterpret_cast<__m128i*>(&cd->data[idx]));

with
_ra = *reinterpret_cast<__m128i*>(&cd->data[idx]);

and it works and performs exactly the same.
I figured that the load functions exist for smaller types just for the sake of convenience so people wouldn't have to pack them into continuous memory manually but for data that is already in the correct order, why bother?
Is there something else that _mm_load_si128 does? Or is it essentially just a roundabout way of assigning a value?

A: There are explicit and implicit loads in SSE.

*

*_mm_load_si128(reinterpret_cast<__m128i*>(&cd->data[idx])); is an explicit load

**reinterpret_cast<__m128i*>(&cd->data[idx]); is an implicit load

With an explicit load you explicitly instruct the compiler to load the data into an XMM register - this is the "official" Intel way to do it. You can also control whether the load is an aligned or unaligned load by using _mm_load_si128 or _mm_loadu_si128.
Although as an extension, most compilers are also able to automatically generate XMM loads when you do type-punning, but this way you cannot control whether the load is aligned or unaligned. In this case, since on modern CPUs there is no performance penalty of using unaligned loads when the data is aligned, compilers tend to use unaligned loads universally.
An another, more important aspect is that with implicit loads you violate strict aliasing rules, which can result in undefined behavior. Although it's worth to mention that - as part of the extension - compilers which support Intel intrinsics don't tend to enforce strict aliasing rules on XMM placeholder types like __m128, __m128d, __m128i.
Nevertheless I think explicit loads are cleaner and more bulletproof.

Why do compilers don't tend to enforce strict aliasing rules on SSE placeholder types?
The 1st reason lies in the design of the SSE intrinsics: there are obvious cases when you have to use type-punning, since there is no other way to use some of the intrinsics. Mysticial's answer summarizes it perfectly.
As Cody Gray pointed out in the comments, it's worth to mention that historically MMX instrinsics (which are now mostly superseded by SSE2) didn't even provide explicit loads or stores - you had to use type-punning.
The 2nd reason (somewhat related to the 1st) lies in the type definitions of these types.
GCC's typedefs for the SSE/SSE2 placeholder types in <xmmintrin.h > and <emmintrin.h>:
/* The Intel API is flexible enough that we must allow aliasing with other
   vector types, and their scalar components.  */

typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));

The key here is the __may_alias__ attribute, which makes type-punning work on these types even when strict aliasing is enabled with the -fstrict-aliasing flag.
Now, since clang and ICC are compatible with GCC, they should follow the same convention. So currently, in these 3 compilers implicit loads/stores are somewhat guaranteed to work even with -fstrict-aliasing flag. Finally, MSVC doesn't support strict aliasing at all, so it cannot even be an issue there.
Still, this doesn't mean that you should prefer implicit loads/stores over explicit ones.


text:
Q: How to detect blank images from set of scanned documents using java? I am using Asprise Scanning and Image Capture SDK for scanning and atalasoft jolt image for cleaning image in my application.I want to group scanned documents.We are using blank paper for separating groups.How to detect these blank pages?

A: If the image is "cleaned", i. e. not grey in some regions, you can specify a threshold value for arithmetic mean of all points; using Graphics2D in Java for example.


text:
Q: Refactoring predicate out of the Lambda expressoin caueses an exception I'm having a method, that builds a large Lambda expression based on the incoming parameters (filter for db query, Entity Framework v. 1.0).
Let's say we've a Person, Department, and Occupation entities.
Person can have Occupations, and Occupation belongs to a Department.
Here is the code:
var query = myDbContext.AsQueryable();
query = query.Persons.Where(.......) //Building some conditions
...
... //Adding conditions to the query if there are incoming params

The problem lies in the following fragment:
//We have a Department Id as parameter, so we want to filter persons whose Occupations belong to this Department
query = query.Where(per => per.Occupations.Where(occ => !occ.IsDeleted).Count(occ => occ.Department.Id == myFilterParameter) > 0;)

This works fine, but when refactoring the predicate for Count() costruction out from the expresion, like so:
Expression<Func<Occupation, bool>> countExpression = occ => occ.DepartmentId == myFilterParameter;
query = query.Where(per => per.Occupations.Where(occ => !occ.IsDeleted).Count(countExpression.Compile()) > 0);

It causes
Internal .NET Framework Data Provider error 1025.
Any ideas why it is happening so?
I tried also:
query = query.Where(per => per.Occupations.Where(occ => !occ.IsDeleted).AsQueryable().Count(countExpression.Compile()) > 0), the same picture.

Any help would be very appreciable.

A: Typo:
Expression<Func<Occupation, bool>> countExpression = occ => occ.DepartmentId = myFilterParameter;
this should be:
Expression<Func<Occupation, bool>> countExpression = occ => occ.DepartmentId == myFilterParameter;

A: Remove the Compile() on countExpression.Compile()
Edit - Have you tried something like this?
query.Where(per => per.Occupations
                      .Where(occ => !occ.IsDeleted)
                      .Any(countExpression));


text:
Q: How detect when received a notification I need know the function to detect the notifications. I can send and receive notifications, but i need a function to detect when receive the notification.

A: The notificationOpenedCallback will fire when a notification is either opened or if one is received while the app is in focus. Example below.
var notificationOpenedCallback = function(jsonData) {
  console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));
};

window.plugins.OneSignal.init("b2f7f966-d8cc-11e4-bed1-df8f05be55ba",
                             {googleProjectNumber: "703322744261"},
                             notificationOpenedCallback);

There isn't an event for when a notification is receive in the background through Corodva. You will need to use native code for this by setting up a NotificationExtenderService in Java by following the OneSignal Background Data and Notification Overriding documentation for Android. For iOS set content_available to true and setup a
- application:didReceiveRemoteNotification:fetchCompletionHandler: selector.


text:
Q: Peak detector (peak event) I have a problem which is somehow related to detecting a peak. Let me summarize the problem a little bit, so it might be clear to you. I have to signals, both are not periodic and I know when they start and when they end. I also know the signal has exactely one peak. The signal might be a bit noisy, but I think this could be eliminated.
Now I need to know when between the start and end point the peak occurs. The best option would be that I get an output signal as soon as the peak occurs. Yet, I do not know how high the peak will be. This can vary a lot. The signal itself looks like a gaussian.
Now I could use a high speed ADC and sample the signal continously, do some small calculations and get the peak. Yet, what I would like much more, would be if I simply get an "event" telling me: There was the peak. I don't mind if I get this signal a bit later, as long as the time difference between the peak and the event is constant. I absolutely do NOT care about the peak level, I only want to know the point in time when this happened.
Does anyone know of a circuit which is able to satisfy these requirements?

A: I don't especially like the idea of doing this with a differentiator, because your gaussian pulse has a relatively flat top, so there will be a time when the derivative is nearly zero, so that the moment when you detect the peak will be fairly noise sensitive.
If the shape and amplitude of the input pulse is the same each time, you may be able to get what you want with a standard op-amp peak-detector followed by a comparator:

What this is doing is not trying to detect the peak event directly, but detecting when the input (IN) falls by one diode drop below the peak. When this happens, you'll get a rising edge at OUT.
After each cycle, your micro should assert the CLR line to clear out the peak detector.
You could reduce the delay from the peak to the output edge by using a schottky diode at D2. If your pulse is very slow, the value of C1 and R1 also need to be chosen large enough so that the capacitor doesn't bleed down too quickly after the peak.
The diode and FET types are just the default ones in CircuitLab. You'll want to choose these more carefully.
You'll want to choose an op-amp appropriate for the time scale of your signal, and you'll also need one that is okay being used as a comparator (e.g. one that doesn't go crazy when its two inputs are not at the same voltage and that can recover reasonably quickly from being driven to the rails).
Edit: I updated the schematic, adding R2 in the FET drain, to avoid extreme currents through D1 in the event the pulse arrives while you are resetting. Ideally you'll give your reset pulse at a time when you know the pulse won't occur. Otherwise, you'll need to make R2 big enough that you don't blow out OA2 or D1 if it does arrive when CLR is asserted; and make the CLR pulse width long enough to fully discharge C1 through R2.

A: If you are sure there is only a single peak, then you can differentiate the signal and compare to zero.  I'm a bit rushed right now, but a simple way to make a differentiator is a opamp in inverting configuration with a capacitor on its input.
One problem with a differentiator is that it is susceptible to noise.  Put another way, it will show you all the little local maximums in the signal resulting from noise if there are any.  Low pass filtering the signal to eliminate frequencies you know don't matter would be a good idea.

A:
simulate this circuit – Schematic created using CircuitLab
Peak hold detector: Working fine with 1us peaking time (width = 5 us) semi-gaussian analog signal  from my CZT detector + front-end electronics.


text:
Q: Is there a way to prevent Geb from returning null from void methods? In a Spock Specification any line in expect: or then: block is evaluated and asserted as boolean, unless it has signature with return type void.
I've noticed that there is something odd going on for methods declared as void on any class inheriting from Navigator (for example Page or Module classes).
Let say we have such example:
class NavigationSpec extends GebSpec {

    def 'Collections page has a right header'() {

        when:
            to CollectionsPage

        then:
            hasHeaderText('Collections')
    }
}

The hasHeaderText() method is defined within CollectionsPage class as follows:
class CollectionsPage extends Page {

    static url = 'movies/collections'

    void hasHeaderText(String expectedText) {
        assert true
    }
}

On purpose I'm just asserting true over there so it should never fail. Even though it fails with an error:
Condition not satisfied:

hasHeaderText('Collections')
|
null

How and why a void method call result is evaluated as null?
I know how to 'fix it'. It's enough to declare the method return type as boolean and return true. This is ugly though as following all the asserts otherwise unnecessary return true has to be added like:
boolean hasHeaderText(String expectedText) {
    assert header.text() == expectedText
    return true
}

This causes only noise though. Is there any way to prevent Geb from returning null from void methods?
I'm, of course, aware that this specific case could go like:
boolean hasHeaderText(String expectedText) {
    header.text() == expectedText`
}

This doesn't explain the oddity of lost void return type, not to mention we loose meaningful assert failure message with such approach.

A: It's part of the Groovy language that every method returns a value. This allows any method to be used in expressions or as lambdas.
All methods that are declared void return null.
If you don't explicitly have any return statement, the result of the last expression in your method is returned.
You can look at the bytecode... even if you declare a return type, you don't actually need to return anything as Groovy will, by default, return null:
// returns null
String callMe() { }

static void main(args) {
    def x = callMe()
    assert x == null
    println "OK!"
}

Because Spock will assert anything in the then block which is not a simple assignment, you need to avoid doing anything other than boolean assertions in the then block. Even assigning a variable, though allowed, should be avoided... It's hard to keep tests clean and clear, and by adhering to these guidelines will really work for you in the long run, not against you.
So, the correct way to write the assertion you want is to make your method return a boolean:
boolean hasHeaderText(String expectedText) {
    header.text() == expectedText
}

And use it in the then block:
then: 'The header has the expected text #expectedText'
hasHeaderText expectedText

Looks pretty good if you ask me.
EDIT
I've noticed that Groovy/Spock actually will not assert the result of a normal void method even in the then block... What's probably going on here is that you don't have a normal void method, you seem to be calling a dynamic method of CollectionsPage (I guess that's Geb's magic in play), which means that, probably, the Spock AST Transformer does not have the opportunity to check the signature of the method you're calling, so it correctly assumes it must assert the result... at least that's what it looks like.

A: @Renato is correct in the edited part of his response -  your call to a void method gets asserted by Spock because it's a dynamic call and Spock isn't able to figure out that you are calling a void method and eagerly asserts the call. If you changed your code to:
class NavigationSpec extends GebSpec {

    def 'Collections page has a right header'() {
        when:
            CollectionsPage collectionsPage = to CollectionsPage

        then:
            collectionsPage.hasHeaderText('Collections')
    }

}

then it won't get asserted.


text:
Q: Disable checkbox after clicking button on ionic I'm making an Ionic app and I'm creating profiles grups on it. To do this, the user needs to choose profiles from a checkbox list, then click a button and the group is created. At this point, those profiles already selected should disappear or at least should be unable to click them, but I can't do it.
Code:
HTML
<ion-list>
  <ion-item *ngFor="let profile of profiles; let i = index">
     <ion-label>{{profile.name}}</ion-label>
     <ion-checkbox color="dark" [(ngModel)]="values[i]"></ion-checkbox>
  </ion-item>
</ion-list>
<button ion-button full (click)="addGroup()">Add group</button>

TS
profiles = [];
values = [];
groupList = [];

addGroup(){
let y=0;
for(let i=0; i<this.values.length; i++){
  if(this.values[i] == true){
    this.groupList[y] = this.profiles[i];
    y++;
  }
}
let alert = this.alertCtrl.create({
  title: 'Group created!',
  buttons: ['OK']
});
alert.present();

//I tried this to solve the problem, but it is not really what I want...
for(let i=0; i<this.values.length; i++){
  if(this.values[i] == true){
    this.profiles[i] = 0;
  }
}
}

A: You're trying to loop over values but it is an empty array. Seems like you're missing core programming concepts here.


text:
Q: Background из assets не правильный размер Загружаю background элемента RelativeLayout из assets используя след. код:
        InputStream ims = getAssets().open(dbfile.getPath());

        BitmapFactory.Options opts = new BitmapFactory.Options();
        opts.inDensity = DisplayMetrics.DENSITY_TV;

        return Drawable.createFromResourceStream(getApplication().getResources(), null, ims, name, opts);

Результат заношу в setBackground(Drawable d).
Задник не растягиваеться по всей поверхности RelativeLayout, а покрывает только  часть. Как сделать покрытие  всей поверхности элемента?
Дополнение: Как я понимаю картинка не растягиваеться из за отсутствия авто-скэйла при загрузке из assets. По идее указание density в drawable уведомляет систему о исходном размере, если текущие параметры елементов отличаються, то система должна скэлить текстуру.... как я понял, но это не работает
layout код:
<com.app.ugooslauncher.elements.UgoosRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:font="http://schemas.android.com/apk/res-auto"

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rlItemApps"
android:gravity="center"
android:focusable="true">

<com.app.ugooslauncher.views.TypefacedTextView
    android:id="@+id/apps_name"
    android:layout_height="wrap_content"
    android:layout_marginBottom="8dp"
    android:gravity="center"
    android:lines="2"
    android:textColor="#424141"
    android:textSize="18sp"
    font:typeface="OpenSans-Regular.ttf"
    android:layout_alignParentBottom="false"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_width="match_parent" />

<ImageView
    android:id="@+id/apps_image"
    android:layout_width="120dp"
    android:layout_height="120dp"
    android:layout_centerHorizontal="true"
    android:layout_below="@id/apps_name"
    android:background="@android:color/holo_green_light" />

A: Рубленное решение без предоставления layout.xml топик стартером это просто вместо background вставить на задний фон ImageView со scaleType="fitXY"
например:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
 <ImageView
    android:id ="@+id/backgroun"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"/>

 <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
            <!-- твой код -->
 </RelativeLayout>
</FrameLayout>

A: В BitmapOptions    .outHeight и .outWeight должны быть равны тому RelativeLayout на который drawable ставится, получить актуальный размер этого лэйаута можно через ViewTreeObderver.


text:
Q: Binding data of multiple classes to single list view/xamarin forms Hello how can i bind data of multiple classes to a single list view through xaml. I sucessfully bind data from single class to a lisview but when i try to bind data of more than one classes it didn't show anything in xaml.

A: You cant't do that 'directly'.
As all UIElement controls have only one BindingContext property, you can bind only one objet at a time.
In MVVM patterns, you implement ViewModel classes to group all the needed data to display on the associated page...
So for your 'Listview', I suggest you to make a property in your ViewModel that references a new object that is simply the aggregation of all classes you want to connect to your listview.
A simple exemple:
/// Data A needed for your listview
public class DataA { ... }

/// Data B needed for your listview
public class DataB { ... }

///
/// You will make a property of this type into your viewModel
///
public class ListviewAggregatedData : INotifyPropertyChanged
{
    private DataA _listviewDataPart1;
    private DataB _listviewDataPart2;

    public DataA ListViewDataPart1
    {
        get => _listviewDataPart1;
        set {  _listviewDataPart1 = value; PropertyChanged?.Invoke(...); }
    }

    public DataA ListViewDataPart2
    {
        get => _listviewDataPart2;
        set {  _listviewDataPart2 = value; PropertyChanged?.Invoke(...); }
    }

    // ....
}

And in your xaml, presuming your viewModel implements a property of type ListviewAggregatedData called 'VmAggregatedDataProp', You could have something like that:
        <ListView
            BindingContext="{Binding VmAggregatedDataProp}"
            Header="{Binding ListViewDataPart1.Title}"
            ItemsSource="{Binding ListViewDataPart2.AllMyItems}"
            />

Binding names in this example must be replaced by your own properties...
Tell me if it s clear...


text:
Q: Capture logs (errors, warnings) in exported/deployed OSX app I am exporting my app as a .app and testing it on different OSX versions and machines. Is there any way to capture warnings, errors, etc. to a log?
The application is not crashing so a crash log is not being generated.

A: The best way to capture these is using something similar to TestFairy (framework for android / ios beta testing), I suggest you take a look at that, to see what functionalities it provides and the search for something similar on mac os.
Found these two for Mac :

*

*hockeyapp

*plccrashreporter


text:
Q: vue.js Unit Test - Error in mounted hook I'm using Jasmine as unit test framework, and I would like to know how could I know if a vue is correctly mounted. Is there a function, an API from VueJS, a receipt to know the state of the view ?
Actually..the unit test is passing but at the console (terminal or under the browser) I got the the following error : ERROR LOG: '[Vue warn]: Error in mounted hook: (found in xxxx ) -  ReferenceError: $ is not defined'
Then I would like that my unit test has a failure on this kind of error instead of passing......?
Here is a quick snapshot of the code:
describe("location component tests suite", () => {

    const getComponent = (data) => {
        let vm = new Vue({
            template : "<div>"
                + "<location"
                + " :data='data'"
                + " label='pick'"
                + " placeholder='placeholder'"
                + " required>"
                + "</location></div>",

            data: {
                data
            }
        });

        return vm;
    };

    it("Validate mount", () => {
        const data= { 'data' : { 'value' : 'VUE'} };
        const vm = getComponent(data).$mount();
        expect(vm.$el.querySelector('div.location-wrapper').getAttribute('class')).toBe('location-wrapper');
        expect(vm.$el.querySelector('input').getAttribute('name')).toBe('pick');
    });
});

Thank you !

A: You may want to use Vue.config.errorHandler API which is introduced since v2.2.0.

*

*You can declare a variable as an error-thrown flag (i.e. errorThrown).
 let errorThrown = false;

*Define the errorHandler function so that errorThrown will be switched to true when it's triggered.
 Vue.config.errorHandler = function (err, vm, info) {
   console.log(info);
   if(info.includes('mounted')) {
     errorThrown = true;
   }
 };

*Check errorThrown by using expect API in jasmine.
 expect(errorThrown).toBe(false);  // Test will fail here

Check the working demo here.
In this way, errors occurred in mounted method will be catched and force unit test to fail.


text:
Q: IDW interpolation in Python in QGIS 3.4 I have a problem with IDW interpolation. I need to use canvas extent and other attributes (I created an option with only attribute 0, other attributes aren't working). The documentation is not very helpful.
My code:
layer = iface.activeLayer()

layer_data = QgsInterpolator.LayerData()
layer_data.source = xlayer
layer_data.zCoordInterpolation=False
layer_data.interpolationAttribute =0
layer_data.SourceType =SourcePoints
layer_data.distanceCoefficient=2

tin_interpolator = QgsIDWInterpolator([layer_data])

export_path = r"C:\Users\Maria\Documents\miau.tif"

cos= canvas.extent()

output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
output.writeFile()

rlayer=iface.addRasterLayer(export_path, "interpolation_output")

A: Not sure why you called it tin_interpolator when you want to use QgsIDWInterpolator :) But you need to replace the following lines:

*

*layer_data.SourceType =SourcePoints to
layer_data.sourceType = QgsInterpolator.SourcePoints

*

*layer_data.distanceCoefficient=2 to
tin_interpolator.setDistanceCoefficient(2)

*

*cos= canvas.extent() to
cos = iface.mapCanvas().extent()

So your final code should look something like:
layer = iface.activeLayer()
layer_data = QgsInterpolator.LayerData()
layer_data.source = layer
layer_data.zCoordInterpolation = False
layer_data.interpolationAttribute = 0
layer_data.sourceType = QgsInterpolator.SourcePoints

tin_interpolator = QgsIDWInterpolator([layer_data])
tin_interpolator.setDistanceCoefficient(2)

export_path = r"C:\Users\Maria\Documents\miau.tif"
cos = iface.mapCanvas().extent()
output = QgsGridFileWriter(tin_interpolator,export_path,cos,2000,2000)
output.writeFile()

rlayer = iface.addRasterLayer(export_path, "interpolation_output")


text:
Q: When asking for a table Error occurs: Error: connect ETIMEDOUT 52.166.80.90:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14) I try to connect to an azure-storage to change some data in a table. The connection to the azure cloud works but when I try to work with a table in there I get the time-out-Error.
I use node.js. We work behind a corporate proxy but there are some proxy-server one can use for special internet access. Thus, I got the connection to the azure-portal and I can create the tableService but I can not do anything with a table. Already the question 'doesTableExist' does not work. I also tried the function 'createTableIfNotExists' but same matter.
var azure = require('azure-storage');
var storageName = "...";
var storageKey = "...";

var tableService = azure.createTableService( storageName, storageKey);

tableService.logger.level = azure.Logger.LogLevels.DEBUG;
console.log('TableService activ' + tableService);

tableService.doesTableExist('tblName', function(err, res) {
    if (!err) {
            console.log('res' + res.status);
        } else {
        console.log('Error at doesTableExists ' + err.stack);
    }
});

How can I get the table values? The Table exists.


text:
Q: NotifyPropertyChanged of a Calculated property when Items in List Changes I Have a model SupplierInvoice as follows:
public class SupplierInvoice
{
    public bool Use { get; set; }
    public ApInvoice Invoice { get; set; }
}

And a ViewModel with a list of this model:
private List<SupplierInvoice> _SupplierInvoices;
public List<SupplierInvoice> SupplierInvoices
{
    get
    {
        return this._SupplierInvoices;
    }
    set
    {
        if (this._SupplierInvoices != value)
        {
            this._SupplierInvoices = value;
            this.RaisePropertyChanged("SupplierInvoices");
        }
    }
}

within this ViewModel I have a calculated property too:
public decimal ApTotal
{
    get
    {
        decimal total = 0;

        if (this.SupplierInvoices != null)
        {
            foreach (SupplierInvoice invoice in this.SupplierInvoices)
            {
                if (invoice.Use)
                {
                    total += invoice.Invoice.MthInvBal1;
                }
            }
        }

        return total;
    }
}

this calculated property returns the sum of the balance of all the invoices (if the invoice's Use property is true). The Use property is selected to be true on the view with a checkbox in a grid.
Now... the question is: How do I NotifyPropertyChanged of this calculated property (ApTotal) when the Use property of the SupplierInvoice model has been changed?

A: I think replacing your List<TObject> by an ObservableCollection<TObject> will do the trick.
From what I remember the List isn't propagating the PropertyChangedEvent to the UI thread.

A: This may be a bit naughty, but you could always do this:
private List<SupplierInvoice> _SupplierInvoices;
public List<SupplierInvoice> SupplierInvoices
{
    get
    {
        return this._SupplierInvoices;
    }
    set
    {
        if (this._SupplierInvoices != value)
        {
            this._SupplierInvoices = value;
            this.RaisePropertyChanged("SupplierInvoices");
            this.RaisePropertyChanged("ApTotal");
        }
    }
}

A: Whenever you have a calculated property, you just need to raise the INotifyPropertyChanged.PropertyChanged event from the other properties that are involved in the calculation. So as your ApTotal property is calculated from just the SupplierInvoices property, then you can just notify the interface from that property setter:
public List<SupplierInvoice> SupplierInvoices
{
    get
    {
        return this._SupplierInvoices;
    }
    set
    {
        if (this._SupplierInvoices != value)
        {
            this._SupplierInvoices = value;
            this.RaisePropertyChanged("SupplierInvoices");
            this.RaisePropertyChanged("ApTotal");
        }
    }
}


text:
Q: Open link in new tab in react router programmatically I am using ReactJS for a project along with React Router (no redux) I want to programmatically open a link but on a new tab. I am aware that using
  onClickNode={e => this.props.history.push('/${e.data.node.id}')} I can go to the desired link but the problem is that it gets opened in the same tab. Also there is no way to use JSX in that function and hence no possibility of adding <Link> component.
( I am using React Router v4)

A: This https://stackoverflow.com/a/11384018/7697399 answer helped me out and worked flawlessly. This could be done without the help of react-router.
function openInNewTab(url) {
  var win = window.open(url, '_blank');
  win.focus();
}

A: <Link/> component from react-router-dom can be used. Using you can pass props to new tab.
<Link to='/' target="_blank">
  <div> Button </div>
 </Link>

A: In new Javascript syntax you could write the function like so:
const openLink = (url) => window.open(url, '_blank')?.focus();

This will try to open the URL in a new tab and focus on it if succeeded.
It will not throw an error if the tab did not open.

A: Similar to the previous answer, but doesn't error out if the window couldn't be opened.
function open(url) {
  const win = window.open(url, '_blank');
  if (win != null) {
    win.focus();
  }
}

A: You can get the path programatically using useHref hook(Docs). This is what the <Link> component internally uses. You can then open it in new tab using window.open. This would automatically add the basename etc for you.
let href = useHref(to);
window.open(href, '_blank');


text:
Q: Evaluation of a small math type language that supports one variable I have written the parser that reads the string input. That works. I have also written the evaluator that spits out the result. But there is one small detail that I'm having trouble implementing. Look at the following example:
+(sw+(2,2),sr)

The sw construct of this tiny language is suppose to evaluate "+(2,2)" and store it somewhere. The sr construct would read this storage area. The whole expression over would evaluate to 8.
My thoughts on it would be to use an extra parameter for the function eval, that stores the result. But I can't see that working out. Note I am new to haskell, so be kind. Oh, this is homework. So don't give me a solution, give me a hint.

A: Since expressions can read and write into storage area, your evaluation function should get state of memory as a parameter, and return new state in result.
 evaluate :: Expr -> Int -> (Float, Int)

[where Int is type of the storage, and Float is type of result, of course you can change that].
When implementing evaluate (Sum a b), you need to pass memory into evaluate a, get new value of memory and give it to evaluate b.
     |
     |  m
    \ /
|----------|   x
|evaluate a|--------|
|-----------        |
     |              |
     |  m'          |
    \ /            \ /
|----------|  y    ---
|evaluate b|----->| + |
|----------|       ---
     |              |
     |              |
    \ /            \ /
   final           final
   value of        result
   memory

Use pattern matching. You'd start with let (x,m') = evaluate a m in ....


text:
Q: position().top inconsistencies when (zoom < 1) I am using a window of fixed position with horizontal and vertical scroll. And using position.top() to find the particular position of the div.
 var position = anchor.position().top;

But when zoom is 1 or >1 then it is working totally fine.
But when zoom is <1 then there are inconsistencies.
Example Jsfiddle

A: You have to subtract the position of inner content
var position = anchor.position().top - $('.innercontent').position().top;

Checkout this jsfiddle


text:
Q: Remove both rows that duplicate in R I'm trying to remove all rows that have a duplicate value. Hence, in the example I want to remove both rows that have a 2 and the three rows that have 6 under the x column. I have tried df[!duplicated(xy$x), ] however this still gives me the first row that duplicates, where I do not want either row.
    x <- c(1,2,2,4,5,6,6,6)
    y <- c(1888,1999,2000,2001,2004,2005,2010,2011)
    xy <- as.data.frame(cbind(x,y))
    xy
    x    y
  1 1 1888
  2 2 1999
  3 2 2000
  4 4 2001
  5 5 2004
  6 6 2005
  7 6 2010
  8 6 2011

What I want is
    x     y
    1  1888
    4  2001
    5  2004

Any help is appreciated. I need to avoid specifying the value to get rid of since I am dealing with a dataframe with thousands of records.

A: we can do
xy[! xy$x %in% unique(xy[duplicated(xy$x), "x"]), ]
#  x    y
#1 1 1888
#4 4 2001
#5 5 2004

as
unique(xy[duplicated(xy$x), "x"])

gives the values of x that are duplicated. Then we can just filter those out.

A: You can count and include only the singletons
xy[1==ave(xy$x,xy$x,FUN=length),]

  x    y
1 1 1888
4 4 2001
5 5 2004

A: Or like this:
xy[xy$x %in% names(which(table(xy$x)==1)),]
  x    y
1 1 1888
4 4 2001
5 5 2004


text:
Q: Recovery formatted hidden formated file I'm using photorec on last version Ubuntu to find a file in my old hard drive (not damaged just formatted) but I realised that it was an hidden file. However, when I try recover the files using photorec it does not show this hidden text file that I'm looking for (I checked using find command). Is there any chance to recover it?Or other utility that I can use? Thanks in advance

A: When I used photorec in the past(with Hirens Boot CD), it didn't pull the files metadata, so searching by name didn't work. It did save the file extensions though. The file names were just changed to just numbers, so searching by the original files name wouldn't bring anything up. Try checking out the files manually, if you see this is true in your case as well your best bet is to search for the file by extension and you'll have to manually search through the results.
An example to search by extensions if looking for a MP3 file is like this
sudo find ./ *.mp3 2> /dev/null
the 2> /dev/null just gets rid of errors so you get a cleaner output. I recommend using sudo to run the command just so you don't have issues with permissions. you can cd to the the directories you want to search or just type in the full path in place of ./ to the drives location. I remember data recovery with photorec was time consuming cause it mixes OS files and personal data files, and loses the names. So many files to sort through.

A: I think photorec doesn't give you the name of the recovered files, so you will need to use grep in order to find some content of the file you're looking for
grep "I'm sure this is in my file" recup_dir.*/*
this should give you the 'new' name of your file
hope this help


text:
Q: Inspiron 15 3552 standby keyboard issues My mother, myself, and my sister all have the same model of Inspiron 15 3552. Mine is upgraded to 8G ram with a Samsung SSD, my mothers is upgraded to 8G ram with a corsair SSD, and my sister's is stock (4G with 500G HDD).
All of our laptops have this weird intermittent keyboard problem that I've been trying to troubleshoot for a while now. Whenever we close the lid on our laptops and open them later, the keyboard about 50% will not work. It acts as if it's not plugged in. We have to reboot to get the keyboard working again.
I've tried to disable the keyboard driver going to sleep under power management, updated the BIOS to latest version, all are on Windows 1903 with latest patches.
One weird quirk is that sometimes if the keyboard does work, pressing the capslock key will 'lock' it on and the keyboard will stop working.
Anyone have any ideas?

A: Seems you're not the first person with this problem. Looks like re-installing or roll-backing the keyboard drivers worked for this person :
https://www.dell.com/community/Inspiron/URGENT-HELP-My-In-Built-Keyboard-Is-Not-Working/td-p/6073762


text:
Q: How to write ngrx/effects unit test case if i use delay observable? My Effects
@Effect({dispatch: false}) getStudents = this.action.pipe(
  ofType(GET_STUDENT),
  delay(0),
  tap(() => this.api.getStudents())
 )

How to write unit test case for the above ngrx/effects, mainly how to use delay observable in that?


text:
Q: check the 'checked' value of all children hidden inputs ANSWER
stackoverflow.com/a/18676076/2240163

You can't have hidden input be a checkbox, so it won't have a checked
  property. You can use a type="checkbox" and hide it with display:none
  if you need it to be a checkbox, or you can simply use the hidden
  input with a 0 or a 1 instead to kind of simulate it.

I have a container with hidden fields to hold data.
    <Panel id="jointlist">
      <input type="hidden" id="jl_C_Head_back_conf" name="C_Head_back_conf" data-location="Head, back"/>
      <input type="hidden" id="jl_C_Head_back_text" name="C_Head_back_text"/>
      <input type="hidden" id="jl_C_Head_front_conf" name="C_Head_front_conf" data-location="Head, front"/>
      <input type="hidden" id="jl_C_Head_front_text" name="C_Head_front_text"/>
    </Panel>

Im trying to find which input elements has a checked value of true.
Ive tried
var jointlist = $("#jointlist");
var items = jointlist.find("input[id*='_conf']:checked");

but this returns the parent node with all the inputs listed under children. The item in the pic is true and there is one more true item, but the rest of the 132 remaining items are all false.

so then I tried to loop through all the children to find the checked elements, so I tried
    jointlist.each(function () {
        var curItem = $(this);
        var chldrn = curItem[0].children;
        for (i = 0; i < chldrn.length; i++) {
            console.log(chldrn[i].checked);
        }
    });

This returns the HTML of the child element.
So Im not sure how to access the checked attribute of the children.
EDIT
This is the screenshot of the for loop console.log(chldrn[i].checked);

A: You can fetch all the input elements first:
var inputs = document.getElementById('jointlist').getElementsByTagName('input');

then loop through and get the checked value like
inputs[i].getAttribute('checked');

var inputs = document.getElementById('jointlist').getElementsByTagName('input');
var res;
for (var i = 0; i < inputs.length; i++) {
  if (inputs[i].getAttribute('checked') === 'true') {
    res = inputs[i];
  }
}
console.log(res);
<Panel id="jointlist">
    <input type="hidden" id="jl_C_Head_back_conf" name="C_Head_back_conf" data-location="Head, back" checked="true" />
    <input type="hidden" id="jl_C_Head_back_text" name="C_Head_back_text"/>
    <input type="hidden" id="jl_C_Head_front_conf" name="C_Head_front_conf" data-location="Head, front"/>
    <input type="hidden" id="jl_C_Head_front_text" name="C_Head_front_text"/>
</Panel>


text:
Q: Ajax call in local site to PHP file to kill task I am hoping someone can explain how to do this to a laymen like me. I found a work around posted by someone else for a project I'm working on. However, I'm not sure how I do this.
Here is the workaround posted by someone else:

I found a way to get around this when using a browser other than the default: I simply make a call via ajax to a PHP function which contains the following code:

<?php
shell_exec('taskkill /T /F /IM "Server2Go.exe"');
?>

This ends the task tree for Server2Go which kills the Server2Go.exe
  file, Apache and MySql.

So I created the PHP file containing the code he/she wrote. How do I create an AJAX call that would recognize the browser has closed and kills the "Server2Go.exe" process? And once it is created, where exactly to I place it? I searched on Google and found several ways to "make an ajax call" - but wasn't sure exactly where I needed to place it.
That is my question, so you don't have to continue, but In case other info is wanted:
I am currently running a local wordpress install with Server2Go - Which launches apache, mysql, and basically everything you need to have a server and database for a local install.
It also has a feature to shutdown the "server2go.exe" process as well as all the child processes.
It is designed to work with IE, but I prefer to use another browser. Because I use a different browser it does not shutdown the "server2go.exe" process.

A: You can use the jQuery script below to identify a browser/tab close event and then make an ajax call to your php.
<html>
    <head>
        <!-- Load jQuery Libraby -->
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script>
            // Bind the window before load event.
            $(window).bind("beforeunload", function () {
                // This code is running when user refresh the page or tab is clossin or browser is closing.
                $.ajax({
                    type: "POST",
                    url: "the php url"
                }).done(function (response) {});
            });
        </script>
    </head>
    <body>
        <!-- Whatever the body of your page will include -->
    </body>
</html>


text:
Q: Solution design for a serverless hosted in AWS I'm designing a website solution in AWS containing only 2 sites: the main dashboard showing company data in a graph (index site) and single pages for each company.
Pre-requisites:

*

*serverless.

*cost-effective solution based on-demand traffic.

*everything can be publicly accessed. not login required.

*website in HTML using JS.

*the data is changed 1 time per day.

Functionalities:

*

*Main dashboard (a graph in JS) reading dynamic data (last 30 reports). The data can be read from a file: txt, json or maybe a database: dynamoDB. As it has
to be publicly accessed, I don't think using a database will be a
good strategy.

*Company page.The users can publicly post comments and rate with starts.
How do you personally would design this solution?
My first approach is: dashboard site reading data from a txt file, company site use a DynamoDB to save/show comments and ratings.

A: I would recommend you use some kind of "orchestration framework" to launch such services in AWS. Alternatively, you could manually write and manage a Cloudformation template for this purpose.
You should also not worry about keeping each of these components in a seperate git repo. You could also employ different programming language for each component if necessary. This will allow you to design it not only as "serverless" but also utilizing microservice architecture, which AWS is heavily advancing in the field.
This example should quickstart you: https://serverless.com/examples/aws-node-single-page-app-via-cloudfront/
The static part of your application (HTML + JS) should rely on API's to gather data.
These API's can be Lamba functions with API Gateway in front of them. That would allow you to securely connect to a database without worrying about security.
This example should quickstart your API part: https://serverless.com/examples/aws-node-rest-api-with-dynamodb-and-offline/
Given how Lambda, S3, and DynamoDB pricing works (large free tiers) this would most likely run for free for the first 50K monthly visitors or so, with approx 2-3EUR p/m for each other 50K monthly visitor increment.

A: It really depends on how often your data is updated and how real-time your data displaying should be.
If it's just daily updates, and you can afford a few minutes latency in your updates, I would generate static pages with the new data every day using Jekyll (via Siteleaf, for example) or Hugo (which can run on AWS Lambda).
Then, automatically export those pages to an S3 bucket, and cache everything using Cloudfront for better performance and lower costs. Blazing fast, no moving parts, simple to maintain.
If you do need your displayed data to be continuously up-to-date, go with a S3 hosted single-page app fetching your data from a Lambda-DynamoDB based API, fronted by API Gateway.
You could deploy it using the Serverless framework or something similar, which are much more user-friendly than CloudFormation itself.


text:
Q: Missing number, treated as zero.  * I'm having the worst time ever figuring how to get rid of this error I'm getting!
\documentclass[12pt, onecolumn]{article}
\usepackage{multicol, multirow, array}
\usepackage{calc}
\usepackage{colortbl}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{arydshln}
\usepackage{booktabs}
\usepackage{bigstrut}

\begin{document}
\begin{center}
\begin{tabular}{|ccc|cc|c|c|}
\hline
\multicolumn{3}{c}{\multirow{2}{*}{$A$}} & \multicolumn{2}{c}{\multirow{2}{*}{$I_m$}} & $_m{\hat{0}}$ & $\hat{b}$\\
\hline
\multicolumn{3}{c}{$\bar{c}$} & \multicolumn{2}{*}{$\bar{0}_m$} & 1 & $d$\\
\hline
\multicolumn{3}{c}{$\bar{0}_n$}&\multicolumn{2}{*}{$\bar{0}_m$}&0&$0$\\
\hline
\end{tabular}
\end{center}
\end{document}

The table should look like this:

A: TeX error messages can be rather cryptic at times. Sigh.
The * character in
\multicolumn{2}{*}{$\bar{0}_m$}

is not legal. Basically, the second argument of \multicolumn must be a recognized column type, say, l, c, r, or p.

Since all entries in the table are math-y, I would use an array environment, and I'd place this array environment in an unnumbered display-math group, delimited by \[ and \]. This setup allows you to get rid of lots of $ tokens.
By the way, there is absolutely no need for any \multirow or \multicolumn directives.

\documentclass[12pt]{article}
\usepackage{array} % no other packages needed!
\begin{document}
\[
\renewcommand{\arraystretch}{1.5}
\setlength\arraycolsep{10pt} % default: 5pt
\begin{array}{|*{4}{c|}}
\hline
A         & I_m       & {}_m\bar{0} & \bar{b} \\
\hline
\hat{c}   & \hat{0}_m & 1           & d  \\
\hline
\hat{0}_n & \hat{0}_m & 0           & 0  \\
\hline
\end{array}
\]
\end{document}

A: You can avoid multirow and use a much more natural input syntax.
\documentclass[12pt, onecolumn]{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{arydshln}

\begin{document}

\[
\renewcommand{\arraystretch}{1.5}
\newcommand{\threerows}{\vphantom{\begin{array}{c}\\\\\end{array}}}
\begin{array}{|c|c|c:c|}
\hline
\threerows\mathmakebox[4em]{A} & \mathmakebox[2em]{I_m} & {}_m\hat{0} & \hat{b} \\
\hdashline
\bar{c} & \bar{0}_m & 1 & d \\
\hline
\bar{0}_n & \bar{0}_m & 0 & 0 \\
\hline
\end{array}
\]

\end{document}

I define a disposable \threerows command, just inside the math display, which reserves the vertical space of a three row array. For the horizontal spacing, I exploit \mathmakebox of mathtools.

You might want to use \bar{0}_{\mathrlap{n}} in the bottom left entry, to get

A: Your problem stems from
\multicolumn{2}{*}{<stuff>}

since \multicolumn expects a column specification in the second argument (and * isn't part of the valid set of options).
Regardless, you can use some details from How to add vertical and horizontal dashed lines in array and tabular enviroments? to replicate what you're after:

\documentclass{article}

\usepackage{array,arydshln}

\begin{document}

\begin{center}
  \renewcommand{\arraystretch}{1.5}%
  \begin{tabular}{ | >{\qquad}c<{\qquad} | >{\quad}c<{\quad} : c | c | }
    \hline
                &             &               &           \\
       $A$      &    $I_m$    & $_m{\bar{0}}$ & $\bar{b}$ \\
                &             &               &           \\
    \hdashline
     $\hat{c}$  & $\hat{0}_m$ &       1       &     $d$   \\
    \hline
    $\hat{0}_n$ & $\hat{0}_m$ &       0       &      0    \\
    \hline
  \end{tabular}
\end{center}

\end{document}

A: The {*} is used as the second argument of multirow to denote the natural width of its contents. For \multicolumn, the second argument is the column type of the multicolumn.
I would suggest using two  centred fixed width columns for the first two, \bigstrut to set the height of the first row, and cellspace to add some minimal vertical padding to the other row:
  \documentclass[12pt, onecolumn]{article}
    \usepackage{multicol, multirow, array}
    \usepackage{calc}
    \usepackage{colortbl}
    \usepackage{geometry}
    \usepackage{enumitem}
    \usepackage{mathtools}
     \usepackage{fancyhdr}
     \usepackage{graphicx}
    \usepackage{arydshln}
    \usepackage{booktabs, cellspace}
    \setlength{\cellspacetoplimit}{5pt}
    \setlength{\cellspacebottomlimit}{4pt}
    \usepackage{bigstrut}

\begin{document}

 \begin{center}

 \setlength{\bigstrutjot}{3ex}
    \begin{tabular}{|>{\centering}p{1.8cm}|S{>{\centering}p{1.2cm}}:c|c|}
    \hline
   \bigstrut$A$ & $I_m$ & ${_m{}\hat{0}}$ & $\hat{b}$\\
    \hdashline
      $\bar{c}$ & $\bar{0}_m$ & 1 & $d$\\
    \hline
    $\bar{0}_n$ & $\bar{0}_m$ &0&$0$\\
    \hline
    \end{tabular}
    \end{center}

\end{document}

A: The error message seems so mysterious and (at first glance) unconnected to the source file, so here's a note on reading TeX error messages and the (crude) facilities available to debug something like this.
(TLDR: Add \errorcontextlines=999 and \tracingmacros=1 to your input file, and run TeX with settings max_print_line=10000 and error_line=254 and half_error_line=238, to get more output.)
First, having produced a small example that reproduces the error (as in the question), go further and remove one-by-one all packages and options that don't change the error message. So, starting with the version in the question, you might arrive at something like:
\documentclass{article}
\usepackage{multirow}

\begin{document}
\begin{center}
\begin{tabular}{|ccc|cc|c|c|}
\hline
\multicolumn{3}{c}{\multirow{2}{*}{$A$}} & \multicolumn{2}{c}{\multirow{2}{*}{$I_m$}} & $_m{\hat{0}}$ & $\hat{b}$\\
\hline
\multicolumn{3}{c}{$\bar{c}$} & \multicolumn{2}{*}{$\bar{0}_m$} & 1 & $d$\\
\hline
\multicolumn{3}{c}{$\bar{0}_n$}&\multicolumn{2}{*}{$\bar{0}_m$}&0&$0$\\
\hline
\end{tabular}
\end{center}
\end{document}

by removing packages and options to \documentclass. Then after looking at the line number that causes the error (the second row of the table), you can minimize even further, removing the \begin{center} … \end{center}, and all but the second row of the table:
\documentclass{article}
\begin{document}
\begin{tabular}{|ccc|cc|c|c|}
\multicolumn{3}{c}{$\bar{c}$} & \multicolumn{2}{*}{$\bar{0}_m$} & 1 & $d$\\
\end{tabular}
\end{document}

No extra packages, just core LaTeX! The error message now is something like:
! Missing number, treated as zero.
<to be read again>
                   *
l.4 ...\bar{c}$} & \multicolumn{2}{*}{$\bar{0}_m$}
                                                   & 1 & $d$\\
?

The way error messages are printed in TeX has a certain grammar; in short after the first line (the one starting with !) you should read the lines in pairs. These pairs of lines are TeX's input stack (the things it was reading/expanding) at the time the error was encountered. In each pair of lines, the first line is what TeX had already read (by the time it produced the error) and the second line is what it was not yet read (and therefore irrelevant to the error, but useful for context in recognizing what that pair of lines is). Also the first of each pair of lines starts with what kind of token list it is or where it came from, e.g. the line starting with l.4 means the input came from line 4.
So here, TeX encountered the error after reading the part of line 4 until \multicolumn{2}{*}{$\bar{0}_m$}. Sometimes, knowing this much is enough, but often it is not. In this case, there's no immediately discernible connection between Missing number, treated as zero and the <to be read again> * and the source line. What's going on is that LaTeX, in an attempt to avoid confusing the user, helpfully turns off all but the first and last pair of context lines in the error. To undo this, add something like \setcounter{errorcontextlines}{999} (or simply \errorcontextlines=999) to the top of your file. Then at least you see the full "stack trace". The output has ...s in it which show that something was truncated, in order to fit within a small width. You can get less truncation by passing in larger values of certain parameters, e.g. instead of pdflatex run max_print_line=10000 error_line=254 half_error_line=238 pdflatex (you can also set those three values in texmf.cnf), to get the error message:
! Missing number, treated as zero.
<to be read again>
                   *
\@xexpast #1*#2#3#4\@@ ->\edef \reserved@a {#1}\@tempcnta #2
                                                            \relax \ifnum \@tempcnta >\z@ \@whilenum \@tempcnta >\z@ \do {\edef \reserved@a {\reserved@a #3}\advance \@tempcnta \m@ne }\let \reserved@b \@xexpast \else \let \reserved@b \@xexnoop \fi \exp...
\@mkpream #1->\@firstamptrue \@lastchclass 6 \let \@preamble \@empty \let \protect \@unexpandable@protect \let \@sharp \relax \let \@startpbox \relax \let \@endpbox \relax \@expast {#1}
                                                                                \expandafter \@tfor \expandafter \@nextchar \expandafter :\expanda...
\multicolumn #1#2#3->\multispan {#1}\begingroup \@mkpream {#2}
                                                              \def \@sharp {#3}\set@typeset@protect \let \@startpbox \@@startpbox \let \@endpbox \@@endpbox \@arstrut \@preamble \hbox {}\endgroup \ignorespaces
l.5 \multicolumn{3}{c}{$\bar{c}$} & \multicolumn{2}{*}{$\bar{0}_m$}
                                                                    & 1 & $d$\\
?

This finally shows what's going on, and you can also add \tracingmacros=1 and search for the corresponding macros in the log file for more clarity. Basically:

*

*TeX said "Missing number, treated as zero" because it saw \@tempcnta * where \@tempcnta is a counter value (and expects a number). So it decided to treat the number as 0, and leave the * to be read later, but is also asking you for confirmation.

*It saw this \@tempcnta * because it encountered \@tempcnta #2 in the expansion of \@xexpast #1*#2#3#4\@@, which got #2 as *.

*This comes from the expansion \@expast #1->\@xexpast #1*0x\@@ with #1<-* (this is in the log file)

*It saw this \@expast * because of \@expast {#1} in the expansion of \@mkpream #1, with #1 being *

*It saw this \@mkpream * because of \@mkpream {#2} in the expansion of \multicolumn #1#2#3, with #2 being *

*This came from \multicolumn{2}{*}{$\bar{0}_m$} in the input file.
In other words, the last two points show that the problem is with the second argument of \multicolumn{2}{*}, and hopefully with that clue you can resolve your problem.

The cryptic error message here, which is fair to consider a usability bug, is IMO not TeX's fault but that of LaTeX. I mean, TeX's output undoubtedly has quite a few problems:

*

*In addition to "Missing number, treated as zero", ideally it could have said something more explicit like "you tried to assign the non-integer value * to the counter \@tempcnta"

*It tries to do error-recovery (inserting 0s, $s and what not), which made sense in the days when rerunning TeX would have been very slow, but these days it's better to just show an error message and stop.

*Its conventions of printing error messages in separate lines, etc., require reading the manual, and aren't intuitive,

*By default it prints too narrow lines; these days we have much wider screens so the limits don't make sense and the wrapping only confuses.

*(A fundamental flaw: By providing macro facilities, which do not amount to a proper programming language, it enables their abuse and the creation of monstrosities.)
Nevertheless, the bulk of the problem here is not with TeX itself. If you were a plain TeX user and you knew enough to manually write macros like \newcount\@tempcnta and then sometime later \@tempcnta * (which is what is happening here internally), you'd be in a position to understand and act on the error message as well.
Instead, the bigger problem (IMO) is that LaTeX, which provides so many conveniences to the user, does so in a way that causes an easily (and frequently) shattered illusion of simplicity. Suppressing the error context lines would be justifiable if LaTeX did proper error checking itself: for example, the macro \multicolumn is intended to have the syntax of \multicolumn{NUMBER}{FORMAT}{ITEM}, so it could verify that the second argument is indeed a valid format (or at least that it doesn't contain a *), before passing it to \@mkpream and causing such confusing error messages.
There are historical reasons for this (at the time LaTeX was written there wasn't enough space to do proper error-checking, and these days changing macros may break existing documents so everyone is very wary of changing anything simply for better usability), and some of these lessons seem to have influenced the design of the new LaTeX macro-programming style (expl3) which seems to provide more opportunities for error-checking. Meanwhile with the maturing of LuaTeX, hopefully such macro programming will be less necessary too.
Sorry for a long "answer" that doesn't really help you with your table, but hopefully it helps you or someone make sense of the nonsensical-looking error message and why things are this way, either now or in the future.


text:
Q: Encrypt data in Javascript, Decrypt data in C# using private/public keys I want to encrypt data in a web browser that is send to my C# backend and decrypted there.
That fails because I am unable to decrypt the data generated on the frontend in the backend.
Here's what I did so far.
First I created a private/public key pair (in XmlString Format). I took the ExportPublicKey function to generate the public key file from here: https://stackoverflow.com/a/28407693/98491
private static void GeneratePrivatePublicKeyPair() {
    var name = "test";
    var privateKeyXmlFile = name + "_priv.xml";
    var publicKeyXmlFile = name + "_pub.xml";
    var publicKeyFile = name + ".pub";

    using var provider = new RSACryptoServiceProvider(1024);
    File.WriteAllText(privateKeyXmlFile, provider.ToXmlString(true));
    File.WriteAllText(publicKeyXmlFile, provider.ToXmlString(false));
    using var publicKeyWriter = File.CreateText(publicKeyFile);
    ExportPublicKey(provider, publicKeyWriter);
}

Now I can use the public key to encrypt data in my frontend.

(() => {

    const publicKey = `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGy8btrbnSNPz7vWKfQXKxKXzg
28ZD8jCAd7gGYfUIFqKqUcogHWt5gyGvTgEhwBwBP1kYrVnBlhB2nuWHLYpJDI6b
uBoqKrHtrcdgXsKumSP0OKpn0nbYxknOvNYVjUUR6plMboUBaWX1oKoR6pNzTEHS
al4bIU7XMwppkR3KNQIDAQAB
-----END PUBLIC KEY-----`;

    function getSpkiDer(spkiPem) {
      const pemHeader = "-----BEGIN PUBLIC KEY-----";
      const pemFooter = "-----END PUBLIC KEY-----";
      var pemContents = spkiPem.substring(
        pemHeader.length,
        spkiPem.length - pemFooter.length
      );
      var binaryDerString = window.atob(pemContents);
      return str2ab(binaryDerString);
    }

    async function importPublicKey(spkiPem) {
      return await window.crypto.subtle.importKey(
        "spki",
        getSpkiDer(spkiPem),
        {
          name: "RSA-OAEP",
          hash: "SHA-256",
        },
        true,
        ["encrypt"]
      );
    }

    async function encryptRSA(key, plaintext) {
      let encrypted = await window.crypto.subtle.encrypt(
        {
          name: "RSA-OAEP",
        },
        key,
        plaintext
      );
      return encrypted;
    }

    function str2ab(str) {
      const buf = new ArrayBuffer(str.length);
      const bufView = new Uint8Array(buf);
      for (let i = 0, strLen = str.length; i < strLen; i++) {
        bufView[i] = str.charCodeAt(i);
      }
      return buf;
    }

    function ab2str(buf) {
      return String.fromCharCode.apply(null, new Uint8Array(buf));
    }

    async function encrypt(plaintext) {
      const pub = await importPublicKey(publicKey);
      const encrypted = await encryptRSA(
        pub,
        new TextEncoder().encode(plaintext)
      );
      const encryptedBase64 = window.btoa(ab2str(encrypted));
      console.log(encryptedBase64);
    }

    encrypt("I want to decrypt this string in C#");

    })();

However: If I want to decrypt the code in my backend again, this fails
private static void Decrypt()
{
    var name = "test";
    var encryptedBase64 = @"Rzabx5380rkx2+KKB+HaJP2dOXDcOC7SkYOy4HN8+Nb9HmjqeZfGQlf+ZUa6uAfAJ3oAB2iIlHlnx+iXK3XDIX3izjoW1eeiNmdOWieNCu6YXqW4denUVEv0Z4EpAmEYgVImnEzoMdmPDEcl9UHgdWUmS4Bnq6T8Yqh3UZ/4NOc=";
    var encrypted = Convert.FromBase64String(encryptedBase64);
    using var privateKey = new RSACryptoServiceProvider();
    privateKey.FromXmlString(File.ReadAllText(name + "_priv.xml"));
    var decryptedBytes = privateKey.Decrypt(encrypted, false);
    var dectryptedText = Encoding.UTF8.GetString(decryptedBytes);
}

I tried privateKey.Decrypt(encrypted, false); which throws
Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Wrong parameter
    CapiHelper.DecryptKey(SafeKeyHandle safeKeyHandle, Byte[] encryptedData, Int32 encryptedDataLength, Boolean fOAEP, Byte[]& decryptedData)
    RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP)

and privateKey.Decrypt(encrypted, false); which throws
System.Security.Cryptography.CryptographicException: Cryptography_OAEPDecoding,
    CapiHelper.DecryptKey(SafeKeyHandle safeKeyHandle, Byte[] encryptedData, Int32 encryptedDataLength, Boolean fOAEP, Byte[]& decryptedData)
    RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP)

Note: I verified that I can sucessfully encrypt/decrypt data in the backend with the private_key/public keys in xml format.
And I verified that I can sucessfully encrypt/decrypt data in the frontend with the
private/public keys in PEM format.
The thing that does not work is decrypt a string in C# that is encrypted in the frontend with javascript.
What am I doing wrong?
For reference (Just generated for this purpose)
private key
-----BEGIN PRIVATE KEY-----
MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAMbLxu2tudI0/Pu9
Yp9BcrEpfODbxkPyMIB3uAZh9QgWoqpRyiAda3mDIa9OASHAHAE/WRitWcGWEHae
5YctikkMjpu4Gioqse2tx2Bewq6ZI/Q4qmfSdtjGSc681hWNRRHqmUxuhQFpZfWg
qhHqk3NMQdJqXhshTtczCmmRHco1AgMBAAECgYEAokAVN02wOQm4ZPp4cMSpCEF1
Q8z8L96OiXusvcDbjWN0FhC1KKr6We2V44+FyvcRpE8At+xcMmz5OOeNLFwV3QLZ
GOYjZXP5dmRC3mG7HOv0Iu4QqAQCMEzLf998+6RwA24U74ysm+6CVCeVWZLtJSi/
UdQm3jho086iQF9UOo0CQQDjjhZl/fOqqb9nvW3rvSNwsdzSYoGpfx22uzrJplN2
wpFO6XCorAGMO6lHI3Ua8A0OSNO1ybkhG2iZOkPoEGWHAkEA36VhsUFNQr4RO7gL
oWpB+D2QtciZjnHm+QGRlfDl1mq527LHnHURrBQVRcHR3OgQbJ1wsSi4IjcKJ3l6
EtcBYwJBAKRTtIsc1D0XbljdLCcEJDa6yuvHJTmgyXVvSenbSgTGRycEX03/QPLj
FsB/s46rcdIx92kc7qsg3u1gbS+Fv7sCQQC5QHaxqxPiayo/O2524FuQ0v5hda6s
rXDTZhdACnF3sKQPdgGeeeKPlXshczDxOVERh0BnnwEXZlwE4rzZijtdAkEA2gXb
e/4gNIAuowBdgs1nXtuLKTP/HJzPIfil6zcF82Jc5dy7lR7nJCl088w0t1a0ebx5
LrC2qjX4SMEUbMTkNg==
-----END PRIVATE KEY-----`

public key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGy8btrbnSNPz7vWKfQXKxKXzg
28ZD8jCAd7gGYfUIFqKqUcogHWt5gyGvTgEhwBwBP1kYrVnBlhB2nuWHLYpJDI6b
uBoqKrHtrcdgXsKumSP0OKpn0nbYxknOvNYVjUUR6plMboUBaWX1oKoR6pNzTEHS
al4bIU7XMwppkR3KNQIDAQAB
-----END PUBLIC KEY-----

private key xml
<RSAKeyValue><Modulus>xsvG7a250jT8+71in0FysSl84NvGQ/IwgHe4BmH1CBaiqlHKIB1reYMhr04BIcAcAT9ZGK1ZwZYQdp7lhy2KSQyOm7gaKiqx7a3HYF7Crpkj9DiqZ9J22MZJzrzWFY1FEeqZTG6FAWll9aCqEeqTc0xB0mpeGyFO1zMKaZEdyjU=</Modulus><Exponent>AQAB</Exponent>
444WZf3zqqm/Z71t670jcLHc0mKBqX8dtrs6yaZTdsKRTulwqKwBjDupRyN1GvANDkjTtcm5IRtomTpD6BBlhw==
<Q>36VhsUFNQr4RO7gLoWpB+D2QtciZjnHm+QGRlfDl1mq527LHnHURrBQVRcHR3OgQbJ1wsSi4IjcKJ3l6EtcBYw==</Q><DP>pFO0ixzUPRduWN0sJwQkNrrK68clOaDJdW9J6dtKBMZHJwRfTf9A8uMWwH+zjqtx0jH3aRzuqyDe7WBtL4W/uw==</DP><DQ>uUB2sasT4msqPztuduBbkNL+YXWurK1w02YXQApxd7CkD3YBnnnij5V7IXMw8TlREYdAZ58BF2ZcBOK82Yo7XQ==</DQ><InverseQ>2gXbe/4gNIAuowBdgs1nXtuLKTP/HJzPIfil6zcF82Jc5dy7lR7nJCl088w0t1a0ebx5LrC2qjX4SMEUbMTkNg==</InverseQ><D>okAVN02wOQm4ZPp4cMSpCEF1Q8z8L96OiXusvcDbjWN0FhC1KKr6We2V44+FyvcRpE8At+xcMmz5OOeNLFwV3QLZGOYjZXP5dmRC3mG7HOv0Iu4QqAQCMEzLf998+6RwA24U74ysm+6CVCeVWZLtJSi/UdQm3jho086iQF9UOo0=</D></RSAKeyValue>

public key xml
<RSAKeyValue><Modulus>xsvG7a250jT8+71in0FysSl84NvGQ/IwgHe4BmH1CBaiqlHKIB1reYMhr04BIcAcAT9ZGK1ZwZYQdp7lhy2KSQyOm7gaKiqx7a3HYF7Crpkj9DiqZ9J22MZJzrzWFY1FEeqZTG6FAWll9aCqEeqTc0xB0mpeGyFO1zMKaZEdyjU=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

Update
Just to make it clear what I want to achive. I am aware that using a private in a browser might be a bad idea. But in my case this is required:
App 1
Internal webapp that needs to write encrypted data to an NDEF Tag using Web NFC API and is the one that needs the private key.
App 2
Webapp that reads the encrypted data from the NEDF tag and transfers it to a .NET Webapp (App 3)
App 3
Reads the encrypted data from App 2 and decrypts it.

A: Both codes use different paddings, on the JavaScript side OAEP (with SHA256), on the C# side PKCS#1 v1.5. For decryption to be possible on the C# side, OAEP with SHA256 must be used there as well.
You have not specified a .NET version. Under .NET Core 3.0+ or .NET 5+ decryption is possible e.g. with:
...
using var privateKey = RSA.Create();
...
var decryptedBytes = privateKey.Decrypt(encrypted, RSAEncryptionPadding.OaepSHA256);
...

and gives as plaintext for the posted ciphertext and keys: The bunny hops at teatime.

RSACryptoServiceProvider.Decrypt(Byte[], Boolean) uses PKCS#1 v1.5 if the second parameter is set to false. If the second parameter is set to true OAEP is applied, but with SHA1.
RSACryptoServiceProvider.Decrypt(Byte[], RSAEncryptionPadding) allows setting OAEP with SHA256, but a runtime error occurs because only SHA1 is supported (s. Remarks).
Therefore a change to e.g. RSA.Decrypt(Byte[], RSAEncryptionPadding) is necessary for OAEP with SHA256.

A: In addition to @Topaco's correct answer, decryption is still possible on older versions of .NET by changing the hashing algorithm to SHA-1 in both Javascript and C# thusly:
async function importPublicKey(spkiPem) {
            return await window.crypto.subtle.importKey(
                "spki",
                getSpkiDer(spkiPem),
                {
                    name: "RSA-OAEP",
                    hash: "SHA-1",    //// <-  SHA-1 here for older .NET decryption
                },
                true,
                ["encrypt"]
            );
        }

and
 using (var privateKey = RSA.Create())
 {
      privateKey.FromXmlString(privKey);
      var dectryptedBytes = privateKey.Decrypt(encrypted, RSAEncryptionPadding.OaepSHA1);
      // ^^^^^^^^^ OaepSHA1 here for older versions of .NET ^^^^^^
      var dectryptedText = Encoding.UTF8.GetString(dectryptedBytes);
 }

A: You need to encrypt with the private key and then decrypt with the public key


text:
Q: Launch spring batch jobs from control-m I developed jobs in Spring Batch to replace a data loading process that was previously done using bash scripts.
My company's scheduler of choice is control-m. The old bash scripts were triggered from control-m on file arrival using a file watcher.
For reasons beyond my control, we still need to use control-m. Using Spring Boot or any other framework tied to a webserver is not a possibility.
The safe approach seems to be to package the spring batch application as a jar and trigger from control-m the job using "java -jar", but this doesn't seem the right way considering we have 20+ jobs.
I was wondering if it's possible to trigger the app once (like a deamon) and communicate with it using JMS or any other approach. In this way we wouldn't need to spawn multiple jvms (considering jobs might run simultaneously).
I'm open to different solutions. Feel free to teach me the best way to solve this use case.

A:
The safe approach seems to be to package the spring batch application as a jar and trigger from control-m the job using "java -jar", but this doesn't seem the right way considering we have 20+ jobs.

IMO, running jobs on demand is the way to go, because it is the most efficient way to use resources. Having a JVM running 24/7 and make it run a batch job once a while is a waste of resource as the JVM will be idle between run schedules. If your concern is the packaging side of things, you can package all jobs in a single jar and use the spring boot property spring.batch.job.names at launch time to specify which job to run.

I was wondering if it's possible to trigger the app once (like a deamon) and communicate with it using JMS or any other approach. In this way we wouldn't need to spawn multiple jvms (considering jobs might run simultaneously).

I would recommend to expose a REST endpoint in your JVM and implement a controller that launches batch jobs on demand. You can find an example in the Running Jobs from within a Web Container section. In this case, the job name and its parameters could passed in as request parameters.
Another way is to use a combination between Spring Batch and Spring Integration to launch jobs using JMS requests (JobLaunchRequest). This approach is explained in details with code examples in the Launching Batch Jobs through Messages.

A: In addition to the helpful answer from Mahmoud, Control-M isn't great with daemons. Sure, you can launch a daemon but anything running for a substantial length of time (i.e. into several weeks and beyond) is prone to error and you can often end up with daemons that are running that Control-M is no longer "aware" of (e.g. if the system has issues that cause the Control-M Agent to assume the daemon job has failed and then launches another one).
When I had no other methods available I used to add daemons as batch jobs in Control-M but there was an overhead in additional jobs that checked for multiple daemons, did the stop/starts and various housekeeping tasks. Best avoided if possible.