text:
Q: Request to server fails in Firefox when type=submit for button My html code sends the request to php to send email. In my case the email can be sent in Google Chrome & Edge but not in Firefox when I set the button type=submit, when I change type=button, it works fine. My javascript code is:
function Send() {
    var allset = true;
    var namevalid = true;
    var emailvalid = false;
    var commentvalid = false;
    var sent = 0;

    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;

    if ($("#email").val() == '' || $("#email").val() == null) {
        $("#email").addClass("invalid");
        allset = false;
    }
    else {

        if (!$("#email").val().match(emailPattern)) {
            $("#email").removeClass("valid");
            $("#email").addClass("invalid");
            allset = false;

        }

        else {
            emailvalid = true;
            $("#email").addClass("valid");
        }

    }

    if ($("#comment").val() == '' || $("#comment").val() == null) {
        $("#comment").addClass("invalid");
        allset = false;
    }
    else {
        commentvalid = true;
        $("#comment").addClass("valid");
    }
    $("#name").addClass("valid");

    if (namevalid === true && emailvalid === true && commentvalid === true) {
        var name = document.getElementById("name").value;
        var email = document.getElementById("email").value;
        var number = document.getElementById("number").value;
        var demo = document.getElementById("sel1").value;
        var comment = document.getElementById("comment").value;

        alert("Request Successfully Received");

        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function () {

            if (xhttp.readyState == 4 && xhttp.status == 200) {
                alert(xhttp.responseText)
            }
        };
        sent = 1;
        xhttp.open("POST", "email.php?" + "name=" + name + "&mail=" + email + "&phone=" + number + "&msg=" + comment + "&demo=" + demo, true);
        xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xhttp.send();

    }
    else
    {
        alert("Please fill all the fields correctly");
    }

}

My html for form's button is:
 <form class="form" id="form1">

        <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />

        <input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />

        <input  type="text" name="telephone" maxlength="30" class="feedback-input" size="30" id="number" placeholder="Number">

        <select class="form-control feedback-input demotype" id="sel1" name="demo">

        <option> something </option>

      </select>

        <textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>

          <input type="submit" id="button-blue" onclick="Send()" value="Send" />

    </form>

A: 'type=submit' is basically for submitting forms and 'type=button' is just a button to be bind with some functions. If you don't have any form as its parent element and an error occurs when you click the button, I suggest you to use 'type=button' instead.

A: Just add return false; at the end of function becuase submit button submits your form. Like this.
function Send() {
 var allset = true;
            var namevalid = true;
            var emailvalid = false;
            var commentvalid = false;
            var sent=0;

            var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;

            if ($("#email").val() == '' || $("#email").val() == null) {
                $("#email").addClass("invalid");
                allset = false;
            }
            else {

                if (!$("#email").val().match(emailPattern)) {
                    $("#email").removeClass("valid");
                    $("#email").addClass("invalid");
                    allset = false;

                }

                else {
                    emailvalid = true;
                    $("#email").addClass("valid");
                }

            }

            if ($("#comment").val() == '' || $("#comment").val() == null) {
                $("#comment").addClass("invalid");
                allset = false;
            }
            else {
                commentvalid = true;
                $("#comment").addClass("valid");
            }
         $("#name").addClass("valid");

            if (namevalid === true && emailvalid === true && commentvalid === true) {
               var name = document.getElementById("name").value;
                var email = document.getElementById("email").value;
                var number = document.getElementById("number").value;
                var demo=document.getElementById("sel1").value;
                var comment = document.getElementById("comment").value;

alert("Request Successfully Received");

   var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {

if (xhttp.readyState == 4 && xhttp.status == 200) {
alert(xhttp.responseText)
}
};
sent=1;
xhttp.open("POST", "email.php?"+"name="+name+"&mail="+email+"&phone="+number+"&msg="+comment+"&demo="+demo, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send();

}
else
{
    alert("Please fill all the fields correctly");
}

return false;

 }


text:
Q: Do multiple instances of System.Random still use the same seed in .Net Core? I've seen several articles talking about not generating too many System.Random instances too closely together because they'll be seeded with the same value from the system clock and thus return the same set of numbers:

*

*https://stackoverflow.com/a/2706537/2891835

*https://codeblog.jonskeet.uk/2009/11/04/revisiting-randomness/

*https://learn.microsoft.com/en-us/dotnet/api/system.random?view=netframework-4.8#instantiating-the-random-number-generator
That appears to be true for .net framework 4.8.
Looking at the source code for .net core, however, it looks like instances of System.Random generated on the same thread are seeded from a [ThreadStatic] generator.
So it would seem to me that, in .net core, you are now safe to do something like:
Random[] randoms = new Random[1000];
for (int i = 0; i < randoms.Length; i++)
{
  randoms[i] = new Random();
}
// use Random instances and they'll all have distinct generated patterns

Is this true? Am I missing something?
Note: Assume we're talking about a single thread here (although I'm not sure it matters because it looks like .net core uses bcrypt or something to seed the global generator per-thread?).
EDIT:
This is now tracked in this ticket.

A:
Is this true? Am I missing something?

I believe your reading of the source code is correct.  But you shouldn't rely on this behavior unless it's documented.  My guess is that the documentation simply hasn't kept up with the implementation, but you can open an issue here to get the docs updated.
.NET Core has lots of little enhancements like this that you might hesitate to make to .NET Framework for backwards-compatibility reasons.

redpajama_set_name: RedPajamaStackExchange


text:
Q: PHP Warning: PHP Startup: Unable to load dynamic library: /home/lib.so so: undefined symbol: __gxx_personality_v0 in Unknown on line 0 i've managed to succesfully create an .php extension. I would like to move further. Insted of using the .cc that i want my .php to link with i would like to add the library.so.
When compiling i have this error.
how to solve it?
thx. appreciate
EDIT:
I succed to compile it. now i have this error:
 undefined symbol: _ZN3CarC1Ei. why?
it is true i did not add the .cc code. how to add iin config.m4 the .so file that contans the .h and .cc with which i wpuld like to work from php?

A: Apparently your extension has been compiled with g++ and you didn't linked the stdc++ library. You need to add something like this in config.m4:
  PHP_SUBST(YOUREXT_SHARED_LIBADD)
  PHP_ADD_LIBRARY_WITH_PATH(stdc++, "", YOUREXT_SHARED_LIBADD)

See here for an exemple: http://svn.php.net/viewvc/pecl/rar/trunk/config.m4?revision=299933&view=markup

A: I guess you need to link with libstdc++. Or compile with g++ instead of gcc, then libstdc++ will be linked by default.


text:
Q: Create a sticky element I would like to create a sticky element on this JSFIDDLE. The 'blue' div should be fixed until the 'pink' touch it and then the 'blue' div could be in relative position.
HTML :

 I want to stay 'fixe' until the pink bloc touch me.
 Then I can be 'relative'.

CSS :
body {margin:0;}

.blue {
 height:50vh;
 position:relative;
 width:100%;
 display:inline-block;
 background:blue;
 color:white;
 text-align:center;
}

.pink {
 height:500vh;
 margin-top:40vh;
 position:absolute;
 width:100%;
 display:inline-block;
 background:pink;
}

A: You can do it using sticky position. Simply pay attention to browser support

body {
  margin: 0;
}

.container {
  height: 90vh; /*height of the blue + margin-top of the pink*/
}

.blue {
  height: 50vh;
  position: sticky;
  top: 0;
  background: blue;
  color: white;
  text-align: center;
}

.pink {
  height: 500vh;
  background: pink;
}

 I want to stay 'fixe' until the pink bloc touch me.
 Then I can be 'relative'.

A: Try this. :)

div.blue {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background-color: blue;
    height: 50vh;
    color:#fff;
    font-size: 20px;
    text-align: center;
}
div.dummy {
 width: 100%;
    height: 500px;
}
div.pink {
    position: relative;
    top: 0;
    background-color: pink;
    padding: 50px;
    height: 500vh;
    font-size: 20px;
}

I want to stay 'fixed' until the pink bloc touch me.
 Then I can be 'relative'.

Oh hey by the way don't use
 . Use
 or
.
Happy to Help you.


text:
Q: Playing Videos in Firefox I use Ubuntu 18.04 and Firefox 60.0 (linux beginner!)
I just installed the flash player, but the only videos that are displayed in my browser are the ones on youtube.
facebook and any other streaming-services can not play videos.
do i need to install/enable html5 somehow?

A: If those streaming services use DRM, you must enable DRM in Firefox's settings: Preferences -> General -> Play DRM-controlled content You might also have to install package libavcodec-extra to get the codecs:
sudo apt install libavcodec-extra


text:
Q: How to print a confidence interval into a sentence in r by writing my own function I'm trying to print a confidence interval into the same sentence.

A: You can use sprintf or paste0 to concatenate (and format) the lower and upper confidence value. Here is an example using sprintf.
# Sample data
y <- glm(mpg ~ wt, data = mtcars);
colName <- "wt";

# Print statement
print(paste0(
    "The 95% confidence interval for covariate  ",
    colName,
    " is ",
    sprintf("[ %4.3f, %4.3f ]", confint(y, parm = colName)[1], confint(y, parm = colName)[2]),
    " which means that we reject or fail to reject the null hypothesis that the coefficient of this covariate is zero "));
#[1] "The 95% confidence interval for covariate  wt is [ -6.440, -4.249 ] which means that we reject or fail to reject the null hypothesis that the coefficient of this covariate is zero "


text:
Q: Node.js Lambda Function "response is invalid" Amazon Alexa UPDATE: I had a mistake on my http request endpoint. I had not set the appropriate authentication options so that fixed a lot of errors possibly this specific one.
My question is similar to one here:
Node.js Lambda function returns "The response is invalid" back to Alexa Service Simulator from REST call
However the solution to that question does not solve my problem. So I make an http request call to an xsjs service in Hana cloud. I am getting the 'response is invalid' error message. I can't see why. Here is my function:
 // Create a web request and handle the response.
function httpGet(query, callback) {

    console.log("/n QUERY: "+ query);

    var host = 'datacloudyd070518trial.hanatrial.ondemand.com';
    var path = '/LocationInformation/getLocationInfo.xsjs?location=';
    var hostname = 'https://' + host + path + query;

    var auth = 'user1:D1anafer';

    var req = http.request({'hostname': hostname,
                            'auth': auth
                        }, (res) => {

    var body = '';

        res.on('data', (d) => {
            body += JSON.stringify(d);
        });

        res.on('end', function () {
            callback(body);
        });

    });

    req.end();

    req.on('error', (e) => {
        console.error(e);
    });

}

And the function that calls it:
'getNewsIntent': function () {

    //self = this;

    httpGet(location, function (response) {

        // Parse the response into a JSON object ready to be formatted.
        //var output = JSON.parse(response);
        //output = output['change'];
        var output = response;

        var cardTitle = location;
        var cardContent = output;

        alexa.emit(':tellWithCard', output, cardTitle, cardContent);

    });

},

Thank You
-Diana

A: Inside your AWS account go to your Lambda function and click on the monitoring tab, where you should see "View Logs in Cloudwatch" in the right hand corner. If you click that link and you should see the errors that are being produced.
You can also use console.log() to log any information being returned from your REST api, which will be logged in cloudwatch and can help you see where your errors are.

