text:
Q: VBA for filtering columns I have a big database-like sheet, first row contains headers. I would like a subset of rows of this table based on column values. Two issues:
1) VBA-wise I would like to loop through the columns, when the values for all necessary columns all match, copy the entire row into a new sheet.
2) The subset of rows is based on a list. I just read I can use Autofilter with an array. Is it possible to input this array from a column instead of manually entering it in the VBA code? The list I'm using consists of 200 different strings and will be updated periodically.
Where CritList is the list of strings. I still need to figure out how, but now I leave the office, so more tomorrow.
EDIT1 Thanks to @DougGlancy; the autofiltering works now. Here is his beautiful code (I only added the array-filter).
EDIT2 Included a more elaborate array-filter, where NameList is the list I would like to filter for. Now it all works!
Sub FilterAndCopy()
Dim LastRow As Long

Dim vName As Variant
Dim rngName As Range
Set rngName = Sheets("Sheet3").Range("NameList")

vName = rngName.Value

Sheets("Sheet2").UsedRange.Offset(0).ClearContents
With Worksheets("Sheet1")
    .Range("A:E").AutoFilter

    'Array filter from NameList
    .Range("A:J").AutoFilter Field:=3, Criteria1:=Application.Transpose(vName), _
                                Operator:=xlFilterValues

    .Range("A:E").AutoFilter field:=2, Criteria1:="=String1" _
                                  , Operator:=xlOr, Criteria2:="=string2"
    .Range("A:E").AutoFilter field:=3, Criteria1:=">0", _
    .Range("A:E").AutoFilter field:=5, Criteria1:="Number"

    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    .Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy _
            Destination:=Sheets("Sheet2").Range("A1")

End With
End Sub

A: Here's a different approach. The heart of it was created by turning on the Macro Recorder and filtering the columns per your specifications. Then there's a bit of code to copy the results. It will run faster than looping through each row and column:
Sub FilterAndCopy()
Dim LastRow As Long

Sheets("Sheet2").UsedRange.Offset(0).ClearContents
With Worksheets("Sheet1")
    .Range("$A:$E").AutoFilter
    .Range("$A:$E").AutoFilter field:=1, Criteria1:="#N/A"
    .Range("$A:$E").AutoFilter field:=2, Criteria1:="=String1", Operator:=xlOr, Criteria2:="=string2"
    .Range("$A:$E").AutoFilter field:=3, Criteria1:=">0"
    .Range("$A:$E").AutoFilter field:=5, Criteria1:="Number"
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    .Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy _
            Destination:=Sheets("Sheet2").Range("A1")
End With
End Sub

As a side note, your code has more loops and counter variables than necessary. You wouldn't need to loop through the columns, just through the rows. You'd then check the various cells of interest in that row, much like you did.


text:
Q: ThreadPool misses events I need to queue events and execute them in parallel.
My C# code queues the events in a blocking collection and executes each event on a worker thread using the ThreadPool. However, if the events are queued with a rate of 2000 event/second or more, some events are missed. When I searched for this problem, I found out that the ThreadPool can reject some requests or hold them if no thread is available, from this link:

To make matters worse, incoming requests that depend on the threads from the thread pool may be on hold or may even be rejected primarily because the thread pool may not have available threads with it to handle an incoming request

Note: This problem appears only when using a laptop with a Core i5, when I tried it with a Core i7, it worked correctly.
Here's a snippet of the code:
public static void ExecuteEvents()
{
    foreach (EventData data in blockingCollection.GetConsumingEnumerable())
    {
        switch (data.EventType)
        {
            case EventType1:
                ThreadPool.QueueUserWorkItem(o =>
                {
                    Function1(data);
                });
                break;
            case EventType2:
                ThreadPool.QueueUserWorkItem(o =>
                {
                    Function2(data);
                });
            default:
                break;
        }
    }
}

A: It doesn't look like you're having a problem with the threadpool. It looks like you're having a problem with closures.
You should create a local variable within the loop first. The problem is that when the threadpool executes the action, it is referencing to the EventData data variable which is constantly changed. Therefore you should create a local variable first.(which will be packed in a displayclass, because the local variable is referenced from a method which is put on a list out the scope.)
public static void ExecuteEvents()
{
    foreach (EventData data in blockingCollection.GetConsumingEnumerable())
    {
        var local = data;
        switch (local.EventType)
        {
            case EventType1:
                ThreadPool.QueueUserWorkItem(o =>
                {
                    Function1(local);
                });
                break;
            case EventType2:
                ThreadPool.QueueUserWorkItem(o =>
                {
                    Function2(local);
                });
            default:
                break;
        }
    }
}

For more info on closures look here

redpajama_set_name: RedPajamaStackExchange


text:
Q: TeX capacity exceeded with several \input in a spreadtab I use several \input in a spreadtab using the method from this answer in my document until I got this error:
TeX capacity exceeded, sorry [text input levels=15].

I read in the Internet that I can manage the problem by changing the this parameter from max_in_open = 15 to max_in_open = 30.
The problem I don't know where I can find the data to make the changes. I use TeXStudio on my Mac.
I am looking for the settings to make my document work.
\documentclass{article}
\usepackage[a4paper,left=2.5cm,right=2.5cm,bottom=2.8cm,top=2.8cm]{geometry}
\usepackage{longtable,tabu}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{datetime}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage[sc]{mathpazo}
\usepackage{datatool}
\usepackage{spreadtab,booktabs,xpatch}
\usepackage[]{numprint}
\usepackage[]{eurosym}
\usepackage{fp}
\usepackage{booktabs}
\usepackage{tabularx,siunitx}
\usepackage{numprint}
}%=========================

\makeatletter
\def\spreadtab@ii{\IfSubStr\ST@tab{\noexpand\input}{\expandafter\spreadtab@iii\ST@tab\@nil}\relax}
\def\spreadtab@iii#1\input#2#3\@nil{%
    \long\def\spreadtab@iv##1\spreadtab@iv{\endgroup\def\ST@tab{#1##1#3}\spreadtab@ii}%
    \begingroup
    \everyeof{\spreadtab@iv\noexpand}%
    \expandafter\spreadtab@iv\@@input#2
}
\xpretocmd\spreadtab@i\spreadtab@ii{}{}
\makeatother

\subsection*{B}
    \begin{spreadtab}{{tabular}{@{\hskip1pt}r@{\hskip7pt}p{2.7cm}crrr}}
    \toprule
    &@ Ku& @ Re & @ Ne & @ Me & @ Br \\
        \midrule
        \input{Bu1.txt}
        \input{Bu2.txt}
        \input{Bu3.txt}
        \input{Bu4.txt}
        \input{Bu5.txt}
        \input{Bu6.txt}
        \input{Bu7.txt}
        \input{Bu8.txt}
        \input{Bu9.txt}
        \input{Bu10.txt}
        \input{Bu11.txt}
        \input{Bu12.txt}
        \input{Bu13.txt}
        \input{Bu14.txt}
        \input{Bu15.txt}
        \midrule
        &@ To & @\thefo &(sum(d2:[0,-1]))tag(BN) & sum(e2:[0,-1])tag(BM)& sum(f2:[0,-1])tag(BB)\\
        \bottomrule
    \end{spreadtab}

Sample content of Bu1.txt:
@\thefoo&@BU1& @513& 270.00& 551.30& 3231.30\\

The other *.txt look similar.

A: As David pointed out in the comment, the code \everyeof{\spreadtab@iv\noexpand} \expandafter\spreadtab@iv\@@input#2 is causing every \input to start yet another \input before finishing, which effectively nests inputs as far as TeX is concerned.
I don't really know spreadtab, so I don't have a good solution.  Instead, here is a very, very, very, very, very, very, very, VERY bad hack to make your document work.  The new spreadtabwithinput environment will replace every \input{<file>} command in its body by the contents of <file>, and then pass everything back to spreadtab.  You can have arbitrarily many \input in there.
Proceed at your own risk.
% \newwrite\wrt
% \def\x#1;{\immediate\openout\wrt"Bu#1.txt"
%   \immediate\write\wrt{@\noexpand\thefoo
%     &@BU#1& @513& 270.00& 551.30& 3231.30\noexpand\\}%
%   \immediate\closeout\wrt
%   \ifnum#1<15 \expandafter\x\number\numexpr#1+1\expandafter;\fi}\x1;

\documentclass{article}
\usepackage{spreadtab,booktabs}

% HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK %
\usepackage{xparse}
\ExplSyntaxOn
\tl_new:N \l__ihpro_spreadtab_hack_tl
\tl_new:N \l__ihpro_tmpa_tl
\NewDocumentEnvironment { spreadtabwithinput } { +b }
  {
    \tl_clear:N \l__ihpro_spreadtab_hack_tl
    \__ihpro_spreadtab_loop:w \prg_do_nothing: #1
      \input \q_recursion_tail \q_recursion_stop
    \exp_last_unbraced:Nno
    \begin{spreadtab}
      \l__ihpro_spreadtab_hack_tl
    \end{spreadtab}
  } { }
\cs_new_protected:Npn \__ihpro_spreadtab_loop:w #1 \input #2
  {
    \tl_put_right:No \l__ihpro_spreadtab_hack_tl {#1}
    \quark_if_recursion_tail_stop:n {#2}
    \file_get:nnNF {#2} { } \l__ihpro_tmpa_tl
      {
        \msg_error:nnn { ihpro } { file-not-found } {#2}
        \tl_clear:N \l__ihpro_tmpa_tl
      }
    \exp_last_unbraced:NNo
    \__ihpro_spreadtab_loop:w \prg_do_nothing: \l__ihpro_tmpa_tl
  }
\msg_new:nnn { ihpro } { file-not-found } { File~'#1'~not~found. }
\ExplSyntaxOff
% HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK % HACK %

\newcounter{foo}

\begin{document}
\subsection*{B}
    \begin{spreadtabwithinput}{{tabular}{@{\hskip1pt}r@{\hskip7pt}p{2.7cm}crrr}}
    \toprule
    &@ Ku& @ Re & @ Ne & @ Me & @ Br \\
        \midrule
        \input{Bu1.txt}
        \input{Bu2.txt}
        \input{Bu3.txt}
        \input{Bu4.txt}
        \input{Bu5.txt}
        \input{Bu6.txt}
        \input{Bu7.txt}
        \input{Bu8.txt}
        \input{Bu9.txt}
        \input{Bu10.txt}
        \input{Bu11.txt}
        \input{Bu12.txt}
        \input{Bu13.txt}
        \input{Bu14.txt}
        \input{Bu15.txt}
        \midrule
        &@ To & @\thefoo &(sum(d2:[0,-1]))tag(BN) & sum(e2:[0,-1])tag(BM)& sum(f2:[0,-1])tag(BB)\\
        \bottomrule
    \end{spreadtabwithinput}
\end{document}

A: Off the cuff Heiko Oberdiek's package catchfile comes to my mind.
You can use macros of this package for defining macros from the content of a file.
I can offer a routine
\CatchFilesForScantokens{⟨comma-separated file list⟩}{⟨preamble code⟩}{⟨postamble code⟩}
which reads and collects the ⟨preamble code⟩ and the content of each file of the ⟨comma-separated file list⟩ and the ⟨postamble code⟩ in verbatim-catcode-regime and then passes collected/accumulated things to \scantokens so that normal catcode-régime is in effect when the verbatimized material gets re-tokenized.
You can use this routine as
\CatchFilesForScantokens{⟨comma-separated file list⟩}%
                        {⟨stuff for initiating spreadtab-environment}%
                        {⟨stuff for ending the spreadtab-environment⟩}
(Internally with each file of the ⟨comma-separated file list⟩ the routine uses the \CatchFileDef-macro of the package catchfile for (re)defining a scratch-macro A from the content of that file, tokenized in verbatim-catcode/category-12-régime, and then appends the expansion of that scratch-macro A to the definition of another scratch-macro B. ⟨preamble code⟩ and ⟨postamble code⟩ also go to that other scratch-macro B. Thus everything is accumulated in that other scratch-macro B whose expansion can be passed to \scantokens for re-tokenization under normal catcode-régime.
I am lazy, so I use expl3's function \clist_map_inline:nn for parsing the ⟨comma-separated file list⟩).
Here is the example:
% Create  15 MyBu<X>.txt-files
% ==========================
\begin{filecontents*}{MyBu1.txt}
[0,-1]+1&@BU1& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu2.txt}
[0,-1]+1&@BU2& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu3.txt}
[0,-1]+1&@BU3& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu4.txt}
[0,-1]+1&@BU4& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu5.txt}
[0,-1]+1&@BU5& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu6.txt}
[0,-1]+1&@BU6& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu7.txt}
[0,-1]+1&@BU7& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu8.txt}
[0,-1]+1&@BU8& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu9.txt}
[0,-1]+1&@BU9& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu10.txt}
[0,-1]+1&@BU10& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu11.txt}
[0,-1]+1&@BU11& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu12.txt}
[0,-1]+1&@BU12& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu13.txt}
[0,-1]+1&@BU13& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu14.txt}
[0,-1]+1&@BU14& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}
\begin{filecontents*}{MyBu15.txt}
[0,-1]+1&@BU15& @513& 270.00& 551.30& 3231.30\\
\end{filecontents*}

