text:
Q: OpenGL Transform Feedback with dynamic Geometry I am currently trying out Transform Feedback with a Geometry Shader. The Geometry Shader takes a Triangle, makes a Prism out of it and also puts a tetraeder on top of it (Think of it like an Obelisk but only with 3 instead of 4 sides).
I get the right result using Transform Feedback once. However i wanted to create additional Geometry with Transform Feedback. I wanted to do the Geometry Shader Process for each of the Triangles of the Tetraeder.
Result after first Pass

Result after second Pass

So instead of the black part going to infinity in the second pass, there should have been another of these branches that you can see left and right, but that one towards the camera.
What am i doing wrong here? I am not sure how to handle the always increasing size of data for the two Vertex Buffer Objects and i am probably doing something wrong there. Help would be appreciated.
Transform Feedback before the Main window Loop:
glUseProgram(transformShaderProgram);

glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, TBO);
glBindVertexArray(transformVAO);
glEnable(GL_RASTERIZER_DISCARD);

glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, tfQuery);
glBeginTransformFeedback(GL_TRIANGLES);
glDrawArrays(GL_TRIANGLES, 0, 3);
glEndTransformFeedback();
glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
glDisable(GL_RASTERIZER_DISCARD);

GLuint numPrimitivesWritten = 0;
glGetQueryObjectuiv(tfQuery, GL_QUERY_RESULT, &numPrimitivesWritten);
printf("Number of PrimitivesWritten %i\n", numPrimitivesWritten);

Transform Feedback during the main window Loop:
glUseProgram(feedbackShaderProgram);
while (!glfwWindowShouldClose(window))
{
    glfwPollEvents();
    CalcDeltaTime();
    doMovement();

    glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    if (doTransformFeedback && (currentNumberOfTransformFeedback < maxNumberOfTransformFeedback)) {
        glUseProgram(transformShaderProgram);

        glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, TBO);
        glBindVertexArray(feedbackVAO);
        glEnable(GL_RASTERIZER_DISCARD);

        glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, tfQuery);
        glBeginTransformFeedback(GL_TRIANGLES);
        glDrawArrays(GL_TRIANGLES, 0, numPrimitivesWritten * 5);
        glEndTransformFeedback();
        glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
        glDisable(GL_RASTERIZER_DISCARD);

        GLuint numPrimitivesWritten2 = 0;
        glGetQueryObjectuiv(tfQuery, GL_QUERY_RESULT, &numPrimitivesWritten2);
        numPrimitivesWritten += numPrimitivesWritten2;

        doTransformFeedback = false;
        currentNumberOfTransformFeedback++;
        glUseProgram(feedbackShaderProgram);
    }
    glBindVertexArray(feedbackVAO);
    glDrawArrays(GL_TRIANGLES, 0, numPrimitivesWritten * 5 );
    glBindVertexArray(0);

    glfwSwapBuffers(window);
}

A: It's OK to perform a transform feedback operation into the same buffer that you're reading vertex data from. It's not OK to perform a transform feedback operation on top of the vertex data you're reading from.
And that's essentially what you're doing in the second operation.
What you need to do is use glBindBufferBase to offset the feedback buffer in the second TF operation, so that it's writing to fresh vertex data.
The other thing you're doing wrong is that you're passing the wrong triangles to your feedback operation. From your description of what you want, you only want to execute the process on the topmost triangles of the obelisk. But you pass the whole thing in your TF rendering code. You need to isolate the specific triangles you want to expand and only render them.
Transform feedback will write triangles in the order that you output them. So you need to isolate those specific triangles and only perform feedback operations on them.


text:
Q: configure analogic pin as digital pin I have the SAMA5D3 Xplained.
This kit has several analog ports and my idea is to be configured as analog or digital as needed.
Would it be possible to do it in an easy way from the kernel?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Htaccess apache permalink 404 (they dont work anymore) we switched a website from nginx to normal apache webserver but now we have a big problem with the permalinks: all dropping 404. (before everything worked great)
I tried to configure the htaccess file correct but i am stuck on it.
Link structure where I can still access the site:
http://abc.de/subdomain/foobar/index.php?page=PageOne
Link structure how it should be:
http://abc.de/subdomain/foobar/PageOne
My current htaccess file:
DocumentRoot "/home/johnedoe/public_html/subdomain/"

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /foobar/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt|svg)$ [NC]
RewriteRule ^(.*)/$ index\.php\?page=$1 [NC,R=301,L]
</IfModule>

Of course I also activated error log for .htaccess:

