text:
Q: Magic Trackpad 2 is not recognized as synpatic touchpad I have found a lot of posts on the Internet working with Apple Magic Trackpad on Ubuntu. I bought Apple Magic Trackpad 2 and seems like it is not recognized as a touchpad. I can do left click and cursor movements, but nothing else (not scrolling, no two-finger click, ...). Any ideas on how I can make it work?

A: There is a driver available for the Apple Magic Trackpad 2 on Github. Highlights from the README.md file:

*

*robbi5 created a dkms package with the driver that is known to work with kernel 4.4.0-57-generic on Ubuntu 16.04 LTS

*Used this driver in combination with the mtrack-driver, to make use of the multitouch feature (e.g. 2-finger-tap for right-click, etc)

*Right now the driver only works over USB. OP has submitted an official patch to linux-input.


text:
Q: configure aws lambda and api gateway to return binary data for image/avif content-type There's no shortage of questions and blog posts about binary data using aws lambda and api gateway, but surprisingly I haven't been able to find anything related to AVIF images. This is important because of this issue in chromium. Essentially the chrome team recently added "image/avif" to the beginning of its Accept header for images, and that's causing my endpoint to return the base64 string of an image rather than the binary data. If I repeat the same request using curl and remove the "image/avif" from the Accept header, I get the binary data. Concretely:

*

*accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 yields binary data

*accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8 yields base64 data (and the image is broken in the webpage)

*accept: image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8 yields binary data
From the discussion in the chromium thread, it seems that the solution is to update my endpoint to respond with the appropriate binary data when the Accept header begins with "image/avif". However, this is proving difficult for me. The closest I've come is this answer. I've followed those steps to update my API gateway config but I'm still getting base64 data when the Accept header begins with "image/avif". And I haven't found any posts specifically referring to this issue.

A: As it turns out that guide I linked to in the post had all the necessary steps, but the "save changes" button in the API Gateway dashboard doesn't actually deploy your changes. You have to go to Resources > Actions > Deploy API to make the changes live.

redpajama_set_name: RedPajamaStackExchange


text:
Q: functional dependencies in SQL databases Normal forms There are two functional dependencies in the SQL databases.
a) Partial functional dependency: A non-key column is dependent on some, but not all of the columns in a composite primary key.
b) Transitive functional dependencies: Any non-key column depends on other non-key columns.
For a good SQL database.
Rule 1: Columns contain only atomic values
Rule 2: No repeating groups of data
Rule 3: Have no partial dependencies
Rule 4: having no transitive dependencies
I've understood the requirements of the 1 and 2nd rules, why do we need the 3rd and 4th rules, instead of saying the no column shouldn't depend on other columns. Why is there two separate rules (3 and 4)?
Source: Head First SQL
Thanks in advance!

A: Good question. It is purely for historical and pedagogical reasons that these two are often separated.
Second Normal Form (2NF) is concerned with eliminating only partial key dependencies. 2NF alone normally isn't especially important because the Third Normal Form, Boyce Codd Normal Form and higher normal forms also eliminate those same partial key dependencies and those NFs (> 2NF) are usually the desired goal in database design. However, it is common practice to teach normalization using a process of decomposition. By the decomposition method, partial key dependencies are usually considered first. In reality this is rarely done by most practioners who will often consider all dependencies at once.
Definitions of Normal Forms higher than 2NF don't necessarily mention partial key dependencies as a special case at all. Boyce Codd Normal Form can be briefly summarised as meaning that every non-trivial functional determinant is a superkey - in other words, no non-trivial FDs (of any kind) on anything other than keys.


text:
Q: android error occured while executing doInBackground() I am getting the error 'error occured while executing doInBackground()'
Here is my ASyncTask class:
private class ASyncPollServer extends AsyncTask<String, Void, String>{

    @Override
    protected String doInBackground(String... params) {
        String pollResult = "";
        if(((ChatApplication) _instance.getApplication()).isPolling() == false){
        ((ChatApplication) _instance.getApplication()).setPolling(true);
        pollResult = ((ChatApplication) _instance.getApplication()).GetConnectionManager().PollServer();
    }
        return pollResult;
        }

    @Override
    protected void onPostExecute(String result) {
        if(result != ""){
            HandlePollResult(result);
            ((ChatApplication) _instance.getApplication()).setPolling(false);
        }

    }

}

And my TimerTask to call it:
private Handler handler = new Handler();
public class ServerPollTimer extends TimerTask {
    private Runnable runnable = new Runnable() {
        public void run() {
            ExecutePollServer();
        }
    };

    public void run() {
        handler.post(runnable);
        }
    }

And my ExecutePollServer method:
private void ExecutePollServer(){
    ASyncPollServer task = new ASyncPollServer();
    task.execute();
}

And where I call the timer in the OnCreate():
new Timer().schedule(new ServerPollTimer() , 0, 5000);

Here is my stacktrace:
05-30 09:46:16.020: E/AndroidRuntime(340): FATAL EXCEPTION: AsyncTask #1
05-30 09:46:16.020: E/AndroidRuntime(340): java.lang.RuntimeException: An error occured while executing doInBackground()
05-30 09:46:16.020: E/AndroidRuntime(340):  at android.os.AsyncTask$3.done(AsyncTask.java:200)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
05-30 09:46:16.020: E/AndroidRuntime(340):  at java.lang.Thread.run(Thread.java:1019)
05-30 09:46:16.020: E/AndroidRuntime(340): Caused by: java.lang.IllegalStateException: No wrapped connection.
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.conn.AbstractClientConnAdapter.assertValid(AbstractClientConnAdapter.java:163)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:269)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:119)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:421)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
05-30 09:46:16.020: E/AndroidRuntime(340):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
05-30 09:46:16.020: E/AndroidRuntime(340):  at chatclient.utility.HttpPostNetworkUtility.PerformPost(HttpPostNetworkUtility.java:43)
05-30 09:46:16.020: E/AndroidRuntime(340):  at chatclient.utility.ConnectionManager.ExecuteCommand(ConnectionManager.java:213)
05-30 09:46:16.020: E/AndroidRuntime(340):  at chatclient.utility.ConnectionManager.PollServer(ConnectionManager.java:192)
05-30 09:46:16.020: E/AndroidRuntime(340):  at chatclient.namespace.MainWindowActivity$ASyncPollServer.doInBackground(MainWindowActivity.java:402)
05-30 09:46:16.020: E/AndroidRuntime(340):  at chatclient.namespace.MainWindowActivity$ASyncPollServer.doInBackground(MainWindowActivity.java:1)

Any help would be GREATLY appreciated!
Thank you!

A: This answer would suggest that you should use a ThreadSafeClientConnManager within your pollResult = ((ChatApplication) _instance.getApplication()).GetConnectionManager().PollServer();.
I'd also replace ((ChatApplication) _instance.getApplication()) with a member variable initialised in onPreExecute or similar.


text:
Q: Koa: What is the most sensible way to connect to a database without an existing wrapper? I am very new to node & koa, so please excuse my stupidity.
I am not sure if I mess something up. But I would like to use Koa together with OrientDB. I can connect to OrientDB using Oriento (the module for Node). And I would like to use the power of generators of Koa.
Since the data in my OrientDB database relates to objects I'm using in my app, I would like to implement models (of course). So I guess the connecting to the database part would go in to that.
Say I had a model named "Task" then I would like it to expose a couple of methods and getters/setter. So Task.find(); should get all Tasks from the OrientDB Database
As far as I understand it, I would hook that somewhere in the middleware stack. And it would be nice if I could use generators so that my middleware waits until it gets the data back, using yield. Some error handling would be good as well...
With all that said:

*

*Are my assumptions correct? Or is there a better way?

*Do I have to do that all myself? Or am I missing modules that facilitate what I am
planning?

*What would be a good point to start learning on how to properly do something like that?

*Should I just look at existing wrappers for mongodb/mysql/whatever and abstract from that?

Thanks!

A: I've never used orient-db, but looking at the github page it looks like it offers a connection pool and returns promises.  Based on that I would do something like this:
// in utils/oriento.js or similar
// instantiate it once and share in multiple places(models), since it offers
// connection pooling
var Oriento = require('oriento');
var server = Oriento({
  host: 'localhost',
  port: 2424,
  username: 'root',
  password: 'yourpassword'
});
var db = server.use({
  name: 'mydb',
  username: 'admin',
  password: 'admin'
});
module.exports = db;

then for models:
// models/item.js
var db = require('../utils/oriento.js');

var Item = function(props){

};

Item.findById = function(id){
    // db.query returns a promise
    return db.query('select from OItem where id=:id', {
      params: {
        id: id
      },
      limit: 1
    });

}
// add getters, setters, find etc...
module.exports = Item;

then in controllers:
// server.js or wherever

var Item = require('./models/item');

