text:
Q: Concatinating result with inner join I wrote this piece of SQL to get movies with persones (role_id = 1 - is director). While movie has single director - all good, but extra rows with the same movie's name appear, when there is more than one directors.
SELECT
    m.name,
    ps.name as director
FROM
    movies m
INNER JOIN participants p ON
    m.movie_id = p.movie_id
INNER JOIN persones ps ON
    ps.person_id = p.person_id AND
    p.role_id = 1
ORDER BY m.updated_at DESC
LIMIT 10\G

For example
*************************** 1. row ***************************
    name: Film1
director: director1
*************************** 2. row ***************************
    name: Film1
director: director2
*************************** 3. row ***************************
    name: Film1
director: director3
*************************** 4. row ***************************
    name: Film2
director: director4
*************************** 5. row ***************************
    name: Film2
director: director5
*************************** 6. row ***************************
    name: Film2
director: director6

OK, i found group_concat for concatenate directors in single row
SELECT
    m.name,
    GROUP_CONCAT(ps.name SEPARATOR ", ") as director
FROM
    movies m
INNER JOIN participants p ON
    m.movie_id = p.movie_id
INNER JOIN persones ps ON
    ps.person_id = p.person_id AND
    p.role_id = 1
ORDER BY m.updated_at DESC
LIMIT 10\G

but i have unexpected result!
*************************** 1. row ***************************
    name: Film123
director: director1, someperson1, someperson3, ......, someperson18

Just one row with persons from another category (artists or smth). Even row with movie has name not the same as ORDER BY m.updated_at DESC must return

A: You are missing with a GROUP BY you are using a group function but without grouping them
SELECT
    m.name,
    GROUP_CONCAT(ps.name SEPARATOR ", ") as director
FROM
    movies m
INNER JOIN participants p ON
    m.movie_id = p.movie_id
INNER JOIN persones ps ON
    ps.person_id = p.person_id AND
    p.role_id = 1
GROUP BY m.name /* or you can use the movie id column here*/
ORDER BY m.updated_at DESC
LIMIT 10

GROUP_CONCAT(expr)
GROUP BY (Aggregate) Functions
EDIT Also make sure you do have movie_id column in your movies table
SELECT
    m.movie_id ,
    m.international_name AS o_name,
    m.description AS description,
    m.name AS name,
    m.covers AS covers,
    m.YEAR AS YEAR,
    m.updated_at AS added,
    GROUP_CONCAT(ps.name SEPARATOR ', ') AS director
FROM
    movies AS m
INNER JOIN  movies_genres AS mgen ON
    (m.movie_id = mgen.movie_id)
INNER JOIN participants p ON
    m.movie_id = p.movie_id
INNER JOIN persones ps ON
    ps.person_id = p.person_id AND
    p.role_id = 1 /* Directors */
WHERE
    m.hidden=0 AND
    mgen.genre_id = 6 AND

GROUP BY m.name
ORDER BY m.updated_at DESC

A: If you're using GROUP_CONCAT you have to use GROUP BY to create the groups.
SELECT
m.name,
GROUP_CONCAT(ps.name SEPARATOR ", ") as director
FROM
    movies m
INNER JOIN participants p ON
    m.movie_id = p.movie_id
INNER JOIN persones ps ON
    ps.person_id = p.person_id AND
    p.role_id = 1
GROUP BY m.movie_id,m.name
ORDER BY m.updated_at DESC
LIMIT 10


text:
Q: PHP jQuery json_encode PHP
$results[] = array(
    'response' => $response
);
echo json_encode($results);

Using the above returns to my jQuery the following data
Part of .ajax()
success:function(data){
    console.log(data);
}

Outputs
 [{"response":0}]

How could I change console.log(data) to pick the value of response?

A: If you set datatype: "json" in the .ajax() call, the data object you get, contains the already parsed JSON. So you can access it like any other JavaScript object.
console.log( data[0].response );

Otherwise you might have to parse it first. ( This can happen, when the returned MIME type is wrong.)
data = JSON.parse( data );
console.log( data[0].response );

Citing the respective part of the jQuery documentation:

dataType
If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).

A: 1)
console.log(data[0].response)

2)
for(var i in data){
  console.log(data[i].response);
}

A: success:function(data){
    data = $.parseJSON(data);
    console.log(data[0].response);
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: ORA-00904: invalid identifier error when trying to execute PL/SQL stored procedure using nested tables I'm trying to execute a stored procedure which uses a nested table, however I get the following error. I've checked the values that are being passed into the collection and it's passing in the right amount of values. I did an insert query and it worked fine so I'm unsure why the procedure isn't executing.
LINE/COL ERROR
-------- -----------------------------------------------------------------
28/5     PL/SQL: SQL Statement ignored
30/5     PL/SQL: ORA-00904: "ORDER_ITEMS": invalid identifier
SQL>

CREATE OR REPLACE TYPE order_item AS object(
    order_item_id INT,
    order_id INT,
    product_id INT,
    seller_id INT,
    sub_order_number CHAR(10),
    quantity INT,
    condition CHAR(100),
    unit_price NUMBER,
    cost_charge NUMBER
);
/

CREATE OR REPLACE TYPE order_items AS Table of order_item;
/

CREATE TABLE Orders (
 order_id INT CONSTRAINT PKEY_order PRIMARY KEY,
 order_number CHAR(10),
 billing_name CHAR(100),
 billing_email CHAR(100),
 billing_address VARCHAR2(100),
 billing_city VARCHAR2(100),
 billing_province VARCHAR2(100),
 billing_postcode VARCHAR2(100),
 billing_telephone NUMBER(25),
 billing_total NUMBER,
 order_date DATE,
 Items order_items)
 Nested Table Items Store As Orders_Item
/

CREATE OR REPLACE PROCEDURE insert_new_order
(
    p_order_id IN INT,
    p_order_num IN CHAR,
    p_name IN CHAR,
    p_email IN CHAR,
    p_address IN VARCHAR2,
    p_city IN VARCHAR2,
    p_province IN VARCHAR2,
    p_postcode IN VARCHAR2,
    p_telephone IN NUMBER,
    p_total IN NUMBER,
    p_order_date IN DATE,
    -- Order items
    p_order_item_id IN INT,
    p_product_id IN INT,
    p_seller_id IN INT,
    p_sub_order_number IN CHAR,
    p_quantity IN INT,
    p_condition IN CHAR,
    p_unit_price IN NUMBER,
    p_cost_charge IN NUMBER
)
AS
BEGIN
    DBMS_OUTPUT.PUT_LINE ('Insert attempted');

    INSERT INTO Orders (order_id, order_number, billing_name, billing_email, billing_address, billing_city, billing_province, billing_postcode, billing_telephone, billing_total, order_date, order_items)
    VALUES (p_order_id, p_order_num, p_name, p_email, p_address, p_city, p_province, p_postcode, p_telephone, p_total, p_order_date, order_items(
        order_item(p_order_item_id, p_order_id, p_product_id, p_seller_id, p_sub_order_number, p_quantity, p_condition, p_unit_price, p_cost_charge)));

    COMMIT;

    DBMS_OUTPUT.PUT_LINE ('Insert succeeded');

    EXCEPTION
     WHEN others THEN
        DBMS_OUTPUT.PUT_LINE ('Insert rejected');
      DBMS_OUTPUT.PUT_LINE ('SQL Error Code:  ' || SQLCODE);
      DBMS_OUTPUT.PUT_LINE ('SQL Error Message:  ' || SQLERRM);
      ROLLBACK;
END;
/

Ideally I want to have the insert query to do this in the stored procedure, which works when I execute this query.
INSERT INTO Orders VALUES (1, 'P396XT47','Test', 'test@test.co.uk',
    'test', 'test', 'test' ,'DL99 9UU', '123456789', '57.78', '19-apr-2021', order_items(
    order_item(1, 1, 1, 1, '3026143053', '1', 'Brand new', '53.49', '0'),
    order_item(2, 1, 2, 2, '3029608429', '1', 'Brand new', '1.99', '2.00')));


text:
Q: Failure delivering result ResultInfo to activity : java.lang.NullPointerException: Activity must not be null Hi I was working on an application that authenticate using google but I got an error after running it in the emulator. I don't know what exactly is going on because I pasted documentation's codes without any changes. Here is the error which I've got:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1302730037, result=-1, data=Intent { (has extras) }} to activity {com.example.platform/com.example.platform.MainActivity}: java.lang.NullPointerException: Activity must not be null
at android.app.ActivityThread.deliverResults(ActivityThread.java:5392)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5431)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2272)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7902)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:933)
Caused by: java.lang.NullPointerException: Activity must not be null
at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement@@18.0.0:2)
at com.google.android.gms.common.api.internal.LifecycleActivity.(com.google.android.gms:play-services-basement@@18.0.0:1)
at com.google.android.gms.common.api.internal.LifecycleCallback.getFragment(com.google.android.gms:play-services-basement@@18.0.0:1)
at com.google.android.gms.tasks.zzv.zza(com.google.android.gms:play-services-tasks@@18.0.1:1)
at com.google.android.gms.tasks.zzw.addOnCompleteListener(com.google.android.gms:play-services-tasks@@18.0.1:3)
at com.example.platform.LoginFragment.firebaseAuthWithGoogle(LoginFragment.kt:92)
at com.example.platform.LoginFragment.onActivityResult(LoginFragment.kt:69)
at androidx.fragment.app.FragmentManager$7.onActivityResult(FragmentManager.java:2617)
at androidx.fragment.app.FragmentManager$7.onActivityResult(FragmentManager.java:2597)
at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:392)
at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:351)
at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.java:647)
at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:140)
at android.app.Activity.dispatchActivityResult(Activity.java:8243)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5385)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5431)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2272)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7902)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:933)
and here is my code:
LoginFragment.kt:
package com.example.platform

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.example.platform.databinding.FragmentLoginBinding
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInClient
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.firebase.ui.auth.IdpResponse
import com.google.android.gms.common.api.ApiException
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.GoogleAuthProvider

class LoginFragment : Fragment() {

    companion object {
        const val TAG = "LoginFragment"
        const val RC_SIGN_IN = 1001
    }