A: This is just a guess from the top of my head. To really help some detailed error message would be required like mentioned about.
But just a guess: Your http.request() is using the http module (https://nodejs.org/api/http.html) and your are accessing the a https resource. If so there is a https (https://nodejs.org/api/https.html) module or use something like axios https://www.npmjs.com/package/axios or requestjs (https://github.com/request/request) this will handle both.
Like I said just a blind guess without detailed error message and seeing your require statements but I am happy to dive deeper if you happen to have details.
HTH

A: Your callback from the Lambda has to return a valid status code and body. Like this:
let payload = {
    statusCode: 400,
    body: JSON.stringify('body'),
    headers: {"Access-Control-Allow-Origin": "*"}
};
callback(null, payload);

On top of that, to call this from client side code, you have to pass the CORS header back.


text:
Q: Настроить вид ручки и шрифт для рисования Программа рисует хорду и надпись в отдельном окне, и мне нужно добавить возможность выбирать шрифт и стиль штриховки для рисования хорды, делаю я это с помощью диалоговых окон, которые вызываются нажатием клавиш, начал с шрифта, но при самом рисовании вылетает ошибка
Вот код:
import sys
from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QPushButton, QLabel, QFontDialog
from PyQt5.QtGui import QPainter, QColor, QPen, QFont
from PyQt5.QtCore import Qt, QRect

class Example(QWidget):

    def __init__(self, mainwindow):
        super().__init__()
        self.mainwindow = mainwindow
        self.initUI()

    def initUI(self):
        self.text = '\u0412\u0020\u043b\u0435\u0432\u043e\u043c\u0020\u043d\u0438\u0436\u043d\u0435\u043c\u0020\u0443\u0433\u043b\u0443\u0020\u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0430\u0020\u0445\u043e\u0440\u0434\u0430\u002e'
        self.setGeometry(100, 100, 380, 270)
        self.setWindowTitle('ЛР №3')
        self.show()

    def paintEvent(self, event):
        qp = QPainter()
        qp.begin(self)
        self.drawText(event,qp)
        self.drawChord(qp)
        qp.end()

    def drawText(self, event, qp):
        qp.setPen(QColor(168, 34, 3))
        self.font = self.mainwindow.draw_font
        qp.setFont(self.font)
        qp.drawText(event.rect(), Qt.AlignRight, self.text)

    def drawChord(self, qp):
        pen = QPen(Qt.black, 6, Qt.SolidLine)
        qp.setPen(pen)
        qp.drawChord(0, 200, 320, 140, 30 * 16, 120 * 16)

class window(QMainWindow):
    def __init__(self):
        super().__init__()
        self.resize(565, 232)
        font = QFont()
        font.setPointSize(16)
        self.centralwidget = QWidget()
        self.centralwidget.setObjectName("centralwidget")
        self.label = QLabel(self.centralwidget)
        self.label.setGeometry(QRect(120, 10, 351, 31))
        self.label.setObjectName("label")
        self.label_2 = QLabel(self.centralwidget)
        self.label_2.setGeometry(QRect(120, 55, 391, 25))
        self.label_2.setObjectName("label_2")
        self.label_3 = QLabel(self.centralwidget)
        self.label_3.setGeometry(QRect(120, 90, 361, 31))
        self.label_3.setObjectName("label_3")
        self.pushButton = QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QRect(180, 170, 211, 31))
        self.pushButton.setObjectName("pushButton")
        self.label.setText("Нажмите F1 чтобы выбрать кисть")
        self.label_2.setText("Нажмите F2 чтобы выбрать .txt файл")
        self.label_3.setText("Нажмите F3 чтобы выбрать шрифт")
        self.pushButton.setText("Нарисовать")
        self.label.setFont(font)
        self.label_2.setFont(font)
        self.label_3.setFont(font)
        self.pushButton.setFont(font)
        self.setCentralWidget(self.centralwidget)

        self.pushButton.clicked.connect(self.draw)

        self.draw_font = QFont('Decorative', 10)

    def draw(self):
        self.ex = Example(mainwindow = self)

    def keyPressEvent(self, press):
        if press.key() == Qt.Key_F1:
            pass
        elif press.key() == Qt.Key_F2:
            pass
        elif press.key() == Qt.Key_F3:
            self.draw_font = QFontDialog.getFont()
            print(self.draw_font)

if __name__ == '__main__':

    app = QApplication(sys.argv)
    window = window()
    window.show()
    sys.exit(app.exec_())

A: Статичный метод getFont() возвращает tuple, первый параметр которого это признак Принятия, или Отклонения выбора, а второй это сам объект шрифта (для PySide2, а для PyQt наоборот), поэтому вызов надо делать так:
PySide2:
isAccepted, self.draw_font = QFontDialog.getFont()

PyQt5:
self.draw_font, isAccepted = QFontDialog.getFont()


text:
Q: How does Ruby's .() operator work? I recently came across some code using a method call consisting of the format object.(arg1, arg2)  without seeing a good explanation of how it works. See this sample code:
class TestServiceObject
  def call
    'method'
  end
end

TestServiceObject.new.()
# => 'method'

What's the term for this kind of shorthand?

A: foo.(bar, baz)

is interpreted as
foo.call(bar, baz)

just like
foo + bar

is interpreted as
foo.+(bar)

or
foo[bar, baz] = quux

is interpreted as
foo.[]=(bar, baz, quux)

The intention is to make calling function-like objects look similar to calling methods:
foo.(bar, baz) # function
foo(bar, baz)  # method

Despite claims in other answers to this question, it has nothing to do with an "implicit call method" (Ruby doesn't even have implicit methods, only Scala does) or the indexing operator.
The indexing operator is translated into a different method call ([]) and not into a call to call:
o = Object.new

def o.call(*args); "`call` called with #{args.join(', ')}" end

o.(42)
# => "`call` called with 42"

o[42]
# NoMethodError: undefined method `[]' for #<Object:0xdeadbeefc0ffee>

def o.[](*args);   "`[]` called with #{args.join(', ')}"   end

o[42]
# => "`[]` called with 42"

A: obj.(args) is just a feature provided through the parser. Not technically an alias, but it simply has the same effect as invoking obj.call(args) on an object that defines the call method.

A: The dot-parentheses notation is a shorthand way for passing arguments to the implicit call method on a Ruby object:
foo = lambda {|bar| puts bar}

foo.call('baz')
#=> baz
foo.('baz')

foo.call('baz') === foo.('baz')
#=> true

Also note that the following notations are also valid (and equivalent) invocations of the call method:
foo['baz']
#=> baz
foo::('baz')
#=> baz

In your example, you're explicitly overriding the call method on the TestServiceObject class such that it returns the string 'method' when called. Accordingly, you can explicitly override the the call method to accept arguments:
class TestServiceObject
  def call(foo=nil)
    foo || 'method'
  end
end

TestServiceObject.new.()
#=> method
TestServicesObject.new.('bar')
#=> bar

UPDATE:
As commenter @LoganSerman duly notes, the shorthand operator appears to work on anything that responds to call, which is validated in part by the following example:
m = 12.method("+")

m.call(3)
#=> 15
m.(3)
#=> 15

UPDATE 2:
As commenter @Stefan also points out from the documentation on Proc#call:

prc.() invokes prc.call() with the parameters given. It's a syntax sugar to hide "call".


text:
Q: External Exception E0434352 on calling a C++/CLI Wrapper The below solution creates the libraries 'YahooAPI.dll' & 'YahooAPIWrapper.dll'.
(original project found here: http://pragmateek.com/using-c-from-native-c-with-the-help-of-ccli-v2/)
From a 3rd party application I call 'YahooAPIWrapper.dll' with the following results:

*

*the function 'Foo' returns the expected data without issue (it doesn't call the YahooAPI.dll).

*the function 'GetRevision' via the function 'GetRevisionUtil', calls 'YahooAPI.dll' twice; each call shows the msgbox without error. However, after the 2nd msgbox is shown, a popup appears showing: External Exception E0434352

For trouble-shooting I added the c++ console app.
Please see the comments in the below code.
YahooAPI.dll:
// YahooAPI.cs

using System;
using System.Windows.Forms;

public class YahooAPI
{
    public string GetRevisionUtil(string rev)
    {
        MessageBox.Show("CurrentRev: " + rev);
        return "rev_" + rev ;
    }
}

YahooAPIWrapper.dll header:
// YahooAPIWrapper.h

#pragma once

#define DLL_EXP extern "C" __declspec(dllexport)
DLL_EXP void GetRevision(char* data_in, char *data_out);
DLL_EXP void Foo(char* data_in, char *data_out);

class YahooAPIWrapperPrivate;
class __declspec(dllexport) YahooAPIWrapper
{
private:  YahooAPIWrapperPrivate* _private;

public:
    YahooAPIWrapper();
    ~YahooAPIWrapper();

    const char* GetRevisionFunc(const char* rev);
};

Please see the comments in the function: GetRevision
// YahooAPIWrapper.cpp

#include "stdafx.h"
#include <msclr\auto_gcroot.h>
#include <string>
#using "YahooAPI.dll"

#include <msclr\auto_gcroot.h>
#include "YahooAPIWrapper.h"

using namespace System::Runtime::InteropServices; // Marshal

DLL_EXP void GetRevision(char* data_in, char *data_out)
{
    YahooAPIWrapper wrp;
    const char* c = wrp.GetRevisionFunc(data_in);  // 1st messagebox shows
    const char* d = wrp.GetRevisionFunc(c);   // 2nd messagebox shows

    strcpy_s(data_out,100, d);  // << HERE <<  3rd party app throws 'external exception E0434352 '
                          // the console app throws the error 'Unhandled exception...'
}

const char* YahooAPIWrapper::GetRevisionFunc(const char* rev)
{
    System::String^ managedCapi = _private->yahooAPI->GetRevisionUtil(gcnew System::String(rev));
    return (const char*)Marshal::StringToHGlobalAnsi(managedCapi).ToPointer();
}

DLL_EXP void Foo(char* data_in, char *data_out)
{
    int a_size = int(strlen(data_in));
    std::string s_a = convertToString(data_in, a_size);
    strcpy_s(data_out,100, s_a.c_str());
}

std::string convertToString(char* a, int size)
{
    int i;
    std::string s = "";
    for (i = 0; i < size; i++) {
        s = s + a[i];
    }
    return s;
}

class YahooAPIWrapperPrivate
{
    public: msclr::auto_gcroot<YahooAPI^> yahooAPI;
};

YahooAPIWrapper::YahooAPIWrapper()
{
    _private = new YahooAPIWrapperPrivate();
    _private->yahooAPI = gcnew YahooAPI();
}

YahooAPIWrapper::~YahooAPIWrapper()
{
    delete _private;
}

Console test app:
// Test.cpp

#include <iostream>
#include <stdio.h>

#include "YahooAPIWrapper.h"

int main()
{
    YahooAPIWrapper yahoo;

    char* a = "aaaa";
    char* b = "bbbb";

    const char* c = yahoo.GetRevisionFunc(b); // messagebox shows
    std::cout << c << std::endl;

    GetRevision(a, b); // 1st & 2nd msgbox shows - then error: "unhandled exception..."
    std::cout << a << std::endl;
    std::cout << b << std::endl;

    return 0;
}

EDIT: the 'console app' error is resolved.
(Full text of the above error:
Unhandled exception at 0x0f3c2fdd in Test.exe: 0xC0000005: Access violation writing location 0x00da7830.)

EDIT:
the above project has been pared down the following (see comments) - but still seeing 'External Exception E0434352':
namespace Publics {
    public class YahooAPI{
        public static void GetRevisionUtil() {
            string rev = "test";
            MessageBox.Show("CurrentRev: " + rev);
            //return "rev_" + rev;
        }
    }
}

// YahooAPIWrapper.h
#pragma once
#define DLL_EXP extern "C" __declspec(dllexport)
DLL_EXP void GetRevision(char* data_in, char *data_out);
DLL_EXP void Foo(char* data_in, char *data_out);

#include "stdafx.h"
#include <windows.h>
#include <msclr\auto_gcroot.h>
#include <string>

#using YahooAPI.dll"
#include "YahooAPIWrapper.h"

using namespace System::Runtime::InteropServices; // Marshal

DLL_EXP void GetRevision(char* data_in, char *data_out)
// this function builds & works fine with console
// however, immediately throws error (External Exception E0434352) when called by 3rd party app
// - does not even make it to MessageBox.
{
    MessageBox(NULL, TEXT("msg1"), TEXT("Test"), MB_OK);

    Publics::YahooAPI::GetRevisionUtil();

    // Publics::YahooAPI^ obj = gcnew Publics::YahooAPI;
    // obj->GetRevisionUtil();

    strcpy(data_out,  data_in);
}

EDIT:
My continued efforts to resolve this error were helped by using WinDbg - per:
https://stackoverflow.com/a/6245146/3818364
Help in actually using WinDbg was found here:
https://netmatze.wordpress.com/2012/08/24/using-windbg-exe-and-sos-dll-to-debug-a-net-4-0-application/
Below is a snippet from the WinDbg command window.
Note the use of the following commands:
.load C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll
!threads
ntdll!DbgBreakPoint:
772c2790 cc              int     3
0:014> .load C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll
0:014> g
(9b3c.a350): C++ EH exception - code e06d7363 (first chance)
(9b3c.a350): C++ EH exception - code e06d7363 (first chance)
(9b3c.a350): C++ EH exception - code e06d7363 (first chance)
(9b3c.a350): CLR exception - code e0434352 (first chance)
(9b3c.a350): C++ EH exception - code e06d7363 (first chance)
(9b3c.87d8): Break instruction exception - code 80000003 (first chance)
eax=00353000 ebx=00000000 ecx=772fb3b0 edx=772fb3b0 esi=772fb3b0 edi=772fb3b0
eip=772c2790 esp=0e9eff44 ebp=0e9eff70 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!DbgBreakPoint:
772c2790 cc              int     3
0:014> !threads
ThreadCount:      2
UnstartedThread:  0
BackgroundThread: 2
PendingThread:    0
DeadThread:       0
Hosted Runtime:   no
                                                                         Lock
       ID OSID ThreadOBJ    State GC Mode     GC Alloc Context  Domain   Count Apt Exception
   0    1 a350 0299d1b8     20220 Preemptive  0BFC41D4:00000000 04f22fd8 0     STA System.IO.FileNotFoundException 0bfc2768
  13    2 9b08 04f369c8     21220 Preemptive  00000000:00000000 04f22fd8 0     Ukn (Finalizer)
0:014> !PrintException /d 0bfc2768
Exception object: 0bfc2768
Exception type:   System.IO.FileNotFoundException
Message:          Could not load file or assembly 'YahooAPI.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
InnerException:   <none>

As you can see in the above window, I was able to resolve the original error 'External Exception E0434352' down to a 'C++ EH exception - code e06d7363'. And finally was able to resolve this error to the mundane: "System.IO.FileNotFoundException". My YahooAPIWrapper.dll could not find my (managed) YahooAPI.dll - even though they were both in the same folder.
Bottome line: my 3rd party app has a configuration function for the user to browse and select the folder for their Win32 dll.
My mistake was assuming that the correct location for the managed DLL (YahooAPI.dll) was to be in the same folder as the unmanaged (YahooAPIWrapper.dll).
The error was resolved by simply copying my managed DLL (YahooAPI.dll) to the folder where the 3rd party .Exe resides. Viola!

A: Using WinDbg allowed me to resolve the generic 'External Exception E0434352' error down to the more helpful: "System.IO.FileNotFoundException". Please see my last edit for links.


text:
Q: Best Way for Web Workflow for Wireframe, to HTML to SPA React/Angular I am new to front end web development. I work with a designer who makes mockups (no html) wire frames and the finished product is a React/Angular single page application.
I was thinking of this workflow.
1) Get the mockup wireframe
2) Recreate it in HTML/CSS and collaborate with the designer to make quick changes.
3) After completion, then take the HTML and convert it to the React/Angular single page application.
Thanks.