app.get('/:id', function *(){
    var id = this.params.id;
    this.body = yield Item.findById(id);
}

Hopefully this helps
You might want to checkout my screencasts on koajs at http://knowthen.com


text:
Q: Given two unbiased estimators, show that a third value is also an unbiased estimator Consider $\hat\theta_a$ and $\hat\theta_b$ are uncorrelated, unbiased estimators of $\theta$. In addition, the variance of $\hat\theta_a$  is twice that of $\hat\theta_b$. Show that for any constant $k$, the weighted average $\hat\theta_a(k)+\hat\theta_b(1-k)=\hat\theta_c$ is also an unbiased estimator of $\theta$.

How should I approach this question? Should I start by figuring the variances into the equation somehow, or can it be shown just by manipulating the given equation? Thank you.

A: $$\hat\theta_c = k\hat\theta_a + (1-k)\hat\theta_b$$
Taking expectation on both sides
\begin{align*}
E(\hat\theta_c) = kE(\hat\theta_a) + (1-k)E(\hat\theta_b) && (1)
\end{align*}
Since $\theta_a$ and $\hat\theta_b$ are unbiased estimator of $\theta$, hence $E(\hat\theta_a) = \theta$ and $E(\hat\theta_b) = \theta$.
Substituting the same in (1) we get
$$E(\hat\theta_c) = kE(\hat\theta_a) + (1-k)E(\hat\theta_b) = k\theta + (1-k)\theta = k\theta + \theta - k\theta = \theta$$
Since $E(\hat\theta_c) = \theta$, $\hat\theta_c$ is also an unbiased estimator for $\theta$.

A: Start with the definition of unbiased estimator from, say, here. Then, for our model $\text{Pr}_{\theta}(x) = \text{Pr}(x|\theta)$, the bias for a given estimator $\hat{\theta}$, is: $$\text{Bias}_{\theta}(\hat{\theta}) = \mathbb{E}_{x|\theta}\left[\hat{\theta}\right] - \theta$$ in which $\mathbb{E}_{x|\theta}$ is the expected value over the distribution $\text{Pr}(x|\theta)$.
The problem statement gives us that $\text{Bias}_{\theta}(\hat{\theta}_a) = \text{Bias}_{\theta}(\hat{\theta}_b) = 0$ and that, for $k\in\mathbb{R}$, $\hat{\theta}_c \equiv k\hat{\theta}_a + (1-k)\hat{\theta}_b$. That $\hat{\theta}_c$ be unbiased for $\theta$ means that $\text{Bias}_{\theta}(\hat{\theta}_c) = 0 \iff \mathbb{E}_{x|\theta}\left[\hat{\theta}_c\right]=\theta$. To that end,
$$\begin{align}\mathbb{E}_{x|\theta}\left[\hat{\theta}_c\right] &= \mathbb{E}_{x|\theta}\left[k\hat{\theta}_a + (1-k)\hat{\theta}_b\right] \\ &= \mathbb{E}_{x|\theta}\left[k\hat{\theta}_a\right] + \mathbb{E}_{x|\theta}\left[(1-k)\hat{\theta}_b\right] \\ &= k\mathbb{E}_{x|\theta}\left[\hat{\theta}_a\right] + (1-k)\mathbb{E}_{x|\theta}\left[\hat{\theta}_b\right] \\ &= k\theta + (1-k)\theta \\ &= k\theta + \theta - k\theta \\ &= \theta \ \ \ \square \end{align}$$
by the linearity of expectation.


text:
Q: Why do i get this error: Swagger UI 404 error on SpringBoot Hello everyone i have a problem with Swagger ui. Actually my code was working and i could see the Swagger UI but i can't see now and i didn't change anything.
I got the error this when i refresh the page on Console:
Failed to load resource: the server responded with a status of 404 ()

My SpringFoxConfigClass:
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class SpringFoxConfig implements WebMvcConfigurer {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
    }
}

My pom.xml file:
<dependency>

            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>


text:
Q: How do you compute each row of foreach double value to compute into a SINGLE value? Right now I have this logic behind my code:
INSERT INTO PAYMENT (amount, appointmentID) VALUES
(@amount1, @app1),
(@amount2, @app2),
(@amount3, @app3),
...

Let's say @amount1 is 10, @amount2 is 15, @amount3 is 20
How do i compute the TOTAL value of amount1, amount2, amount 3, etc. and submit it into the database as a total value of 45 in this manner: (@amount1, @app1)?  how do I approach this kind of logic?
This is what I have for my button click code:
string cMedication = string.Empty;
string cQuantity = string.Empty;
string cAppointment = string.Empty;
foreach (DataGridViewRow row in this.dataPrescription.Rows)
{
    cMedication = row.Cells[0].Value.ToString();
    cQuantity = row.Cells[1].Value.ToString();
    cAppointment = txtAppointmentID.Text;

    if (cAppointment == "NO APPOINTMENT HAS BEEN MADE")
    {
        MessageBox.Show("Please make an appointment first at the Nurse counter", "WARNING");
    }
    else
    {
        this.calculateTotal(cMedication, cQuantity, cAppointment);
    }
}

and this is my calculateTotal function:
private void calculateTotal(string cMedication, string cQuantity, string cAppointment)
{
    string strConnectionString = ConfigurationManager.ConnectionStrings["HConnection"].ConnectionString;
    SqlConnection con = new SqlConnection(strConnectionString);

    string insertPayment = "INSERT INTO PAYMENT (amount, appointmentID) " +
        "VALUES (@insertAmount, @insertAppointment)";

    using (SqlConnection connection = new SqlConnection(strConnectionString))
    {
        using (SqlCommand cmdPayment = new SqlCommand(insertPayment, connection))
        {
            string strPrice = "SELECT medicationPrice FROM MEDICATION WHERE medicationName= @getName";
            SqlCommand cmdPrice = new SqlCommand(strPrice, con);
            cmdPrice.Parameters.AddWithValue("@getName", cMedication);

            con.Open();
            SqlDataReader readPrice = cmdPrice.ExecuteReader();
            if (readPrice.Read())
            {
                string getPrice = readPrice["medicationPrice"].ToString();
                double doublePrice = Convert.ToDouble(getPrice);
                double doubleQuantity = Convert.ToDouble(cQuantity);

                double result = doublePrice * doubleQuantity;

                string answer = result.ToString();
                cmdPayment.Parameters.AddWithValue("@insertAmount", answer);
            }

            readPrice.Close();
            con.Close();

            cmdPayment.Parameters.AddWithValue("@insertAppointment", txtAppointmentID.Text);

            connection.Open();
            cmdPayment.ExecuteNonQuery();
            connection.Close();
        }
    }
}

A: You need to avoid too many roundtrips to the database. A couple select-insert statements inside a loop is not considered a best practice.
I'd try to use a INSERT INTO SELECT statement. Something like:
INSERT INTO PAYMENT (amount, appointmentID)
SELECT price * quantity, appointmentID FROM MEDICATION
INNER JOIN APPOINTMENT
ON "whatever_matches_medications_and_appointments"


text:
Q: Dynamically change stylesheet onclick anywhere on site I was wondering if there's a way to keep changing the stylesheet (so a series of five or so) of the whole page every time the user clicks anywhere at all.
Maybe using the $(document).click function?

A: Give your main <link> tag an id  and create array of the href url's you want.
<link data-style_index="0" id="main-style" href="main.css" rel=.... >

jQuery:
var styles =['url1.css','url2.css','url3.css'...];

$(document).click(function(){
   var $link =$('#main-style'),
       // get index stored on element data and increment
       nextIndex = $link.data('style_index') + 1;
   //revert to first if at last one already
   if( nextIndex === styles.length){
      nextIndex = 0;
    }
    // change the href and store new index value in tag data
    $link.attr('href', styles[nextIndex]).data('style_index', nextIndex);

});

Using the element itself to store the current index for the styles array in html5 data- attribute

A: selects all tags inside body and on click change color property to #ccc:
$('*','body').click(function() { $(this).css('color', '#cccccc'); });


text:
Q: 2 (or 3 or 4...) websites in IIS, pointing to same ASP.NET application IIS I wish to maintain a single a single code base (ASP.NET app) setup at c:\inetpub\wwwroot\myApp, and point several IIS websites at this single code base.
Will this be an issue? Will IIS see this as a conflict in resource allocation?
Reasons why I want to do it:

*

*Each IIS website can then have it's own IP, SSL cert, etc.

*Each IIS website can have it's own ISAPI filters installed for friendly URLs, etc.

*Easier to maintain the code base by having single point of deployment

A: From a sysadmin perspective, this is perfectly fine, and you can add multiple host headers to IIS so that it supports multiple IP addresses and domain names on the same website.
It would be up to your application to handle friendly URL's etc. based on the domain name... but that's a question for stackoverflow :)

A: Yes, this is possible. Binding-wise you have both IPs and host header bindings. I would have to warn about individualized configuration. Relying on the local web.config files will cause all sites to share the same configuration. You would have to rely on configuration based on location elements.
<location path="Site1">
<!-- Site 1 individual config -->
</location>
<location path="Site2">
<!-- Site 2 individual config -->
</location>

Of course, configuration that will be shared amongst all of the sites can be done via local web.config files or by inheritance.


text:
Q: How to Dispose resources when the WPF form close When i tried to analyze my WPF (MVVM) application,it is found that after opening a page memory is increasd and at the time of close this page,it won't free that memory.So that the performance analyzer shows no decrease in resource at the time of form close.
After opening the particular page again,it is found that memor is again increase up to a level.It is still not disposing the memory.Please let me know if anyone know the reason.
Regards
Sreyas MN

A: sa_ddam answers this question quite well here. Further down on the same page, there is a link to an MSDN blog that has a nice table of possible leak scenarios.
Finally, Redgate posted and nice article on what they believe are the Top 5 memory leaks in WPF.
I hope this helps.