    private lateinit var binding: FragmentLoginBinding
    private lateinit var mAuth: FirebaseAuth
    private lateinit var googleSignInClient: GoogleSignInClient

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = FragmentLoginBinding.inflate(inflater, container, false)
        return binding.root

    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .build()
        googleSignInClient = GoogleSignIn.getClient(requireContext(), gso)
        mAuth = FirebaseAuth.getInstance()
        binding.google.setOnClickListener {
            signIn()
        }
    }
    private fun signIn() {
        val signInIntent = googleSignInClient.signInIntent
        startActivityForResult(signInIntent, RC_SIGN_IN)
    }
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (requestCode == RC_SIGN_IN) {
            val response = IdpResponse.fromResultIntent(data)
            if (resultCode == Activity.RESULT_OK) {
                // Successfully signed in user.
                try {
                    // Google Sign In was successful, authenticate with Firebase
                    val task = GoogleSignIn.getSignedInAccountFromIntent(data)
                    val account = task.getResult(ApiException::class.java)!!
                    Log.d(TAG, "firebaseAuthWithGoogle:" + account.id)
                    firebaseAuthWithGoogle(account.idToken!!)
                    Log.i(
                        TAG,
                        "Successfully signed in user " +
                                "${FirebaseAuth.getInstance().currentUser?.displayName}!"
                    )
                } catch (e: ApiException) {
                    // Google Sign In failed, update UI appropriately
                    Log.w(TAG, "Google sign in failed", e)
                }
            }
            else {
                // Sign in failed. If response is null the user canceled the sign-in flow using
                // the back button. Otherwise check response.getError().getErrorCode() and handle
                // the error.
                Log.i(TAG, "Sign in unsuccessful ${response?.error?.errorCode}")
            }
        }
    }
    private fun firebaseAuthWithGoogle(idToken: String) {
        val credential = GoogleAuthProvider.getCredential(idToken, null)
        activity?.finish()
        mAuth.signInWithCredential(credential)
            .addOnCompleteListener(requireActivity().parent) { task ->
                if (task.isSuccessful) {
                    Log.d("signIn", "signInWithCredential:success")
                    findNavController().navigate(R.id.action_loginFragment_to_mainFragment)
                } else {
                    Log.d("signIn", task.exception.toString())
                }
            }
    }
}


text:
Q: Activity is not being launched after click in a Notification a have tried 8 versions of the following code, but the Home activity is not being launched when I click the notification.
Here is the code (it's inside of a Service)
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());
builder.setSmallIcon(R.mipmap.alert);
builder.setContentTitle("");
builder.setContentText("Running in Background");
builder.setOngoing(true);

IntenIntenticationIntent = new Intent(getApplicationContext(), Home.class);

PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,notificationIntent, 0);
notificationManager = (NotificationManager) getApplicationContext().getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());

A: Could you please the code below?
Intent notificationIntent = new Intent(this, Home.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.mipmap.alert);
builder.setContentTitle("");
builder.setContentText("Running in Background");
builder.setOngoing(true);
builder.setContentIntent(contentIntent);

notificationManager = (NotificationManager) this.getSystemService(Service.NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());


text:
Q: VS Code debugging prompting for arguments and also setting the working directory I know how to pass fixed arguments in the launch.json, e.g. In Visual Studio Code, how to pass arguments in launch.json . What I really need is a prompt where I can give a value for an argument that changes.
In addition, my argument is a (data) directory for which there is a very ugly long absolute path. I'd really like to be able to set the working directory to a path which contains each of my individual data directories so I only need to provide a relative directory path, i.e. just the directory name.
I'm working with Python, on Windows (not my choice) using VS Code 1.55.2 (not my choice, either).

A: You can use input variables
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File with arguments",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "args": [
        "--dir",
        "/some/fixed/dir/${input:enterDir}"
      ]
    }
  ],
  "inputs": [
    {
      "id": "enterDir",
      "type": "promptString",
      "description": "Subdirectory to process",
      "default": "data-0034"
    }
  ]
}

You can place the ${input:enterDir} in any string in the task "configurations" like the "cwd" property.
If you like to pick a directory from a list because it is dynamic you can use the extension Command Variable that has the command pickFile
Command Variable v1.36.0 supports the fixed folder specification.
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File with arguments",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "args": [
        "--dir",
        "${input:pickDir}"
      ]
    }
  ],
  "inputs": [
    {
      "id": "pickDir",
      "type": "command",
      "command": "extension.commandvariable.file.pickFile",
      "args": {
        "include": "**/*",
        "display": "fileName",
        "description": "Subdirectory to process",
        "showDirs": true,
        "fromFolder": { "fixed": "/some/fixed/dir" }
      }
    }
  ]
}

On Unix like systems you can include the folder in the include glob pattern. On Windows you have to use the fromFolder to convert the directory path to a usable glob pattern. If you have multiple folders you can use the predefined property.


text:
Q: NullPointerException - fragment I received the below message from logcat when attempting to run my application. Essentially I am trying to retrieve a list of information from parse using query. The code seems fine, so I am not too sure how to resolve this issue.
Logcat Message
08-24 19:23:35.387: E/AndroidRuntime(3996): FATAL EXCEPTION: main
    08-24 19:23:35.387: E/AndroidRuntime(3996): Process: com.dooba.beta, PID: 3996
    08-24 19:23:35.387: E/AndroidRuntime(3996): java.lang.NullPointerException
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.dooba.beta.Fragment1$2.done(Fragment1.java:154)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.parse.FindCallback.internalDone(FindCallback.java:45)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.parse.FindCallback.internalDone(FindCallback.java:1)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.parse.Parse$6$1.run(Parse.java:888)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at android.os.Handler.handleCallback(Handler.java:733)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at android.os.Handler.dispatchMessage(Handler.java:95)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at android.os.Looper.loop(Looper.java:136)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at android.app.ActivityThread.main(ActivityThread.java:5017)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at java.lang.reflect.Method.invokeNative(Native Method)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at java.lang.reflect.Method.invoke(Method.java:515)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    08-24 19:23:35.387: E/AndroidRuntime(3996):     at dalvik.system.NativeStart.main(Native Method)

Code
public class Fragment1 extends Fragment {

    public interface Constants {
        String LOG = "com.dooba.beta";
    }

    private String currentUserId;
    private String currentUser;

    protected TextView mUserRetrieved;
    protected TextView mUserActivityNameRetrieved;
    protected TextView mUserNameRetrieved;

    private ArrayAdapter<String> namesArrayAdapter;
    private ArrayList<String> names;
    private ArrayList<String> age;
    private ArrayList<String> headline;
    private ArrayList<String> activityname;

    private ArrayList<Images> alProfilePicture;
    private ListView usersListName;
    private ListView usersListHeadline;
    private ListView usersListActivityname;

    private Button logoutButton;
    String userGender = ParseUser.getCurrentUser().getString("Gender");

    String activityName = ParseUser.getCurrentUser().getString("ActivityName");
    Number maxDistance = ParseUser.getCurrentUser().getNumber(
            "Maximum_Distance");
    String userLookingGender = ParseUser.getCurrentUser().getString(
            "Looking_Gender");
    Number minimumAge = ParseUser.getCurrentUser().getNumber("Minimum_Age");
    Number maximumAge = ParseUser.getCurrentUser().getNumber("Maximum_Age");
    Number userage = ParseUser.getCurrentUser().getNumber("Age");

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        setConversationsList();

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment1_layout, container,
                false);

        mUserRetrieved = (TextView) getActivity().findViewById(R.id.userlistname);

        Button newPage = (Button)view.findViewById(R.id.btnMatchConfirm);
        newPage.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                ParseUser currentUser = ParseUser.getCurrentUser();

                currentUser.put("UserMatchName", mUserRetrieved);
                Intent intent = new Intent(getActivity(), matchOptionActivity.class);
                startActivity(intent);
            }
        });

        return view;
    }

    private void setConversationsList() {
        currentUserId = ParseUser.getCurrentUser().getObjectId();
        names = new ArrayList<String>();
        age = new ArrayList<String>();
        headline = new ArrayList<String>();
        activityname = new ArrayList<String>();

        alProfilePicture = new ArrayList<Images>();

        ParseQuery<ParseUser> query = ParseUser.getQuery();
        ParseQuery<ParseUser> query2 = ParseUser.getQuery();
        ParseQuery<ParseUser> query3 = ParseUser.getQuery();
        ParseQuery<ParseUser> query4 = ParseUser.getQuery();
        ParseQuery<ParseUser> query5 = ParseUser.getQuery();

        query.findInBackground(new FindCallback<ParseUser>() {

            @Override
            public void done(List<ParseUser> objects,ParseException e) {

                for(int i=0;i<objects.size();i++){
                    // Do whatever you need to extract object from "users"
                    ParseQuery<ParseObject> query = ParseQuery.getQuery("User");
                    query.whereNotEqualTo("objectId", ParseUser.getCurrentUser()
                            .getObjectId());
                    // users with Gender = currentUser.Looking_Gender
                    query.whereEqualTo("Gender", userLookingGender);
                    // users with Looking_Gender = currentUser.Gender
                    query.whereEqualTo("Looking_Gender", userGender);
                    query.setLimit(1);
                    query.whereEqualTo("ActivityName", activityName);
                    // query.whereGreaterThanOrEqualTo("Age", minimumAge);
                    // query.whereLessThanOrEqualTo("Age", maximumAge);

                    mUserActivityNameRetrieved = (TextView) getActivity().findViewById(R.id.userlistactivityname);

                    mUserActivityNameRetrieved.setText(objects.get(i).get("ActivityName").toString());

                }
    }//for loop
            });

        query2.findInBackground(new FindCallback<ParseUser>() {

            @Override
            public void done(List<ParseUser> objects,ParseException e) {

                for(int i=0;i<objects.size();i++){
                    // Do whatever you need to extract object from "users"
                    ParseQuery<ParseObject> query2 = ParseQuery.getQuery("User");
                    query2.whereNotEqualTo("objectId", ParseUser.getCurrentUser()
                            .getObjectId());
                    // users with Gender = currentUser.Looking_Gender
                    query2.whereEqualTo("Gender", userLookingGender);
                    // users with Looking_Gender = currentUser.Gender
                    query2.whereEqualTo("Looking_Gender", userGender);
                    query2.setLimit(1);
                    query2.whereEqualTo("ActivityName", activityName);
                    // query.whereGreaterThanOrEqualTo("Age", minimumAge);
                    // query.whereLessThanOrEqualTo("Age", maximumAge);

                    mUserNameRetrieved = (TextView) getActivity().findViewById(R.id.userlistname);

                    mUserNameRetrieved.setText(objects.get(i).get("Name").toString());

                }
    }//for loop
            });

        query3.findInBackground(new FindCallback<ParseUser>() {

            @Override
            public void done(List<ParseUser> objects,ParseException e) {

                for(int i=0;i<objects.size();i++){
                    // Do whatever you need to extract object from "users"
                    ParseQuery<ParseObject> query3 = ParseQuery.getQuery("User");
                    query3.whereNotEqualTo("objectId", ParseUser.getCurrentUser()
                            .getObjectId());
                    // users with Gender = currentUser.Looking_Gender
                    query3.whereEqualTo("Gender", userLookingGender);
                    // users with Looking_Gender = currentUser.Gender
                    query3.whereEqualTo("Looking_Gender", userGender);
                    query3.setLimit(1);
                    query3.whereEqualTo("ActivityName", activityName);
                    // query.whereGreaterThanOrEqualTo("Age", minimumAge);
                    // query.whereLessThanOrEqualTo("Age", maximumAge);

                    mUserNameRetrieved = (TextView) getActivity().findViewById(R.id.userlistage);

                    mUserNameRetrieved.setText(objects.get(i).get("Name").toString());

                }
    }//for loop
            });

        query4.findInBackground(new FindCallback<ParseUser>() {

            @Override
            public void done(List<ParseUser> objects,ParseException e) {

                for(int i=0;i<objects.size();i++){
                    // Do whatever you need to extract object from "users"
                    ParseQuery<ParseObject> query4 = ParseQuery.getQuery("User");
                    query4.whereNotEqualTo("objectId", ParseUser.getCurrentUser()
                            .getObjectId());
                    // users with Gender = currentUser.Looking_Gender
                    query4.whereEqualTo("Gender", userLookingGender);
                    // users with Looking_Gender = currentUser.Gender
                    query4.whereEqualTo("Looking_Gender", userGender);
                    query4.setLimit(1);
                    query4.whereEqualTo("ActivityName", activityName);
                    // query.whereGreaterThanOrEqualTo("Age", minimumAge);
                    // query.whereLessThanOrEqualTo("Age", maximumAge);

                    mUserNameRetrieved = (TextView) getActivity().findViewById(R.id.userlistheadline);

                    mUserNameRetrieved.setText(objects.get(i).get("Headline").toString());

                }
    }//for loop
            });

        query5.findInBackground(new FindCallback<ParseUser>() {

            @Override
            public void done(List<ParseUser> objects,ParseException e) {

                for(int i=0;i<objects.size();i++){
                    // Do whatever you need to extract object from "users"
                    ParseQuery<ParseObject> query5 = ParseQuery.getQuery("User");
                    query5.whereNotEqualTo("objectId", ParseUser.getCurrentUser()
                            .getObjectId());
                    // users with Gender = currentUser.Looking_Gender
                    query5.whereEqualTo("Gender", userLookingGender);
                    // users with Looking_Gender = currentUser.Gender
                    query5.whereEqualTo("Looking_Gender", userGender);
                    query5.setLimit(1);
                    query5.whereEqualTo("ActivityName", activityName);
                    // query.whereGreaterThanOrEqualTo("Age", minimumAge);
                    // query.whereLessThanOrEqualTo("Age", maximumAge);

                    ParseFile image = objects.get(i).getParseFile("ProfilePicture");

                    ParseImageView imageView = (ParseImageView) getView().findViewById(R.id.profilePictureresult);

                     // The placeholder will be used before and during the fetch, to be replaced by the fetched image
                     // data.
                     imageView.setPlaceholder(getResources().getDrawable(R.drawable.profile_pict));
                     imageView.setParseFile(image);
                     imageView.loadInBackground(new GetDataCallback() {
                       @Override
                       public void done(byte[] data, ParseException e) {
                           if (data != null) {
                               Log.i("ParseImageView", "Fetched: " + data.length);
                             } else {
                               Log.e("ParseImageView", "Error fetching: " + e.getMessage());
                             }
                       }

                 });
                }
    }//for loop
            });

    }

    public void openConversation(ArrayList<String> names, int pos) {
        ParseQuery<ParseUser> query = ParseUser.getQuery();
        query.whereEqualTo("Name", names.get(pos));
        query.findInBackground(new FindCallback<ParseUser>() {
            public void done(List<ParseUser> user, ParseException e) {
                if (e == null) {
                    Intent intent = new Intent(getActivity()
                            .getApplicationContext(), MessagingActivity.class);
                    intent.putExtra("RECIPIENT_ID", user.get(0).getObjectId());
                    startActivity(intent);
                } else {
                    Toast.makeText(getActivity().getApplicationContext(),
                            "Error finding that user", Toast.LENGTH_SHORT)
                            .show();
                }
            }
        });
    }

}