% ==========================================================================================
% Define macro
%
%   \CatchFilesForScantokens{<comma-separated file list>}{<preamble code>}{<postamble code>}
%
% to read and collect <preamble-code> and each file of <comma-separated file list> and
% <postamble code> in verbatim-catcode-regime and to pass collected things to \scantokens:
% ==========================================================================================
\RequirePackage{catchfile}
\newcommand\MyScratchmacroA{}%
\newcommand\MyScratchmacroB{}%

% Within a local scope temporarily change the catcode-régime:
\begingroup
%
\makeatletter
\ExplSyntaxOn
%
% We won't need \makeatother / \ExplSyntaxOff as -- like the other changes to the
% catcode-régime -- the effects of  \makeatletter and \ExplSyntaxOn will be gone
% when the local scope is closed by \@firstofone.
%
% Use the SOH(=Start Of Heading)-character, code-point-number 1 in ASCII, accessible
% as ^^A in TeX's ^^-notation, for commenting:
\catcode`\^^A=14 %
% Make the CR(=Carriage-Return)-character, code-point-number 13 in ASCII, accessible
% as ^^M in TeX's ^^-notation, an ordinary character --- every line must end by something
% that is taken for a comment-character by TeX as long as this setting is in effect :
\catcode`\^^M=12\relax%
% Make % an ordinary character:
\catcode`\%=12\relax^^A
^^A
\@firstofone{^^A
  ^^A the first thing \@firstofone shall do is close the local scope where the
  ^^A catcode-régime is changed:
  \endgroup^^A
  ^^A=============================================================================
  ^^A PARAPHERNALIA:
  ^^A \UD@firstoftwo, \UD@secondoftwo, \UD@stopromannumeral, \UD@CheckWhetherNull,
  ^^A=============================================================================
  \newcommand\UD@firstoftwo[2]{#1}^^A
  \newcommand\UD@secondoftwo[2]{#2}^^A
  \@ifdefinable\UD@stopromannumeral{\chardef\UD@stopromannumeral=`\^^00}^^A
  ^^A-----------------------------------------------------------------------------
  ^^A Check whether argument is empty:
  ^^A.............................................................................
  ^^A \UD@CheckWhetherNull{<Argument which is to be checked>}%
  ^^A                     {<Tokens to be delivered in case that argument
  ^^A                       which is to be checked is empty>}%
  ^^A                     {<Tokens to be delivered in case that argument
  ^^A                       which is to be checked is not empty>}%
  ^^A
  ^^A The gist of this macro comes from Robert R. Schneck's \ifempty-macro:
  ^^A <https://groups.google.com/forum/#!original/comp.text.tex/kuOEIQIrElc/lUg37FmhA74J>
  \newcommand\UD@CheckWhetherNull[1]{^^A
    \romannumeral\expandafter\UD@secondoftwo\string{\expandafter^^A
    \UD@secondoftwo\expandafter{\expandafter{\string#1}\expandafter^^A
    \UD@secondoftwo\string}\expandafter\UD@firstoftwo\expandafter{\expandafter^^A
    \UD@secondoftwo\string}\expandafter\UD@stopromannumeral\UD@secondoftwo}{^^A
    \expandafter\UD@stopromannumeral\UD@firstoftwo}^^A
  }^^A
  ^^A-----------------------------------------------------------------------------
  ^^A Check whether_verbatimized_ argument has a trailing explicit
  ^^A <carriage-return>-character-token of catcode 12(other):
  ^^A-----------------------------------------------------------------------------
  ^^A \UD@CheckWhetherTrailingCarriageReturn{<Argument which is to be checked>}%
  ^^A                                      {<Tokens to be delivered in case
  ^^A                                       <argument which is to be checked>'s
  ^^A                                       last token is an explicit <carriage-
  ^^A                                       return>-character-token of
  ^^A                                       catcode 12(other)>}%
  ^^A                                      {<Tokens to be delivered in case
  ^^A                                       <argument which is to be checked>'s
  ^^A                                       last token is not an explicit
  ^^A                                       <carriage-return>-character-token of
  ^^A                                       catcode 12(other)>}%
  \newcommand\UD@CheckWhetherTrailingCarriageReturn[1]{^^A
    \UD@@CheckWhetherTrailingCarriageReturn#1\UD@SelDom^^M\UD@SelDom\UD@@SelDom^^A
  }^^A
  \@ifdefinable\UD@@CheckWhetherTrailingCarriageReturn{^^A
    \long\def\UD@@CheckWhetherTrailingCarriageReturn#1^^M\UD@SelDom#2\UD@@SelDom{^^A
      \UD@CheckWhetherNull{#2}{\UD@secondoftwo}{\UD@firstoftwo}^^A
    }^^A
  }^^A
  ^^A=============================================================================
  \NewDocumentCommand\CatchFilesForScantokens{m}{^^A
    \begingroup^^A
    \let\do\@makeother^^A
    \do\^^I^^A
    \CatchFilesForScantokensInner{#1}^^A
  }^^A
  \newcommand\verbatimregime{^^A
    \let\do\@makeother^^A
    \dospecials^^A
    \do\^^I^^A
    \do\^^M^^A
    \endlinechar=`\^^M\relax^^A
    \newlinechar=\endlinechar^^A
  }^^A
  \NewDocumentCommand\CatchFilesForScantokensInner{m+v+v}{^^A
    \endgroup^^A
    \begingroup^^A
    \edef\MyScratchmacroB{^^A
      \expandafter\UD@CheckWhetherTrailingCarriageReturn\expandafter{\detokenize{#2}}^^A
        {\unexpanded\expandafter{\detokenize{#2}}}^^A
        {\unexpanded\expandafter{\detokenize{#2^^M}}}^^A
    }^^A
    \clist_map_inline:nn{#1}{^^A
      ^^A\message{##1^^J}^^A
      \CatchFileDef{\MyScratchmacroA}{##1}{\verbatimregime}^^A
      \edef\MyScratchmacroB{^^A
        \unexpanded\expandafter\expandafter\expandafter{\expandafter\MyScratchmacroB\detokenize\expandafter{\MyScratchmacroA}}^^A
      }^^A
    }^^A
    \edef\MyScratchmacroB{^^A
      \unexpanded\expandafter\expandafter\expandafter{\expandafter\MyScratchmacroB\detokenize{#3}%}^^A
    }^^A
    \newlinechar=\endlinechar^^A
    ^^A=======================================================================
    ^^A If you want to see on connsole what \scantokens gets as spreadtab,
    ^^A then enable the next but one line by removing the leading ^^A
    ^^A=======================================================================
    ^^A\show\MyScratchmacroB^^A
    \scantokens\expandafter{\expandafter\endgroup\MyScratchmacroB}^^A
  }^^A
}%

% Create  document:
% =================
\documentclass{article}
\usepackage[a4paper,left=2.5cm,right=2.5cm,bottom=2.8cm,top=2.8cm]{geometry}
\usepackage{longtable,tabu}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{datetime}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage[sc]{mathpazo}
\usepackage{datatool}
\usepackage{spreadtab,booktabs,xpatch}
\usepackage[]{numprint}
\usepackage[]{eurosym}
\usepackage{fp}
\usepackage{booktabs}
\usepackage{tabularx,siunitx}
\usepackage{numprint}

\begin{document}

\CatchFilesForScantokens{%
  MyBu1.txt,
  MyBu2.txt,
  MyBu3.txt,
  MyBu4.txt,
  MyBu5.txt,
  MyBu6.txt,
  MyBu7.txt,
  MyBu8.txt,
  MyBu9.txt,
  MyBu10.txt,
  MyBu11.txt,
  MyBu12.txt,
  MyBu13.txt,
  MyBu14.txt,
  MyBu15.txt
}%
{%
  \begin{spreadtab}{{tabular}{@{\hskip1pt }r@{\hskip7pt }p{2.7cm }crrr}}
  \toprule
  &@ Ku& @ Re & @ Ne & @ Me & @ Br \\ % <- This is row 1.
  \midrule
  \SThiderow 0&&&&&\\ % <- This is row 2 and it is invisible and used for initial values.
}%
{%
  \midrule
  &@To & [-2,-1] &(sum(d3:[0,-1]))tag(BN) & sum(e3:[0,-1])tag(BM)& sum(f3:[0,-1])tag(BB)\\
  \bottomrule
  \end{spreadtab}
}%

\end{document}

!!! This approach is based on reading/tokenizing files in verbatim-category-code-régime. Hereby \input-commands occurring within some of the files of the ⟨comma-separated file list⟩ will not be carried out. I.e., \input-nesting is not possible. All you can do is provide a list of files. !!!
!!! Also it is relied on reading and tokenizing the ⟨preamble code⟩ and the ⟨postamble code⟩ in verbatim-category-code-régime. This in turn implies that \CatchFilesForScantokens

*

*cannot be hidden inside the definition of whatsoever macro and

*cannot be used inside macro-arguments, i.e.,

*must be used in ways where it is ensured that the arguments will be obtained by reading and tokenizing things from the .tex-input-file while the changes of the category-code-régime temporarily introduced by \CatchFilesForScantokens are in effect.

!!!


text:
Q: Difference between "This is" and "It is", "These are" and "They are" When I should use "It is" and when "This is"?
For example when I show an apple to my son, how is better to say:

*

*It is an apple

*This is an apple

What is the main difference between abovementioned phrases?
The same problem when I show scissors, glasses etc. (plural nouns)

*

*These are glasses

*They are glasses - sounds very awkward to me.

A: You say "This is an apple." while gestering with the hand to indicate what this refers to.  Using it means you have already established a subject and can repeat it. E.g. you might continue with "It is good for you.".  Don't use it without an antecedent. Do use this when presenting the thing being referred to.
For the second, when you first start to talk you hold the glasses in your hand, point to them,or somesuch, and say "These are glasses." Now that you have established a subject, you can continue with "They must be kept clean."  If the idea of glasses being plural in English is just odd sounding, ponder the fact that it's a pair of glasses.  To refer to one lens only, or any other component like a screw at the temple, would need explicit focus on that part.  "These are my glasses.  One lens corrects astigmatism and the other is plain glass." So talking about the set, "I wear a pair of glasses. They correct my vision."  That's the same as "I wear glasses. They correct my vision." Think about the pair to justify why it sounds that way.


text:
Q: Is there a way to get response headers without download the url content in Python? I'm using Python to write a manager that will download some files given some conditions. The problem is that the conditions are to be performed against the response headers.
The example below is a simplified version of what I'm doing now. I first download the file and then test whether its name, contained in the headers, is in a list defined previously.
I'd like to know if is there a way to get the response without download the content, which takes a huge time in my real case.
import requests

# The line below download the file, but I'd like not to do it.
req = requests.get('http://some_url.com/some_file')

# Get the name of the file to test if it's the right file.
r = re.search(r'filename="(.*)";', req.headers['Content-Disposition'])

filename = None

# If the filename is present in the headers...
if r.groups():
    filename = r.groups()[0]

# If the filename is in an authorized list...
if filename in [...]:
   # Process req.content

A: You can use requests.head() instead of requests.get().


text:
Q: Changing Default port for Nagios NSClient++ The default port for NSClient++ is 12489. Is is possible to change this port, and if so where does this change need to be made?

A: The TCP port 12489 is the default port for using check_nt not for all the services offered by nsclient.
If you want to change the default port, you can do this in the file nsclient.ini.
You would have something like this :
<snip>
[/settings/NSClient/server]

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489 <= CHANGE HERE TO HAVE YOUR NEW LISTENING PORT
<snip>

After, don't forget to restart your service. And test with netstat to be sure your new port is correctly opened.


text:
Q: Компилирование GCC по Linux From Scratch - 3 ошибки При попытке компилирования GCC (шаг первый) выходят такие ошибки:
checking for x86_64-pc-linux-gnu-gcc...  /mnt/lfs/sources/gcc-8.2.0/build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-8.2.0/build/./prev-gcc/ -B/tools/x86_64-pc-linux-gnu/bin/ -B/tools/x86_64-pc-linux-gnu/bin/ -B/tools/x86_64-pc-linux-gnu/lib/ -isystem /tools/x86_64-pc-linux-gnu/include -isystem /tools/x86_64-pc-linux-gnu/sys-include
checking for C compiler default output file name...
configure: error: in `/mnt/lfs/sources/gcc-8.2.0/build/intl':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [Makefile:8927: configure-stage2-intl] Ошибка 77
make[2]: выход из каталога «/mnt/lfs/sources/gcc-8.2.0/build»
make[1]: *** [Makefile:21584: stage2-bubble] Ошибка 2
make[1]: выход из каталога «/mnt/lfs/sources/gcc-8.2.0/build»
make: *** [Makefile:897: all] Ошибка 2

Проблему так и не нашел, но если открыть config.log то в нем есть ссылка на файл confdefs.h и isl/schedule.h.
Если быть точнее то:
configure:5924: gcc -o conftest -g -O2  -I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src -I$$s/mpc/src     -lisl -L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp conftest.c  -lisl -lgmp >&5
/usr/bin/ld: cannot find -lmpc
collect2: error: ld returned 1 exit status
configure:5924: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <isl/schedule.h>
| int
| main ()
| {
| isl_options_set_schedule_serialize_sccs (NULL, 0);
|   ;
|   return 0;
| }

Я пытался найти похожие ошибки, но это было бессмысленно.
Кстати, содержание файла config.log
## --------- ##
## Platform. ##
## --------- ##

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2304: checking build system type
configure:2318: result: x86_64-pc-linux-gnu
configure:2365: checking host system type
configure:2378: result: x86_64-pc-linux-gnu
configure:2398: checking target system type
configure:2411: result: x86_64-pc-linux-gnu
configure:2465: checking for a BSD-compatible install
configure:2533: result: /usr/bin/install -c
configure:2544: checking whether ln works
configure:2566: result: yes
configure:2570: checking whether ln -s works
configure:2574: result: yes
configure:2581: checking for a sed that does not truncate output
configure:2645: result: /bin/sed
configure:2654: checking for gawk
configure:2670: found /usr/bin/gawk
configure:2681: result: gawk
configure:3212: checking for libitm support
configure:3222: result: yes
configure:3231: checking for libsanitizer support
configure:3241: result: yes
configure:3289: checking for libhsail-rt support
configure:3301: result: yes
configure:4008: checking for gcc
configure:4024: found /usr/bin/gcc
configure:4035: result: gcc
configure:4264: checking for C compiler version
configure:4273: gcc --version >&5
gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4284: $? = 0
configure:4273: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.2.0-7ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)
configure:4284: $? = 0
configure:4273: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4284: $? = 1
configure:4273: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:4284: $? = 1
configure:4304: checking for C compiler default output file name
configure:4326: gcc    conftest.c  >&5
configure:4330: $? = 0
configure:4367: result: a.out
configure:4383: checking whether the C compiler works
configure:4392: ./a.out
configure:4396: $? = 0
configure:4411: result: yes
configure:4418: checking whether we are cross compiling
configure:4420: result: no
configure:4423: checking for suffix of executables
configure:4430: gcc -o conftest    conftest.c  >&5
configure:4434: $? = 0
configure:4456: result:
configure:4462: checking for suffix of object files
configure:4484: gcc -c   conftest.c >&5
configure:4488: $? = 0
configure:4509: result: o
configure:4513: checking whether we are using the GNU C compiler
configure:4532: gcc -c   conftest.c >&5
configure:4532: $? = 0
configure:4541: result: yes
configure:4550: checking whether gcc accepts -g
configure:4570: gcc -c -g  conftest.c >&5
configure:4570: $? = 0
configure:4611: result: yes
configure:4628: checking for gcc option to accept ISO C89
configure:4692: gcc  -c -g -O2  conftest.c >&5
configure:4692: $? = 0
configure:4705: result: none needed
configure:4783: checking for g++
configure:4799: found /usr/bin/g++
configure:4810: result: g++
configure:4837: checking for C++ compiler version
configure:4846: g++ --version >&5
g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0
configure:4857: $? = 0
configure:4846: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.2.0-7ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)
configure:4857: $? = 0
configure:4846: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:4857: $? = 1
configure:4846: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:4857: $? = 1
configure:4861: checking whether we are using the GNU C++ compiler
configure:4880: g++ -c   conftest.cpp >&5
configure:4880: $? = 0
configure:4889: result: yes
configure:4898: checking whether g++ accepts -g
configure:4918: g++ -c -g  conftest.cpp >&5
configure:4918: $? = 0
configure:4959: result: yes
configure:5008: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:5025: g++ -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.cpp  >&5
configure:5025: $? = 0
configure:5026: result: yes
configure:5090: checking for gnatbind
configure:5120: result: no
configure:5182: checking for gnatmake
configure:5212: result: no
configure:5231: checking whether compiler driver understands Ada
configure:5254: result: no
configure:5263: checking how to compare bootstrapped objects
configure:5288: result: cmp --ignore-initial=16 $$f1 $$f2
configure:5348: checking for objdir
configure:5363: result: .libs
configure:5911: checking for isl 0.15 or later
configure:5924: gcc -o conftest -g -O2  -I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src -I$$s/mpc/src     -lisl -L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp conftest.c  -lisl -lgmp >&5
/usr/bin/ld: cannot find -lmpc
collect2: error: ld returned 1 exit status
configure:5924: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <isl/schedule.h>
| int
| main ()
| {
| isl_options_set_schedule_serialize_sccs (NULL, 0);
|   ;
|   return 0;
| }
configure:5931: result: no
configure:5935: result: required isl version is 0.15 or later
configure:7028: checking for default BUILD_CONFIG
configure:7060: result: bootstrap-debug
configure:7065: checking for --enable-vtable-verify
configure:7078: result: no
configure:7678: checking for bison
configure:7694: found /usr/bin/bison
configure:7705: result: bison -y
configure:7725: checking for bison
configure:7741: found /usr/bin/bison
configure:7752: result: bison
configure:7772: checking for gm4
configure:7802: result: no
configure:7772: checking for gnum4
configure:7802: result: no
configure:7772: checking for m4
configure:7788: found /usr/bin/m4
configure:7799: result: m4
configure:7819: checking for flex
configure:7835: found /usr/bin/flex
configure:7846: result: flex
configure:7867: checking for flex
configure:7883: found /usr/bin/flex
configure:7894: result: flex
configure:7914: checking for makeinfo
configure:7930: found /usr/bin/makeinfo
configure:7941: result: makeinfo
configure:7975: checking for expect
configure:8005: result: no
configure:8024: checking for runtest
configure:8054: result: no
configure:8169: checking for ar
configure:8185: found /usr/bin/ar
configure:8196: result: ar
configure:8310: checking for as
configure:8326: found /usr/bin/as
configure:8337: result: as
configure:8451: checking for dlltool
configure:8481: result: no
configure:8592: checking for ld
configure:8608: found /usr/bin/ld
configure:8619: result: ld
configure:8733: checking for lipo
configure:8763: result: no
configure:8874: checking for nm
configure:8890: found /usr/bin/nm
configure:8901: result: nm
configure:9015: checking for ranlib
configure:9031: found /usr/bin/ranlib
configure:9042: result: ranlib
configure:9151: checking for strip
configure:9167: found /usr/bin/strip
configure:9178: result: strip
configure:9287: checking for windres
configure:9317: result: no
configure:9428: checking for windmc
configure:9458: result: no
configure:9569: checking for objcopy
configure:9585: found /usr/bin/objcopy
configure:9596: result: objcopy
configure:9710: checking for objdump
configure:9726: found /usr/bin/objdump
configure:9737: result: objdump
configure:9851: checking for readelf
configure:9867: found /usr/bin/readelf
configure:9878: result: readelf
configure:10031: checking for cc
configure:10047: found /usr/bin/cc
configure:10058: result: cc
configure:10192: checking for c++
configure:10208: found /usr/bin/c++
configure:10219: result: c++
configure:10353: checking for gcc
configure:10369: found /usr/bin/gcc
configure:10380: result: gcc
configure:10509: checking for gfortran
configure:10539: result: no
configure:10670: checking for gccgo
configure:10700: result: no
configure:10761: checking for ar
configure:10779: found /tools/x86_64-pc-linux-gnu/bin/ar
configure:10791: result: /tools/x86_64-pc-linux-gnu/bin/ar
configure:10991: checking for as
configure:11009: found /tools/x86_64-pc-linux-gnu/bin/as
configure:11021: result: /tools/x86_64-pc-linux-gnu/bin/as
configure:11221: checking for dlltool
configure:11254: result: no
configure:11371: checking for dlltool
configure:11401: result: no
configure:11451: checking for ld
configure:11469: found /tools/x86_64-pc-linux-gnu/bin/ld
configure:11481: result: /tools/x86_64-pc-linux-gnu/bin/ld
configure:11681: checking for lipo
configure:11714: result: no
configure:11831: checking for lipo
configure:11861: result: no
configure:11911: checking for nm
configure:11929: found /tools/x86_64-pc-linux-gnu/bin/nm
configure:11941: result: /tools/x86_64-pc-linux-gnu/bin/nm
configure:12141: checking for objcopy
configure:12159: found /tools/x86_64-pc-linux-gnu/bin/objcopy
configure:12171: result: /tools/x86_64-pc-linux-gnu/bin/objcopy
configure:12371: checking for objdump
configure:12389: found /tools/x86_64-pc-linux-gnu/bin/objdump
configure:12401: result: /tools/x86_64-pc-linux-gnu/bin/objdump
configure:12601: checking for ranlib
configure:12619: found /tools/x86_64-pc-linux-gnu/bin/ranlib
configure:12631: result: /tools/x86_64-pc-linux-gnu/bin/ranlib
configure:12831: checking for readelf
configure:12849: found /tools/x86_64-pc-linux-gnu/bin/readelf
configure:12861: result: /tools/x86_64-pc-linux-gnu/bin/readelf
configure:13061: checking for strip
configure:13079: found /tools/x86_64-pc-linux-gnu/bin/strip
configure:13091: result: /tools/x86_64-pc-linux-gnu/bin/strip
configure:13291: checking for windres
configure:13324: result: no
configure:13441: checking for windres
configure:13471: result: no
configure:13521: checking for windmc
configure:13554: result: no
configure:13671: checking for windmc
configure:13701: result: no
configure:13729: checking where to find the target ar
configure:13757: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:13771: checking where to find the target as
configure:13799: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:13813: checking where to find the target cc
configure:13836: result: just compiled
configure:13855: checking where to find the target c++
configure:13881: result: just compiled
configure:13900: checking where to find the target c++ for libstdc++
configure:13926: result: just compiled
configure:13945: checking where to find the target dlltool
configure:13978: result: host tool
configure:13987: checking where to find the target gcc
configure:14010: result: just compiled
configure:14029: checking where to find the target gfortran
configure:14065: result: host tool
configure:14074: checking where to find the target gccgo
configure:14110: result: host tool
configure:14119: checking where to find the target ld
configure:14147: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14161: checking where to find the target lipo
configure:14183: result: host tool
configure:14192: checking where to find the target nm
configure:14220: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14234: checking where to find the target objcopy
configure:14262: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14276: checking where to find the target objdump
configure:14304: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14318: checking where to find the target ranlib
configure:14346: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14360: checking where to find the target readelf
configure:14388: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14402: checking where to find the target strip
configure:14430: result: pre-installed in /tools/x86_64-pc-linux-gnu/bin
configure:14444: checking where to find the target windres
configure:14477: result: host tool
configure:14486: checking where to find the target windmc
configure:14519: result: host tool
configure:14556: checking whether to enable maintainer-specific portions of Makefiles
configure:14565: result: no
configure:14796: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by config.status, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  CONFIG_FILES    =
  CONFIG_HEADERS  =
  CONFIG_LINKS    =
  CONFIG_COMMANDS =
  $ ./config.status

on dappinc-pc

config.status:978: creating Makefile

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/ar'
AS='as'
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/as'
AWK='gawk'
BISON='bison'
BUILD_CONFIG='bootstrap-debug'
CC='gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
CFLAGS='-g -O2'
CFLAGS_FOR_BUILD='-g -O2'
CFLAGS_FOR_TARGET='-g -O2'
COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX='g++ -std=gnu++98'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BUILD='-g -O2'
CXXFLAGS_FOR_TARGET='-g -O2'
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DLT_OBJDIR=\".libs/\"'
DLLTOOL='dlltool'
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET='$(DLLTOOL)'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT='expect'
FLAGS_FOR_TARGET=' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
FLEX='flex'
GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
GCC_SHLIB_SUBDIR=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET='$(GFORTRAN)'
GNATBIND='no'
GNATMAKE='no'
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET='$(GOC)'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='ld'
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/ld'
LEX='flex'
LIBOBJS=''
LIBS=''
LIPO='lipo'
LIPO_FOR_TARGET='$(LIPO)'
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4='m4'
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='makeinfo'
NM='nm'
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/nm'
OBJCOPY='objcopy'
OBJCOPY_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/objcopy'
OBJDUMP='objdump'
OBJDUMP_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/objdump'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB='ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/ranlib'
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
READELF='readelf'
READELF_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/readelf'
RPATH_ENVVAR='LD_LIBRARY_PATH'
RUNTEST='runtest'
SED='/bin/sed'
SHELL='/bin/bash'
STRIP='strip'
STRIP_FOR_TARGET='/tools/x86_64-pc-linux-gnu/bin/strip'
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../configure --target= --prefix=/tools --with-glibc-version=2.11 --with-sysroot=/mnt/lfs --with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++'
WINDMC='windmc'
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET='$(WINDMC)'
WINDRES='windres'
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET='$(WINDRES)'
YACC='bison -y'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_configargs=' --cache-file=./config.cache '\''--prefix=/tools'\'' '\''--with-glibc-version=2.11'\'' '\''--with-sysroot=/mnt/lfs'\'' '\''--with-newlib'\'' '\''--without-headers'\'' '\''--with-local-prefix=/tools'\'' '\''--with-native-system-header-dir=/tools/include'\'' '\''--disable-nls'\'' '\''--disable-shared'\'' '\''--disable-multilib'\'' '\''--disable-decimal-float'\'' '\''--disable-threads'\'' '\''--disable-libatomic'\'' '\''--disable-libgomp'\'' '\''--disable-libmpx'\'' '\''--disable-libquadmath'\'' '\''--disable-libssp'\'' '\''--disable-libvtv'\'' '\''--disable-libstdcxx'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
build_configdirs=' libiberty libcpp fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-pc-linux-gnu'
build_noncanonical='x86_64-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-pc-linux-gnu'
build_tooldir='${exec_prefix}/x86_64-pc-linux-gnu'
build_vendor='pc'
compare_exclusions='gcc/cc*-checksum$(objext) | gcc/ada/*tools/*'
configdirs=' intl libiberty zlib libbacktrace libcpp libdecnumber gmp mpfr mpc fixincludes gcc libcc1 lto-plugin'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare='cmp --ignore-initial=16 $$f1 $$f2'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
extra_host_libiberty_configure_flags='--enable-shared'
extra_host_zlib_configure_flags=''
extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
extra_liboffloadmic_configure_flags=''
extra_linker_plugin_configure_flags=''
extra_linker_plugin_flags=''
extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/.libs'
extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
get_gcc_base_ver='cat'
gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src -I$$s/mpc/src '
gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp'
host='x86_64-pc-linux-gnu'
host_alias=''
host_configargs=' --cache-file=./config.cache  '\''--prefix=/tools'\'' '\''--with-glibc-version=2.11'\'' '\''--with-sysroot=/mnt/lfs'\'' '\''--with-newlib'\'' '\''--without-headers'\'' '\''--with-local-prefix=/tools'\'' '\''--with-native-system-header-dir=/tools/include'\'' '\''--disable-nls'\'' '\''--disable-shared'\'' '\''--disable-multilib'\'' '\''--disable-decimal-float'\'' '\''--disable-threads'\'' '\''--disable-libatomic'\'' '\''--disable-libgomp'\'' '\''--disable-libmpx'\'' '\''--disable-libquadmath'\'' '\''--disable-libssp'\'' '\''--disable-libvtv'\'' '\''--disable-libstdcxx'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
host_cpu='x86_64'
host_noncanonical='x86_64-pc-linux-gnu'
host_os='linux-gnu'
host_shared='no'
host_subdir='.'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc=''
isllibs=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags='-static-libstdc++ -static-libgcc'
poststage1_libs=''
prefix='/tools'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags='-g'
stage1_checking='--enable-checking=yes,types'
stage1_languages='c,c++,lto'
stage1_ldflags='-static-libstdc++ -static-libgcc'
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-gnu'
target_alias=''
target_configargs='--cache-file=./config.cache   '\''--prefix=/tools'\'' '\''--with-glibc-version=2.11'\'' '\''--with-sysroot=/mnt/lfs'\'' '\''--with-newlib'\'' '\''--without-headers'\'' '\''--with-local-prefix=/tools'\'' '\''--with-native-system-header-dir=/tools/include'\'' '\''--disable-nls'\'' '\''--disable-shared'\'' '\''--disable-multilib'\'' '\''--disable-decimal-float'\'' '\''--disable-threads'\'' '\''--disable-libatomic'\'' '\''--disable-libgomp'\'' '\''--disable-libmpx'\'' '\''--disable-libquadmath'\'' '\''--disable-libssp'\'' '\''--disable-libvtv'\'' '\''--disable-libstdcxx'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
target_configdirs=' libgcc'
target_cpu='x86_64'
target_noncanonical='x86_64-pc-linux-gnu'
target_os='linux-gnu'
target_subdir='x86_64-pc-linux-gnu'
target_vendor='pc'
tooldir='${exec_prefix}/x86_64-pc-linux-gnu'

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag='/dev/null'
host_makefile_frag='/dev/null'
ospace_frag='/dev/null'
serialization_dependencies='serdep.tmp'
target_makefile_frag='../config/mt-gnu'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define LT_OBJDIR ".libs/"

configure: exit 0


text:
Q: how to use concat function in ms sql where condition with like I have got right output using this below query in Oracle.
SELECT COUNT(*) AS CNT FROM MSS WHERE TRIM(UPPER(FIRSTNAME)|| UPPER(SECONDNAME)) LIKE UPPER('qw1')||UPPER('121212')

However I need the query for MS SQL Server, any help would be appreciated..

A: Try
SELECT COUNT(*) AS CNT FROM MSS WHERE LTRIM(RTRIM(UPPER(FIRSTNAME) + UPPER(SECONDNAME))) LIKE UPPER('qw1') + UPPER('121212')

But I'm not sure if you don't need to compare for anything containg your like condition:
SELECT COUNT(*) AS CNT FROM MSS WHERE LTRIM(RTRIM(UPPER(FIRSTNAME) + UPPER(SECONDNAME))) LIKE '%' + UPPER('qw1') + UPPER('121212') + '%'

Otherwise you could just use = in your first query:
SELECT COUNT(*) AS CNT FROM MSS WHERE LTRIM(RTRIM(UPPER(FIRSTNAME) + UPPER(SECONDNAME))) = UPPER('qw1') + UPPER('121212')

A: 1.when creating the table MSS, make sure case sensivity is off on names(collation) and
make sure you use varchar or nvarchar for names.
Example:
CREATE TABLE MSS
(
firstname nvarchar(50) collate Latin1_General_CI_AS,
lastname nvarchar(50) collate Latin1_General_CI_AS
)

2.when populating the table MSS make sure there are no spaces before the name.
Example:
declare @val1 nvarchar(50) = ' qw1 '
declare @val2 nvarchar(50) = ' 121212 '
insert MSS(firstname, lastname)
values(ltrim(@val1), ltrim(@val2))

3.make a update query to fix current data so the names are not starting with spaces.
Example:
UPDATE MSS
SET FIRSTNAME = LTRIM(FIRSTNAME),
SECONDNAME = LTRIM(SECONDNAME)
WHERE FIRSTNAME <> LTRIM(FIRSTNAME)
or SECONDNAME <> LTRIM(SECONDNAME)

4.write your query.
Example:
SELECT COUNT(*) AS CNT
FROM MSS
WHERE FIRSTNAME like 'qw1'
and SECONDNAME like '121212'

Please stop concating columns before comparing, it slows performance


text:
Q: JBoss AS 4.2 Overview tab in Eclipse Luna EE SR2 This is probably trivial question but I can't find solution to it. I past few days I installed several times Luna EE R with JBoss AS Tools (while it was still beta),

and I had automatically (or I think it was automatically) - after configuration - JBoss Overview tab opened, and in Project Explorer I had Servers -> JBoss AS 4.2 server shown.
Now, with new installation, Eclipse Luna EE SR2, and JBossAS Tools stable release, I don't have it, and I can't find where or how to turn it on. Othervwise it works OK (I can run or debug project). Now there are some quute important settings in that Overrview tab so my questions are:

*

*How to open JBoss AS 4.2 Overview tab

*How to show JBoss server in Project Explorer

*Why my project "MC_trunk" it is not listed in debug Configuration, Remote Java Application, and how to get that?

Probably this is just one or two check boxes which I miss, but I opened both versions of eclipse I just find how to get those views.

A: I found answer here. Apparently I what I had to do was:
Window -> Show View -> Servers, open Servers tab, right click on JBoss AS 4.2 -> Properties -> Switch Location -> Location: [workspace metadata] -> Location: /Servers/JBoss AS 4.2.server -> Apply -> OK


text:
Q: i keep getting a Value error in python I am new to programming  I decided I would make a basic maths game. I started
    print ("what is your name")
    name = input ()
    print ("hello " + name + " i am steve and this is my maths test. Are you ready? Y/N")
    answer_1 = input ()
    answer_1 = int (answer_1)
if answer_1 ==Y:
    print ("Good then lets get started")

else:
    print ("well you have started now so to late lets go")

I went to test it and every time I do I get this.
what is your name
Callum
hello Callum i am steve and this is my maths test. Are you ready? Y/N
Y
Traceback (most recent call last):
  File "C:\Users\callum\Documents\programming\maths test.py", line 6, in <module>
answer_1 = int (answer_1)
ValueError: invalid literal for int() with base 10: 'Y'
>>>

Can anyone tell me what I have done wrong

A: You are trying to convert the letter 'y' into a base 10 number.
Take this line out of your code.
answer_1 = int (answer_1)

Also when you are testing for string equality, remember to use quotation marks or the python interpreter won't know if you mean a variable name or the actual string 'Y'.
if answer_1 =='Y':
    print ("Good then lets get started")

A: Simply:
if answer_1 == 'Y':

And don't convert it to an integer...

A: you are converting the string input from this line
answer_1 = input ()

into an integer here
answer_1 = int (answer_1)

this will not work if the input is "Y".
Then you compare this input with Y, but you should compare with the string "Y" here:
if answer_1 ==Y:

finally, i think it is not a good idea to have spaces in programming-related filesnames.

A: remove this line : answer_1 = int (answer_1)
and change this if answer_1 == Y: to if answer_1 == 'Y':


text:
Q: How to Implement Transactions in Mongodb using Nodejs having MVC pattern? I want to implement the Transactions with the Nodejs(express) and Mongodb but I am not able to find the proper solution that how it can be implemented in MVC pattern?
I tried to do so but there are multiple DB calls in a single API with are gradually be called one by one when it returns the response to the controller. For example, I want to add a user but it related to a person. So if the transaction fails to insert Person info then it's user info should also be deleted in any case of error.


text:
Q: spring @scheduled cron with variable in our system we use a settings class to point to the properties file, depends on which eve it loads different property file. To access specific property, we call 'Settings.getString('property_name_here')'.
In my code, i loaded the @scheduled cron expression to a variable and try to passed to the @scheduled annotation, but it won't work,
here is my code:
in properties file:
cron.second=0
cron.min=1
cron.hour=14

in constructor i have:
this.cronExpression = new StringBuilder()
            .append(settings.getString("cron.second"))
            .append(" ")
            .append(settings.getString("cron.min"))
            .append(" ")
            .append(settings.getString("cron.hour"))
            .append(" ")
            .append("*").append(" ").append("*").append(" ").append("*")
            .toString();

which create a String of "0 1 14 * * *", it's a valid con expression
in the scheduled task i have:
@Scheduled(cron = "${this.cronExpression}")
public void scheduleTask() throws Exception {
         ....
 }

when I ran the code it complaint:
Caused by: java.lang.IllegalStateException: Encountered invalid @Scheduled method 'scheduleTask': Cron expression must consist of 6 fields (found 1 in "${this.cronExpression}")
then I changed this.cronExpression to a list of String:
    this.cronExpression = Lists.newArrayList();
    this.cronExpression.add(settings.getString("cron.second"));
    this.cronExpression.add(settings.getString("cron.min"));
    this.cronExpression.add(settings.getString("cron.hour"));
    this.cronExpression.add("*");
    this.cronExpression.add("*");
    this.cronExpression.add("*");

but still got the same error, so what exactly is the cron expression supposed to be?

A: What I did and it worked for me:
In properties file:
my.cron.expression=0 3 * * * ?

In code:
@Scheduled(cron = "${my.cron.expression}")
public void scheduleTask(){
  ...
}


text:
Q: User control dependencyproperychanged event firing, but bound viewmodel not updating... What's going on? I recently stumbled across this issue with WPFs DatePicker control. Basically, the popup causes an exception when you:

*

*Set the DatePickers Control Template via a style

*Bind the IsEnabled to a property on your ViewModel

*Run your program and Enable the DatePicker

*Drop down the calendar popup

*disable the DatePicker, then re-enable it

*Drop down the calendar popup again

I know that's a very specific scenario, but it happens all the time in my application. An entire user control full of controls starts off as disabled, the user selects a record, (filling the form), edits, saves, repeats. The second time they run it, selecting a calendar from a DatePicker crashes it.
I've set the DatePicker's control template in a style to show a disabled text box when disabled, to better fit with the look of the rest of the disabled appearances (I did the same with comboboxes with no issue).
So, knowing that this is the cause of my issue, I set out to create my own user control to handle the disabled appearance of a DatePicker. It simply wraps a Datepicker, provides some dependency properties to bind to the DatePicker properties I care about, and swaps the template of the user control with a text box when disabled. That way I get the look I want, without having to trip over the DatePicker's bug.
My issue is that, while the DependencyPropertyChanged events are firing with new values when I select a new date on my user control, these values never make their way to the external viewmodel that I'm binding to. I've looked at it every which way, and it's not making any sense to me:
DisableableDatePicker Code Behind
public partial class DisableableDatePicker : UserControl
{
    public static readonly DependencyProperty SelectedDateProperty = DependencyProperty.Register("SelectedDate", typeof(DateTime?), typeof(DisableableDatePicker), new PropertyMetadata(DateChanged));

    private static void DateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        Console.WriteLine(((DateTime)e.NewValue).ToString("yyyy-MM-dd"));
    }

    public DateTime? SelectedDate
    {
        get { return (DateTime?)GetValue(SelectedDateProperty); }
        set { SetValue(SelectedDateProperty, value); }
    }

    public static readonly DependencyProperty DisplayDateEndProperty = DependencyProperty.Register("DisplayDateEnd", typeof(DateTime?), typeof(DisableableDatePicker));
    public DateTime? DisplayDateEnd
    {
        get { return (DateTime?)GetValue(DisplayDateEndProperty); }
        set { SetValue(DisplayDateEndProperty, value); }
    }

    public static readonly DependencyProperty DisplayDateStartProperty = DependencyProperty.Register("DisplayDateStart", typeof(DateTime?), typeof(DisableableDatePicker));
    public DateTime? DisplayDateStart
    {
        get { return (DateTime?)GetValue(DisplayDateStartProperty); }
        set { SetValue(DisplayDateStartProperty, value); }
    }

    public static readonly DependencyProperty BlackoutDatesProperty = DependencyProperty.Register("BlackoutDates", typeof(List<DateTime>), typeof(DisableableDatePicker));
    public List<DateTime> BlackoutDates
    {
        get { return (List<DateTime>)GetValue(BlackoutDatesProperty); }
        set { SetValue(BlackoutDatesProperty, value); }
    }

    public DisableableDatePicker()
    {
        InitializeComponent();

        ClearValue(SelectedDateProperty);
        ClearValue(DisplayDateEndProperty);
        ClearValue(DisplayDateStartProperty);
        ClearValue(BlackoutDatesProperty);
        ClearValue(IsEnabledProperty);
    }
}