text:
Q: couldn't get data from editText android studio i created a login form and want to check user credentials is correct or wrong.
but before i found, i could not get editText value in string variables.
so please help me to store editText value.
my java code
private String output;
private Toolbar toolbar;
private Button button;
public EditText Username,Password;
public String myURL,userValue23,passValue;

List<DataModel> loginList;

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

    toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);

    Username = (EditText) findViewById(R.id.etUsername);
    Password = (EditText) findViewById(R.id.etPassword);

    userValue23 = Username.getText().toString();
    passValue = Password.getText().toString();

    button = (Button) findViewById(R.id.btn_login);
    button.setOnClickListener(this);
}
@Override
public void onClick(View v) {

    if(v.getId()==R.id.btn_login)
    {
        if(inOnline())
        {
            if(userValue=="")
            {
                Toast.makeText(this, "tees", Toast.LENGTH_LONG).show();
            }else{
                Toast.makeText(this, userValue+"tees", Toast.LENGTH_LONG).show();
            }
        }
        else
        {
            Toast.makeText(this, "Network isn't available", Toast.LENGTH_LONG).show();
        }
    }
}

In XML code i created Login Form with two editText Form, and these ID's are respectively etUsername, etPassword, btn_login

A: Put these
userValue23 = Username.getText().toString();
passValue = Password.getText().toString();

inside onClick method
public void onClick(View v) {

if(v.getId()==R.id.btn_login)
{
    userValue23 = Username.getText().toString();
    passValue = Password.getText().toString();
    if(inOnline())
    {
        if(userValue23=="")
        {
            Toast.makeText(this, "tees", Toast.LENGTH_LONG).show();
        }else{
            Toast.makeText(this, userValue23+"tees", Toast.LENGTH_LONG).show();
        }
    }
    else
    {
        Toast.makeText(this, "Network isn't available", Toast.LENGTH_LONG).show();
    }
}
}

A: You need to move these two lines
userValue23 = Username.getText().toString();
passValue = Password.getText().toString();

inside the OnClick method. Otherwise they will always be empty OnCreate.

A:      if(inOnline())
            {
                if(userValue=="")
                {
                    Toast.makeText(this, "tees", Toast.LENGTH_LONG).show();
                }else{

**You Use value That Name is userValue but you didn't define it, but you Define it you define userValue23 .. fix it and dont need move your varibale to onclick function
   **
                    Toast.makeText(this, userValue+"tees", Toast.LENGTH_LONG).show();
                }
            }


text:
Q: Junk characters in Marshal.PtrToStringAnsi In below code, pcp_Out is supposed to return system date in ANSI format.

*

*system date is returned but it has some junk characters in front?

*Is AllocHGlobal right way to initialize out IntPtr?
   [DllImport("Open32env.dll", CharSet = CharSet.Ansi, ExactSpelling = false, EntryPoint = "CallOPLFunction", CallingConvention = CallingConvention.StdCall)]
    static extern int CallOPLFunction(long pl_Instr, IntPtr pcp_In, out IntPtr pcp_Out, out IntPtr pcp_ErrorMessage);

    static void Main(string[] args)
    {
        IntPtr OutPtr = Marshal.AllocHGlobal(0);
        IntPtr ErrorPtr = Marshal.AllocHGlobal(0);
        IntPtr inPtr = Marshal.StringToHGlobalAnsi("");

        long invalue = 0;

        int ret = CallOPLFunction(invalue, inPtr, out OutPtr, out ErrorPtr);

        string Outstring = Marshal.PtrToStringAnsi(OutPtr,30);

        Marshal.FreeHGlobal(OutPtr);
        Marshal.FreeHGlobal(ErrorPtr);
        Marshal.FreeHGlobal(inPtr);
    }

The output
Outstring = "h\0Qr\0\0\0\0Ä<g\a?\004/22/13 10:25"

A: I think, better way to allocate memory to empty pointer is:
IntPtr OutPtr = new IntPtr();
IntPtr ErrorPtr = new IntPtr();

If pcp_Out is Unicode string, then try to use:
CharSet = CharSet.Unicode


text:
Q: How to make a header image respond to changes in screen size? The header image on the website I am working on responds to changes in screen size when going down in size (smaller) however, does not respond when going to a bigger screen size.
Link: Removed
If you go to a smaller screen size, refresh, and then expand the window, you will see the problem. The bottom of the image becomes cut off with a black space filling the area.
HTML:

CSS:
.intro { position: relative; text-align: center; color: #fff; background-color: #000; max-height: 100vh; overflow: hidden;}
.intro-inner { position: absolute; bottom: 0; top: 0; left: 0; right: 0; }
.intro:after { content: ''; display: block; padding-top: 45%; }
.intro:before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 40%); z-index: 3; }

.intro-bg { position: fixed !important; height: 100% !important; }

A: Since you are using bootstrap, try to use the class "img-responsive" for the logo
and adjust the logo width using media queries for each screen size

A: The problem persisted when viewing the website from a mobile device only. A less than ideal solution I came up with was to set the height of the image to be the WIDTH of the screen when on any screen size smaller than a laptop.
CSS:
@media only screen and (max-device-width: 1024px) and (orientation: landscape) {
  .intro-bg {
    height: 100vw !important;
  }
}


text:
Q: My mobile responsive website is not resizing properly i have a website in development phase. The default view looks fine, but when the browser is re-sized, instead of being gracefully responsive, the images and fonts looks too stretched or squeezed. I have attached two images here. Pls advice what is wrong. Thank You.

A: If the image is the background, trying adding:
background-size: cover;

to those divs.
This will make the image large enough to fill its container while maintaining the original ratio.
If the image is just an img and not the background-image, if you switch it, it should work.

A: When you add this CSS with your background image it take 100% width in all browser size. Image not stretch after adding this css.
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
height: 100%;
width: 100%;


text:
Q: ThreeJS : Culling hide a mesh which is not visible to the user I'm working in threejs occlusion culling where I want to hide the object which is not visible to the view of the user. In this scenario, If I hide the element, I think the data of the element will be presented in the DOM which inturn it is not optimized and the draw calls will remain the same but only I hide the object. So, I have no idea what must I do with the unwanted object which is not visible to the user, should I have to hide it or what can I do to reduce the call of the object when it's not in the view and bring that back to it's normal state when it's visible.
Thanks in advance!

A: THREEJS performs frustum culling by default.
It will still do a bounding box/frustum check during render to see if the object became visible.
If you want to avoid that, you can set .frustumCulled = false on your object, and then toggle the .visible flag on the object yourself, according to your algorithm.


text:
Q: R: Using the bigmemory library for classification with randomForest has anyone been able to set up a classification (not a regressions) using randomForest AND the bigmemory library. I am aware that the 'formula approach" cannot be used and we have to resort to the "x=predictors, y=response approach". It appears that the big memory library is unable to deal with a response vector that has categorical values (its a matrix, after all). In my case, I have two levels, both represented as characters.
According to the bigmemory documentation..."A data frame will have character vectors converted to factors, and then all factors converted to numeric factor levels"
Any suggested workarounds to get randomForest classification to work with bigmemory?
#EXAMPLE to problem
library(randomForest)
library(bigmemory)
# Removing any extra objects from my workspace (just in case)
rm(list=ls())

#first small matrix
small.mat <- matrix(sample(0:1,5000,replace = TRUE),1000,5)
colnames(small.mat) <- paste("V",1:5,sep = "")
small.mat[,5] <- as.factor(small.mat[,5])
small.rf <- randomForest(V5 ~ .,data = small.mat, mtry=2, do.trace=100)
print(small.rf)
small.result <- matrix(0,1000,1)
small.result <- predict(small.rf, data=small.mat[,-5])

#now small dataframe Works!
small.mat <- matrix(sample(0:1,5000,replace = TRUE),1000,5)
colnames(small.mat) <- paste("V",1:5,sep = "")
small.data <- as.data.frame(small.mat)

small.data[,5] <- as.factor(small.data[,5])
small.rf <- randomForest(V5 ~ .,data = small.data, mtry=2, do.trace=100)
print(small.rf)
small.result <- matrix(0,1000,1)
small.result <- predict(small.rf, data=small.data[,-5])

#then big matrix Classification Does NOT Work :-(
#----------------****************************----
big.mat <- as.big.matrix(small.mat, type = "integer")
#Line below throws error, "cannot coerce class 'structure("big.matrix", package = "bigmemory")' into a data.frame"
big.rf <- randomForest(V5~.,data = big.mat, do.trace=10)

#Runs without error but only regression
big.rf <- randomForest(x = big.mat[,-5], y = big.mat[,5], mtry=2, do.trace=100)
print(big.rf)
big.result <- matrix(0,1000,1)
big.result <- predict(big.rf, data=big.mat[,-5])

A: bigrf package may help. Currently, it supports classification with a limited number of features.


text:
Q: How to read/write flash cookies with php? I have a site where I require to bar some people from accessing it, and creating new accounts due to rampant abuse.
IP banning, setting cookies to identify people proved to be useless since they use proxies and clear cookies.
I would like to save the "ban cookie" into flash, and have php respawn the http cookie if the flash cookie exists. Is there some sort of php/flash API that will allow me to write cookies into flash, and have php read them?