XML layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/blue_bac3"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="70dp"
        android:layout_height="50dp"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/profilePictureresult"
        android:layout_marginTop="16dp"
        android:alpha="0.7"
        android:src="@drawable/left_right" />

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="70dp"
        android:layout_height="50dp"
        android:layout_alignParentLeft="true"
        android:layout_alignTop="@+id/imageView2"
        android:alpha="0.7"
        android:src="@drawable/left_arrow2" />

    <TextView
        android:id="@+id/userlistactivityname"
       android:textColor="#ADD8E6"
    android:padding="6dp"
    android:gravity="center"
    android:textStyle="bold"
    android:typeface="serif"
    android:layout_below="@+id/tactivityname"
            android:layout_centerHorizontal="true"

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="18sp" >
    </TextView>

    <TextView
        android:id="@+id/userlistage"
        android:layout_width="80dp"
        android:layout_height="50dp"
        android:layout_below="@+id/profilePictureresult"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="9dp"
        android:divider="@null" >
    </TextView>

    <TextView
        android:id="@+id/tactivityname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/userlistage"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="7dp"
        android:text="Activity Name"
        android:textColor="#d2f2a2"
        android:textSize="23sp"
        android:textStyle="bold" />

    <com.parse.ParseImageView
        android:id="@+id/profilePictureresult"
        android:layout_width="132dp"
        android:layout_height="120dp"
        android:layout_below="@+id/userlistheadline"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="4dp"
        android:alpha="1"
        android:background="@drawable/border_image"
        android:cropToPadding="true"
        android:padding="3dp"
        android:scaleType="centerCrop" />

    <TextView
        android:id="@+id/userlistheadline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
     android:layout_below="@+id/userlistname"
            android:layout_centerHorizontal="true"
        android:gravity="center"
        android:padding="6dp"
        android:textColor="#ffffff"
        android:textSize="18sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/userlistname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/userlistheadline"
        android:layout_alignParentTop="true"
        android:layout_marginTop="25dp"
        android:gravity="center"
        android:padding="6dp"
        android:textColor="#ADD8E6"
        android:textSize="22sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <Button
        android:id="@+id/btnMatchConfirm"
        android:layout_width="100dp"
        android:layout_height="50dp"
        android:layout_below="@+id/userlistactivityname"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="18dp"
        android:alpha="0.7"
        android:background="#ADD8E6"
        android:text="Confirm"
        android:textColor="#000000"
        android:textSize="22sp"
        android:typeface="serif" />

</RelativeLayout>

Thanks in advance

A: In each of your done() callbacks, your are doing:
mUserNameRetrieved = (TextView) getActivity().findViewById(R.id.userlistage);

This is going to search the id userlistage inside your Activity.
But, this id is inside your Fragment, not your Activity.
Do this instead:
mUserNameRetrieved = (TextView) getView().findViewById(R.id.userlistage);

And be careful if your fragment is being destroyed during the task.


text:
Q: java rest webservice, java.lang.NoClassDefFoundError: org/glassfish/jersey/server/spi/Container i am trying to run java rest webservice program. constantly i am getting this error
    Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/hk2/api/ServiceLocatorFactory$CreatePolicy
    at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:141)
    at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:113)
    at org.glassfish.jersey.server.internal.RuntimeDelegateImpl.<init>(RuntimeDelegateImpl.java:63)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:117)
    at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:165)
    at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)
    at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
    at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95)
    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
    at co.test.RestClient.getBaseUri(RestClient.java:31)
    at co.test.RestClient.main(RestClient.java:18)
Caused by: java.lang.ClassNotFoundException: org.glassfish.hk2.api.ServiceLocatorFactory$CreatePolicy
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 16 more

java classes are
Hello.java
package co.test;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/hello")
public class Hello {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sayStringHello(){
        String Str="this is hello plain";
        return Str;
    }
    @GET
    @Produces(MediaType.TEXT_HTML)
    public String sayHTMLHello(){
        String Str="<title>title</title>
hello from html
";
        return Str;
    }
    @GET
    @Produces(MediaType.TEXT_XML)
    public String sayXMLHello(){
        String Str="<?xml version=\"1.0\"><title>title</title>
hello from html
";
        return Str;
    }

}

RestClient.java
package co.test;

import java.net.URI;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;

import org.glassfish.jersey.client.ClientConfig;

public class RestClient {

    public static void main(String[] args) {
        ClientConfig config= new ClientConfig();
        Client client = ClientBuilder.newClient(config);
         WebTarget target= client.target(RestClient.getBaseUri());

         String plain=target.path("rest").path("hello").request().accept(MediaType.TEXT_PLAIN).get(String.class);
         String html=target.path("rest").path("hello").request().accept(MediaType.TEXT_HTML).get(String.class);
         String xml=target.path("rest").path("hello").request().accept(MediaType.TEXT_XML).get(String.class);

         System.out.println(plain);
         System.out.println(html);
         System.out.println(xml);

    }

