text:
Q: Independence of two noncommutative observables If two observables are free, you can find the joint distribution of these two observables. But, by Heisenberg's Uncertainty Principle it is impossible unless $X$ and $Y$ are such that $XY=YX$.
Is there any physical significance of free independence? What's the physical interpretation for two observables to be free independent?

A: Free probability theory was developed precisely to deal with noncommuting operators, represented by matrices $X$, $Y$. If $XY\neq YX$, the eigenvalues $\sigma$ of the sum $X+Y$ are not given by the sum of the eigenvalues $\lambda,\mu$ of $X$ and $Y$, so you cannot use the usual construction of the probability distribution $P_\sigma$ of $\sigma$ as the convolution of $P_\mu$ and $P_\lambda$. Free probability theory tells you how to construct, under certain conditions, $P_\sigma$ in terms of $P_\mu$ and $P_\lambda$. If this is the case, $X$ and $Y$ are called "free independent random variables".
Most of the physics applications I know of involve the quantization of classically chaotic systems. Suppose you have a billiard geometry of a certain shape, and you vary the shape a bit, parameterized by some variable $s$. If the billiard has classically chaotic dynamics, then the Hamiltonians $H(s_1)$ and $H(s_2)$ of that system evaluated at two sufficiently different values of $s$ are free independent.

A: I think some of the confusion in this question comes from the use of the phrase "joint distribution"; the slogan is that freeness of two variables allows to determine the joint distribution of the two variables, given the distribution of each of the variables. This is correct, but "joint distribution" has here to be understood as the non-commutative joint distribution, which is, by definition, the collection of all moments of the two variables. If the variables commute this can be identified with the classical meaning of joint distribution, i.e., a probability measure on $\mathbb{R}^2$; if the variables do not commute then this identification does not work any more. If variables are free, then (apart from trivial cases, where one of them is a constant) they do not commute, hence there is no joint distribution in the classical sense for two free variables.
The search for a good analytic meaning of the joint distribution of non-commuting variables is at the moment actually a quite active direction in free probability. See, for example, my survey article
Free Probability theory.
The physical significance of freeness usually comes via its link with random matrices; then large $N$-limits of physical theories might have a formulation in terms of free probability theory.
Some literature with a more physics flavor are for example:

*

*Quantum free Yang-Mills on the plane by Anshelevich and Sengupta

*Zooming in on local level statistics by supersymmetric extension of free probability by Mandt and Zirnbauer,

*Anomalous transport: a mathematical framework" (in particular, chapter 5) by Schulz-Baldes and Bellisard,

A: Free probability is a mathematical theory that studies noncommutative random variables. The "freeness" property is the analogue of the classical notion
of independence, and it is connected with free products. This theory was
initiated by Dan Voiculescu around 1986 in order to attack the free group
factors isomorphism problem, an important unsolved problem in the theory
of operator algebras. Typically the random variables lies in a unital algebra $ A$ such as a $C^{\ast}$-algebra or a von Neumann algebra. The algebra comes equipped with a noncommutative expectation, a linear functional $\tau: \mathcal{A}\rightarrow\mathbb{C}$ such that $\tau(1) = 1$. Unital subalgebras $A_{1},\ldots, A_{n}$ are then said to be free if the expectation of the product $a_{1}, \ldots, a_{n}$ is zero whenever each $ a_{1}\ldots , a_{n}$ has zero expectation, lies in an $A_{k}$, and no adjacent $ a_{j}$'s come from the same subalgebra $ A_{k}$. Random variables are free if they generate free unital subalgebras.

A: If two observables $X$ and $Y$ are free, all joint moments in $X$ and $Y$ vanish. Thus, if $X$ and $Y$ are self-adjoints like hermitians matrices, one can show with the help of the spectral theorem, the joint distribution  $\mu_{XY}$ of $X$ and $Y$ is uniquely determined by only the distribution $\mu_{X}$ of $X$ and the distribution $\mu_{Y}$ of $Y$. Thus, Heisenberg's uncertainty principle is not applied to free observables.


text:
Q: Android Parse Push Notifications Not Working - Outdated Device I just updated the latest Parse SDK (1.11.0) and now I'm not receiving push notifications. I am able to register successfully and can see on the parse site that that my "developer" channel has been subscribed but pushes never get sent and I get this error:

PPNS - Outdated device - The records on this installation are
  outdated, the user might have uninstalled the app.