A: There are no PHP libraries for creating Flash files that support local shared objects (Flash cookies).  The only PHP library for generating Flash files is Ming which does not support these.
To do this, you will need to manually create a Flash file that creates a local shared object and put that Flash file on your web page.
The easiest way to do this is to use the open source Flex SDK to compile an Actionscript file.  You will need to learn a little bit of Actionscript to do this.
You can see the API for local shared objects here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2


text:
Q: How to pass a NSMutableArray filled with objects to an UITableView and show the data Setup:
MainViewController holds an NSMutableArray of objects. An object is an instance of my NewContact which has a firstName and a contactImage ivar. When I tap on showAllContactsBtn in MainViewController AllContactsViewController should show all object ivars (firstNames and contactImages) on the table.
I think the problem is that I do not pass the data properly to AllContactsViewController but can't figure out how to fix it. Worth to mention is that I do not see the  NSLog statements in cellForRowAtIndex so maybe the method will not be called at all?
MainViewController.m
- (IBAction)showAllCBtnTapped:(id)sender
{
    AllContactsViewController *nAllCVC = [[AllContactsViewController alloc]init];
    nAllCVC.allContactsArray = self.contactsArray; // Properly passed the data???
    nAllCVC.delegate = self;
    nAllCVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    [self presentModalViewController:nAllCVC animated:YES];
}

AllContactsViewController.h
@interface AllContactsViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

AllContactsViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdent = @"ContactCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdent];

    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdent];
    }

    NewContact *tempContact = [[NewContact alloc]init];

    tempContact = [self.allContactsArray objectAtIndex:[indexPath row]];

    cell.textLabel.text = tempContact.firstName;

    NSLog(@"%@", tempContact.firstName);
    NSLog(@"Test......");

    cell.imageView.image = tempContact.contactPicture;

    [tableView reloadData];

    return cell;
}

Note:
As you can see AllContactsViewController was subclassed from UIVIewController, is this fine or do I have to subclass from UITableViewController despite I set the delegate and datasource properly?

A: Several things to check:
1) How does your property declaration of allContactsArray in AllContactsViewController look like? Is it @property(retain)?
2) You are not forced to subclass UITableViewController although it makes your life easier. In your case be sure that the delegates delegate and dataSource of your UITableView are set correctly.
3) The piece of code NewContact *tempContact = [[NewContact alloc]init]; is not necessary at all, because you get your object from your array.
4) Remove the line of code [tableView reloadData];
5) Be sure that the delegate method - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section is implemented correctly

A: When you create the view controller, its array is initially empty, so from the data source methods, the table view gets the information that the number of rows in (any) section is zero - it'll thus never call the data source for cells to be displayed. Possible solutions:
One. After calling nAllCVC.allContactsArray = self.contactsArray;, call [nAllCVC.tableView reloadData]; (assuming nAllCVC exposes its table view through that property), or better:
Two. Instead of @synthesize-ing the data array of the table view, provide a custom getter and setter that calls the table view automagically; something like this:
- (NSArray *)allContactsArray {
    return _allContactsArray;
}

- (void)setAllContactsArray:(NSArray *)a {
    if (_allContactsArray == a) return;

    [_allContactsArray release];
    _allContactsArray = [a retain];

    [_tableView reloadData];
}

P. s.: you're confusing pointers with the memory pointed to by them. NewContact *tempContact = [[NewContact alloc]init]; is superfluous and is leaking memory.
P. p. s.: don't reload the table view upon requesting every and each cell, that may end up in an infinite loop.

A: To all, thanks for your help, I discovered a minute ago that I re-initialized the array in the viewDidLoad in the AllContactsViewController therefore I think the values were overwritten right after I received them. I deleted the line and now I see the object properties listed correctly in the tableview . Have a nice day


text:
Q: Can't get sshd_config Match User to work Am exploring ssh on my el capitan laptop and have managed to get key-based login to work (using an account called adminuser).  I now want to see if I can get another administrator account (called pwtest) to work using password-based login.
I've just discovered Match User and added it sshd_config but when I ssh pwtest@dplaptop.local and then enter the password I just get "Permission denied, please try again."
sshd_config:
#   $OpenBSD: sshd_config,v 1.95 2015/04/27 21:42:48 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

# See sshd_config(5) for details on setting the Port and Listen values on Mac OS X
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# The default requires explicit activation of protocol 1
#Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Ciphers and keying
#RekeyLimit default none

# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile  .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords both PasswordAuthentication and
# ChallengeResponseAuthentication must be set to "no".
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# Also, PAM will deny null passwords by default.  If you need to allow
# null passwords, add the " nullok" option to the end of the
# securityserver.so line in /etc/pam.d/sshd.
UsePAM no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#XauthLocation xauth # Default is to search $PATH (set by launchd(8)).  It is recommended that a full path be provided.
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation sandbox      # Default for new installations.
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# pass locale information
AcceptEnv LANG LC_*

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    /usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

Match User pwtest
    PasswordAuthentication yes

ssh -vv pwtest@dplaptop.local output:
Unknown-58-b0-35-63-5c-67:~ davidpark$ ssh -vv pwtest@dplaptop.local
OpenSSH_6.9p1, LibreSSL 2.1.7
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to dplaptop.local [fe80::5ab0:35ff:fe63:5c67%en1] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/davidpark/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug2: fd 5 setting O_NONBLOCK
debug1: Authenticating to dplaptop.local:22 as 'pwtest'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:pZ9I3OlB5kUmeKHq4PWADSigAPIAmO7VWK10Pn5Vau4
debug1: Host 'dplaptop.local' is known and matches the ECDSA host key.
debug1: Found key in /Users/davidpark/.ssh/known_hosts:1
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/davidpark/.ssh/id_rsa (0x0),
debug2: key: /Users/davidpark/.ssh/id_dsa (0x0),
debug2: key: /Users/davidpark/.ssh/id_ecdsa (0x0),
debug2: key: /Users/davidpark/.ssh/id_ed25519 (0x0),
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/davidpark/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/davidpark/.ssh/id_dsa
debug1: Trying private key: /Users/davidpark/.ssh/id_ecdsa
debug1: Trying private key: /Users/davidpark/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
pwtest@dplaptop.local's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pwtest@dplaptop.local's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pwtest@dplaptop.local's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,password).

ssh_config:
#   $OpenBSD: ssh_config,v 1.28 2013/09/16 11:35:43 sthen Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# Apple:
 Host *
   SendEnv LANG LC_*
#   AskPassGUI yes

#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication no
#   HostbasedAuthentication yes
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h

system.log content:
Nov  9 15:07:28 Unknown-58-b0-35-63-5c-67 sshd[1868]: Failed password for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49985 ssh2
Nov  9 15:07:51 --- last message repeated 2 times ---
Nov  9 15:07:51 Unknown-58-b0-35-63-5c-67 sshd[1868]: Connection closed by fe80::5ab0:35ff:fe63:5c67%en1 [preauth]
Nov  9 15:07:51 Unknown-58-b0-35-63-5c-67 com.apple.xpc.launchd[1] (com.openssh.sshd.CC0FA77D-7484-4138-96BA-7BC748771FA1[1868]): Service exited with abnormal code: 255

Following @Otheus suggestions:
When I use a plain vanilla sshd_config file i.e.  sudo /usr/sbin/sshd -D -d -f /etc/ssh/sshd_config.plain -p 2020 I can successfully ssh -p 2020 pwtest@dplaptop.local - see debug output below:
...
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user pwtest service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "pwtest"
debug1: PAM: setting PAM_RHOST to "fe80::5ab0:35ff:fe63:5c67%en1"
debug1: userauth-request for user pwtest service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: temporarily_use_uid: 503/20 (e=0/0)
debug1: trying public key file /Users/pwtest/.ssh/authorized_keys
debug1: Could not open authorized keys '/Users/pwtest/.ssh/authorized_keys': No such file or directory
debug1: restore_uid: 0/0
Failed publickey for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49288 ssh2: RSA SHA256:Y4oh+ZwNsE9hrnD+kCGYUkl48TypV0oQxXi9osTozE4
debug1: audit_event: unhandled event 6
debug1: userauth-request for user pwtest service ssh-connection method keyboard-interactive [preauth]
debug1: attempt 2 failures 1 [preauth]
debug1: keyboard-interactive devs  [preauth]
debug1: auth2_challenge: user=pwtest devs= [preauth]
debug1: kbdint_alloc: devices 'pam' [preauth]
debug1: auth2_challenge_start: trying authentication method 'pam' [preauth]
Postponed keyboard-interactive for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49288 ssh2: RSA SHA256:Y4oh+ZwNsE9hrnD+kCGYUkl48TypV0oQxXi9osTozE4 [preauth]
debug1: do_pam_account: called
debug1: PAM: num PAM env strings 2
Postponed keyboard-interactive/pam for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49288 ssh2 [preauth]
debug1: do_pam_account: called
Accepted keyboard-interactive/pam for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49288 ssh2
debug1: monitor_child_preauth: pwtest has been authenticated by privileged process
debug1: monitor_read_log: child log fd closed
debug1: PAM: establishing credentials
User child is on pid 473
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 503/20
debug1: ssh_packet_set_postauth: called
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_req: channel 0 request pty-req reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_new: session 0
debug1: session_pty_req: session 0 alloc /dev/ttys002
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request shell reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
Starting session: shell on ttys002 for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49288
debug1: Setting controlling tty using TIOCSCTTY.