[root@host apache]# cat error_log
18:21:53.998 [INFO] [APVH_abc.de_Suphp56:] PID: 182662, add child process pid: 188198, procinfo: 0x2e29eb0
18:21:55.304 [INFO] [123.123.123:123:9122] File not found [abc.de/subdomain/foobar/PageOnebower_components/font-awesome/fonts/fontawesome-webfont.woff2]
18:21:55.304 [INFO] [123.123.123:123:9122] File not found [abc.de/subdomain/foobar/PageOne404.shtml]
18:21:55.312 [INFO] [123.123.123:123:9089] File not found [abc.de/subdomain/foobar/PageOneassets/fonts/SairaSemiCondensed-Regular.eot]
18:21:55.312 [INFO] [123.123.123:123:9089] File not found [abc.de/subdomain/foobar/PageOne404.shtml]
18:21:55.317 [INFO] [123.123.123:123:9104] File not found [abc.de/subdomain/foobar/PageOne404.shtml]
....
18:21:55.557 [INFO] [123.123.123:123:9106] [REWRITE] strip base: '/johndoe/' from URI: '/johndoe/website/assets/fonts/fontawesome-webfont.woff'
18:21:55.557 [INFO] [123.123.123:123:9106] [REWRITE] Rule: Match 'website/assets/fonts/fontawesome-webfont.woff' with pattern '^(.*)/$', result: -1
18:21:55.581 [INFO] [123.123.123:123:9104-3#APVHjohndoe.abc.de] File not found [abc.de/subdomain/foobar/PageOneassets/fonts/SairaSemiCondensed-Regular.ttf]
18:21:55.581 [INFO] [123.123.123:123:9104-3#APVHjohndoe.abc.de] File not found [abc.de/subdomain/foobar/PageOne404.shtml]
18:21:55.594 [INFO] [123.123.123:123:9106-1#APVH_abc.de] [REWRITE] strip base: '/johndoe/' from URI: '/johndoe/website/assets/fonts/fontawesome-webfont.woff'
18:21:55.594 [INFO] [123.123.123:123:9106-1#APVH_abc.de] [REWRITE] Rule: Match 'website/assets/fonts/fontawesome-webfont.woff' with pattern '^(.*)/$', result: -1
18:21:55.892 [INFO] [123.123.123:123:9076] [REWRITE] strip base: '/johndoe/' from URI: '/johndoe/website/assets/images/favicon/favicon-32x32.png'
18:21:55.893 [INFO] [123.123.123:123:9076] [REWRITE] Rule: Match 'website/assets/images/favicon/favicon-32x32.png' with pattern '^(.*)/$', result: -1
18:21:55.926 [INFO] [123.123.123:123:9076-1#APVH_abc.de] [REWRITE] strip base: '/johndoe/' from URI: '/johndoe/website/assets/images/favicon/favicon-16x16.png'
18:21:55.926 [INFO] [123.123.123:123:9076-1#APVH_abc.de] [REWRITE] Rule: Match 'website/assets/images/favicon/favicon-16x16.png' with pattern '^(.*)/$', result: -1
...
18:22:22.913 [INFO] [123.123.123:123:9095] File not found [/home/abc.de/public_html/website/index.php]
18:22:22.913 [INFO] [123.123.123:123:9095] File not found [/home/abc.de/public_html/404.shtml]

Last but not least the old rewrite rule I found in nginx:
location / {
        try_files $uri $uri/ /index.php?$uri&$args;
    }

Does anyone have an idea? Would be very important - thanks!!


text:
Q: Add custom command with custom counter to table of contents I defined a new command so that I can get the enumeration of the subsections with the format that I want. Now my problem is that I don´t know how to make these numbers and its respective title appear on the table of contents (\tableofcontents).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{report}
\usepackage{ulem}

\begin{document}
\tableofcontents
\newcounter{UntUntKap}[section]
\newcommand{\nummeriere}[1]{\stepcounter{UntUntKap}\uline{\arabic{chapter}.\arabic{section}.\arabic{UntUntKap}} \ #1}
\section{erste}
\nummeriere{ das ist text } \\
\nummeriere \\
\nummeriere\\
\nummeriere

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I tried with \addcontentsline{toc}{subsection}{*} , but either i am using it wrong or this command doesn´t accept my "\nummeriere" in it. My optimal scenario would be that the "add to toc" were included in my custom command, but if i have to write it every time i can also create a simpler command I guess...
Thanks a lot for the help!

A: If you wish to change the formatting of sections both in the main text and in the table of contents, the packages titlesec and titletoc might be of interest to you.

In case you wish to do "by hand", without these packages:
The usual hierarchy of sectioning-counters below chapter is:
section → subsection → subsubsection → paragraph → subparagraph.
The corresponding sectionig-commands are:
\section → \subsection → \subsubsection → \paragraph → \subparagraph.
All these things denote sections.
"subsection", "subsubsection", "paragraph"  etc is just LaTeX-jargon for denoting different levels of sectioning.
Your counter UntUntKap denotes the same level of sectioning as the subsection-counter.
So instead of defining a \nummeriere-command which is connected to a numbering-infrastructure which is parallel to the numbering-infrastructure connected to the \subsection-command I would probably define my own customized variant of the \subsection-command which uses the same numbering-infrastructure as the \subsection-command.
Be that as it may.
You can implement a numbering-infrastructure parallel to the numbering-infrastructure connected to the \subsection-command as follows:
\documentclass{report}
%\usepackage{hyperref}
\usepackage{ulem}

\setcounter{secnumdepth}{2} % 1 -> sections are the last sectioning-level that gets numbered.
                            % 2 -> subsections are the last sectioning-level that gets numbered.
                            % 3 -> subsubsections are the last sectioning-level that gets numbered.
                            % etc

\setcounter{tocdepth}{2} % 1 -> sections go to toc
                         % 2 -> sections and subsections go to toc
                         % 3 -> sections, subsections and subsubsections go to toc
                         % etc

\newcounter{UntUntKap}[section]
\renewcommand\theUntUntKap{\thesection.\arabic{UntUntKap}}%

\makeatletter
\AtBeginDocument{\let\l@UntUntKap=\l@subsection}%
\newcommand\CheckWhetherArgumentIsEmpty[1]{%
  \romannumeral0%
  \ifcat A\detokenize{#1}A%
    \@firstoftwo{\expandafter\expandafter\expandafter}{} %
    \expandafter\@firstoftwo
  \else
    \@firstoftwo{\expandafter\expandafter\expandafter}{} %
    \expandafter\@secondoftwo
  \fi
}%
\newcommand\nummeriere{%
  \@ifstar\nummeriere@star\nummeriere@nostar
}%
\newcommand{\nummeriere@star}[1][]{%
  #1\@bsphack\@esphack
}%
\newcommand{\nummeriere@nostar}[1][]{%
  \ifnum 2>\c@secnumdepth\else
    \refstepcounter{UntUntKap}%
    \underline{\theUntUntKap}%
    \addcontentsline{toc}{UntUntKap}{%
      \ifnum2>\c@secnumdepth\else
        \protect\numberline{\theUntUntKap}%
      \fi
      \CheckWhetherArgumentIsEmpty{#1}{\protect\kern-.6em}{#1}%
    }%
    \space
  \fi
  #1%
  \@bsphack\@esphack
}%
\makeatother

\begin{document}
\tableofcontents
\chapter{A chapter}
\enlargethispage{2\baselineskip}%
\section{A section whose hierarchy-level is named ``section'' in \LaTeX-jargon.}
\subsection{A section whose hierarchy-level is named ``subsection'' in \LaTeX-jargon.}
\nummeriere[This is text belonging to a numbering-structure, not really a sectioning-structure,
            which is parallel to the numbering of subsections that goes to the toc as well.]
            This is text belonging to a numbering-structure, not really a sectioning-structure,
            which is parallel to the numbering of subsections that does not go to the toc.\\
\nummeriere This is text belonging to a numbering-structure, not really a sectioning-structure,
            which is parallel to the numbering of subsections that does not go to the toc.

\nummeriere This is text belonging to a numbering-structure, not really a sectioning-structure,
            which is parallel to the numbering of subsections that does not go to the toc. %%%
\nummeriere This is text belonging to a numbering-structure, not really a sectioning-structure,
            which is parallel to the numbering of subsections that does not go to the toc.\

\bigskip

Having two parallel numbering-structures, namely the numbering-structure that belongs to sections
whose hierarchy-level is named ``subsection'' in \LaTeX-jargon and the numbering-structure that
underlies the \verb|\nummeriere|-command is confusing.

Unless you never use them parallel throughout the whole document.

I.e.:

\begingroup\sloppy
When you have two consecutive \verb|\section|s with  \verb|\subsection|s/\allowbreak\verb|\subsubsection|s/\allowbreak etc
in between, then there should not also be \verb|\nummeriere| in between.

When you have two consecutive \verb|\section|s with  \verb|\nummeriere| in between, then
there should not also be  \verb|\subsection|s/\allowbreak\verb|\subsubsection|s/\allowbreak etc in between.

\endgroup

\end{document}


text:
Q: minicom cmd not showing I am using minicom in centos to try to connect to a cisco router. I did the configuration with  minicom -s  changed the serial port to the appropriate one /dev/ttyS1. Saved as dfl. and Exit.
When minicom started i got the following.
Welcome to minicom 2.3
Options: 118n
Compiled on Nov 23 2010, 13:27:13
Port /dev/ttyS1

        press CTRL-A z for help on special keys

I don't see the  cmd:  line though. Do i need to set up anything else?

A: It sounds like you may need to initialize the modem. Hit CTRL+A z to get to the Help menu then "M".


text:
Q: Best Way to add footer view in Xamarin forms list view? I noticed that Xamarin forms ListView doesn't have a method similar to addFooterView in Android.
I want to add a submit button at the bottom the list.
Whats the best way to achieve this?

A: You could write your own custom renderer for Xamarin.Forms ListView, and add in the ability to expose the addFooterView in Android perhaps?
This would be the simplest way of extending the support for this on the Android platform specifically.
Update 1
To achieve something that is applicable across all platforms you could customize the cell appearance based on the data it represents.
In Xamarin.Forms you are able to write your own custom Cell implementations that can be used in a ListView or TableView.
Therefore to achieve the 'Load More' effect at the bottom of the ListView, you could add an extra Model item into your collection, with some flag indicating that it is this type of display to be shown, rather than the normal Cell representation of a real Model item.
Evaluating this flag, you would be able to determine whether you should show the 'Load More' custom view or not.
When you are going to add more data, naturally you would remove this item, prior to adding new items, and then also add this 'special case' Model item afterwards.

A: you can do it the way Pete described or in a non ListView related way. If i had to implement a fixed footer i would put a ListView and a StackLayout into a grid with two rows. The ListView's row has a *asterisk height and the StackLayout an Auto sized height.
 <Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <ListView Grid.Row="0">
    <ListView.ItemTemplate>
        <DataTemplate>
            <TextCell/>
        </DataTemplate>
    </ListView.ItemTemplate>
    </ListView>
    <StackLayout Grid.Row="1">
        <Label Text="Your fixed footer"/>
    </StackLayout>
</Grid>

Update
If you need a customizable cell on the bottom of the ListView then you can simply use the Footer property of the ListView.
  <ListView ItemsSource="{Binding Items}" HasUnevenRows="true">
    <ListView.ItemTemplate>
        <DataTemplate>
            <TextCell Text="Some Titles"/>
        </DataTemplate>
    </ListView.ItemTemplate>
<ListView.Footer>
    <StackLayout>
        <Label Text="Footer of the ListView"/>
    </StackLayout>
</ListView.Footer>
</ListView>


text:
Q: Body is undefined I have the following code in javascript (firefox extension)
var body;

var Test = {
initializeBody: function(e) {
  if (!e.originalTarget.defaultView.frameElement) {
    body = e.target.ownerDocument.getElementsByTagName('body')[0].cloneNode(true);
  }
}
}

window.addEventListener("DOMContentLoaded", function(e) { Test.initializeBody(e); }, false);

when I want to use body variable in another function Error console writes that body is undefined . I understand that not all firefox pages have body tag defined, but it writes this message even if I load http://www.google.com
Do you know what is wrong?
thank you

A: you need to use document.body for accessing the body tag of a document

A: If body is undefined, I'd assume that nothing was assigned to it, probably because !e.originalTarget.defaultView.frameElement expression evaluates to false. What's that condition for?


text:
Q: How to extract specific data (using string and delimiter) from multiple text file to a excel sheet? I have thousands of  files like (e.g. EOG090W06LO_M0_mlc) like below and I want to extract specific data from those files like
                 lnL            kappa (ts/tv)    omega (dN/dS)     tree length for dN   tree length for dS
EOG090W06LO  -5160.995083        1.50195           0.05318               0.6637               12.4810
EOG090W05ZG   ......             .......           ......               .......              ........
EOG090W06CS   ......             .......           ......               .......              ........

Kindly guide me on how to do that it in bash or python.
Example file EOG090W06LO_M0_mlc
> Codon frequencies under model, for use in evolver (TTT TTC TTA TTG ...
> GGG):
>   0.01286657  0.01332375  0.01120763  0.01409444
>   0.00654743  0.00678008  0.00570324  0.00717226
>   0.01087585  0.01126231  0.00000000  0.00000000
>   0.00570731  0.00591011  0.00497145  0.00625197
>   0.01541211  0.01595975  0.01342496  0.01688291
>   0.00784278  0.00812146  0.00683158  0.00859123
>   0.01302755  0.01349046  0.01134786  0.01427079
>   0.00683646  0.00707938  0.00595501  0.00748887
>   0.02626538  0.02719867  0.02287888  0.02877192
>   0.01336570  0.01384063  0.01164241  0.01464121
>   0.02220161  0.02299050  0.01933907  0.02432034
>   0.01165072  0.01206470  0.01014854  0.01276256
>   0.03667897  0.03798228  0.03194980  0.04017930
>   0.01866488  0.01932810  0.01625834  0.02044610
>   0.03100401  0.03210568  0.02700654  0.03396277
>   0.01626995  0.01684807  0.01417220  0.01782261
>
>
> TREE #  1:  (15, 43, (((((1, (((((10, (12, 6)), ((((11, 3), 13), 5),
> 8)), (7, 9)), (14, 4)), 2)), 44), ((19, 24), ((21, 22), (47, 48)))),
> ((((((((16, 18), 17), 54), 20), (((((((26, 32), 51), (33, 53)), 29),
> ((27, 34), ((28, 31), 30))), 50), 35)), ((((36, (39, 40)), (38, 41)),
> 37), ((42, (45, 46)), 52))), 49), 25)), 23));   MP score: 1153
> lnL(ntime:  0  np:  2):  -5160.995083      +0.000000
>  1.501953 0.053177
>
> tree length = 11.795207
>
> (15: 0.475705, 43: 0.645809, (((((1: 0.206782, (((((10: 0.069332, (12:
> 0.046579, 6: 0.054610): 0.024700): 0.084846, ((((11: 0.011270, 3: 0.006663): 0.009598, 13: 0.006096): 0.062727, 5: 0.096529): 0.014611, 8: 0.101040): 0.032842): 0.041200, (7: 0.057180, 9: 0.084448):
> 0.062359): 0.047267, (14: 0.103211, 4: 0.090685): 0.077973): 0.064394, 2: 0.181198): 0.243921): 0.270070, 44: 0.295151): 0.134002, ((19:
> 0.391130, 24: 0.180895): 0.089913, ((21: 0.075882, 22: 0.052405): 0.142810, (47: 0.360326, 48: 0.151256): 0.061099): 0.073893): 0.186753): 0.035225, ((((((((16: 0.021929, 18: 0.021001): 0.022963, 17: 0.036132): 0.034858, 54: 0.055961): 0.084331, 20: 0.138317):
> 0.140076, (((((((26: 0.148166, 32: 0.104747): 0.033408, 51: 0.164604): 0.029923, (33: 0.190488, 53: 0.174541): 0.030186): 0.019935, 29: 0.222916): 0.020484, ((27: 0.050592, 34: 0.061516): 0.092558, ((28: 0.074252, 31: 0.108120): 0.020924, 30: 0.061404): 0.114540): 0.109270): 0.097724, 50: 0.202292): 0.206280, 35: 0.296817): 0.083934): 0.055128, ((((36: 0.026483, (39: 0.027394, 40: 0.011871): 0.003734): 0.010522, (38: 0.015286, 41: 0.013052): 0.022506): 0.062251, 37: 0.074776): 0.179134, ((42: 0.088283, (45: 0.133738, 46: 0.088861): 0.020813): 0.076282, 52: 0.230076): 0.048498): 0.051390): 0.167347, 49: 0.395711): 0.061789, 25: 0.377871): 0.036416): 0.064064, 23: 0.514741): 0.157612);
>
> (taxon15: 0.475705, taxon43: 0.645809, (((((taxon1: 0.206782,
> (((((taxon10: 0.069332, (taxon12: 0.046579, taxon6: 0.054610):
> 0.024700): 0.084846, ((((taxon11: 0.011270, taxon3: 0.006663): 0.009598, taxon13: 0.006096): 0.062727, taxon5: 0.096529): 0.014611, taxon8: 0.101040): 0.032842): 0.041200, (taxon7: 0.057180, taxon9:
> 0.084448): 0.062359): 0.047267, (taxon14: 0.103211, taxon4: 0.090685): 0.077973): 0.064394, taxon2: 0.181198): 0.243921): 0.270070, taxon44: 0.295151): 0.134002, ((taxon19: 0.391130, taxon24: 0.180895): 0.089913, ((taxon21: 0.075882, taxon22: 0.052405): 0.142810, (taxon47: 0.360326, taxon48: 0.151256): 0.061099): 0.073893): 0.186753): 0.035225, ((((((((taxon16: 0.021929, taxon18: 0.021001): 0.022963, taxon17: 0.036132): 0.034858, taxon54: 0.055961): 0.084331, taxon20:
> 0.138317): 0.140076, (((((((taxon26: 0.148166, taxon32: 0.104747): 0.033408, taxon51: 0.164604): 0.029923, (taxon33: 0.190488, taxon53: 0.174541): 0.030186): 0.019935, taxon29: 0.222916): 0.020484, ((taxon27: 0.050592, taxon34: 0.061516): 0.092558, ((taxon28:
> 0.074252, taxon31: 0.108120): 0.020924, taxon30: 0.061404): 0.114540): 0.109270): 0.097724, taxon50: 0.202292): 0.206280, taxon35: 0.296817): 0.083934): 0.055128, ((((taxon36: 0.026483, (taxon39: 0.027394, taxon40: 0.011871): 0.003734): 0.010522, (taxon38: 0.015286, taxon41:
> 0.013052): 0.022506): 0.062251, taxon37: 0.074776): 0.179134, ((taxon42: 0.088283, (taxon45: 0.133738, taxon46: 0.088861):
> 0.020813): 0.076282, taxon52: 0.230076): 0.048498): 0.051390): 0.167347, taxon49: 0.395711): 0.061789, taxon25: 0.377871): 0.036416): 0.064064, taxon23: 0.514741): 0.157612);
>
> Detailed output identifying parameters
>
> kappa (ts/tv) =  1.50195
>
> omega (dN/dS) =  0.05318
>
> dN & dS for each branch
>
>  branch          t       N       S   dN/dS      dN      dS  N*dN  S*dS
>
>   55..15     0.476   158.4    60.6  0.0532  0.0268  0.5034   4.2  30.5
>   55..43     0.646   158.4    60.6  0.0532  0.0363  0.6834   5.8  41.4
>   55..56     0.158   158.4    60.6  0.0532  0.0089  0.1668   1.4  10.1
>   56..57     0.064   158.4    60.6  0.0532  0.0036  0.0678   0.6   4.1
>   57..58     0.035   158.4    60.6  0.0532  0.0020  0.0373   0.3   2.3
>   58..59     0.134   158.4    60.6  0.0532  0.0075  0.1418   1.2   8.6
>   59..60     0.270   158.4    60.6  0.0532  0.0152  0.2858   2.4  17.3
>   60..1      0.207   158.4    60.6  0.0532  0.0116  0.2188   1.8  13.3
>   60..61     0.244   158.4    60.6  0.0532  0.0137  0.2581   2.2  15.6
>   61..62     0.064   158.4    60.6  0.0532  0.0036  0.0681   0.6   4.1
>   62..63     0.047   158.4    60.6  0.0532  0.0027  0.0500   0.4   3.0
>   63..64     0.041   158.4    60.6  0.0532  0.0023  0.0436   0.4   2.6
>   64..65     0.085   158.4    60.6  0.0532  0.0048  0.0898   0.8   5.4
>   65..10     0.069   158.4    60.6  0.0532  0.0039  0.0734   0.6   4.4
>   65..66     0.025   158.4    60.6  0.0532  0.0014  0.0261   0.2   1.6
>   66..12     0.047   158.4    60.6  0.0532  0.0026  0.0493   0.4   3.0
>   66..6      0.055   158.4    60.6  0.0532  0.0031  0.0578   0.5   3.5
>   64..67     0.033   158.4    60.6  0.0532  0.0018  0.0348   0.3   2.1
>   67..68     0.015   158.4    60.6  0.0532  0.0008  0.0155   0.1   0.9
>   68..69     0.063   158.4    60.6  0.0532  0.0035  0.0664   0.6   4.0
>   69..70     0.010   158.4    60.6  0.0532  0.0005  0.0102   0.1   0.6
>   70..11     0.011   158.4    60.6  0.0532  0.0006  0.0119   0.1   0.7
>   70..3      0.007   158.4    60.6  0.0532  0.0004  0.0071   0.1   0.4
>   69..13     0.006   158.4    60.6  0.0532  0.0003  0.0065   0.1   0.4
>   68..5      0.097   158.4    60.6  0.0532  0.0054  0.1021   0.9   6.2
>   67..8      0.101   158.4    60.6  0.0532  0.0057  0.1069   0.9   6.5
>   63..71     0.062   158.4    60.6  0.0532  0.0035  0.0660   0.6   4.0
>   71..7      0.057   158.4    60.6  0.0532  0.0032  0.0605   0.5   3.7
>   71..9      0.084   158.4    60.6  0.0532  0.0048  0.0894   0.8   5.4
>   62..72     0.078   158.4    60.6  0.0532  0.0044  0.0825   0.7   5.0
>   72..14     0.103   158.4    60.6  0.0532  0.0058  0.1092   0.9   6.6
>   72..4      0.091   158.4    60.6  0.0532  0.0051  0.0960   0.8   5.8
>   61..2      0.181   158.4    60.6  0.0532  0.0102  0.1917   1.6  11.6
>   59..44     0.295   158.4    60.6  0.0532  0.0166  0.3123   2.6  18.9
>   58..73     0.187   158.4    60.6  0.0532  0.0105  0.1976   1.7  12.0
>   73..74     0.090   158.4    60.6  0.0532  0.0051  0.0951   0.8   5.8
>   74..19     0.391   158.4    60.6  0.0532  0.0220  0.4139   3.5  25.1
>   74..24     0.181   158.4    60.6  0.0532  0.0102  0.1914   1.6  11.6
>   73..75     0.074   158.4    60.6  0.0532  0.0042  0.0782   0.7   4.7
>   75..76     0.143   158.4    60.6  0.0532  0.0080  0.1511   1.3   9.2
>   76..21     0.076   158.4    60.6  0.0532  0.0043  0.0803   0.7   4.9
>   76..22     0.052   158.4    60.6  0.0532  0.0029  0.0555   0.5   3.4
>   75..77     0.061   158.4    60.6  0.0532  0.0034  0.0647   0.5   3.9
>   77..47     0.360   158.4    60.6  0.0532  0.0203  0.3813   3.2  23.1
>   77..48     0.151   158.4    60.6  0.0532  0.0085  0.1601   1.3   9.7
>   57..78     0.036   158.4    60.6  0.0532  0.0020  0.0385   0.3   2.3
>   78..79     0.062   158.4    60.6  0.0532  0.0035  0.0654   0.6   4.0
>   79..80     0.167   158.4    60.6  0.0532  0.0094  0.1771   1.5  10.7
>   80..81     0.055   158.4    60.6  0.0532  0.0031  0.0583   0.5   3.5
>   81..82     0.140   158.4    60.6  0.0532  0.0079  0.1482   1.2   9.0
>   82..83     0.084   158.4    60.6  0.0532  0.0047  0.0892   0.8   5.4
>   83..84     0.035   158.4    60.6  0.0532  0.0020  0.0369   0.3   2.2
>   84..85     0.023   158.4    60.6  0.0532  0.0013  0.0243   0.2   1.5
>   85..16     0.022   158.4    60.6  0.0532  0.0012  0.0232   0.2   1.4
>   85..18     0.021   158.4    60.6  0.0532  0.0012  0.0222   0.2   1.3
>   84..17     0.036   158.4    60.6  0.0532  0.0020  0.0382   0.3   2.3
>   83..54     0.056   158.4    60.6  0.0532  0.0031  0.0592   0.5   3.6
>   82..20     0.138   158.4    60.6  0.0532  0.0078  0.1464   1.2   8.9
>   81..86     0.084   158.4    60.6  0.0532  0.0047  0.0888   0.7   5.4
>   86..87     0.206   158.4    60.6  0.0532  0.0116  0.2183   1.8  13.2
>   87..88     0.098   158.4    60.6  0.0532  0.0055  0.1034   0.9   6.3
>   88..89     0.020   158.4    60.6  0.0532  0.0012  0.0217   0.2   1.3
>   89..90     0.020   158.4    60.6  0.0532  0.0011  0.0211   0.2   1.3
>   90..91     0.030   158.4    60.6  0.0532  0.0017  0.0317   0.3   1.9
>   91..92     0.033   158.4    60.6  0.0532  0.0019  0.0354   0.3   2.1
>   92..26     0.148   158.4    60.6  0.0532  0.0083  0.1568   1.3   9.5
>   92..32     0.105   158.4    60.6  0.0532  0.0059  0.1108   0.9   6.7
>   91..51     0.165   158.4    60.6  0.0532  0.0093  0.1742   1.5  10.5
>   90..93     0.030   158.4    60.6  0.0532  0.0017  0.0319   0.3   1.9
>   93..33     0.190   158.4    60.6  0.0532  0.0107  0.2016   1.7  12.2
>   93..53     0.175   158.4    60.6  0.0532  0.0098  0.1847   1.6  11.2
>   89..29     0.223   158.4    60.6  0.0532  0.0125  0.2359   2.0  14.3
>   88..94     0.109   158.4    60.6  0.0532  0.0061  0.1156   1.0   7.0
>   94..95     0.093   158.4    60.6  0.0532  0.0052  0.0979   0.8   5.9
>   95..27     0.051   158.4    60.6  0.0532  0.0028  0.0535   0.5   3.2
>   95..34     0.062   158.4    60.6  0.0532  0.0035  0.0651   0.5   3.9
>   94..96     0.115   158.4    60.6  0.0532  0.0064  0.1212   1.0   7.3
>   96..97     0.021   158.4    60.6  0.0532  0.0012  0.0221   0.2   1.3
>   97..28     0.074   158.4    60.6  0.0532  0.0042  0.0786   0.7   4.8
>   97..31     0.108   158.4    60.6  0.0532  0.0061  0.1144   1.0   6.9
>   96..30     0.061   158.4    60.6  0.0532  0.0035  0.0650   0.5   3.9
>   87..50     0.202   158.4    60.6  0.0532  0.0114  0.2141   1.8  13.0
>   86..35     0.297   158.4    60.6  0.0532  0.0167  0.3141   2.6  19.0
>   80..98     0.051   158.4    60.6  0.0532  0.0029  0.0544   0.5   3.3
>   98..99     0.179   158.4    60.6  0.0532  0.0101  0.1895   1.6  11.5
>   99..100    0.062   158.4    60.6  0.0532  0.0035  0.0659   0.6   4.0
>  100..101    0.011   158.4    60.6  0.0532  0.0006  0.0111   0.1   0.7
>  101..36     0.026   158.4    60.6  0.0532  0.0015  0.0280   0.2   1.7
>  101..102    0.004   158.4    60.6  0.0532  0.0002  0.0040   0.0   0.2
>  102..39     0.027   158.4    60.6  0.0532  0.0015  0.0290   0.2   1.8
>  102..40     0.012   158.4    60.6  0.0532  0.0007  0.0126   0.1   0.8
>  100..103    0.023   158.4    60.6  0.0532  0.0013  0.0238   0.2   1.4
>  103..38     0.015   158.4    60.6  0.0532  0.0009  0.0162   0.1   1.0
>  103..41     0.013   158.4    60.6  0.0532  0.0007  0.0138   0.1   0.8
>   99..37     0.075   158.4    60.6  0.0532  0.0042  0.0791   0.7   4.8
>   98..104    0.048   158.4    60.6  0.0532  0.0027  0.0513   0.4   3.1
>  104..105    0.076   158.4    60.6  0.0532  0.0043  0.0807   0.7   4.9
>  105..42     0.088   158.4    60.6  0.0532  0.0050  0.0934   0.8   5.7
>  105..106    0.021   158.4    60.6  0.0532  0.0012  0.0220   0.2   1.3
>  106..45     0.134   158.4    60.6  0.0532  0.0075  0.1415   1.2   8.6
>  106..46     0.089   158.4    60.6  0.0532  0.0050  0.0940   0.8   5.7
>  104..52     0.230   158.4    60.6  0.0532  0.0129  0.2435   2.1  14.7
>   79..49     0.396   158.4    60.6  0.0532  0.0223  0.4187   3.5  25.4
>   78..25     0.378   158.4    60.6  0.0532  0.0213  0.3998   3.4  24.2
>   56..23     0.515   158.4    60.6  0.0532  0.0290  0.5447   4.6  33.0
>
> tree length for dN:       0.6637 tree length for dS:      12.4810
>
>
> Time used:  0:04