    private static URI getBaseUri(){
        return UriBuilder.fromUri("http://localhost:8080/RestWSDemo/").build();
    }
}

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>RestWSDemo</display-name>
  <welcome-file-list>
    <welcome-file>Index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

  <servlet>
  <servlet-name>JerseyRestService</servlet-name>
  <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
  <init-param>
  <param-name>jersey.config.server.provider.packages</param-name>
  <param-value>co.test</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>

  </servlet>

  <servlet-mapping>
  <servlet-name>JerseyRestService</servlet-name>
  <url-pattern>/rest/*</url-pattern>

  </servlet-mapping>
</web-app>

Index.html

<!DOCTYPE html>

<meta charset="ISO-8859-1">
<title>Insert title here</title>

Hello

and the jar files i am using are:

can anyone help me with this? thank you


text:
Q: IllegalMonitorStateException при использовании Guava StripedLock Словил вышеуказанное исключение в следующем куске кода при вызове releaseLock() при нагрузочном тестировании:
public void addReference(Path path) {
    acquireLock(path);
    try {
        AtomicInteger counter = references.get(path);
        if (counter == null) {
            counter = new AtomicInteger();
            references.put(path, counter);
        }
        int value = counter.incrementAndGet();
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Currently holding {} references for path {}", value, path);
        }
    } finally {
        releaseLock(path);
    }
}

за acquireLock() и releaseLock() прячутся вызовы к WriteLock, получаемому из StripedLock гугловой Guava.
Как такое может быть? Пока данная проблема проявлялась единожды, но все равно не хотелось бы оставлять ее за бортом.


text:
Q: Prove a matrix inequality involving norms. I have the following problem. If  $$\|Ax\| \geq \theta \|x\|$$ for a square matrix A, $\theta$ a positive real number, $x$ a vector and a natural norm $\| \cdot \|$. Prove that $A$ is invertible and $$\|A^{-1}\| \leq \frac{1}{\theta}$$.
My attempt, let $x=A^{-1}y$ so $$\|y\| \geq \theta \|A^{-1} y \|$$ and $$\|A^{-1} \| = \sup_{\|y\|=1} \| A^{-1} y \|  1/ \theta \leq \sup_{\|y \|=1} 1/ \theta \|y\|=1/ \theta$$. Is this proof OK?  Also I can't seem to figure out how to prove that $A$ is invertible in the first place, how should I approach this?

A: Your result is true if $ A \in M(n\times n) $. This way,
$ |A(x)| \ge  \theta |x| $ implies that $ A $ in injective. By the rank-nullity theorem the dimension of image is $ n $ so the $ A $ is also surjective. Also, $ |A(x)| \ge  \theta |x| $ implies $ \|A\| \ge \theta $. Finally, as $ A\cdot A^- = I $ we have
$$
\|A\|\|A^-\| =1.
$$
Then, $ \|A^{-1}\| \le 1/\theta. $


text:
Q: Sandbox service permissions required to activate a solution on an RBS enabled database We have a Remote Blob Storage (RBS) enabled database. When trying to activate the CRMListComponent sandbox solution, an error occured:

UserCodeExecutionProxy call pipeline failed with execution.
  ServiceUrl: tcp:////SPUCExecutionHost;
  Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException:
  Unable to load assembly group. The user assembly group provider threw
  an exception while trying to provide user assemblies for the specified
  assembly group.

We were able to activate the sandbox solution after granting the "db_rbs_admin" database role to the sandbox service account.
Since this confirms its a permission issue, my question is:
What is the least amount of privilege required for the service account? We don't want to give more permission than necessary.
The only mention I see in SharePoint RBS documentation is that the SharePoint IIS application pool identity that runs the website hosting the content DB needs "db_owner" privileges on the content db, but no mentions of any other service application or service identities.


text:
Q: Oscilloscope Run/Stop output signal
Hi, guys. Does anyone know what causes the multiple waves at a time when you run the oscilloscope? But when you stop (pause) the oscilloscope, you get one wave a time (picture on the answer column).

This is the screenshot of the signal output when I pressed the stop button on the oscilloscope.

A: It is not multiple waves at the same time, but rather multiple waves captured at different times overlapping on the display.
These appear on the screen for two reasons:

*

*First, your waveform has zero crossings at multiple places in its cycle, and your trigger is set near zero, so it can be satisfied at multiple points in time, meaning the re-triggerings won't cause the waveform to approximately align as they would with a better chosen trigger condition (say near an absolute maximum).

*Next, your scope is operating in a fancy persistence mode where it simulates the delay phosphor of an analog CRT by slowly fading old traces, or even holds them permanently in a uniquely digital manner.  As Steve G. points out in a comment, changing this mode may cause the scope to only display a single copy of the waveform at a time.
And of course if you use the scope in some other mode, such as a single shot capture without re-triggering, you would only see one copy of the waveform.

A: As others have said, this is not an error. This is the intended operation of the oscilloscope. It all comes down to a combination of your trigger settings and the oscilloscope's waveform update rate.
First, let's look at your triggering. In this instance, you're using the default trigger settings - rising edge trigger with a 0V threshold level. This means that every time the oscilloscope sees a rising edge moving from below 0V to above 0V, the scope will trigger. It will capture/acquire data, and plot it to the screen. In your signal, this appears to happen quite often.
However, this is happening more frequently than your eyes can handle (and more frequently than the display refreshes. So in Run mode, the scope overlays multiple captures/trigger instances on top of each other. When you hit "stop" or "single" you are telling to scope to drop out of Run mode and only display 1 acquisition/capture.
If you hit "Stop" it will display the most recent capture, and if you hit "Single" it will capture & display the next signal that meets your trigger requirements.
Check out the Keysight Labs YouTube channel, which I help create content for. We have a ton of oscilloscope info on topics like this!

A: When you have noise added to a repetitive waveform the waveform is no longer triggered at the zero crossing of the repetitive wave with a 125uS period.
To capture this you need to remove the lower frequency noise in the signal OR the trigger using an HPF that attenuates the LF noise.  But since this bandwidth of the noise and the signal overlaps the amplitude jitter causes jitter in the trigger of the recurring wave.
The phase jitter is a direct function of the SNR of the signal or the trigger signal's amplitude jitter.


text:
Q: Asp.NET Core adds a Plus into the URL Why does ASP.NET Core add a Plus (+) into the URI, when I try to submit a form using the get method?
For example I have two fields to calculate the BMI: height and weight. After submitting the form, I get the following URL:
http://localhost:59953/?height=170&weight+=65
In the controller, I only get the height parameter because after the weight in the URL, there is a +.
[HttpGet]
public ActionResult Index(int height, int weight)
{
    // The height is 170 but the weight is 0!
    return View();
}

This is the form Razor code:
<form method="get">

        Height in cm
        <input name="height" id="height" class="form-control"/>

        Weight in kg
        <input name="weight "id="weight" class="form-control"/>

    <button class="btn btn-primary" type="submit">Calculate</button>
</form>

A: You have an extra space within the name attribute for your weight property, consider removing it:
<input name="weight" id="weight" class="form-control"/>

By default, spaces are going to be encoded as '+' characters within the URL and since "weight+" isn't the same as "weight", ASP.NET isn't going to be able to properly bind the value.
Additionally, you may want to consider using a POST as opposed to a GET request, since you are actually submitting data to the server as opposed to retrieving it, but your use case may vary.


text:
Q: UntrustedCertificateException: Peer SSL/TLS certificate is not trusted SAML gluu server I am trying to configure my application (SP) to work with remote IDP. The IDP provided me with a certificate to configure with SP. For SAML request.
I get this exception :

org.springframework.security.saml.trust.UntrustedCertificateException: Peer SSL/TLS certificate XXX, issued by XXX is not trusted, add the certificate or it's CA to your trust store and optionally update tlsKey in >extended metadata with the certificate's alias.
Follow certificates (in PEM format) presented by the peer. Content between being/end certificate (including) can be stored in a file and imported using keytool, e.g. 'keytool -importcert -file cert.cer -alias certAlias -keystore keystore.jks'). Make sure the presented certificates are issued by your trusted CA before adding them to the keystore.

why i get this exception?
I am using gluu server and it's shibboleth component.in SP there is an apollo.cert and a samlkeystore.jks . apollo.crt is imported in samlkeystore.jks .
I run SP and get metadadata.xml (it contains ds:X509Certificate) and import this file into gluu server .
I am confused , where is the problem ? IDP or SP?what can i do to fix that?
I really need help.
EDIT :
@Bernahrd,@Guillermo thank you so much for your reply.
I still working but can't find out what happen here.
I add metadata xml file in idp and sp .
this is gluu idp metadata , to generate idp metadata on gluu server I use https://hostname/idp/shibboleth
<?xml version="1.0" encoding="UTF-8"?>
<EntityDescriptor entityID="https://ubuntu.gluu.info/idp/shibboleth" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
                  xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <IDPSSODescriptor errorURL="https://ubuntu.gluu.info/identity/feedback.htm"
                      protocolSupportEnumeration="urn:mace:shibboleth:1.0 urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:2.0:protocol">
        <Extensions>
            <shibmd:Scope regexp="false">ubuntu.gluu.info</shibmd:Scope>
        </Extensions>
        <KeyDescriptor>
            <ds:KeyInfo>
                <ds:X509Data>
                    <ds:X509Certificate>MIIDaDCCAlACCQD165zhtG0q6DANBgkqhkiG9w0BAQsFADB2MQswCQYDVQQGEwJJ
                        UjELMAkGA1UECAwCVEgxDzANBgNVBAcMBnRlaHJhbjENMAsGA1UECgwER0xVVTEZ
                        MBcGA1UEAwwQdWJ1bnR1LmdsdXUuaW5mbzEfMB0GCSqGSIb3DQEJARYQc3VwcG9y
                        dEBnbHV1Lm9yZzAeFw0xNjA2MTcyMDMxMTlaFw0xNzA2MTcyMDMxMTlaMHYxCzAJ
                        BgNVBAYTAklSMQswCQYDVQQIDAJUSDEPMA0GA1UEBwwGdGVocmFuMQ0wCwYDVQQK
                        DARHTFVVMRkwFwYDVQQDDBB1YnVudHUuZ2x1dS5pbmZvMR8wHQYJKoZIhvcNAQkB
                        FhBzdXBwb3J0QGdsdXUub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
                        AQEAuSkeEK+lK498Yc8OspdYoqoDQLDPs8cF0qE84hLRhdEHU1y++/dzaC6271sV
                        KtTXt/aG1PwBS7unPIMOEKFNJXdO0FHEgt4nkuhq7KUvcR4ckNvL+5Ys5r/3Egzh
                        8nm96Z0jtuUlu1e8b6iAsw+9tYq1olDZO9Hv6hR9V/ZlTolmuZqnXEy3p/47W25p
                        ROLVuR7jIH+cKDVJe8lW1702wWEQWDhxPBJ1fJsMuBA/RiB/J6SBAgkxs/9m513Y
                        +lYaobhqMfocwzt/GAqsq4Fnixf1PldJpi/ZJfnyJ0JOFcLj8YHY/CFRiRm8b3UE
                        1VUYZRTHK9Qc3ryd+KA14QTymwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBRS5aR
                        CSPS+3qoWI5wj3f97QEncv0Q80sb0tzumUJIWqDoYWW0ucyRWGiUSSVIBeVJmmmG
                        Yus9ML6Khb1WNCsXZW3GcBfoA8FImTtTBMyXWHpDtR6Ne156kSv2ymmdyipZo6OB
                        iItWjEgAOmRsynxkJASEPhH5RM8iqGAJVBCgU738so0X3e7N5pQSNMKLiCkf8afK
                        EsL9Q61f9RiLImlehkdw3m2B0wKQJZo1Q1D/L7sZzaOXiif3YkcVNO8t0CJpZSog
                        YSKS+2cM7LTDdiNS3YMpcRdcvZTixDMSAfO+7PDTfubio8ADAmjr7Gj7vwzG8sFi
                        PmIqbqM/Ii1e0kD7
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </KeyDescriptor>
        <ArtifactResolutionService Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
                                   Location="https://ubuntu.gluu.info:9443/idp/profile/SAML1/SOAP/ArtifactResolution"
                                   index="1"/>
        <ArtifactResolutionService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
                                   Location="https://ubuntu.gluu.info:9443/idp/profile/SAML2/SOAP/ArtifactResolution"
                                   index="2"/>
        <NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
        <SingleSignOnService Binding="urn:mace:shibboleth:1.0:profiles:AuthnRequest"
                             Location="https://ubuntu.gluu.info/idp/profile/Shibboleth/SSO"/>
        <SingleSignOnService Binding="urn:mace:shibboleth:2.0:profiles:AuthnRequest"
                             Location="https://ubuntu.gluu.info/idp/profile/SAML2/Unsolicited/SSO"/>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                             Location="https://ubuntu.gluu.info/idp/profile/SAML2/POST/SSO"/>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"
                             Location="https://ubuntu.gluu.info/idp/profile/SAML2/POST-SimpleSign/SSO"/>
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
                             Location="https://ubuntu.gluu.info/idp/profile/SAML2/Redirect/SSO"/>
    </IDPSSODescriptor>
    <AttributeAuthorityDescriptor
            protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:2.0:protocol">
        <Extensions>
            <shibmd:Scope regexp="false">ubuntu.gluu.info</shibmd:Scope>
        </Extensions>
        <KeyDescriptor>
            <ds:KeyInfo>
                <ds:X509Data>
                    <ds:X509Certificate>MIIDaDCCAlACCQD165zhtG0q6DANBgkqhkiG9w0BAQsFADB2MQswCQYDVQQGEwJJ
                        UjELMAkGA1UECAwCVEgxDzANBgNVBAcMBnRlaHJhbjENMAsGA1UECgwER0xVVTEZ
                        MBcGA1UEAwwQdWJ1bnR1LmdsdXUuaW5mbzEfMB0GCSqGSIb3DQEJARYQc3VwcG9y
                        dEBnbHV1Lm9yZzAeFw0xNjA2MTcyMDMxMTlaFw0xNzA2MTcyMDMxMTlaMHYxCzAJ
                        BgNVBAYTAklSMQswCQYDVQQIDAJUSDEPMA0GA1UEBwwGdGVocmFuMQ0wCwYDVQQK
                        DARHTFVVMRkwFwYDVQQDDBB1YnVudHUuZ2x1dS5pbmZvMR8wHQYJKoZIhvcNAQkB
                        FhBzdXBwb3J0QGdsdXUub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
                        AQEAuSkeEK+lK498Yc8OspdYoqoDQLDPs8cF0qE84hLRhdEHU1y++/dzaC6271sV
                        KtTXt/aG1PwBS7unPIMOEKFNJXdO0FHEgt4nkuhq7KUvcR4ckNvL+5Ys5r/3Egzh
                        8nm96Z0jtuUlu1e8b6iAsw+9tYq1olDZO9Hv6hR9V/ZlTolmuZqnXEy3p/47W25p
                        ROLVuR7jIH+cKDVJe8lW1702wWEQWDhxPBJ1fJsMuBA/RiB/J6SBAgkxs/9m513Y
                        +lYaobhqMfocwzt/GAqsq4Fnixf1PldJpi/ZJfnyJ0JOFcLj8YHY/CFRiRm8b3UE
                        1VUYZRTHK9Qc3ryd+KA14QTymwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBRS5aR
                        CSPS+3qoWI5wj3f97QEncv0Q80sb0tzumUJIWqDoYWW0ucyRWGiUSSVIBeVJmmmG
                        Yus9ML6Khb1WNCsXZW3GcBfoA8FImTtTBMyXWHpDtR6Ne156kSv2ymmdyipZo6OB
                        iItWjEgAOmRsynxkJASEPhH5RM8iqGAJVBCgU738so0X3e7N5pQSNMKLiCkf8afK
                        EsL9Q61f9RiLImlehkdw3m2B0wKQJZo1Q1D/L7sZzaOXiif3YkcVNO8t0CJpZSog
                        YSKS+2cM7LTDdiNS3YMpcRdcvZTixDMSAfO+7PDTfubio8ADAmjr7Gj7vwzG8sFi
                        PmIqbqM/Ii1e0kD7
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </KeyDescriptor>
        <AttributeService Binding="urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
                          Location="https://ubuntu.gluu.info:9443/idp/profile/SAML1/SOAP/AttributeQuery"/>
        <AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
                          Location="https://ubuntu.gluu.info:9443/idp/profile/SAML2/SOAP/AttributeQuery"/>
        <NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
        <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
    </AttributeAuthorityDescriptor>
</EntityDescriptor>

Then I add it to SP in shibboleth-idb.xml
this is my SP metadata file that should be add to the gluu idp :
<?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor ID="http://ubuntu.gluu.info:9090/saml/metadata/alias/defaultAlias"
                     entityID="http://ubuntu.gluu.info:9090/saml/metadata/alias/defaultAlias"
                     xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
    <md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true"
                        protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
        <md:KeyDescriptor use="signing">
            <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <ds:X509Data>
                    <ds:X509Certificate>MIIDUjCCAjqgAwIBAgIEUOLIQTANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQGEwJGSTEQMA4GA1UE
                        CBMHVXVzaW1hYTERMA8GA1UEBxMISGVsc2lua2kxGDAWBgNVBAoTD1JNNSBTb2Z0d2FyZSBPeTEM
                        MAoGA1UECwwDUiZEMQ8wDQYDVQQDEwZhcG9sbG8wHhcNMTMwMTAxMTEyODAxWhcNMjIxMjMwMTEy
                        ODAxWjBrMQswCQYDVQQGEwJGSTEQMA4GA1UECBMHVXVzaW1hYTERMA8GA1UEBxMISGVsc2lua2kx
                        GDAWBgNVBAoTD1JNNSBTb2Z0d2FyZSBPeTEMMAoGA1UECwwDUiZEMQ8wDQYDVQQDEwZhcG9sbG8w
                        ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCXqP0wqL2Ai1haeTj0alwsLafhrDtUt00E
                        5xc7kdD7PISRA270ZmpYMB4W24Uk2QkuwaBp6dI/yRdUvPfOT45YZrqIxMe2451PAQWtEKWF5Z13
                        F0J4/lB71TtrzyH94RnqSHXFfvRN8EY/rzuEzrpZrHdtNs9LRyLqcRTXMMO4z7QghBuxh3K5gu7K
                        qxpHx6No83WNZj4B3gvWLRWv05nbXh/F9YMeQClTX1iBNAhLQxWhwXMKB4u1iPQ/KSaal3R26pON
                        UUmu1qVtU1quQozSTPD8HvsDqGG19v2+/N3uf5dRYtvEPfwXN3wIY+/R93vBA6lnl5nTctZIRsyg
                        0Gv5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAFQwAAYUjso1VwjDc2kypK/RRcB8bMAUUIG0hLGL
                        82IvnKouGixGqAcULwQKIvTs6uGmlgbSG6Gn5ROb2mlBztXqQ49zRvi5qWNRttir6eyqwRFGOM6A
                        8rxj3Jhxi2Vb/MJn7XzeVHHLzA1sV5hwl/2PLnaL2h9WyG9QwBbwtmkMEqUt/dgixKb1Rvby/tBu
                        RogWgPONNSACiW+Z5o8UdAOqNMZQozD/i1gOjBXoF0F5OksjQN7xoQZLj9xXefxCFQ69FPcFDeEW
                        bHwSoBy5hLPNALaEUoa5zPDwlixwRjFQTc5XXaRpgIjy/2gsL8+Y5QRhyXnLqgO67BlLYW/GuHE=
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </md:KeyDescriptor>
        <md:KeyDescriptor use="encryption">
            <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <ds:X509Data>
                    <ds:X509Certificate>MIIDUjCCAjqgAwIBAgIEUOLIQTANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQGEwJGSTEQMA4GA1UE
                        CBMHVXVzaW1hYTERMA8GA1UEBxMISGVsc2lua2kxGDAWBgNVBAoTD1JNNSBTb2Z0d2FyZSBPeTEM
                        MAoGA1UECwwDUiZEMQ8wDQYDVQQDEwZhcG9sbG8wHhcNMTMwMTAxMTEyODAxWhcNMjIxMjMwMTEy
                        ODAxWjBrMQswCQYDVQQGEwJGSTEQMA4GA1UECBMHVXVzaW1hYTERMA8GA1UEBxMISGVsc2lua2kx
                        GDAWBgNVBAoTD1JNNSBTb2Z0d2FyZSBPeTEMMAoGA1UECwwDUiZEMQ8wDQYDVQQDEwZhcG9sbG8w
                        ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCXqP0wqL2Ai1haeTj0alwsLafhrDtUt00E
                        5xc7kdD7PISRA270ZmpYMB4W24Uk2QkuwaBp6dI/yRdUvPfOT45YZrqIxMe2451PAQWtEKWF5Z13
                        F0J4/lB71TtrzyH94RnqSHXFfvRN8EY/rzuEzrpZrHdtNs9LRyLqcRTXMMO4z7QghBuxh3K5gu7K
                        qxpHx6No83WNZj4B3gvWLRWv05nbXh/F9YMeQClTX1iBNAhLQxWhwXMKB4u1iPQ/KSaal3R26pON
                        UUmu1qVtU1quQozSTPD8HvsDqGG19v2+/N3uf5dRYtvEPfwXN3wIY+/R93vBA6lnl5nTctZIRsyg
                        0Gv5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAFQwAAYUjso1VwjDc2kypK/RRcB8bMAUUIG0hLGL
                        82IvnKouGixGqAcULwQKIvTs6uGmlgbSG6Gn5ROb2mlBztXqQ49zRvi5qWNRttir6eyqwRFGOM6A
                        8rxj3Jhxi2Vb/MJn7XzeVHHLzA1sV5hwl/2PLnaL2h9WyG9QwBbwtmkMEqUt/dgixKb1Rvby/tBu
                        RogWgPONNSACiW+Z5o8UdAOqNMZQozD/i1gOjBXoF0F5OksjQN7xoQZLj9xXefxCFQ69FPcFDeEW
                        bHwSoBy5hLPNALaEUoa5zPDwlixwRjFQTc5XXaRpgIjy/2gsL8+Y5QRhyXnLqgO67BlLYW/GuHE=
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </md:KeyDescriptor>
        <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                                Location="http://ubuntu.gluu.info:9090/saml/SingleLogout/alias/defaultAlias"/>
        <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
                                Location="http://ubuntu.gluu.info:9090/saml/SingleLogout/alias/defaultAlias"/>
        <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
        <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
        <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
        <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
        <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</md:NameIDFormat>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
                                     Location="http://ubuntu.gluu.info:9090/saml/SSO/alias/defaultAlias" index="0"
                                     isDefault="true"/>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                                     Location="http://ubuntu.gluu.info:9090/saml/SSO/alias/defaultAlias" index="1"/>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"
                                     Location="http://ubuntu.gluu.info:9090/saml/SSO/alias/defaultAlias" index="2"/>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"
                                     Location="http://ubuntu.gluu.info:9090/saml/HoKSSO/alias/defaultAlias"
                                     hoksso:ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
                                     index="3"
                                     xmlns:hoksso="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"/>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"
                                     Location="http://ubuntu.gluu.info:9090/saml/HoKSSO/alias/defaultAlias"
                                     hoksso:ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" index="4"
                                     xmlns:hoksso="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"/>
    </md:SPSSODescriptor>
</md:EntityDescriptor>

in gluu server I add new trust relationship and add SP metadata file to it.
but some thing strange happen here,In SP index page i select shibolleth idp,then login page of shibolleth idp appears,after enter username and password it redirect to my SP and then Exception happen, according to the exception,idp send me this certificate and want me to add this to my trust store :
-----BEGIN CERTIFICATE-----
MIIDaDCCAlACCQDTFXuxD0vSJTANBgkqhkiG9w0BAQsFADB2MQswCQYDVQQGEwJJUjELMAkGA1UE
CAwCVEgxDzANBgNVBAcMBnRlaHJhbjENMAsGA1UECgwER0xVVTEZMBcGA1UEAwwQdWJ1bnR1Lmds
dXUuaW5mbzEfMB0GCSqGSIb3DQEJARYQc3VwcG9ydEBnbHV1Lm9yZzAeFw0xNjA2MTcyMDMxMTha
Fw0xNzA2MTcyMDMxMThaMHYxCzAJBgNVBAYTAklSMQswCQYDVQQIDAJUSDEPMA0GA1UEBwwGdGVo
cmFuMQ0wCwYDVQQKDARHTFVVMRkwFwYDVQQDDBB1YnVudHUuZ2x1dS5pbmZvMR8wHQYJKoZIhvcN
AQkBFhBzdXBwb3J0QGdsdXUub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvt/V
JO3o7LCwmgUSJg1CyTfSwUL28d2FaMsiiSUZ5Qs6kPHKwJ22IltBpIaJBgFcqyNxOgve3z7agJtJ
dBmyWJRoz7yMbtXmHJdk+XRs4LqRCl0CFprlPtfg9Avyb8tBqWa+c3VBbbhJ0dKpWpvzVLoRm33J
u9+/TnlM6a5UUHGsQIynjndFJSFnittNfDLQglooKyjUuiv0OrN5E7qG9bGe+w+EytYrzfx+AI/t
9wGIjMKyY9MWO4/ai0Ei7tX5CHS1GxFg2xp6Q6705YjFxrfFTbB+5XIbUCLi62nzas51hYeVzWHZ
B2XODA8ClE+U31EtwvVHbNJP5DOoM9441QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBBYAvHpshQ
8SH7wrPKNhFpbdxJ49PYmMDlCtKyU10umiEYmCSg9m4vado9MLrqblQ5qUMX1YYiIQbR47RXtSdG
AAr16JcBbiktrGv+KeGuLp7K0Ye3WsUS/uSrCimvW+lilNqAHj0MvqjQuSKCgOrmpxT55C8e21/h
piFjQF7ReCAeD0DV5ZGiDZQP0wdjJvHAMVQbQGeIpizZnOmmozsCiUDpSN2gZgu59TPimTD7rcfi
WZdaOr9L3pevZFLOrCXweyS6eiD2pTV1hWnfX6Ck3c0pM+yuA7Ug3BSFoOCXigKiA1EO4aqnGHLG
dswo1zee5kgF8oJbyYjVcYhZgc5w
-----END CERTIFICATE-----

Thanks.

A: You SP-metadata has
       <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
                                 Location="http://ubuntu.gluu.info:9090/saml/SSO/alias/defaultAlias" index="0"
                                 isDefault="true"/>

hence artifact binding will be used.
--> The SP tries to connect to the Artifact Resolution service of the IdP (Location="https://ubuntu.gluu.info:9443/idp/profile/SAML2/SOAP/ArtifactResolution").
As this has scheme 'https' a secure SOAP call has to be performed.
Either you configure a JSSE truststore for your deployment container running the app (JVM-option -Djavax.net.ssl.trustStore=PATH_TO_JKS_TRUSTORE) and add the provided cert to hat truststore or remove artifact binding from your SP's meta data and only use front-channel bindings (where all communication goes through the user-agent)


text:
Q: Create a quickly app with build dependencies I am creating a Quickly app in Ubuntu that depends on Python Twisted, which is available in the package python-twisted. How should I add python twisted as a dependency so that it will be installed when a user installs my application?

A: The good thing is that Quickly will handle this for you, so you don't have to worry about it at all :)
Once you've added the import statement to add Twisted in your code, the next time you run the quickly package (or share or release or submitubuntu), Quickly will automatically detect that you're using it and will add it to the dependencies in the debian/control file in your source tree.
This will take care of your package pulling in python-twisted as a dependency whenever it is installed.
In addition to that, if you really need additional dependencies that you don't use directly in the code, you can use the quickly configure dependencies command and add a comma-separated list of extra dependencies to the text editor that's then fired up. Quickly will then always add those dependencies to the package. Be sure to know what you're doing if you're using that command.


text:
Q: Proof of $\int_{a}^{a} f(x)dx = 0$ For this proof, after I convert the definite integral into the riemann sum definition, is it just enough to say $\Delta(x)$ = $\frac{b-a}{n}$ and since b = a, the $\Delta(x)$ becomes 0, thus, making everything else equal to 0, since everything else is being multiplied by zero?

A: We can use also  the empty sum definition
$$\sum^0_{k=1} f(k)=0 $$ for every f.
One partition is in the form
$a=t_0<t_1< \ldots <t_n=b$
if $a=b$ then $n=0$.
Let it be the degenerate interval $[a,a]=\{a\}$, we have $t_{0}=a$ and $t_{n}=a$, we should have   $t_{1}>t_{0}=a$ but we don't have one number greater then $a$ in the interval. We have only one partition. The inferior summation is
 $$s(f,P)=\sum^{n=0}_{k=1}m_{k}\Delta t_{k-1}=0 $$
 because it's empty.
 The superior summation is
 $$S(f,P)=\sum^{n=0}_{k=1}M_{k}\Delta t_{k-1}=0 $$
In this case the inferior summation is always equal the superior summation
and the same for the superior and inferior integrals. So every function will be integrable in this set and the integral $0$
 $$\int^{a}_{a} f(x)dx=0. $$

A: Why not just stick with this?
$$\begin{align}
\int_a^a f(x)\, dx &= F(x)\bigr|_a^a \\
&= F(a)-F(a) \\
&= 0
\end{align}$$
where $F'(x)=f(x)$.


text:
Q: How to extract string in batch file? I am trying to extract IP of source of Remote Desktop Connection using,
FOR /F "tokens=3 USEBACKQ" %%F IN (`netstat -n ^| find "3389" ^| find "ESTABLISHED" /c`) DO SET /A IP=%%F

ECHO %IP%

But this way the IP variable contains IP along with the port 192.168.174.129:47523.
How can I extract only the IP part?
I read about the substring functionality in batch but that requires the starting position aling with length but I can't be sure of starting position as last octet of IP might change from 129 to 29 or even 2.

A: Here's a quick example according to my comment, of using the appropriate delims. It additionally uses findstr.exe instead of find.exe, in order to use a single match string, instead of performing multiple pipes to the same utility.
@Echo Off
SetLocal EnableExtensions
Set "IP="
For /F "Tokens=4 Delims=: " %%G In ('%SystemRoot%\System32\NETSTAT.EXE -n 2^>NUL
 ^| %SystemRoot%\System32\findstr.exe /R
 /C:":3389[ ][ ]*[^ ][^ ]*[ ][ ]*ESTABLISHED"') Do Set "IP=%%G"
If Not Defined IP GoTo :EOF
Echo %IP%

In this case, findstr.exe searches for, and returns, lines output from the NETSTAT.EXE -n command which contain the string :3389 immediately followed by a sequence of one or more space characters, then one or more none space characters, then one or more space characters, then the case sensitive string ESTABLISHED.
Please note however that ESTABLISHED is most likely a language dependent string, so this is unlikely to work universally.

A: FOR /F "tokens=3 USEBACKQ" %%F IN (`netstat -n ^| findstr "3389" ^| findstr "ESTABLISHED"`) DO (
  for /f "delims=:" %%a in ("%%F") do set IP=%%a
)
echo %IP%

I replace find to findstr because find not search text in my machine. The second FOR with delims=: split 192.168.174.129:47523 in two parts. First part is IP address.


text:
Q: Asus Nexus 7 2013 camera.open Fail to connect to camera service I have an issue only on Asus Nexus 7 2013. All other devices, including Asus Nexus 7 2012 works fine.
This device has 2 camera IDs: 0, 1.
But I can't open camera, using both of them.
//...
try {
     //cameraID: 0 or 1
     camera = Camera.open(cameraID);
     //...
} catch (Exception e) {
     e.printStackTrace();
}

So I getting:
java.lang.RuntimeException: Fail to connect to camera service
android.hardware.Camera.<init>(Camera.java:495)
android.hardware.Camera.open(Camera.java:341)

A: Problem was in new Android 6+ feature: Request Permission at Runtime.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
    if (!permissionRequestInProgress) {
          permissionRequestInProgress = true;
              new Handler().post(new Runnable() {
                  @Override
                  public void run() {
                      if (ContextCompat.checkSelfPermission(RootActivity.this, Manifest.permission.CAMERA)
                              != PackageManager.PERMISSION_GRANTED)
                      {
                          ActivityCompat.requestPermissions(RootActivity.this,
                                        new String[]{Manifest.permission.CAMERA},
                                        CAMERA_PERMISSION_REQUEST);
                      } else {
                          //we got it
                      }
              }
           });
    }
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    switch (requestCode) {
        case CAMERA_PERMISSION_REQUEST:
            if (grantResults.length > 0
                    && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                // permission was granted
                //we got it
            } else {
                // permission denied
            }
            permissionRequestInProgress = false;
            break;
        default:
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}


text:
Q: exec() PHP command fails without error but works on command prompt (Magento 2) I created an own command for magento 2 which exports all product data to a csv file, the command looks as follows:
php -d memory_limit=1024M /home/myuser/public_html/myapp/bin/magento catalog:export catalog_product -f csv -e myserializedarray >> /home/myuser/public_html/myapp/log.txt 2>&1 &

This command works perfectly on the command prompt, exports all 15000 products without a problem.
When I do the same within PHP as follows:
exec("php -d memory_limit=1024M /home/myuser/public_html/myapp/bin/magento catalog:export catalog_product -f csv -e myserializedarray >> /home/myuser/public_html/myapp/log.txt 2>&1 &")

The command stops after some minutes, always at different positions. I added some log statements and it turned out that it stops in the middle of the loop which reads data from the database and writes it into the a file. Magento function (core):
 public function export(){
    //Execution time may be very long
    set_time_limit(0);

    $writer = $this->getWriter();
    $page = 0;
    while (true) {
        ++$this->page;
        $entityCollection = $this->_getEntityCollection(true);
        $entityCollection->setOrder('has_options', 'asc');
        $entityCollection->setStoreId(Store::DEFAULT_STORE_ID);
        $this->_prepareEntityCollection($entityCollection);
        $this->paginateCollection($this->page, $this->getItemsPerPage());
        if ($entityCollection->count() == 0) {
            break;
        }
        $exportData = $this->getExportData();
        if ($this->page == 1) {
            $writer->setHeaderCols($this->_getHeaderColumns());
        }
        foreach ($exportData as $dataRow) {
            $writer->writeRow($this->_customFieldsMapping($dataRow));
        }
        if ($entityCollection->getCurPage() >= $entityCollection->getLastPageNumber()) {
            break;
        }
    }
    return $writer->getContents();
}

The user is the same for the command prompt version and for the version started via web. The used paths are absolute, therefore shouldn't be a problem either. I also activated error logging, but there's no messages written. shell_exec doesn't work either.
What am I missing? The function itself must be working, so what's the difference with starting the command via php?


text:
Q: Where to authenticate with customToken using adapters We're trying to authenticate with a customToken to Firebase - this has been working before we moved to EmberCLI as we initiated these Firebase specific adapters at a later stage in the app runtime.
Now trying to initiate the authCustomToken at an earlier stage in the adapter with the flow as follows:

*

*Initiate adapter

*Hook on "init" and request a token from backend

*When token received - authWithCustomToken

Code looks pretty much like this:
import DS from 'ember-data';

/**
 * CartAdapter
 * @class adapters.Cart
 * @extends DS.FirebaseAdapter
 */