But when I use my modified ssh_config sudo /usr/sbin/sshd -D -d -f /etc/ssh/sshd_config -p 2020, ssh -p 2020 pwtest@dplaptop.local doesn't work - debug output below:
...
debug1: Client protocol version 2.0; client software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: permanently_set_uid: 75/75 [preauth]
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none [preauth]
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user pwtest service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: user pwtest matched 'User pwtest' at line 146
debug1: userauth-request for user pwtest service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: temporarily_use_uid: 503/20 (e=0/0)
debug1: trying public key file /Users/pwtest/.ssh/authorized_keys
debug1: Could not open authorized keys '/Users/pwtest/.ssh/authorized_keys': No such file or directory
debug1: restore_uid: 0/0
Failed publickey for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49290 ssh2: RSA SHA256:Y4oh+ZwNsE9hrnD+kCGYUkl48TypV0oQxXi9osTozE4
debug1: audit_event: unhandled event 6
debug1: userauth-request for user pwtest service ssh-connection method password [preauth]
debug1: attempt 2 failures 1 [preauth]
Failed password for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49290 ssh2
debug1: userauth-request for user pwtest service ssh-connection method password [preauth]
debug1: attempt 3 failures 2 [preauth]
Failed password for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49290 ssh2
debug1: userauth-request for user pwtest service ssh-connection method password [preauth]
debug1: attempt 4 failures 3 [preauth]
Failed password for pwtest from fe80::5ab0:35ff:fe63:5c67%en1 port 49290 ssh2
Connection closed by fe80::5ab0:35ff:fe63:5c67%en1 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: Killing privsep child 497
debug1: audit_event: unhandled event 12

A: See @Otheus comments for the solution - in order to have one user use key login and another user (pwtest) password login, the relevant parameters in /etc/ssh/sshd_config are below.  Previously I had UsePAM no and when pwtest entered their password they would get the message: Permission denied, please try again.
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM yes
UsePrivilegeSeparation sandbox # default setting
Match User pwtest
    PasswordAuthentication yes


text:
Q: How To Access my Sprite properties from outside a function in Phaser3 and Matterjs I'm using phaser 3 and Matterjs. I created a function (arrow function) and created a sprite within and it worked fine, but when I set it's velocity within the function it moves a little while and stops, it happens in other instances outside the function (it is a matterjs issue and this might be because I called it in the phaser create() function and not update() which works, although it works anywhere in arcade physics) and I want to access my Sprite velocity away from the function, I had created it to remove the
Uncaught TypeError: Cannot read properties of undefined (reading 'setVelocityX'...)
and set it's velocity in the update() so it wouldn't have to stop on it's way. I would gladly appreciate any working method. Thanks.
Added Code from the comments:
this.obstacles = this.add.group();
var addObstacle = (x, y) => {
    // Create a pipe at the position x and y
    obstacle = this.matter.add.sprite(x, y, 'barrel').setScale(0.2);
    obstacle.setIgnoreGravity(true);
    this.obstacles.add(obstacle);
    obstacle.setVelocityX(-30);
}
var space = 7;
var vary = Phaser.Math.Between(800,1000);
setInterval( _ => {
    for (var i = 0; i < 4; i++) {
        if (i != space && i != space + 1){
            addObstacle(screenWidth+400, i * 60 + (vary));
        }
    }
}, 5000);

A: Well the reason why the sprite slows down, is because in matterjs the velocity is "dampened", if you don't want that the velocity to be slowed down, just set the friction to 0, with the function setFriction (link to the documentation)
like this:
// just needs to be called once, after creating the sprite
sprite.setFriction(0, 0, 0);

to get the current velocity, just get it over the body property:
like this:
console.info(sprite.body.velocity.x, sprite.body.velocity.y);

Mini Demo:

document.body.style = 'margin:0;';

let text;
let text1, text2;
let rect1, rect2;

var config = {
    type: Phaser.AUTO,
    width: 536,
    height: 183,
    physics: {
        default: 'matter',
        matter: { debug: true }
    },
    scene: { create, update },
    banner: false
};

function create ()
{
    text = this.add.text(10, 10, 'Velocity set in "create" function ');
    text1 = this.add.text(10, 30, 'without friction');

    this.matter.world.disableGravity();

    rect1 = this.matter.add.image(10, 70, '_no_texture_');

    rect1.setVelocity(3, 0);
    rect1.setFriction(0, 0, 0);

    text2 = this.add.text(10, 110, 'with friction');
    rect2 = this.matter.add.image(10, 150, '_no_texture_');
    rect2.setVelocity(3, 0);

}

function update(){
    text1.setText(`current velocity without friction ( ${rect1.body.velocity.x.toFixed(2)}, ${rect1.body.velocity.y.toFixed(2)})`);
    text2.setText(`current velocity with friction ( ${rect2.body.velocity.x.toFixed(2)}, ${rect2.body.velocity.y.toFixed(2)})`);
}

new Phaser.Game(config);
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>

Update, extra demo for comment, question:

document.body.style = 'margin:0;';

let text;

var config = {
    type: Phaser.AUTO,
    width: 536,
    height: 183,
    physics: {
        default: 'matter',
        matter: { debug: true }
    },
    scene: { create, update },
    banner: false
};

function create () {
    text = this.add.text(10, 10, 'obstacels: 0');
    this.matter.world.disableGravity();
    this.obstacles = this.add.group();

    this.time.addEvent({
        delay: 2000,
        loop: true,
        callback: _ => {
            let newX = Phaser.Math.Between(500, 600);
            for (var i = 0; i < 4; i++) {
                let newY = i * 60;
                addObstacle(this, newX,  newY );
            }
        }
    })
}

function addObstacle(scene, x, y){
    obstacle = scene.matter.add.sprite(x, y, 'barrel')
        .setIgnoreGravity(true)
        .setVelocityX(-3)
        .setFriction(0, 0, 0);

    scene.obstacles.add(obstacle);
}

function update(){
  text.setText(`obstacels: ${this.obstacles.children.size}`);

  this.obstacles
    .getChildren()
    .filter(item => item.x < 0)
    .forEach(item => this.obstacles.remove(item))
}

new Phaser.Game(config);
<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>


text:
Q: Read CSS file in angularjs Can anyone tell me how can i read a css file from my UI project directory in angularjs. I am doing a get call but not able to get the CSS but getting index.html  file in output.
Can anyone tell me what will be the possible solution.

A: Hi,
We're in lack of context, can you please provide the aimed piece of code?
By the way, if you call for a css file and get html, it's certainly the html of a 404 page, check the url path.

A: I wrote a minimalist CSS parsing object a long time ago. It doesn't use Angular, but might give you the needed hint for reading CSS files via JS. The object declaration can be seen at:
https://pastebin.com/k2smWS0M
this.getSheetByHref = function(href) {}

is the bit you'd likely need.


text:
Q: Ruby XML::Builder with hyphen in Element name I'm trying to generate some XML using XML::Builder, but my element names need to have hyphens in it.
When I try I get undefined methods, with the element name being truncated at the hyphen
xml.instruct!

xml.update-manifest do
  xml.latest-id @latest_version_update.guid
  xml.download-url @latest_version_update.download_url
  xml.release-information-url version_guid_url(@latest_vesrion_update.guid)
end

The fixed version is
xml.instruct!

xml.tag! 'update-manifest' do
  xml.tag! 'latest-id', @latest_version_update.guid
  xml.tag! 'download-url', @latest_version_update.download_url
  xml.tag! 'release-information-url', version_guid_url(@latest_vesrion_update.guid)
end

A: I have tried to fix dash or hiphen in xml to do this.
xml.send("latest-id") "latest ID With hiphen"

For more reference to go this link xml with hiphen

A: xml.tag! 'latest-id', "latest ID with hiphen."


text:
Q: Question about diagonal entries of inverse matrices? Assume $A$ is a symmetric positive semidefinite matrix with diagonal zero and all other entries are less than one. Also assume $D$ is a diagonal matrix with all entries in diagonal are positive and less than $1$.
Can we say that the diagonal entries of $[D+A]^{-1}$ are all positive?

