A real matrix whith rows generating $U$ and columns generating $V$

Question: Let $n \in \mathbb{N}$, and $U,V$ two linear subspaces of $\mathbb{R}^n$ of the same dimension. Could one always make a matrix $A \in \mathbb{M}^{n \times n}(\mathbb{R})$ such that $spanA = U$ and $spanA^T = V$?

I find it hard to find a counterexample. I know that for any $n \in \mathbb{N}$, there is such a matrix if $\dim U = \dim V \in \{0,n\}$, we could just take $0,I$ as matrices. Moreover, if $U,V$ are lines, that means $U = \mathbb{R}v$  and $V = \mathbb{R}w$ for some nontrivial vectors $v,w$, then the matrix below works.
$$
\left( \  w_1v \ | \  w_2v \ | \ \cdots \ | \ w_nv \ \right)
$$
Here $w_i$ are coordinates of the vector $w$, and each entry represents a column this way.
Then I took two subspaces of dimension two in $\mathbb{R}^3$, namely
$$
U \quad = \quad
span \left\{
\left( \begin{array}{ccc}
1  \\
0  \\
0
\end{array} \right)
,
\left( \begin{array}{ccc}
0 \\
1\\
0
\end{array} \right)
\right\}
\qquad
V \quad = \quad
\left( \begin{array}{ccc}
0 \\
1\\
0
\end{array} \right)^\perp
$$
The matrix we need here is
$$
\left( \begin{array}{ccc}
1 & 0 & 0 \\
-1 & 1 & 0 \\
0 & -1 & 0 \end{array} \right)
$$

I find it hard to deal with the general case. Could you give me some help to establish the statement, or give a counterexemple?
Answer: This is indeed always possible. Let $U$ be some $r$-dimensional subspace of $\mathbb{R}^n$. Let $R$ denote any matrix with rowspace $U$. Since $U$ is $r$-dimensional, it follows that the rank of $R$ is $r$ and so the image of $R$ is also $r$-dimensional.
Let $\mathcal{B}'$ denote a basis for the image of $R$ and extend $\mathcal{B}'$ to a basis $\mathcal{B}$ of $\mathbb{R}^n$. Form the matrix $P$ with columns given by $\mathcal{B}$, with the first $r$ columns consisting of the vectors of $\mathcal{B}'$. It follows that $P$ maps the subspace $S$ spanned by $\left\{\mathbf{e}_1,\ \cdots, \mathbf{e}_r\right\}$ to $\mathrm{im}(R)$ and therefore $P^{-1}$ maps $\mathrm{im}(R)$ to $S$.
Now let $\mathcal{C}'$ denote a basis for $V$ and extend $\mathcal{C}'$ to $\mathcal{C}$. Form the matrix $Q$ with the basis as the columns, with the first $r$ columns consisting of the vectors of $\mathcal{C}'$. It follows that $Q$ takes $S$ to $V$.
Then the matrix $QP^{-1}R$ is your desired matrix. Since $QP^{-1}$ is invertible, the rowspace of $R$ is unchanged, therefore $\mathrm{row}(QP^{-1}R) = U$. Also, $P^{-1}$ maps $\mathrm{im}(R)$ to $S$ and $Q$ maps $S$ to $V$. Therefore $\mathrm{im}(QP^{-1}R) = V$, as required.
Comment: I understand that a map $X \mapsto AX$ does not change the kernel of $X$ if $A$ is invertible, but I don't see how that should work for *the rowspace* of $X$. Could you explain me?
Comment: @KoenraadvanDuin There are two immediate ways to see this. First you note that the kernel is invariant under $X\mapsto AX$. The rowspace is the orthogonal complement of the kernel, hence it is also left invariant. Alternatively, if $A$ is invertible then it can be written as a product of elementary matrices, so the overall effect of $A$ is to perform a sequence of elementary row operations on $X$, which does not change the rowspace.
Answer: Let $m$ be the dimension of $U$ and $V$. Let $M_U$ be an $n\times m$ matrix whose columns are a basis of $U$ and $M_V$ be an $n \times m$ matrix whose columns are a basis of $V$.
Now $U = \{M_U \vec{x} : \vec{x} \in \mathbb{R}^m \}$ and $V = \{M_V \vec{x} : \vec{x} \in \mathbb{R}^m \}$.
We wish to find a matrix $A$ such that
$$
\begin{align*}
U &= \{M_U \vec{x} : \vec{x} \in \mathbb{R}^m \} = \{A \vec{x} : \vec{x} \in \mathbb{R}^n \}, \\
V &= \{M_V \vec{x} : \vec{x} \in \mathbb{R}^m \} = \{A^T \vec{x} : \vec{x} \in \mathbb{R}^n \}.
\end{align*}
$$
We note that $\{ M_V^T \vec{x} : \vec{x} \in \mathbb{R}^n\} = \mathbb{R}^m$, because the rank of $M_V^T$ is $m$ and it has $m$ rows. Thus
$$
U = \{M_U \vec{x} : \vec{x} \in \mathbb{R}^m \} = \{M_U M_V^T \vec{x} : \vec{x} \in \mathbb{R}^n \}.
$$
But this immediately suggests that $A=M_U M_V^T$, because $\mathrm{span}(M_U M_V^T) = U$. By symmetry, also $\mathrm{span}(M_V M_U^T) = V$, and because $A^T=M_V M_U^T$, we are done.
Comment: I don't understand what you mean by $M_U^T$, could you please tell me?
Comment: @KoenraadvanDuin Transpose of the matrix $M_U$.
Comment: right, I forgot about that.


What if we found many points satisfying KKT conditions

Question: I have the following convex optimization problem:
\begin{equation}
\begin{aligned}
\max_{x} & \quad f(X)\\
s.t. &\quad \sum\limits_{j=1}^N A_{ij}X_{ij} -  \sum\limits_{j=1}^N A_{ji}X_{ji}= 0, \forall i\\
& \quad 0 \leq X_{ij} \leq 1, \forall i, j =1, 2, \cdots, n
\end{aligned}
\end{equation}
Since we have infinite points satisfying $\sum\limits_{j=1}^N A_{ij}X_{ij} -  \sum\limits_{j=1}^N A_{ji}X_{ji}= 0$, then I got many points (cannot enumerate all points) satisfying KKT conditions.
Here for this problem, it satisfies Slater's condition and thus we have strong duality.
So I am wondering if this case happens and then should I say all of these points are optimal???

Re-edit:
$f(X)$ is concave.
Actually, I can find one feasible solution from the linear system $\sum\limits_{j=1}^N A_{ij}X_{ij} -  \sum\limits_{j=1}^N A_{ji}X_{ji}= 0$ and it satisfies all of the KKT conditions.
I am just wondering if I can take this solution as the optimal one due to the strong duality. If that's true, I do not need to verify other solutions from $\sum\limits_{j=1}^N A_{ij}X_{ij} -  \sum\limits_{j=1}^N A_{ji}X_{ji}= 0$.
Comment: Not all points satisfying $\sum\limits_{j=1}^N A_{ij}X_{ij} -  \sum\limits_{j=1}^N A_{ji}X_{ji}= 0$ satisfy the KKT conditions! Those will at the very least limit you to the corners of the feasible region. There is a large number of those, but there are finitely many.
Comment: @MishaLavrov Thanks for your reply. Yes, I just cannot verifies every solution from the linear constraints. But I can find one feasible solution satisfying all of the KKT conditions. So I am wondering if this solution is the optimal one and then I do not need to verify other solutions.
Comment: That's not what your question is asking. Can you edit your question to be more clear about what you want to know?
Comment: Sure, sorry for the trouble.
Comment: Also, the KKT conditions are for *minimizing* a convex function, not for maximizing it...
Answer: If you have found a point that satisfies the KKT conditions, then it is an optimal solution. It will be the unique optimal solution when $f$ is strictly concave; otherwise, it's possible that there are multiple equally good optimal solutions.
Some fine print about the properties we're using:

We need to be looking at a convex program in order to draw this conclusion from the KKT conditions in gradient form. But if you have a point that satisfies the KKT conditions in saddle point form, you don't need convexity. Admittedly, verifying the KKT conditions in saddle point form is less practical.
The Slater condition on convex programs isn't necessary for this direction. Its purpose is to rule out cases in which no point satisfies the KKT conditions, but a degenerate optimal solution exists. (So if the KKT conditions have no solution, you need something like the Slater condition to conclude that there is no optimal solution. But for a bounded convex program, that's impossible anyway.)


How to select most recent record for each ID

Question: I am going to financial data of peers of a company. I have 10 peers for a particular company and the financial data is captured at regular intervals (monthly, quarterly, etc). However since the data capturing does not happen for all together I end up having different most recent update date.
What I want to do is to select most recent row for each peer company ID in a way that I end up having only 11 rows in my table i.e. (1 for my company and 10 peers)
Below is the code that I am running as of now
select * from Financials_table