I added in the DependencyPropertyChanged event 'DateChanged' to print the new value to the console whenever one is selected. These new values show in the console just fine, without any issue.
DisableableDatePicker XAML
<UserControl x:Class="ALERT_Human_Resources.View.DisableableDatePicker"
             ...
             Margin="0,0,0,3" x:Name="root" >
    <UserControl.Resources>
        <local:InverseBooleanConverter x:Key="DisableableDatePicker_InvertBoolean" />
        <system:String x:Key="DateFormat">yyyy-MM-dd</system:String>
    </UserControl.Resources>
    <UserControl.Style>
        <Style TargetType="{x:Type UserControl}">
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <TextBox IsEnabled="False" Text="{Binding Path=SelectedDate, ElementName=root" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>
    <DatePicker
                    local:DependencyPropertyHost.BlackoutDates="{Binding Path=BlackoutDates, ElementName=root}"
                    DisplayDateEnd="{Binding Path=DisplayDateEnd, ElementName=root}"
                    DisplayDateStart="{Binding Path=DisplayDateStart, ElementName=root}"
                    SelectedDate="{Binding Path=SelectedDate, ElementName=root, StringFormat={StaticResource DateFormat}}"
                    IsEnabled="{Binding Path=IsEnabled, ElementName=root}" />