A: Since $A$ is SPSD, $I+A$ is SPD since $x^T(I+A)x=x^Tx+x^TAx>0$ for all nonzero $x$. Inverse of an SPD matrix $B$ is SPD as well because
$$
x^TB^{-1}x=(B^{-1}x)^TB(B^{-1}x)=y^TBy>0
$$
for all nonzero $x$ (since $B$ is SPD and hence nonsingular, $y\neq 0$ iff $x\neq 0$ and for every $y\neq 0$ there's a nonzero $x$ such that $x=By$). Hence $(I+A)^{-1}$ is SPD too.
An SPD matrix $B$ always have positive diagonal entries since $0<e_i^TBe_i=b_{ii}$, where $e_i$ is the $i$th vector of the canonical basis and $b_{ii}$ is the $i$th diagonal entry of $B$.
P.S.: The assumption on the diagonal and off-diagonal entries of $A$ is not needed here. All what is required is that $A$ is SPSD. However, note that an SPSD matrix with zero diagonal entries is necessarily the zero matrix. To see this, note that the trace of $A$ (that is, the sum of the diagonal entries) is equal to the sum of the eigenvalues due to the invariance of the trace w.r.t. the change of basis. The eigenvalues of $A$ are non-negative because $A$ is SPSD and since they sum up to zero, they are necessarily all equal to zero.


text:
Q: Purely noncommutative algebra-Morita equivalence Morita equivalence of algebras certainly don't preserve commutativity: even if $A$ is commutative there are plenty of noncommutative algebras which are Morita equivalent with $A$---for example all algebras of the form $M_n(A)$ are good. What is the simplest example of an algebra which is not Morita equivalent to any commutative algebra?

A: An algebra is Morita equivalent to a commutative algebra iff it's Morita equivalent to its center, since the center is Morita invariant. So any representative of a nontrivial class in the Brauer group of the underlying field $k$ is a counterexample: for example, when $k = \mathbb{R}$ we can take the quaternions $\mathbb{H}$.


text:
Q: Receive index with jquery While selecting the desired element is simple in jQuery i haven't found one way to receive an elements index
here's an example of what I want:
$('#minia .holder a').click(function () {
})

This function is used to catch any clicks on one of those elements
to catch that specific element I use $(this) now my question is how would i get
$(this) index so i can then later use it like so $('#minia .holder a[index]').

A: try running this and get the idea:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                    "http://www.w3.org/TR/html4/loose.dtd">

  Click a div!

First div

Second div

Third div

a demo and documentation can be found here.
edit
$('#pic .control').click(function () {
     var imgUrl = $('#view').attr("src");
     // why not erase the next two lines... then
     //var indexLink = $('#minia .holder a').index('#minia .holder a[href="'+imgUrl+'"]');
     //$('#minia .holder a:eq('+indexLink+')').click();
     // use this
     $('#minia .holder a[href="'+imgUrl+'"]').trigger('click'); // if you wanted a click..
})

A: well i solved it by doing like this
 $('#pic .control').click(function () {
         var imgUrl = $('#view').attr("src");
         var indexLink = $('#minia .holder a').index(jQuery('#minia .holder a[href="'+imgUrl+'"]')) + 1;
         $('#minia .holder a:eq('+indexLink+')').click();
      })

even thought you guys answered my initial question this was the final one

A: try this
$('#minia .holder a').click(function (event) {

var temp_index = $(this).index();

})


text:
Q: Conditions for which groups of states of markov chain still represent a markov chain Consider a 3x3 Markov chain matrix for 3 different states $j=1,2,3$.
$$ W= \left(\begin{matrix}W_{11}&W_{12}&W_{13}\\W_{21}&W_{22}&W_{23}\\W_{31}&W_{32}&W_{33}\end{matrix}\right) $$
If I define two states $I,II$ as

*

*$I$ is $1$

*$II$ is obtained joining $2$ and $3$
What are the conditions on the matrix elements $W_{ij}$ under which $I$ and $II$ are the states of a new Markov chain?

I think that the conditions are

*

*$W_{21}=W_{31}$

*$W_{22}=W_{33}$ and $W_{23}=W_{32}$
Otherwise the probabilities $W_{II,I}$ and $W_{II,II}$ would not be defined.

But I would like to have an explanation on how to derive those conditions from the definition of Markov chain, i.e. the transition probability must not depend on past states.

A: Definitely you need to have $W_{21}=W_{31}$, so as to make sure that the probability for the transition from state II to state I doesn't depend on whether state II was an instance of state $2$ or an instance of state $3$.

But as I see it, that's all you need.

Ler $a=W_{11}$, and let $b=W_{21}=W_{31}$.

Then the Markov chain for the new states has transition matrix
$$
\pmatrix
{
a & 1-a \cr
b & 1-b
}
$$


text:
Q: React.addons.cloneWithProps chaining of event handlers Why and how React.addons.cloneWithProps does chaining of event handlers?
// All props were transferred from <Element /> to its child.
// Event handlers from <Element /> will chain with event handlers from its child.
var Case2 = React.createClass({
    render: function () {
        var child = React.Children.only(this.props.children);
        return React.addons.cloneWithProps(child, this.props);
    }
});

// All props were transferred from <Element /> to its child.
// Event handlers from <Element /> will override event handlers from its child.
var Case3 = React.createClass({
    render: function () {
        var child = React.Children.only(this.props.children);
        return React.addons.cloneWithProps(child, _.omit(this.props, 'children'));
    }
});

Here is the official documentation of the React.addons.cloneWithProps. It says nothing about this behavior.
Here is the fiddle.


text:
Q: How to get sign right for parametric area for circle For finding the area of a circle of radius $r$ using $x=r \cos(t)$ and $y=r \sin(t)$ with $t$ from $0$ to $2 \pi$, it seems that the formula usually given for parametric area, which is $\int_a^b y(t)x'(t)dt$, gives a negative result and all the examples I could find use the formula of $\int_a^b x(t)y'(t)dt$
From what I've read, for the area formula to work, you'd need a closed curve but the sign depends on the direction? From what I read on brilliant (the above paragraph, as well as the circle example), my negative sign is due to the using the first formula and not the second... however, if I use my formula with $\int_{2\pi}^{0} r \sin(x) \cdot -1 r \sin(x) \ dx$ then it works out well and I get $\pi r^2$ with the positive sign
Then reading this answer to a user with a similar issue, the suggestion is due to the sign of the product of the terms inside more than anything.
Which is the right formula to use, and is there a good way to predict which one would give the correct sign?

A: Both formulas are correct; care needs to taken though in determining the integration limits of the parametrized variable.
In the case of $\int y(t)x'(t)dt=\int y (x)dx$, the integration is over the range $x\in [-r,r]$, which corresponds to $ [\pi,0]$ under the parameterization $x=r\cos t$ (i.e. $-r= r\cos\pi$ and $r=r\cos 0$) and the area integral for the circle is given by
\begin{align}
Area & =\int_{-r}^r [y-(-y)]\>dx = 2\int_{-r}^r y\>dx\\
&= 2 \int_\pi^0 y(t)x'(t) \>dt\\
&= 2 r^2 \int_\pi^0(-\sin^2t)\>dt\\
&= \pi r^2
\end{align}

A: For a length $l$ between points $A$ and $B$ of a curve we have $AB^2=\Delta x^2+\Delta y^2$. As $\Delta x, \Delta y \to 0$, $AB \to l$ and we have $(dl)^2=(dx)^2+(dy)^2.$ So then $(dl)^2=\left(1+(\frac{dy}{dx})^2\right)dx^2\Leftrightarrow dl=\sqrt{1+(\frac{dy}{dx})^2}dx$. The equation of the circle is of course $x^2+y^2=r^2.$ So we have $2xdx+2ydy=0\Leftrightarrow \displaystyle\frac{dy}{dx}=-\frac{x}{y}.$ Let $l$ be the circle's circumference. You have $l = \displaystyle\int_{0}^{R}{\sqrt{1+\left(\frac{x}{y}\right)^2}dx}=\int_{0}^{R}{\sqrt{\frac{R^2}{R^2-x^2}}}dx=\int_{0}^{R}{\frac{1}{\sqrt{1-\displaystyle\frac{x^2}{R^2}}}}dx=R\int_{0}^{R}{\frac{1}{\sqrt{1-\displaystyle\frac{x^2}{R^2}}}}d\left(\frac{x}{R}\right)= \\
=R\cdot arcsin\left(\displaystyle\frac{x}{R}\right)\Biggr|_{0}^{R}=2\pi R.$ So now integrating it is easily seen that the area of a circle is $\pi R^2.$ I know it isn't quite what you wanted but I thought it was interesting to consider.
But now of course Green's theorem comes in handy when you need to integrate parametric curves. The answer above provides a very nice example and shows how careful you need to be choosing the limits. Notice here that $t \in [0,2\pi]$ and the $x(t), y(t)$ describe parametric curves in $\mathbb{R}^2$. So obviously you can have $\displaystyle\int{y\hspace{0.11cm}dx}=\int_{0}^{2\pi}{y(t)x'(t)dt}=r^2 \int_{0}^{2\pi}{cos^2(t)dt}=4r^2\int_{0}^{\frac{\pi}{2}}{cos^2(t)dt}=I \hspace{0.5cm} (1)$, which is always an incredibly useful trick in dealing with curves... Let's solve for $I$! Now let $\theta=\frac{\pi}{2}-t\Leftrightarrow du = -dt$. So $I = 4r^2\displaystyle\int_{0}^{\frac{\pi}{2}}{sin^2(t)dt}\hspace{0.5cm} (2)$. Now $(1)+(2)=2I=4r^2\displaystyle\int_{0}^{\frac{\pi}{2}}{1d\theta}\Leftrightarrow 2I = 2\pi r^2\Leftrightarrow I = \pi r^2.$ As desired in the first place.


text:
Q: Nginx conditional proxy pass configuration I have 2 different ( Node & Angular ) applications running under a domain. I am trying to configure nginx in way to serve like, whenever anyone access "domain.com" it should serve the node app running on port 4200 and if someone access "domain.com/admin" it should serve the contents from Angular app. Below is my nginx configuration.
 server {
    listen   80;
    listen   [::]:80;

    server_name domain.com

}

server {
    listen   443 default_server ssl;
    ssl on;
    server_name domain.com;
    root /home/domain/public_html/angular/dist;
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    location / {
                        proxy_pass http://127.0.0.1:4200;
                        proxy_http_version 1.1;
                        proxy_set_header Upgrade $http_upgrade;
                        proxy_set_header Connection 'upgrade';
                        proxy_set_header Host $host;
                        proxy_cache_bypass $http_upgrade;
                        proxy_redirect off;
    }
     location /admin {
         try_files $uri /index.html;
    }
    }