A: Specification of the task:
(1) Read and collect data from a large number of files held in one specified directory. Each file name is unique in the first 11 characters, and the final 7 characters of the name shall be _M0_mlc.
(2) The files are plain text with white-space, and are essentially free-format.
(3) The data to be extracted is identified by specific text as listed. For each file, only the first such match will be used.
lnL
kappa
omega
tree length for dN
tree length for dS

The immediately following real number, on the same text line, shall be the value for output. For any file where such a specific text or value is not found, the value N/A shall be output.
(4) Output shall be a single columnised table as shown in the question, one line per input file.
(5) All other data in any file shall be ignored.
(6) [as the title mentions an Excel worksheet]. The option to output the data as a CSV (comma separated value) text file, suitable for import to Excel, shall be provided.
This is a tested script that works according the the notes above. It has been tested using the file posted in the question, plus some hacks on the data to test some conditions (like missing data).
The test file is 166 lines, and I made 2600 copies for performance testing. It runs 2600 files of 166 lines in 1.25 seconds, which is about 300,000 lines a second, on my Laptop. Your files of 512KB are about 40 times bigger, so it might process the lot in one minute.
It takes an argument -c if you want CSV output to import to Excel.
Paul--) ./awkFastParse
DataSet      lnL                kappa (ts/tv)      omega (dN/dS)      tree length for dN tree length for dS
EOA100W06LO  -5160.995083       1.50195            0.05318            0.6637             12.4810
EOA110W06LO  -5160.995083       1.50195            0.05318            0.6637             12.4810
EOA120W06LO  N/A                N/A                N/A                N/A                N/A
EOA130W06LO  -5160.995083       N/A                0.05318            0.6637             12.4810
EOA140W06LO  -5160.995083       N/A                0.05318            0.6637             12.4810
EOA150W06LO  -5160.995083       1.50195            0.05318            0.6637             12.4810
EOA160W06LO  N/A                N/A                N/A                0.6637             12.4810
EOA170W06LO  -5160.995083       1.50195            0.05318            0.6637             12.4810
EOA180W06LO  -5160.995083       1.50195            0.05318            0.6637             12.4810
Paul--)
Paul--) ./awkFastParse -c
DataSet,lnL,kappa (ts/tv),omega (dN/dS),tree length for dN,tree length for dS
EOA100W06LO,-5160.995083,1.50195,0.05318,0.6637,12.4810
EOA110W06LO,-5160.995083,1.50195,0.05318,0.6637,12.4810
EOA120W06LO,N/A,N/A,N/A,N/A,N/A
EOA130W06LO,-5160.995083,N/A,0.05318,0.6637,12.4810
EOA140W06LO,-5160.995083,N/A,0.05318,0.6637,12.4810
EOA150W06LO,-5160.995083,1.50195,0.05318,0.6637,12.4810
EOA160W06LO,N/A,N/A,N/A,0.6637,12.4810
EOA170W06LO,-5160.995083,1.50195,0.05318,0.6637,12.4810
EOA180W06LO,-5160.995083,1.50195,0.05318,0.6637,12.4810
Paul--)

