text:
Q: Isomorphism between $\operatorname{Stab_G(x)}$ and $S_{n-1}$ Consider the group $G = S_n$ acting on $X = \left\{1,2,...n \right\}$.  Let $x=n$.  How many elements does the stabilizer $\operatorname{Stab_G(x)}$ have?  To what group is this stabilizer isomorphic?
Attempt:  There is $(n-1)!$  elements in $\operatorname{Stab_G(x)}$.  There exists an isomorphism $\phi$ such that $\phi : \operatorname{Stab_G(x)} \rightarrow S_{n-1}$, however, what is the simplest way to prove this?  Clearly, the sets have the same size so that is not an issue (in terms of bijectivity) and I have checked some cases, but I can't see how to prove it in general, which I think would be equivalent to finding an explicit homomorphism $\operatorname{Stab_G(x)} \rightarrow S_{n-1}$
Is it correct to say that $\operatorname{Stab_G(x)} \leq G$ acts trivially on the set $X$?  If so, I thought about considering the bijection $f_g : X \rightarrow X$, given by $f_g(x) = g \cdot x = x,\,\, g \in \operatorname{Stab_G(x)}$ which I think is a homomorphism from $\operatorname{Stab_G(x)}$ to some symmetric group (since this group is finite and $f_g \in \operatorname{bij}(X) = S_{|X|}),$ but I am unsure
Many thanks.

A: Maybe it's a good idea to think permutations as bijections of finite sets. In other words, $S_n$ is the group of bijections of the set $\{1,\ldots,n\}$ with composition as operation.
Let $\eta\in Stab_G(x)\subseteq S_n$ be such a bijection. Note that
the map
$$
\begin{array}{rccc}
\Phi(\eta):&\{1,\ldots,n-1\}&\longrightarrow&\{1,\ldots,n-1\}\\
 &a&\longmapsto&\eta(a)
\end{array}
$$
is a bijection and therefore $\Phi(\eta)\in S_{n-1}$. Then $\Phi:Stab_G(x)\rightarrow S_{n-1}$ is the isomorphism you are looking for. To see that it indeed is an isomorphism you can try to construct its inverse, which should send
$\psi$ to the map $\widetilde{\psi}$ given by $\widetilde{\psi}(a)=\psi(a)$ if $a\in\{1,\ldots,n-1\}$ and $\widetilde{\psi}(a)=n$ if $a=n$.

A: Or; you can use the Orbit-Stablizer Equation. Moerover to @A. Bellmunt's way, when you want to show two permutation groups are isomorphic, you have to consider additional points there. See 1.

A: If you write the elements that fix $n$ in cycle notation, you will notice that these are precisely the elements that do not contain the symbol $n$ in any of your cycles (when simplified of course).
So the isomorphism should be clear.

A: For every $x\in X:=\{1,\dots,n\}$, set $Y:=X\setminus\{x\}$. Then, $\operatorname{Stab}(x)\stackrel{\varphi}{\cong} S_Y$ via $\sigma\mapsto\varphi(\sigma):=\sigma_{|Y}$. In fact:

*

*injectivity: $\varphi(\sigma)=\varphi(\tau)\Longrightarrow \sigma_{|Y}=\tau_{|Y}\stackrel{\sigma(x)=x=\tau(x)}{\Longrightarrow}\sigma=\tau$;

*surjectivity: for any given $f\in S_Y$, define $\sigma\in S_n$ by $(\sigma(x):=x) \wedge (\sigma_{|Y}:=f)$; therefore, $\sigma\in\operatorname{Stab}(x)$ and $\varphi(\sigma)=f$;

*operation-preserving: for $y\in Y$:
\begin{alignat}{1}
(\sigma\tau)(y) &= \sigma(\tau(y)) \\
&\stackrel{y\in Y}{=}\sigma(\tau_{|Y}(y)) \\
&\stackrel{\tau_{|Y}(y)\in Y}{=}\sigma_{|Y}(\tau_{|Y}(y)) \\
&=(\sigma_{|Y}\tau_{|Y})(y) \\
\end{alignat}
On the other hand, $y\in Y\Longrightarrow (\sigma\tau)(y)=(\sigma\tau)_{|Y}(y)$. Therefore:
$$\varphi(\sigma\tau)=(\sigma\tau)_{|Y}=\sigma_{|Y}\tau_{|Y}=\varphi(\sigma)\varphi(\tau)$$
Now, note that $|Y|=n-1$, and hence $S_Y\stackrel{\phi}{\cong} S_{n-1}$ for $\phi(f):=\mathscr gf\mathscr g^{-1}$, where $\mathscr g\colon Y\longrightarrow \{1,\dots,n-1\}$ is any bijection. So, finally, for every $x\in X$:
$$\operatorname{Stab}(x)\stackrel{\phi\varphi}{\cong} S_{n-1}$$


text:
Q: Efficient way to check if value is present in a dataframe with some conditions I have a pretty large dataframe (20M rows) containing workers. Some of the workers appear multiple times, given they might have previously worked in other firms. For each worker, I have information about first, last name (columns: first_name, last_name) and the starting date of each job (started_working_date). I'd like to create a new column in the dataframe (past_experience) that flags workers that were previously employed (in any firm).
In order to do so, I have to check whether, for each worker in my dataframe, there is a row (in the same dataframe) with the same first and last name and a earlier starting date than the one considered.
The dataframe looks like this:
   first_name  last_name started_working_date
0  Bob         J         1995-01-01
1  John        S         2000-01-01
1  Mark        L         2001-01-01
1  Bob         J         1997-01-01

The ideal result should be:
   first_name  last_name  started_working_date  past_experience
0  Bob         J          1995-01-01            0
1  John        S          2000-01-01            0
1  Mark        L          2001-01-01            0
1  Bob         J          1997-01-01            1

I tried to write a very simple apply function that filters the dataframe according to my conditions and returns 0 or 1 depending on the length of the resulting dataframe.
def past_experience(row):
    filtered_df = my_df[(my_df['first_name'] == row['first_name']) & (my_df['last_name'] == row['last_name']) & (my_df['started_working_date'] < row['started_working_date'])]
    if filtered_df.shape[0]>0:
        return 1
    else:
        return 0

my_df['past_experience'] = my_df.apply(past_experience, axis=1)

This works, but it is extremely inefficient. Could you suggest a better solution?

A: I am using numpy broadcast , notice this method still a o(n*n) check , which mean if you data frame is big, memory will exceed.
s1=my_df['first_name'].values
s2=my_df['last_name'].values
s3=my_df['started_working_date'].values

np.any((s1==s1[:,None])&(s2==s2[:,None])&(s3<s3[:,None]),1)

A: Try:
groups = df.groupby(['first_name','last_name'])
df['employed'] = groups.started_working_date.cumcount()

df['employed_shift'] = groups.employed.shift().fillna(0)

df['employed_changed'] = (df['employed'] != df['employed_shift'])

And output:
+---+------------+-----------+----------------------+----------+----------------+
|   | first_name | last_name | started_working_date | employed | employ_changed |
+---+------------+-----------+----------------------+----------+----------------+
| 0 | Bob        | J         | 1995-01-01           |        0 | False          |
| 1 | John       | S         | 2000-01-01           |        0 | False          |
| 1 | Mark       | L         | 2001-01-01           |        0 | False          |
| 1 | Bob        | J         | 1997-01-01           |        1 | True           |
+---+------------+-----------+----------------------+----------+----------------+

redpajama_set_name: RedPajamaStackExchange


text:
Q: mapping semaphore memory values about the sensors in the Android NDK - C/embed Does the Android NDK expose the values generated by the sensors in pre-defined portions of memory so i can do something like this
T* ptr = 0x124

?
It's this possible and it's this being standardized by the Android team ?

A: No.  And it's pretty inconceivable that they would do this.
The NDK keeps you much more isolated from the hardware than even a typical C-on-unix environment would, both mandatorily due to the security model, and also advisably due to the major variability of these details between the numerous Android versions and vendors.


text:
Q: Retrieve email ID instead of name Below coding retrieves all the information from .msg files. However, when it retrieve the email ID of sender and received, it is reflecting name instead of email ID. Please assist me and advise as to what changes are required to display the email ID instead of name.
Dim MyOutlook As Outlook.Application

Dim Msg As Outlook.MailItem
Dim x As Namespace
Dim Row As Integer
Dim Path As String
Set MyOutlook = New Outlook.Application
Set x = MyOutlook.GetNamespace("MAPI")
Path = "C:\Users\USERNAME\Desktop\My working\Macro\New folder\Ilearn - Grp 1\"

FileList = GetFileList(Path + "*.msg")
Row = 1

While Row <= UBound(FileList)

    Set Msg = x.OpenSharedItem(Path + FileList(Row))

    Sheet2.Cells(Row + 1, 1) = Msg.Subject
    Sheet2.Cells(Row + 1, 2) = Msg.Sender
    Sheet2.Cells(Row + 1, 3) = Msg.CC
    Sheet2.Cells(Row + 1, 4) = Msg.To
    Sheet2.Cells(Row + 1, 5) = Msg.SentOn
    Row = Row + 1
Wend


text:
Q: How to print Hello World in assembly? I downloaded the library file which is Irvine32, then I create my assembly program in Visual Studio empty project. I'm new to assembly language. Below is my code.
.386

.model flat, stdcall

.stack 4096

ExitProcess PROTO, dwExitCode:DWORD
INCLUDE Irvine32.inc
.data
msg  db "Hello again, World!",0
.code

main Proc

    INVOKE ExitProcess, 0
main ENDP
END main

A: Example code below for a Windows console program using Visual Studio's native library rather than the Irvine library. Visual Studio 2015 and later versions inline printf into the compiled code, normally requiring a C source file with main(), but this can be avoided by using legacy library (which includes scanf, printf, ... ).
Visual Studio may not setup a default build for .asm files. In this case, right click on the .asm file name in the solution explorer windows, then properties. Set excluded from build to no, item type to custom build tool, and apply. Then from custom build tool window, using x.asm as the name of the file:
command line:  ml /c /Zi /Fo$(OutDir)\x.obj x.asm
...
output file:   $(OutDir)\x.obj