The problem I am facing now is all the requests including /admin is getting proxy passed. Is there any way I can restrict the /admin requests to not get proxy passed? Below is the nginx log.
connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: domain.com, request: "GET /admin HTTP/1.1", upstream: "http://127.0.0.1:4200/admin", host: "domain.com"

Can someone please shed some light to get this resolved?


text:
Q: Internet is not working when VPN is up I'd like to redirect all trafic through VPN, but it doesn't work at all.
server: RT-N16 [TomatoUSB v1.28.0000 MIPSR2-112 K26 USB AIO]
client: Ubuntu 14.04.1
server config:

# Automatically generated configuration
daemon
server 10.8.0.0 255.255.255.0
proto tcp-server
port 9999
dev tun21
cipher AES-256-CBC
comp-lzo no
keepalive 15 60
verb 3
push "route 192.168.1.0 255.255.255.0"
push "dhcp-option DNS 192.168.1.1"
push "redirect-gateway def1"
ca ca.crt
dh dh.pem
cert server.crt
key server.key
status-version 2
status status
# Custom Configuration (these section appears to be main FIX):
client-to-client
push "comp-lzo"
push "redirect-gateway"

server: iptables -L -t nat -n (just POSTROUTING chain of output)

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0
SNAT       all  --  192.168.1.0/24       192.168.1.0/24      to:192.168.1.1

server log:

Feb  4 21:19:38 r daemon.notice openvpn[1072]: TCP connection established with [AF_INET]192.168.1.4:58170
Feb  4 21:19:39 r daemon.notice openvpn[1072]: 192.168.1.4:58170 TLS: Initial packet from [AF_INET]192.168.1.4:58170, sid=00fe6a02 33820233
Feb  4 21:19:39 r daemon.notice openvpn[1072]: 192.168.1.4:58170 VERIFY OK: XXXXXXXXXXXXXXXX
Feb  4 21:19:39 r daemon.notice openvpn[1072]: 192.168.1.4:58170 VERIFY OK: XXXXXXXXXXXXXXXX
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Feb  4 21:19:40 r daemon.notice openvpn[1072]: 192.168.1.4:58170 [client] Peer Connection Initiated with [AF_INET]192.168.1.4:58170
Feb  4 21:19:40 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Feb  4 21:19:40 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 MULTI: Learn: 10.8.0.6 -> client/192.168.1.4:58170
Feb  4 21:19:40 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 MULTI: primary virtual IP for client/192.168.1.4:58170: 10.8.0.6
Feb  4 21:19:43 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 PUSH: Received control message: 'PUSH_REQUEST'
Feb  4 21:19:43 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 send_push_reply(): safe_cap=940
Feb  4 21:19:43 r daemon.notice openvpn[1072]: client/192.168.1.4:58170 SENT CONTROL [client]: 'PUSH_REPLY,route 192.168.1.0 255.255.255.0,dhcp-option DNS 192.168.1.1,redirect-gateway def1,route 10.8.0.1,topology net30,ping 15,ping-restart 60,ifconfig 10.8.0.6 10.8.0.5' (status=1)

client config:

client
remote 192.168.1.1 9999
ca ca.crt
cert client.crt
key client.key
cipher AES-256-CBC
dev tun
proto tcp
nobind
auth-nocache
script-security 2
persist-key
persist-tun
user nobody
group nogroup

client: netstat -nr (with vpn up):

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.8.0.5        128.0.0.0       UG        0 0          0 tun0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
10.8.0.1        10.8.0.5        255.255.255.255 UGH       0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
128.0.0.0       10.8.0.5        128.0.0.0       UG        0 0          0 tun0
192.168.1.0     10.8.0.5        255.255.255.0   UG        0 0          0 tun0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
192.168.1.1     192.168.1.1     255.255.255.255 UGH       0 0          0 wlan0

client log:

Wed Feb  4 21:32:24 2015 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec  1 2014
Wed Feb  4 21:32:24 2015 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Wed Feb  4 21:32:24 2015 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Wed Feb  4 21:32:24 2015 Attempting to establish TCP connection with [AF_INET]192.168.1.1:9999 [nonblock]
Wed Feb  4 21:32:25 2015 TCP connection established with [AF_INET]192.168.1.1:9999
Wed Feb  4 21:32:25 2015 TCPv4_CLIENT link local: [undef]
Wed Feb  4 21:32:25 2015 TCPv4_CLIENT link remote: [AF_INET]192.168.1.1:9999
Wed Feb  4 21:32:26 2015 [zais.dnsd.me] Peer Connection Initiated with [AF_INET]192.168.1.1:9999
Wed Feb  4 21:32:29 2015 TUN/TAP device tun0 opened
Wed Feb  4 21:32:29 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Feb  4 21:32:29 2015 /sbin/ip link set dev tun0 up mtu 1500
Wed Feb  4 21:32:29 2015 /sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Wed Feb  4 21:32:29 2015 GID set to nogroup
Wed Feb  4 21:32:29 2015 UID set to nobody
Wed Feb  4 21:32:29 2015 Initialization Sequence Completed
Wed Feb  4 21:32:43 2015 write to TUN/TAP : Invalid argument (code=22)
Wed Feb  4 21:32:58 2015 write to TUN/TAP : Invalid argument (code=22)
Wed Feb  4 21:33:13 2015 write to TUN/TAP : Invalid argument (code=22)
Wed Feb  4 21:33:28 2015 write to TUN/TAP : Invalid argument (code=22)