The script currently takes files from a subdirectory "Data", cuts off any pathname and the "_M0_mlc" filename extention. That might need some changes to fit in with your needs. Post if you need anything improved.
#! /bin/bash --

[[ "${1}" = "-c" ]] && { Csv=1; shift; }    #.. Option to set CSV output.

awkFastParse () {

    AWK='
BEGIN {
    txTitle = "DataSet,lnL,kappa (ts/tv),omega (dN/dS)," \
        "tree length for dN,tree length for dS";
    split (txTitle, Title, /,/);
    fmtCSV = "%s,%s,%s,%s,%s,%s\n";
    fmtCol = "%-12s %-18s %-18s %-18s %-18s %-18s\n";
    fmtRow = (Csv) ? fmtCSV : fmtCol;
    printf (fmtRow, Title[1], Title[2], Title[3], Title[4], Title[5], Title[6]);

    stderr = "cat 1>&2"; NUL = "\000"; NL = RS; RS = NUL;
    reAnyTag = "(lnL|kappa|omega|tree length for (dN|dS))";
    reValue = "[-+]?[0-9]+[.][0-9]+";
    Tag["lnL"]; Tag["kappa"]; Tag["omega"];
    Tag["tree length for dN"]; Tag["tree length for dS"];
}

function doFile (fn, Local, g, Set, fnr, txt, tag, j, cut, value) {

    RS = NL;
    while ((g = (getline txt < fn)) > 0) {
        ++fnr;
        #.. Optimisation -- skip any line that does not contain a Tag.
        if (txt !~ reAnyTag) continue;
        #.. Find all tags in this line.
        for (tag in Tag) {
            #.. Only take the first value in any file.
            if (tag in value) continue;
            #.. Locate the tag, or skip.
            if ((j = index (txt, tag)) == 0) continue;
            #.. Isolate the rest of the line.
            cut = substr (txt, j);
            #.. The value is the next real number.
            if (match (cut, reValue)) {
                value[tag] = substr (cut, RSTART, RLENGTH);
            }
        }
        #.. Optimisation -- if we have one of each value, skip the file.
        if (length (value) == length (Tag)) break;
    }
    if (g < 0) printf ("%s: %s\n", fn, ERRNO) | stderr;
    close (fn);
    RS = NUL;
    #.. Format and print the line for this file.
    Set = fn; sub (/^.*\//, "", Set); sub (/_M0_mlc$/, "", Set);
    for (tag in Tag) if (! (tag in value)) value[tag] = "N/A";
    printf (fmtRow, Set, value["lnL"], value["kappa"], value["omega"],
        value["tree length for dN"], value["tree length for dS"]);
}

{ doFile( $0); }
'
    awk -v Csv="${Csv}" -f <( printf '%s' "${AWK}" )
}

#.. Generate a list of file names with null terminations.

    find Data -name '*_M0_mlc' -print0 | sort -z | awkFastParse


text:
Q: ProgressBar with IProgress delegate across threads does not update I'm trying to display the progress of unzipping a few files on a WinForms ProgressBar.
Here I create a System.Progress with a handler that updates the ProgressBar
Progress<int> progress = new Progress<int>(value => {
    progressBar1.Value = value; progressBar1.Update(); });

Then I hand over my function to the thread pool.
Task t = Task.Run(() => FileUtils.UnzipTo(targetDir,
sourceDir, false, progress));

t.Wait();

Inside my unzip function I do this for every file in the archive:
progress.Report(++complete / total * 100);

This is definitely called and if I use a method for my handler the breakpoint is hit for every file (although too late I think)
I was hoping this would update the ProgressBar.
I see the dialog until the file is completely decompressed with a busy cursor above but there is no increase in progress.
What am I missing?

A: I believe that "what you're missing" is the integer division in the expression progress.Report(++complete / total * 100). When I replicated the issue this expression always evaluates to zero unless the total variable is cast to a floating point variable type.
Other than that I was able to reproduce a mock version of your code with the desired outcome.

public partial class MainForm : Form
{
    public MainForm()
    {
        InitializeComponent();
        buttonUnzip.Click += onButtonUnzip;
    }
    private async void onButtonUnzip(object? sender, EventArgs e)
    {
        progressBar1.Visible = true;
        Progress<int> progress = new Progress<int>(value => {
            progressBar1.Value = value; progressBar1.Update();
        });
        await Task.Run(() => FileUtils.UnzipTo("mockSource", "mockDest", true, progress));
        progressBar1.Visible = false;
    }
}
class FileUtils
{
    static string[] GetFilesMock() => new string[25];
    static void UnzipOneMock(string sourceDir, string targetDir, string file)
        => Thread.Sleep(TimeSpan.FromMilliseconds(100));
    public static void UnzipTo(
        string sourceDir,
        string targetDir,
        bool option,
        IProgress<int> progress)
    {
        var files = GetFilesMock();
        int complete = 0;
        int total = files.Length;
        foreach (var file in files)
        {
            UnzipOneMock(sourceDir, targetDir, file);
            progress.Report((int)(++complete / (double)total * 100));
        }
    }
}


text:
Q: Need help setting up custom code for chatbox widget on Twitch I am trying to get a typewriter effect but emotes don't show up, long text doesn't wrap either. Feel free to ask more details I don't know if you need more info. Any help is appreciated.
I am trying to get a typewriter effect but emotes don't show up, long text doesn't wrap either. Feel free to ask more details I don't know if you need more info. Any help is appreciated.

Page is streamlabs you may need a twitch account
HTML Code

Css Code
@import url('https://fonts.googleapis.com/css2?family=Codystar&display=swap');

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    text-shadow: 0 0 1px #000, 0 0 2px #000;
    background: {background_color};
        font-family: 'Codystar', cursive;
    font-weight: 700;
    font-size: {font_size};
    line-height: 1.5em;
  color: {text_color};
}

#log>div {
    animation: fadeInRight .3s ease forwards, fadeOut 0.5s ease {message_hide_delay} forwards;
    -webkit-animation: fadeInRight .3s ease forwards, fadeOut 0.5s ease {message_hide_delay} forwards;
}

.colon {
    display: none;
}

#log {
    display: table;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 0 10px 10px;
    width: 100%;
    table-layout: fixed;
}

#log>div {
    display: table-row;
}

#log>div.deleted {
    visibility: hidden;
}

#log .emote {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    padding: 0.4em 0.2em;
    position: relative;
}

#log .emote img {
    display: inline-block !important;
    height: 1em;
    opacity: 0;
}

#log .message,#log .meta {
    vertical-align: top;
    display: table-cell;
    padding-bottom: 0.1em;
}

#log .meta {
    width: 35%;
    text-align: right;
    padding-right: 0.5em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#log .message {
    word-wrap: break-word;
    width: 65%;
}
#message {
    word-wrap: break-word;
    width: 65%;
}

.badge {
    display: inline-block;
    margin-right: 0.2em;
    position: relative;
    height: 1em;
    vertical-align: middle;
    top: -0.1em;
}

.name {
    margin-left: 0.2em;
}

JavaScript Code
document.addEventListener('onLoad', function(obj) {
    // obj will be empty for chat widget
    // this will fire only once when the widget loads
});

document.addEventListener('onEventReceived', function(obj) {
    // obj will contain information about the event
e++
typeEffect(e);

});
var speed = 50;
var e = 1;
function typeEffect(inp) {
  var o = inp;
  document.getElementById("message").id= "message"+o;
    var text = $("#message"+o).text();
    $("#message"+o).text('');
    var i = 0;
    var timer = setInterval(function() {
        if(i < text.length) {
            $("#message"+o).append(text.charAt(i));
            i++;
        }
        else{
            clearInterval(timer);
      document.getElementById("message").id= "complete";
        };
  }, speed);

    }