</UserControl>

DisableableDatePicker Usage
<view:DisableableDatePicker Margin="0,0,0,3"
    SelectedDate="{Binding HighlightDate, UpdateSourceTrigger=PropertyChanged}"
    DisplayDateStart="{Binding StartDate}"
    DisplayDateEnd="{Binding EndDate}"
    IsEnabled="{Binding IsEditing}"
    BlackoutDates="{Binding BlackoutDates}" />

DisableableDatePicker Bound ViewModel Property
public DateTime HighlightDate
{
    get
    {
        return SelectedDailyHighlight == null ? DateTime.MinValue : SelectedDailyHighlight.HighlightDate;
    }
    set
    {
        if (SelectedDailyHighlight != null && value != null && SelectedDailyHighlight.HighlightDate == value)
            return;
        SelectedDailyHighlight.HighlightDate = value;
        OnPropertyChanged("HighlightDate");
    }
}

So, when I put breakpoints in the ViewModels getter and setter, the getter is hit properly, but the setter is never called. I find this odd, because my dependency property is reporting that it sees the new values.
The final piece to this puzzle is how I bind the Blackout dates. I wanted to be able to bind to a simple list of dates. To do this easily, I've added the following at an attached property:
 public static readonly DependencyProperty BlackoutDatesProperty =
    DependencyProperty.RegisterAttached("BlackoutDates", typeof(List<DateTime>),
    typeof(DependencyPropertyHost),
    new FrameworkPropertyMetadata(null, OnBlackoutDatesChanged));