export default DS.FirebaseAdapter.extend(ajax, {
    firebase: new Firebase('https://firebasehost.com'),
    pathForType: function() {
        return 'carts/' + this.get('sessionService').get('userId');
    },
    initAdapter: function() {
        this.ajaxRequest('backendhost/firebase/').then(function(data) {
            var ref = new Firebase('https://firebasehost.com');
            ref.authWithCustomToken(data.token);
        });
    }.on('init')
});

How is the best way of approaching this?

A: The error is that it seems EmberFire as of yet does not support a validation child rule. Most probably because it's trying to update the cart before the item is inserted.
This was working in Ember 1.7 and a previous version of EmberFire.
The rule-block below that does work, with the part that did not work uncommented:
"rules": {
    // All data is accessible
    ".read": true,
    ".write": true,
    "cartItem": {
        "$userid": {
            // A list of users carts.
            "$cartitemid": {
                // Only the user can read and write their own entries into this list.
                ".write": "auth != null && $userid ==auth.uid",
                ".read": "auth != null && $userid ==auth.uid",
                "cart": {
                    // The following relation should only contain an actual id from the "cart" list.
                    "$cartid": {
                        ".validate": "root.child('carts').hasChild($cartid)"
                    }
                }
            }
        }
    },
    "carts": {
        "$userid": {
            "$cartid": {
                // The user is allowed to read and write everything in their cart.
                ".read": "auth != null && $userid ==auth.uid",
                ".write": "auth != null && $userid ==auth.uid"
                /*"items": {
                    // The following list should only contain actual ids from the "cartItems" list.
                    "$itemid": {
                        ".validate": "root.child('cartItem/' + $userid).hasChild($itemid)"
                    }
                }*/
            }
        }
    }
}