A: Hi Mitch welcome to web dev!
So I can't say I'd recommend that workflow exactly, only because you don't want to have to write and rewrite code and make it into components.
Working with a designer myself we collaborate closely on a daily basis.  If your designer is using sketch (which he loves) he can create wireframes and prototypes. Our workflow is similar to what you are proposing, this is what we do:

*

*We have a feature request that we need to design and build

*He creates a mockup / wireframe

*Then he whips that up into a prototype (optional)

*From there I turn the prototype into working code (we use angular)

*When I think I have recreated his prototype I ask him to look it over and we discuss from there.

For me, it is easy to go back and fix some CSS or change some HTML around, just keep everything organized and well commented so you can easily change stuff in the future as your app grows.
One other thing I would recommend is that you should create your own form of a wireframe so that you can see how your components are going to be placed and interacting with one another.
I hope that this helps you and your designer come up with a workflow that you both enjoy!

A: This is my workflow. I import the figma, sketch, adobexd design file into Desech Studio to get a clean html structure positioned with css grids. Then I need to adjust the margins and sizes and I'm done with the conversion. And finally I work on the responsiveness of the website.
Then I install and enable the react plugin and when I save the project, it will export react code. And then I work on the react code and components. Here's the github repository for the react plugin.


text:
Q: Change appearance of natbib \cite locally I am sorry if this question has already been addressed somewhere; it appears my Google Fu is weak with respect to this question.
The Problem
I am trying to create a table that compiles experimental data. My aim is to include the reference in a separate column, so as to distinguish it from the values in other columns. The problem that I now have is that the references generated still are formatted the same as in normal text (superscript). This is highly unpractical for use in the table, as the font size in it will also be smaller than normal text.
Minimum working example
Here is a MWE that demonstrates the problem:
\documentclass[english,12pt,oneside]{scrartcl}

\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[hidelinks]{hyperref}
\usepackage{charter}
\usepackage[a4paper,left=30mm,right=20mm,top=25mm,bottom=25mm,
            marginparwidth=3cm]{geometry}
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=up]{caption}
\usepackage[super, sort&compress]{natbib}

\begin{document}
\section{Introduction}
The influence of rings\cite{ref1} must not be neglected when examining this or
the other. Furthermore, acting is a career choice that should always be held in
high regard.\cite{ref2}

\section{The Table}
\begin{table}[h!]
    \centering
    \caption{This is the table that I am talking about. All the time.}
    \begin{tabular}{lrr}
    \hline \hline
    Field name & Value & Ref. \\
    \hline
    Arg1 & 122.3 & \cite{ref1} \\
    Arg2 & 129.4 & \cite{ref2} \\
    \hline
    \end{tabular}
\end{table}

\footnotesize
\bibliographystyle{unsrt}
\bibliography{biblio}

\end{document}

biblio.bib:
@article{ref1,
    author    = {Hermann Hesse},
    title     = "The Things about Annular Rings",
    journal   = "Journal of Rings",
    year      = "2064"
}
@article{ref2,
    author={Julia Roberts},
    title={Acting: A Career},
    journal = {Journal of Acting Reviews},
    pages={20--23},
    year=1997
}

Output

Desired Output
I'd like the table to look like the following:

Generally it would be great to have some new type of command like \tablecite{} which would then not superscript the reference.
Thanks in advance!


text:
Q: SELECT RANGE 1 IN 1 HOUR - POSTGRESQL GOAL
I would like to do a SELECT within a range of 1 hour in 1 hour
DATA TABLE
CREATE TABLE t (
    t_id   INT PRIMARY KEY,
    time   TIMESTAMP
);
INSERT INTO t VALUES (1, '2019-10-28 08:00:00');
INSERT INTO t VALUES (2, '2019-10-28 08:30:00');
INSERT INTO t VALUES (3, '2019-10-28 09:00:00');
INSERT INTO t VALUES (4, '2019-10-28 09:30:00');
INSERT INTO t VALUES (5, '2019-10-28 10:00:00');
INSERT INTO t VALUES (6, '2019-10-28 10:30:00');

QUERY
SELECT
    t_id,
    MIN(time)
FROM
    t
WHERE
    date_trunc('day', time) = current_date
GROUP BY
    t_id,
    date_trunc('hour', time)

OUTPUT
t_id    min
4   2019-10-28 09:30:00
5   2019-10-28 10:30:00
1   2019-10-28 08:00:00
2   2019-10-28 08:30:00
3   2019-10-28 09:00:00
6   2019-10-28 10:00:00

OUTPUT ESPERADO
t_id    min
1   2019-10-28 08:00:00
3   2019-10-28 09:00:00
5   2019-10-28 10:00:00

NOTE: REFORMED QUESTION
SQL FIDDLE

A: You can use DISTINCT ON to get the first t_id per hour.
SELECT DISTINCT ON (date_trunc('hour', time))
t_id, date_trunc('hour', time)
FROM t
WHERE date_trunc('day', time) = current_date
ORDER BY date_trunc('hour', time), t_id;

DISTINCT ON (date_trunc('hour', time)) along with ORDER BY date_trunc('hour', time), t_id allows us to grab the lowest t_id for each hour.
If instead you want the very first t_id in order of time, you could do the following:
SELECT DISTINCT ON (date_trunc('hour', time))
t_id, date_trunc('hour', time)
FROM t
WHERE date_trunc('day', time) = current_date
ORDER BY date_trunc('hour', time), time;

In this case, they are the same, but in the fiddle you added to the comments, they are not.


text:
Q: How do I use OAuth 2.0 to send Gmail from Indy? The following code successfully sends an e-mail using Google's Gmail servers, but only after lowering the Google account security settings to "Allow less secure apps."
The code offered below (originally from Remy LeBeau) does not incorporate OAuth 2.0, which is required if you do not want to ask your users to make the seemingly tough decision to lower their security setting to allow your application to succeed.  How do I incorporate OAuth 2.0 into the Indy solution to satisfy Google's higher security standard?
Working Solution:
function TTabbedwithNavigationForm.SendEmailNow(FromStr, ToStr, Subject,
MessageBody, Host: String; Port: Integer; UserName, Pass: String): Boolean;
  begin

///From Remy LeBeau Indy SMTP with SSL via gmail host
Result := False;