public static List<DateTime> GetBlackoutDates(DependencyObject d)
{
    return (List<DateTime>)d.GetValue(BlackoutDatesProperty);
}

public static void SetBlackoutDates(DependencyObject d, List<DateTime> value)
{
    d.SetValue(BlackoutDatesProperty, value);
}

private static void OnBlackoutDatesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    DatePicker datePicker = d as DatePicker;
    if (e.NewValue != null && datePicker != null)
    {
        List<DateTime> blackoutDates = (List<DateTime>)e.NewValue;
        var toRemove = datePicker.BlackoutDates.Select
                                                (x => x.Start).Except
                                                (blackoutDates.Select(y => y)).ToList();
        foreach (DateTime date in toRemove)
        {
            datePicker.BlackoutDates.Remove(datePicker.BlackoutDates.Single(x => x.Start == date));
        }
        foreach (DateTime date in blackoutDates)
        {
            if (!datePicker.BlackoutDates.Contains(date) &&
                date >= datePicker.DisplayDateStart &&
                date <= datePicker.DisplayDateEnd &&
                datePicker.SelectedDate != date)
            {
                datePicker.BlackoutDates.Add(new CalendarDateRange(date));
            }
        }
    }
}

A: By default, Dependency Properties bind OneWay.  Meaning it will read from the View Model, but won't write to it.  You have 2 options to fix this.
Option 1: In your binding set the mode to TwoWay.
<view:DisableableDatePicker Margin="0,0,0,3"
    SelectedDate="{Binding HighlightDate}"
    DisplayDateStart="{Binding StartDate}"
    DisplayDateEnd="{Binding EndDate}"
    IsEnabled="{Binding IsEditing}"
    BlackoutDates="{Binding BlackoutDates, Mode=TwoWay}" />