text:
Q: Why does my springMVC cannot get models from front-end pages? I use @RequestBody in Controller to make the front-end json inject into my back-end entity automatically, but when I print the members of the entity, all of them are null. I search for some solutions, some suggests changing the Spring version to 4.2.4 can work, some says ommiting contentType:"application/json",  but I still cannot get the properties after doing those. So how can I solve the problem? I try to add consumes= "application/json"as the following comment, still in vain. Maybe using MappingJackson2HttpMessageConverter can only transfer model to json but cannot do conversely? Should I add more MessageConverters?
There are getters and setters in my models. Here are the excerpts of java code, jsp, applicationContext.xml and pom.xml:
@RequestMapping(value = "/changeNewslist", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "update/create", notes = "update/create", httpMethod = "POST", produces = "application/json")
public Integer changeNewslist(
        @ApiParam(value = "newslist", required = true)@RequestBody Newslist newslist,
        // newslist is the model I wanna get
        @ApiParam(value = "1-update 2-create", required = true) Integer operation) {
    System.out.println("**********" + JSON.toJSONString(newslist));
    System.out.println("**********" + operation);
    Integer res = 0;
    if (null != newslist){
        if (operation == 1) {
            newslist.setModifytime(new Date());
            res = this.getNewslistService().updateByPrimaryKeySelective(newslist);
        }
        if (operation == 2) {
            newslist.setCreatetime(new Date());
            res = this.getNewslistService().insertSelective(newslist);
        }
    }
    return res;
}

    $("#wid").on("change", function () {
        wid = $(this).val();
        newsObj.wid = wid;
    });

    $("#sitename").on("change", function () {
        sitename = $(this).val();
        newsObj.sitename = sitename;
    });

    $("#keyword").on("change", function () {
        keyword = $(this).val();
        newsObj.keyword = keyword;
    });

    $("#nextpageCount").on("change", function () {
        nextpageCount = $(this).val();
        newsObj.nextpagecount = Number(nextpageCount);
    });

    $("#weight").on("change", function () {
        weight = $(this).find("option:selected").html();
        newsObj.weight = Number(weight);
    });

    $("#url").on("change", function () {
        url = $(this).val();
        newsObj.url = url;
    });

    $(".status").on("click", function () {
        status = $(":checked:eq(1)").attr("id").split("-")[1];
        newsObj.status = Number(status);
    });

    $("#formSubmit").on("click", function () {
        // newsObj.operation = 1
        console.log(newsObj);
        $.ajax({
            url: '../list/changeNewslist',
            cache: false,
            async: false,
            dataType: 'json',
            contentType:"application/json",
            // contentType:'text/html;charset=utf-8',
            type: 'post',
            data: JSON.stringify({
                newslist: newsObj,
                operation : 2
            }),
            success: function (data) {
                // location.href = './newslist.jsp'
            }
        })
    });

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <ref bean="mappingJacksonHttpMessageConverter"/>
            </list>
        </property>
    </bean>

    <bean id="mappingJacksonHttpMessageConverter"
          class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
        <property name="supportedMediaTypes">
            <list>
                <value>application/json;charset=UTF-8</value>
            </list>
        </property>
    </bean>

<context:component-scan base-package="com.bolaa">
        <!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>-->
    </context:component-scan>
    <mvc:annotation-driven/>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.7.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.7.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.7.1</version>
        </dependency>

A: Try changing
 @ApiParam(value = "newslist对象", required = true)@RequestBody Newslist newslist,

to
@ApiParam(name="newslist", value = "newslist对象", required = true)@RequestBody Newslist newslist,

A: Your issue is wrong use @ApiParam
@ApiParam is for parameters. It is usually defined in the API Resource request class.
Example of @ApiParam:
/users?age=50
it can be used to define parameter age and the following fields:
paramType: query
name: age
description: age of the user
required: true
@ApiModelProperty is used for adding properties for models. You will use it in your model class on the model properties.
Example:
model User has name and age as properties: name and age then for each property you can define the following:
For age:
type: integer,
format": int64,
description: age of the user,
Check out the fields each denote in the swagger objects:
@ApiModelProperty- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md#529-property-object
@ApiParam - https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md#524-parameter-object


text:
Q: Chaining Observable with Promises for common error handling - Angular I am writing writing an application using the latest version of the Angular framework. I came across a problem - some of my methods return observables, and some return promises.
Is it possible to chain them in order to define a single catch block for all requests in the chain? (I mean the way you would normally do with just promises).
Take a look at this code sample:
loginToBackendServer(token: string) {
return new Promise ((resolve, reject) => {
  this.userService.loginUserWithFb().subscribe(backendUser => {
    this.facebookProvider.getBasicUserData().then(profile => {
      let userData = {
        id: backendUser['id'],
        facebookId: profile['id'],
        picture: profile['picture_large']['data']['url'],
        name: profile['name']
      };
      this.userService.userData = userData;
      this.sharedService.emitUserData(userData);
      this.storage.set("fbAccessToken", token);
      resolve();
    })
      .catch(error => {
        console.log(error);
        reject();
      })
  }, error => {
    console.log(error);
    reject();
  });
});

}
How do I chain the .subscribe() and the .then() so that I only have one catch block instead of having to handle errors separately?
Thanks guys!

A: You do not need to use a new promise to chain all the response and catch the error in one point. By using fromPromise and concatMap allow you to chain and keep your code organize (Note that I am using the pipeable operators, it is highly recommend to do so).
import { fromPromise } from 'rxjs/observable/fromPromise';
import { concatMap } from 'rxjs/operators';

...

loginToBackendServer(token: string) {
      this.userService.loginUserWithFb().pipe(
          concatMap(backendUser => fromPromise(this.facebookProvider.getBasicUserData()))
      ).subscribe(profile => {
          let userData = {
              id: backendUser['id'],
              facebookId: profile['id'],
              picture: profile['picture_large']['data']['url'],
              name: profile['name']
          };

          this.userService.userData = userData;
          this.sharedService.emitUserData(userData);
          this.storage.set("fbAccessToken", token);
      }, error => {
          console.log(error);
      });
  }


text:
Q: load failed UWP.csproj : error : Object reference not set to an instance of an object My Xamarin.UWP suddenly won't load after Visual Studio 2017 15.4.
I did update my Xamarin PCL and others. But the UWP Project will not load anymore. I can't get to it?
I get this in my VS IDE Output;
UWP.csproj : error  : Object reference not set to an instance of an object.
How would I og about solving this?

A: i had the same problem and it turned out that the error was caused by not having all the assets for UWP projects, so I made sure the projects has all assets added to UWP.csproj fil and assets folder.
So my ItemGroup looks like this
<ItemGroup>
    <Content Include="Properties\Default.rd.xml" />
    <Content Include="Assets\LockScreenLogo.scale-100.png" />
    <Content Include="Assets\LockScreenLogo.scale-125.png" />
    <Content Include="Assets\LockScreenLogo.scale-150.png" />
    <Content Include="Assets\LockScreenLogo.scale-200.png" />
    <Content Include="Assets\LockScreenLogo.scale-400.png" />
    <Content Include="Assets\SplashScreen.scale-100.png" />
    <Content Include="Assets\SplashScreen.scale-125.png" />
    <Content Include="Assets\SplashScreen.scale-150.png" />
    <Content Include="Assets\SplashScreen.scale-200.png" />
    <Content Include="Assets\SplashScreen.scale-400.png" />
    <Content Include="Assets\Square150x150Logo.scale-100.png" />
    <Content Include="Assets\Square150x150Logo.scale-125.png" />
    <Content Include="Assets\Square150x150Logo.scale-150.png" />
    <Content Include="Assets\Square150x150Logo.scale-200.png" />
    <Content Include="Assets\Square150x150Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.scale-100.png" />
    <Content Include="Assets\Square44x44Logo.scale-125.png" />
    <Content Include="Assets\Square44x44Logo.scale-150.png" />
    <Content Include="Assets\Square44x44Logo.scale-200.png" />
    <Content Include="Assets\Square44x44Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-16_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-32_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-48_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-256_altform-unplated.png" />
    <Content Include="Assets\StoreLogo.png" />
    <Content Include="Assets\Wide310x150Logo.scale-100.png" />
    <Content Include="Assets\Wide310x150Logo.scale-125.png" />
    <Content Include="Assets\Wide310x150Logo.scale-150.png" />
    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
    <Content Include="Assets\Wide310x150Logo.scale-400.png" />
  </ItemGroup>

A: I had this issue while after upgrading from vs2015 to vs2017.
After following this
link
and replacing the platform target, it loaded again.
(yes, I know, it doesn't seem to make any sense)

*

*Right click target UWP project and select "edit"

*Alter find and change keys to these values:

replacement:
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>

Note: the project's platform target might get disrupted.


text:
Q: Placing an Admob banner at the bottom of screen I have added a Admob banner to a scene in my app by using the example from: https://forums.xamarin.com/discussion/51779/cocossahrp-and-admob.
The ad displays at the top of the screen but I want to display it at the bottom. I couldn't find any CocosSharp examples but I did find one for cocos2d-x(last post): http://discuss.cocos2d-x.org/t/admob-bottom-placement-tutorial-v3-0/13854/11
I have tried this with my code(see below) but can't get it working. Something I have noticed though is if I change the LayoutParams from 200 to size.Y the ad banner appears in the middle of the screen instead of the top but this happens even when AlignParentBottom or Gravity.Bottom is not used.
Using a RelativeLayout with AddRule:
        Android.Graphics.Point size = new Android.Graphics.Point();
        prActivity.WindowManager.DefaultDisplay.GetSize(size);
        RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(
            size.X,
            200);
        var bannerAd = new AdView(prActivity);
        bannerAd.AdSize = AdSize.SmartBanner;
        bannerAd.AdUnitId = "ca-app-pub-3940256099942544/6300978111"; // Test UnitId
        bannerAd.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
        var lcRequestbuilder = new AdRequest.Builder();
        bannerAd.LoadAd(lcRequestbuilder.Build());
        adParams.AddRule(LayoutRules.AlignParentBottom); // Rule to place ad at the bottom
        prActivity.AddContentView(bannerAd, adParams);

        ScheduleOnce(t =>
        {
            bannerAd.BringToFront();
        }, 3f);

Using a LinearLayout with Gravity:
        Android.Graphics.Point size = new Android.Graphics.Point();
        prActivity.WindowManager.DefaultDisplay.GetSize(size);
        LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(
            size.X,
            200);
        var bannerAd = new AdView(prActivity);
        bannerAd.AdSize = AdSize.SmartBanner;
        bannerAd.AdUnitId = "ca-app-pub-3940256099942544/6300978111"; // Test UnitId
        bannerAd.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
        var lcRequestbuilder = new AdRequest.Builder();
        bannerAd.LoadAd(lcRequestbuilder.Build());
        adParams.Gravity = GravityFlags.Bottom; // Gravity Flag to place ad at the bottom
        prActivity.AddContentView(bannerAd, adParams);

        ScheduleOnce(t =>
        {
            bannerAd.BringToFront();
        }, 3f);

A: I use AdMob Ad in this way in my App and it's work for me(Ad is in the bottom of the screen) :
 private static final String AD_UNIT_ID = "";
 private AdView adView;

 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(getWindowManager().getDefaultDisplay().getWidth(), (getWindowManager().getDefaultDisplay().getHeight() + getWindowManager().getDefaultDisplay().getHeight()) - 100);
        adView = new AdView(this);
        adView.setAdSize(AdSize.BANNER);
        adView.setAdUnitId(AD_UNIT_ID);
        adView.setBackgroundColor(Color.TRANSPARENT);
        addContentView(this.adView, adParams);

    }

getWidth method of Display is deprecated but still i am using it.


text:
Q: Flow Chart on a straight line in latex How can I draw a flowchart that looks like this?
I know how to draw block diagrams but I have never seen an example of a work flow diagram like this. Especially I am having a hard time on generating curly arrows. I will appreciate any help.