try
  IdMessage1 := nil;
  IdSSLIOHandlerSocketOpenSSL1 := nil;
  IdSMTP1 := nil;
  try
    //setup mail message
    try
      IdMessage1                         := TIdMessage.Create(nil);
      IdMessage1.From.Address                := FromStr;//// change to league email
      IdMessage1.Recipients.EMailAddresses   := ToStr;
      IdMessage1.Subject                     := Subject;
      IdMessage1.Body.Text                   := MessageBody;
      //if FileExists(datafilename) then
      //  IdAttachmentFile := TIdAttachmentFile.Create(IdMessage1.MessageParts, datafilename);
    except
      Exception.RaiseOuterException(Exception.Create('Could not create message, please try again later'));
    end;

//setup TLS
try
  IdSSLIOHandlerSocketOpenSSL1                    := TIdSSLIOHandlersocketopenSSL.Create(nil);
  IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method      := sslvTLSv1;
  IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode        := sslmUnassigned;
  IdSSLIOHandlerSocketOpenSSL1.SSLOptions.VerifyMode  := [];
  IdSSLIOHandlerSocketOpenSSL1.SSLOptions.VerifyDepth := 0;
except
  Exception.RaiseOuterException(Exception.Create('Could not create SSL handler, please try again later'));
end; // of try ssl

//setup SMTP
try
  IdSMTP1           := TIdSMTP.Create(nil);
  IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
  IdSMTP1.UseTLS    := utUseExplicitTLS;
  IdSMTP1.Host      := Host;//'smtp.gmail.com';
  IdSMTP1.Port      := Port;//587;
  IdSMTP1.Username  := UserName;  // 'username@gmail.com';
  IdSMTP1.password  := Pass;  //***gmail account password';
except
  Exception.RaiseOuterException(Exception.Create('Could not create SMTP handler, please try again later'));
end; // of try

try
  IdSMTP1.Connect;
  try
    IdSMTP1.Send(IdMessage1) ;
  finally
    IdSMTP1.Disconnect;
  end;
except
  Exception.RaiseOuterException(Exception.Create('Could not send secure email, please try again later'));
end;
  finally
    IdSMTP1.Free;
    IdSSLIOHandlerSocketOpenSSL1.Free;
    IdMessage1.Free;
    Result := True;
  end;
except
  on E: Exception do
  begin
    if E.InnerException <> nil then
      ShowMessage('ERROR: ' + E.Message + #13#13 + E.InnerException.Message)
    else
      ShowMessage('ERROR: ' + E.Message);
  end;
end;

/// End Remy LeBeau Code

end;

A: You need to import lib BackgroundMailLibrary
BackgroundMail bm = new BackgroundMail(PasswordChangeActivity.this);
                                            bm.setGmailUserName(mail id);
                                            bm.setGmailPassword(Utils.decryptIt(password));
                                            bm.setMailTo(ownerEmail);
                                            bm.setFormSubject(subject);
                                            bm.setFormBody(body);
                                            bm.send();


text:
Q: If $ \sum_{r=1}^{n} t_r $ = $ { n ( n + 1 ) ( n + 2 ) ( n + 3 ) } \over {8} $ , then what does $ \sum_{r=1}^{n} {1\over {t_r} } $ equal to? $ \sum_{r=1}^{n} t_r $ = $ { n ( n + 1 ) ( n + 2 ) ( n + 3 ) } \over {8} $
$ \sum_{r=1}^{n} {1\over {t_r} } $ = ?
My progress so far :
$ t_1 = {{1*2*3*4 } \over 8 } = 3 $
$ t_2 = 15 $
$ t_3 = 45 $
$ t_4 = 105 $
$ t_5 = 210 $
$ \sum_{r=1}^{n} {1\over {t_r} } $ = 1/3 + 1/12 + 1/30 + 1/60 + 1/105 .... So on , but I dont get a pattern .
How do I solve this ?

A: You can verify the series simplification at the bottom via telescoping or induction.
$$\sum_{r=1}^{n}t_r=\frac{n(n+1)(n+2)(n+3)}{8}$$
$$\implies t_n=\sum_{r=1}^{n}t_r-\sum_{r=1}^{n-1}t_r=\frac{n(n+1)(n+2)(n+3)}{8}-\frac{(n-1)n(n+1)(n+2)}{8}=\frac{n(n+1)(n+2)}{8}\big((n+3)-(n-1)\big)=\frac{n(n+1)(n+2)}{2}$$
$$\implies \frac{1}{t_r}=\frac{2}{r(r+1)(r+2)}=\frac{1}{r}-\frac{2}{r+1}+\frac{1}{r+2}$$
$$\implies \sum_{r=1}^n\frac{1}{t_r}=\sum_{r=1}^n\frac{1}{r}-2\sum_{r=1}^n\frac{1}{r+1}+\sum_{r=1}^n\frac{1}{r+2}=\frac{n(n+3)}{2(n+1)(n+2)}$$


text:
Q: How to get local notification when app is not open in android? I want to set local notification when location is change.so how can i active my app in background and check for update location in andorid.in location listner i set my entire logic for getting notification but i do not know why it is not working and also app is not running in background so please help me. i am new in android.
public class GPService extends Service {
NotificationManager nManager;
Notification notification ;
ArrayList<ImgProperties> arr ;
Calendar calender ;
String distance  ;
Location dest_location;
DBhelper dbHelper ;
Context context = this;
@Override
public IBinder onBind(Intent intent) {
return null;
}

private static void start() {
}
@SuppressWarnings("unused")
private static void stop() {
throw new UnsupportedOperationException("Not yet implemented");
    }

    private void show() {
        throw new UnsupportedOperationException("Not yet implemented");
    }

    private final IBinder mBinder = new LocalBinder();

    public class LocalBinder extends Binder {
        GPService getService() {
            return GPService.this;
        }
    }

    @Override
    public void onCreate() {
        SharedPreferences settings = getSharedPreferences("geodroid", 0);
        LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER
                ,Integer.parseInt(settings.getString("GPS", "3"))*1000
               , Integer.parseInt(settings.getString("Dist", "1")), locationListenerGPS);

    }

    public  android.location.Location getCurrentGeoLocation()
    {
        android.location.Location location = null;
        LocationManager locManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
        try {
            locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,0, locationListenerGPS);
            location = locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(location == null)
        {
            locManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0,0, locationListenerGPS);
            location = locManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
        }
        return location;
    }

    private final LocationListener locationListenerGPS = new LocationListener() {

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {

        }

        @Override
        public void onProviderEnabled(String provider) {

        }

        @Override
        public void onProviderDisabled(String provider) {

        }

        @SuppressWarnings("deprecation")
        @Override
        public void onLocationChanged(Location location) {

            calender = Calendar.getInstance();
            String Cdate = calender.get(Calendar.YEAR) + "/" +
                        (calender.get(Calendar.MONTH) + 1) + "/" +
                            calender.get(Calendar.DAY_OF_MONTH);
            String Ctime = calender.get(Calendar.HOUR) + ":" +
                        calender.get(Calendar.MINUTE) ;

            Location loc = getCurrentGeoLocation();

            nManager = (NotificationManager) getApplicationContext().getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
            dbHelper = new DBhelper(GPService.this);
            dbHelper.open();

            arr = dbHelper.getAllData();
            if(arr!= null){
            for(ImgProperties ipp : arr){
                String lt = ipp.getLat();
                String lon = ipp.getLng();

                dest_location = new Location("");

                    dest_location.setLatitude(Double.parseDouble(lt));
                    dest_location.setLongitude(Double.parseDouble(lon));

                    float[] results = new float[3];
                    android.location.Location.distanceBetween(loc.getLatitude(),
                            loc.getLongitude(), dest_location.getLatitude(), dest_location.getLongitude(), results);
                    double ddd = Utilities.metersToMile(results[0]);
                    int dd = (int) Math.ceil(ddd) ;
                    //double dis = loc.distanceTo(dest_location);
                    //distance = String.format("%.2f", dis);
                    //int dd = Integer.parseInt(distance);
                    Log.e("distacce", String.valueOf(dd));
                    Log.e("from date", String.valueOf(ipp.getFrom_date().equals(Cdate)));

                    Log.e("from date", String.valueOf(ipp.getFrom_time().equals(Ctime)));
                    Log.e("from date", String.valueOf(Integer.parseInt(ipp.getRadius())<=dd));

                    if(ipp.getIs_active().equals("Deactive")){

                        if(ipp.getFrom_date().equals(Cdate)){

                        if(ipp.getFrom_time().equals(Ctime)){

                            Log.e("", "1");
                                String act = "Active";
                                String patt = ipp.getBmp();
                                ImgProperties imgProp = new ImgProperties(act,patt);
                                dbHelper.updateSingle(imgProp);

                            notification =  new Notification(R.drawable.ic_launcher, "you click this", 11);

                            String title = context.getString(R.string.app_name);
                            Intent notificationIntent = new Intent(context, DashPage.class);
                            notificationIntent.putExtra("ms", "you click this");
                            notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                            PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
                            notification.setLatestEventInfo(context, title, "you click this", intent);
                            notification.flags |= Notification.FLAG_AUTO_CANCEL;

                            notification.defaults |= Notification.DEFAULT_SOUND;

                         //   notification.defaults |= Notification.DEFAULT_VIBRATE;
                            nManager.notify(0, notification);
                           // stopSelf();
                        }

                        else if(Integer.parseInt(ipp.getRadius())<=dd){

                            Log.e("", "2");
                             String act = "Active";
                                String patt = ipp.getBmp();
                                ImgProperties imgProp = new ImgProperties(act,patt);
                                dbHelper.updateSingle(imgProp);
                            notification =  new Notification(R.drawable.ic_launcher, "you click this", 11);

                            String title = context.getString(R.string.app_name);
                            Intent notificationIntent = new Intent(context, DashPage.class);
                            notificationIntent.putExtra("ms", "you click this");
                            notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                            PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
                            notification.setLatestEventInfo(context, title, "you click this", intent);
                            notification.flags |= Notification.FLAG_AUTO_CANCEL;

                            notification.defaults |= Notification.DEFAULT_SOUND;

                          //  notification.defaults |= Notification.DEFAULT_VIBRATE;
                            nManager.notify(1, notification);
                           // stopSelf();
                        }

                }
                else if(ipp.getFrom_time().equals(Ctime))
                {
                    Log.e("", "3");
                        String act = "Active";
                        String patt = ipp.getBmp();
                        ImgProperties imgProp = new ImgProperties(act,patt);
                        dbHelper.updateSingle(imgProp);

                    notification =  new Notification(R.drawable.ic_launcher, "you click this", 11);
                    //new Notification(icon, tickerText, when)

                    String title = context.getString(R.string.app_name);
                    Intent notificationIntent = new Intent(context, DashPage.class);
                    notificationIntent.putExtra("ms", "you click this");
                    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                    PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
                    notification.setLatestEventInfo(context, title, "you click this", intent);
                    notification.flags |= Notification.FLAG_AUTO_CANCEL;

                    notification.defaults |= Notification.DEFAULT_SOUND;

                  //  notification.defaults |= Notification.DEFAULT_VIBRATE;
                    nManager.notify(2, notification);
                  //  stopSelf();

                }
                else if(Integer.parseInt(ipp.getRadius())<=dd)
                {
                    Log.e("", "4");
                     String act = "Active";
                     String patt = ipp.getBmp();
                        ImgProperties imgProp = new ImgProperties(act,patt);
                        dbHelper.updateSingle(imgProp);

                        notification =  new Notification(R.drawable.ic_launcher, "you click this", 11);

                    String title = context.getString(R.string.app_name);
                    Intent notificationIntent = new Intent(context, DashPage.class);
                    notificationIntent.putExtra("ms", "you click this");
                    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                    PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
                    notification.setLatestEventInfo(context, title, "you click this", intent);
                    notification.flags |= Notification.FLAG_AUTO_CANCEL;

                    notification.defaults |= Notification.DEFAULT_SOUND;

                  //  notification.defaults |= Notification.DEFAULT_VIBRATE;
                    nManager.notify(3, notification);
                    stopSelf();

                }

                    }

            }
        }

        }
    };

                                 @Override
                                public int onStartCommand(Intent intent, int flags, int startId) {

                                     GPService.start();
                                    return START_STICKY;
                                }

                                 @Override
                                 public void onDestroy() {
                                     // Cancel the persistent notification.
                                     //mNM.cancel(NOTIFICATION);
                                        GPService.stop();
                                     // Tell the user we stopped.
                                     Toast.makeText(this, "geodroid service stopped", Toast.LENGTH_SHORT).show();
                                 }