UPDATE: thanks for help. VPN is working now (not sure way but i need to wait about 5mins after connection to actually get it to working state, may be it's limits of my router, like not enough CPU/MEM)

A: For some reason your client is unable to delete the current default route when the tunnel opens, thereby causing two default routes to exist in the routing table.
What you are going to have to do is give the current route a lower metric (higher number) before the tunnel comes up.  You can see the metric with the route -n command:
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.4.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.3.0     10.8.1.2        255.255.255.0   UG    0      0        0 tun0
9.15.64.0       0.0.0.0         255.255.252.0   U     0      0        0 eth0
0.0.0.0         9.15.64.1       0.0.0.0         UG    0      0        0 eth0

So for example give your wlan interface a metric of 20 and let the tunnel route come up with a metric of zero.  Your traffic will all be sent down the tunnel route.
In order to configure the metric on the interface just open the wlan interface file in the /etc/sysconfig/network-scripts directory and add a parameter called METRIC=20.
That should do it.  Make sure you verify it afterwards with the route -n command.
UPDATE:
Now that you have the proper default route, its time to troubleshoot with tcpdump and pings.  For example try the below command and perform some ping to the remote network.
# tcpdump -i tun0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 65535 bytes
09:59:13.591764 IP 192.168.4.190 > 192.168.3.1: ICMP echo request, id 3154, seq 4, length 64
09:59:13.681290 IP 192.168.3.1 > 192.168.4.190: ICMP echo reply, id 3154, seq 4, length 64
09:59:14.592829 IP 192.168.4.190 > 192.168.3.1: ICMP echo request, id 3154, seq 5, length 64
09:59:14.680878 IP 192.168.3.1 > 192.168.4.190: ICMP echo reply, id 3154, seq 5, length 64

My guess is you will see the echo request but not the echo reply.  This means that the remote endpoint is not routing the packets back.  You need to fix the routes there too in the server config file.
UPDATE2
From your tcpdump it is clear that your client is routing the packets via the tunnel, your problem therefore lies at the remote end because it is not rounting the packets back.
listening on tun0, link-type RAW (Raw IP), capture size 65535 bytes
09:19:28.964361 IP 10.8.0.6.57394 > 192.168.1.1.domain: 60317+ A? daisy.ubuntu.com.localdomain. (46)
09:19:28.964382 IP 10.8.0.6.57394 > 8.8.8.8.domain: 60317+ A? daisy.ubuntu.com.localdomain. (46)
09:19:28.964398 IP 10.8.0.6.57394 > 8.8.4.4.domain: 60317+ A? daisy.ubuntu.com.localdomain. (46)

You must examine every hop to see what the routing table looks like.  Start with 192.168.1.1.  Does it know where to route packets sent to 10.8.0.6?


text:
Q: Wit.ai to IBM watson migration I want to import Wit.ai exported bot json data to IBM watson conversation workspace. Is there a tool available or any process that can help me to convert Wit.ai json data to be converted into json data required by Watson.

A: Thanks for asking. I'm not aware of any tool. I would recommend to create a simple Wit app then export it to understand how the json files are structured. Then you will create a script to migrate your IBM export in these files. Finally use this zip command before importing into a new wit app
zip FlowBased_SimpleExample.zip FlowBased_SimpleExample/app.json FlowBased_SimpleExample/entities/*.json FlowBased_SimpleExample/actions.json FlowBased_SimpleExample/stories.json FlowBased_SimpleExample/expressions.json


text:
Q: Code Base Analysis Does anyone know of a methodology that can be used on a project file tree to identify dead files, dead code, unused libraries, etc. I have been thinking about this for some time as I seem to inherit code that was develop from another code base and find that my maintenance reveals unneeded libs, unused files and last of all dead code.

A: Unfortunately, nearly all languages allow for runtime loading of code and/or reflection which make full static analysis impossible because the code could be used dynamically. Though those tools exist for most languages if you're willing to live with that caveat - not a few languages/IDEs do this sort of dead code/reference analysis these days and emit warnings.
Full runtime analysis is impossible because it's equivalent to the halting problem (is that code really dead, or has it just not been called yet?). Though those tools exist if you're willing to live with that caveat. Depending on your situation, a simple code coverage tool (perhaps in combination with a fuzzer) might be sufficient, which come with many testing frameworks.


text:
Q: Java FileReader FileNotFound issue when reading in the string I have the following code:
    BufferedReader inFromUser =
            new BufferedReader(new InputStreamReader(System.in));

    System.out.print("Enter: ");

    String m = inFromUser.readLine();

    BufferedReader br = new BufferedReader(new FileReader(m));

    String text;

    while((text = br.readLine()) != null){
        System.out.println(text);
    }

    br.close();

And when reading in the string from the user the file can never be found. I don't know what is happening when the string is passed but it becomes unfindable. Although the file is very much there.
I have run tests and when I replace the newFileReader(m) with newFileReader("Lab3/test") the file is found, but when I enter the "Lab3/test" into the system(Via the String m = inFromUser.readLine();) to read it, it's read in and printed as "Lab3/test" but the file reader never finds the file when the string is passed into the file reader(Via m), when the string is the exact same.
I've googled a bit but trying to explain that is a pain.
A thank you in advance, Sam

A: You need to enter the file name without quotes. If you enter it with quotes, then the file name must contain the quotes as well.
If you use file name such as Lab3/test, then Java will search for the file in the current working directory. The current working directory is normally where the application was started. I might be easier if you enter the complete, absolute file name, such as C:\Users\Smithers\Dropbox\Software Engineering Code\Eclipse\Networking\Lab3\test.
It doesn't matter if you use backslashes or forward slashes.


text:
Q: React Native Maps red outline ios I'm trying to solve the red border issue with react-native-maps. I've tried all the usual of styling, re-installing/re-linking, and adding airmaps to my xcode project, I'm not trying to use google maps. Any help would be greatly appreciated.
import React, { Component } from 'react';
import {
  Dimensions,
  StyleSheet,
  View,
} from 'react-native';

import MapView from 'react-native-maps';

const { width, height } = Dimensions.get('window');

const styles = StyleSheet.create({
  container: {
    ...StyleSheet.absoluteFillObject,
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  map: {
    ...StyleSheet.absoluteFillObject,
    width: width,
    height: height,
  },
});

export default class Map extends Component {

  render(){
    const { container, map } = styles;
    return(
      <View style={container}>
        <MapView
          style={map}
          initialRegion={{
            latitude: 37.78825,
            longitude: -122.4324,
            latitudeDelta: 0.0922,
            longitudeDelta: 0.0421,
          }}
          showUserLocation
        />
      </View>
    );
  }

};

A: When you get a red border instead of a component you're trying to use, it means that the library which contains the native view for this component was not linked to your project.
You should follow the installation instructions carefully and see if you didn't miss any steps.
In case you did link the package and you're still getting the red border, it means that you didn't compile the native project after it was linked. You need to build it again for the link changes to take effect.

A: Problem solved.
First, I made sure to exit out of the NPM running in the command prompt (ctrl+C)
Second, I ran File->"Reset Content and Settings" in the simulator, to completely erase any old project files
Third, while the simulator was resetting itself I ran "react-native link" in the command prompt to make sure all links were set up, when this finished running
Fourth, I then recompiled the by running "react-native run-ios" in the command prompt.
Problem solved. This probably happened because there are probably files on the simulator that do not get updated and are only downloaded when the project is first loaded. (I'm probably wrong, but I'm sure an engineer will point that out to me)


text:
Q: Manually rotate viewcontroller My app must NOT auto-rotate at all. But it includes a screen which tells the user to rotate his phone (and not the opposite!).
To do that, the ViewController must make an animated rotation (without any rotation event) when the screen is displaying.
So I used
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:animated];
    [super viewWillDisappear:animated];
}

And
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}

to make my screen rotate, as every website and documentation recommend.
But only the StatusBar rotates: my NavigationBar remains stuck at the top.

A: I would use a CGAffineTransform perhaps on the navigationcontroller view? Simply rotate it using an animation block 90 degrees?

A: this code is helpful for you to resize the navigation bar automatically you can use it in where you create the navigationController & navigation bar
  self.navigationController.navigationBar.autoresizesSubviews = YES;
  self.navigationController.navigationBar.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

above code will work automatically if it is not then you try this will work in all delegates methods of your view controller where you need the change
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:animated];
[self.navigationController shouldAutorotateToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
}

- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
   CGRect frame = self.navViewController.navigationBar.frame;
   frame.size = self.view.frame.size;
if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {

    frame.size.height = 44;
} else {
    frame.size.height = 32;
}
self.navViewController.navigationBar.frame = frame;

if navigation controller is rootview controller then check it enables the all orientation supports
   -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
[super shouldAutorotateToInterfaceOrientation:toInterfaceOrientation];
[self.navigationController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation];
        return YES;
    }

you can use this code in viewcontroller delegates listed below according to your requirment
- (void)viewDidAppear:(BOOL)animated
- (void)viewWillAppear:(BOOL)animated
– willRotateToInterfaceOrientation:duration:

– willAnimateRotationToInterfaceOrientation:duration:

– didRotateFromInterfaceOrientation:


text:
Q: Jenkins: Git push will trigger a Jenkins build for only that branch We are working in parallel on a number of Git branches.
When pushing a specific Git branch, how can we start a Jenkins item/job that will trigger the build of that specific branch?
As an example: we push a Git branch "feature-abc" ==> this should trigger a Jenkins build job using/pulling that branch "feature-abc".
For each new feature we have a branch, so the number of branches is not fixed.
So, I think it is different than this answer with a manual action.

A: If the use case is to trigger a build for every git push, you can add a a git pre-receive hook, which will trigger the build, once git-push is completed.
#!/bin/bash
while read oldrev newrev refname
do
    branch=$(git rev-parse --symbolic --abbrev-ref $refname)
    #Trigger based on branch name "$branch" or pass this parameter to trigger the build
    curl -X POST -u "user" "http://<jenkins_url>/job/buildWithParameters?branch_name=$branch"
done

A: A much better alternative for building Jenkins jobs via the GUI is making them as Jenkins pipelines.
The result of the (below) simple demo configuration is that each time you push updates to the Git repo, a Jenkinsfile for that (changed) branch is started. In the Jenkinsfile you can output the branch name.
How? You can easily create such a configuration yourself in a few minutes. In this case I have a Jenkins server running on my local PC. So, this Jenkins server is by default not accessable for a webhook in the Git project. (Notice: you can use Webhook relay to simulate real webhooks). When the Git server can access the Jenkins server, then you should definitely use a webhook.

*

*Create a project and put it in a Git(lab) repo.

*Add this simple Jenkinsfile (pipeline) to your project.

.
node {
    stage('Preparation') {
        checkout scm
    }
    stage('Who am i?') {
        echo "This job was triggered by a Git push to branch: ${env.BRANCH_NAME}"
    }
}

*

*Jenkins > New Item > Multibranch pipeline. If your Jenkins server is not accessable for the Git server you can use polling. Otherwise you can setup a webhook via the Git server.

*Jenkins will now scan the Git project for branches having a 'Jenkinsfile'. For each matching branch (having a Jenkinsfile) it will automatically create a Jenkins Pipeline job. The jobs have the name of the branch. At first there will be only 1 branch, so there will be 1 job with the name 'master' created. The newly created jenkins job will execute the 'Jenkinsfile' for the 'master' branch. In the console you will see the output with the name of the branch: master.

*Create a branch and make a change to the Jenkinsfile. Push the changes to the branch.

*After waiting max 1 minute (due to the polling) the multibranch job will scan whether there are new branches with a Jenkinsfile. In this case a new jenkins job is created with the name of the branch. All jobs are visible below the Multibranch job. The job will be executed and printout the branch name.

*If you only make a change to an existing branch AND you push the change to the Git project, then within 1 minute the branches are scanned. Jenkins will see that the branch is changed and start the Jenkins pipeline job.


text:
Q: Use Laravel Mix without ES6 Compilation I'm building something using the Electron framework. I'm using Vue and SCSS, and I'd like to use Laravel Mix.
However, I can't figure out how to use Laravel Mix without ES6 compilation using babel. Since Electron is running on Node, there is no need to compile to ES5.
Looking through Laravel Mix's API, there seems to be no method that provides this functionality.
I created a .babelrc file with the following contents:
{
    "plugins": [ ],
    "presets": [ ]
}

However, after running npm run dev, the output file clearly has been transpiled to ES5.
According to line 248 of src/config.js in Laravel Mix's source code, the options taken from .babelrc overwrite the default options defined on line 220.
Laravel Mix Version: 1.7.2
Is there something I'm missing? Or does Laravel Mix simply not support this functionality?
Thanks in advance.

A: I had similar problem and it wasn't easy to find, but here's the solution:
mix.babelConfig({
    only: ["./some-fake-dir"]
})

As the Babel documentation says:

Use it to explicitly enable Babel compilation of files inside the src
  directory while disabling everything else.

So by entering some fake dir, you turn off the compilation all together.
More on this option here: https://babeljs.io/docs/en/options#only