Do this for both debug and release builds. For release builds, the /Zi is not needed:
command line:  ml /c /Fo$(OutDir)\x.obj x.asm

Example code:
        .686p                   ;enable instructions
        .xmm                    ;enable instructions
        .model flat,c           ;use C naming convention (stdcall is default)

;       include C libraries
        includelib      msvcrtd
        includelib      oldnames
        includelib      legacy_stdio_definitions.lib    ;for scanf, printf, ...

        .data                   ;initialized data
msg     db      "Hello again, World!",00dh,00ah,000h    ;added CR, LF to msg

        .data?                  ;uinitialized data

        .stack  4096            ;stack (optional, linker will default)

        .code                   ;code
        extrn   printf:near
        public  main

main    proc
        push    offset msg
        call    printf
        add     esp,4
        xor     eax,eax
        ret
main    endp

        end


text:
Q: Problem ins getting notification by urbanAirShip I have used UrbanAirShip for APNS ,before today i was receiving notification regularly .but today I am not able to receive notification though urbanAir displays message the " Okay, we sent that message."
but I am not getting that on device
please help


text:
Q: Federating user access to AWS Console/CLI My company has a Active Directory on Premise and we want to federate employees into AWS console/CLI by authenticating against it. There are multiple ways of doing this over VPN or direct connect and I have came across two of them
1) using ADFS and 2) using AWS AD connector.. Which one should be used for which use case and when. pros and cons of each?

A: This is a complex subject and my answer just touches upon highlights of integrating Active Directory into your Amazon Cloud environment. The best answer depends on your particular networking needs.
For simple Active Directory integration, AD Connector is a good fit. For complex needs which include SAML or custom applications, ADFS is required.
AD Connector is used to extend Active Directory from your data center into your Amazon Cloud so that Amazon services can use Active Directory. AD Connector supports sign in to Amazon applications such as WorkSpaces, WorkDocs and WorkMail. AD Connector allows your Amazon EC2 Windows instances to join your Active Directory Domain. Joining Linux instances to Active Directory is also supported (Amazon Linux, Red Hat Enterprise, Ubuntu Server, CentOS). AD Connector can also provide federated sign-in to the AWS Management Console by mapping Active Directory identities to AWS Identity and Access Managment (IAM) roles.
ADFS is a Microsoft service added to Active Directory to provide SAML based federation. With SAML you can use single sign-on (SSO) to sign in to all of your SAML enabled applications by using a single set of credentials.
If you want to your Active Directory users to be able to get temporary credentials (Cognito) then you need ADFS. AD Connector does not support this.
AD Connector cannot be used with custom applications and can only be used for secure AWS integration for 1) sign in to AWS applications; 2) Join Windows (and Linux) instances to Active Directory; 3) provide federated sign-in to the AWS Management Console.
ADFS is far more complicated to setup but offers more features for identity management and federation with both Amazon services and custom applications. Once setup correctly, your Active Directory Domain and the Amazon Console are tightly integrated.
I recommend watching one of the Amazon Deep Dive videos on Integrating Active Directory.


text:
Q: factoring a neighborhood of identity in a compact connected Lie group with a closed Lie subgroup Given a closed Lie subgroup of a compact and connected Lie group, it seems plausible to me that there exists such a neighborhood of identity in the original Lie group that it can be written as the product of the aforementioned closed Lie subgroup and the image of the exp map restricted to the complement of the Lie algebra corresponding to the closed Lie subgroup.
While I suspect it follows from some basic facts in the theory of Lie groups and Lie algebras, I am not sure how to go about proving it. In fact, additional assumptions might be needed to make the statement rigorous. For example, perhaps the complement in the Lie algebra needs be orthogonal with respect to an appropriately invariant inner product?
Could anyone offer some guidance as to how to make sense of my intuitive and possibly naive thinking? Thanks!

A: Given $H \subseteq G$ a closed Lie subgroup with corresponding Lie algebras $\mathfrak{h} \subseteq \mathfrak{g}$, let $\mathfrak{k}$ be a vector complement to $\mathfrak{h}$ in $\mathfrak{g}$ (note that $\mathfrak{k}$ is not required to be even a subalgebra), and define $f: \mathfrak{g} \to G$ by
$$ f(u + v) = \exp(u)\exp(v)$$
where $u \in \mathfrak{h}$ and $v \in \mathfrak{k}$. Then as $\mathfrak{g} = \mathfrak{h} \oplus \mathfrak{k}$, the derivative of $f$ at 0 will be the identity map, and thus there are neighborhoods $U$ and $V$ of $0$ in $\mathfrak{h}$ and $\mathfrak{k}$ respectively such that $f: U \times V \to f(U \times V)$ will be a diffeomorphism, and $f(U \times V) = \exp(U)\exp(V) \subseteq G$ will be open.
Now, this may be the neighborhood you want (since $f(V)$ may intersect $H$), but if you desire, a contradiction argument may be used to show that $V$ may be shrunk to a smaller neighborhood $V'$ of zero such that $f(V') \cap H = 1$. Here, we must use that $\mathfrak{k}$ is a vector complement to $\mathfrak{h}$.


text:
Q: How to create Drop Down list of widget in Flutter? I'd like to implement a Drop Down button that open a list of other Card. For example, what happens when we click on "Campionati Appuntati" in these screenshoots:

How could I code this in Flutter?
EDIT: I found ExpansionPanelList that could help me, but I don't know how to code expansionCallback field
ExpansionPanelList(
        children: [
          ExpansionPanel(
              headerBuilder: (context, isExpanded) {
                return ListTile(
                  title: Text('Click To Expand', style: TextStyle(color: Colors.white),),
                );
              },
              body:ListTile(
                title: Text('Description text',style: TextStyle(color: Colors.black)),
                tileColor: Colors.white,
              ),
            backgroundColor: Colors.green
          ),
        ],
        expansionCallback: (panelIndex, isExpanded) {

        },
  )

A: You can create a state bool to handle expand mode.
class EXTEst extends StatefulWidget {
  EXTEst({Key? key}) : super(key: key);

  @override
  State<EXTEst> createState() => _EXTEstState();
}

class _EXTEstState extends State<EXTEst> {
  bool _isExpanded = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          ExpansionPanelList(
            children: [
              ExpansionPanel(
                  isExpanded: _isExpanded,
                  headerBuilder: (context, isExpanded) {
                    return ListTile(
                      title: Text(
                        'Click To Expand',
                        style: TextStyle(color: Colors.white),
                      ),
                    );
                  },
                  body: ListTile(
                    title: Text('Description text',
                        style: TextStyle(color: Colors.black)),
                    tileColor: Colors.white,
                  ),
                  backgroundColor: Colors.green),
            ],
            expansionCallback: (panelIndex, isExpanded) {
              debugPrint(isExpanded.toString());
              setState(() {
                _isExpanded = !isExpanded;
              });
            },
          ),
        ],
      ),
    );
  }
}

More about ExpansionPanel


text:
Q: When does $n-2$ divide $2(n+1)(n-1)$ The question is in the title, where $n$ is an integer $\geq 4$.
I first tried to solve it by saying $n-2$ divides $2$, or $n+1$, or $n-1$. Then one finds $n=4,5$. But then I realized that there may be other solutions (for example $n=8$) whenever $n-2$ is not prime.
So, what is the good method to solve it?

A: $$\frac{2(n-1)(n+1)}{n-2}=\frac{2(n^2-4+3)}{n-2}=2(n+2)+\frac{6}{n-2},$$
which says $$n-2\in\{\pm6,\pm2,\pm3,\pm1\}$$ and with $n\geq4$ we can get all values of $n$.

A: It is much easier if you mark $k=n-2$ and then ask when $k$ divide $2(k+1)(k+3) = 2k^2+8k+6$. Now this is clearly iff $k\mid 6$...


text:
Q: How can I use core graphics framework functionality from a launch daemon in a macOS? I need to receive notifications about number of monitors plugged in to the Mac laptop from my launch daemon (written in C++). In particular I'm using CGDisplayRegisterReconfigurationCallback function and some others (see below).
If I implement it in my launch daemon, it works in a kinda strange way. Most times it works OK, but sometimes crashes the daemon with SIGABRT and weird callstacks.
I did some research and it turns out that I can't use certain frameworks from a launch daemon.
The question is then, how can I call that CGDisplayRegisterReconfigurationCallback function, along with CGMainDisplayID, CGGetActiveDisplayList, CGDisplayIsActive, etc that are needed for the functionality of my app? Any suggestions?


text:
Q: Device-side enqueue causes CL_OUT_OF_RESOURCES I have a program utilizing OpenCL 2.0 because I want to take advantage of device-side enqueue. I have a test program that performs the following tasks on the host side:

*

*Allocates 16 kilobytes of floating point memory on the device and zeros it out.

*Builds the OpenCL program below, and creates a kernel of masterKernel()

*Sets the first argument of masterKernel() (heap) to the allocated memory in step 1

*Enqueues that masterKernel() via clEnqueueNDRangeKernel() with a work_dim of 1 and a global work size of 1. (So it only runs once, with get_global_id(0) always being zero)

*Reads the memory back into the host and displays it.

Here is the OpenCL code:
//This function was stripped down to nothing for testing purposes.
kernel void childKernel(global float* heap)
{
}

//Enqueues the child kernel.
kernel void masterKernel(global float* heap)
{
    ndrange_t ndRange = ndrange_1D(16);   //Arbitrary, could be any number.

    if(get_global_id(0) == 0)
    {
         enqueue_kernel(get_default_queue(), 0, ndRange,
            ^{ childKernel(heap); });
    }
}

The program builds successfully. However, when I try to run masterKernel(), The call to enqueue_kernel() here causes the host side call to clEnqueueNDRangeKernel() to fail with an error code of CL_OUT_OF_RESOURCES. OpenCL's documentation says enqueue_kernel() should return CL_SUCCESS or CL_ENQUEUE_FAILURE depending on if the block enqueues successfully or not. It does not say that clEnqueueNDRangeKernel() itself should fail. Here are some other things I've tried:

*

*Commenting out the call to enqueue_kernel() causes the program to succeed.