A: Dont forget to add a Gps Status Listener that will start GPS coordinates polling from available satellites. You should do that before calling to locationManager.requestLocationUpdates(...) :
        locationManager.addGpsStatusListener(new GpsStatus.Listener() {
            @Override
            public void onGpsStatusChanged(int i) {
                log(getTimeStamp() + ":GSL:onGpsStatusChanged");
                switch (i) {
                    case GpsStatus.GPS_EVENT_STOPPED:
                        log(getTimeStamp() + ":GPS_EVENT_STOPPED");
                        break;
                    case GpsStatus.GPS_EVENT_STARTED:
                        log(getTimeStamp() + ":GPS_EVENT_STARTED");
                        break;
                    case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
                        log(getTimeStamp() + ":GPS_EVENT_SATELLITE_STATUS");
                        GpsStatus gpsStatus = locationManager.getGpsStatus(null);
                        Iterable<GpsSatellite> gpsSatelliteIterable = gpsStatus.getSatellites();
                        Iterator<GpsSatellite> iterator = gpsSatelliteIterable.iterator();
                        int iCurrentSatIndex = 0;
                        while (iterator.hasNext()) {
                            GpsSatellite gpsSatellite = iterator.next();
                            log("SAT" + iCurrentSatIndex + ":Signal to Noise Ratio =" + gpsSatellite.getSnr());
                            log("SAT" + iCurrentSatIndex + ":Pseudo Random Number =" + gpsSatellite.getSnr());
                            log("SAT" + iCurrentSatIndex + ":Elevation =" + gpsSatellite.getElevation());
                            log("SAT" + iCurrentSatIndex + ":Azimuth =" + gpsSatellite.getAzimuth());
                            log("SAT" + iCurrentSatIndex + ":hasAlmanac =" + gpsSatellite.hasAlmanac());
                            log("SAT" + iCurrentSatIndex + ":hasEphemeris =" + gpsSatellite.hasEphemeris());
                            log("SAT" + iCurrentSatIndex + ":usedInFix =" + gpsSatellite.usedInFix());
                            iCurrentSatIndex++;
                        }
                        break;
                    case GpsStatus.GPS_EVENT_FIRST_FIX:
                        log(getTimeStamp() + ":GPS_EVENT_FIRST_FIX");
                        break;
                    default:
                        break;
                }
            }
        });


text:
Q: How to remove the item in View Binding in a Recycler view adapter I am getting the date from the activity in the adapter and then created a custom layout for showing data in a recycler but I want to remove some item on a certain condition if its matches with any condition in a view binding in adapter but I am unable to delete it. any idea how to delete the item?
Below is my code of the adapter.
public class Get_Events_List_Adapter extends RecyclerView.Adapter<Get_Events_List_Adapter.Get_Events_List_Adapter_View_Holder>
{
    Context context;
    List<responsemodel> data;
    int hour,minute,year,month,date;

    private ItemClickListner mItemListner;

    public Get_Events_List_Adapter(Context applicationContext, List<responsemodel> data,int hour,int minute,int year,int month,int date, ItemClickListner itemClickListner)
    {
        this.data = data;
        this.mItemListner = itemClickListner;
        this.context = applicationContext;
        this.hour = hour;
        this.minute = minute;
        this.year = year;
        this.month = month;
        this.date = date;
    }

    @NonNull
    @Override
    public Get_Events_List_Adapter_View_Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.display_events_list_layout,parent,false);
        return new Get_Events_List_Adapter_View_Holder(view);
    }

    @RequiresApi(api = Build.VERSION_CODES.N)
    @Override
    public void onBindViewHolder(@NonNull Get_Events_List_Adapter_View_Holder holder, int position) {

        holder.display_events_list_event_name.setText(data.get(position).getCreate_Event_Name());
        holder.display_events_list_event_organizer.setText(data.get(position).getCreate_Event_Organizer());
        holder.display_events_list_event_type.setText(data.get(position).getCreate_Event_Type());
        if (TextUtils.isEmpty(data.get(position).getCreate_Event_Specific_Person()))
        {
            holder.display_events_list_event_specific_person.setVisibility(View.GONE);
        }
        else
        {

        }

        String starting_time_hour = data.get(position).getCreate_Event_Starting_Time_Hour();
        int Starting_Time_Hour = Integer.parseInt(starting_time_hour);
        String starting_time_minute = data.get(position).getCreate_Event_Starting_Time_Minute();
        int Starting_Time_Minute = Integer.parseInt(starting_time_minute);
        String starting_date_day = data.get(position).getCreate_Event_Starting_Date_Day();
        int Starting_Date_Day = Integer.parseInt(starting_date_day);
        String starting_date_month = data.get(position).getCreate_Event_Starting_Date_Month();
        int Starting_Date_Month = Integer.parseInt(starting_date_month);
        String starting_date_year = data.get(position).getCreate_Event_Starting_Date_Year();
        int Starting_Date_Year = Integer.parseInt(starting_date_year)-1900;

        String ending_time_hour = data.get(position).getCreate_Event_Ending_Time_Hour();
        int Ending_Time_Hour = Integer.parseInt(ending_time_hour);
        String ending_time_minute = data.get(position).getCreate_Event_Ending_Time_Minute();
        int Ending_Time_Minute = Integer.parseInt(ending_time_minute);
        String ending_date_day = data.get(position).getCreate_Event_Ending_Date_Day();
        int Ending_Date_Day = Integer.parseInt(ending_date_day);
        String ending_date_month = data.get(position).getCreate_Event_Ending_Date_Month();
        int Ending_Date_Month = Integer.parseInt(ending_date_month);
        String ending_date_year = data.get(position).getCreate_Event_Ending_Date_Year();
        int Ending_Date_Year = Integer.parseInt(ending_date_year)-1900;

        Date dates = new Date();
        dates.setHours(Starting_Time_Hour);
        dates.setMinutes(Starting_Time_Minute);
        SimpleDateFormat df = new SimpleDateFormat("hh:mm a");
        String st = df.format(dates);

        holder.display_events_list_event_starting_time.setText(st);

        Date date1 = new Date();
        date1.setHours(Ending_Time_Hour);
        date1.setMinutes(Ending_Time_Minute);
        SimpleDateFormat df1 = new SimpleDateFormat("hh:mm a");
        String et = df1.format(date1);

        holder.display_events_list_event_ending_time.setText(et);

        Date date2 = new Date();
        date2.setYear(Starting_Date_Year);
        date2.setMonth(Starting_Date_Month);
        date2.setDate(Starting_Date_Day);
        SimpleDateFormat fmtOut = new SimpleDateFormat("yyyy―MM―dd");
        String sd = fmtOut.format(date2);

        holder.display_events_list_event_starting_date.setText(sd);

        Date date3 = new Date();
        date3.setYear(Ending_Date_Year);
        date3.setMonth(Ending_Date_Month);
        date3.setDate(Ending_Date_Day);
        SimpleDateFormat df3 = new SimpleDateFormat("yyyy―MM―dd");
        String ed = df3.format(date3);

        holder.display_events_list_event_ending_date.setText(String.valueOf(ed));

        if (Integer.parseInt(starting_date_year)<year)
        {
            **Remove item at this point**
        }
        else if (Integer.parseInt(starting_date_year)==year && Integer.parseInt(starting_date_month)<month)
        {
            **Remove item at this point**
        }
        else if (Integer.parseInt(starting_date_year)==year && Integer.parseInt(starting_date_month)==month && Integer.parseInt(starting_date_day)<date)
        {
            **Remove item at this point**
        }
        else
        {
            if (Integer.parseInt(starting_time_hour)<hour && Integer.parseInt(starting_date_year)==year && Integer.parseInt(starting_date_month)==month && Integer.parseInt(starting_date_day)==date)
            {
                **Remove item at this point**
            }
            else if (Integer.parseInt(starting_time_hour)==hour && Integer.parseInt(starting_time_minute)<minute  && Integer.parseInt(starting_date_year)==year && Integer.parseInt(starting_date_month)==month && Integer.parseInt(starting_date_day)==date)
            {
                **Remove item at this point**
            }
        }

        if (position == data.size()-1)
        {
            holder.display_events_list_event_view.setVisibility(View.GONE);
            holder.display_events_list_event_no_more.setVisibility(View.VISIBLE);
        }

        holder.itemView.setOnClickListener(view -> {
            mItemListner.onItemClick(data.get(position));
        });

    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    public interface ItemClickListner {
        void  onItemClick(responsemodel details);
    }

    class Get_Events_List_Adapter_View_Holder extends RecyclerView.ViewHolder
    {
        TextView display_events_list_event_name,display_events_list_event_organizer,display_events_list_event_type,display_events_list_event_starting_date,display_events_list_event_ending_date,display_events_list_event_starting_time,display_events_list_event_ending_time;
        View display_events_list_event_view;
        TextView display_events_list_event_no_more;

        public Get_Events_List_Adapter_View_Holder(@NonNull View itemView) {
            super(itemView);

            display_events_list_event_name = itemView.findViewById(R.id.display_events_list_event_name);
            display_events_list_event_organizer = itemView.findViewById(R.id.display_events_list_event_organizer);
            display_events_list_event_type = itemView.findViewById(R.id.display_events_list_event_type);
            display_events_list_event_starting_date = itemView.findViewById(R.id.display_events_list_event_starting_date);
            display_events_list_event_ending_date = itemView.findViewById(R.id.display_events_list_event_ending_date);
            display_events_list_event_starting_time = itemView.findViewById(R.id.display_events_list_event_starting_time);
            display_events_list_event_ending_time = itemView.findViewById(R.id.display_events_list_event_ending_time);

            display_events_list_event_view = itemView.findViewById(R.id.display_events_list_event_view);

            display_events_list_event_no_more = itemView.findViewById(R.id.display_events_list_event_no_more);

        }
    }
}