Option 2: Set the default binding mode to TwoWay in your code behind.
 public static readonly DependencyProperty BlackoutDatesProperty =
    DependencyProperty.RegisterAttached("BlackoutDates", typeof(List<DateTime>),
    typeof(DependencyPropertyHost),
    new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,  OnBlackoutDatesChanged));


text:
Q: Why do old editors like Vim and Emacs expose the difference between a File and a Buffer in the interface? Does my question make sense? Using either Vim or Emacs, you come to understand that the interface exposes the code's representation of the state of the file you are editing in the buffer, the file is the on-disk storage you can fill a buffer from or write a buffer to. All these things a programmer would know, but when just editing text, why is it exposed? Any newer editor just tells you "Here is a file. Edit it."
Yes, I understand the technical meanings, but that isn't my question. This is a question not even about if it is a good idea to do it or not. Vim and Emacs are our two oldest editors in common use today, and they share this behavior. I know of no new editor that does the same. When did editors stop doing this and why?

A: Because several buffers can show you different view of the same file. I do not know of other editors but this is true of Emacs. And what do you mean exactly with Old?

A: For starters, Emacs uses plenty of buffers that aren't associated with any file.  Any time you open a directory, read your mail, open a terminal, compile a program, launch an interactive Python session, or connect to a database, you get a buffer.  Hence, Emacs's basic unit of work is a buffer and not a file, and the same logic holds for Vim.
New applications that only edit files make no distinction because every screen or window or tab directly represents a file.  More capable applications like Emacs and Vim are a lot more flexible in that respect.

A: OK, here's my weird philosophical answer :
because late binding between the buffer in the editor and the actual concrete thing you're working on, gives the editing environment more flexibility and power.
Think this is out of date? One place where the idea is back with a vengeance is in the browser, where you don't have 1-1 correspondence between tabs and web-pages. Instead, inside each tab you can navigate forwards and backwards between multiple pages. No-one would try to make an MDI type interface to the web, where each page had it's own inner window. It would be impossibly fiddly to use. It just wouldn't scale.
Personally, I think IDEs are getting way too complicated these days, and the static binding between documents and buffers is one reason for this. I expect at some point there'll be a breakthrough as they move to the browser-like tabbed-buffer model where :
a) you'll be able to hyperlink between multiple files within the same buffer/tab (and there'll be a back-button etc.)
b) the generic buffers will be able to hold any type of data : source-code, command-line, dynamically generated graphic output, project outline etc.
In other words, much of the Vim / Emacs model, except tweaked to be more in-line with discoveries that browsers are making.

A: When applications started becoming used heavily by non-geeks who didn't want to trouble themselves with irrelevant detail.

A: I think the new editors quit doing it for the reasons you stated, that it is an abstraction that just gets in the way. Also most modern editors have unlimited undo, so the idea of the "buffer" is sort of implicit.

A: I guess I'm just an old fogey (in the die-hard vim camp), but the other editing packages I use, such as MS Word or Open Office, preserve the distinction between the copy of the file that I'm editing and the last saved version.  That is utterly invaluable -- I don't want the editor to trample over my last good version until I'm ready for it to do so.  Indeed, there's a decent chance (say one in a thousand) that I'll create a new file with the buffer I'm editing on.
On the other hand, the ability to create a file image by reading multiple files (either several copies of the same file, or copies of several different files) is also useful.  There are faintly similar facilities in other documents.
So, I could be missing the point - I don't know which editors you are referring to as removing the distinction.  But I think that all editors preserve the distinction between the copy of the file that you're editing and the last version saved to disk.

A: Because developers of those editors didn't care to hide implementation details from users.