Can someone please take a look at my code and see if you notice anything incorrect?
public class LSIApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Parse.initialize(this, "********", "********");
        ParseInstallation.getCurrentInstallation().saveInBackground();
        ParsePush.subscribeInBackground("developer", new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
                } else {
                    Log.e("com.parse.push", "failed to subscribe for push", e);
                }
            }
        });
        Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
    }
}`

Android Manifest:
<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"  />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<permission
    android:name="${applicationId}.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<uses-permission android:name="${applicationId}.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>

<permission android:protectionLevel="signature"
            android:name="${applicationId}.permission.C2D_MESSAGE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application android:name=".LSIApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="********" />

    <service android:name="com.parse.PushService" />
    <receiver android:name="com.parse.ParsePushBroadcastReceiver"
              android:exported="false">
        <intent-filter>
            <action android:name="com.parse.push.intent.RECEIVE" />
            <action android:name="com.parse.push.intent.DELETE" />
            <action android:name="com.parse.push.intent.OPEN" />
        </intent-filter>
    </receiver>
    <receiver android:name=".startup.PushBroadcastReceiver"
              android:exported="false">
        <intent-filter>
            <action android:name="com.parse.push.intent.RECEIVE" />
            <action android:name="com.parse.push.intent.DELETE" />
            <action android:name="com.parse.push.intent.OPEN" />
        </intent-filter>
    </receiver>
</application>

Note: The ${applicationId} is 'com.broker.schlisimobile.dev'  and/or 'com.broker.schlisimobile' depending on whether it's a production or developer build.
Here is my custom PushBroadcastReceiver class:
public class PushBroadcastReceiver extends ParsePushBroadcastReceiver {
@Override
protected void onPushOpen(Context context, Intent intent) {
    if ( storyJSONExists(intent) ) {
        if (!DataController.getInstance().getCurrentUser().isGuestUser() ) {
            Intent i = new Intent(context, PushLoadingActivity.class);
            i.putExtras(intent.getExtras());
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);
        } else {
            Intent i = new Intent(context, HomeActivity.class);
            i.putExtra("promptForLogin", true);
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);
            context.startActivity(i);
        }
    } else {
        Intent i = new Intent(context, HomeActivity.class);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);
        i.putExtras(i);
        context.startActivity(i);
    }
}

private boolean storyJSONExists(Intent intent) {
    try {
        String jsonString = intent.getExtras().getString("com.parse.Data");
        JSONObject json = new JSONObject(jsonString);
        if ( json.has("postID") ) {
            return true;
        }
    } catch (JSONException jsonE) {
        jsonE.printStackTrace();
    }
    return false;
}

}

A: In your manifest.xml comment/delete below code,
 <receiver android:name="com.parse.ParsePushBroadcastReceiver"
          android:exported="false">
    <intent-filter>
        <action android:name="com.parse.push.intent.RECEIVE" />
        <action android:name="com.parse.push.intent.DELETE" />
        <action android:name="com.parse.push.intent.OPEN" />
    </intent-filter>
 </receiver>

then add below code in manifest.xml
<receiver
        android:name="com.parse.GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND">
   <intent-filter>
      <action android:name="com.google.android.c2dm.intent.RECEIVE" />
      <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

  <!--IMPORTANT: Change "com.parse.starter" to match your app's package name.-->

        <category android:name="your_application_id" />
   </intent-filter>
 </receiver>

hope it works.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Contour integration of $\int_{0}^{\infty} \frac{\ln{x}}{x^{3 / 4}(1+x)}$ I'm having a little trouble with this one. I recognise that it can be rewritten into the form $$\ln{x} \cdot \frac{x^{1 / 4 - 1}}{1+x}$$ but don't know what to do with $\ln(x)$ that is in the equation.

A: It is easier to remove the branch point through suitable substitutions. By setting $x=z^4$ we get
$$ I = \int_{0}^{+\infty}\frac{\log x}{x^{3/4}(1+x)}\,dx = \int_{0}^{+\infty}\frac{4z^3 \log(z^4)}{z^3(1+z^4)}\,dz = 16\int_{0}^{+\infty}\frac{\log(z)}{1+z^4}\,dz $$
and by splitting the integration range as $(0,1)\cup[1,+\infty)$ and mapping $z$ to $\frac{1}{z}$ in the second interval
$$ I = 16\int_{0}^{1}\frac{\log(z)}{1+z^4}\,dz-16\int_{0}^{1}\frac{z^2\log(z)}{1+z^4}\,dz = 16 \int_{0}^{1}\frac{1-z^2}{1+z^4}\log(z)\,dz $$
Since $\int_{0}^{1}z^k\log(z)\,dz=-\frac{1}{(k+1)^2}$, by the Taylor series of $\frac{1+z^2}{1+z^4}$ we get
$$\begin{eqnarray*} I &=& -16\sum_{k\geq 0}\left(\frac{1}{(8k+1)^2}-\frac{1}{(8k+3)^2}-\frac{1}{(8k+5)^2}+\frac{1}{(8k+7)^2}\right)\\&=&-16\left(\psi'\left(\frac{1}{8}\right)-\psi'\left(\frac{3}{8}\right)-\psi'\left(\frac{5}{8}\right)+\psi'\left(\frac{7}{8}\right)\right)\\&=&-\frac{\pi^2}{4}\left(\frac{1}{\sin^2(\pi/8)}-\frac{1}{\sin^2(3\pi/8)}\right)=\color{red}{-\pi^2\sqrt{2}}\end{eqnarray*}$$
by the trigamma reflection formula.


text:
Q: make a filtre in mysql with case i have a question i have 3 columns id, paydate, paydatefin
SELECT id, paydate, CASE
WHEN paydatefin IS NULL
THEN paydatefin = paydate
ELSE paydatefin
END AS  `paydatefin`
FROM  `ws_crm_comenzi`
WHERE  `sezonId` =  '4'
AND  `service_id` =  '1'
AND  `owner_id` =  '325'
AND  `finished` =  '1'
ORDER BY  `paydatefin` DESC

---------------------------------
|id | paydate    | paydatefin   |
|1  | 2016-08-29 | 2016-08-30   |
|2  | 2016-08-28 | 0000-00-00   |
|3  | 2016-08-28 | 2016-08-29   |

how ca i make a query if paydatefin is null then paydatefin = paydate

A: When paydatefin is NULL then you need to supply paydate in place of that.
But you were doing a comparison e.g. (paydatefin = paydate) would result in 0/1.
Do this instead:
SELECT
    id,
    paydate,
    CASE
    WHEN paydatefin IS NULL THEN paydate
    ELSE    paydatefin END AS `paydatefinColumn`
FROM
    `ws_crm_comenzi`
WHERE
    `sezonId` = '4'
AND `service_id` = '1'
AND `owner_id` = '325'
AND `finished` = '1'
ORDER BY `paydatefinColumn` DESC

EDIT:
SELECT
        id,
        paydate,
        CASE
        WHEN paydatefin IS NULL OR paydatefin = '0000-00-00' THEN paydate
        ELSE    paydatefin END AS `paydatefinColumn`
    FROM
        `ws_crm_comenzi`
    WHERE
        `sezonId` = '4'
    AND `service_id` = '1'
    AND `owner_id` = '325'
    AND `finished` = '1'
    ORDER BY `paydatefinColumn` DESC

A: Ca i do somthing like this ?
SELECT
        id,
        paydate,
        CASE
        WHEN paydatefin IS NULL OR paydatefin = '0000-00-00' THEN paydate
        ELSE    paydatefin END AS `paydatefinColumn`
    FROM
        `ws_crm_comenzi`
    WHERE
        `sezonId` = '4'
    AND `service_id` = '1'
    AND `owner_id` = '325'
    AND `finished` = '1'
    AND YEARWEEK(  `paydatefinColumn` ) = YEARWEEK( CURDATE( ) )
    ORDER BY `paydatefinColumn` DESC


text:
Q: I'm having an issue with appending the output of wmic to a text file I have a batch file that runs when any user logs on to the domain. The batch file gets lots of diffrent information from the users PC and outputs it into a text file on a shared folder.
In part of the batch file i use WMIC to get the Product Name and Serial Number of the PC.
My issue is when i output the Product Name and Serial Number using the below code the font size is massive.
Code
wmic bios get serialnumber >> A:\"%username%".txt
wmic csproduct get name >> A:\"%username%".txt

Output
S e r i a l N u m b e r     *********          N a m e    **********

and when i tried using the following it doesnt work for users with a space in there name  even if i add quotes
EG:
%username% = "Joe blogs" doesnt work
%username% = jblogs works fine

Code
wmic /APPEND:A:\"%username%".txt bios get serialnumber >> nul
wmic /APPEND:A:\"%username%".txt csproduct get name >> nul

So in short i need a way of changing the font of the output or a way of making wmic /append work for users with a space in there name.
If anyone needs more info or needs me to clarify something let me know
Thanks

A: wmic /APPEND:"A:\%username%.txt" bios get serialnumber >> nul

Your quotes are wrong. A: is reserved for floppy drives.


text:
Q: Is there a Swing component for Google Maps? I would like to have support for Google Maps in my Java Swing desktop application. Is there an Google Maps component for Swing that is freely available? It would be good if it was extendable and maybe had support for other maps i.e. like OpenStreetMaps.

A: You can use JXMapViewer
look here
http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html

A: How about JXMapViewer?  Looks like it gets NASA's Blue Marble tile set by default (if you want 3D maps and Blue Marble WorldWindJava is an amazing API for mapping), but also works with OpenStreetMap.  Or, looks like gmap-viewer is a project which can show you how it's done.  Aerith also includes Google maps.
EDIT: Also, check out this related StackOverflow question.  Looks like the FAQ, at least at that time, did not allow you to do what you want with Google Maps (OpenStreetMap, on the other hand, has desktop apps like Traveling Salesman and clearly embraces the desktop, as does WorldWind).

A: You can use Google visualisation library directly in java, where you can show Google Maps as you like.
Google Visualization API Gallery


text:
Q: Does this covariant functor really turn coproducts into products? Let $X$ be a set. Let $\mathrm{Over}(X)$ be the category of sets $A$ with a map $A\to X$; the morphisms are equivariant maps, that is, maps which make the obvious triangle commute.
A map of sets $f\colon X\to Y$ induces a functor $f_*\colon\mathrm{Over}(X)\to\mathrm{Over}(Y)$ by postcomposition. This shows that $\mathrm{Over}$ is a functor from the category of sets to the category of categories (up to usual set theoretic issues which I would like to ignore).
Now let $X=X_1\sqcup X_2$ be a disjoint union, i.e., a coproduct of sets. Every set $\phi\colon A\to X$ gives a pair consisting of a set over $X_1$ and a set over $X_2$. These are the restrictions $\phi^{-1}(X_i)\to X_i$. On the other hand, if you give me a set over $X_1$ and a set over $X_2$, then I can write down a corresponding set over $X$ by just taking the disjoint union.
I think what I just said means that the coproduct decomposition $X=X_1\coprod X_2$ gives a product decomposition of categories $\mathrm{Over}(X)\cong \mathrm{Over}(X_1)\times \mathrm{Over}(X_2)$.
I am confused by the apparent fact that the covariant functor $\mathrm{Over}$ turns coproducts into products. What is happening here?
Edit: As Theo explains in his comment below, the coproduct of categories is just the disjoint union. So it is not a very complicated thing, but also not what we want here---which is really pairs of objects.
Edit: Does the pullback diagram
$$\begin{array}{ccc}
P & \rightarrow & A\\
\downarrow_{f^!(\phi)} & & \downarrow_\phi\\
X & \rightarrow^f &  Y
\end{array}$$
define a wrong-way functoriality for maps $f\colon X\to Y$ which would turn the canonical maps of a coproduct $X_1\sqcup X_2$ to the canonical maps of the product $\mathrm{Over}(X_1)\times \mathrm{Over}(X_2)$? This seems to correspond to Omar's observation.

A: The functor Over is covariant, and you do have that Over(X1∐X2)≅Over(X1)×Over(X2). However, I wouldn't say Over "turns coproducts into products", since that phrase usually
means that additionally the canonical maps Xi→X1∐X2 are sent to the canonical projections Over(X1)×Over(X2)→Over(Xi), and for that, of course, the functor would need to be contravariant.
In this example what is really going on is that Over(X) is equivalent to Fun(X,Set), the category of functors from X to Set (where the set X is regarded as a discrete category, i.e., the category whose objects are the elements of X and that only has identity morphisms). [The equivalence is given by sending f:A→X to the functor that sends an element x in X to its inverse image under f.] Of course, the functor Set→Cat given by Fun(_,Set) is contravariant, and it does turn coproducts into products in the sense I mentioned above. In summary, the covariant functor Over and the contravariant functor Fun(_, Set) agree on objects even though they have opposite variance, and the second turns coproducts into products.
Edit to answer the edit to the question: the pullback does indeed make Over(X) into a contravariant functor which is naturally isomorphic to Fun(_,Set). This is easy to check: if you have an object of Over(Y), say f:A→Y, and a function g:X→Y, then the inverse image of an element x in X under the pullback object of Over(X) is just the preimage of g(x) under f (the definition of pull-back is basically chosen to make this true).


text:
Q: Fatal error: Index out of range in TableView inside ViewController Essentially I have a TableView inside a ViewController called TransferTableView my intention is to have data load from a function called fetchJSON() that populates the tableView with both rows and section for organization.
The issue is I keep getting the error,

Fatal error: Index out of range in TableView inside ViewController.

For the line let section = sections[section] in numberOfRowsInSection I don't understand what is causing this error to appear.

A: When the table appears before loading the data the array is empty and default of numberOfSections is 1
let section = sections[section] // = sections[0]

hence the crash , you fix it by adding
func numberOfSections(in tableView: UITableView) -> Int {
  return sections.count
}

A: add this func in your datasource
func numberOfSections(in tableView: UITableView) -> Int {
  return sections.count
}


text:
Q: Tracking where the script stopped after timeout I've got a shell script doing connection performance test, that I timeout if it takes too long.
Upon timeout, it logs the results of a few commands so I can make myself an idea of the system status at the time of failure. I would like to run some commands depending on which phase of the test it timed-out.
I came up with the following script:
#!/bin/bash
TESTCASE="INITIAL"

function testing()
{
    let TESTCASE="FIRST"
    #do some testing

    let TESTCASE="SECOND"
    #do some testing

    let TESTCASE="THIRD"
    #do some testing
}

function logonerror(){
    if [ "$TESTCASE" = "FIRST" ]; then
       #logging command relevant to first test case
    elif [ "$TESTCASE" = "SECOND" ]; then
       #logging command relevant to second test case
    elif [ "$TESTCASE" = "THIRD" ]; then
       #logging command relevant to third test case
    fi
    #some additional standard logging
}

timeout 7200 cat  <( testing )
if (($? == 124)); then
    logonerror
fi
cleanup

The only issue I have is that it doesn't matter which phase it timed-out, when doing the logging it always think it is at the initial phase.
How can I make sure that the test phase information get correctly updated?

A: Your first problem is:
let TESTCASE="UNSET_INTEGER_VARIABLE_NAME"

let handles math. Assignments made in a let statement will assign integer values. In a shell arithmetic context the FIRST, SECOND, THIRD values you're assigning to $TESTCASE all evaluate to zero because they're considered to be unset variable names - not literal values.
unset FIRST
let TESTCASE=FIRST
echo "$TESTCASE"

0

...or...
FIRST=10
let TESTCASE=FIRST
echo "$TESTCASE"

10

So every assignment you do assigns the same value to $TESTCASE unless any variables named FIRST, SECOND, THIRD, or INITIAL are exported into its environment before it is run.
To assign the string FIRST to the shell variable $TESTCASE you should do:
TESTCASE=FIRST
echo "$TESTCASE"

FIRST

You might also consider case:
logonerror(){
    case $TESTCASE in
    (1)   : logging commands relevant to 1st test case
    ;;
    (2)   : logging commands relevant to 2nd test case
    ;;
    (3)   : logging commands relevant to 3rd test case
    ;;
    esac; : logging commands relevant to all test cases
}
testing()
    case $TESTCASE in
    (1) : do some testing
    ;;
    (2) : do some testing
    ;;
    (3) : do some testing
    ;;
    esac

    trap  cleanup         EXIT
{   trap 'logonerror >&2; exit' PIPE
    for TESTCASE in 1 2 3; do testing; done >&2;:
}|{ read -t 7200; kill -PIPE -0; }


text:
Q: React redux - pushing new item to the state array not working I'm having an issue with adding a new item to the state array variable. In the "CategorySection" component I'm calling .push() to add "new_category" to the "categories" array, but nothing happens, not even an error.
As I try to create a new category by calling "handleAddCategory" which triggers a dispatch for "createCategory", I can see in the Redux DevTools that it has been added to the "item" state once I get the data back from my backend, but then when .push() is called in the "CategorySection" component, as I said before, nothing happens.
It's really weird, because I'm doing the same process in a different part of my project, and there it's working just fine. For example, I create a new Task, and when getting this created task back from my backend, I push it to the items state variable, and then the component gets re-rendered.
Category Reducer
const initialState = {
  items: [],
  item: {},
}

const reducer = (state=initialState, action) => {
  switch(action.type) {
    case GET_CATEGORIES:
      return {
        ...state,
        items: action.payload
      }

    case CREATE_CATEGORY:
      return {
        ...state,
        item: action.payload
      }

    default:
        return state;
  }
};

export default reducer;

Category Actions
export const getCategories = () => {
  return async(dispatch) => {
    const res = await fetch('/api/get-categories/', {
      method: 'GET',
      headers: {
        'X-CSRFToken': getCookie('csrftoken'),
        'Content-Type': 'application/json'
      }
    });
    const data = await res.json();
    dispatch({
      type: GET_CATEGORIES,
      payload: data
    });
  }
}

export const createCategory = (name) => {
  return async(dispatch) => {
    const res = await fetch('/api/manage-category/', {
      method: 'POST',
      headers: {
        'X-CSRFToken': getCookie('csrftoken'),
        'Content-type': 'application/json'
      },
      body: JSON.stringify({'name': name})
    });
    const data = await res.json();
    dispatch({
      type: CREATE_CATEGORY,
      payload: data
    });
  }
}

CategorySection component
Here I'm trying to call .push in the second useEffect, because sumTasks() must be called only when "categories" changes, but unfortunately it's not pushing at all...
import React from 'react'
import CategoryItem from './CategoryItem'
import AddPopover from '../popovers/AddPopover'
import { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { getTasks } from '../../state/action-creators/taskActions';
import { createCategory, setActiveCategory } from '../../state/action-creators/categoryActions';

const CategorySection = () => {
  const dispatch = useDispatch();

  const categories = useSelector((state) => state.category.items);
  const new_category = useSelector((state) => state.category.item);
  const active_category = useSelector((state) => state.category.active);

  const [anchorEl, setAnchorEl] = useState(null);
  const [totalTasks, setTotalTasks] = useState(0);
  const open = Boolean(anchorEl);

  useEffect(() => {
    sumTasks();
  }, [categories])

  useEffect(() => {
    categories.push(new_category);

  }, [new_category])

  function sumTasks() {
    let sum = categories.reduce((total, current) => total = total + current.total_tasks, 0);
    setTotalTasks(sum);
  }

  const onCategoryClick = async (id) => {
    if(active_category != id) {
      await dispatch(setActiveCategory(id));
      await dispatch(getTasks());
    }
  }

  const single_category = categories && categories.map((category) => {
    return(
      <CategoryItem key={category.id} category={category} active_category={active_category} onCategoryClick={onCategoryClick} />
    )
  })

  const handleClick = (event) => {
    setAnchorEl(event.currentTarget);
  };

  const handleClose = () => {
    setAnchorEl(null);
  };

  const handleAddCategory = async (e, value) => {
    if(e.keyCode === 13 && value != '') {
      setAnchorEl(null);
      await dispatch(createCategory(value));
    }
  }

  return (

              Categories

              <svg onClick={handleClick} xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="orange" id="sidebar-add-category"
                className="bi bi-plus-square rename-add-icon category-add-icon global-add-category-icon" viewBox="0 0 16 16">
                <path
                  d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
                <path
                  d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
              </svg>
              <AddPopover
                open={open}
                anchorEl={anchorEl}
                horizontal={30}
                onClose={handleClose}
                placeholder="Enter Category name"
                handlePressEnter={handleAddCategory}
              />

        <li className={`row hovered-nav-item active-category ${active_category == -1 ? "item-selected" : ""}`}>
           onCategoryClick(-1)} className="category-link category-item fs-5 d-flex " id="sidebar-all-tasks" value="-1">

All

            {totalTasks > 0 ? (

{totalTasks}

            ):''}

          {single_category}

  )
}

export default CategorySection

A: I've changed the CREATE_CATEGORY reducer to:
case CREATE_CATEGORY:
      return {
        ...state,
        items: [...state.items, action.payload]
      }


text:
Q: compare models in pymer4 Is there a way in pymer4 (or similar python modules for linear mixed-effects regression models) to compare two different models?
In R, the command anova of the package lme4 does this as follows:
model1 = lmer(DV ~ IV1 + (1|RV), data = data)
model2 = lmer(DV ~ IV1*IV2 + (1|RV), data = data)

anova(model1, model2)

The API page of pymer4 does not seem to mention this. (I could do this in R, but I would rather do it in python, as I'll have to run this test through different groups through a for loop, for which python provides for flexibility.)

A: You can achieve this with rpy2 / rmagic.
Here is an example of a for loop where you are looping over different IVs, creating and fitting a new model, and comparing with the base model using anova.
# set base formula
base_formula = 'Weight ~ 1 + (1+Time|Pig)' # base model
%R -i base_formula -i data m0 <- lmer(base_formula, data=data)

# loop over variables and compare models.
for iv in ["Time", "Start"]:
  m_formula = f'Weight ~ {iv} + (1+Time|Pig)'
  %R -i m_formula -i data m1 <- lmer(m_formula, data=data); print(anova(m0, m1))

To run this example above, you'll need to import the data and set up your r environment which you can do with the code below or with the notebook associated with this tutorial which I wrote to compare the different ways to run LMER in Python.
# Load dataset
import statsmodels.api as sm
data = sm.datasets.get_rdataset('dietox', 'geepack').data
#  Install Rbase and rpy2
# Install R and Rpy2
!apt-get install r-base
!pip install -q rpy2

# Install LMER packages (THIS TAKES ABOUT 3~5 minutes)
packnames = ('lme4', 'lmerTest', 'emmeans', "geepack")
from rpy2.robjects.packages import importr
from rpy2.robjects.vectors import StrVector
utils = importr("utils")
utils.chooseCRANmirror(ind=1)
utils.install_packages(StrVector(packnames))

## Load modules.
%R library(lme4); library(lmerTest)


text:
Q: xpath: find a node that has a given attribute whose value contains a string Is there an xpath way to find a node that has a given attribute whose value contains a given string?
For example I have an xml document and want to find a node where the address attribute contains the string Downing, so that I could find the following node:
<person name="blair" address="10 Downing St. London"/>

A: select="//*[contains(@address,'Downing')]"


text:
Q: How to use foreign-key attribute as error key instead of belongs_to association name? I have two models: a Post and a Comment.
class Post
  has_many :comments
end

class Comment
  belongs_to :post
end

When I try to create a Comment without assigning a Post, I got the following validation errors as expected:
=> {
    :post => [
        [0] "can't be blank"
    ]
}

I'm writing a Rails API and I have a client-side form field named as post_id. When API validation returns, I need to manually map post errors to post_id errors to show them in my form.
Is there a way to map these belongs_to validation errors to the foreign-key attribute (post_id) instead of the association (post) for any belongs_to association in my Rails app?
All I wanted was this object as my error hash:
=> {
    :post_id => [
        [0] "can't be blank"
    ]
}

A: You could add you own validation on post_id:
validates :post_id, presence: true

This will generate an additional error keyed by post_id. The existing error comes from the automatically generated validation based on the association, and you probably shouldn't remove it. You can also, of course, filter / process the error hash however you like, but I'm guessing you're looking for a preferably Rails-only solution without additional logic to maintain.


text:
Q: not able to view foreign key constrain in database i am using symfony 2 and doctrine to create enitity class with a foreign key
here is my entity class , now the issue is when i check the table fos_user in mysql database , i don't see travel_access_token and travel_id as a foreign key and even if i change the value of travel_id in fos_user table database is not raising any issues.
i have one to one unidirectional relation as only one user can have one token only
<?php

namespace Travel\HomeBundle\Entity;

use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /** @ORM\Column(name="facebook_id", type="string", length=255, nullable=true) */
    protected $facebook_id;

    /** @ORM\Column(name="facebook_access_token", type="string", length=255, nullable=true) */
    protected $facebook_access_token;

     /**

     @ORM\Column(name="travel_id", type="string", length=255, nullable=true)
     @ORM\OneToOne(targetEntity="Travel\HomeBundle\Entity\Client")
     @ORM\JoinColumn(name="travel_id", referencedColumnName="id")

     */

    protected $travel_id;

    /**

      @ORM\Column(name="travel_access_token", type="string", length=255, nullable=true)
      @ORM\OneToOne(targetEntity="Travel\HomeBundle\Entity\Client")
      @ORM\JoinColumn(name="travel_access_token", referencedColumnName="secret")

     */

    protected $travel_access_token;

    public function __construct()
    {
        parent::__construct();
        // your own logic
    }

}

?>

A: As "targetEntity" try use just the names of entities. Like this:
 @ORM\OneToOne(targetEntity="Client")


text:
Q: Correctly managing postgresql connections in celery task for Flask-SQLAlchemy and Celery I'm using Flask-SQLAlchemy, Celery and uWSGI.
I know that Flask-SQLAlchemy automatically manages the session for you. I'm not sure how this works with Celery workers, but it seems that when I run a task a second time, I get the following error: DatabaseError: (psycopg2.DatabaseError) server closed the connection unexpectedly.
Here's how I create the app context and celery tasks:
def make_celery(app):
    celery = Celery(
        app.import_name,
        backend=app.config['CELERY_BACKEND'],
        broker=app.config['CELERY_BROKER_URL'],
    )
    celery.conf.update(app.config)
    TaskBase = celery.Task

    class ContextTask(TaskBase):
        abstract = True
        def __call__(self, *args, **kwargs):
            with app.app_context():
                return TaskBase.__call__(self, *args, **kwargs)
    celery.Task = ContextTask
    return celery

It seems that maybe the workers are using the same database connection and after a task completes that connection is not replenished?
It may be related to the following question?
I'm not sure how to correctly setup the workers or celery so that they're using new connections to the database..

A: Okay. I figured it out, for every process that's using an application context, you must use a new application context. Before, in my app/__init__.py I was simply creating the application globally like so:
from flask import Flask
app = Flask(__name__)

I then changed my app to use create_app like in this pattern
Now, my tasks.py looks like this:
from myapp import create_app
from celery import Celery
def make_celery(app=None):
    app = app or create_app()
    celery = Celery(
        app.import_name,
        backend=app.config['CELERY_BACKEND'],
        broker=app.config['CELERY_BROKER_URL'],
    )
    celery.conf.update(app.config)
    TaskBase = celery.Task

    class ContextTask(TaskBase):
        abstract = True
        def __call__(self, *args, **kwargs):
            with app.app_context():
                return TaskBase.__call__(self, *args, **kwargs)
    celery.Task = ContextTask
    return celery

celery = make_celery()

Make sure in your create_app you are calling db.init_app(app).


text:
Q: SQL Replace NULL value from a Dynamic Pivot Table declare @pivotColumn as varchar(max)
declare @pivotTable varchar (max)

--get distinct value for column names join from 3 different tables
select @pivotColumn = string_agg (QUOTENAME(Name),',')
from (
        select distinct Name
        from dbo.DTR
        inner join dbo.Dim_Partner on dbo.DTR.Partner_ID = dbo.Dim_Partner.Partner_ID
        where Project_ID > 0
      )n

set @pivotTable = '
    with ActualDTRProject
            as
            (
                select Project_Name as ProjectName
                    , Name as PartnerName
                    , Hours_Spent as HoursSpent
                from dbo.DTR
                    inner join dbo.Project on dbo.DTR.Project_ID = dbo.Project.ID
                    inner join dbo.Dim_Partner on dbo.DTR.Partner_ID = dbo.Dim_Partner.Partner_ID
                    where Project_ID > 0
            )
            select upper(ProjectName) Project_Name,'+ @pivotColumn +'
            from ActualDTRProject
            pivot (sum(HoursSpent) for PartnerName in ('+ @pivotColumn +')) as d
            order by Project_Name
    '

exec(@pivotTable)
----

Result Table
Result Table:
|ProjectName        |Gab        |Jocelle        |Paul       |Rllamas|
|-------------------|-----------|---------------|-----------|-------|
|Project A          | 8.00      |5.00           |11.00      |5.00   |
|Project B          |10.00      |8.00           |11.00      |7.00   |
|Project C          |NULL       |NULL           |2.00       |6.00   |
|Project D          |NULL       |NULL           |NULL       |2.00   |


text:
Q: Panning the map after trigering click on a marker to open infowindow I have a simple google map v3 with one marker and infowindow attached to it.
if I click the marker, the infowindow shows and map pans automatically to fit the infowindow in the view, however if I try to trigger a click to open the infowindow when the page loads, the infowindow opens but panning does not occur.
Triggering is done like so:
google.maps.event.trigger(marker, 'click');

If I move above code into a function and call it with setTimeout 500, then the panning happens as well.
I dug around in API, but could not find a function to cause auto panning on demand. is there a way without using a timeout? Why does the timeout help?
Thanks
Here's the example that Does not pan:
<!DOCTYPE html>

    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

Here's the one that does pan but only with a timeout:
<!DOCTYPE html>

    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

A: The initializing of the map is not a synchronous process, when you've created the Map-instance it takes some time until all properties of the map are set(so maybe some properties that are needed to determine the position where to pan the map)
When you use a timeout and it works the needed properties are set at this time.
Instead a timeout I would suggest to call the function when the tiles have been loaded, you can be sure that the initializing of the map has been finished at this time:
google.maps.event.addListenerOnce(map, 'tilesloaded', pop);


text:
Q: Use of the word "analyzation" in formal writing What is the consensus on the use of the word "analyzation" in formal writing (ie ...a problem arises in business analyzation...")? One the one hand, some dictionaries, such as Merriam-Webster and Collins, list it as an actual word, although they do not include uses or definitions. On the other hand, it sounds horrendous in use. Am I wrong to advise against its use?

A: I have never heard that form of the word, and I agree it sounds pretty weird. You may just want to use analysis instead.
According to Google ngrams, "analysis" is over 20,000 times more common than "analyzation", which has only been decreasing in popularity for a number of decades now.

A: This seems to be a result of a forced attempt to write everything in technical reports using a prescribed style of academic writing. This often results in a nominalization of verbs.
We analyzed the data ... >> The analyzation of the data was conducted...
If you spend 10 minutes reading the returns from a Google Scholar search of the term, it almost seems fashionable. (Would that make it a fashionalization?)
This nominalization habit has been noticed by others -

*Passive voice encourages nominalizations

  A major problem with passive is that it makes it easier to use abusive
  nominalizations. I'll assume you've been through the lesson that
  discusses nominalizations (lesson 1)...if not, go read that first!
I've read lots of papers with some variation of the phrase "the DNA
  was then subjected to qPCR analysis" or something like that. I rarely
  read the active counterpart, "we subjected the DNA to qPCR analysis".
  Somehow the first (which is even worse than the second) seems
  acceptable. The main problem with this sentence isn't that it's
  passive, it's that it has nominalized the action of the sentence into
  "qPCR analysis." As such, you can fix the problem by fixing the
  nominalization while retaining the passive: "the DNA was then analyzed
  using qPCR." Nevertheless, somehow awkward phrases like these seem
  more abundant in passive sentences.
J Kirkman summarizes this argument fantastically:
If we accept the premise that all scientific papers must be passive and impersonal, inevitably we find ourselves tempted to use these
  'carrier verbs'. If we will not write: 'we sampled the ions from the
  plasma by' 'I removed the coating with alcohol' 'we did not inspect
  the burners regularly'
we can write in simple passive form: 'the ions from the plasma were sampled by' 'the coating was removed with alcohol' 'the burners were
  not inspected regularly'.
But it is tempting to take a further step and expand these statements to: 'ion sampling from the plasma was achieved by' 'removal of the
  coating was effected by the application of alcohol' 'regular
  inspections of the burners were not carried out'.
In taking this extra step we not only change the verb forms from active to passive, but also introduce colourless 'general purpose'
  verbs 'carrying' abstract nouns. We no longer sample, remove and
  inspect; we achieve, effect and carry out. -J Kirkman
This is a serious, serious problem in scientific writing.

https://cgi.duke.edu/web/sciwriting/index.php?action=passive_voice


text:
Q: Como filtrar por criterio de variación entre fechas en SQL Server Espero que alguien me pueda ayudar con el siguiente problema de la vida real =)
Tengo una BBDD "BD_EJEMPLO" y tabla "Ejemplo_Encuestas" en SQL Server que corresponden a encuestas a clientes y tiene los campos:

*

*Id_Encuesta

*Id_Cliente

*Fecha_Encuesta

*Calificacion

*Calificacion_Agrupada

Donde:

*

*Id_Encuesta: Corresponde a un ID único de cada fila.

*Id_Cliente: Es el identificador de cada cliente encuestado y puede
repetirse. Fecha_Encuesta: Fecha en que se efectuó la encuesta.

*Calificacion: Puntaje relacionado a la encuesta que varía de 0 a 10
donde 0 es malo y 10 es bueno.

*Calificacion_Agrupada: Agrupamiento del campo anterior "Calificacion"
para tener solo 3 criterios donde "A" es bueno y corresponde a los
puntajes 9 y 10, "B" es regular y corresponde a los puntajes 7 y 8 y
"C" malo y corresponde a los puntajes desde el 0 hasta el 6.

Lo que se quiere marcar "SI"/"NO" en un campo adicional "Variacion_Negativa" aquellos "Id_Cliente" que en el tiempo disminuyeron en su Calificación"/"Calificacion_Agrupada".
Por decir algunos ejemplos:

*

*Si un cliente tiene tiene 02 encuestas con calificaciones de mas reciente a mas antiguo {"C";"A"} entonces en la nueva columna debería marcarse como un "SI" ya que disminuyó de "A" a "C".

*Otro cliente {"B";"B";"B";"A"} tiene 04 encuestas, tiene calificación "B" desde hace un tiempo, pero en algún momento fué "A", entonces también debe marcarse como "SI".

*Otro cliente {"A";"A";"A"} siempre tuvo la misma calificación entonces debe marcarse como un "NO".

*Otro cliente {"A";"B";"C"} Actualmente es "A" y antes era "B" varió hacia mejor, debe marcarse como un "NO" ya que solo buscamos aquellos que varían hacia menos.

*Otro {"C"} tiene una sola encuesta, entonces es "NO" ya que no hay variación.
En resumen:
Lo que se busca es marcar en la nueva columna con "SI", SOLO aquellas variaciones a menos comparando la encuesta mas reciente contra la anterior o si la anterior es igual con la variación mas reciente, teniendo en cuenta que el cliente ha tenido mas de una encuesta.
O de lo contrario obtener una nueva tabla con solo aquellos clientes "Id_Cliente" que cumplan con el criterio requerido.
Gracias de antemano a quien pueda ayudarme :)

Una base ejemplo sería:
USE [master]
GO /****** Object: Database [BD_EJEMPLO] Script Date: 10/23/2018 17:09:22 ******/
CREATE DATABASE [BD_EJEMPLO] ON PRIMARY (NAME = N'BD_EJEMPLO', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\BD_EJEMPLO.mdf', SIZE = 3072 KB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024 KB) LOG ON (NAME = N'BD_EJEMPLO_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\BD_EJEMPLO_log.ldf', SIZE = 1024 KB, MAXSIZE = 2048 GB, FILEGROWTH = 10 %)
GO
ALTER DATABASE [BD_EJEMPLO] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
BEGIN
  EXEC [BD_EJEMPLO].[dbo].[sp_fulltext_database] @action = 'enable'
END
GO
ALTER DATABASE [BD_EJEMPLO] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET ANSI_NULLS OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET ANSI_PADDING OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET ARITHABORT OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [BD_EJEMPLO] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [BD_EJEMPLO] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [BD_EJEMPLO] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET DISABLE_BROKER
GO
ALTER DATABASE [BD_EJEMPLO] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [BD_EJEMPLO] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [BD_EJEMPLO] SET READ_WRITE
GO
ALTER DATABASE [BD_EJEMPLO] SET RECOVERY FULL
GO
ALTER DATABASE [BD_EJEMPLO] SET MULTI_USER
GO
ALTER DATABASE [BD_EJEMPLO] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [BD_EJEMPLO] SET DB_CHAINING OFF
GO
USE [BD_EJEMPLO]
GO /****** Object: Table [dbo].[Ejemplo_Encuestas] Script Date: 10/23/2018 17:09:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Ejemplo_Encuestas] (
  [Id_Encuesta] nvarchar NULL,
  [Id_Cliente] nvarchar NULL,
  [Fecha_Encuesta] [datetime] NULL,
  [Calificacion] [float] NULL,
  [Calificacion_Agrupada] nchar NULL
) ON [PRIMARY]
GO
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E1183422', N'15152222', CAST(0x0000A72401166F4C AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E2761000', N'15887888', CAST(0x0000A85800BD68AC AS datetime), 4, N'C ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E6111502', N'10005922', CAST(0x0000A8A800153EAC AS datetime), 0, N'C ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E4370063', N'10005922', CAST(0x0000A82000551DD8 AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E9213303', N'10014760', CAST(0x0000A97600984B1C AS datetime), 7, N'B ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E4968314', N'10014760', CAST(0x0000A851003F5F70 AS datetime), 8, N'B ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E3809315', N'10014760', CAST(0x0000A7F001316220 AS datetime), 9, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E2585759', N'10014760', CAST(0x0000A78D00D082E8 AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E5003484', N'10036018', CAST(0x0000A856005B00E0 AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E3310246', N'10036018', CAST(0x0000A7C800DB2784 AS datetime), 9, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E5160256', N'10050175', CAST(0x0000A863005BE7BC AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E970395', N'10050175', CAST(0x0000A714010E4A88 AS datetime), 1, N'C ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E8777911', N'10096264', CAST(0x0000A95900AB2994 AS datetime), 9, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E4271133', N'10096264', CAST(0x0000A81800A64BE0 AS datetime), 5, N'C ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E3149569', N'10096264', CAST(0x0000A7BA00F92F04 AS datetime), 6, N'C ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E4287335', N'10148833', CAST(0x0000A8190034D244 AS datetime), 8, N'B ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E2761406', N'10148833', CAST(0x0000A79A00909A5C AS datetime), 9, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E6504352', N'32676535', CAST(0x0000A8C500B623BC AS datetime), 8, N'B ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E5028381', N'32676535', CAST(0x0000A85800BD68AC AS datetime), 9, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E3912375', N'32676535', CAST(0x0000A7FA00999A44 AS datetime), 10, N'A ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E2398215', N'32676535', CAST(0x0000A78000C927B4 AS datetime), 7, N'B ')
INSERT [dbo].[Ejemplo_Encuestas] ([Id_Encuesta], [Id_Cliente], [Fecha_Encuesta], [Calificacion], [Calificacion_Agrupada])
  VALUES (N'E1183763', N'32676535', CAST(0x0000A72401166F4C AS datetime), 8, N'B ')

A: Entonces lo que buscas es la variación de la calificación de cada encuesta con relación a la encuesta anterior por cliente.
Algo como esto:
;
WITH CTE AS (
    SELECT  E1.*,
        ROW_NUMBER() OVER (PARTITION BY Id_Cliente ORDER BY Fecha_Encuesta DESC) AS RN
        FROM Ejemplo_Encuestas E1
)
SELECT  T1.Id_Encuesta,
    T1.Id_Cliente,
    T1.Fecha_Encuesta,
    T1.Calificacion_Agrupada,
    CASE WHEN ISNULL(T2.Calificacion_Agrupada, T1.Calificacion_Agrupada) < T1.Calificacion_Agrupada
        THEN 'SI'
        ELSE 'NO'
    END AS 'Variacion'
    FROM CTE T1
    LEFT JOIN CTE T2
        ON T1.Id_Cliente = T2.Id_Cliente
        AND T1.RN = T2.RN - 1
    ORDER BY T1.Id_Cliente, T1.Fecha_Encuesta DESC

Comentarios:

*

*Usamos una "common table expression" válido a partir de SQL2008

*Básicamente generamos un número de orden para cada cliente y con ese dato, por cada fila buscamos la calificación inmediatamente anterior y hacemos la comparación

*Si solo tiene una calificación comparamos con la misma

Salida:
╔═════════════╦════════════╦══════════════════════════╦═══════════════════════╦═══════════╗
║ Id_Encuesta ║ Id_Cliente ║ Fecha_Encuesta           ║ Calificacion_Agrupada ║ Variacion ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E6111502    ║ 10005922   ║ 19/03/2018 01:17:21 a.m. ║ C                     ║ SI        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E4370063    ║ 10005922   ║ 03/11/2017 05:09:54 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E9213303    ║ 10014760   ║ 11/10/2018 09:14:29 a.m. ║ B                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E4968314    ║ 10014760   ║ 22/12/2017 03:50:44 a.m. ║ B                     ║ SI        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E3809315    ║ 10014760   ║ 16/09/2017 06:31:52 p.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E2585759    ║ 10014760   ║ 09/06/2017 12:39:10 p.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E5003484    ║ 10036018   ║ 27/12/2017 05:31:20 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E3310246    ║ 10036018   ║ 07/08/2017 01:17:55 p.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E5160256    ║ 10050175   ║ 09/01/2018 05:34:37 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E970395     ║ 10050175   ║ 08/02/2017 04:24:06 p.m. ║ C                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E8777911    ║ 10096264   ║ 12/09/2018 10:23:11 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E4271133    ║ 10096264   ║ 26/10/2017 10:05:28 a.m. ║ C                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E3149569    ║ 10096264   ║ 24/07/2017 03:07:15 p.m. ║ C                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E4287335    ║ 10148833   ║ 27/10/2017 03:12:19 a.m. ║ B                     ║ SI        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E2761406    ║ 10148833   ║ 22/06/2017 08:46:29 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E1183422    ║ 15152222   ║ 24/02/2017 04:53:45 p.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E2761000    ║ 15887888   ║ 29/12/2017 11:29:37 a.m. ║ C                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E6504352    ║ 32676535   ║ 17/04/2018 11:03:09 a.m. ║ B                     ║ SI        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E5028381    ║ 32676535   ║ 29/12/2017 11:29:37 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E3912375    ║ 32676535   ║ 26/09/2017 09:19:15 a.m. ║ A                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E2398215    ║ 32676535   ║ 27/05/2017 12:12:23 p.m. ║ B                     ║ NO        ║
╠═════════════╬════════════╬══════════════════════════╬═══════════════════════╬═══════════╣
║ E1183763    ║ 32676535   ║ 24/02/2017 04:53:45 p.m. ║ B                     ║ NO        ║
╚═════════════╩════════════╩══════════════════════════╩═══════════════════════╩═══════════╝

Por último, si solo quieres comparar la última encuesta con la anterior inmediata, puedes hacer:
;
WITH CTE AS (
    SELECT  E1.*,
        ROW_NUMBER() OVER (PARTITION BY Id_Cliente ORDER BY Fecha_Encuesta DESC) AS RN
        FROM Ejemplo_Encuestas E1
)
SELECT  T1.Id_Encuesta,
    T1.Id_Cliente,
    T1.Fecha_Encuesta,
    T1.Calificacion_Agrupada,
    CASE WHEN ISNULL(T2.Calificacion_Agrupada, T1.Calificacion_Agrupada) < T1.Calificacion_Agrupada
        THEN 'SI'
        ELSE 'NO'
    END AS 'Variacion'
    FROM CTE T1
    LEFT JOIN CTE T2
        ON T1.Id_Cliente = T2.Id_Cliente
        -- Solo comparamos la última
        AND T1.RN = T2.RN - 1
    WHERE T1.RN = 1
    ORDER BY T1.Id_Cliente, T1.Fecha_Encuesta DESC


text:
Q: Separate definitions of decimal number and word in ANTLR grammar I'm working on defining a grammar in ANTLR4 which includes words and numbers separately.
Numbers are described:
 NUM
   : INTEGER+ ('.' INTEGER+)?
   ;

fragment INTEGER
   : ('0' .. '9')
   ;

and words are described:
WORD
   : VALID_CHAR +
   ;

fragment VALID_CHAR
   : ('a' .. 'z') | ('A' .. 'Z')
   ;

The simplified grammar below describes the addition between either a word or a letter (and needs to be defined recursively like this):
expression
   :  left = expression '+' right = expression #addition
   |  value = WORD #word
   |  value = NUM #num
   ;

The issue is that when I enter 'd3' into the parser, I get a returned instance of a Word 'd'. Similarly, entering 3f returns a Number of value 3. Is there a way to ensure that 'd3' or any similar strings returns an error message from the grammar?
I've looked at the '~' symbol but that seems to be 'everything except', rather than 'only'.
To summarize, I'm looking for a way to ensure that ONLY a series of letters can be parsed to a Word, and contain no other symbols. Currently, the grammar seems to ignore any additional disallowed characters.
Similar to the message received when '3+' is entered:
simpleGrammar::compileUnit:1:2: mismatched input '<EOF>' expecting {WORD, NUM}

At present, the following occurs:
d --> (d) (word) (correct)

22.3 --> (22.2) number (correct)

d3 --> d (word) (incorrect)

22f.4 --> 22 (number) (incorrect)

But ideally the following would happen :

d --> (d) (word) (correct)

22.3 --> (22.2) number (correct)

d3 --> (error)

22f.4 --> (error)

A: [Revised to response to revised question and comments]
ANTLR will attempt to match what it can in your input stream in your input stream and then stop once it's reached the longest recognizable input.  That means, the best ANTLR could do with your input was to recognize a word ('d') and then it quite, because it could match the rest of your input to any of your rules (using the root expression rule)
You can add a rule to tell ANTLR that it needs to consume to entire input, with a top-level rule something like:
root: expression EOF;

With this rule in place you'll get 'mismatched input' at the '3' in 'd3'.
This same rule would give a 'mismatched input' at the 'f' character in '22f.4'.

That should address the specific question you've asked, and, hopefully, is sufficient to meet your needs.  The following discussion is reading a bit into your comment, and maybe assuming too much about what you want in the way of error messages.
Your comment (sort of) implies that you'd prefer to see error messages along the lines of "you have a digit in your word", or "you have a letter in you number"
It helps to understand ANTLR's pipeline for processing your input.  First it processes your input stream using the Lexer rules (rules beginning with capital letters) to create a stream of tokens.
Your 'd3' input produces a stream of 2 tokens with your current grammar;
WORD ('d')
NUM ('3')

This stream of tokens is what is being matched against in your parser rules (i.e. expression).
'22f.4' results in the stream:
NUM ('22')
WORD ('f')
(I would expect an error here as there is no Lexer rule that matches a stream of characters beginning with a '.')

As soon as ANTLR saw something other than a number (or '.') while matching your NUM rule, it considered what it matched so far to be the contents of the NUM token, put it into the token stream and moved on.  (similar with finding a number in a word)
This is standard lexing/parsing behavior.
You can implement your own ErrorListener where ANTLR will hand the details of the error it encountered to you and you could word you error message as you see fit, but I think you'll find it tricky to hit what it seems your target is.  You would not have enough context in the error handler to know what came immediately before, etc., and even if you did, this would get very complicated very fast.
IF you always want some sort of whitespace to occur between NUMs and WORDs, you could do something like defining the following Lexer rules:
BAD_ATOM: (INTEGER|VALID_CHAR|'.')+;

(put it last in the grammar so that the valid streams will match first)
Then when a parser rule errors out with a BAD_ATOM rule, you could inspect it and provide an more specific error message.
Warning: This is a bit unorthodox, and could introduce constraints on what you could allow as you build up your grammar.  That said, it's not uncommon to find a "catch-all" Lexer rule at the bottom of a grammar that some people use for better error messages and/or error recovery.


text:
Q: curl / soap request with .p12 SSL certificate I need to SOAP request https://address?wsdl which require .p12 certificate using PHP7.2.
After hours of reasearch only thing I was able to do is making this request from bash:
$ curl -k -E cert.crt.pem --key cert.key.pem https://address?wsdl
which retured WSDL. But I had to split .p12 to separate files and use -k option which makes all this stuff not secure.
Split done by this commands:
openssl pkcs12 -in mycert.p12 -out cert.key.pem -nocerts -nodes
openssl pkcs12 -in mycert.p12 -out cert.crt.pem -clcerts -nokeys

The question is:
How to request this WSDL using cURL from PHP or how to configure new \SoapClient() so it will work?
Is this possible having only .p12 file & password? Or I have to convert it?

Hope this describe what I already was able to do:
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_VERBOSE, true);

/**
 * cert.p12 (with password) -> cert.pem (contains encrypted PKey & client ?unencrypted? cert)
 * $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts
 *
 * Result:
 *
 * This works. But:
 * - I don't have peer verification
 * - Is such file safe? It has encrypted pkey & certificate (I think not encrypted).
 *   I don't know much about that topic. Maybe someone with more experience will be able to tell more.
 *   Maybe some better solution to output this. Maybe as 2 separate files?
 */
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); // DO NOT VERIFY!
curl_setopt($ch,CURLOPT_SSLCERT,__DIR__ . '/cert.pem');
//curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $pass); // This is not required :/
curl_setopt($ch,CURLOPT_SSLKEY,__DIR__ . '/cert.pem');
curl_setopt($ch,CURLOPT_SSLKEYPASSWD, $pass);

/**
 * cert.p12 (with password) -> cert.pem (contains encrypted PKey & client ?unencrypted? cert)
 * $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts
 *
 * Result:
 *
 * TCP_NODELAY set
 * Connected to XXX
 * ALPN, offering http/1.1
 * SSL certificate problem: self signed certificate in certificate chain
 * stopped the pause stream!
 * Closing connection 0
 */
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true);
curl_setopt($ch,CURLOPT_SSLCERT,__DIR__ . '/cert.pem');
curl_setopt($ch,CURLOPT_SSLKEY,__DIR__ . '/cert.pem');
curl_setopt($ch,CURLOPT_SSLKEYPASSWD, $pass);

/**
 * cert.p12 (with password) -> cert.pem (contains encrypted PKey & client ?unencrypted? cert)
 * $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts
 *
 * Result:
 *
 * TCP_NODELAY set
 * Connected to XXX
 * ALPN, offering http/1.1
 * ignoring certificate verify locations due to disabled peer verification
 * error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
 * stopped the pause stream!
 * Closing connection 0
 */
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_CAINFO,__DIR__ . '/cert.pem');
curl_setopt($ch,CURLOPT_CAPATH,__DIR__);
curl_setopt($ch,CURLOPT_KEYPASSWD,$pass);

/**
 * cert.p12 (with password) -> cert.pem (contains encrypted PKey & client ?unencrypted? cert)
 * $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts
 *
 * Result:
 *
 * TCP_NODELAY set
 * Connected to XXX
 * ALPN, offering http/1.1
 * successfully set certificate verify locations:
 *   CAfile: /www/soap/cert.pem
 *   CApath: /www/soap
 * SSL certificate problem: self signed certificate in certificate chain
 * stopped the pause stream!
 * Closing connection 0
 */
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch,CURLOPT_CAINFO,__DIR__ . '/cert.pem');
curl_setopt($ch,CURLOPT_CAPATH,__DIR__);
curl_setopt($ch,CURLOPT_KEYPASSWD,$pass);

$data = curl_exec($ch);

$error = curl_error($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

var_dump($data, $httpcode, $error);
?>

A: I was not able to use .p12, .pfx, pkcs12 directly is SOAP.
First we need to read p12 file and convert it to .pem. Later you can cache result ($pemCertContent) to avoid conversion each request or store it as file to use as filepaths.
    $readSuccessful = openssl_pkcs12_read($content, $certData, $password);
    if (!$readSuccessful) {
        $msg = sprintf('Could not read pkcs12 file `%s`: `%s`.', $filePath, openssl_error_string());
        throw new \Exception($msg);
    }

    $pemCertContent = '';

    if (isset($certData['pkey'])) {
        openssl_pkey_export($certData['pkey'], $pem, $pemPassword);
        $pemCertContent .= $pem;
    }
    if (isset($certData['cert'])) {
        openssl_x509_export($certData['cert'], $cert);
        $pemCertContent .= $cert;
    }

    $pemCertContent; // This is your .pem certificate content. I store it as a file.

Depending on need you can use it like this when creating SOAP client:
    $soapOptions = [
        /* In some cases, when you have 2 certificates you may need to use stream context instead of 'local_cert'
        'stream_context' => stream_context_create([
            'ssl' => [
                'cafile' => $caCert->getFilePath(), // CA Certificate
                'local_cert' => $tlsCertificate->getFilePath(), // PEM certificate
                'passphrase' => $tlsCertificatePass, // Pass for PEM certificate
            ],
        ]),
         */
        'local_cert' => $tlsCertificate->getFilePath(),
        'passphrase' => $tlsCertificatePass,

        'trace' => true,
        'exceptions' => true,
    ];

This allows to connect to SoapServer to get wsdl and do request. In my case I also have to sign whole request body with WSSE. To do it I use this with .p12 cert opened by openssl_pkcs12_read function:
RobRichards\WsePhp\WSSESoap;
RobRichards\XMLSecLibs\XMLSecurityKey;

But this is another story.


text:
Q: Using Int32 with PythonNet in Python 3 Everything works fine in Python 2, but in Python 3, it doesn't work. I installed the package using the whl from Gohlke's Python packages. The problem is, in Python 3, all integers are long. When passed to a C# function, they're passed as 64 bit integers, which causes functions that take Int32 as an argument to fail with the error "No method matches given arguments". I tried to convert it to Int32 with Convert.ToInt32(), but that returns a Python int, which is 64 bit again.
So, the question is, how do I use Int32 properly in Python3?
Oh, and when I tried it like this it did an OverflowError:
>>> print(Int32(2))
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    print(Int32(2))
OverflowError: value too large to convert

A: Unint32 or Int32 need to be loaded from System:
import clr
clr.AddReference("System")
from System import UInt32, Int32

print(UInt32(2))
print(Int32(2))


text:
Q: gridfstemplate.store(in, url, fileType, metadata); is not storing contentType  DBObject metadata = new BasicDBObject();
        metadata.put("contentType", "application/pdf");
String fileType = "application/pdf";
int counter=0;
 try (BufferedInputStream in = new BufferedInputStream(new URL(url).openStream(), e)) {
                ObjectId uploaded = gridFsTemplate.store(in, url, fileType, metadata);
                System.out.println(++counter+":"+uploaded.toHexString());

            } catch (Exception e) {
                log.error("Error in loading file url["+url+"]");
                e.printStackTrace();
            }

I am passing ContentType as both method argument[fileType] and inside metadata a field called contentType.

*

*However, inside mongo gridfs contentType is empty.


text:
Q: Exceptions quitting the sample application I'm still following the still following the Getting Started version 0.9.
When I run the sample application, and I quit it, the following exception are reported in console:
Stopping JavaFX Application "MyApplication 1.0.0-SNAPSHOT"...
Exception in thread "FelixStartLevel" java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = FelixStartLevel
        at com.sun.glass.ui.Application.checkEventThread(Application.java:443)
        at com.sun.glass.ui.MenuItem.setEnabled(MenuItem.java:108)
        at com.sun.javafx.tk.quantum.GlassSystemMenu.lambda$insertMenuItem$347(GlassSystemMenu.java:261)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:103)
        at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
        at javafx.beans.property.BooleanPropertyBase.access$000(BooleanPropertyBase.java:49)
        at javafx.beans.property.BooleanPropertyBase$Listener.invalidated(BooleanPropertyBase.java:245)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:349)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:103)
        at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
        at javafx.beans.property.BooleanPropertyBase.access$000(BooleanPropertyBase.java:49)
        at javafx.beans.property.BooleanPropertyBase$Listener.invalidated(BooleanPropertyBase.java:245)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:176)
        at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:51)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:72)
        at org.drombler.commons.action.fx.AbstractFXAction$EnabledProperty.set(AbstractFXAction.java:122)
        at org.drombler.commons.action.fx.AbstractFXAction$EnabledProperty.access$100(AbstractFXAction.java:110)
        at org.drombler.commons.action.fx.AbstractFXAction.setEnabled(AbstractFXAction.java:87)
        at org.drombler.commons.action.fx.ActionListenerAdapter.lambda$new$0(ActionListenerAdapter.java:36)
        at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:328)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:303)
        at org.drombler.commons.action.AbstractActionListener.setEnabled(AbstractActionListener.java:54)
        at org.drombler.acp.core.standard.action.data.file.impl.OpenFilesAction.setFileChooserProvider(OpenFilesAction.java:75)
        at org.drombler.acp.core.commons.util.SimpleServiceTrackerCustomizer.removedService(SimpleServiceTrackerCustomizer.java:37)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
        at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
        at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
        at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
        at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
        at org.apache.felix.framework.Felix.access$000(Felix.java:105)
        at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:419)
        at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
        at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:908)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:873)
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:139)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:950)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:805)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:787)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:579)
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:706)
        at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:523)
        at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:452)
        at org.apache.felix.scr.impl.Activator.access$300(Activator.java:54)
        at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:306)
        at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)
        at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)
        at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
        at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516)
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2600)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1389)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)
Exception in thread "FelixStartLevel" java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = FelixStartLevel
        at com.sun.glass.ui.Application.checkEventThread(Application.java:443)
        at com.sun.glass.ui.MenuItem.setEnabled(MenuItem.java:108)
        at com.sun.javafx.tk.quantum.GlassSystemMenu.lambda$insertMenuItem$347(GlassSystemMenu.java:261)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:103)
        at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
        at javafx.beans.property.BooleanPropertyBase.access$000(BooleanPropertyBase.java:49)
        at javafx.beans.property.BooleanPropertyBase$Listener.invalidated(BooleanPropertyBase.java:245)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:349)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:103)
        at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
        at javafx.beans.property.BooleanPropertyBase.access$000(BooleanPropertyBase.java:49)
        at javafx.beans.property.BooleanPropertyBase$Listener.invalidated(BooleanPropertyBase.java:245)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:176)
        at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:51)
        at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:72)
        at org.drombler.commons.action.fx.AbstractFXAction$EnabledProperty.set(AbstractFXAction.java:122)
        at org.drombler.commons.action.fx.AbstractFXAction$EnabledProperty.access$100(AbstractFXAction.java:110)
        at org.drombler.commons.action.fx.AbstractFXAction.setEnabled(AbstractFXAction.java:87)
        at org.drombler.commons.action.fx.ActionListenerAdapter.lambda$new$0(ActionListenerAdapter.java:36)
        at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:328)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:303)
        at org.drombler.commons.action.AbstractActionListener.setEnabled(AbstractActionListener.java:54)
        at org.drombler.acp.core.standard.action.data.file.impl.OpenFilesAction.setFileChooserProvider(OpenFilesAction.java:75)
        at org.drombler.acp.core.commons.util.SimpleServiceTrackerCustomizer.removedService(SimpleServiceTrackerCustomizer.java:37)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:870)
        at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
        at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
        at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
        at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
        at org.apache.felix.framework.Felix.access$000(Felix.java:105)
        at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:419)
        at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
        at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:908)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:873)
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:139)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:950)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:805)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:787)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:579)
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:706)
        at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:523)
        at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:452)
        at org.apache.felix.scr.impl.Activator.access$300(Activator.java:54)
        at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:306)
        at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)
        at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)
        at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
        at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516)
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2600)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1389)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)

After the error messages and before the last one (Stopped JavaFX Application "MyApplication 1.0.0-SNAPSHOT") the application is blocked for a while (a minute, ore or less).
Claudio

A: This seems to be an issue when running on Mac.
Please file an issue.


text:
Q: tensorflow retrain model file im getting started with tensorflow und using retrain.py to teach it some new categories - this works well - however i have some questions:
In the comments of retrain.py it says:
"This produces a new model file that can be loaded and run by any TensorFlow
program, for example the label_image sample code"
however I havent found where this new model file is saved to ?
also: it does contain the whole model, right ? not just the retrained part  ?
Thanks for clearing this up

A: 1)I think you may want to save the new model.
When you want to save a model after some process, you can use
saver.save(sess, 'directory/model-name', *optional-arg).
Check out https://www.tensorflow.org/api_docs/python/tf/train/Saver
If you change model-name by epoch or any measure you would like to use, you can save the new model(otherwise, it may overlap with previous models saved).
You can find the model saved by searching 'checkpoint', '.index', '.meta'.
2)Saving the whole model or just part of it?
It's the part you need to learn bunch of ideas on tf.session and savers. You can save either the whole or just part, it's up to you. Again, start from the above link. The moral is that you put the variables you would like to save in a list quoted as 'var_list' in the link, and you can save only for them. When you call them back, you now also need to specify which variables in your model correspond to the variables in the loaded variables.

A: While running retrain.py you can give --output_graph and --output_labels parameters which specify the location to save graph (default is /tmp/output_graph.pb) and the labels as well. You can change those as per your requirements.


text:
Q: PIXI Webgl memory leak Hi I am using PIXI and I am destroying textures whenever necessary. I am seeing that in the chrome task manager, the image cache and other resources are consuming very less memory. My only problem is with the new screens and textures getting loaded, the GPU memory increases (Like 5-10 mb on every activity). I am using texture.destroy(true) to destroy resources. I am also destroying base textures. I am also logging PIXI.utils.TextureCache and PIXI.utils.BaseTextureCache and I am seeing that the number of objects in these are bare minimum required for my app.
I am also making use of PIXI Animated Sprite. If it consumes any extra resources which I should be worried about, please let me know.
I am not sure where the webgl memory is increasing. I am using webgl because I make extensive usage of filters which is not possible using canvas renderer. Can any one help on how do I debug the memory usage and delete unnecessary textures from webgl. I am running on a tight timeline, so any help is very much appreciated.


text:
Q: Missing "rel" in Spring HATEOAS HAL responses I am looking at the HAL links which are returned by Spring HATEOAS. The links look like
"_links" : {
"self" : {
  "href" : "http://localhost:8765/data-service/dataObjects"
},
"profile" : {
  "href" : "http://localhost:8765/data-service/profile/dataObjects"
},
"search" : {
  "href" : "http://localhost:8765/data-service/dataObjects/search"
}

They seem to be missing "rel" in favor of the link name. My question is: are the links in HATEOAS response  weblinks?  If they are they, must be compliant with RFC 5988. According to it "rel" is not optional.

A: The document returned is compliant with the HAL spec.
See http://stateless.co/hal_specification.html for spec and examples.


text:
Q: In MVC 4 my textarea is not resetting from default value I've created a MVC project with Browse button and upload button. When the user clicks on Browse and select a file and click upload, the file contents has to be displayed in a Textarea. By default when I load the page, I'm displaying default text in textarea. Once the user uploads a file, I'm trying to display the contents in that textarea.
Problem is while I'm trying to reset the content, the textarea is not getting reset. Any help is really appreciated.
View:-
@model DigitalUnderwritingFacade.Models.DigitalUnderwritingModel

DigitalUnderwriting

    @using (Html.BeginForm())
    {

                Upload a json file : <input type="file" id="btnbrowse" name="browse" value="Browse">

                <input type="button" id="btnfileUpload" name="btnfileUpload" value="Upload" />

Please browse a valid json file

                @Html.TextAreaFor(model => model.JsonText, new { @class = "form-control", cols = "120", rows = "45", @id = "textarea" })

                <input type="submit" id="Savebtn" value="Save">

    }

Controller:-

 DigitalUnderwritingModel model = new DigitalUnderwritingModel();
        private string InputJsonPath = System.Configuration.ConfigurationManager.AppSettings["DefaultJson"].ToString();
        private string ResponseJsonPath = System.Configuration.ConfigurationManager.AppSettings["JsonResponsesPath"].ToString();
        //
        // GET: /DigitalUnderwriting/

        public ActionResult Index()
        {
            StreamReader reader = new StreamReader(InputJsonPath);
            if (TempData["ResponseJson"] == null)
            {
                model.JsonText = reader.ReadToEnd();
            }
            else
            {
                model.JsonText = TempData["ResponseJson"].ToString();
                TempData["ResponseJson"] = null;
            }
            return View(model);
        }

        [HttpPost]
        public ActionResult Upload()
        {
            ModelState.Remove("JsonText");
            var streamfile = new StreamReader(Request.Files[0].InputStream);
            var streamline = string.Empty;
            while((streamline = streamfile.ReadLine()) != null)
            {
                model.JsonText += streamline;
            }
            TempData["ResponseJson"] = model.JsonText;
            return RedirectToAction("Index");
        }

Model:-

 [DataType(DataType.MultilineText)]
 public string JsonText { get; set; }

A: Try this, my friend. I think you dont need set id for Textarea.
$("#btnfileUpload").click(function () {
    var formData = new FormData();
    var totalFiles = document.getElementById("btnbrowse").files.length;
    var browsedFile = document.getElementById("btnbrowse").files[0];
    var fileextension = browsedFile.name.split('.').pop();

    if (totalFiles == 0)
        $("#validateSelectedFile").show()
    else{
        $('#JsonText').html(browsedFile.name); //set name file
        if (fileextension == 'json') {
            formData.append("FileUpload", browsedFile);
            $.ajax({
                type: "POST",
                url: '/DigitalUnderwriting/Upload',
                data: formData,
                contentType: false,
                processData: false,
                success: function (result) { }
            });
        }
        else {
            alert("Please select a valid json file.");
        }
    }
});

        [HttpPost]
        public ActionResult Upload()
        {
            TempData["ResponseJson"] = model.JsonText;
            ModelState.Remove("JsonText");
            var streamfile = new StreamReader(Request.Files[0].InputStream);
            var streamline = string.Empty;
            while((streamline = streamfile.ReadLine()) != null)
            {
                model.JsonText += streamline;
            }

            return RedirectToAction("Index");
        }


text:
Q: What is $\mathbb{Z}^*_2$ What is $\displaystyle{\mathbb{Z}^*_2}$?
Do I understand correctly it's the odd numbers?  It would appear it includes both positive and negative.
$\displaystyle{\mathbb{Z}^*_2}=2\mathbb{Z}-1$
Sorry - to clarify.  I was told $\mathbb{Z}_p^*$ is the group of units of the ring of p-adics, and that this meant the set of numbers not divisible by $p$.
So this question is to test whether I understand correctly.  The explanation given would seem to imply that $\mathbb{Z}_2^*$ is the set of 2-adic integers not divisible by $2$, so the odd numbers.  Is the explanation given to me incorrect, or did I misinterpret it?
Thanks in advance.

A: For any prime $p$, the $p$-adic integers can be thought of as a sequence of integers $\alpha=\{a_0,a_1,\cdots\}$ satisfying $a_n\equiv a_{n-1}\pmod {p^n}$ for all $n≥1$.
These form a ring under component-wise addition and multiplication.  We'll call that ring $\mathbb Z_p$.
With $p=2$, your question is equivalent to:
Claim:  $\alpha$ is a unit in $\mathbb Z_p$ if and only if $a_0\not \equiv 0 \pmod p$.
Proof:
Suppose $\alpha$ is a unit. Then there is a $p$-adic integer $\beta=\{b_n\}$ with $\alpha\times \beta =1 $ In particular we have $a_0\times b_0\equiv 1 \pmod p$ so $a_0$ can't be divisible by $p$.
Now suppose that $a_0 \not \equiv 0 \pmod p$.  Then we can find $b_0$ with $a_0\times b_0\equiv 1 \pmod p$. By the definition of the $p$-adic integers we know that $a_i\not \equiv 0 \pmod p\;\forall i$ as well, so we can always solve $a_n\times b_n\equiv 1 \pmod {p^{n+1}}$ and it is easy to see that the $b_n$ so constructed define a $p$-adic integer $\beta$ with $\alpha \times \beta =1$.

A: Generally, we denote
$$\mathbb Z_n:=\mathbb Z/n\mathbb Z,$$
and when $A$ is a ring,
$$A^\times:=\{a\in A,\ a\text{ is invertible in }A\}.$$
So
$$\mathbb Z_n^\times=\{k\in \mathbb Z/n\mathbb Z, \ \gcd(k,n)=1\}.$$
In your case,
$$\mathbb Z_2^\times=\{k\in \mathbb Z/2\mathbb Z, \ \gcd(k,2)=1\}=\{1\}.$$


text:
Q: How to upgrade omnibus gitlab 7.2.1? Im really confused because Gitlab is using different names of their product. So there exist "Gitlab", "Gitlab CE, "Gitlab CI", "Gitlab Omnibus" and "Gitlab paid"
I found some correct documentation as I think for my gitlab version.
Via help page i found out that gitlab which im running at my server got the version GitLab 7.2.1 ff1633f
I failed at this step:
Install the latest package

# Ubuntu/Debian:
sudo dpkg -i gitlab_x.x.x-omnibus.xxx.deb

# CentOS:
sudo rpm -Uvh gitlab-x.x.x_xxx.rpm

root@debian:~# sudo dpkg -i gitlab_x.x.x-omnibus.xxx.deb
dpkg: Fehler beim Bearbeiten von gitlab_x.x.x-omnibus.xxx.deb (--install):
 Auf das Archiv kann nicht zugegriffen werden: Datei oder Verzeichnis nicht gefunden
Fehler traten auf beim Bearbeiten von:
 gitlab_x.x.x-omnibus.xxx.deb
root@debian:~#

What to do now? Im not an linux expert, just started with it.

A: The error indicates that the file you want to install is not found. You have to download the file first and then exchange the x to the downloaded version. I would suggest you follow the steps described on https://gitlab.com/gitlab-org/omnibus-gitlab/blob/7-7-stable/doc/update.md for the update steps itself.
You can always find the latest stable omnibus version to download on https://about.gitlab.com/downloads/ but follow the  update document first
There are two major kinds: OpenSource/Community edition and the paid Enterprise Edition you have to subscribe to. The Enterprise version is based on the free version and comes with some additional features (compare them here.

*

*Gitlab is generically used term for the git server. References the most times the CE version.

*Gitlab CE is the OpenSource Gitlab Server Community Edition

*Gitlab CI is basically an add-on for gitlab adding Continous Integration option to the basic Gitlab Server (gitlab CI seems to be part of the the Omnibus installer)

*"Gitlab paid": I have never heard this phrasing, I would assume it is "Gitlab EE"

*Gitlab EE (not reference by you) is the paid Enterprise Edition you have to subscribe to. It come with some additional non-free features.

*"Gitlab Omnibus" is a in my opinion unlucky chosen phrasing. It indicates that the Omnibus installer is used.

In the past installation was always manual requiring multiple steps. The current recommended way is the installation of Gitlab (EE as well as CE) with the Omnibus installer. It basically requires only 3 steps: install package, edit configuration file, tell gitlab to add this new configuration.


text:
Q: How to make a subclass @Entity? i'm a new for spring boot.
i found @Entity can make a class to db,and it works.
//tTicker.java
@Entity
public class tTicker {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private  String currencyPair;
    private  BigDecimal open;
    private  BigDecimal last;

    ......
}

//tTickerRepository.java
public interface tTickerRepository extends CrudRepository<tTicker,Long> {
}

//tService.java
tTicker tt = new tTicker();
        tt.setCurrencyPair(ticker.getCurrencyPair().toString());
        tt.setOpen(ticker.getOpen());
        tt.setLast(ticker.getLast());

        ttickerRepository.save(tt);

but when i extends this class,only current field store to db.
//aTicker.java
@Entity
public class aTicker extendstTicker {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

}

//tTicker.java
@Entity
public class tTicker {
    private  String currencyPair;
    private  BigDecimal open;
    private  BigDecimal last;

    ......
}

how can i do? thank you for your help.
https://github.com/xchao0213/aitrader

A: Since your question is related to JPA entities, you should take a look at the JPA documentation (not spring boot).
You need to annotate your super/base class with @MappedSupperClass:
//tTicker.java
@MappedSupperClass
public class tTicker {
    private  String currencyPair;
    private  BigDecimal open;
    private  BigDecimal last;

    ......
}

//aTicker.java
@Entity
public class aTicker extends tTicker {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

}

Take a look at @MappedSupperClass documentation:
https://docs.oracle.com/javaee/7/api/javax/persistence/MappedSuperclass.html