where PRD_END_DT = (select max(PRD_END_DT) from Financials_table ) -- Selecting the latest period end date
''')
peers_df.createOrReplaceTempView('peers_df')
print(shape('peers_df'))
head('peers_df', 50)

Note that I have a list of peers stored in peers_list and I'd like to get the most recent PRD_END_DT for each of the peers. Now what I am running returns the most recent PRD_END_DT value but not all peers have data as on that date.
Comment: Which DBMS are you using?
Answer: There are several ways to get the most recent row per company ID. You haven't tagged your request with your DBMS, so some methods may work for you while others may not yet be supported by your DBMS. Here are some options:
Get the maximum prd_end_dt per company_id. Then select the matching rows:
select *
from table
where (company_id, prd_end_dt) in
(
  select company_id, max(prd_end_dt)
  from financials_table
  group by company_id
)
order by company_id;

Select the rows for which no newer prd_end_dt exists for the company_id:
select *
from financials_table ft
where not exists
(
  select null
  from financials_table newer
  where newer.company_id = ft.company_id
  and newer.prd_end_dt > ft.prd_end_dt
)
order by company_id;

Get the maximum prd_end_dt on-the-fly. Then compare the dates:
select *
from
(
  select ft.*, max(prd_end_dt) over (partition by company_id) as max_prd_end_dt
  from financials_table ft
  group by company_id
) with_max_prd_end_dt
where prd_end_dt = max_prd_end_dt
order by company_id;

Rank each company's rows per date and only keep the newest:
select *
from financials_table
order by rank() over (partition by company_id order by prd_end_dt desc)
fetch first row with ties;

Comment: The very first solution worked. Really simple way of going about it.


There is not enough space on the disk on ASP.NET application

Question: I have the following setup on the Windows IIS machine with .NET 4.0 installed.
2 drives, C and D. The inetpub folder which contains my websites are on the D drive.
My only web site saves the attachments to the D drive.
My C drive has got no space on it (for arguments sake 0kb).
Why would I get the following error when attempting to 'upload' attachments via the website to the D drive when the C drive is the one that's without space? Does .NET for example first copy it in a temp folder on C drive?
Here's the error:
[IOException: There is not enough space on the disk.
]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +9718418
   System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) +9555882
   System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count) +146
   System.Web.TempFile.AddBytes(Byte[] data, Int32 offset, Int32 length) +32
   System.Web.HttpRawUploadedContent.AddBytes(Byte[] data, Int32 offset, Int32 length) +8788874
   System.Web.HttpRequest.GetEntireRawContent() +9035719
   System.Web.HttpRequest.GetMultipartContent() +68
   System.Web.HttpRequest.FillInFormCollection() +247
   System.Web.HttpRequest.get_Form() +104
   System.Web.HttpRequest.get_HasForm() +9036655
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
   System.Web.UI.Page.DeterminePostBackMode() +69
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135

Comment: yes, the file is temporarily copied to the "Temporary ASp.NET Files" folder on the C drive.
Answer: The temp folders used by your IIS is on C drive. That is the one causing this issue.
IIS is trying to write the files into the temporary files which is usually located under C:\Windows\Microsoft.net\Framework\<version>\Temporary ASP.NET Files
Answer: type "run" in Search text box and Press Enter button, then click on "Run".
Now type %temp%  inside the Run textbox and press OK button.
Now it will be Open all the temporary file location i.e "C:\Users\ASUS\AppData\Local\Temp"
Now delete all the files of this folder as possible.
Answer: Even, i faced the same weird error when i run my wcf service. After deleting the temp asp.net files from C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. I was able to run again.
Answer: Run it as administrator, using the right-click menu. Restart your computer if necessary. This was helpful for me.


(DISCORD.JS) how do i fix my discord "cmds" command?

Question: I was wondering how do I fix my "cmds" command? I can't seem to get it to work properly. It's supposed to get all the commands and add a field with the commands name and description to a embed but instead shows up with this error also the file tree is here
<code>module.exports = {
    name:'cmds',
    description:'Literally shows the commands thats it.',
    aliases:'',
    execute(client,msg,args,blacklisted){
        const fs = require('fs')
        const {MessageEmbed} = require("discord.js")
        const embed = new MessageEmbed()
        function getCommand(cmd){
            return client.commands.get(`${cmd}`)
       }
       const commandFiles = fs.readdirSync('.').filter(file => file.endsWith('.js'));
       for (const file of commandFiles){
        const command = require(`./${file}`)
        embed.addField(command.name,```${command.description}```)
        }
        const author = msg.author
        const user = msg.mentions.members.first() || msg.author;
        const useronly = msg.mentions.users.first()
        if (blacklisted.includes(author.id)){
            msg.reply(`You have been blacklisted from using this bot. if you think this is a mistake contact the bot owner.`)
        }else{
        embed.setTitle(`Commands`)
        embed.setColor('RANDOM')
        msg.reply({embeds : [embed] })
        }
    }
}
</code>
Answer: i solved it own by doing this
<code> function getCommand(cmd){
        return client.commands.get(`${cmd}`)
   }
   console.log(getCommand('avatar').name)
    const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
    for (const file of commandFiles){
        const command = require(`./${file}`)
        embed.addField(`${command.name}`,`\`\`\ ${command.description} \`\`\ `)
    }
</code>
Comment: the `console.log(getCommand('avatar').name)` was for testing


BigQuery - GA - Select LAST values from other table with multi match

Question: What I'm trying to do in BigQuery using data from Google Analytics:

get the list of product impressions and clicks from Google Analytics, together with additional data (productListName, productListPosition, Test etc.) - aka "listTable"

get the list of transactions, that are associated with those clicks - aka "transTable"

populate the missing field values in "transTable" with values from "listTable"
-- Test
-- productListName
-- productListPosition
-- Sponsored
-- searchResultType

Match those missing values by a combination of date, fullVisitorID, visitID (I assume those are how you define sessionID) and productSKU.

Given that there may be multiple matches, I'd take the last value (ordered by hitNumber)

Combine "listTable" and "transTable"

I'm having a problem with steps 3 to 5, so I've set the required values as NULL for now in the "transTable".
Here is my code so far:
WITH
  listTable AS (
  SELECT
    *
  FROM (
    SELECT
      date,
      fullVisitorID,
      visitID,
      (
      SELECT
        value
      FROM
        UNNEST(hits.customdimensions)
      WHERE
        INDEX = 58
      GROUP BY
        value ) AS Test,
      hits.hitNumber,
      CASE
        WHEN product.isImpression = TRUE THEN "Impression"
        WHEN product.isClick = TRUE THEN "Click"
    END
      AS Action,
      productListName,
      product.productListPosition AS productListPosition,
      (
      SELECT
        value
      FROM
        UNNEST(product.customdimensions)
      WHERE
        INDEX = 68
      GROUP BY
        value ) AS Sponsored,
      (
      SELECT
        value
      FROM
        UNNEST(product.customdimensions)
      WHERE
        INDEX = 76
      GROUP BY
        value ) AS searchResultType,
      product.productSKU,
      product.productPrice / 1000000 AS Price
    FROM
      `ga_sessions_20230603`,
      UNNEST (hits) AS hits,
      UNNEST (hits.product) AS product
    WHERE
      productListName IN ( "searchpage",
        "categorypage",
        "dropdown_initial",
        "dropdown_results" )
      AND ( product.isImpression = TRUE
        OR product.isClick = TRUE ) )
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC,
    productListPosition ASC ),

  transTable AS (
  SELECT
    date,
    fullVisitorID,
    visitID,
    NULL AS Test,
    hits.hitNumber,
    CASE
      WHEN hits.eCommerceAction.action_type = "6" THEN "Purchase"
  END
    AS Action,
    NULL AS productListName,
    NULL AS productListPosition,
    NULL AS Sponsored,
    NULL AS searchResultType,
    product.productSKU,
    product.productPrice / 1000000 AS Price
  FROM
    `ga_sessions_20230603`,
    UNNEST (hits) AS hits,
    UNNEST (hits.product) AS product
  WHERE
    hits.eCommerceAction.action_type = "6"
    AND CONCAT(date, fullVisitorID, visitID) IN (
    SELECT
      DISTINCT CONCAT(date, fullVisitorID, visitID)
    FROM
      listTable
    WHERE
      Action = "Click" )
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC )

SELECT
  *
FROM
  listTable
UNION ALL
SELECT
  *
FROM
  transTable

I think I can use LAST_VALUE(), but can't figure out how to use it properly - it seems similar to the problem I've had earlier:
One of the previous row value with condition
Not sure if I can use LAG() here, after combining tables.
Could you help me out, please?
Answer: Eventually, I've solved my problem exactly like here:
One of the previous row value with condition
WITH
  listTable AS (
  SELECT
    *
  FROM (
    SELECT
      date,
      fullVisitorID,
      visitID,
      (
      SELECT
        value
      FROM
        UNNEST(hits.customdimensions)
      WHERE
        INDEX = 58
      GROUP BY
        value ) AS Test,
      hits.hitNumber,
      CASE
        WHEN product.isImpression = TRUE THEN "Impression"
        WHEN product.isClick = TRUE THEN "Click"
    END
      AS Action,
      productListName,
      product.productListPosition AS productListPosition,
      (
      SELECT
        value
      FROM
        UNNEST(product.customdimensions)
      WHERE
        INDEX = 68
      GROUP BY
        value ) AS Sponsored,
      (
      SELECT
        value
      FROM
        UNNEST(product.customdimensions)
      WHERE
        INDEX = 76
      GROUP BY
        value ) AS searchResultType,
      product.productSKU,
      product.productPrice / 1000000 AS Price,
      CONCAT(date, fullVisitorID, visitID, productSKU) AS listKey
    FROM
      `gap2-144306.73525272.ga_sessions_20230603`,
      UNNEST (hits) AS hits,
      UNNEST (hits.product) AS product
    WHERE
      productListName IN ( "searchpage",
        "categorypage",
        "dropdown_initial",
        "dropdown_results" )
      AND ( product.isImpression = TRUE
        OR product.isClick = TRUE )
      AND (
      SELECT
        value
      FROM
        UNNEST(`gap2-144306.73525272.ga_sessions_20230603`.customDimensions)
      WHERE
        INDEX = 12
      GROUP BY
        value ) NOT IN ("business",
        "robot",
        "wholesale"))
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC,
    productListPosition ASC ),

  ini_transTable AS (
  SELECT
    date,
    fullVisitorID,
    visitID,
    "NULL" AS Test,
    hits.hitNumber,
    CASE
      WHEN hits.eCommerceAction.action_type = "6" THEN "Purchase"
  END
    AS Action,
    "NULL" AS productListName,
    NULL AS productListPosition,
    "NULL" AS Sponsored,
    "NULL" AS searchResultType,
    product.productSKU,
    product.productPrice / 1000000 AS Price,
    CONCAT(date, fullVisitorID, visitID, productSKU) AS transKey
  FROM
    `gap2-144306.73525272.ga_sessions_20230603`,
    UNNEST (hits) AS hits,
    UNNEST (hits.product) AS product
  WHERE
    hits.eCommerceAction.action_type = "6"
    AND CONCAT(date, fullVisitorID, visitID, productSKU) IN (
    SELECT
      DISTINCT listKey
    FROM
      listTable
    WHERE
      Action = "Click" )
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC ),

  ini_uTable AS (
  SELECT
    *
  FROM
    listTable
  UNION ALL
  SELECT
    *
  FROM
    ini_transTable
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC),

  uTable AS (
  SELECT
    date,
    fullVisitorID,
    visitID,
  IF
    (Action = "Purchase", LAST_VALUE(
      IF
        (Action != "Purchase", Test, NULL) IGNORE NULLS) OVER (PARTITION BY listKey ORDER BY hitNumber ASC), Test) AS Test,
    hitNumber,
    Action,
  IF
    (Action = "Purchase", LAST_VALUE(
      IF
        (Action != "Purchase", productListName, NULL) IGNORE NULLS) OVER (PARTITION BY listKey ORDER BY hitNumber ASC), productListName) AS productListName,
  IF
    (Action = "Purchase", LAST_VALUE(
      IF
        (Action != "Purchase", productListPosition, NULL) IGNORE NULLS) OVER (PARTITION BY listKey ORDER BY hitNumber ASC), productListPosition) AS productListPosition,
  IF
    (Action = "Purchase", LAST_VALUE(
      IF
        (Action != "Purchase", Sponsored, NULL) IGNORE NULLS) OVER (PARTITION BY listKey ORDER BY hitNumber ASC), Sponsored) AS Sponsored,
  IF
    (Action = "Purchase", LAST_VALUE(
      IF
        (Action != "Purchase", searchResultType, NULL) IGNORE NULLS) OVER (PARTITION BY listKey ORDER BY hitNumber ASC), searchResultType) AS searchResultType,
    productSKU,
    Price,
    listKey
  FROM
    ini_uTable
  ORDER BY
    date,
    fullVisitorID ASC,
    visitID ASC,
    hitNumber ASC )

But I'm pretty sure there is a more elegant solution than my brute-forcing through the problem.
I'll appreciate any suggestions.


What's recommended for the number of users to use in qualitative and quantitative testing?

Question: I'm currently rebuilding our entire intranet from scratch, mostly because the tech behind is out-dated and it has been proved that a lot of information is difficult to find.
Though that is beside the point, what I am wondering is what would be the optimum amount of users to use for qualitative and quantitative testing with a userbase of around 1000 users?
Is there a general rule of thumb for both based on the total number of users you have? or is it just say 5 for qualitative and 10 for quantitative?
What would be the best approach?
Comment: You'll probably be able to get fairly qualitative with 4-5 people. Remember Steve Krug's words: it ain't rocket surgery.
Comment: This might *also* be a good question for http://stats.stackexchange.com.
Comment: I'll drop a post on there too then.
Answer: In Why You Only Need to Test with 5 Users Jakob Nielsen suggests:

The best results come from testing no more than 5 users and running as many small tests as you can afford.

However, rather than focusing on the number of users, it might be better to focus on the number and quality of the tasks:

Usability test tasks are so critical that some people argue they are even more important than the number of participants you use: it seems that how many tasks participants try, not the number of test participants, is the critical factor for finding problems in a usability test.
Comment: 5 users are ok in qualitative testing, but not sufficient for statistically significant results. But of course, what is the point of proving that the new task can be carried out significantly faster?
Answer: I don't have a reference for this, but I would think that these numbers would depend on the size of the user base.
For qualitative testing you need to have "typical" users. So if you have 3 roles your users can take you need at least 3 users - one for each role. In reality you'd want more than one, but this is your absolute minimum.
For quantitative testing you need a significant proportion of your user base. I don't know what that number would be, but if you take your user base and 10% as a figure you'll need 100 users. However, this might be unrealistic - there might be no way you can manage that many users, or if you've got a small user base it would produce a very small number.
Answer: Something else to consider is where the result of your usability report is going. How much work can the people downstream from you fix - and what will the effect of those fixes be?
Say I run a test with fifteen people. After the first three I've spotted problems A B C. By the end of the fifteen I've also spotted problems D E F G.
The problem is that the team downstream from me only have time to fix A and B.
Even worse - once we've fixed A and B the system has changed, and the next most serious usability issues may well not be C-G.
So I'd look at the whole cycle time of your product development folk - and only do just enough usability testing to fill the queue of work. Any more than that is likely to be waste.
It's been my experience that doing more usability tests with fewer partipants (even just one)spread throughout the development process is far more effective than few large tests.
Answer: For quantitative testing, it's possible to be more explicit about the effect of the sample size on your results but the number of users you need depends on the particular tests or analyses you are considering (examples could be determining the proportion of participants successfully completing a task, estimating the average time-on-task, comparing two versions with a questionnaire like the SUMI or the SUS…) It's therefore difficult to give a rule of thumb that would be useful for all situations but there are techniques to find out the sample size you need in a given situation.
Now, if you don't want to go over all this trouble and actually estimate things like confidence intervals and statistical power, there are still two important conclusions to remember.
The first one is that the precision of the estimate and therefore the number of users you need to achieve a given level of precision do not depend on the size of your user base, at least as long as this user base is much larger than your test sample. The second one is that the bigger your sample size is, the smaller the improvement you can expect from additional test users will be. Thus, going from 10 to 110 is a huge improvement, going from 1000 to 1100 not so much.
That's why opinion polls often have samples of about 1000 participants, even when the population of interest includes several millions people. In fact, the sample size for a pre-election poll will typically be very similar in countries with 5, 80 or 200 millions inhabitants. As long as your sample is random and the population is much larger, it does not matter if you are asking only 1%, 0.1% or 0.00001% of the total number of voters.
Both of these conclusions are still true for other things than percentages: for example comparisons between ratings on a satisfaction questionnaire or analyses of the time it takes to complete a task. If you want to go futher, one good starting point is Jeff Sauro's website http://www.measuringusability.com/


debugger; [ERROR] 194:11:identifier is a reserved word

Question: I add jsrender into my project, but when I made a deploy, sendme
> Errors found for public/js/xxxxxxxx/jsrender.js
>  > [ERROR] 194:11:identifier is a reserved word
>  > [ERROR] 1:0:Compilation produced 1 syntax errors.

this line made references to this var debugger;
¿How can I change the name without break the library?
Comment: Where did you get the package from?
Comment: I downloaded from github
Answer: debugger itself is a reserved word in Javascript and is commonly used for debugging, so you can't declare a variable with that name :
var debugger; // This doesn't work
debugger;     // This should work (common-use of debugger)

Taking A Look Into jsrender.js
Based off looking at the assumed markup for jsrender.js for the line that you referenced, it appears to just be a debugger call, which should work :
function dbgBreak(val) {
    // Usage examples: {{dbg:...}}, {{:~dbg(...)}}, {{dbg .../}}, {^{for ... onAfterLink=~dbg}} etc.
    try {
        debugger; // THIS IS THE LINE REFERENCED
        console.log("JsRender dbg breakpoint: " + val);
        throw "dbg breakpoint"; // To break here, stop on caught exceptions.
    }
    catch (e) {}
    return this.base ? this.baseApply(arguments) : val;
}

Based off of this, I don't see any reason that this specific line would cause a problem, unless there is some other syntax error that is present.
Comment: I investigate the function  debugger in js, but I look in the entire project and its not declare in other part, this error sendme a hook when i tried to make a commit.
Answer: You can't use "debugger" as a variable name.
Answer: JsRender does not declare a var debugger;. It looks like your error is thrown by a compile step. What software is outputting that error? What is your build/deploy process?
It may be that you are using YUICompressor, which has a related bug - and that the error is thrown by YUICompressor while minifying...? See https://github.com/BorisMoore/jsrender/issues/239. A workaround for your environment would be just to comment out //debugger; Doing so will not break anything.


Get Bytecode from a not loaded java class

Question: I have a project with a folder "input" that contains a few java files(e.g. test.java).This folder is not a source root and that's right. I only want to analyze the files in the input folder with my program.
One target is it to get the bytecode from the files in the input folder and save it in a string.
I read a lot about getting bytecodes from classes(java agents,bcel) but it's not very clear to me how I should start.
Do you have any ideas and tips for me ?
Edit:
 I compiled my files and saved it into a byte array. I used javaassist library as mentioned by someone. My code is now:
    ClassPool pool = ClassPool.getDefault();
    CtClass cc = pool.get("Test");
    byte[] b = cc.toBytecode();

System.out.println(Arrays.toString(b));

As result I am getting:
[-54, -2, -70, -66, 0, 0, 0, 52, 0, 93, 10, 0, 25, 0, 52, 8, 0, 53, 7, 0,...,115]

How can I get from the byte array the "human readable" form of bytecode for example:
iconst_0      // 03
istore_0      // 3b
iinc 0, 1     // 84 00 01
iload_0       // 1a
iconst_2      // 05
imul          // 68
istore_0      // 3b
goto -7       // a7 ff f9

Anyone has some idea?
Comment: If the files are `.java` files, you'd need to compile them to get the bytecode.
Comment: Do you want the actual byte code or it's human-readably, assembly-like form?
Comment: Maybe try https://jboss-javassist.github.io/javassist/tutorial/tutorial.html , first example.
Comment: I would like to save both forms. I am still unsure which one of them I will use later, so it would be clever to save for the beginning both forms.
Comment: There are some possibilities to create the bytecode from `.java` files **at runtime**, using the `JavaCompiler` API. See [this question and answers](http://stackoverflow.com/questions/935175/convert-string-to-code) for some examples (the question refers to a "String", but the answers show the use of the `JavaCompiler` API that could be applied to `.java` files as well)
Comment: On the command line, just `javap -c Test`
Answer: "bytecode" refers to compiled classfiles. It doesn't make sense to ask how to get bytecode from a .java file because there is no bytecode to get. You need to compile them with javac, Eclipse, or similar. Then you can just read the resulting .class files any way you want.
Edit: To convert the classfile into a human readable form, you need a disassembler. A limited disassembler called javap is included in the JDK, so the simplest approach would be to just use that. Alternatively, you can use the Krakatau disassembler, which supports a lot more advanced features than javap.
Comment: If I compiled my file and save the bytecode in a byte array, how can I get the human readable form of bytecode? See my edit, there is an example.
Comment: @vizero I  updated my answer. You need a disassembler, such as javap or Krakatau.


Boost Phoenix (or Boost Lambda) - taking a pointer lazily

Question: Is there a way of taking a pointer of a lazy phoenix value / ref ? If so how ?
Answer: Phoenix placeholders overload operator&(), therefore a simple &_1 should do the trick (see Phoenix docs here).
Comment: Wow I'm surprised that it is indeed that simple :D


Decrease dust in an old house, forced air

Question: My house was built in 1940.  I have noticed the forced air pushes out a lot of dust.  This is evident from lint collecting on the bathroom vanity below a vent.  It only collects lint during Summer and Winter when the forced air is blowing.  I change the air filter every month but there's still significant dust.  How effective would it be to hire someone to clean the vents?  Is there a DIY option?
I've heard the amount of dust depends on how tightly the house is built.  This makes me think that with such an old home, cleaning the vents would only be a temporary fix.
Answer: i would suggest having an HVAC contractor visit to examine all of your ductwork.  My guess would be there are wholes, gaps, or rips in the ducts whereupon the system in operation is pulling the dust in from wall cavities, basement or attic (depending on where the ductwork runs).  Once the contractor (or yourself) seals up and/or replaces any ductwork then you could consider having them vacuumed out.  Also, you should probably put this high on your priority list because interior air quality is really important for controlling allergies and general health.  Good luck!
Comment: I'd be surprised if your ductwork is in the walls, but I'm not familiar with all types of construction. In a 1940s house like yours ductwork is typically run in a basement or crawl space then to floor vents.  2nd stories are accessed via a chase that runs in the wall but then the lines feed out from there. With this kind of setup a contractor should be able to visually inspect most of the ductwork and find leaks when the system is running.  In fact, i haven't heard of an HVAC contractor using a camera - the ones i'm familiar with don't typically extend long enough.
Comment: I would think they could use cameras on extendible  devices to inspect the ductwork, right? Would sealing the ducts require removing walls or are there ways to seal the ducts from the inside without removing walls?
Comment: Much of the horizontal vents are visible in the basement, where they line up with the different rooms above.  As mentioned, these should be easy to check and seal.  The vertical vents are much less accessible, particularly those going from the basement to the 2nd floor.  I don't see how to inspect these without removing the 1st floor walls or using a camera.  I do know that many of the vent covers do not line up well with the vents (problems with old and new sizing) so there are gaps there I could improve.
Comment: This is a temporary fix while you get someone in to look and fix the problem. My brother in-law had a couple of broken ducts dumping dust/dirt into 2 rooms.  While it was addressed he put dryer sheets behind the vent to capture the dust.


How to properly set rails secret_key_base in production?

Question: I have a rails app that will run on 3 web instances behind a load balancer.
I understand that the secret_key_base must be the same across the 3 instances.
Whats a good way to keep it synced without having to set the environment variable manualy on each instance?
Answer: Just initialize them during deploy of your Rails application (i.e. put it to .bash_profile or define env variable in command which run your Rails server, etc.) or during provisioning your servers use such tools like Puppet, Chef, Ansible, etc.
You have a lot of ways to make it automatically. Just choose one.
Answer: If it's only going to be 3 instances that's not a key than ever changes so you could set it once in /etc/environnement on 3 instances and forget it.
If you are planning on deploying more instances I would suggest you to try https://www.docker.com/ you will have an automatic deployment system that lets you set specifics


Filter rows by full name

Question: I have a column with a full name I need to filter like this:
For example, this is my grid:
Name        | Phone
dan liza    | 9758856526
dana Lori   | 8855656264

If I type in the filter textbox "Lori dana" I want it to find it.
I can type only "dana" or "Lori" or the full name but "Lori" and then "dana" not in the same order as in the grid.
Answer: Split the filter input into terms (in this case, words) then require that each word is present. Like so:
If you're using Linq with Entity Framework:
String textBoxInput = "Lori dana";
String[] terms = textBoxInput.Split( (Char[])null, StringSplitOptions.RemoveEmptyEntries ); // Splitting on `null` splits on all whitespace.

IQueryable<People> q = yourDbContext.People;
foreach( String term in terms )
{
    q = q.Where( p => p.Name.Contains( term ) );
}
List<People> filteredPeople = await q.ToListAsync();

If you're using Dynamic SQL (note this particular approach is not vulnerable to SQL injection):
String textBoxInput = "Lori dana";
String[] terms = textBoxInput.Split( (Char[])null, StringSplitOptions.RemoveEmptyEntries );

SqlCommand cmd = connection.CreateCommand();
StringBuilder sql = new StringBuilder( @"

SELECT
    *
FROM
    People
WHERE
" );

for( Int32 i = 0; i < terms.Length; i++ )
{
    if( i > 0 ) sql.AppendLine( "    AND" );

    cmd.Parameters.Add( "@term" + i, SqlDbType.NVarChar ).Value = '%' + terms[i] + '%';
    sql.AppendLine( "    [Name] LIKE @term" + i );
}

cmd.CommandText = sql.ToString();

using( SqlDataReader reader = await cmd.ExecuteReaderAsync().ConfigureAwait(false) )
{
    // etc
}

Comment: hi thx for your answer, no I am using ado.net in this project this is what i have try to do :
 ds.Tables[0].DefaultView.RowFilter = string.Format("[{0}] LIKE '%{1}%'", "CustName", toolStripTextBox2.TextBox.Text);

it's work fine if I type first or the last name separated or I type the full name in the exact order like in the DB but If the order are not the same I get nothing
Comment: @TechMan If you're using ADO.NET then use a `DataView` to wrap your `DataTable`. You can also use a custom filter predicate with `DataGridView`.

Filter rows by full name


how to save variables after using header function php

Question: After i submit a form and save the info to a database i use the header function to redirect to a more user friendly url but the variable $checkError is not saving, it gets reset after the header redirect. How can i save the variable even if the page gets refreshed?
if(isset($_GET['submit'])){

// get the post records <<
$id = '2';
$title = $_GET['title'];
$link = $_GET['link'];

// database connection
$con = mysqli_connect("localhost", "user", "password", "db_test");

$sql = "INSERT INTO test (id, title, link)
VALUES ($id, '$title', '$link')";

$rs = mysqli_query($con, $sql);

if($rs){
    $checkError = '
Success!
';
}else{
    $checkError = '
Not working!
';
}

mysqli_close($con);

//redirect to user friendly url
header("Location: /index.php?id={$id}");

}

Comment: to preserve, you can use $_COOKIE or $_SESSION. You should have done some research before you ask. These are basics... and examples are all over the web.. even here..
Answer: You can write this to session data and recall it later, as one potential solution.
Modify/add in your example code block:
session_start();
if($rs){
    $_SESSION['checkData'] = '
Success!
';
}else{
    $_SESSION['checkData'] = '
Not working!
';
}

header("Location: /index.php?id={$id}");

And back on index.php, you would need to add/modify:
session_start();
if( isset( $_SESSION['checkData'] ) ){ // check whether it's set
    echo $_SESSION['checkData']; // output variable
    unset( $_SESSION['checkData']; // reset variable
}

Answer: You can use $GLOBALS OR $_SESSION as an array for $GLOBALS  more details click here
you can use it as the below code in your header file
set value in $GLOBALS
$GLOBALS['checkError'] = '
Success!
';

get value from $GLOBALS
echo $GLOBALS['checkError'];

Answer: You have to store your data in cookies or sessions before the redirect.
A session is also used to store data, but I suggest you store data in cookies because the session stores data on the server-side, creating performance issues, whereas cookie stores data on the client-side.
You can check the critical difference of Cookie and Session
first.php
<?php
    if($rs){
        setcookie('checkError', '
Success!
');
    }else{
        setcookie('checkError', '
Not working!
');
    }
?>

second.php
<?php
    if(!isset($_COOKIE['checkError'])) {
        echo $_COOKIE['checkError'];
    }
?>

I hope this is helpful to you.
Answer: Another way, very easy to implement is to skip $checkError variable and redirect user to a specific page:
// ...
$rs = mysqli_query($con, $sql);
mysqli_close($con);
$page = $rs ? 'success' : 'failure';
header("Location: /{$page}.php?id={$id}");


Too many Partitions on drive, can't dual boot ubuntu alongside win8 on Thinkpad

Question: I have a Thinkpad S431 with Windows 8. It has a 128gb SSD, and My partitions are WINRE_DRV, Windows8_OS, Lenovo_Recovery, 7gb Hibernation Partition. I also have allocated 20gb for Ubuntu.
When I tried to install Ubuntu, it told me that I have too many OS's on the machine, and the new partition I created is labeled "unusable".
What can I do?
Edit: Volume type is MBR.
I have deleted an unnecessary windows 8 partition from Gparted in the Try Ubuntu option. From there I have also formatted the drive to be ext4 on /dev/sda4 Now the problem is that Ubuntu will not install as "root file system is not detected"
I used ext2 as the filesystem for Ubuntu, and mount as '/'. This solved my problems!
Comment: I would start by editing your question to specify whether your disk is using an MBR or GUID style partition table. You can find this out in Windows 8 by going to Start/Control Panel/System and Security/Administrative Tools/Computer Management/Disk Management and then right in the bottom half of the screen right click on THE disk (not a partition), and choose properties. Under the volumes tab it will list a partition style.
Comment: I updated it with the volume type. I also added what I have done and the current problem that I am getting.
Comment: I assume that you deleted one of your partitions to get past the max 4 primary partitions on MBR systems? What type of partition did you make on the free space? Primary, or Extended?
Comment: The reason that I ask is that you will likely want a swap partition in which case you need an extended partition with 2 logical parititions. However this isn't the only way to handle the situation. Some people don't want swap at all because they have lots of ram, others prefer to use a swapfile. You partition type should be visible with Gparted.
Comment: Yep I deleted the Hibernation partition, as it is not needed for win8. I shrunk the main OS' partition and used that space and created an ext2 file system. Didn't bother with file swap though, only have 4gb of RAM on this laptop right now!
Answer: You must make extended partitions. A MS-DOS partition table allows a maximum of 4 primary partitions.
Don't try to shrink or split a primary partition in two that is located before the extended partitions because you may alter partition table.

I also have allocated 20gb for Ubuntu.

Instead of allocating Ubuntu partitions from Windows, you should delete/shrink partitions to leave empty space in Windows. Then let Ubuntu partition manager create partitions on that empty space.
Comment: Yes that is what I meant I had done, I shrunk the win8 os partition , to use 20gb for ubuntu.
Comment: @FriarBob windows 8 partition is probably the second and is primary (not extended!). You must shrink an extended partition to be able to make another one and install Ubuntu. You can't have primary-primary-**extended**-primary...
Comment: So I went into try ubuntu and Gparted, I deleted the hibernation Primary drive (already had 4 primary partitions) as it is only there for win8 to have a quicker boot.
Comment: I shrunk my win8 partition and made a new one. Now it is telling me that there is no root file system detected. What should I do now?
Answer: First look at, do all of them(partitions) work as primary partition. IF it is, use partition tool like 'gparted'or 3rd party tool to dis-select any of them who are not working as OS containing partition. This is because, primary partition is only be needed where a partition contain an OS.


MongoDB Query generating same result set for multiple pages

Question: Sample Data in mongodb collection attached as image.

Query with sort and limit.
Same Data Getting populated in multiple result set.
Page 1 ->Query
db.user_profile.find({},{ email: 1}).skip(0).limit(3).sort( {isEnabled:-1,firstName:1} )
Page 2 ->Query
db.user_profile.find({},{ email: 1}).skip(3).limit(3).sort( {isEnabled:-1,firstName:1} )
Page 3 ->Query
db.user_profile.find({},{ email: 1}).skip(6).limit(3).sort( {isEnabled:-1,firstName:1} )

Comment: Please look at this: https://stackoverflow.com/questions/38050779/mongodb-sort-with-skip-and-limit-not-sort-the-record-according-to-index. `$sort` should be before `$skip`
Comment: Does this answer your question? [mongodb sort with skip and limit not sort the record according to index](https://stackoverflow.com/questions/38050779/mongodb-sort-with-skip-and-limit-not-sort-the-record-according-to-index)
Comment: @nimrodserok  no after updating query it is not working. When I sort int or date it works well. But for String it is not working.
Comment: `isEnabled` is not on the schema that you provided. Is this by mistake?
Comment: @nimrodserok
Yes there is one more field isEnabled . and it is boolean.
Answer: You Need to project what you are sorting. One way to do it is:
db.user_profile.find({},{ email: 1, isEnabled: 1, firstName:1}).skip(3).limit(3).sort( {isEnabled:-1,firstName:1} )

Notice the projection of isEnabled and firstName that were missing before. This is a simple query but will result in adding two more fields to the output.
If you want to return only the email, you can use an aggregation pipeline that will remove the projection on a latter stage:
db.user_profile.aggregate([
  {
    $sort: {isEnabled: -1, firstName: 1}
  },
  {$skip: 0},
  {$limit: 3},
  {$project: {email: 1}} // or {$project: {email: 1, _id: 0}}
])

You can see the aggregation example working on the playground
Comment: yes I did this , still not working
Comment: https://ibb.co/F5Vz6qG
Query
Comment: In your picture you are sorting by first name, and the arrows shows the email. You are not sorting by email


Limit involving log and exponential

Question: How can I show that the following is true?
$$\lim _{n \rightarrow \infty} n^{(2 n+1) /(2 n)} \log \left(\frac{a}{n}+1\right)=a$$
I have tried using the L'Hôpital's rule since $\log \left(\frac{a}{n}+1\right)$ tends to zero, but the derivative of
$1/n^{(2 n+1) /(2 n)}$ is not very nice.
Answer: Just write
\begin{eqnarray*} n^{(2 n+1) /(2 n)} \log \left(\frac{a}{n}+1\right)
& = & \sqrt{n^{\frac 1n}} \log \left(\left(1+\frac{a}{n}\right)^{n}\right) \\
&\stackrel{n\to\infty}{\longrightarrow} & \sqrt 1 \cdot \log \left(e^a\right) = a
\end{eqnarray*}
Answer: $n^{(2n+1)/2n}=n (n^{1/2n})$ and $n^{1/2n} \to 1$. So you only have to show that $n \log (\frac an +1) \to a$ which can be proved by applying L'Hopital's Rule to limit of  $\frac {\log (ax+1)} x$ as $x \to 0$ .

Limit involving log and exponential


How can i image upload on another Ruby on Rails application using paperclip?

Question: I have Two Application.

Spree Application
Rails Application

I have configure 1 module.
That module have image upload functionality.
I have to upload image in another application which is Rails Application.
How can i configure two application each other ?
How can i upload image on another Rails application and get URL back to Spree Application and that URL store in Spree Application ?
Comment: Are these applications hosted on the same server?
Comment: @davidb, right now i am working localy. After completed then i will deploy.
It may be on Same server.
Comment: Can you please post the Paperclip specific content of the module your tablking about and also the module in the second application where you want the image too.
Comment: @davidb, First Application i want to just app data with image but only image store in Second Application not in First Application, But First Application have one table with field Name,ImagUrl .
In ImageUrl is a string and it store ImageUrl which is stored in Second Application.
My purpose is that not load on single application for Image.
Also Mobile Developer use that application via API.
Comment: @davidb, I give one example.

For example I user AWS for storing image using paper clip. But i want to image upload on Rails Application instead of AWS. It is easy to understand.
Answer: I Found Answer.
This Answer for Two Application Hosted in Same Server.
First Application Which is in Spree. It have Image Model with attachment Field.
Change Code in "path" and "url" to upload image on another rails application which is hosted in same server.
For Example :
has_attached_file :attachment,
<code>      styles: { mini: '48x48>', small: '100x100>', product: '240x240>', large: '600x600>' },

      default_style: :product,

           url: "#{MEDIASERVER_URL}/spree/products/:id/:style/:basename.:extension",

           path: "#{MEDIASERVER_PATH}/public/spree/products/:id/:style/:basename.:extension",

          convert_options: { all: '-strip -auto-orient -colorspace sRGB' }
</code>
MEDIASERVER_URL is a url to getting image from remotely. for example http://localhost:4000
MEDIASERVER_PATH is a path to store image in which location. It is a another rails application . for example /home/ServerName/ProjectName
    enter code here


Invalid length parameter passed to the RIGHT function with CHARINDEX

Question: I am getting the error "Invalid length parameter passed to the RIGHT function" on the following SQL. From what I see is it something to do with the CHARINDEX function. This is on SQL Server 2014. How can this be fixed?
SELECT D.PAYER_TIN, '001', 13679089, YEAR( (CONVERT(CHAR(20),A.PYMNT_DT,121))),
D.PAYEE_TIN, A.VENDOR_ID, D.PAYEE_NAME1, D.PAYEE_NAME2,  D.PAYEE_ADDRESS1,
LEFT(PAYEE_CITYSTZIP,CHARINDEX(',', PAYEE_CITYSTZIP)-1),
SUBSTRING(PAYEE_CITYSTZIP, CHARINDEX(',', PAYEE_CITYSTZIP)+2, 2),
RIGHT(PAYEE_CITYSTZIP, LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)-7),
D.WTHD_BOX1, D.WTHD_BOX2, D.WTHD_BOX7, D.WTHD_BOX18, 0.00
FROM PS_WTHD_TRXN_TBL A, PS_TMP_1099_COPYB D, PS_TMP_1099_PA_VW2 E
WHERE ( A.WTHD_TYPE = D.WTHD_TYPE
     AND A.VENDOR_ID = D.VENDOR_ID
     AND YEAR( A.PYMNT_DT) = '2018'
     AND A.WTHD_CLASS IN ('01','02','07')
     AND A.VENDOR_ID = E.VENDOR_ID
     AND A.VNDR_LOC = E.VNDR_LOC
     AND E.YEAR = '2018'
     AND D.WTHD_CNTL_ID = 'WEST1'
     AND D.WTHD_BOX18 > 0.00)
  GROUP BY  D.PAYER_TIN,  YEAR( (CONVERT(CHAR(20),A.PYMNT_DT,121))),  D.PAYEE_TIN,  A.VENDOR_ID,
   D.PAYEE_NAME1,  D.PAYEE_NAME2,   D.PAYEE_ADDRESS1,  LEFT(PAYEE_CITYSTZIP,
   CHARINDEX(',', PAYEE_CITYSTZIP)-1),  SUBSTRING(PAYEE_CITYSTZIP,
   CHARINDEX(',', PAYEE_CITYSTZIP)+2, 2),  RIGHT(PAYEE_CITYSTZIP, LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)-7),
    D.WTHD_BOX1,  D.WTHD_BOX2,  D.WTHD_BOX7,  D.WTHD_BOX18

EDIT:
Added the following case statement (to the SELECT and GROUP BY) which seems to handle the condition. Turns out there was one row where this column has just a comma (",") (bad user/data input) for it's value so subtracting 7 from 1 would result in a negative number, causing the error.
CASE WHEN PAYEE_CITYSTZIP <> ',' THEN
RIGHT(PAYEE_CITYSTZIP, LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)-7)
ELSE RIGHT(PAYEE_CITYSTZIP, LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)+1) END AS ZIP

Comment: Please isolate the problem to a single column and as few tables as possible.  Along the way, learn to use proper, explicit, **standard** `JOIN` syntax.
Comment: Gordon - I have isolated it to column `RIGHT(PAYEE_CITYSTZIP, LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)-7)`
Comment: I was able to fix the issue but using a Case statement, I have edited the post in case it may help others.
Answer: For the 2nd argument of RIGHT, from:
https://learn.microsoft.com/en-us/sql/t-sql/functions/right-transact-sql?view=sql-server-2017

If integer_expression is negative, an error is returned.

The error you get means probably that this:
LEN(PAYEE_CITYSTZIP) - CHARINDEX(',', PAYEE_CITYSTZIP)-7

returns a negative value.


Determining whether this series converges or diverges (2^n)/(n^n)?

Question: I was wondering how you can determine whether the following series converges or diverges?
$\sum_{n=1}^{\infty}\frac{2^n}{n^n}$
None of the tools I usually use seem to work on this problem (integral Test, comparison Test and ratio Test). Sorry if I'm missing something very fundamental.
Thanks in advance!
Comment: I am pretty sure the ratio test works. Could you show us your work?
Comment: @ Gary Thanks a lot. I got 0 as an answer, and I thought this was the critical value (when it of course was 1).
Answer: It converges because :
$$\forall n \geq 3, 0 \leq \dfrac{2^n}{n^n} \leq \left(\dfrac{2}{3}\right)^n$$
and the geometric series :
$$\sum \left(\dfrac{2}{3}\right)^n$$
converges.
Answer: The root test is the way to go, and gives absolute convergence since
$$\sqrt[n]{\left( \frac 2 n \right)^{n}} = \frac 2 n \xrightarrow{n \to \infty} 0 < 1$$
The ratio test also works. Taking $a_n := (2/n)^n$, then absolute convergence follows, as
$$\left| \frac{a_{n+1}}{a_n} \right| = \frac{2^{n+1} / (n+1)^{n+1}}{2^n / n^n}= \frac 2 n \cdot \left( \frac{n}{n+1} \right)^{n+1} \xrightarrow{n \to \infty} 0 \cdot \frac 1 e = 0 < 1$$
Comment: Could you please explain this step?
$\lim_{n\rightarrow\infty}{\left|\frac{\frac{2^{n+1}}{\left(n+1\right)^{n+1}}}{\frac{2^n}{n^n}}\right|}=\lim_{n\rightarrow\infty}{\left|\frac{2}{n}\cdot\left(\frac{n}{n+1}\right)^{n+1}\right|}$
Comment: Well, you get

$$\frac{2^{n+1}}{2^n} \cdot \frac{n^n}{(n+1)^{n+1}}$$

most immediately. The left factor becomes a $2$. If you multiply on top and bottom by $n$, then you have an $n^{n+1}$ on top, and can group the things that have an $n+1$ power together with exponent properties
Comment: Thank you! Appreciated.
Answer: Root Test. Since
$$
\biggl( \frac{2^n}{n^n} \biggr)^{1/n} \!= \frac{2}{n} \longrightarrow 0 < 1
$$
as $n \to \infty$, the series is guaranteed to converge.
Intuitively, the terms of the series are eventually less than the terms of a geometric series with common ratio $0 < r < 1$, so the series converges by comparison.
Answer: Thank you for all the replies! I really appreciate it.
Here is what happened: I got $0$ as an answer when doing the ratio test. I thought this was the critical value (when of course it was $1$), so that's why I thought the ratio test didn't work.
Here is my work for those who asked for it:
$k=\lim_{n\rightarrow\infty}{\left|\frac{a_{n+1}}{a_n}\right|}=\lim_{n\rightarrow\infty}{\left|\frac{\frac{2^{n+1}}{n^{n+1}}}{\frac{2^n}{n^n}}\right|}=\lim_{n\rightarrow\infty}{\left|\frac{2^{n+1}}{n^{n+1}}\cdot\frac{n^n}{2^n}\right|}=\lim_{n\rightarrow\infty}{\left|2^{n+1-n}\cdot n^{n-\left(n+1\right)}\right|}=
\lim_{n\rightarrow\infty}{\left|\frac{2}{n}\right|}=\lim_{n\rightarrow\infty}{\left|\frac{\frac{2}{n}}{\frac{n}{n}}\right|}=\left|\frac{0}{1}\right|=0$
Comment: Note that $a_{n+1}=\frac{2^{n+1}}{(n+1)^{n+1}}$ and not $\frac{2^{n+1}}{n^{n+1}}$.
Comment: @Gary Thank you!


jsonschema2pojo-maven-plugin:0.4.13:generate failed: trying to create the same field twice

Question: I am getting the below error stack while parsing the json schema and converting it in to java pojo.

[ERROR] Failed to execute goal
  org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.13:generate
  (default) on project XXXXXXXXXXXX: Execution default of goal org
  .jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.13:generate failed:
  trying to create the same field twice: XXXXXXX -> [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
  execute goal
  org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.13:generate
  (default) on pro ject XXXXXXXXXXXX: Execution default of goal
  org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.13:generate
  failed: trying to create the same field twice: XXXXXXX

Below is the maven  plugin details which I am using.
<code>   <plugin>
                    <groupId>org.jsonschema2pojo</groupId>
                    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                    <version>0.4.13</version>
                    <configuration>
                        <sourceDirectory>${basedir}/src/main/resources/json-schema.json</sourceDirectory>
                        <outputDirectory>${basedir}/src/main/java</outputDirectory>
                        <targetPackage>example.json.gen</targetPackage>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
</code>
Answer: Can you post your JSON Schema which you are trying to parse? Sounds like you have a duplicated field in there?
---UPDATE---
Based on your comments you need to edit your json schema like this:
<code>{
    "type" : "object",
    "extends" : {
        "$ref" : "classA.json"
    }
}
</code>
This way you can extend from another json schema. However if you have two generated json schemas with the same fields there is afaik no way to "merge" them without manually editing or automated deleting of duplicated fields.
Comment: I know there are Duplicate values in JSON schema and I am looking for similar setting like XJC in case of XML, without causing failures it should generate the  java pojo.
Comment: Sorry, then I have no idea. Your question is a bit confusing. It sounds like you are asking what causes the exception instead of asking how to parse a json schema with duplicated fields without raising an exception.
Comment: Thanks for your response. I try to explain more, let say I have Class A and B and both contains field abc, and B is a part of class A. In this case I am getting duplicate error while parsing json schema.


Linux won't start alongside Windows 10

Question: I have installed Windows 10 and then Linux. However, grub doesn't start, I am booting right to Windows 10. I don't have Secure Boot or Fast Boot enabled.
When I tried to use Boot Repair, it said I had to set my BIOS into Legacy/EFI mode, however I have no such option in my BIOS.
I have Windows on sda and Linux on sdb. I tried installing the bootloader to both sdb and sda. When on sdb, nothing happend, it just booted into Windows. When on sda, it gave me an error that it couldn't install the bootloader.
EDIT: When booting from sdb, I can only see a grub2 shell. No menu or anything.
Comment: You are using MInt and this is an Ubuntu only forum. You really should have sdb as gpt and installed in UEFI mode. You have sdb as MBR,  but grub in UEFI mode on sda's efi partition. If you get to grub menu you are booting, but then may have video issues. http://askubuntu.co/questions/162075/my-computer-boots-to-a-black-screen-what-options-do-i-have-to-fix-it and if installing: https://help.ubuntu.com/community/UEFI
Comment: @Wilf: Here is my boot repair [output](http://paste.ubuntu.com/11876427/).
Comment: What hardware are you using? If you have two drives in your computer you may be able to set the BIOS to boot from the 2nd with Linux
Comment: Yes, I have Linux and Windows on seperate drives (sdb & sda). Are you suggesting to change the boot order everytime I want to boot a different OS?
Comment: @Wilf: I can't even boot from Linux, see my edit.
Comment: If you get grub you can try and boot using the instructions [here](https://www.linux.com/learn/tutorials/776643-how-to-rescue-a-non-booting-grub-2-on-linux/) (noting down what works, then make your own `boot/grub2/grub.cfg`), or you can try boot repair again (if it gives any output you can post it here). Also, some of the points covered in [this question](http://askubuntu.com/q/221835/178596) may help with your issue.
Comment: Better to have Ubuntu installed in UEFI mode if Windows is UEFI. Or both BIOS boot mode. Microsoft requires vendors to allow users to turn off secure boot. Only a few crippled 32/64 bit UEFI only systems have no BIOS mode. What brand/model system?
Comment: @oldfred: How can I install Linux in UEFI mode? I have secure boot turned off though.
Comment: @Wilf: Okay, I got grub working again, thanks. But now when I select Ubuntu in grub, it won't start properly. Maybe I'll try to reinstall it again.
Comment: @oldfred: Mint is based on Ubuntu, so almost everything that works for Ubuntu also works for Mint. Thanks for the link, it helped me with my issue!
Comment: @gartenriese Mint is offtopic *here* though, on Ask Ubuntu.  Maybe based on Ubuntu, but NOT Ubuntu.
Comment: @ThomasW.: Okay, next time I'll replace "Mint" with "Ubuntu" ...
Answer: When selecting from which drive to boot, you have both UEFI and non-UEFI Boot Repair. You have to start UEFI Boot Repair, then you can repair grub.
Edit:
Steps to reproduce:

Install Linux + Bootloader on sdb
Install Windows on sda
Start Boot Repair in UEFI mode and repair grub

Linux won't start alongside Windows 10


How to do local multiplayer in Gang Beasts on Switch?

Question: It's our first time playing Gang Beasts and we are stuck at this screen.

It's the Nintendo Switch version of the game. The game is officially listed as supporting multiplayer of 1-4 players on a single system.
But there appears to be no way for the other three players to join.
We confirmed that all four Joy-Cons are paired.
We tried all the common methods of joining a multiplayer game with detached Joy-Cons:

Pressing + or -
Pressing and holding L and R simultaneously
Shaking the Joy-Con

We have tried this both from the menu, and after starting with a single player.
We have tried various modes...but no luck.
We just want to do a local couch multiplayer battle. What do we do?
Everyone was stoked to play this game, but now it's total buzzkill.
Edit:
I got it working by pressing the "accept" button on the non-P1 controllers. But I don't know why this didn't work before. I don't really have enough info to post a complete answer yet. In the meantime, someone else feel free.
Answer: This is not an in-depth answer, but basically here's what you need to do:
(This answer assumes most players will be using the detached Joy-Con configuration.)
Each player should press the Accept button as soon as you reach the local multiplayer screen.

↑ In the above image, Accept would be X, and Back would be A.
Then use the Left Thumb Stick (↔ left and right directions) to choose an outfit.
Then press the Accept button again to accept your customization. Your character's arms will be raised in a "let's go!" position as soon as you do this.
Once all players have confirmed their choices, and their arms are raised, a countdown to gameplay will begin.
(At this point you still have a chance go Back if you want to change your configuration.)
It seems some options for Player 1 must be customized before entering this screen, but I need to study this more before I post info on it.


Julia Command Line Wizardry Making One Command Wait for the Next

Question: I knew the wizardry tag would ensnare the myriad of Magic the Gathering fan programmers who pull all the strings in the Julia language. I've been told that running command line arguments in Julia via run() is asynchronous meaning one command could start potentially before the previous finishes. I am assuming the aforementioned to be true, so if that's not the case feel free to lash out. I want to run a series of commands (similar to the following set) but do not want the second to begin before the first has been completed:
<code>     run(`cat $fx` |> `grep $datef` >> "$newfile")

     run(`cat $gx` |> `grep $dateg` >> "$newfile")
</code>
I'd imagine I could put a sleep command between the two or possibly use readall() (which I'm also assuming would have to wait in order to print to standard out) but was wondering if there was something more elegant. Sincere thanks for considering this.
Comment: _"I've been told that running command line arguments in Julia via run() is asynchronous"_  Smite thee troll with a dastardly spell for speaking these untruths.  8-)
Answer: They're synchronous.
<code>run(`sleep 2`)
</code>


How to Prevent Excel from Removing Formula from Cells

Question: I am creating Excel files from a Web App (C#).
Some cells have formulas and being written properly tested by writing as texts. However, when the files are opened, a dialog box with Yes/No is displayed saying something like below:

When Yes is selected, you see the info dialog as below saying the formula were removed.:

Anyone knows how to prevent Excel from doing his?
private static void AppendFormulaeCell(string cellReference, string cellStringValue, ref
OpenXmlWriter writer)
{
     CellFormula cellFormula = new CellFormula("SUM(S11:S13");
     cellFormula.CalculateCell = true;

     //  Add a new Excel Cell to our Row
     writer.WriteElement(new Cell { CellValue = new CellValue(cellStringValue), CellReference =
     cellReference, DataType = CellValues.Number, CellFormula = cellFormula });
}

Any help will be very much appreciated!
Comment: Wouldn't an Excel formula need to start with a `=` sign? Yours doesn't. Also, what do you see when you view the log file that lists the repairs? That should give you information about the problem that we cannot see from your screenshots.
Comment: Hello teylyn, the log has just two lines - basically same thing what we see on the screen. Like:                                                                     Removed Records: Formula from /xl/worksheets/sheet.xml partRemoved Records: Cell information from /xl/worksheets/sheet.xml part . Also the "=" sign is not needed as when you write the Excel file, the equal will be appended as it's a formula.
Comment: In that case you may want to add more info about how you create the workbook. "From a Web App (C#)"  does not help much. Also tag with something other than Excel, because such a formula works fine in Excel and the problem only comes up when you generate the workbook with code, so the problem must be with how the file is generated, especially if it is repeatable and not a one-off fluke due to workbook corruption.
Comment: After reading your comment to the other answer: you have a problem with a formula that gets removed when Excel opens the file and you are looking for help, but you don't post the formula you're actually using. Instead, you post a simple sum(). How on earth would that help us figure out what is wrong with the formula you're using?  If you've made a mistake in the actual Excel formula in your code, then THAT may very well be the reason that Excel removes it as unreadable content, and posting a simple Sum() in its stead is ... ehm ... not very useful.
Answer: Di you try closing properly the formula's parenthesis after S13?
CellFormula cellFormula = new CellFormula("SUM(S11:S13)");

Also, I think you have to clear the cell attributes before writing to it
Comment: Hello JMB, that's in fact not the real formula, just used as an example and when doing that - I goofed in not closing it with the closing parenthesis. Thanks for the response. I will look into clearing the cell attributes.


Connection new 4-line phones to an existing multiline network system

Question: We have an office with several telephone lines working under the same number.
We are using super old phones (4-line phone devices) in each line. 2 of them did not work and we bought 2 new Panasonic 4-line phones.
Our old phones have only 1 phone connection that goes to the wall's phone connection. The new phones come with 4 different connections (1/2, 2, 3/4, 4 being these numbers the lines).
Now, when I connect the new device from the 1/2 connection to the wall's line connection, the phone is working as an independent line and none of the other lines (2,3,4) work at all. Also, I can call out but I cannot pick up if there are calls coming in.
How should I connect my new 4-line phones so they integrate with the current internal network?
OLD PHONE: BELLSOUTH nt8b30ah
NEW PHONE: PANASONIC KX-TS4100B
Comment: I'm voting to close this question as off-topic because It does not appear to be about home improvement - it's about a business telephone system not likely to be seen in a home (even in a home business.)
Answer: It would help to know what your old phone make and models were and what the models of the new phones you got are.
Based on what you provided so far I have a feeling your old system was a keyed system with a KSU or possibly a pbx and your new phones work without a KSU. The new phones are not compatible with your current phone system.
In a keyed system with KSU (this is also similar if you have a PBX as far as wiring goes) you're going to have some sort of box (KSU or PBX) mounted in a rack or more commonly on the wall for small systems. All the incoming lines will connect to this box.
All the phone lines that go to your phones will also be connected to your KSU. The phones usually only need one pair of wires going to them from the KSU to be able to access all incoming lines. The connection between a phone and a line is done through the KSU. The phones are digital phones that need to be compatible with the KSU you are using. Think of it sort of like a network switch or router for your phone system.
In a keyed system that doesn't use a KSU (like a lot of the panasonic phones that have individual line ports) all 4 incoming lines go to each phone. The signals going to your phones are just the regular analog phone lines. So each phone is basically directly connected to each incoming line. These are not digital phones and won't work with a KSU.
One thing to note, I simplified the connections but most likely you'll have a number of 66 blocks where the wires are actually terminated and not going directly into the KSU.
Update after phone models added:
Unfortunately I guessed correctly. The new phones won't work with your existing setup. You can either:

Get phones intended to work with you system (check model number of the KSU first). Even though Nortel went out of business you can still find used/refurbished phones for those systems. This is the easiest and cheapest option but you're stuck with an old system that is no longer made. All you have to do though is plug in the replacement phones.
Get a whole new system with new KSU or PBX and compatible phones. Get a similar system that can support your incoming lines and send one pair of wires to each phone. This should be pretty straight forward but you might need to hire someone to set it up. If there's any rewiring needed it should only be some minimal changes at the telecom closet. I haven't used it but the XBlue X16 system seems very popular and should work with your setup with maybe some minor rewiring of cross connects at the 66 block.
Get rid of your old system and use the new phones on their own. This is going to require that you have 4 pair wire going from the telecom closet to each phone jack. If you already do have 4 pair (8 wires in the cable) going to each jack then with some minor changes you can use the new phones. If you don't have 4 pair cable going to each jack you're going to have to run new wires which can be expensive.
Comment: Also important: with a key system (or a PBX) you can only use phones that are designed to work with that system. Mixing in regular analog phones (including a multi-line phone that connects directly to PSTN lines) will not work: if connected as an extension, it will probably just malfunction (or worse, damage your PBX); if put in parallel with the KSU/PBX you'll have usability issues including not being able to transfer calls properly, collisions when you pick up lines in-use, and voice mail won't work properly (if your KSU/PBX has that).
Comment: phone models in updated question. thx
Comment: @samyb8 updated my answer to provide you options on what you can do now.


Adaptive multi GPU fan control and overclocking software

Question: Running a quad GTX 1080 system that is at full load 24/7. Back when it was using Windows, I was able to use EVGA PrecisionX to not only set a fan profile, but also configure the cards to automatically throttle themselves at regular intervals to ensure the temperatures never exceeded 75C.
Though I have very little understanding of Linux software, I doubt that the Nvidia X Server tool is capable of even remotely assisting me in this regard. The 'coolbits' settings seem very limited and does not allow for any precision control. nvtools also looks like it hasn't been touched in years, so I'm guessing that's out as well.
What other options are available for this level of fan and clock control?
Answer: Look into installing thermald and writing yourself a custom thermal-conf.xml file. With it, you have ultimate control over the cooling system, including fans, power throttling, RAM throttling, and more.
Search here on askubuntu for thermald and you'll find some of my, and others, work with this software.
If you install thermald, you can also man thermald and man thermal-conf.xml for more details and examples.
Comment: I'll look into it tomorrow and let you know if I have any follow up questions. Cheers.
Comment: Yeah, so my follow up question is...Wut? As a Windows idiot, I have no idea what anything means.
Comment: I don't understand your question/comment.


Can I pull a c-wire from a second nearby thermostat?

Question: I have a thermostat that controls the AC/Heat upstairs which is located on my bedroom wall. Right below that I have another Millivolt thermostat for the gas fireplace in my bedroom. If I want to upgrade the fireplace thermostat to a smart wifi that needed a c wire can I pull the 24 volts from the other thermostat? Thanks
Comment: Don't mess with millivolt thermostats unless you know what you're doing. And never grab "just one wire", always use wires in matched sets.
Comment: Does this answer your question? [Can I share "C" wire on two thermostats?](https://diy.stackexchange.com/questions/77307/can-i-share-c-wire-on-two-thermostats)
Answer: No, same as any electrical circuit, you need a two way street on the same circuit and the c wire is only one of those lanes. The R wire is the second lane (most cases). Additionally, you risk frying your furnace's circuit board, and your fireplace blower still needs switching that converts back to millivolt.
Your solution is to pull from a transformer (install a low voltage power supply of some kind) and provide an appropriate switch relay.
See here:

Can I share "C" wire on two thermostats?
https://www.google.com/amp/s/www.instructables.com/Nest-Thermostat-With-Gas-Fireplace-or-Other-Milliv/%3famp_page=true
Answer: This is possible, but it will take some additional components, or a smart thermostat made for the purpose.  The main issue is that a regular smart thermostat is going to use power provided to it on the R wire and the C wire.  You can think of those as positive and negative (but it's not really because its alternating current).  When the thermostat takes an action to turn on heat, what it really does is connect the R wire to the W wire.  That is connecting 24v to the W wire, and that is just incompatible with the millivolt system.
So, yes, you can run an R and C wire from the existing thermostat to power the new one, but then you also need to wire up some additional relays to provide the signaling the millivolt system expects.  The basic idea is that the 24v that the thermostat switches would be used to drive a relay to provide the contact closure the millivolt system expects.  The relays would need to be properly spec'ed for the job.
If you happen to have a smart thermostat made for millivolt that requires 24v only to power itself, that would be very straight forward.  I just don't know if such a thermostat exists.
Comment: Here is a [link to a forum post](https://www.doityourself.com/forum/thermostatic-controls/579942-help-installing-nest-millivolt-system.html) talking more about using a relay.  You can ask a question about it here if you need more help, but I thought it was a little beyond the scope of this question.


Does the Zendesk.com website offer a good ux? And why?

Question: For a new project we want to use Zendesk.com as a good example for our designers. We love the site but can not really tell why since ux is not our field of expertise.
What makes the zendesk.com website special from a UX point of view?
And are there any bad things?
Comment: Asking people for reviews of websites isn't really on topic for our site. A better question would be: how can I determine whether the zendesk website is a good UX? And then you can use an answer like JonW's, which helps you figure out the next steps.
Comment: @codeinthehole it's preferable if the question can be amended to suit the Q/A format rather than closing it. Closing should be a last resort really. There is an answerable question here, as Rahul describes above.
Comment: I'm with @codeinthehole on this. The seatbelt alarm question is much better and it got closed.
Comment: This is a bit too close to a 'can you do a usability review of website X' type question, and therefore isn't one that can have a 'correct' answer. Can you refine the question to be more specific? For instance: "Is technique 'X' as shown on this website good from an accessibility point-of-view".
Comment: I would like to explain my question like that: We looked at different websites we know of which one was a helpdesk service. We liked it and started looking within this industry when we found zendesk. And we were surprised how different it looked and tried to find out what it really was.

What we really want to get out of the zendesk example, is the feeling you get while visiting the site. But how can you do that, right? :)
Comment: @Rahul; I think this is less answerable than http://ux.stackexchange.com/questions/17939/which-case-is-good-ux-a-peugeot-vs-bmw-story because it can't be narrowed to any one area of study.  It's far too general.  I would suggest this type of question should be closed.
Comment: So you're asking more about the *emotional design* of the website if I'm reading your comment right?
Comment: @Ben Brocka; I think might be stretching the meaning inferred by 'love' a bit ;)
Comment: @BenBrocka: Yes. But I try to find out what makes this design such an emotional design. Looking at the site just makes me want to stay and read. Its not something that sites do very often...
Comment: @Rahul: YosefWaysman and Schroedingers Cat did exactly what I hoped for. I don't see why this is a problem. I appreciate all other answers too and I will get into ux  a little bit more. But it makes no sense to me to become an expert just for this one project...
Answer: Zendesk.com is a very good website from a UX perspective. Here's why:

Clear CTA (call to action) - The website is clear about what it wants the user to do: start a free trial. They repeat it several times: thrice on the homepage (on the navigation bar, in the first item of the rotating carousel and at the bottom), and inside every section. And even though they use slightly different phrasing, the button itself is designed the same everywhere: white label on orange background, which differentiates it from other buttons on the site. You can't miss it.

Personality - The website projects Zendesk's fun and vibrant culture and brand personality. They do it by "sneaking in" a funny/clever copy every here and there, and even a large piece of funny content, just to show that there not all business, but also into this for the experience. This gives the site's users (and prospective customers) the feeling that there are real human beings behind Zendesk, not corporate robots. For example:

Credibility and trust - Zendesk.com increases their credibility by applying two well-known "tricks": They display their phone number upfront in the site's header (they're not hiding from you) and they show a list of reputable clients (if Zendesk's good enough for them, it's good enough for you).  .
Aesthetics - The website is clean, minimalist and visually appealing in general, strengthening the brand's professional image and the user's experience.
Usability - the site follows the main usability guidelines: big clear headlines, short and clear labels, simple navigation, big buttons, hints in every text field, hover states for everything that is clickable and more.

All in all, the website follows very good UX practices. As someone who actually used Zendesk in the past, I can say that this experience also ensues in the great product itself, contributing to the old saying that good design is always intentional.
Comment: Thank you so much for this great review! You are mentioning some great points! And all lead to what you say at the end and what we want to accomplish too -> Zendesk is a great product and somehow you can feel it. It really looks like they are sure about what they do. This is what we want too ;-)
Thanks again!
Answer: As has been flavour-of-the-week on UX.StackExchange this week, I think a Heuristic Evaluation is what you're looking for. It's all very well us telling you what is good and bad about the website but nothing beats doing some analysis yourself. That'll give you a better understanding of what makes a website provide a good user experience.

Heuristic evaluation is the most popular of the usability inspection
  methods. Heuristic evaluation is done as a systematic inspection of a
  user interface design for usability. The goal of heuristic evaluation
  is to find the usability problems in the design so that they can be
  attended to as part of an iterative design process. Heuristic
  evaluation involves having a small set of evaluators examine the
  interface and judge its compliance with recognized usability
  principles (the "heuristics").

Rather than determining what is wrong with the site, you can assess the site for what it does well (even suggest improvements, there is no 'perfect' website).
A couple of questions from this board this week were discussing this with some great useful feedback:
Heuristic approaches for users' evaluation of UX
Usability Guidelines
(As my answer is shamelessly stealing from these two questions / answers if you feel the need to upvote my answer please make sure you go and upvote the useful answers in those threads too)
Comment: This is a good answer as it points out that there are 'generic rules' - which can be applied to any website (and more broadly, to any interface).
Comment: Thanks Jon! The problem here is the following. I am not an expert in ux... And I feel that I can only analyse a website based on a feeling rather than knowledge. ;-)

Anyway. Thanks for sharing the links. I will check it out!
Comment: Would love to. But I can't vote yet... ;-)
Answer: I think this question is too broad, but I'll try to answer.
The zendesk.com website looks great, has a clean and easily understandable design. Some parts may be improved but these changes should be A/B tested?

I would try the 'Try zendesk free' button in different colors to see which one attracts the most clicks
Top slider: pot content on the right, and pictures/illustrations on the left.
And definitely change the image of the asian little girl. She should stare to the "Better than free!" headline to direct visitors eyes. Here is a study showing how the we look where they look

After all, the website is great, and I like especially the sticky header.
Comment: I guess the question is not too easy. But your answer is very helpful! Thanks especially for pointing out the study, very interesting!
Answer: The site is clean, unpretentions, but clever. The sticky header works smoothly without me really noticing. There is nothing that distracts the user while being on the site. The colour scheme is gentle, although, for my preference, I would have picked a less lime green/yellow colour.
Most importantly, it tells you what it does, what you can do next, and what other possibilities there might be. It does this clearly and without being in your face. That is critical. It is thinking of the user and how they want to use the site, not just how marketeers want to present themselves.
Comment: Its funny. We also think of the site as "selling without selling". Or like you call it "whitout being in your face". This is definitely something we try to accomplish too... Thanks for your answer! :)
Comment: The sticky header is not even close to being smooth on my machine (i7 quad core with 8GB)
Comment: @MarjanVenema - My machine is not particualarly speedy, but it is fine for me. I have definately seem far worse. Sorry you experience problems, but my point is that if you are going to do things like that, they should be smooth.
Comment: I agree, if you gonna use that, it should be smooth. You can't be certain of that because you don't know what hardware/software will be used to access your site. And that is probably why GMail has changed to making the whole header stick instead of "just" the button bar.


Use Lodash to get first element of each array inside array

Question: This question as a JS-only answer here. But simply because I'd like to become more proficient with Lodash, I'm looking for the Lodash solution.
Let's say I have an array that looks like:
[[a, b, c], [d, e, f], [h, i, j]]
I'd like to get the first element of each array as its own array:
[a, d, h]
What is the most efficient way to do this with Lodash? Thanks.
Comment: `let result = arr.map(a => a[0])`
Comment: No need for lodash in this case
Comment: Lodash version: `let result = _.map(arr, a => a[0]);`
Answer: You could use _.map with _.head for the first element.

var data = [['a', 'b', 'c'], ['d', 'e', 'f'], ['h', 'i', 'j']],
    result = _.map(data, _.head);

console.log(result);

Or just the key.

var data = [['a', 'b', 'c'], ['d', 'e', 'f'], ['h', 'i', 'j']],
    result = _.map(data, 0);

console.log(result);

Comment: Lol why do they have a method to get the first element of an array?
Comment: maybe for headers of tables?
Comment: Head is very useful! It comes from functional languages like lisp, scheme... you can usually add an argument to tell how many of the first elements you want, very basic but useful filtering. Also it's Used in R, Python with data structures sushi as data frames.
Answer: If you want to use lodash:
const _ = require('lodash')
const arr1 = [[a, b, c], [d, e, f], [h, i, j]]
arr2 = _.map(arr1, e => e[0])

Answer: With lodash you can do this with _.first, _.head (_.first is just an alias of _.head) and direct path while mapping through the array:

const data = [['a', 'b', 'c'], ['d', 'e', 'f'], ['h', 'i', 'j']]

console.log(_.map(data, _.first))
console.log(_.map(data, _.head))
console.log(_.map(data, 0)) // direct path

If you however have to use lodash just for this then simply use either ES6 or ES5:

const data = [['a', 'b', 'c'], ['d', 'e', 'f'], ['h', 'i', 'j']]

console.log(data.map(x => x[0]))
console.log(data.map(function(x){ return x[0] }))

The performance and actual code is the same practically.
Answer: https://lodash.com/docs/#filter
Use the docs, look for some each function.
let arr = [[a, b, c], [d, e, f], [h, i, j]]
let newArray = _.filter(arr, function(subArray){
   return subArray[0] // first element of each subArray
})
console.log(newArray)

This should do it, but I don't understand why you wanna use lodash when pretty much the same filter function exists in vanilla javascript.
Answer: You can also use the _.matchesProperty iteratee shorthand, which many lodash methods support.

const data = [['a', 'b', 'c'], ['d', 'e', 'f'], ['h', 'i', 'j']];

const result = _.map(data, '[0]');

console.log(result);


Retrieve excel cell text that is not wide enough

Question: I want to read excel display value, not value that excel internally saves. Problem is that when this value is wider that the cell it makes cell to display ####### which is OK in excel. But I want to read this value from excel API. When I access property range. Text I also get value ########. Is there a way to get value which will be displayed when cell is wide enough?
i.e some third property, not Value2 nor Text.
My colleague said that there are three values in excel, one internal value how excel represents cell value, one what is currently displayed and one what will be displayed when there is enough space, is he right?
If this is not possible, I have another solution which might work. I used AutoFit() method to make cell wide enough and that I read value. But the problem is that I don't want to change width of columns. Is there a way to remember width, then change width so I can read cell, and that return it again to previous width?
Or maybe I should somehow apply formatting option to value of cell to get what will be displayed?
How to solve this?
Comment: What is the file version you are accessing (XLS and/or XLSX) ?
Comment: Currently XLSX, but in future should be both. So it should be some solution which is possible for both file types.
Comment: for XLSX there are free options out there... for XLS the only "good options" I know of are commercial... is a commercial library an option ?
Comment: Well, maybe you haven't understood my question. I don't need library for this, I'm using Microsoft office interop and excel api within it. I just ask for way to do this in excel interop api - programmatically
Comment: Thanks for the clarification... (I always prefer a library based solution since that doesn't need Excel installed and it works in server-scenarios like IIS/Windows Service too...) IF you need an Interop based solution then I wish you luck and hope that someone can provide you with that...
Answer: In VBA I would do this by getting the Value and the number Format, and then useing the VBA Format Function to format it, but I am not sure how to do this using c#.
As a matter of curiosity, why would you want to get the formatted value anyway?
Comment: Well, I synchronize my values with server, and I do that only for values that are changed. I have my inner structure where I keep values and when some object have new value I check it if it differs with my inner and than do sync. But problem is that for some numeric types excel cannot remember same precision as value at server and my inner value. So I remember this display value and sync only those objects where new display value differs with old one. I'll try to create value depending on number Format and Value.
Comment: All Excel numbers are stored internally and retrieved using .Value2 are double-precision floating point (this includes integers, currency, doubles, dates, times etc). I suggest you use the same internally and compare with a very small tolerance rather than messing around with .Text
Comment: Yep, you're right it's easier to do all this without formatting. Thanks Charles.