*Adding a line that sets heap[0] to any number causes the host-side program to reflect that change. So I know that it's not a problem with how I'm feeding the arguments in

*Modifying the if statement so that it reads something impossible like if(get_global_id(0) == 6000) still causes the error. This tells me that the error is not caused by enqueue_kernel() executing (I verified get_global_size(0) == 1), but merely that it exists in the program at all.

*Modifying the if statement to if(0) does make the error not happen.

*Making it so childKernel() actually does something does not make the error go away.

I am not really sure what to try next. I know my device supports OpenCL 2.0. My device is an AMD Radeon R9 380 graphics card. I do not have access to any other OpenCL 2.0 capable hardware to test it on.

A: I ended up figuring this one out. This issue happened because I did not create a device-side queue (one with the flags of CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT).


text:
Q: Problem with sysdepends while checking dependencies I have this script to list all dependencies of all views in a database . I get the dependencies in the right order when I use sysdepends ,but I am missing a few dependencies while using sysdepends. When I use
SYS.sql_expression_dependencies instead. it runs forever . I don't know what's wrong with the code. Some one please help.
;WITH dependencies
AS (
    select distinct procs.NAME AS ViewName ,OBJDEP.NAME as Depends ,sch.name as schemaname
FROM   TEMPLATE_TEST.SYS.sql_expression_dependencies a
        INNER JOIN TEMPLATE_TEST.sys.objects OBJ ON a.referencing_id = OBJ.OBJECT_ID
        INNER JOIN TEMPLATE_TEST.sys.objects OBJDEP ON a.referenced_id = OBJDEP.OBJECT_ID
        inner join   TEMPLATE_TEST.sys.views procs  on a.referencing_id = procs.object_id
        inner join TEMPLATE_TEST.sys.schemas sch on sch.schema_id=procs.schema_id
        where OBJDEP.type='V' AND OBJ.type='V'

    ),
no_dependencies
AS (
           SELECT  obj.NAME AS ViewName,sch.name as schemaname

       FROM TEMPLATE_TEST.sys.objects OBJ
       inner join TEMPLATE_TEST.sys.schemas sch on sch.schema_id=obj.schema_id

       WHERE  NOT exists (SELECT 1 FROM dependencies k where obj.name=k.ViewName and sch.name=k.schemaname)
      AND OBJ.type in('v')

    ),
recursiv
AS (
    SELECT ViewName AS [SP]
        , CAST('' AS VARCHAR(max)) AS DependsON
        , 0 AS LVL
        ,schemaname
    FROM no_dependencies

    UNION ALL

    SELECT d.ViewName AS [SP]

        ,CAST( d.Depends AS VARCHAR(max))
        , R.lvl + 1 AS LVL
        ,d.schemaname
    FROM dependencies d
    INNER JOIN recursiv r
        ON d.Depends = r.[SP]
    )

SELECT  DISTINCT *  FROM recursiv  ORDER BY LVL


text:
Q: White text on white background in tablet version I cannot see what's wrong with my layout. In Phone it shows black text in a white background. But in the tablet version, it is all white.
I don't want to set textColor to each TextView.
Here is my layout for StepMasterActivity (it's a raw design yet):
layout/activity_step_master.xml:
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.github.alexpfx.udacity.nanodegree.android.baking_app.step.StepMasterActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"/>

    </android.support.design.widget.AppBarLayout>

    <FrameLayout
        android:id="@+id/step_master_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        >

    </FrameLayout>

</android.support.design.widget.CoordinatorLayout>

layout-sw600dp/activity_step_master.xml:
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.github.alexpfx.udacity.nanodegree.android.baking_app.step.StepMasterActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"/>

    </android.support.design.widget.AppBarLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    >

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:alpha="250"
        android:background="@color/colorAccent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        >

            <fragment
                android:id="@+id/step_list_fragment"
                android:name="com.github.alexpfx.udacity.nanodegree.android.baking_app.step.master.steps.StepListFragment"

                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"
                />
        </FrameLayout>

        <View
            android:layout_width="1dp"
            android:layout_height="match_parent"
            android:layout_marginBottom="10dp"
            android:layout_marginTop="10dp"
            android:background="?android:attr/listDivider"
            />

        <FrameLayout
            android:id="@+id/step_master_container"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"

            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            />

    </LinearLayout>

</android.support.design.widget.CoordinatorLayout>

the layout below is same for tablet and phone version:
item_ingredient.xml  (Ingredients recyclerview)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal">

    <TextView
        android:id="@+id/text_ingredient"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left|start"
        android:gravity="left|center_vertical"
        android:paddingLeft="@dimen/padding_internal_views"
        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
        tools:text="Nutella or other chocolate-hazelnut spread"
        />

</LinearLayout>

item_step.xml (Steps recycler view)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

    <ImageView
        android:id="@+id/image_has_video"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:padding="@dimen/padding_internal_views"
        android:src="@drawable/ic_videocam_black_24dp"
        android:visibility="invisible"
        />

    <TextView
        android:layout_toRightOf="@id/image_has_video"
        android:id="@+id/text_step_short_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:padding="@dimen/padding_internal_views"
        android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Subtitle"
        tools:text="Finish filling prep"

        />

    <TextView
        android:layout_below="@+id/image_has_video"
        android:id="@+id/text_step_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left|start"
        android:gravity="left|center_vertical"
        android:padding="@dimen/padding_internal_views"
        android:textAppearance="@style/TextAppearance.AppCompat.Medium"

        />

</RelativeLayout>

StepMasterActivity and StepListFragment: Sorry, I cannot attend the SO demand for format, so I create gists:
StepMasterActivity:
https://gist.github.com/alexpfx/2138e7e17cb519b5499b0285f1c0a323
StepListFragment:
https://gist.github.com/alexpfx/e44b5709712fbf601a33f7bb9f80f9e8

colors.xml:
    <?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="primary_text">#212121</color>
    <color name="secondary_text">#757575</color>
    <color name="white">#FFF</color>
</resources>

styles.xml:

    <resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

</resources>


text:
Q: AFNetworking call getting delay always for api call i am calling afnetworking api call, every time its getting more delay nearly more than 10 to 15 sec.Only for this api call. Here is my code at below.
Is there any option to use dispatch to get the response data between 3 to 5 sec atleast.
My code :
self.myclass.GetArraryfromURL(urlstring, inviewController: self, Withhud: false, completionHandler:{(jsonObject:NSArray,Stats:Bool) in

  NSLog("jsonObject=%@", jsonObject);
}})

func GetArraryfromURL(_ urlstring: String,inviewController viewController:UIViewController,Withhud check:Bool,completionHandler:@escaping (_ jsonObject:NSArray,_ Stats:Bool) -> Void)
    {
        if AFNetworkReachabilityManager.shared().isReachable
        {
//            HUD = MBProgressHUD()
//            let encodestr = urlstring.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)! as String;
            let encodestr = urlstring.addingPercentEncoding( withAllowedCharacters: .urlQueryAllowed)
            if check == true
            {
                self.createhudinview(viewController, value:true)
            }
            print(urlstring)
            let manager = AFHTTPSessionManager();
            manager.responseSerializer = AFHTTPResponseSerializer()
            manager.get(encodestr!, parameters: nil, success:{(task,responseObject) -> Void in
                print("JSON: %@", responseObject);

                do {

                    if check == true
                    {
                        self.createhudinview(viewController, value:false)
                    }
                    let jsonResults = try JSONSerialization.jsonObject(with: (responseObject as! NSData) as Data, options:JSONSerialization.ReadingOptions.mutableContainers) as! NSDictionary

                    print("status:%@",jsonResults.value(forKey: "result"))

                    let copyarr = jsonResults.value(forKey: "result") as? NSArray;

                    let flag = true // true if download succeed,false otherwise
                    completionHandler(copyarr ?? [],flag);

                    // success ...
                } catch {
                    // failure

                    if check == true
                    {
                        self.createhudinview(viewController, value:false)
                    }
                    let flag = false // true if download succeed,false otherwise
                    completionHandler(NSArray(),flag);

                    self.ShowsinglebutAlertwithTitle(self.StringfromKey("WCi"), withAlert:self.StringfromKey("errorinretrive"), withIdentifier:"error")
                }

                }, failure:{(task,error) -> Void in
                    print("Error: %@", error);
                    if check == true
                    {
                        self.createhudinview(viewController, value:false)
                    }
                    let flag = false // true if download succeed,false otherwise
                    completionHandler(NSArray(),flag);
                    self.ShowsinglebutAlertwithTitle(self.StringfromKey("WCi"), withAlert:self.StringfromKey("errorinretrive"), withIdentifier:"error")
            })
        }
        else
        {
            let flag = false // true if download succeed,false otherwise
            completionHandler(NSArray(),flag);
            self.ShowsinglebutAlertwithTitle(self.StringfromKey("WCi"), withAlert:self.StringfromKey("Check your connection"), withIdentifier:"internet")

        }
    }

Now its getting delay for 10 t0 15 sec. But i need to make it atleast 5 sec . Not sure, how can i do that. I tried with dispatch async but i could't make it.
Any possibilities.Thanks in advance !!


text:
Q: initializing basic stack, but errors i do not comprehend i am trying to initialize a basic stack - with push, and pop function.
the problems comes in while testing. you will notice in the code that i have pushed 2 times, so a print of the stack should display [5,5] whereas it is displaying None. I could tinker with the code to make it work eventually, but then i will not fully understand the underlying concepts and the error of my ways. so i ask for advice and pointers.
please check out these codes and tell me what i am doing wrong.
this is the code with the class with all it's functions, it is named stack_class:
class Stack:

    def __init__(self):
        self._values = []
        print ('Stack initialized...')
        return

    def push(self, var):
        ok = self._values.append(var)
        return ok

    def pop(self):
        self.stack.pop()

    def __str__(self):
        output = "{0}".format(self.ok)
        return output

this is the testing code:
from stack_class import Stack

ob_1 = Stack()
ob_1.push(5)
print(ob_1.push(5))

A: What happens is that append method doesn't return anything.
print [].append(1)
>>> None

It does its job, but doesn't return anything, that's why you are getting None in variable ok. I think you want to return the _values instead:
def push(self, var):
    self._values.append(var)
    return self._values