text:
Q: Sum of Kloosterman sums bound by $O(n^{\epsilon})$ I've been studying the book "Topics in Classical Automorphic forms" by Henryk Iwaniec and I am stuck at a bound.
For even $k$ and any $3/4 < \sigma < 1$ the book claims the following for the Kloosterman sum $S(n,n,c)$ where $\epsilon>0 $ is fixed, as $n$ gets large. (page 73)
$$\sum_{c>0} c^{-2\sigma}|S(n,n,c)| \ll n^{\epsilon} $$
I've been trying to prove this using the Weyl bound $|S(m,n,c)| \le \gcd(m,n,c)^{1/2} c^{1/2}\tau(c)$ but I haven't managed to do so. Maybe I am missing something basic but in order to create a convergent series the bounds for the $\tau$ function seems to exceed any hopes I have for that.

A: Since $|S(n,n;c)| \leq (n,c)^{1/2} c^{1/2} \tau(c)$ and $\tau(c) \ll_{\varepsilon} c^{\varepsilon}$, this sum is
$$\ll_{\varepsilon} \sum_{c = 1}^{\infty} \frac{(n,c)^{1/2}}{c^{2\sigma - 1/2 - \varepsilon}}.$$
Now write this sum over $c \in \mathbb{N}$ as a double sum over $m \mid n$ and over $c \in \mathbb{N}$ for which $(c,n) = m$ (that is, break up the sum over $c$ based on the $\gcd$ of $c$ and $n$). Having done this, make the change of variables $c \mapsto mc$, since $(c,n) = m$ implies that $m \mid c$. We get
$$\sum_{m \mid n} \frac{1}{m^{2\sigma - 1 - \varepsilon}} \sum_{\substack{c = 1 \\ (c,\frac{n}{m}) = 1}}^{\infty} \frac{1}{c^{2\sigma - 1/2 - \varepsilon}}.$$
The inner sum over $c$ converges absolutely since $\sigma > 3/4$. The outer sum is $\ll_{\varepsilon} n^{\epsilon}$.


text:
Q: How to create multiple sections of textviews using multiple touch? I am working on this project where I have requirement like follows,

As you can see in this image I have views with few textViews or imageViews.
User can move any view horizontally only, This is I am able to do and its working fine.
But I have a second scenario with multiple finger touch like this,

In this scenario user can move two views using multiple finger max. 2, This I am not able to do.
I have tried with finding the multiple pointer index in touch listener but I am not able to make it work properly.
Can anyone help me with this?
Thanks in Adv.

A: Sorry Not Much of a kotlin fan yet , but i did implemented this kind of task a while ago.
I created a view on which if you multi touch it will give you exact android.graphics.PointF object for the finger , then you can easily compare by getting position other views on top of my view to check if finger is pressing/dragging that particular view.View is hosted on Github.
And to check if finger point is overlapping other view , check this answer.
Note: this answer is just to kick start your process of solving the problem , as question itself is too broad to answer completely

A: Thanks for reaching out. I understand that the question is too broad, So I have started working on my own to achieve this functionality. I do have found some success a while back and I have uploaded the demo project on GitHub, here's the link, github.com/nightfox8/SwipeDemo To all those who might need this kind of solution in future, Thanks


text:
Q: ASP.NET MVC - Передача данных во второе представление Мне необходимо по нажатию кнопки "Авторизоваться" передать значения из текстовых полей первого представления во второе представление и открыть его.
Что я должен написать в контроллере?
Представление 1

    <form class="register-form" method="post" action="~/Views/Library/Books">
        <input type="text" placeholder="Электронная почта" name="Email" />
        <button type="submit">Отправить</button>

Передумали? Авторизация

    </form>

    <form class="login-form" method="post">
        <input type="text" placeholder="Логин" name="Login" />
        <input type="password" placeholder="Пароль"  name="Password"/>
        <button>Авторизоваться</button>

Забыли пароль? Вспомнить

    </form>

Метод Auth
public ActionResult Auth()
    {
        return View();
    }

Нужно создать еще один метод, который будет это выполнять? Не пойму, как это связать и как передать значения из представления

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


text:
Q: determine which database row is causing an "Input string was not in correct format" I have a project using NHibernate linked with a MySQL database.  All of a sudden, the homepage started throwing the below error:
Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14281985
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +305
   System.SByte.Parse(String s, NumberStyles style, NumberFormatInfo info) +41
   MySql.Data.Types.MySqlByte.MySql.Data.Types.IMySqlValue.ReadValue(MySqlPacket packet, Int64 length, Boolean nullVal) +182
   MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32 index, MySqlField field, IMySqlValue valObject) +376
   MySql.Data.MySqlClient.ResultSet.ReadColumnData(Boolean outputParms) +105
   MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior) +263
   MySql.Data.MySqlClient.MySqlDataReader.Read() +98
   NHibernate.Driver.NHybridDataReader.Read() +28
   NHibernate.Impl.MultiCriteriaImpl.GetResultsFromDatabase(IList results) +1363

    [HibernateException: Error executing multi criteria : [SELECT count(distinct this_.ID) as y0_ FROM `PropertyItem` this_ WHERE (this_._Temporary_Flag = ?p0 or this_._Temporary_Flag is null) and (this_._Deleted = ?p1 or this_._Deleted is null) and this_.Featured = ?p2 and this_.Activated = ?p3 and this_.ListingStatus = ?p4 and this_.HideListingFromWeb = ?p5 and this_.HideListingFromPublic = ?p6;
SELECT this_.ID as ID53_1_, this_.FullPropertyDescription as FullProp2_53_1_, this_.HeaderTagText as HeaderTa3_53_1_, this_.PropertyCategory as Property4_53_1_, this_.PropertyStatus as Property5_53_1_, this_.ShortDescription as ShortDes6_53_1_, this_.PropertyPrice as Property7_53_1_, this_.RefCode as RefCode53_1_, this_.Featured as Featured53_1_, this_.Title as Title53_1_, this_.StarRating as StarRating53_1_, this_.AmountOfBedrooms as AmountO12_53_1_, this_.Activated as Activated53_1_, this_.PropertyPlotSize as Propert14_53_1_, this_.PropertyFloorArea as Propert15_53_1_, this_.AmountOfBathrooms as AmountO16_53_1_, this_.AmountOfGarages as AmountO17_53_1_, this_.VirtualTourURL as Virtual18_53_1_, this_.RentInterval as RentInt19_53_1_, this_.HolidayPriceDescription as Holiday20_53_1_, this_.Exclusive as Exclusive53_1_, this_.FacebookImageFilename as Faceboo22_53_1_, this_.MainImageFilename as MainIma23_53_1_, this_.IsFromXMLFile as IsFromX24_53_1_, this_.PriceDaily as PriceDaily53_1_, this_.FeatureValuesForSearch as Feature26_53_1_, this_._LastEditedOn as column27_53_1_, this_.IsExclusive as IsExclu28_53_1_, this_.HidePriceFromPublic as HidePri29_53_1_, this_.ListingStatus as Listing30_53_1_, this_.HideListingFromWeb as HideLis31_53_1_, this_.LastXmlImportInfo as LastXml32_53_1_, this_.HideListingFromPublic as HideLis33_53_1_, this_._Temporary_LastUpdOn as column34_53_1_, this_._Temporary_Flag as column35_53_1_, this_._Deleted as column36_53_1_, this_._DeletedOn as column37_53_1_, this_.Priority as Priority53_1_, this_.LocalityID as LocalityID53_1_, this_.PropertyTypeID as Propert40_53_1_, this_._LastEditedByID as column41_53_1_, this_.OfficeNameID as OfficeN42_53_1_, this_.SalesAgentID as SalesAg43_53_1_, location2_.ID as ID36_0_, location2_.ReferenceID as Referenc2_36_0_, location2_.Title as Title36_0_, location2_.LocationType as Location4_36_0_, location2_._Temporary_LastUpdOn as column5_36_0_, location2_._Temporary_Flag as column6_36_0_, location2_._Deleted as column7_36_0_, location2_._DeletedOn as column8_36_0_, location2_.Priority as Priority36_0_, location2_.ParentLocationID as ParentL10_36_0_ FROM `PropertyItem` this_ left outer join `Location` location2_ on this_.LocalityID=location2_.ID WHERE (this_._Temporary_Flag = ?p7 or this_._Temporary_Flag is null) and (this_._Deleted = ?p8 or this_._Deleted is null) and this_.Featured = ?p9 and this_.Activated = ?p10 and this_.ListingStatus = ?p11 and this_.HideListingFromWeb = ?p12 and this_.HideListingFromPublic = ?p13 and this_.ID in (?p14, ?p15, ?p16, ?p17, ?p18, ?p19, ?p20, ?p21);]]
       Classes.Search.DatabaseSearcher.GetSearchInDatabase()
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.BasePartialCachingControl.LoadRecursive() +143
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Is it be possible to determine which rows are causing the issue?  The resulting dataset is quite large and difficult to go through it one by one.

A: A few observations from your error messages:

*

*NHibernate is trying to convert a string to a number, and failing. So you should focus on varchar (or similar) columns that have been mapped to int properties.  Take a look at your NHibernate mappings and CREATE TABLE statements to figure out which columns might be the problem.

*It is not possible for SELECT count(...) to return a string, so the problem must be elsewhere.

*It looks like the query has been truncated (....), and you are using MultiCriteria, so I suspect that there is a second or third SELECT query in this batch that is actually causing the problem.  Focus on the columns listed in the SELECT clauses of these queries.

Once you've determined which columns are potentially guilty, you can identify which rows contain non-integer text in those columns with a simple SELECT query: How do I check to see if a value is an integer in MySQL?


text:
Q: How to get the node name associated with the value in c# <NodeA>
  <ChildNode>
     XYZ
  </ChildNode>
  <ChildNode1>
     ABC
  </ChildNode1>
</NodeA>

I have an XML.
Suppose if I get the value as ABC I want to check that which node it is coming from so the answer should be like "ChildNode1".
Can we get this type of thing ?

A: Try this
            string xml =
                "<NodeA>" +
                  "<ChildNode>" +
                     "XYZ" +
                  "</ChildNode>" +
                  "<ChildNode1>" +
                     "ABC" +
                  "</ChildNode1>" +
                "</NodeA>";
            XElement nodeA = XElement.Parse(xml);
            List<string> abc = nodeA.Elements().Where(x => x.Value == "ABC").Select(x => x.Value).ToList();

A: You can use LINQ to XML for this.
So to get the node names with a specific value you can use something like this:
var nodeNames = xdoc.Root.Elements()
    .Where(n => n.Value == "ABC")
    .Select(n => n.Name.ToString())
    .ToList();

nodeNames.ForEach(n => Console.WriteLine(n));

This would print "ChildNode1"
In the XML you posted there are some line breaks and spaces so if that's your actual XML you're working with you may need to check without the spaces like this:
var nodeNames = xdoc.Root.Elements()
    .Where(n => n.Value.Replace("\n", "").Replace("\r", "").Replace(" ", "") == "ABC")
    .Select(n => n.Name.ToString())
    .ToList();