text:
Q: How can I make this query in mysql with multiple select statements? I want to make this query with multiple statements but I don't know how. Please help me. Thank you! :)
SELECT
      customerNumber AS 'Customer Number',
      customerName AS ' Customer Name',
      quantityordered AS 'Quantity Ordered',
      amount AS 'Amount',
      SUM(quantityOrdered*amount) AS 'Total Amount'
   FROM
      customers
         INNER JOIN orders USING (customerNumber)
            INNER JOIN orderdetails USING (orderNumber)
         INNER JOIN payments USING (customerNumber)
   WHERE
      quantityOrdered >= 50
   GROUP BY
      customerName
   HAVING
      COUNT(quantityOrdered) > 5
   ORDER BY
      3;

A: Too much to explain in a comment... Your query does not make sense and it may be due to a lack of understanding of the group by and having context.  I would first start that your queries should have all columns referenced as "table.column" or "alias.column" so we know where columns originate vs guessing.
The "Group by" applies an aggregation of values (such as your SUM() of qty * amount) by the given group by (customer name).  However, if you have multiple records in the child-level tables (ex: multiple payments for a person, then your counts and sum values could get duplicated unexpectedly.)  Also, you have a group by customer name... What if you have 5 different people named "Jim" but they are totally different people.  You should probably be grouping by their unique customerNumber, and this would result in 5 different "Jim" records with each of their respective unique customer numbers.
Your Where clause of QtyOrd > 50 means that only those individual line item purchases (assuming) order details, have a quantity of 50 or more will be included regardless of how many items ordered have less quantity even if on the same order which is ok if that is what you intend.
Finally, your having clause of count() > 5, this appears you only want those customers who have ordered AT LEAST 5 different things with a quantity of 50 or more as qualified by the where clause.
The order by 3 indicating you want ordered by the quantity ordered in natural ascending order (vs descending would be most qty at top, least qty at bottom).
All that being said, you have an additional join to your payments table.  Here is where the duplications would probably kick in...  If you have an order with 2 or 3 payments, your order of 2 line items has just turned into 4 or 6 as a final count.
Knowing these, you might want to better describe in your original question what you are TRYING to get.  You showed the query as best you could, but still unclear...