Output:
Stack initialized...
[5, 5]

Also, it's the first time I read about empty return convention. It's not necessary.


text:
Q: What could be a select query to search records By "Last Week", "Last Month" and "Last Year"? I have system in which I need to display the list of records such we are available with three options

*

*Last Week

*Last Month

*Last Year

My table structure has a field call createdate which is BIGINT type and saves the data obtained from PHP's time() function.
Please guide me to get the select query to search records By "Last Week", "Last Month" and "Last Year"
Thanks

A: this should do the trick:
SELECT * FROM my_table WHERE createdate BETWEEN DATE_SUB(NOW(), INTERVAL 1 week) AND NOW();
SELECT * FROM my_table WHERE createdate BETWEEN DATE_SUB(NOW(), INTERVAL 1 month) AND NOW() ;
SELECT * FROM my_table WHERE createdate BETWEEN DATE_SUB(NOW(), INTERVAL 1 year) AND NOW();

A: Many of the given queries suffer from bad usability of indexes. If your createdate is in unix time, the comparison should happen as well in unix time.
SELECT *
    FROM mytable
    WHERE createdate
        BETWEEN UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY) AND UNIX_TIMESTAMP()

should provide a way to use a range on the index over createdate and doesn't require a full table scan.

A: SELECT * FROM mytable WHERE YEAR(FROM_UNIXTIME(createdate)) = YEAR(NOW())-1
SELECT * FROM mytable WHERE WEEK(FROM_UNIXTIME(createdate)) = WEEK(NOW())-1 AND YEAR(FROM_UNIXTIME(createdate)) = YEAR(NOW())
SELECT * FROM mytable WHERE MONTH(FROM_UNIXTIME(createdate)) = MONTH(NOW())-1 AND YEAR(FROM_UNIXTIME(createdate)) = YEAR(NOW())

See the week function for options like first day of week.

A: I think it could be something like this:
SELECT * FROM your_table
WHERE FROM_UNIXTIME(date_col) BETWEEN
    DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW()

SELECT * FROM your_table
WHERE FROM_UNIXTIME(date_col) BETWEEN
    DATE_SUB(NOW(), INTERVAL 1 MONTH) AND NOW()

SELECT * FROM your_table
WHERE FROM_UNIXTIME(date_col) BETWEEN
    DATE_SUB(NOW(), INTERVAL 1 YEAR) AND NOW()


text:
Q: Handling time out with NSMutableURLRequest I am making POST web service calls in parallel which are asynchronous, setting the time interval of NSMutableURLRequest to 180 seconds.
But my didFailWithError: delegate is not getting triggered  exactly at the interval of 180 seconds, rather it goes too less to 75 seconds or too greater value to 220 seconds and so on, but not once for 180 seconds.
As far I scanned through the similar questions, there is no solid solution for this. But at much places, I could see like timeOutInterval will not work for POST methods.
I just want to know whether this issue is true with POST methods and Is there any way to overcome this at least in iOS8?

A: If you are using POST and an iOS version bellow 6, you have to set a value above 240 seconds. Otherwise, your timeout will be ignored. See this post and this question.


text:
Q: I want to include class, but it doesn't work I'm just learning C++. I'm following a YouTube video, but I'm stuck at this stage. Below is my files.
// main.cpp

#include <iostream>
#include "Person.h"

int main()
{
    Person foo;
    foo.set_age(25);

    std::cout << foo.get_age() << std::endl;

    return 0;
}

// Person.h

#ifndef PERSON_H
#define PERSON_H

#pragma once

class Person
{
public:
    void set_age(int a);
    int get_age();

private:
    int age;
};

#endif

// Person.cpp

#include "Person.h"

void Person::set_age(int a)
{
    age = a;
}
int Person::get_age()
{
    return age;
}

I just set up the development environment in vscode and installed code runner.
Whenever I click the Run button here
It says
launch: program '.....main.exe' does not exist
Is there a tool like php composer that automatically manages it?
Moved the contents of the .cpp file to the .h file.
It worked fine. But I would like to separate the two files for management.


text:
Q: Bash shell script to add classpath if empty I am new to Bash Scripting and would need help to make a simple script that I will run on my CentOS. I would like the script to check if classpath is empty like this:
> [root@hdp ~]# echo $CLASSPATH
>
> [root@hdp ~]#

do: export CLASSPATH="something"
else

echo -n "There's already a classpath! Appending!"

If there already is a classpath set, append to the existing one without overwriting to it.


text:
Q: Touch Screen and Javascript DOM Mousedown Event I have a javascript web application that uses a touchscreen, browser is webkit based.
I am having a problem with this:
addEventListener("mousedown", function(event){
    console.log('down fired');
    event.target.classList.add('down');
}, true);

When using a mouse, the target element class is added immediately when the mouse is held down, but when using the touchscreen, the target element class is not changed when the finger is held on the element.
The strange thing is however, the console log message is sent on the down event for both the mouse click and the ts press.
Any suggestions on how to solve this ??
Thanks
EDIT
I added the touchstart event listener, but it does not fire on a touch event:
addEventListener("touchstart", function(event){
    cl('touch fired');
}, true);

A: Use touchstart and touchend events instead.
addEventListener("touchstart", function(event){
    console.log('down fired');
    event.target.classList.add('down');
}, true);

A: Way too late, but maybe someone else could use it:
event.target doesn't work on touchscreen, because you could use more than 1 finger, so there are more targets:
addEventListener("mousedown", function(event){
  console.log('down fired');
  var t = /touch/.test(event.type) ? event.targetTouches[0] : event.target;
  t.classList.add('down');
}, true);

A: Though generally a touch device does send the mouse events as expected, there are special events for touch screens. Specifically 'touchstart' as the equivalent of 'mousedown', and 'touchend'/'touchcancel' as the equivalents of 'mouseup'. If you are not checking what button or position is being touched, you can generally do a direct replacement with them.
By the way, touchend means the user stopped touching the screen. touchcancel occurs when something happens (like a non-browser alert) that intercepts the touch.


text:
Q: Inherited methods not found in Eclipse I'm doing semantic analysis of java codes. Some classes are as below:
ClassOrInterfaceDeclaration -> TypeDeclaration -> BodyDeclaration -> Node

The Node class is like this:
public abstract class Node {

private final int beginLine;

private final int beginColumn;

private Scope enclosingScope;

@Deprecated
public Node(int line, int column) {
    this.beginLine = line;
    this.beginColumn = column;
    this.endLine = line;
    this.endColumn = column;
}

public Node(int beginLine, int beginColumn, int endLine, int endColumn) {
    this.beginLine = beginLine;
    this.beginColumn = beginColumn;
    this.endLine = endLine;
    this.endColumn = endColumn;
}

public void setMyScope(Scope enclosingScope) {
    this.enclosingScope = enclosingScope;
}

public Scope getMyScope() {
    return enclosingScope;
}

public final int getBeginLine() {
    return beginLine;
}

public final int getBeginColumn() {
    return beginColumn;
} ... ...

Now, when I call these methods from an instance of ClassOrInterfaceDeclaration, any method is available except the setMyScope() and getMyScope(). Kinda a newbie. No idea why and how to fix it.
Codes of ClassOrInterfaceDeclaration is as below:
public final class ClassOrInterfaceDeclaration extends TypeDeclaration {

private final List<AnnotationExpr> annotations;

private final boolean isInterface;

private final List<TypeParameter> typeParameters;

private final List<ClassOrInterfaceType> extendsList;

private final List<ClassOrInterfaceType> implementsList;

public ClassOrInterfaceDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, boolean isInterface, String name, List<TypeParameter> typeParameters, List<ClassOrInterfaceType> extendsList, List<ClassOrInterfaceType> implementsList, List<BodyDeclaration> members) {
    super(line, column, javaDoc, name, modifiers, members);
    this.annotations = annotations;
    this.isInterface = isInterface;
    this.typeParameters = typeParameters;
    this.extendsList = extendsList;
    this.implementsList = implementsList;
}

public List<AnnotationExpr> getAnnotations() {
    return annotations;
}

public boolean isInterface() {
    return isInterface;
}

public List<TypeParameter> getTypeParameters() {
    return typeParameters;
}

public List<ClassOrInterfaceType> getExtends() {
    return extendsList;
}

public List<ClassOrInterfaceType> getImplements() {
    return implementsList;
}

@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
    v.visit(this, arg);
}

@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
    return v.visit(this, arg);
}
}

TypeDeclaration and BodyDeclaration is similar. There is nothing about line, column or scope in them. However, while beginLine() and beginColumn() work well, the setMyScope(), getMyScope() don't. The latter two methods were added by me. I suspect that I have done something silly but can't figure out.

A: It seems like an issue where you are not able to reference the latest class version.
Possible issues :

*

*code is not recompiled at all

*there may be compilation error in other classes in the same src. Fix those and compile again.

*You may have the jar file path in  your classpath where the jar is not getting replaced with the latest one.

Please check if all these boxes are ticked. If the issue still persists, let us know


text:
Q: Nhibernate many-to-many eager load in one SQL query? How to force nhibernate to fully load many-to-many data in one sql query.
I have tried this:
var list = session.CreateCriteria<Q>("q")
                  .CreateAlias("q.PList", "p", JoinType.LeftOuterJoin)
                  .List();

But it loads only q.PList, and when I try to access q.PList[0].QList[0].PList[0] NH executes additional select query.
Entities and how I mapped them:
public class P
{
    public virtual Guid Id { get; set; }
    public virtual IList<Q> QList { get; set; }
}
public class Q
{
    public virtual Guid Id { get; set; }
    public virtual IList<P> PList{ get; set; }
}
public class PMap : ClassMap<P>
{
    public PMap()
    {
        Table("p");
        Id(t => t.Id);
        HasManyToMany(t => t.QList)
            .Table("q2p").ParentKeyColumn("pId").ChildKeyColumn("qId").Inverse();
    }
}
public class QMap : ClassMap<Q>
{
    public QMap()
    {
        Table("q");
        Id(t => t.Id);
        HasManyToMany(t => t.PList)
            .Table("q2p").ParentKeyColumn("qId").ChildKeyColumn("pId");
    }
}