A: I did this with stacks.
\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\def\useanchorwidth{T}
\newcommand\vstrut[1][]{\makebox[0pt]{\rule[-1ex]{1pt}{2ex}}\mnote{#1}}
\def\mnote#1{\brlap{$\scriptstyle#1$}}
\def\dx#1{\hbox to #1 {}}
\def\dline#1{\hbox to #1 {\hrulefill}}
\def\dubrace#1{\hbox to #1 {\upbracefill}}
\def\ddbrace#1{\hbox to #1 {\downbracefill}}
 \begin{document}
\stackunder[-1ex]{%
  \Shortstack{Time\\Update\\ \dx{1in}}%
  \Shortstack{%
    Spectrum Collection\\(Prediction-based Sampling)\\ \ddbrace{3.5in}\\
    Blob\\Extraction\\ \dx{3.5in}}%
}{%
  \Shortunderstack{
    \vstrut[t_k\mathrm{s}]\dline{1in}\vstrut[t_n\mathrm{s}]\dline{1.25in}%
    \vstrut[t_k + 0.1\mathrm{s}]\\ \dubrace{2.25in}\\Panchromatic Image\\Aquisition}%
  \dline{1in}%
  \Shortunderstack{
    \vstrut[t_n\mathrm{s}]\dline{1.25in}\vstrut[t_k + 0.4\mathrm{s}]\\
    \dubrace{1.25in}\\Spectra Collection\\(Measurement-based Sampling)}%
}
\end{document}

A: A TikZ solution. To draw with brace, one needs decorations.pathreplacing from tikzlibrary. The syntax is displayed below where amplitude and raise can be changed to suit one's need. The two points are starting/ending points where braces with be drawn in between.
\draw[decorate,thick,decoration={brace,amplitude=5pt,raise=15pt},]
(10,0)--node[below=0.5cm,mybox2]{Spectra Collection \\ (Measurement-based Sampling)}(7,0);

Code:
\documentclass[12pt,oneside]{book}
\usepackage{tikz}
\usepackage{siunitx}
\usetikzlibrary{decorations.pathreplacing,,positioning}
\tikzset{mybox/.style = {rectangle, text width=4cm,minimum height=2cm,align=center},
mybox2/.style = {rectangle, text width=6cm,minimum height=2cm,align=center}
}
\begin{document}
\begin{tikzpicture}
\draw[-] (0,0)node[pos=0,below]{\tiny $t_k\,\si{\s}$} --
node[pos=0.1,above=-15pt,mybox] {Time \\Update}
node[pos=0.6,above=-15pt,mybox] {Blob \\Extraction}
node[pos=0.2,below]{\tiny $t_n\,\si{\s}$}
node[pos=0.5,below]{\tiny $t_k+\SI{0.1}{\s}$}
node[pos=0.7,below]{\tiny $t_m\,\si{\s}$}
node[pos=1,below]{\tiny $t_n+\SI{0.4}{\s}$}
(10,0);
\draw[thick]  (0,-5pt)--(0,5pt) (2,-5pt)--(2,5pt)  (5,-5pt)--(5,5pt)  (7,-5pt)--(7,5pt)  (10,-5pt)--(10,5pt);
\draw[decorate,thick,decoration={brace,amplitude=5pt,raise=15pt}]
(5,0)--node[below=0.5cm,mybox]{Panchromatic Image \\ Acquisition}(0,0);
\draw[decorate,thick,decoration={brace,amplitude=5pt,raise=30pt},]
(2,0)--node[above=0.8cm,mybox2]{Spectra Collection \\ (Prediction-based Sampling)}(10,0);
\draw[decorate,thick,decoration={brace,amplitude=5pt,raise=15pt},]
(10,0)--node[below=0.5cm,mybox2]{Spectra Collection \\ (Measurement-based Sampling)}(7,0);
\end{tikzpicture}
\end{document}


text:
Q: Symfony workflow::can passes through workflow guard event listener I don't now if a lot of you have already tested the symfony workflow component but I hope some of you have :)
So, I am using this component on two objects and I want the first object to update the second one depending on the transition it is applying.
To do so, I am using the workflow guard listener on my first object and try to do a workflow::apply on my second object (using the second workflow ...).
The problem is that, when I make a workflow::can, the event is dispatched and it tries to apply a new status on my second object ... This is quite not normal as I am just asking if I can apply some transition and not asking to actually apply it on my first object.
config
framework:
    workflows:
        request_for_operation:
            type: 'state_machine'
            marking_store:
                type: 'single_state'
                arguments:
                    - 'status'
            supports:
                - AppBundle\Entity\RequestForOperation
            places:
                - draft
                - pending_for_management
                - in_progress
                - finished
                - canceled
            transitions:
                request_for_operations:
                    from: draft
                    to:   pending_for_management
                start_rfop_management:
                    from: pending_for_management
                    to:   in_progress
                close:
                    from: in_progress
                    to:   finished
                cancel:
                    from: [pending_for_management, in_progress]
                    to:   canceled
        operation:
            type: 'state_machine'
            marking_store:
                type: 'single_state'
                arguments:
                    - 'status'
            supports:
                - AppBundle\Entity\Operation
            places:
                - draft
                - pending_for_management
                - in_progress
                - finished
                - canceled
            transitions:
                validate_operation:
                    from: draft
                    to:   pending_for_management
                start_tracking:
                    from: pending_for_management
                    to:   in_progress
                close:
                    from: in_progress
                    to:   finished
                cancel:
                    from: [pending_for_management, in_progress]
                    to:   canceled

Subscriber
class RequestForOperationListener implements EventSubscriberInterface
{
    public function __construct(
        OperationManager $operationManager,
        UserNotifier $userNotifier
    ) {
        $this->operationManager = $operationManager;
        $this->userNotifier = $userNotifier;
    }

    public static function getSubscribedEvents()
    {
        return [
            'workflow.request_for_operation.guard.request_for_operations' => ['onRequestForOperations'],
            'workflow.request_for_operation.guard.start_rfop_management' => ['onStartRfopManagement'],
            'workflow.request_for_operation.guard.close' => ['onClose'],
            'workflow.request_for_operation.guard.cancel' => ['onCancel'],
        ];
    }

    public function onRequestForOperations(GuardEvent $event)
    {
        /** @var RequestForOperation $rfop */
        $rfop = $event->getSubject();

        //get all the operations linked to the rfop
        $operations = $rfop->getOperations();
        foreach ($operations as $operation) {
            //set the status of the operation to 'pending_for_management'
            $this->operationManager->applyTransition($operation, 'validate_operation');
            //set the status of the sub-operations to 'pending_for_management'
            foreach ($operation->getChildren() as $subOperation) {
                $this->operationManager->applyTransition($subOperation, 'validate_operation');
            }

            //get the users (i.e: managers) linked to the operation and notify them (by mail or whatever)
            $this->notifyAssignedUsers($operation->getUsers(), $operation);
        }
    }
}

A: I think I encountered the same issue as you, and I have logged a bug with the Symfony project: https://github.com/symfony/symfony/issues/33105


text:
Q: Cordova File Plugin Has Wrong Directory So I am building a cordova/phonegap app in angularjs 1 and I'm trying to save and read from a file called calendar.txt in the app's private directory/sandbox and can't.
My console logs while debugging show that there are no errors and the file is being created if it doesn't exist, and is being read correctly. However that is not the case. When I build and run on my device, the data is not saved. Also no file is created in the location specified.
I console logged the path it was trying to use and this is it:
file:///data/data/com.adobe.phonegap.app/files/calendar.txt
Here is the code I am using to open the file:
$rootScope.openFile = function(){
        var pathToFile = cordova.file.dataDirectory + "calendar.txt";
        console.log('path = ' + pathToFile);
        window.resolveLocalFileSystemURL(pathToFile,
            function(fileEntry){
            fileEntry.file(function (file) {
                var reader = new FileReader();

                reader.onloadend = function (e) {
                    $rootScope.calendar = JSON.parse(this.result);
                    console.log('file opened');
                    console.log(JSON.parse(this.result));
                };

                reader.readAsText(file);
            }, function(error){});
        }, function(error){
            if(error.code == FileError.NOT_FOUND_ERR){
                $rootScope.calendar = new Year();
                console.log('no file found so it was created');
                $rootScope.saveFile();
            }
            else{
                console.log(error);
            }
        });
    };

And here is the code for my save the file:
$rootScope.saveFile = function(){
        var data = JSON.stringify($rootScope.calendar, null, '\t');
        var fileName = "calendar.txt"
        window.resolveLocalFileSystemURL(cordova.file.dataDirectory,
            function(directoryEntry){
                directoryEntry.getFile(fileName, { create: true },
                    function (fileEntry) {
                        fileEntry.createWriter(
                            function (fileWriter) {
                                var blob = new Blob([data], { type: 'text/plain' });
                                fileWriter.write(blob);
                                console.log('file saved');
                            },
                            function (error){});
                    },
                    function (error){}
                );
            },
            function(error){
                console.log("Saving Error: Error during finding directory", error.message);
            }
        );
    };

I have used this tutorial to get this far: Cordova File Plugin Tutorial
What am I doing wrong?

A: I assume that you are facing this issue in Android as i too faced the same. As per my understanding and googling, in android (atleast in android 5) you cant write in application data directory unless the phone is rooted. So you may have to use externalRootDirectory instead.
eg: window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory,successCallback, errorCallback);
Hope it helps.


text:
Q: Android Listview : Center items in layout when fewer items I have a listview that can have items from 1 to 100, dynamically varying.
However, when I have fewer items, I want the items to appear vertically centered in
the listview layout.  By default, Android draws the items form the top. I have attached a picture to illustrate what I need.
Is there any way I can achieve this, either by code or in XML layout ?
Thanks.

Edit: Based on the answers I have received now, I am adding more clarity to my question as the answers are off mark.
The positioning of the Listview in the main layout or positioning of individual item layouts is not an ISSUE here.  The listview is positioned properly as shown in the shaded background.  The question to which I need answer is:

*

*Assume there are 10 items, the entire shared area of Listview will be used by items,
possibly Items 1 to 5 are shown.

*Assume there are 3 items only.  The listview is still shown but Items 1,2 and 3 are rendered at the top of the listview (shaded area).  However, in this case, I want the items to be drawn at centre of the listview's layout (as shown in the picture).

Anyway this can be done ?

A: Use this property
    mLoginUserNameValueView.setGravity(Gravity.CENTER_HORIZONTAL);

which one you want to center in the List view adapter and which position exactly where you need
e-x  you need your 55th position you want center the item means
     in getview you will use this line like below.
@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = null;
        if (convertView == null) {
            convertView = mLayoutInflater.inflate(R.layout.navigationlayout,
                    null);
            mHolder.mLayout = (LinearLayout) convertView
                    .findViewById(R.id.navigationLayout);
            mHolder.mNavigationtext = (TextView) convertView
                    .findViewById(R.id.navigationText);
            convertView.setTag(mHolder);
        }
        if (\\Your desired position checking )
            \\ and set the above line here
        }
        return convertView;
    }


text:
Q: Why is it ambiguous between an int object and a function type? Here is the code example:
namespace A
{
  int k;
}
void k(int,int){/*dosomething*/}
int main()
{
  using namespace A;
  k(1,1);//ooop!k is ambiguous!
}

What happened? I thought it should not be ambiguous since they are different types. Why is it ambiguous?  With int k it is not possible to do k(1,1).
So it has nothing to do with what the name actually is?Even if a name that is not a function type will also cause ambiguity when we use k(1,1) ,which is wrong in grammar because int k is not function?

A: There are three ways to resolve the ambiguity:
1st:
int main() {
    A::k = 5;
    ::k( 1, 1 );
}

2nd:
int main() {
    using namespace A;
    A::k = 5;
    ::k(1, 1);
}

3rd:
namespace A {
   int k;
}

namespace B {
   void k( int, int ) { /* do something */ }
}