A: as per your scenario and provided data is explaining i have get this type of things .. hope it will help you.
select * from orders where customerNumber == '';

select * from orderdetails where orderNumber == '';

select * from payments where customerNumber == '';

select SUM(o.quantityOrdered * p.amount) as 'quantityOrdered' from orders o, payments p where o.orderId == p.orderId;


text:
Q: CSS/HTML - Viewport metatag destroys my site styling completely? I'm experiencing a serious problem with viewport metatag while browsing on mobile.
Adding this line to my <head> tag:
<meta name="viewport" content="width=device-width, initial-scale=1">

Makes the whole site display everything 10x bigger, won't display background images at all.
What am I doing wrong? This only applies to mobile version.
After using metatag:

EDIT:
I'll add another screenshot to show exactly this same part of the page.

A: i think i found problem)
all of you query start from min-width >700px
you can write @media(max-width: 968px) - and all must work fine
play with query rules


text:
Q: ContainerView hide UILabel I want to use UILabel in ContainerView.
So I am using this code for that.
UILabel *myLabel = [[[UILabel alloc] initWithFrame:CGRectMake(16, 60, 300, 150)] autorelease];
myLabel.numberOfLines = 0;
myLabel.font = [UIFont systemFontOfSize:13.5];
myLabel.text = [theQuiz objectAtIndex:row+3] ;
myLabel.lineBreakMode = UILineBreakModeWordWrap;
myLabel.backgroundColor = [UIColor clearColor];
myLabel.layer.cornerRadius = 8.0;
[myLabel sizeToFit];
[self.view addSubview:myLabel];

//ContainerView
UIView *ChallengeView = [[UIView alloc] initWithFrame:CGRectMake(8, 55, 300, 10 + Challenge.frame.size.height)];
ChallengeView.layer.borderColor = [[UIColor purpleColor ] CGColor];
[ChallengeView setBackgroundColor:[UIColor whiteColor]];
ChallengeView.layer.cornerRadius = 8 ;
ChallengeView.layer.borderWidth = 1.5;
[self.view addSubview:ChallengeView];
[ChallengeView release];

Now problem is that when i set background color for ContainerView it hides the text of myLabel
Any Solution ??

A: What is happening is that you containerView is being added above label either you add label after containerView or do this:
[self.view bringSubviewToFront:myLabel];

A: You add the ChallengeView first , Then add the myLabel.
Otherwise u can do as like @xs2bush said,
[self.view bringSubviewToFront:myLabel];

Bcz the ChallengeView hides the label.


text:
Q: How to hide a WPF element to work correctly with an automation framework? The most common approach to hide a WPF control is setting Visibility attribute to Hidden or Collapsed. When I did this for sample application, and I was trying to find these elements by the automation framework, I got the items with IsOffscreen flag set to true.
For instance:
<Label Content="Hidden label" Visibility="Hidden"/>

<Label Content="Collapsed label" Visibility="Collapsed"/>

From my perspective, it looks reasonable but automation framework documentation:
https://learn.microsoft.com/en-us/windows/desktop/winauto/uiauto-automation-element-propids
 says:

Objects that the end-user does not perceive at all, or that are
  "programmatically hidden" (for example, a dialogue box that has been
  dismissed, but the underlying object is still cached by the
  application) should not be in the automation element tree in the first
  place (instead of setting the state of IsOffscreen to TRUE).

How can I achieve the result which is pointed out in the documentation?

A: Faced similar issue, Setting Visibilty to hidden/Collapsed does not remove the element from the visual tree, even though the control is not visible visually. And currently as per my knowledge there is no other property that can remove the element from the visual tree.
As a workaround, you can make use of ContentPresenter with triggers to include or exclude controls at runtime.
For example, in the below snippet I am deciding which label to include based on a condition. it is decided at runtime and only one is included in the visual tree.
<ContentPresenter Content="{Binding}">
<ContentPresenter.Resources>
    <DataTemplate x:Key="LabelContent1">
        <Label Content="Dummy" />
    </DataTemplate>
    <DataTemplate x:Key="LabelContent2">
        <Label Content="Dummy" />
    </DataTemplate>
</ContentPresenter.Resources>
<ContentPresenter.Style>
    <Style TargetType="{x:Type ContentPresenter}">
        <Setter Property="ContentTemplate" Value="{StaticResource LabelContent1}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding Converter={Binding Path=LabelText}}" Value="{x:Null}">
                <Setter Property="ContentTemplate" Value="{StaticResource LabelContent2}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
</ContentPresenter.Style>

Reference:
https://tyrrrz.me/blog/conditional-content-presenting-via-wpf-contentpresenter


text:
Q: Dynamically create angular checkboxes and get their values I have a program that needs to check an API for all the current users on the system, and then present a form to an administrator who can decide which ones to give certain powers. I can't figure out how to get the information modeled into my formData in order to do this. I have this but it does not work:

<input type="checkbox" ng-model="formData.checkboxes" ng-true-value="{{f}}"> {{f}}

The mdfields is just an array of every user's name.
That may give you an idea though of what I want: I just want to display all the names of users, and let the admin select as many of them as he wants, then have that information available to $scope.formData so I can pass it to another API call and do stuff.
Edit: To clarify a bit, the list of checkboxes that gets called can change often, and ideally, I want the ability to send some data back to the server that says specifically something like:
["jao smith":true]
["frank jones":false]
although it would be fine to send back to server only the names of people who have been checked.

A: Without knowing more about you models there are several ways you can do it:
As property of fobject - can filter mdfields array to find selected:
<input ng-model="f.selected">

All in one scope variable array (not a good choice if doing any filtering because indexing changes):
<input  ng-model="formData.checkboxes[$index]"
        ng-init="formData.checkboxes[$index]=formData.checkboxes[$index]|false">

In a scope variable object - easy to collect selected by id
<input  ng-model="formData.checkboxes[f.id]">


text:
Q: Uploaded image after cropping not refreshed using codeigniter We have implemented image crop in our codeigniter application. It is uploading the image correctly using jquery ajax, but not displaying correctly in the page after uploading. It shows old image. After one page refresh only, new one is displaying.
We have added page refresh, redirect methods to refresh the page after upload, but not working.
I tried,
header("Location:".$_SERVER['HTTP_REFERER']);
window.location.reload();