text:
Q: Code igniter file upload and file write I try to write code on page using with file uploader. The page generated must have the css code with the path name of image uploaded by user as background. I' using codeigniter file_write. I have inputs to get bg color and title too. I have a layout.php page on view (with 777 permission)
But, my code not work, after click on upload button, appers the error: "The upload path does not appear to be valid"
 class Upload extends CI_Controller {

    public function __construct()
        {
            parent::__construct();
            $this->load->helper(array('form', 'url', 'file', 'directory'));
        }

    public function index()
        {
            $this->load->view('upload_form', array('error' => ''));
        }

    public function do_upload()
        {

            $path = $this->input->post('new-folder');
            $title = $this->input->post("title");
            $bgcolor = $this->input->post("bgcolor");

            $upload_path_url = site_url().'uploads/'.$path.'/';

            $config['upload_path'] = './uploads/'.$path.'/';
            $config['allowed_types'] = 'gif|jpg|jpeg|png';
            $config['max_size'] = '2000';
            $config['max_width']  = '1920';

            $this->load->library('upload', $config);

            if ( ! $this->upload->do_upload()) {
                $error = array('error' => $this->upload->display_errors('
','
'));
                $this->load->view('upload_form', $error);

            } else {
                $data = $this->upload->data();

                //set the data for the json array
                $info->name = $data['file_name'];
                $info->size = $data['file_size'];
                $info->type = $data['file_type'];
                $info->url = $upload_path_url .$data['file_name'];

                $info->thumbnail_url = $upload_path_url .$data['file_name'];
                $info->delete_url = base_url().'upload/deleteImage/'.$data['file_name'];
                $info->delete_type = 'DELETE';

                //this is why we put this in the constants to pass only json data
                if (IS_AJAX) {
                    echo json_encode(array($info));

                // so that this will still work if javascript is not enabled
                } else {
                     echo $upload_path_url;

                    if(!is_dir($path))
                    {
                        mkdir($upload_path_url,0777,TRUE);

                    }

                    $page_layout = $this->load->view('layout');
                    $write_data = '

' ;

                    if ( ! write_file( $page_layout . $write_data, 'a+') )
                    {
                        $msg_file = 'Unable to generate the page';
                    }
                    else
                    {
                        $msg_file = 'Layout Page was generated!';
                    }

                    $file_data['msg_file'] = $msg_file;
                    $file_data['title'] = $title;
                    $file_data['bgcolor'] = $bgcolor;
                    $file_data['upload_data'] = $this->upload->data();
                    $this->load->view('upload_success', $file_data);
                }
            }
        }
}

Part of form_upload.php:

Title:
<input type="text" size="40" name="title" />

Background color:
<input type='text' value='#fff' name='bgcolor' id='bg' size="10" />

Part of upload-success.php:
    if ( isset($msg_file) ) { echo $msg_file; }
    echo '

';
    echo 'Site title: '. $title.'';
    echo '
';
    //echo $write_data;
    echo '
';
    echo 'background-color: '. $bgcolor.'';
    echo '
';

A: Message "The upload path does not appear to be valid" references to your $config['upload_path'] = './uploads/'.$path.'/' line.
It means the directory doesn't exsist and/or has bad permissions. Looking at your code, $path comes via POST data from the form, and you're not creating that folder anywhere BEFORE you do upload. I don't think CI's Upload class creates an upload folder if the one doesn't exist. I've not tested that, but try someting like following:
$config['upload_path'] = './uploads/'.$path.'/';
[...]

$this->load->library('upload', $config);

if (!empty($path) && !file_exists($config['upload_path'])) {
   if (!mkdir($config['upload_path'], 0777, true)) {
    die('Failed to create folders...');
   }
}

if ( ! $this->upload->do_upload()) {
[...]

I'm not talking about POST data check as this is another matter.


text:
Q: Serialize abstract class with Gson returns null I have a problem with goggles Gson library. Look at following code:
public abstract class Main {
    public String foo = "foo";
    public List<String> bar = Arrays.asList( "foo", "bar" );

    @Override
    public String toString( ) {
        Gson gson = new Gson( );
        return gson.toJson( this );
    }

    public static void main( String[] args ) {
        Main main = new Main( ) {
        };
        System.out.println(main.toString( ));
    }
}

It prints null. But I would like it to print {"foo":"foo","bar":["foo","bar"]} which it does, when I remove the abstract identifier and the curly brackets after the creation of Main( ).
So how do I get the right output for an abstract class?

A: In case of abstract classes, you will need write your own adapter. See this article on the subject.

A: Looking at the code, I can see that Gson excludes anonymous inner classes.  The best explanation I have is because Gson's philosophy is to support symmetric serialization and deserialization, as explained in this bug:

Don't use double brace initialization. It prevents [de]serialization and Gson is designed for symmetric serialization and [de]serialization.

It is impossible to deserialize an inner class without customization.  From the users guide:

Gson can also deserialize static nested classes. However, Gson can not automatically deserialize the pure inner classes since their no-args constructor also need a reference to the containing Object which is not available at the time of deserialization.

Thus Gson prevents the serialization.  You could make the anonymous inner class a static nested class instead, and it would work.

A: Sorry a bit late into this but for those who don't want to create nested class you can use this:
AbstractPayload payload = new AbstractPayload("field") {};
String result = gson.toJson(payload, AbstractPayload.class)

This worked for my case


text:
Q: How to check the status of a checkbox (switch) after the submit in a form i put in a checkbox (switch), how do i post after submitting to checking the status of the switch for MySQL update? thank you
Consequently the MySQL table does not change.
From checkbox and submit
<form method="POST" action="process.php">

<input type="checkbox" id="switch-1" class="mdl-switch__input" checked>
Autenticazione a due fattori

....
<input onclick="conferma();" class="mdl-button mdl-js-button
mdl-button--raised mdl-js-ripple-effect mdl-button--accent" type="submit"
value="Salva" name="submitBtn">
</form>

Switch control and MySQL update (process.php)
<?php
session_start();
mysql_connect(localhost) or die(mysql_error());
mysql_select_db("*******") or die(mysql_error());
$user = $_SESSION['users'];
if(isset($_POST['submitBtn'])) { //form submission occured
    if(!isset($_POST['switch-1'])){
        $sql = "UPDATE `*******`.`login_users` SET `auth` = \'checked\' WHERE username = '$user'";
        header("location: https://*******.php");
    } else {
        $sql = "UPDATE `*******`.`login_users` SET `auth` = \'unchecked\' WHERE username = '$user'";
        header("location: https://*******.php");
    }
}

?>

A: 1) Modify your form
<form method="POST" action="process.php">

    <input type="checkbox" name="switch-1" id="switch-1" class="mdl-switch__input" checked>
    Autenticazione a due fattori

    ....
    <input type="submit" value="Salva" name="submitBtn" class="mdl-button mdl-js-button
    mdl-button--raised mdl-js-ripple-effect mdl-button--accent" >

</form>

2) Create a new process.php page in the same working directory and add these.
EDIT:
<?php

session_start();
$user = $_SESSION['users'];

$servername = "localhost";
$username = "root";
$password = "";
$dbname = "YourDBName";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

if(isset($_POST['submitBtn'])) { //form submission occured

    if(isset($_POST['switch-1'])){
        $sql = "UPDATE login_users SET auth = 'checked' WHERE username = '$user'";
    } else {
        $sql = "UPDATE login_users SET auth = 'no' WHERE username = '$user'";
    }

    if ($conn->query($sql)) {
        echo "Updated successfully";
    } else {
        echo "Error: " . $sql . "
" . $conn->error;
    }

} else {
    echo "Form Submission Error";
}

$conn->close();
?>

Hope it's helpful.


text:
Q: "ImportError: No module named oldnumeric" when running PMV from mgltools I installed a tool called mgltools using following command
conda install mgltools

When I tried to test the installation using command pmv I got following error
setting PYTHONHOME environment
Run PMV from  /home/satyajeet/miniconda2/MGLToolsPckgs/Pmv
Traceback (most recent call last):
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/Pmv/__init__.py", line 369, in runPmv
    from mglutil.splashregister.splashscreen import SplashScreen
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/mglutil/splashregister/splashscreen.py", line 7, in <module>
    from mglutil.util.misc import ensureFontCase
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/mglutil/util/misc.py", line 19, in <module>
    import numpy.oldnumeric as Numeric
ImportError: No module named oldnumeric
hit enter to continue

From online forums, I found that the problem is numpy version. The oldnumeric support was withdrawn after numpy 1.9 and I was running numpy 1.15. So I downgraded numpy to numpy 1.8.1 using following command
python -m pip install numpy==1.8.1

But now I get a new error
setting PYTHONHOME environment
Run PMV from  /home/satyajeet/miniconda2/MGLToolsPckgs/Pmv
Traceback (most recent call last):
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/Pmv/__init__.py", line 378, in runPmv
    from Pmv.moleculeViewer import MoleculeViewer
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/Pmv/moleculeViewer.py", line 21, in <module>
    from DejaVu.Geom import Geom
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/__init__.py", line 200, in <module>
    from Viewer import Viewer
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/Viewer.py", line 53, in <module>
    from DejaVu.Camera import Camera
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/Camera.py", line 41, in <module>
    import Image
ImportError: No module named Image
hit enter to continue

I can import Image using
>>> from PIL import Image

Any suggestions please?
Output of pip freeze
absl-py==0.5.0
alabaster==0.7.11
asn1crypto==0.24.0
Babel==2.6.0
backports-abc==0.5
backports.functools-lru-cache==1.5
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
conda==4.5.11
cryptography==2.3.1
cycler==0.10.0
Cython==0.28.5
decorator==4.3.0
deepTools==3.1.2
dill==0.2.8.2
Django==1.11.15
dm-sonnet==1.23
docutils==0.14
enum34==1.1.6
functools32==3.2.3.post2
futures==3.2.0
idna==2.7
image==1.5.25
imagesize==1.1.0
ipaddress==1.0.22
ipython-genutils==0.2.0
Jinja2==2.10
jsonschema==2.6.0
jupyter-core==4.4.0
kiwisolver==1.0.1
MACS==1.4.2
MarkupSafe==1.0
matplotlib==2.2.3
mkl-fft==1.0.6
mkl-random==1.0.1
nbformat==4.4.0
numpy==1.8.1
numpydoc==0.8.0
oldnumeric==1.0.4
packaging==17.1
pandas==0.23.4
Pillow==5.2.0
plotly==3.2.1
Pmw==2.0.1
py2bit==0.3.0
pyBigWig==0.3.12
pycosat==0.6.3
pycparser==2.18
Pygments==2.2.0
pyOpenSSL==18.0.0
pyparsing==2.2.1
pysam==0.15.0
PySocks==1.6.8
python-dateutil==2.7.3
pytz==2018.5
requests==2.19.1
retrying==1.3.3
ruamel-yaml==0.15.46
scipy==1.1.0
singledispatch==3.4.0.3
six==1.11.0
snowballstemmer==1.2.1
Sphinx==1.8.1
sphinxcontrib-websupport==1.1.0
subprocess32==3.5.2
tornado==5.1.1
traitlets==4.3.2
typing==3.6.6
urllib3==1.23

Update 1:

Following this suggestion, I setup a PIL module.
I got
fatal error: X11/Xlib.h: No such file or directory

It was solved as described here. But now the new error if I try to execute pmv is..
ValueError: Attempted relative import in non-package

A: MGLtools looks abandoned, and its conda package is unusable. The latest release was in 2012, the download page of the official site was last updated in 2015, and so on.
As you could see, the conda package is incompatible with recent versions of other packages, and, judging by the contents of the files for download, it is built for Python 2.5(!).

*

*so even if you get the necessary Python modules (whatever they are), you'll still have to recompile it against the available Python for extension modules to be usable.

You were only able to install the package with conda because its metadata (info/index.json in a .tar.gz) doesn't specify its dependencies (at all).
So, if you still wish to try it out, your best bet is to try to make a standalone installation from an official download package from
Downloads — MGLTools. Those packages include the necessary version of Python and other dependencies.


text:
Q: How to write a script to analyse C# code using FxCop? I am trying to write a script to analyse C# code (batch script) using FxCop and integrate scripts into Hudson to automate the task. Can anyone can help? Even help to get me halfway is appreciated.
Thanks in advance.

A: Here are a few hints to get you started:

*

*Write a batch script that executes FxCopCmd, the command-line tool for FxCop.

*Use the Violations plugin to display the analysis results in Hudson.

I also suggest that you use Jenkins instead of Hudson, but this is not necessary.


text:
Q: What is exponentially fitted osculating straight line? While reading an article about iterative methods for solving nonlinear equations I can't understand what is exponentially fitted osculating straight line. Could someone please briefly explain this term to me?

A: it's jargon for a function of the form
$$y(x)=e^{a(x-x_0)}[b(x-x_0)+c]$$
where the constants $a,b,c$ are determined such that $y(x)$ osculates the function $f(x)$ you are fitting to at $x=x_0$:
$$y(x_0)=f(x_0),\;\;y'(x_0)=f'(x_0),\;\;y''(x_0)=f''(x_0).$$
This gives
$$c=f(x_0),\;\;b+ac=f'(x_0),\;\;2ab+a^2 c=f''(x_0)$$
for example, see this paper


text:
Q: Derivation and character space Suppose $A$ is a Banach algebra and $D:A\to {A^*}$ a bounded derivation. Is it possible to define some characters on $A$ by using $D$.

A: Certainly not. Take your favourite Banach algebra without characters (such as bounded operators on $\ell_p$) and consider inner derivations into the dual.


text:
Q: How to deploy Django + React project to hosting platform? I used Django as backend and React as frontend.
I want to know how to deploy this project to hosting platform such as heroku, netlify, etc.
Can I deploy this project to one domain?
Or should I have to use two doamins - one for Django and one for React?

A: Were you able to find the answer to this?
You will need to deploy two separate apps. I presume, you have been making axios/fetch calls between the frontend and backend on localhost? It will work just like that, except instead of localhost, the calls go to where ever the backend is deployed.
Now deploying is a beast of its own. Good luck!


text:
Q: Visual Studio 2013 C++ - guidelines Few years back I've used Dev C++, just recently while working on some projects I remembered one its feature I miss a lot.
My English is not so great, so probably the word I've used isn't exactly right, but here is the picture.

See that lines by if/for/while/..., that identify exactly where it begins and where it ends.
Is it possible to add something like this is Visual Studio 2013?

A: Yes, via extensions. There's several: Indent Guides and Productivity Power Tools for example. The latter provides a lot of [useful?] modifications.

A: Visual Studio allows you to

*

*automatically format the code with indentation adjustment (Edit > Avanced > Format Selection)

*collapse/expand blocks (Edit > Outlining > ...)


text:
Q: Creating a new file based on three .tsv files in unix I have three very large files and I just want to grab the matching ID2s that come up for the first 20 ID2s for file 1 (in the example, I listed only 5). I want it to search file 2 and file 3 in its entirety and pull out the lines that match to the 20 ID2s from file1. I also want the ID1- even if it's blank (as well as other columns that are on the same matching ID2 line).
I know how to do this in python, but since the files are so large, my computer can't handle it. I have been trying to do it in the terminal (unix) with no luck.
I tried the following command but 1)it doesn't deal with three files and 2) it is also throwing me an error (maybe I'm grabbing the wrong columns)?
awk 'NR==FNR{a[$1][$0];next} $0 in a {for (i in a[$0]) print i}' file1.tsv file2.tsv