int main() {
   using namespace A or B but not both!
   if A then k = 5; okay && k(1,1); error
   if B then k(1, 1); okay && k = 5; error
   if both again ambiguous unless A::k = 5; || B::k(1,1);
   return 0;
}

Due to the nature of ambiguity it doesn't truly pay to use using namespace A. And this is why it is considered bad practice to have using namespace std; either in the global scope or directly in the main function. It is okay to use it in a function or a member function of a class/struct as long as you don't conflict with any other library.
I ran this in my IDE visual studio 2017 CE and here is the compiler error:
1>------ Build started: Project: ChemLab, Configuration: Debug Win32 ------
1>main.cpp
1>c:\...\visual studio 2017\projects\chemlab\chemlab\main.cpp(17): error C2872: 'k': ambiguous symbol
1>c:\...\visual studio 2017\projects\chemlab\chemlab\main.cpp(8): note: could be 'void k(int,int)'
1>c:\...\visual studio 2017\projects\chemlab\chemlab\main.cpp(6): note: or       'int A::k'
1>Done building project "ChemLab.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

When you use the using namespace directive it will take everything that is in that namespace and make it visible to main. So now in main you have both the namespace A and the global namespace visible within main. Since you have both visible you now have 2 identifiers or symbols in the look up table named k. And when you call k(1, 1) it doesn't know which one you intended to choose.
This is no different than doing this:
main.cpp
#include <string>

class string {
public:
    char* _chars;
};

int main() {
    using namespace std;

    string myString; // error ambiguous did you mean ::string or std::string?

    return 0;
}

This might provide you with some more insight:
When the using directive is being used, don't think of the variable k and the function k as being declared in the same scope. They were previously declared in their own scope. The variable k is in ::A::k and the function void k(int,int){} is in ::k(int,int){}. In the main function when you apply the using namespace A; what happens here it takes every symbol after A:: and it kind of shifts it as if it were in the global :: scope for visibility. Now the compiler has to make a choice on the available symbols and sees I have a k and a k. Did you mean int k(){} or void k(int,int){}...

A: Lookup of the name k is ambiguous because there are two matching declarations visible, ::k and ::A::k .
The exact rule can be found in the C++ Standard (N4659 [basic.lookup]/1):

Name lookup associates the use of a name with a set of declarations of that name. The declarations found by name lookup shall either all declare the same entity or shall all declare functions; in the latter case, the declarations are said to form a set of overloaded functions.

Looking up an unqualified name that is used for a function call has two stages:

*

*Unqualified lookup of the name

*Argument-dependent lookup of the name.

The unqualified name lookup rules, even when looking up a name that is being used for a function call, find any declaration of that name.  (The rule is NOT that it only searches for function declarations of that name).  This stage finds both ::k and ::A::k regardless of whether those are functions, ints, or whatever.
The argument-dependent lookup does have a rule that only function declarations are found for that part of the lookup. But that is not relevant to this code.

The relevant behaviour of the using directive is covered by [basic.lookup.unqual]/2 (edited by me to just show the parts relevant to this question):

For the purpose of the unqualified name lookup rules, the declarations from the namespace nominated by the using-directive are considered members of that enclosing namespace.

This clarifies that using namespace A; does not actually introduce the members of A into the scope of main(); but it means that when looking up a name in the global namespace (because that is the innermost enclosing namespace of the site of the using declaration), the names from A will also be found there.

A: The ambiguity comes from the name. There is no way to overload a variable like you would a function/method, so there is a "clash" in the names.
In order to get the "k" that you want, you need to specify the namespace.
namespace A
{
    int k;
}

void k(int, int) {/*dosomething*/ }

int main()
{
    using namespace A;
    ::k(1, 1); // uses the global namespace
    A::k = 5; // uses the namespace A
 }

Or, to take the namespace out of the equation:
void k(int, int) {/*dosomething*/ }
void k(int, int, float) {}

int main()
{
    int k;

    // all of these are now ambiguous
    k(1, 1);
    k(1, 2, 0.4);
    k = 5;
}


text:
Q: syncing Google spreadsheet and Google (my) Maps I would like to synchronize a google spreadsheet with a map so that I don't have to upload everything everyday.
I found that it's possible to synch a google form to google map using Google Fusion.
See, YouTube: Syncing Google Forms with Google Fusion Tables for Crowdsourced Maps.
But I couldn't replicate the process to my situation (I guess it's maybe because the spreadsheet content is not originated from a google form and maybe the script take that into account)
I don't know much about coding scripts but automating this process would be a blast for me!!
I hope someone will be able to help me out on this
thanks a lot and have a good day

A: The only thing to account for this situation is the difference of form submit. The guy in the video sets up two triggers: one for onFormSubmit, and one hourly trigger for syncing whenever any manual changes are made.
I haven't looked directly over the code, but all you should have to do is modify the onFormSubmit code and trigger. Change the code to look for and update the fusion table with any new rows from your spreadsheet. And then change the trigger to your desired need, timer would probably be the best option. So every hour, or day, or run it manually after your done adding rows.
Now, if you were to edit the rows of data after they've already been updated, the hourly syncing will take care of those changes.
I could imagine that the hourly sync method could be changed in such a manner to look for rows that need to be added, could be as simple as calling the submit function.