It is working fine in local server.
 In server, refresh not working.
Can any one make a solution for this...?
<script type="text/javascript">
window.onload = function() {
    var options =
    {
        imageBox: '.imageBox',
        thumbBox: '.thumbBox',
        spinner: '.spinner',
        imgSrc: 'avatar.png'
    }
    var cropper = new cropbox(options);
    document.querySelector('#file').addEventListener('change', function(){
        var reader = new FileReader();
        reader.onload = function(e) {
            options.imgSrc = e.target.result;
            cropper = new cropbox(options);
        }
        reader.readAsDataURL(this.files[0]);
        this.files = [];
    })
    document.querySelector('#btnCrop').addEventListener('click', function(){
        var img = cropper.getDataURL();

        var simple = '<?php echo base_url(); ?>';
        var member_id ='<?php echo $this->session->userdata('current_member');?>';
        $.ajax({url: simple + 'admin/admin_home/membercrop',
            type: "POST",
            async: false,
            data: {
                "image": img
            },
            success: function (data) {

              window.location.reload();

            },
            error: function (error) {
                alert('error');
            }
        });

    })
    document.querySelector('#btnZoomIn').addEventListener('click', function(){
        cropper.zoomIn();
    })
    document.querySelector('#btnZoomOut').addEventListener('click', function(){
        cropper.zoomOut();
    })

};

</script>

A: The solution is to add a timestamp behind your image, this will prevent the caching :
<img src="test.jpg?t=<?=date('U')?>" />


text:
Q: VIM: Close all other tabs of current file except the one I'm on? Say if my 5 open tabs are:
file1 file2 file2 file2 file3

I want a quick way to close just all of the duplicate file2 tabs, when the focus is on any of the file2 tabs.
So result after running command should be:
file1 file2 file3

The command should not have any effect when focus is on file1 or file3 as there're no duplicate tabs of these.
Any thoughts on how to achieve this?
EDIT - SOLUTION based on Ingo's suggestions:
function! s:CloseDupTabs()
    let curBufnr = bufnr('')
    let numTabs  = tabpagenr('$')

    " Run for 1 lesser than numTabs so that we don't visit current tab in loop
    for i in range(numTabs - 1)
        execute 'tabnext'

        if curBufnr == bufnr('')
            " Check edge case to see if we're already on last tab before doing tabprev
            if tabpagenr() != tabpagenr('$')
                close
                execute 'tabprev'
            else
                close
            endif
        endif
    endfor

    execute 'tabnext'
endfunction

A: Every open file in Vim gets a unique buffer number; the one for your current file (file2 in your example) can be obtained via
:let bufnr = bufnr('')

You can then inspect the other tab pages, and close any buffer with the same number there. :help tabpagebuflist() has an example how to iterate over all tab pages; just modify that to skip the current (tabpagenr()) one.
In order to close a buffer, you first need to navigate to the corresponding tab page:
:execute 'tabnext' tabnr

If you always have just one window in a tab, you can then just :close it. Else, you need to first find the window that has the buffer, and go to it:
:execute bufwinnr(bufnr) . 'wincmd w'

It would be nice to keep track of the original tab page number, decrementing it when removing tab pages before it, in order to return to the original one.

A: I use Tabops to achieve this.
After installing with your favourite package manager, simply do:

:Tabops Uniq


text:
Q: Best way to optimize MySQL operations after a table grows Background info: we run a an e-commerce website and are trying to figure out what is the best way to deal with "historical" data for tables that are used very frequently and are bound too contain a lot of records (ie. orders, customers, etc).
I am particularly looking at 2 specific scenarios:

*

*DB migrations

*SELECTs

DB migrations
In the case of DB migrations, we are starting to see that we sometimes need to run some ALTER TABLE which are locking the whole table and, if the table has so many records, this can take a while. Of course, all operations on the table are on hold until the migration is done, which means that our checkout might be down just because we are changing a VARCHAR(15) to VARCHAR(256).
From MySQL 5.6, a lot of operations are done "INPLACE" which means (from what I understood) that they wont be creating a full-table lock: that's ok-ish but still not perfect -- what if we need to change the type of a column (cannot be executed INPLACE) and we really do not want to be in maintenance mode for minutes?
My super-ghetto idea was to simply replicate the table (copy it over), then execute the migration on the copied table, stop writing to the original table (ie. lock it), copy the data that wasnt synced to the copied one and swap them. I think the percona tool for zero-downtime migrations does something similar so maybe that's the "best" approach?
Opinions?
SELECTs
For SELECTs, since most of the old data is accessed very rarely, I thought of range-partitioning it by date (say pre-2015 / post-2015 for example) and then change most of our queries to fetch stuff WHERE YEAR(created_at) >= 2015.
If the user wants his full historical data then we'd dynamically remove that condition. This somehow ensures that data is well-partitioned.
Any other idea? Do you think partitioning might be worth it?

A: *

*Not until 5.7.1 can you quickly do this:

VARCHAR size may be increased using an in-place ALTER TABLE, as in
  this example:
ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(255);

*

*See pt-online-schema-change.

*If you already have Replication set up, then you can play the game of ALTERing the Slave, then failing over.  (Yes the Percona tools are handy in this area.)

*Don't 'hide' columns inside functions; the optimizer can't see them:
WHERE YEAR(created_at) >= 2015.
-->
WHERE created_at >= '2015-01-01'

*Partitioning into only 2 partitions is unlikely to provide any performance benefit.

*It is reasonable (and commonly done) to PARTITION BY RANGE of some date (eg, TO_DAYS()) for the purpose of eventually purging (via DROP PARTITION) old data.  The DROP is so much faster and less invasive than a big DELETE that that feature, alone, justifies partitioning.  The pruning that you mentioned rarely speeds up queries (except where indexes are poor).  More discussion of sliding time series


text:
Q: Unzip Multipart Zip from Command Line Thanks in advance for any help.  I am trying to unzip a multipart zip file from the command line in OSX 10.8.5.
I created the zip using zip -s 800m foo.zip foo.mov
The file foo.mov is 2.7GB.  So I have the files: foo.zip, foo.z01, foo.z02, foo.z03.
I tried using zip -s 0 foo.zip -O foo_unsplit.zip, but then foo_unsplit.zip is only 1.6GB and gives the error below when used with unzip.
error:  invalid compressed data to inflate

I also tried using cat Heritage.zip Heritage.z01 Heritage.z02 Heritage.z03 > Heritage_unsplit.zip but unzipping the result file gives the below result:
unzip Heritage_unsplit.zip
Archive:  Heritage_unsplit.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of Heritage_unsplit.zip or
        Heritage_unsplit.zip.zip, and cannot find Heritage_unsplit.zip.ZIP, period.

Does anyone know of a way to unzip a multipart file in command line.  Have I made a mistake in any of my attempts?

A: I'm assuming this is different between MacOS versions - I'm currently running High Sierra  and unzip is still not supporting multipart properly - but I did the same trick with cat but in reverse order and it worked.
i.e. cat Heritage.z03 Heritage.z02 Heritage.z01 Heritage.zip > Heritage_unsplit.zip
Then unzip on it worked.
I got some errors like the ones below, but the files are binary equal:
> unzip big.zip
Archive:  big.zip
warning [big.zip]:  zipfile claims to be last disk of a multi-part archive;
  attempting to process anyway, assuming all parts have been concatenated
  together in order.  Expect "errors" and warnings...true multi-part support
  doesn't exist yet (coming soon).
warning [big.zip]:  1073741824 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  1073741828
  (attempting to re-compensate)
  inflating: ...


text:
Q: Characteristic function issue As mentioned in a previous post, I've been trying to work through ALL of the problems in Jacod and Protter's Probability Essentials. The following problem has been giving me issues:

Let $Z \sim N(0,1)$. Show that $E[X^{2n+1}]=0$ and $E[X^{2n}]=\frac{(2n)!}{2^n n!}$

The issue I'm having is proceeding form my Taylor Expansion for $\varphi_{_Z}(u)$. Here's my work:

Since we're dealing with $N(0,1)$, we have
  $$\varphi_{_Z}(u)=e^{-\frac{1}{2}u^2}$$
  Recalling that the Taylor expansion of $e^x$ wrapped around 0, we have
  $$\varphi_{_Z}(u)=e^{-\frac{1}{2}u^2}=\sum_{k\geq0}(-\frac{u^2}{2})^k\cdot\frac{1}{k!}=\sum_{k\geq 0}(-1)^k\frac{u^{2k}}{2^kk!}$$
  $$\implies \varphi_{_Z}(u)=\sum_{k\geq 0}(-1)^k\frac{u^{2k}}{2^kk!}$$
  Next, recall by a theorem in the book that
  $$\frac{d^m}{du^m}\varphi_{_Z}(0)=i^mE[Z^m]$$
  where $i\in \mathbb{C}$. It follows that
  $$\frac{d^{2k}}{du^{2k}}\varphi_{_Z}(0)=\sum_{k\geq0}(-1)^k\frac{(2k)!}{2^k k!}=i^{2k}E[Z^{2k}]$$
  and
  $$\frac{d^{2k+1}}{du^{2k+1}}\varphi_{_Z}(0)=\sum_{k\geq0}(-1)^k(0)=0$$
  Since $(-1)^k=i^{2k}$, it follows that we have
  $$\sum_{k\geq0}i^{2k}\frac{(2k)!}{2^k k!}=i^{2k}E[Z^{2k}]$$
  $$\implies E[X^{2k}]=\frac{(2k)!}{2^k k!}$$

Is it justified to get rid of the sum? I'm basically at the answer, but keeping the sum is killing me. Any suggestions?

A: You made a mistake while differentiating. Notice
\begin{align}
\varphi_{_Z}(u)&=\sum_{k\geq 0}(-1)^k\frac{u^{2k}}{2^kk!}\\
&=\frac{u^{0}}{2^00!}-\frac{u^{2}}{2^11!}+\dotsb+(-1)^{n}\frac{u^{2n}}{2^nn!}+(-1)^{n+1}\frac{u^{2(n+1)}}{2^{n+1}(n+1)!}+\dotsb,
\end{align}
So
\begin{align}\frac{d^{2n}}{du^{2n}}\varphi_{_Z}(0)&=0+0+\dotsb+(-1)^{n}\frac{(2n)!0^0}{2^nn!}+(-1)^{n+1}\frac{(2(n+1))!0^{2}}{2^{n+1}(n+1)!}+\dotsb\\
&=(-1)^{n}\frac{(2n)!}{2^nn!}.
\end{align}
That is, $$(-1)^{n}\frac{(2n)!}{2^nn!}=i^{2n}E[Z^{2n}],$$ such that $$E[Z^{2n}]=\frac{(2n)!}{2^n n!}$$ follows immediately.