text:
Q: Features extraction in Real-time prediction in sagemaker i want to deploy a real time prediction machine learning model for fraud detection using sagemaker.
i used sagemaker jupyter instance to:
-load my training data from s3 contains transactions
-preprocessing data and features engineering (i use category_encoders to encode the categorical value)
-training the model and configure the endpoint

For the inference step , i used a lambda function which  invoke my endpoint to get the prediction for each real time transaction.
should i calculte again all the features for this real time transactions in lambda function ?

for the features when i use category_encoders with fit_transform() function to transform my categorical feature to numerical one, what should I do because the result will not be the same as training set?

is there another method not to redo the calculation of the features in the inference step?

A:
should i calculate again all the features for this real time transaction in lambda function?

Yes, when inference a trained model (or predict on real-time data), you should pass exactly the same features list that you use for the training model. If you calculate some features while training (e.g. part of the day from timestamp) you should also calculate these features while inferencing.

for the features when i use category_encoders with fit_transform() function to transform my categorical feature to numerical one, what should I do because the result will not be the same as training set?

You should store all transformations that you use for training model: numeric scalers, categorical encoders, etc.
For python it looks like this:
import joblib # for dump fitted transformers
import category_encoders as ce

# 1. while training model
# fit encoder on historical data
encoder = ce.OneHotEncoder(cols=[...])
encoder.fit(X, y)
# and dump it
joblib.dump(encoder, 'filename.joblib')

# 2. while inference a trained model
# load fitted encoder
encoder = joblib.load('filename.joblib')
# and apply transformation to new data
encoder.transform(X_new)


text:
Q: xpath-router doesn't route message with xpath-expression I use Spring Integration XML router with xpath-expression
<int:chain input-channel="routerInputChannel">
    <int-xml:xpath-router default-output-channel="routerOutputChannel">
        <int-xml:xpath-expression expression="//actor[1]/text()"/>
        <int-xml:mapping value="Christian Bale" channel="routerBaleChannel"/>
    </int-xml:xpath-router>
</int:chain>

and expect that this XML string as a SI message payload
<root xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
    <actors>
        <actor id="1">Christian Bale</actor>
        <actor id="2">Liam Neeson</actor>
        <actor id="3">Michael Caine</actor>
    </actors>
    <foo:singers>
        <foo:singer id="4">Tom Waits</foo:singer>
        <foo:singer id="5">B.B. King</foo:singer>
        <foo:singer id="6">Ray Charles</foo:singer>
    </foo:singers>
</root>

will be send to routerBaleChannel but it doesn't work for some reason.
I tried the message and XPath expression at XPath Tester / Evaluator and as expected I've got Christian Bale string.
I debugged org.springframework.integration.xml.router.XPathRouter method getChannelKeys and see some problem inside Jaxp13XPathExpressionFactory method evaluate: for unknown reason after execution
NodeList nodes = (NodeList) evaluate(node, XPathConstants.NODESET);
nodes.getLength() returns empty list.
So what is wrong with my XPath router or XPath expression configuration?

A: Works for me:
<int:chain input-channel="inputChannel">
    <int-xml:xpath-router>
        <int-xml:xpath-expression expression="//actor[1]/text()"/>
        <int-xml:mapping value="Christian Bale" channel="routerBaleChannel"/>
    </int-xml:xpath-router>
</int:chain>

<int:channel id="routerBaleChannel">
    <int:queue/>
</int:channel>

...
@Test
public void testSO45173221() {
    ClassPathXmlApplicationContext ac =
            new ClassPathXmlApplicationContext("XPathRouterTests-context.xml", this.getClass());
    MessageChannel inputChannel = ac.getBean("inputChannel", MessageChannel.class);
    PollableChannel channelBale = ac.getBean("routerBaleChannel", PollableChannel.class);
    GenericMessage<String> message =
            new GenericMessage<>("<root xmlns:foo=\"http://www.foo.org/\" xmlns:bar=\"http://www.bar.org\">\n" +
            "    <actors>\n" +
            "        <actor id=\"1\">Christian Bale</actor>\n" +
            "        <actor id=\"2\">Liam Neeson</actor>\n" +
            "        <actor id=\"3\">Michael Caine</actor>\n" +
            "    </actors>\n" +
            "    <foo:singers>\n" +
            "        <foo:singer id=\"4\">Tom Waits</foo:singer>\n" +
            "        <foo:singer id=\"5\">B.B. King</foo:singer>\n" +
            "        <foo:singer id=\"6\">Ray Charles</foo:singer>\n" +
            "    </foo:singers>\n" +
            "</root>");
    inputChannel.send(message);
    Message<?> result = channelBale.receive(0);
    assertNotNull(result);
    assertEquals(message.getPayload(), result.getPayload());
    ac.close();
}

Not sure what's going on in your case...
Although I'm on Java 8 FYI.


text:
Q: Get a process response I am looking for a way to get a response in a form of a javascript alert after a form has been submitted using a php script. I guess ajax should do this but Im not an Ajax guy yet. A simple sample code would help a lot. Thanks for reading

A: In your PHP code after successfully saving/processing data, write/echo the following inside <body> tag. This will show an alert when rendered on client's browser.

<script language="javascript" type="text/javascript" >
  alert('This is what an alert message looks like.');
  </script>

A: If you want to venture into ajax and jquery - grab a copy of the jquery core and then do something like the following:
(Now with a full example. You will also need jquery.form.js plug in)
<html>
<body>
<script type="text/Javascript" src="jquery-1.2.4.min.js"></script>
<script type="text/Javascript" src="jquery.form.js"></script>
<script type="text/Javascript">
$(document).ready(function(){
    $("#SUBMIT_BUTTON").click(function()
    {
        var options = {
        url:        'processForm.php',
        success:    function(){
            alert('success');
        },
        error:    function() {
            alert('failure');
        }};

        $('#MYFORM').ajaxSubmit(options);
        return false;
    }
)});
</script>

<form id="MYFORM" method="post">
    <input type="text" name="testing">
    <input type="button" value="click me" id="SUBMIT_BUTTON">
</form>
</body>
</html>


text:
Q: RestTemplate getForEntity map to list of objects I have a response from URL which looks like:
{"seq":1,"id":"Test1","changes":[{"rev":"1-52f5cdf008ecfbadf621c2939af7bd80"}]}
{"seq":2,"id":"Test2","changes":[{"rev":"1-8ce403a89dc5e7cb4187a16941b3fb7d"}]}
{"seq":3,"id":"Test3","changes":[{"rev":"1-52as7ddfd8ecfbadf621c2939af7bd80"}]}
{"seq":4,"id":"Test4","changes":[{"rev":"1-6yy03a89dc5e7cb45677a16941b3fb7d"}]}

If the mapped object is String, then getting all the changes feed.
ResponseEntity<String> responseEntity = restTemplate.exchange(URL, HttpMethod.GET, requestEntity, String.class);

Whereas, if I happen to use a custom Value object, somethings like:
public class KnChanges {
private long seq;
private String id;
private List changes;

with getter and setter methods, then I'm getting only the first doc change details. Even if the KnChanges[] (array) is used, only the first change is obtained.
Can you please help as to how the JSON list structure mentioned above can be mapped to an object?
Thanks
Harsha

A: Some people asked for a better answer with some explaination. So here it is:
As sujim mentioned: You need to
ParameterizedTypeReference<List<KnChanges>> responseType = new ParameterizedTypeReference<List<KnChanges>>() {};
ResponseEntity<List<KnChanges>> resp = restTemplate.exchange(URL, HttpMethod.GET, requestEntity, responseType);
List<KnChanges> list = resp.getBody();

Explaination:
The last parameter of the exchange method call defines the class that gets instantiated when the response is received. The response data will then be mapped to the resulting object. So you need a List.class in fist place. Because you expect a JSON array. Now you need to define the type of the content of that List. Here Java's type erasure throws some stones in your way. As Java removes generic type information at compile-time, you can't just define the expected List to be a List<KnChanges>.class. "Luckily" there is a hack ;) And that hack is new ParameterizedTypeReference<List<KnChanges>>() {}. Provided that object the application is able to read the generic type information at runtime. And therefore is able to map the received data to your Java objects.
As a side-note: There a several implementations of that hack. It's commonly used for dependency injection or mapper systems, where type erasure can sometimes be an issue. Also Googles Guava offers an implementation. See the code for more information. There you can also learn how it's done, if you like.

A: ParameterizedTypeReference<List<KnChanges>> responseType = new ParameterizedTypeReference<List<KnChanges>>() {};
ResponseEntity<List<KnChanges>> resp = restTemplate.exchange(URL, HttpMethod.GET, requestEntity, responseType);
List<KnChanges> list = resp.getBody();


text:
Q: Are there known issues with the Microsoft.VisualBasic.Compatibility.VB6 namespace in 64 bit processes? Using classes from the Microsoft.VisualBasic.Compatibility.VB6 namespace in a .NET Framework 4+ project yields the following warning:

Warning BC40000:
<Class name> is obsolete: 'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862

The project uses the classes LabelArray, TextBoxArray and PictureBoxArray as well as the methods Format, SetItemData and GetItemData from the Support module.
I'm aware that these classes are remnants of the VB6->VB.NET conversion wizard available in ancient Visual Studio versions and should not be used for new development. I am also aware that "not supported" means that I'm on my own if anything breaks.
That having been said, I am trying to assess the risk of switching an old legacy library that still uses those classes from x86 to AnyCPU, so that it can be used in a 64 bit host application. According to some preliminary tests, everything just "seems to work".
Apart from not being officially supported, are there any concrete known issues with using classes from the Microsoft.VisualBasic.Compatibility.VB6 namespace in a 64 bit process?


text:
Q: CodeIgniter Uploadify doesn't upload files I don't get any error, nothing, but image isn't being uploaded, like controller isn't called at all, when I add in contruct function log_message I do not see anything in log file, not sure what is the problem. By the way I'm using this library(http://jeromejaglale.com/doc/php/codeigniter_i18n) to manage languages, so I have in url http://getit.mysite/en
Here is my controller function
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class FileUpload extends CI_Controller {

    public $view_data = array();
    private $upload_config;

    function __construct() {
        parent::__construct();
    }

    public function do_upload() {
        $this->load->library('upload');

        $image_upload_folder = base_url() . 'uploads/';

        if (!file_exists($image_upload_folder)) {
            mkdir($image_upload_folder, DIR_WRITE_MODE, true);
        }

        $this->upload_config = array(
            'upload_path' => $image_upload_folder,
            'allowed_types' => 'png|jpg|jpeg|bmp|tiff',
            'max_size' => 2048,
            'remove_space' => TRUE,
            'encrypt_name' => TRUE,
        );

        $this->upload->initialize($this->upload_config);

        if (!$this->upload->do_upload()) {
            $upload_error = $this->upload->display_errors();
            echo json_encode($upload_error);
        } else {
            $file_info = $this->upload->data();
            echo json_encode($file_info);
        }
    }

}