A: I believe what you are really trying to do is:
var list = session.CreateCriteria<Q>()
                  .SetFetchMode("PList", FetchMode.Join)
                  .List();

Update based on your comment:
It's cumbersome and usually not worth it to try to fetch a whole graph with many collections using joins. For this particular case, I suggest that you use batch-size on the collections and let NH do a batched lazy-loading.
Depending on your code, it's also possible that a HQL query retrieves the data you want better than navigating the object graph.

A: or use HQL to achieve the same
your query will look as follows
var hqlQuery="select p from Q as q inner join fetch q.PList as p";

You run the query as follows:
 Sesssion.CreateQuery(hqlQuery).List<P>();

Hope that helps.


text:
Q: Equivalent java code for this kotlin code? I have this kotlin code:
private fun showNoMoreCards() = showContent {
    row {
        label(gapLeft = LEFT_MARGIN, text = "Congratulations, you've reviewed all the cards for now!")
    }
}

fun showContent(init: LayoutBuilder.() -> Unit) {
    val panel = panel(LCFlags.fill) {
        init()
    }

    val content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false)
    toolWindow.contentManager.removeAllContents(false)
    toolWindow.contentManager.addContent(content)
}

```
I don't understand nor want to learn kotlin, I'd like this in Java. There is a lot of this code, I just need some guidance on what this would look like with (presumably) JPanels and the like - can someone give me the roughly equivalent java code?
This code is found in this github repo

A: Sorry this might be slightly off, but it's the best that I can do with the amount of code that's provided in Java 8 (and without actually reading through the provided Github repo):
private void showNoMoreCards() {
    showContent((layoutBuilder) -> {
        layoutBuilder.row((rowBuilder) -> {
            rowBuilder.label(LEFT_MARGIN, "Congratulations, you've reviewed all the cards for now!");
        });
    });
}

public void showContent(java.util.function.Consumer<LayoutBuilder> init) {
    JPanel panel = panel(LCFlags.fill, () -> {
        init.apply(layoutBuilder);
    });

    Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false)
    toolWindow.getContentManager().removeAllContents(false);
    toolWindow.getContentManager().addContent(content);
}


text:
Q: PostgreSQL on Amazon RDS: out of memory error on bytea field > 64MB I am attempting to dump a modestly sized (less than 3GB) database from Postgres 9.5.4 running on Amazon RDS. The instance is a db.m4.xlarge, which has 4 virtual cores and 16GB RAM. It's using the default parameter group.
My dump fails like this:
$ pg_dump -h xxxxx.rds.amazonaws.com -U admin -d mydb -Fc -f dump-20170919.psql
Password:
pg_dump: Dumping the contents of table "plugindata" failed: PQgetCopyData() failed.
pg_dump: Error message from server: out of memory
pg_dump: The command was: COPY public.plugindata (plugindataid, pluginkey, filename, lastmoddate, data) TO stdout;

Because attempting to SELECT the problem field also causes an error, I was able to narrow it down to a specific field in one record. The data field (type bytea) in this record has a size of 66,459,495 bytes, which is an order of magnitude larger than any other record in the table.
I have tried increasing both work_mem (to 1GB) and maintenance_work_mem (to 3GB) to no avail. I'm not all that familiar with memory tuning for Postgres, so I assume there's something else I need to tweak?
EDIT: Server logs contain the following:
...:admin@mydb:[14270]:LOG: could not send data to client: Connection reset by peer
...:admin@mydb [14270]:ERROR: canceling statement due to user request
...:admin@mydb:[14270]:LOG: could not send data to client: Broken pipe
...:admin@mydb:[14270]:LOG: SSL error: bad write retry
...:admin@mydb:[14270]:FATAL: connection to client lost

I have verified that ssl_renegotiation_limit is set to 0.

A: PostgreSQL's handling of large binary fields is very memory-inefficient. It's quite normal for it to keep three or more copies of a given field in memory when procesing a row, albeit briefly. One TOASTed Datum, one deTOASTed Datum, one stringified hex-formatted Datum. I wouldn't be surprised if SSL added another copy.
That said, this doesn't really look like a memory issue to me. Lets say somehow PostgreSQL insanely stored TEN copies of the field. It's only 63MB. You'd need 640MB of RAM. That's nothing for your server. So unless RDS's postgres is patched to do things normal PostgreSQL doesn't do, or runs with some weird control groups configuration or something, it's unlikely to be a true memory problem.
I suspect the real issue is something else.
work_mem isn't relevant here, as it's only considered for things like sorts. It's not a memory quota for a backend.
"Out of memory" can be reported in error cases where something fails that should not usually fail, under conditions that are usually caused by not being able to allocate memory. Given that, I'm very suspicious of the "bad write retry" report from OpenSSL.
You've excluded issues with renegotiations, but in an opaque system like RDS it's hard to tell what else it might be.
Can you show more of the logs? That may be informative. Especially if you retry after setting log_error_verbosity = verbose and log_min_messages = debug1 in your configuration.
Also, what's the output of SELECT pg_column_size(x), octet_length(x) FROM mytable WHERE ..., where x is the problem row?
(Edit your question to add more info, then comment here to notify me)
If this were normal unpatched PostgreSQL on a real host I'd get you to attach gdb and capture the error so we could see exactly what's happening. But in this case your best bet will be to contact Amazon's support, since they're the only people who can actually see what's happening on the host.


text:
Q: org.w3c.dom.Document gwt converter to string in GWT I have a problem when I try converter a document (org.w3c.dom.Document) to String for GWT.
Bofer I developed it without to use GWT and I make like this:
        XMLSerializer xmlSerializer = new XMLSerializer();
        StringWriter strWriter = new StringWriter();
        OutputFormat outFormat1 = new OutputFormat();

        outFormat1.setEncoding("UTF-8");
        //outFormat1.setEncoding("ISO-8859-1");
        outFormat1.setVersion("1.0");
        outFormat1.setIndenting(true);

        outFormat1.setIndent(4);
        //outFormat1.setIndent(2);
        outFormat1.setOmitXMLDeclaration(false);

        outFormat1.setMethod("xml");

        xmlSerializer.setOutputCharStream(strWriter);
        xmlSerializer.setOutputFormat(outFormat1);
        xmlSerializer.serialize(xmlDoc);
        strWriter.close();

But the application give a mistake because GWT don´t accept it.
Do someone know some other solution?
Thanks.

A: I guess you are trying to deal with xml documents in client side, right?
If so, you cannot use org.w3c.dom since it is not part of the subset of the java runtime library emulated by gwt.
To handle xml in client-side you have to use GWT XML parsers, or another client library, personally I prefer the gwtquery XML data-binding way.


text:
Q: Having problems creating kmls with python I am creating kml files using python and the simplekml creator.
For some reason it creates two kml files and will not create the third. Data seems fine to me. Here is the code:
times=open("E:\\Python\Copyofresttable.csv","r")
import time
import csv
import simplekml
from time import strftime, localtime
dayoftheweekvariable = strftime("%A", localtime())
print dayoftheweekvariable
kml = simplekml.Kml()

if dayoftheweekvariable == "Monday":
     for line in times:
        a = line.split(',')
        if a[2] == "Monday":
            print a[5]

if dayoftheweekvariable == "Tuesday":
     for line in times:
        a = line.split(',')
        if a[2] == "Tuesday":
            print a[5]

if dayoftheweekvariable == "Wednesday":
    for line in times:
        a = line.split(',')

        if a[1]== "Iron Hill" and a[2] =="Wednesday":
            kml.newpoint(name="Iron Hill", coords=[(-75.605507,39.960504)], description=a[5])
            kml.save("pythonmap.kml")
            print "Creating KML"

        if a[1]== "Side Bar and Resturant" and a[2] =="Wednesday":
            kml.newpoint(name="Side Bar and Resturant", coords=[(-75.604805,39.960591)], description=a[5])
            kml.save("pythonmap.kml")
            print "Creating KML"

        if a[1]== "Barnaby's" and a[2] =="Wednesday":
            kml.newpoint(name="Barnaby's", coords=[(-75.604049,39.959488)], description=a[5])
            kml.save("pythonmap.kml")
            print "Creating KML"

obviously testing this out on Wednesday night...As for the last three if statements, no matter what order i put them in, it will create a kml for Iron Hill and Barnaby's but not side bar. this is the result it returns:
Wednesday
Creating KML
Creating KML

Traceback (most recent call last):
  File "C:/Users/75IV740906/Desktop/py117", line 26, in <module>
    if a[1]== "Iron Hill" and a[2] =="Wednesday":
IndexError: list index out of range

the error message calls out what ever if statement is on top. Im stumped. Hope my question makes sense(why is it giving me this error message and only creating two kmls no matter what order the if statements are in)

A: Change
times=open("E:\\Python\Copyofresttable.csv","r")

to:
times=open("E:\\Python\Copyofresttable.csv","r").read()

in your first line and add a
print('#Times: {0}'.format(len(times.split())))

to make sure you have enough lines...
Update:
You traceback (in comment) shows that your (1st?!) dayoftheweek seems to be a wednesday, that's why your 1st two ifs are ignored. Then it seems like your list a doesn't have nough entries.
You may check that assumption with a print("# a: {0}".format(len(a)))
So if you have less then 3 entries a[2]== must fail because the list index out of range ;-)
Ahh, i didn't read your question properly at first. And it makes more sense that way, if every 1st if-statement is throwing an exception....
Update 2:
Btw: You should rearange your for line in times: loops to a less redundant way, like:
lines=open("E:\\Python\Copyofresttable.csv","r").readlines()
...
for line in lines:
    a = line.split(',')
    if a[2] == "Monday" == dayoftheweek:
        ...
    elif a[2] == "Tuesday" == dayoftheweek:
        ...
    elif a[1]== "Iron Hill" and a[2] =="Wednesday" == dayoftheweek:
        ...

Update 3:
You could "cheat" a little if ommiting some lines, by doing something like:
a = line.split(',')
if len(a) < 6:
   continue   # ignores the rest of the loop and jumps stright to the next iteration


text:
Q: LinkedList on python and c++ I am trying to implement linkedlist on python, which i have finished on c++.
just for the function insertHead. i basically used the same algorithm.
c++
template <class T>
int L1List<T>::insertHead(T&& a){
    L1Item<T>   *p = new L1Item<T>(std::move(a));
    p->pNext = _pHead;
    _pHead = p;
    _size++;
    return 0;
}

python
def insertHead(self, _data):
    pNew = LLnode(_data)
    pNew.pNext = self.pHead
    self.pHead = pNew
    self.length += 1
    return True

i try to insert 10 million value of int. for c++ i get like 0.7s, while python run it for like 28s.
why there is a huge difference??


text:
Q: How to Ignore Certain terms in search using Fusejs? I want to create a search using fusejs, in which an entity or keyword can have multiple names, (alias). In fusejs the score is calculated based on the user input, he/she can enter any of the names.
In my data i can have only 1 name.
For Example: "House"
[
     {"label": "House No. 436, Street 12, Phase 3"}
]

If a user enter "house" it works perfectly, but what if user enter Plot no, or home no, apartment no , flat no or any such word. In that case the score calculated will effect the search results.
Please let me know if there is any way out for this.

A: I solved this problem by adding a new array containing all the alias to each object.
[{"label": "House No. 436, Street 12, Phase 3", tags: ["Plot No", "Flat no", "Apartment no"]}]

and so on. And then i applied the weighted search with 0.7 weight to the variable label and 0.3 to array of alias.
 keys: [{
            name: 'tags',
            weight: 0.3
        }, {
            name: 'label',
            weight: 0.7
        }]
    };

Now if user inputs any of the keyword, it will have same impact, Thus the actual search results are not effected.


text:
Q: Differences between Stata teffects psmatch and nnmatch? I am using Stata 13 to analyse some observational data and a treatment. I came across an abundance of possible ways to estimate treatment effects with Stata. Let me just show you two options below (excluding the popular psmatch2, pscore  and attn etc.).
use "http://www.stata-press.com/data/r13/cattaneo2.dta", clear

global treat mbsmoke
global match mmarried mage medu fbaby
global ylist bweight

*Option 1: teffects psmatch
teffects psmatch ($ylist) ($treat $match, logit), atet

*Option 2: teffects nnmatch
teffects nnmatch ($ylist $match) ($treat), atet

I use the Cattaneo sample, which offers some material on the mother's habit to smoke (treatment), birth weight of a child (endogenous variable), and a few factors to match (here randomly selected marriage status of the mother, mother's age, and first baby). I always calculate the average treatment effect on the treated and match at least one nearest neighbour.
I tried to specify the commands as similar as possible - but the outcomes differ a bit:   -245.711 vs. -239.2433.
I have a few questions: First and foremost, why do the results differ? When should one use psmatch and when nnmatch? And, why can I specify nnmatch to exactly match on some criteria (via ematch) and why is that not the case for psmatch?
Crossposted at: http://www.statalist.org/forums/forum/general-stata-discussion/general/1323628-differences-between-stata-teffects-psmatch-and-nnmatch


text:
Q: Use static method to build immutable type (org.apache.commons.lang3.Range) class RangeDTO {
  public org.apache.commons.lang3.Range<Long> range;
}

class SourceDTO {
  public Long min;
  public Long max;
}

public interface Mapper {
    @Mapping(target = "range.max", source = "max")
    @Mapping(target = "range.min", source = "min")
    public abstract RangeDTO map(SourceDTO source);
}

This mapper method produces Range<Long> does not have an accessible constructor error (it's fine, Range doesn't have an accessible constructor) because it must created using static method Range#between().
I prefer not to use expression nor writing a Range<Long> map(SourceDTO).
Any advice?
Thanks in advance


text:
Q: MFC: limit the size of child control from the code of control itself Say, I have a CListCtrl-derived control. I want it to be always square (i.e. it's width and height should be always equal to each other).
The control resides on a dialog (CDialog-based), it is resized once the dialog is resized (the control is resized using SetWindowPos()). What I want to achieve is to make it impossible to resize the control improperly: the control must always have equal horizontal and vertical dimensions regardless of what is passed to SetWindowPos.
Of course, I can control the values that are passed to SetWindowPos. The question is: is it possible to control the size of the CListCtrl-derived control inside the code of that control itself?

A: If you subclass the control and have it handle the WM_SIZING message you can constrain the resize in any way you'd like. Just modify the RECT structure that's passed with the message.


text:
Q: CSRF verification failed when logging into admin panel In production my app is giving me CSRF verification failed when I log into my admin panel.
I have the following in my settings.py:
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True

As my site doesn't currently have an SSL certificate I have ignored the following after running python manage.py check --deploy:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.

A: If you use those two settings then you must be using SSL.
See:
SESSION_COOKIE_SECURE
CSRF_COOKIE_SECURE


text:
Q: How do you create a two tier label QGIS Zurich 3.18.2 -Win10
I have a virtual layer that has multiple polygons each with two pertinent Attribute fields. "Field1Name" and "Field2Name". I can set and Style the Label for one field and I can display these two fields as a Label, using the Expression Value "field1name" || '\n' || "field2name".
BUT is it possible to set a different Text/Render Style for each of the two fieldnames in the Label to display at the same time? I want both fields data to appear within the polygon label, but one highlighted, bold and large and the other subordinated, smaller less obvious. If I set up two Text Styles up is there an Expression that will achieve this two component styled Label?

A: Yes this is possible. To do this you need to set labelling to rule based labelling. One rule will be for your top line and the second rule for the bottom line. You don't to set any filters for the rules but you can set them to display different fields and have different label symbologies. There may just be a little bit more effort involved in getting the spacing correct between the different lines as you will probably have to do this using offsets instead of a line break.
EDIT: To edit the vertical spacing for each rule: open the rule's properties, go to Placement, set the mode to 'Offset from Point', and adjust the offsets under Offset,X,Y. Y adjustment highlighted here:


text:
Q: Difference between Sencha-touch-all and Sencha-touch.js library files? Still not clear with this. I am testing with simple login form (Version is 2.2.1 and no external CSS or JS). After looking up the resource consuming, I am confused with js should i prefer either (sencha-touch.js or sencha-touch-all.js) for development and production. By default the microloader maps to sencha-touch.js. Should i change it?
sencha-touch.js -->
sencha-touch-all.js  -->
Here it just give only 29 hits to server but downloading 4 mb of file which is larger than sencha-touch

A: sencha-touch.js will be making a request to individual source files for each component your app requires in. sencha-toucha-all.js includes all components by default.
See this guide in the docs for more info:
http://docs.sencha.com/touch/2.3.0/#!/guide/building
More specifically, this is what you should be doing:
- use sencha-touch.js in development
- have each of your files require in all the sencha touch components/proxies etc it needs
- when you want to go to production, use the sencha app build command in your terminal to build to a single, minified javascript file which then contains all your code and all the sencha touch code your app needs.


text:
Q: PHP: How to Logout From API using JWT So I created an API using Token based authentication for Login, now I want to create the logout but I do not know how to go about it.
The login process just uses the following steps:

*

*User passes Username and Password to server

*Server checks DB to ensure user is Valid

*Token is generated containing uid and other details

*Token is then passed to User who sends back to server whenever he makes a request
Now I want user to logout, how do I go about it, I do not have power over the user Token anymore.

A: I also come here in search of a solution, but after reading much I came to few conclusions or say possible situations.

Edit Note:- Never store any potential information in token, as reading the data in token doesn't require the secret key. Secret Key is only for verifying signature of Base64 token. To check this out go to http://jwt.io and paste your token. I added this point because somewhere I saw a developer adding username and password of user in token. Please don't do things like this.

1.) Account logout event is initiated by client, if he wants to logout before expiry time of token.
Solution:-
Remove the token from every place in client side. It can be stored in DOM, or JavaScript Variable, or HTML key-pair storage, or session storage  or cookies storage. Everywhere we can store a value in a browser, we have also rights to delete the values. Once the token is deleted from every corner of this world user is logged out.
Caveat 1 in above solution
What if user is logging out in emergency, like someone might have stollen the token. How to destroy the token?
Answer is same as what will do if our secret key for JWT is stollen. We will quickly change the secret key and regenerate the tokens for logged in users. But in case of users what should we change?User ID( I will say no.). We should add a account locking mechanism similar to mechanism in Debit/Credit cards, where card is locked for 24 hours. But in our case we should have end period of account locking little more than the expiry time of token.
2.) Tokens are just like missiles, once fired we can not ask them to shut down.
I am talking about ideal case, if you are storing the reference of fired token in database, than there is no point of using JWT. We can generate a token using any hash generation method.
3.) Set expiry time short. Renew without letting user notice this, a little before the previous token expire. Time can be around 20 seconds. Still you have to consider caveat 1, as any person having a genuine token can ask for fresh token.
4.) We can also add an field IP address in token and check if current IP address of users matches with the one used at the time of login or not. It prevents from remote hackers.
5.) Add a clearly visible Logout button in your user interface for preventing naive users, and guide users to logout from your application every time they are done with your application.
6.) Add a client type in your token meta. For mobile applications check HMAC or IMEI codes, instead of IP address as mobile applications require keep running session as no one wants his or her users to logout from their mobile applications. But compromiser can compromise IMEI and HMAC address although. But randomly using between HMAC, IMEI or any other available string can add a little more security.
7.) I will add more if get to know more such.
Invalidating JSON Web Tokens this thread is also having many good inputs. As mentioned in comment under question.


text:
Q: Operand Type Clash - SQL Server INSERT stored procedure I understand the error, I am simply not sure why this is occurring. I have written a simple insert procedure to update a list of users.
Error:

Msg 206, Level 16, State 2, Procedure addNewUser, Line 0 [Batch Start Line 2]
  Operand type clash: int is incompatible with date

Procedure declaration:
CREATE PROCEDURE [dbo].[addNewUser]
    @fName VARCHAR(255),
    @lname VARCHAR(255),
    @dob DATE,
    @email VARCHAR(255),
    @gender VARCHAR(255),
    @level VARCHAR(255) AS

INSERT INTO [dbo].[User] ([firstname], [lastname], [dob], [email], [gender], [accesslevel])
VALUES ('@fName ', N'@lname', @dob, N'@email', N'@gender', N'@level')

Calling procedure:
DECLARE @return_value int

EXEC    @return_value = [dbo].[addNewUser]
        @fName = N'Ste',
        @lname = N'King',
        @dob = 19780103,
        @email = N'Books@email.com',
        @gender = N'Male',
        @level = N'Free'

SELECT  'Return Value' = @return_value
GO

A: Just put @dob = 19780103 into quotes '1978-01-03':
USE [t7068097]
GO

DECLARE @return_value int

EXEC    @return_value = [dbo].[addNewUser]
        @fName = N'Ste',
        @lname = N'King',
        @dob = '1978-01-03',
        @email = N'Books@email.com',
        @gender = N'Male',
        @level = N'Free'

SELECT  'Return Value' = @return_value

GO

UPDATE:
SELECT CAST('1978-1-1' AS DATE)
SELECT CAST('19780101' AS DATE)

A: First your procedure is wrong. You shouldn't put your variables into the single quote for your purpose:
ALTER PROCEDURE [dbo].[addNewUser]
@fName  varchar(255),
@lname  varchar(255),
@dob    DATE,
@email  varchar(255),
@gender varchar(255),
@level  varchar(255)
AS

INSERT [dbo].[User]
    (
      [firstname]
    , [lastname]
    , [dob]
    , [email]
    , [gender]
    , [accesslevel]
    )
VALUES
    (
      @fName
    , @lname
    , @dob
    , @email
    , @gender
    , @level
    )
GO

Also you send int value to the date field. You need yo put into the single quote:
DECLARE @return_value int

EXEC    @return_value = [dbo].[addNewUser]
        @fName  = N'Ste',
        @lname  = N'King',
        @dob    = '19780103',
        @email  = N'Books@email.com',
        @gender = N'Male',
        @level  = N'Free'

SELECT  'Return Value' = @return_value


text:
Q: SQL query including Contains() & group by not working as expected I have the case below:

*

*user x category ids in UserInterests table: 1 , 2 , 3

*user y category ids in UserInterests table: 1, 2

The category ids are integer values where (ApplicationUserId,CategoryId) is the composite primary key of mentioned table.
This is the shape of records:
userx  1
userx  2
userx  3
usery  1
usery  2
string interests="1 2"
I want to execute an SQL query that would allow me to retrieve only users having 1 and 2 as interests (not user x).
When I execute the query shown below (knowing that result variable contains the id's of my users)I keep getting user x and user y; I guess it's retrieving the users containing 1&2 but I don't want user x in the result.
int count = 2

var result2 = (from t8 in result
               from t9 in _dbContext.UserInterests
               where  t8.id == t9.ApplicationUserId && interests.Contains(t9.CategoryId.ToString())
               group t8 by t8.id into g
               where g.Count() == count
               select g.Key).ToList();

Any help is appreciated!

A: Firstly, I'd recommend using a join for readability reasons.
from t8 in result
join t9 in _dbContext.UserInterests
on t8.id equals t9.ApplicationUserId ...

Not having two from keywords and two where keywords in the same query should make things more maintainable.

Secondly, I'd change string interests = "1 2" to an array: string[] interests = {"1", "2"}

This is an exclusive query, it's using inclusion and exclusion to get a partial. The best way to achieve it is usually to capture the whole (inclusion), and negate the bad results (exclusion), resulting in a dataset you want.
Another way: {HasOnlyXCategories} = {AllUserCategoryPairs} - {AllUsersWithCategoriesNotInX}
Hopefully its clear to see that this new query is much easier to write. We already start with {AllUserCategoryPairs} in our join so, we need to write a subquery query that fetches those Users who have categories not in interests and then exclude those Users we find.
The following should be what you end up with, or close.
var result2 = from u in result
              join c in _dbContext.UserInterests
                  on u.id equals c.ApplicationUserId
                  and !interests.Contains(c.CategoryId)
                  into usersBadCategories
              where !usersBadCategories.Any()
              select u;

You might have to adjust it a little to fit your context but that should be about the shape of it.

A: There Are multiple ways to achieve what you want, based on the given you have already garbed the users from the db. With this given I do not know about any method to achieve this with single db request.
I've crafted a simple example to be able to validates the result of the query but you can replace the variables with your variables.

Solution 1 - Not recommended

    static void Main(string[] args)
    {
        // Sample Data
        var allUsers = new List<User>
        {
            new User{Id = 1, Name = "User X"},
            new User{Id = 2, Name = "User Y"},
            new User{Id = 3, Name = "User Z"},
            new User{Id = 4, Name = "User W"}
        };

        var userInterests = new List<UserInterest>
        {
            new UserInterest {FakeId = 1, UserId = 1, CategoryId = 1},
            new UserInterest {FakeId = 2,UserId = 1, CategoryId = 2},
            new UserInterest {FakeId = 3,UserId = 1, CategoryId = 3},
            new UserInterest {FakeId = 4,UserId = 2, CategoryId = 1},
            new UserInterest {FakeId = 5,UserId = 2, CategoryId = 2},
            new UserInterest {FakeId = 6,UserId = 3, CategoryId = 1},
            new UserInterest {FakeId = 7,UserId = 3, CategoryId = 4}
        };

        var interests = "1 2";
        var interestsFilter = interests.Split(" ").ToList();

        var unwantedUserIds = userInterests.Where(q => interestsFilter.All(q2 => q.CategoryId != int.Parse(q2)))
                                            .Select(q => q.UserId).Distinct();

        // Get All users ids that match the filter
        var myUserIds = userInterests.Where(q => unwantedUserIds.All(q2 => q.UserId != q2))
            .Select(q => q.UserId).Distinct();

        // Or Get the users directly
        var myUsers = allUsers.Join(userInterests,
                                        user => user.Id,
                                        userInterest => userInterest.UserId,
                                        (user, userInterest) => user).Where(q => unwantedUserIds.All(q2 => q.Id != q2)).Distinct();

    }

Solution 2 - Raw Sql

Since you are using entity framework and as long as you can achieve results with single db query you go RawSql in case Linq was not able to do it.
RawSql


text:
Q: Printing a html object I had read all I could find about this But I am still not able to solve this.
<body>
<object data="/app/pdf/banana.pdf" type="application/pdf"
style="width: 100%; height: 100%"></object>
</body>

<script type="text/javascript">

$(document).ready(function () {
    window.print();
    setTimeout("closePrintView()", 3000);
});
function closePrintView() {
    document.location.href = 'somewhere.html';
}

Everything is working, Even the redirect when I close the print dialog but the problem is that the print function loads an empty page, I cant see the PDF.

I tried in every way. I need to open this PDF, Print it and redirect to another page.

A: Try this,
<html>
<body>

<object data="cv.pdf" type="application/pdf"
style="width: 100%; height: 100%"></object>
</body>

<script type="text/javascript">

$(document).ready(function () {
    window.print();
    setTimeout(closePrintView(), 3000);
});
function closePrintView() {
    document.location.href = 'somewhere.html';
}
</body>
</html>


text:
Q: How to mock RedissionClient.createBatch() I'm trying to unit test a piece of code and I want to mock the
redissionClient.createBatch() method call which returns the RBatch object.
Code snippet looks like:
RBatch batch =redissonClient.createBatch();

How do I handle
Mockito.when(redissonClient.createBatch()).thenReturn(*!!facing issue here in object creation!!*)


text:
Q: Git & Github: El commit por SSH aparece hecho por otra cuenta Estoy trabajando los commits mediante llaves SSH, el proceso que hago para identificarme es el siguiente:
eval $(ssh-agent)
ssh-add ~/Desktop/ssh/Github/UsuarioA  <--- Llave privada

Incluso si ejecuto el comando
ssh -T git@github.com

Me aparece que me identifiqué como el usuario A: Hi UsuarioA! You've successfully authenticated, but GitHub does not provide shell access.
¡Pero al hacer commits me aparece que los hizo el UsuarioB!
Lo que más se me hace extraño es que ya eliminé las llaves del UsuarioB, no existen. Y el repositorio es privado y el UsuarioB no tiene permiso de acceso a ese repositorio. No entiendo qué está pasando, pues no hay warnings ni errores, ¿Alguna idea de lo que está pasando?
Nota: Uso GitBash para ello y trabajo con Windows
Imagen del problema:

A: Lo solucioné con ayuda de este blog, el cual nos indica cómo configurar el .git/config para que te reconozca la llave ssh específica.
Quedando la configuración del .git/config parecida a esta:
[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    ignorecase = true
    sshCommand = "ssh -i ~/Desktop/ssh/Github/UsuarioA"
[remote "origin"]
    url = git@github.com:UsuarioA/Repositorio.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
    remote = origin
    merge = refs/heads/main
[user]
    name = UsuarioA
    email = UsuarioA@correo.ejemplo.com

De la configuración adicional que agregué fue todo [user] y [core].sshCommand


text:
Q: ActiveMQ consumer in AKS I have an ActiveMQ consumer in AKS I am trying to connect to a external service.
I have setup a AKS load balancer with a dedicated IP with with the following rules but it will not connect.
apiVersion: v1
kind: Service
metadata:
  name: mx-load-balancer
spec:
  loadBalancerIP: 1.1.1.1
 type: LoadBalancer
 ports:
  - name: activemq-port-61616
    port: 61616
    targetPort: 61616
    protocol: TCP
  selector:
    k8s-app: handlers-mx

Any ideas?

A: First of all, your loadBalancerIP is not a real one, you need to use a real IP of your LB. Second,  you need to add annotation for service of type LoadBalancer to work:
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-resource-group: LB_RESORCE_GROUP


text:
Q: Where to put utility (not administration) stored procedures in SQL Server?
Possible Duplicate:
Setting up a central CLR stored procedure / function respository library for internal stored procs in other databases to use?

I have some simple user-defined functions for string manipulations. Most of them are actually CLR functions but not all of them are. I use them from multiple databases on the same server. What is the proper place to put these?
I've been placing them in the master DB so far. Is that a bad idea? If so, why? Is it standard practice to have a utility database that has no data but only progammability objects?

A: I would put them in a Utility database.
Putting stuff in the master database is something to avoid as it stores information related to the system configuration.  If there is a problem with the master database, your SQL Server will go down.  It's probably ok to put normal stored procedures used for server level troubleshooting like sp_WhoIsActive but I would never put a CLR based procedure in there.


text:
Q: Muting and unmuting sound with mutebutton I'm running the testing branch of debian with codename Jessie and xfce as desktop environment on a Lenovo ThinkPad T410. When I press the mute-button, it mutes pulse-audio and alsa, but when I press the mute-button again it unmutes pulse-audio but not alsa. I can happily mute and unmute in the terminal by
amixer set Master toggle

Now I'd like to set this command to be executed when pressing the mute button. xfce has a setting for that, it works for other buttons, but not the mute button. In .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml I have the line
<property name="XF86AudioMute" type="string" value="amixer set Master toggle"/>

but to no avail. Does anyone know how I can either turn off the mute button or overwrite what happens when I press it?

A: Uncommenting
load-module module-alsa-sink
load-module module-alsa-source device=hw:1,0

in /etc/pulse/default.pa did the trick.
Edit: However, after uncommenting the lines mentioned above, I ran into all sorts of problems, for example vlc started crashing. I now removed the complete folder /etc/pulse/ and now everything seems to work fine, including sound and mute button.

A: I found this solution on a blog to work on my Debian Jessie / XFCE machine.
In brief, the problem seems to be a missing "gstreamer0.10-pulseaudio" package.  This causes a behavior where you can mute all audio using the keyboard button, but to unmute it you have to go into alsamixer and press M to unmute; the unmute action apparently doesn't get communicated by default.

*

*sudo apt-get install gstreamer0.10-pulseaudio

*Reboot (might be sufficient to restart X, but I just rebooted)

*Verify the output of xfconf-query -lc xfce4-mixer to ensure that PlaybackBuiltinAudioAnalogStereoPulseAudioMixer is listed.

*The author recommends running xfconf-query -c xfce4-mixer -p /active-card -s PlaybackBuiltinAudioAnalogStereoPulseAudioMixer to set Pulseaudio as the "active card", but this doesn't seem to be necessary and throws an error for me when I tried ("Property "/active-card" does not exist on channel "xfce4-mixer".)

Note that I previously implemented the first part of Michael Tomkins' proposed solution (mapping amixer set Master toggle to the keyboard mute button in the xfce4-menu settings control), so that may be related and is worth a try.  I did not remove any of the gstreamer components, and don't recommend doing so given the number of things in Jessie that are (apparently) dependent on them.

A: Added (not sure step important)
 xfce4-menu -> Settings -> Settings Manager -> keyboard
 Application Shortcuts
 +Add
 <Command:> amixer set Master toggle <Ok>
 <Press volume toggle button>
 <OK>

Open Audio Mixer and check that both Master and Speaker are toggling, if so finish.
Was only Toggling Master, speaker was just turning on not off. I noticed on Jessie that both
ii  gstreamer0.10-plugins-bad:amd64       0.10.23-7.1                        amd64        GStreamer plugins from the "bad" set
ii  gstreamer0.10-plugins-base:amd64      0.10.36-1.1                        amd64        GStreamer plugins from the "base" set
ii  gstreamer0.10-plugins-good:amd64      0.10.31-3+nmu2                     amd64        GStreamer plugins from the "good" set
rc  gstreamer0.10-plugins-really-bad      0.10.22-0.1                        amd64        GStreamer plugins from the "bad" set
ii  gstreamer0.10-plugins-ugly:amd64      0.10.19-2+b3                       amd64        GStreamer plugins from the "ugly" set
ii  gstreamer0.10-pulseaudio:amd64        0.10.31-3+nmu2                     amd64        GStreamer plugin for PulseAudio
...
ii  gstreamer1.0-plugins-base:amd64       1.2.3-1                            amd64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-good:amd64       1.2.3-1                            amd64        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:amd64       1.2.3-2                            amd64        GStreamer plugins from the "ugly" set

were present.
Tried removing gstreamer0.10 which had too many dependencies. So
aptitude purge gstreamer1.0-plugins-base gstreamer1.0-plugins-good  gstreamer1.0-plugins-ugly
reboot

Didn't touch libgstreamer1.0-0 or libgstreamer-plugins-base1.0-0
The above also fixes plugging/unplugging headphones AND speaker toggle.
Worked for me.


text:
Q: как обработать нажатие по mapicon? <my:MapControl
                        x:Name="myMapControl"
                        MapServiceToken=" ***" Loaded="myMapControl_Loaded" ZoomLevelChanged="myMapControl_ZoomLevelChanged"
                       >
                        <Button Name="ZoomOut" Content="-" HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="60" Width="60" Click="ZoomOut_Click" FontWeight="Bold" Padding="0,-9,0,0" />
                    </my:MapControl>

  private void AddMapIcon(float lat, float lon, string title)
        {
            MapIcon MapIcon1 = new MapIcon();
            MapIcon1.Location = new Geopoint(new BasicGeoposition() { Latitude = lat, Longitude = lon });
            MapIcon1.NormalizedAnchorPoint = new Point(0.5, 1.0);
            MapIcon1.Title = title;
            MapIcon1.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///" + dl.urlimg));
            myMapControl.MapElements.Add(MapIcon1);
        }

как обработать нажатие по mapicon? В документации нашел https://msdn.microsoft.com/ru-ru/library/windows/apps/windows.ui.xaml.controls.maps.mapcontrol.mapelementclick.aspx
но не нашел такое событие там где оно должно быть.

A: Тут есть мануал. Если я правильно понял эвент завётся Tapped.


text:
Q: I'm trying to add a font to my react native app but im getting error of not closing a jsx tag but i closed all of them Im trying to add fonts to my app but along the way I ran into this error

SyntaxError: C:\Users\arich\Documents\efees\App.js: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (69:5)

constructor(props) {
    super(props);
      this.state = {
      fontLoaded: false
  };
}

    async componentDidMount() {
      await Font.loadAsync({
        'open-sans': require('./assets/fonts/OpenSans-Bold.ttf')
      }).then(() => {
        this.setState({ fontLoaded: true });
      });
    }

  render() {
    const finalValue = parseFloat(this.state.soldPrice || 0) +
    parseFloat(this.state.shippingCharge || 0)
    - parseFloat(this.state.soldPrice || 0) *
    parseFloat(this.state.paypalFeePercentage || 0)
    - parseFloat(this.state.paypalFee  || 0)
    - parseFloat(this.state.soldPrice || 0) *
    parseFloat(this.state.ebayFee || 0) - parseFloat(this.state.shippingCost || 0)
    - parseFloat(this.state.itemCost || 0);

    const inputStyle = this.state.inputStyleInactive;

    const ebaytTotal = this.state.ebayFee * this.state.soldPrice;

    const paypalTotal = this.state.paypalFeePercentage *
     this.state.soldPrice + this.state.paypalFee;

      EStyleSheet.build({ // always call EStyleSheet.build() even if you don't use global variables!

      });
   return (

     <View style={styles.container}>

I tried to add/remove opening and closing tags but i think the main cause of this error is this opening parenthesis but just not sure how to fix it also would appreciate an explanation for why this error was caused it would definitely help me for the future being that i'm a beginner always looking to learn lessons out of these moments when i'm just stumped
 {this.state.fontLoaded == true ? (
         <View style={styles.header}>
         <Text style={styles.headerText}>Efees</Text>
         </View>

this view is the one getting the error
    <View style={styles.blocks}>

     <View style={styles.inputs} >
     <Text style={styles.inputText}>1. Sold Price</Text>
     <NumberInput
     onchange={(soldPrice) => this.setState({ soldPrice })}
     />
     </View>

     <View style={styles.inputs}>
     <Text style={styles.inputText}>2. Shipping Charge</Text>

     <NumberInput
     onchange={(shippingCharge) => this.setState({ shippingCharge })}
     />
     </View>

     <View style={styles.inputs}>
     <Text style={styles.inputText}>3. Shipping Cost</Text>

     <NumberInput
     onchange={(shippingCost) => this.setState({ shippingCost })}
     />

     </View>

     <View style={styles.inputs}>
     <Text style={styles.inputText}>4. Item Cost</Text>

     <NumberInput
     onchange={(itemCost) => this.setState({ itemCost })}
     />

     </View>

     <View style={styles.inputs}>
     <Text style={styles.inputText}>5. Ebay Store?</Text>

     </View>

     <View style={styles.inputs}>
     <Text style={styles.inputText}>6. Top Rated Seller?</Text>

     </View>
     </View>

     <View style={styles.results}>
      <Text style={styles.resultText}>eBay Fee:{ebaytTotal.toFixed(2)}</Text>
      <Text style={styles.resultText}>Paypal Fee:{paypalTotal.toFixed(2)}</Text>
      <Text style={styles.resultText}>Profit %{}</Text>
      <Text style={styles.profitResult}>TOTAL PROFIT:{finalValue.toFixed(2)}</Text>
      </View>
    ) : (<Text style={styles.inputText}>Loading... </Text>)
  }
      </View>

 );
 }
}

A: The error is because, you are returning multiple elements from your condition,
{this.state.fontLoaded == true ? ( ...

You need to wrap all your element with a wrapper element to create only 1 returning element.
For this you can use Fragments.
What is Fragments ?

A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM.

Here also you have multiple ways to write Fragment.
import React from 'react'

{this.state.fontLoaded == true ? (
  <React.Fragment>
     <view></view>
     ...
     ...
  </React.Fragment>
 ) : (<Text style={styles.inputText}>Loading... </Text>)
}

Or
import React , { Fragment } from 'react'

{this.state.fontLoaded == true ? (
  <Fragment>
     <view></view>
     ...
     ...
  </Fragment>
 ) : (<Text style={styles.inputText}>Loading... </Text>)
}

Or even short syntax is <> </> (empty tags),
import React from 'react'

{this.state.fontLoaded == true ? (
  <>
     <view></view>
     ...
     ...
  </>
 ) : (<Text style={styles.inputText}>Loading... </Text>)
}