A: I had the same problem but i could solve it.
A time trigger is not needed if you set the sync function at the end of the function OnFormSubmit (so "sync();" under "insertRowId(rowId, row);" Syncing takes place after each sending of the form automatically.
For larger forms I found out that you should not make a special column Location in the Fusion table. The address column should marked as Location in Fusion table. In the script properties of the spreadsheet give the addressColumn the value of the column title of the address column and the third property keeps unchanged ("latlng">Location. What happens is that the value of the adres is overwritten by "latlng". So if you have trouble to loose the original addresses, add a new column, copy by apps script the same address (that piece of script direct at the beginning of the function OnFormSubmit) and (after syncing) give the addressColumn the value of the column title and in the Fusion table marks the original addess column as Text and the new column as Location.


text:
Q: What's the simplest way to retrieve the latest subversion tag from SVN? When we tag, we use the following format. YYYYMMDD_SPRINTNAME
We have multiple environments and each environment should only have that particular sprint (TV show name) installed. For example, our UAT environment is working off the FRIENDS code base. Our QA environment is working off the LAWORDER code base.
When we tag, they all go into the same repository (unlike our branches). So running an svn ls <PATH_TO_REPO> | tail -n1 won't work. What I would like to have happen is run the same command for each sprint name and grabbing the latest tag for that particular sprint.
For example, svn ls http://devbox/repos/projectname/tags will show the following. The latest tag is at the bottom (tail -n1 will work but not always).
20121210_CHOPPED
20121219_FRIENDS
20121220_MASH
20121220_FRIENDS
20121220_LAWORDER

So there could be an instance where we wanted to grab the latest tag for the FRIENDS sprint?

A: Instead of blindly rely on the results of tail, contrary to @msell code, I'll suggest hand-made logic and small change in ls
svn ls -v ROOT-OF-TAGS
in this case first column of each tag will be revision of creation and after grep highest revision can be detected based on number, not order

A: Subversion tags are just directories just like branches. There has been some controversy with this design because tags can be easily modified (just like branches and directories) without much notice. One of the first things I did was to create a pre-commit hook to allow people to create a tag, but prevent tags from being modified.
However, one of the great things about this design is that tags have the full power of Subversion attached to them. You can see who created the tag, when, and why. You can see where the tag is from, what revision, and who may have modified it.
This means that if all of your tags are directly under the tags directory, you can simply use svn log to look at the changes in the /tags directory:
$ svn log -v $REPO/tags

The very first entry will be the very last tag created. If you use Python or Perl, you can have a script that will run on both PCs and (U|li)nix systems that will return the last tag created.

A: Perhaps using svn log would give you what you want, for example:
$ svn log http://some/repos/tags
------------------------------------------------------------------------
r4443 | joe | 2012-12-18 15:35:27 -0800 (Tue, 18 Dec 2012) | 1 line
Changed paths:
   A /tags/release-2.2.3.1-ga (from /branches/release-2.2:4442)

------------------------------------------------------------------------
r4345 | joe | 2012-11-21 17:40:11 -0800 (Wed, 21 Nov 2012) | 1 line
Changed paths:
   A /tags/release-1.7.4.1-ga (from /branches/release-1.7.4:3872)

Create tag for 1.1.4.1

...

So you could either use some shell tools to pick out your sprint name, or read in the XML formatted log output (svn log --xml) and pick it out of there.  Whichever method you're more adept at.


text:
Q: T-SQL convert BigInt into Date I used to work this way :
select cast(cast(20171002 as varchar) as date) AS BigInt_into_Date,
but is it possible, to achive the same with single use of convert() function ?
Conversion between bigint and datetime is explicite, so expression argument in convert is needed, so mayby we also could convert into date

A: It is possible to convert from BigInt to DateTime.
However, the numeric value for October 2nd 2017 is 43008 (days since Jan 1, 1900).
20171002 is really a string representation of a date stored as a number - hence your need for the double cast.
And no - I don't think it's possible to perform any simple arithmetic to get from 20171002 to 43008 :-)


text:
Q: include HTMLPURIFIER file cause error on Prestashop 1.6 I have an error on this code
if (Configuration::get('PS_USE_HTMLPURIFIER')) {

 require_once(_PS_ROOT_DIR_.'/tools/htmlpurifier/HTMLPurifier.standalone.php');
}

the error:
PHP Fatal error:  require_once(): Failed opening required '/home/luvsecret/public_html/www.jacketsshops.com/tools/htmlpurifier/HTMLPurifier.standalone.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/luvsecret/public_html/www.jacketsshops.com/config/config.inc.php on line 135

The file permission is 644, the file exists and folder permission is 755
When commenting the code the website returns to work.
Any help?

A: I think the problem is on path, you should replace _PS_ROOT_DIR_ with _PS_TOOL_DIR_
if (Configuration::get('PS_USE_HTMLPURIFIER')) {
    require_once(_PS_TOOL_DIR_.'htmlpurifier/HTMLPurifier.standalone.php');
}


text:
Q: R: Looping over a vector of subsets of data, and for each, comparing it against some aggregates Suppose I work with the toy data
library(dplyr)

dat <- data.frame(
ID = letters[1:20],
Category = rep(c(1,2),10),
Values = rnorm(20,0,1)
)

A_B <- dat[1:6,]
A_notB <- dat[7:14,]
notA_B <- dat[15:16,]
notA_notB <- dat[17:20,]

For each subset, I want to compute its variance grouped by category, which I can do.  However, for each subset, I would also like to compare its variance grouped by category against three alternatives.
It's easiest to explain if I just work with the example of subset A_B.  I would like to compare its grouped variance against the grouped variances of each of the following:
(1) All the data not in A_B,
(2) all the data in a variable that begins with notA (so the union of notA_B and notA_notB),
(3) all the data that ends in notB
Is there a way to accomplish this in a for-loop, or are the three groupings of the data so dependent on the names of the subsets that just brute-force writing out the code for each case really the most efficient way to proceed?

A: You can build function splitting db to "case" versus rest and apply to list of different cases to see all the comparison of variances
  Case <- c("A_B", "A_notB", "notA_B", "notA_notB")

  Total <- rbind(cbind(A_B, gr="A_B"),
        cbind(A_notB, gr="A_notB"),
        cbind(notA_B, gr="notA_B"),
        cbind(notA_notB, gr="notA_notB"))

  vargr_comp <- function(case){
     Total%>%
      mutate(split = ifelse(gr==case, case, paste0("not ", case)))%>%
      group_by(split, gr, Category)%>%
      summarise(var=var(Values))
  }

  lapply(Case, vargr_comp)


text:
Q: abstract algebra for component wise operations on "vectors" or what it might be called I have a quite tough problem to solve and need an algebra that allows to "vectors" following operations:
- multiplication between two vectors are componentwise that means v=(v1, v2, v3,...) multiplied by w=(w1, w2, w3,...) gives v.w = (v1 w1, v2 w2, v3 w3,...)
- no scalar multiplication of vectors allowed
- all mathematical operators suc as log, sin, cos, sign, etc are applied componentwise
- the vectors contain only integers
In general every operation seems to work here component wise. Indeed I do not even like to call them even a vector.
Formally, I need to fix what type of ring/module/... and properties define exactly this algebra and what terminology I can use.
It is crazy that I have solved the problem but can not expressit in a formal language, because of lacking as from natural sciences the mathematical formalism from abstract algebra.
Is there anybody who can help me please.
Many thanks
-Sam


text:
Q: AttributeError: 'module' object has no attribute 'urlopen' python2.7 im trying to get proxies out of a web page
import urllib
import re
myfile = open("C:\\Users\Teli\Desktop\pro.txt", "w")
page = urllib.urlopen("http://www.samair.ru/proxy/ip-address-01.htm").read()
a = re.findall('\d+\.\d+\.\d+\.\d+', page)
myfile.write(str(a))
myfile.close()

why does it say:
page = urllib.urlopen("http://www.samair.ru/proxy/ip-address-01.htm").read()

AttributeError: 'module' object has no attribute 'urlopen'

A: You are either using python 3 or have a file named urllib.py in the current directory.

A: i used python2.7 and it worked
import urllib
import re
myfile = open("C:\\Users\Teli\Desktop\pro.txt", "w")
pagea = urllib.urlopen("http://www.samair.ru/proxy/ip-address-01.htm").read()
a = re.findall('\d+\.\d+\.\d+\.\d+', pagea)
pageb = urllib.urlopen("http://www.samair.ru/proxy/ip-address-02.htm").read()
b = re.findall('\d+\.\d+\.\d+\.\d+', pageb)
pagec = urllib.urlopen("http://www.samair.ru/proxy/ip-address-03.htm").read()
c = re.findall('\d+\.\d+\.\d+\.\d+', pagec)
paged = urllib.urlopen("http://www.samair.ru/proxy/ip-address-04.htm").read()
d = re.findall('\d+\.\d+\.\d+\.\d+', paged)
myfile.write(str(a)) myfile.write(str(b)) myfile.write(str(c))
myfile.write(str(d)) myfile.close()


text:
Q: How to read multiple files with specific character or number using a loop in R I have a directory with a bunch of .tif files like: tnt_xxx_2015.tif, tnt_xxx_2016.tif, tnt_xxx_2017.tif......tnt_xxx_2100.tif. 'tnt' is one of the variable names, and for each year "xxx" represents multiple strings. The years are from 2015 to 2100.So I want to find all files that the variable name and year are the same values.I tried to find all files with the variable 'tnt' in same year first:
for (i in 2015:2100)
{
   myfiles = Sys.glob("*i.tif")
}

But it doesn't work. It won't accept wildcards; it needs an exact match on the file name. Sys.glob("2015.tif") runs successfully.
Any ideas?

A: How about:
for(I in 2015:2100){
  myfiles <- list.files(pattern=paste0(i, ".tif$"))
}

This replicates your code above, but will overwrite myfiles each time through the loop.  If you want to just grab all the files in one vector, you could do the following:
myfiles <- NULL
for(I in 2015:2100){
  myfiles <- c(myfiles, list.files(pattern=paste0(i, ".tif$")))
}


text:
Q: LDA in Spark 1.3.1. Converting raw data into Term Document Matrix? I'm trying out LDA with Spark 1.3.1 in Java and got this error:
Error: application failed with exception
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.NumberFormatException: For input string: "��"

My .txt file looks like this:
 put weight find difficult pull ups push ups now
 blindness diseases everything eyes work perfectly except ability take light use light form images
 role model kid
  Dear recall saddest memory childhood
This is the code:
import scala.Tuple2;

import org.apache.spark.api.java.*;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.mllib.clustering.LDAModel;
import org.apache.spark.mllib.clustering.LDA;
import org.apache.spark.mllib.linalg.Matrix;
import org.apache.spark.mllib.linalg.Vector;
import org.apache.spark.mllib.linalg.Vectors;
import org.apache.spark.SparkConf;

public class JavaLDA {
  public static void main(String[] args) {
    SparkConf conf = new SparkConf().setAppName("LDA Example");
    JavaSparkContext sc = new JavaSparkContext(conf);

    // Load and parse the data
    String path = "/tutorial/input/askreddit20150801.txt";
    JavaRDD<String> data = sc.textFile(path);
    JavaRDD<Vector> parsedData = data.map(
        new Function<String, Vector>() {
          public Vector call(String s) {
            String[] sarray = s.trim().split(" ");
            double[] values = new double[sarray.length];
            for (int i = 0; i < sarray.length; i++)
              values[i] = Double.parseDouble(sarray[i]);
            return Vectors.dense(values);
          }
        }
    );
    // Index documents with unique IDs
    JavaPairRDD<Long, Vector> corpus = JavaPairRDD.fromJavaRDD(parsedData.zipWithIndex().map(
        new Function<Tuple2<Vector, Long>, Tuple2<Long, Vector>>() {
          public Tuple2<Long, Vector> call(Tuple2<Vector, Long> doc_id) {
            return doc_id.swap();
          }
        }
    ));
    corpus.cache();

    // Cluster the documents into three topics using LDA
    LDAModel ldaModel = new LDA().setK(100).run(corpus);

    // Output topics. Each is a distribution over words (matching word count vectors)
    System.out.println("Learned topics (as distributions over vocab of " + ldaModel.vocabSize()
        + " words):");
    Matrix topics = ldaModel.topicsMatrix();
    for (int topic = 0; topic < 100; topic++) {
      System.out.print("Topic " + topic + ":");
      for (int word = 0; word < ldaModel.vocabSize(); word++) {
        System.out.print(" " + topics.apply(word, topic));
      }
      System.out.println();
    }

    ldaModel.save(sc.sc(), "myLDAModel");

  }
}

Anyone know why this happened? I'm just trying LDA Spark for the first time. Thanks.

A: values[i] = Double.parseDouble(sarray[i]);

Why are you trying to convert each word of your text file into a Double?
That's the answer to your issue:
http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#parseDouble%28java.lang.String%29

A: Your code is expecting the input file to be a bunch of lines of whitespace separated text that looks like numbers. Assuming your text is words instead:
Get a list of every word that appears in your corpus:
JavaRDD<String> words =
        data.flatMap((FlatMapFunction<String, String>) s -> {
            s = s.replaceAll("[^a-zA-Z ]", "");
            s = s.toLowerCase();
            return Arrays.asList(s.split(" "));
        });

Make a map giving each word an integer associated with it:
Map<String, Long> vocab = words.zipWithIndex().collectAsMap();

Then instead of your parsedData doing what it's doing up there, make it look up each word, find the associated number, go to that location in an array, and add 1 to the count for that word.
JavaRDD<Vector> tokens = data.map(
        (Function<String, Vector>) s -> {
            String[] vals = s.split("\\s");
            double[] idx = new double[vocab.size() + 1];
            for (String val : vals) {
                idx[vocab.get(val).intValue()] += 1.0;
            }
            return Vectors.dense(idx);
        }
    );

This results in an RDD of vectors, where each vector is vocab.size() long, and each spot in the vector is the count of how many times that vocab word appeared in the line.
I modified this code slightly from what I'm currently using and didn't test it, so there could be errors in it. Good luck!


text:
Q: reading text from canvas rectangle in android Iam new to android.I want to read the text written in a rectangle drawn in canvas.I know that drawText() is used to write the text,is there any way to read the text ?
Thanks in advance

A: If you simply want to write text inside a rectangle. It will be the best you use TextView instead of canvas.drawText.
If you do want to use drawText. Here's the method. First, create CustomView class.
public class CustomView extends View{

    String text;
    private Paint paint;

    public CustomView(Context context, AttributeSet attrs) {
        super(context, attrs);
        paint = new Paint();
        paint.setColor(Color.BLACK);
    }

    public void setText(String text){
        this.text = text;
        invalidate();
    }

    @Override
    public void onDraw(Canvas canvas){
        canvas.drawText(text, 20, 20, paint);
        super.onDraw(canvas);
    }

}

In activitiy_main.xml, declare like following. In this case, you have draw 2 rectangles. Remember to set different id for each rectangle.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.example.apps1.CustomView
        android:id="@+id/custom_view_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <com.example.apps1.CustomView
        android:id="@+id/custom_view_2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>

Then, find the view by the given id on above at MainActivity and write the text you want to set into your rectangle.
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String view1Text = "First rectangle";
        String view2Text = "Second rectangle";

        CustomView customView1 = (CustomView)findViewById(R.id.custom_view_1);
        CustomView customView2 = (CustomView)findViewById(R.id.custom_view_2);
        customView1.setText(view1Text);
        customView2.setText(view2Text);

        // get text from customView1 and customView2
        String textOnCustomView1 = customView1.text;
        String textOnCustomView2 = customView2.text;
    }

}

In this way, you can read the text you write into rectangle.


text:
Q: How can I connect 12.4 to the Internet with WEP key? I have Ubuntu and I want to know how can I connect to the Internet using my WEP key for my wireless.
I tried too many times but it doesn't work. I have my wireless password but it doesn't work too.
Can somebody help me?

A: I'm a little confused.  A WEP key is a security code used on some Wi-Fi networks.  It is usually  a set of hex numbers 10 or 26 digits long.  A "wireless password" might mean you are using WPA encryption.  check out how to reset your router from the manual that came with it.  Usually this involves pressing a small button on the back of the router labeled "RESET" for several seconds then using the default password and username to set up your security--good luck!


text:
Q: How to remove a duplicate country from intl-tel-input How to remove the repetition of preferred countries. I need to add all the African countries as preferred countries in the dropdown list.
code i used for that.

preferredCountries: [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ],

But this same country's all are repeating in the list again. How can I remove the repetition.

A: You can use a Set to get the unique values here, then use the ... spread operator to return to an array:

preferredCountries = [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ];

const uniqueCountries = [...new Set(preferredCountries)];

console.log({ uniqueCountries });
.as-console-wrapper { max-height: 100% !important; top: 0; }

Another example:

const values = [ 'a', 'a', 'a', 'b', 'b', 'b', 'c' ];

// Use spread operator and new Set()
let uniqueValues = [...new Set(values)];

console.log({ uniqueValues });

// Or use Array.from() and new Set()
uniqueValues = Array.from(new Set(values));

console.log({ uniqueValues });
.as-console-wrapper { max-height: 100% !important; top: 0; }

A: You can avoid duplication of array by different ways
let preferredCountries: [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ],

let NewpreferredCountries= [...new Set(chars)];

console.log(NewpreferredCountries);

Another Method is
let preferredCountries: [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ],

let NewpreferredCountries= preferredCountries.filter((c, index) => {
    return preferredCountries.indexOf(c) === index;
});

console.log(NewpreferredCountries);

You can also remove duplicates from an array using forEach() and include()
let preferredCountries: [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ],

let NewpreferredCountries= [];
preferredCountries.forEach((c) => {
    if (!NewpreferredCountries.includes(c)) {
        NewpreferredCountries.push(c);
    }
});

console.log(NewpreferredCountries);