?>

and js
jQuery(document).ready(function($) {

    var base_url = 'http://getit.mycom/';

    $('#upload-file').click(function(e) {
        e.preventDefault();
        $('#userfile').uploadify('upload', '*');
    });

    $('#userfile').uploadify({
        'auto': false,
        'swf': base_url + 'js/uploadify/uploadify.swf',
        'cancelImg': base_url + 'js/uploadify/uploadify-cancel.png',
        'uploader': base_url + 'fileupload/do_upload',
        'fileTypeExts': '*.jpg;*.bmp;*.png;*.tif',
        'fileTypeDesc': 'Image Files (.jpg,.bmp,.png,.tif)',
        'fileSizeLimit': '8MB',
        'fileObjName': 'userfile',
        'buttonText': 'Select Photo(s)',
        'multi': true,
        'removeCompleted': false
    });
});

and view file(add user) :
 <?php echo form_open_multipart(); ?>

                                            <?php echo form_upload('userfile', '', 'id="userfile"'); ?>
                                            <?php echo (isset($error)) ? $error : ''; ?>

                                            <?php echo form_button(array('content' => 'Upload', 'id' => 'upload-file', 'class' => 'btn btn-large btn-primary')); ?>

                                    <?php echo form_close(); ?>

A: At the controller code, change if (!$this->upload->do_upload()) to if (!$this->upload->do_upload('Filedata')). Just try.


text:
Q: React application hosted on GCP using Docker only opens when i type the URL folowed by "//" double slash So basically i have deployed a react application on docker using express to serve my build folders. But the after i deployed the application only opens when i follow the url with "//".
I have set the homepage property of package.json to "."
The main js chunk will not load if i just type the application URL . It will load only if the application url is followed by double slash for example https://example.com//
Can any one please make me understand why might this behavior occur? Following is the code for the server.js
const path = require("path");
const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;

app.use(express.static(path.join(__dirname, "..", "build")));
app.use(express.static("public"));
app.use((req, res, next) => {
  res.sendFile(path.join(__dirname, "..", "build", "index.html"));
});

app.listen(PORT, () => {
  console.log(`Server started on PORT ${PORT}`);
});

Dockerfile
FROM node:16 AS ui-build
WORKDIR /usr/src/app/
COPY . .
RUN npm install && npm run build
EXPOSE 3000

ENV PORT 3000
ENTRYPOINT ["node", "server/server.js"]

package.json
  {
      "name": "app",
      "version": "0.1.0",
      "homepage": ".",
      "private": true,
      "dependencies": {...
    }


text:
Q: Ubuntu VM Guest - Samba Service Not Accessible from VM Host via Hostname I have a Windows 7 Laptop Workstation with a Ubuntu 10.10 VM running in Virtual Box 3.2.12 r68302. I recently updated Samba and winbind, and since the update, I am unable to access the machine via it's hostname (\mystique) from the VM Host. I can access it by the "Host-only" IP (\192.168.56.101) and the DHCP Assigned IP address (\10.1.1.20) and I can connect to the webserver on the machine via it's hostname (http://mystique/).
As stated, accessing this machine via it's hostname worked fine prior to the update, but has since stopped working. I have added the hostname to the smb.conf for the netbios name, to no avail.
My smb.conf [global] section looks like this:
   workgroup = NETWORK
   netbios name = Mystique
   server string = %h server (Samba, Ubuntu)
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d

   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes

EDIT: I have also tried creating an entry in c:\windows\system32\drivers\etc\hosts for 192.168.56.101 mystique but that doesn't work either
EDIT 2: When I boot the machine at home, with no other changes, I am able to access the VM Guest by hostname without any issues. This leads me to believe the problem has something to do with the DHCP system at the office ...

A: Turns out it was the DNS settings of the VM Host OS that needed to be changed. Once I set them to the Domain Server in the office, everything works. Not sure how this will impact DNS at home yet, but it solves my initial issue.


text:
Q: Java JPA: Best practice for rollout of desktop app with DB? I just wanna ask for best practices about rollout of java desktop apps including an embedded DB (like JavaDB).
1. Question:
I create version 1.0 of my app with an embedded JavaDB for rollout. Should I deliver the DB files within my rollout package or should the app create the embedded DB files by first start?
2. Question:
Now it's time for release 1.1 and the DB structure changed. How to deliver the update? Is there any best practive for release strategies?
Thanks,
Daniel

A: *

*Do whatever is easier for you. Personaly I think beeing able to create a new DB on the fly is more conventient for developers.

*You need an update script. If this happens more than once, put the version number 1.0, 1.1, ... into the db. This way you can check what update scripts have to run automatically and you can make sure your software and db do match.


text:
Q: optimizing Query with datediff() in mysql I have a Query like below
select
id,name,baseid,member_card_type,membercard_num,last_draw,counter
from details_dest
where datediff(curdate(),basedate)<100;

i have used the explain on that and found it is using index which is on basedate and i think date_diff is the problem
so please suggest me is there any other way to execute it without any functions
and kindly tell me which is better datediff() or to_days() in according to performance
i am using mysql 5.5

A: I would suggest the following query:
select
id,name,baseid,member_card_type,membercard_num,last_draw,counter
from details_dest
where basedate > (curdate() - INTERVAL 100 DAY);


text:
Q: Display Custom Meta data in DIVI I know this requires customization but cant figure out where to edit .
I have created one Custom field using ACF (Advanced Custom Fields). I want it to show up in my blog meta data (not on the page). DIVI has author,date,comment,rating,category.
ACF has a function where i can call the value $value = get_field( "text_field" );.I know it can be added in the child theme function.php but need help with the coding.
below link shows how to add "last updated" to my meta data . i need to replace it with the custom field
add "last updated" to meta
meta image
Edit :
I managed to achieve it by editing my child theme, i used the meta_key to display the value from my custom category. i added the code to the array which displayed the meta data. (module-posts-content.php)
'meta_key'       => $value = the_field('custom_date_or_text'),
One final problem is my custom field appears above the meta fields rather than in line with it .
(code from my theme)
<?php
                    $meta_args = array(
                        'author_link'    => $show_author,
                        'author_link_by' => et_get_safe_localization( __( 'Posted by %s', 'extra' ) ),
                        'post_date'      => $show_date,
                        'date_format'    => $date_format,
                        'categories'     => $show_categories,
                        'comment_count'  => $show_comments,
                        'rating_stars'   => $show_rating,
                        'meta_key'       => $value = the_field('custom_date_or_text'),
                    );
                    ?>

final result

A: Try fetching the post_meta along with the ID on that post/page template:
<?php $text_field = get_post_meta( get_the_ID(), 'text_field', true); ?>

<?php echo esc_html( $text_field );?>


text:
Q: Decode a gamma encoded image I am working on a project, where the user can specify a gamma function on a image, for example:
y=(pow(10,(1023*x-681)/444)-.0408)/(1-.0408))

The image is then encoded with this gamma curve, and then my code must be able to return this image back to its original (linear) version:
(y=x)

My question is how I can decode a gamma corrected image back to a linear version if i know the encoding function?

A: Use inverse function
x = (444 * (log ((1-.0408) * y + .0408) / log 10) + 681) / 1023


text:
Q: Disabling anti-aliasing/dithering/other image enhancements on background drawables / 9-patch pngs I am having trouble removing anti-aliasing on a 9-patch png and a normal drawable that is tiled to make a background. I am using the 9-patch as a background for my EditText controls and the tiled drawable is used as a background for an ImageView to create the 'divider'.
Here is some enlarged versions of my 9 patch png (it's hard to show white graphics so I filled in the transparent areas in blue):

And my tiled background image along with the xml that defines the tiled pattern:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/border_diagonal_lines"
    android:tileMode="repeat"
    />

Here is the whole thing put together:

The screenshot on the left is what I currently get and the screenshot on the right is what I want it to look like. What could I do to achieve the desired effect?
I also would like the imageview with the tiled background to always be 3 pixels tall regardless of screen resolution but using 'pixels' as units is generally a bad idea. Is there a way round this?

A: It isn't anti-aliasing your graphics, it's probably scaling them (which, granted, may also perform anti-aliasing, but it's not the cause). Are you placing them in the correct density-specific folder? (e.g. drawable-hdpi, drawable-xhdpi, etc.) If you are doing that, also make sure you are not using the android:anyDensity="true" tag in your manifest.

I also would like the imageview with the tiled background to always be
  3 pixels tall regardless of screen resolution but using 'pixels' as
  units is generally a bad idea. Is there a way round this?

It's discouraged in general cases, when the system should be handling scaling for multiple densities (using DP instead), but if you specifically need something 3 pixels tall, then there's nothing "bad" about specifying a pixel height.


text:
Q: Rails/Rspec/Factory girl: records not associating? Here are my factories:
FactoryGirl.define do
  factory :account do
    company 'Example, Inc.'
  end

  factory :site do
    association :account
  end

  factory :page do
    association :site
  end
end

And a simple request spec:
require 'spec_helper'

describe "Pages" do

  before do
    @account = Factory(:account)
    @site = Factory(:site)
  end

  it "lets me create a new page" do
    visit account_site_pages_path(@account, @site)
    page.should have_content('New Page')
  end

end

But I get this failure:
Failure/Error: visit account_site_pages_path(@account, @site)
ActiveRecord::RecordNotFound:
 Couldn't find Site with ID=51 [WHERE (`sites`.account_id = 127)]
# <internal:prelude>:10:in `synchronize'
# ./spec/requests/pages_spec.rb:19:in `block (2 levels) in <top (required)>'

Meaning the site factory is not associated with the proper account, right?  I'm guessing I'm missing something pretty obvious :D

A: Your @account and @site aren't connected, which is likely the problem. So do:
before do
  @account = Factory(:account)
  @site = Factory(:site, :account => @account)
end

That way, your site isn't creating a new account and is instead related to the original account.