Error:
zsh: parse error near `}'

Another question:
How do I skip the first five rows in unix when doing the command (because these files have some notes in the beginning that are read in as rows)?

file1
     id 1             id2          name
    A00000004   B00000004          emily
                B00000005          joe
    A00000006   B00000006          jack
                B00000007          john
    A00000008   B00000008          sally

file2
    id1             id2     source    source_code
    A00000001   B00000001   source1    321
    A00000003   B00000003   source2    165
    A00000004   B00000004   source3    481
    A00000005   B00000005   source2    891

file 3
      id2         code
    B00000006    yes
    B00000007    no
    B00000005    yes
    B00000004    yes
    B00000012    yes

Desired:
    id1             id2     name      source    source_code    code
    A00000004   B00000004    emily     source3    481          yes
    A00000005   B00000005    joe       source2    891          yes

A: First, to start on the Nth line of a file:
tail -n +N infile
To match the id2 columns in the different files, I'd recommend the join command. However, there are drawbacks, including the requirement to know which columns contain id2 and the need to sort on those columns. This method also won't recognize more than one identical column (e.g. the id1 column will be repeated for each file in which it appears). It's also unclear to me from the question if there are headers you want to keep. This method will lose the headers.
# Sort files on the id2 column
# First, drop the header line.
# Then sort on the common column (in this case the 2nd field).
# "-t $'\t'" means to use tabs as the field separator.
tail -n +2 file1 | sort -t $'\t' -k2,2 > file1.sort
tail -n +2 file2 | sort -t $'\t' -k2,2 > file2.sort
tail -n +2 file3 | sort -t $'\t' -k1,1 > file3.sort

First join file1.sort to file2.sort:
# The "-j 2" flag means that both files use the second column as the common field.
# One could also use "-1 2 -2 2" to specify the field for the first and second files.
join -t $'\t' -j 2 file1.sort file2.sort > file1-2

Then join that file to file3.sort. Note that the output of join places the joined column first, by default.
join -t $'\t' -j 1 file1-2 file3.sort > files1-3

You can save a step, and an intermediary file, by combining the last two commands:
join -t $'\t' -j 2 file1.sort file2.sort | join -t $'\t' -j 1 - file3.sort > files1-3

>cat files1-3
B00000004   A00000004   emily   A00000004   source3 481 yes
B00000005       joe A00000005   source2 891 yes

If you know that the columns are arranged the way they are in the example, you can also use join's output formatting to clean things up a bit:
join -t $'\t' -j 2 file1.sort file2.sort | join -t $'\t' -j 1 -o 1.4,1.1,1.3,1.5,1.6,2.2 - file3.sort > files1-3_format

>cat files1-3_format
A00000004   B00000004   emily   source3 481 yes
A00000005   B00000005   joe source2 891 yes


text:
Q: Custom endpoint create in Marketing Cloud I was wondering if it was possible to create a custom endpoint in Marketing Cloud?  I am in a position where an API call is being sent to MC but unfortunately MC only accepts email and we are sending a UUID as input.
Is it possible to use ampscript in the initial API request to replace the UUID with the respective email address from SF?  Thanks!

A: I have built a number of custom endpoints using JSON code resources within Cloud Pages. You can send e.g. POST request to the URL of this code resource, and read all the data sent to it, using RequestParameter function.
From here, you can use regular Ampscript and/or SSJS to manipulate data in your data extensions, or basically perform any other function supported by the platform.
You can print the result as JSON, allowing the source system sending the request to identify whether the request was processed successfully or not.
It is important to state, this is NOT a real API with authentication, and whatever else is in place when looking at the native endpoints provided by SFMC. Hence appropriate measures should be taken when developing the code, as well as when distributing the endpoint URL.
If you need to send a triggered email, you can use this SSJS to send it:
function sendTSD(variableX,variableY,emailAddress,subKey) {
  var proxy = new Script.Util.WSProxy();
  var customerKey = "yourTriggeredEmail"; //key of your triggered send definition
  var name = "yourTriggeredEmail";

  var ts= {
         TriggeredSendDefinition: {CustomerKey: customerKey, Name: name}
         ,Subscribers: [ {
                EmailAddress: emailAddress
              , SubscriberKey: subKey
              , Attributes: [
                  {
                   Name: 'foo',
                    Value: variableX
                 },
                 {
                  Name: 'bar',
                  Value: variableY
                 }
              ]
          }]

      };

  var res = proxy.createItem("TriggeredSend", ts);

  return res;
}

To fetch the subscriber key prior to firing the code above, use LookupRows to look it up in a data extension.
To pass variables from ampscript to SSJS, you will need to use the SSJS functions GetValue and SetValue.


text:
Q: jQuery DataTables altEditor issue I've been trying to get this free alternative editor I found here to work but it keeps on blowing up on me because I am terrible at javaScript. Been debugging, reading documentations like mad all day but my scrub mind is out of ideas but I'm still trying anyway.
I deleted some of the stuff it had in there like ajax to server,the ID row, because I don't need those, I just want to be able to insert, edit, and delete rows in the table while keeping the <option> dropdown and pattern validation.
I prepared a jsfiddle with my exact setup here. Any hints/help will be greatly appreciated.

A: Managed to figure it out myself.
This jsfiddle is an updated version that works.
This diff shows the modifications I made compared to the original.
What is the point you ask?
The point is to be able to validate stuff before adding/editing them, to have a neat dropdown select, and to be able to send the data from the table itself as a JSON string in a "Column Name" : "Cell Data" format so that I can json_decode($_POST['table'] and use a nice associative array to add the data to my database.
Why?
Beats me, do what you want with it. I plan to use it to send a list of addresses one way only to the server.
Why not use the official editor?
Because I can't justify the price for my meaningless project and I hardly need 10% of what it offers.
Big thanks to Kingcode.com where I found the free datatables editor alternative and KasperOlesen for making it more awesome.


text:
Q: Horizontal scrolling control like the App store has I need a horizontal scrolling control like the App Store:

Should I use UIScrollView combined with UIPageControl?

A: Did you consider UICollectionView?


text:
Q: How to find google play developer registration id? I'm trying to move an app to a new developer account with these instructions:
https://support.google.com/googleplay/android-developer/answer/6230247?hl=en
The step 3 is confusing. I can't seem to find the registration id anywhere.
Can someone help me find the registration id?

A: As explained in the link you provided, check the email which you registered your account with and in the registration email should be the transaction ID. If you can't find it there you need to enter payments.google.com with that account and in each transaction you'll find the transaction ID.

A: go to here
select activity
in the transaction id copy  at the start of "Registration" to latest part

A: If you wanna know what is your Google Paid Id use this link:
https://pay.google.com/payments/home?bcn
in the menu button you can see the details about the paid id of each account that you have.