text:
Q: Twitter api key says unknown key I have downloaded source code from below site
http://oauth-io.github.io/oauth-js/
and implemented for twitter as-is.
but when I intialize with my app consumer key it returns unknown key, where as when I give consumer key form demo source code, it works, what setting I need.
function twitterLogin()
    {
        console.log(OAuth);
        OAuth.initialize('xxxxxx');
        OAuth.popup('twitter', function (error, success) {
            console.log('error ' + error);
            console.log('success ' + success);
        });

}

It just says unknown key and popup closed immediately.
Thanks

A: From the OAuth.io Docs:

When you create an OAuth.io application in your dashboard, a pair of
  public key, private key is generated. You will need this pari to
  initialize the SDK later on.

// Initialize the SDK
OAuth.initialize('Your-public-key')

To authorize your app using OAuth.io, you just need to add a provider
  to your OAuth.io app, copy/paste your provider's API Keys (usually
  client_id and client_secret), and specify a permission scope. Then,
  you can directly try a connection to the provider, by clicking on the
  Try auth button.
You can also use the Token API to sign up your users with their social
  identity. provider is the name of a provider on OAuth.io as facebook,
  twitter, google and 100+ others.
The provider needs to have the User API enabled to work properly (you
  can see it when you add a new provider in your OAuth.io Dashbaord).

This is important. Your Twitter API Key goes into your OAuth.io Dashboard and your OAuth.io Key goes into your initialize function.


text:
Q: Como criar uma conexão com um db externo com um app Phonegap? Estou entrando e estudando o mundo do Phonegap/Cordova e quero começar a desenvolver aplicativos mais legais e com mais interação, mas estou encontrando essa limitação, na maioria dos locais onde eu encontro para aprender, os bancos de dados para as aplicações utilizando Phonegap/Cordova são locais e gostaria de saber se é possível fazer uma aplicação utilizando essas ferramentas(de forma segura) com um banco de dados externo e se sim, como fazer.
obs: já encontrei perguntas com respostas aqui mesmo que diziam que era possível realizar a conexão com o banco com o JS, mas em contrapartida, isso não era seguro.

A: Diretamente no lado cliente não é possível conectar diretamente no banco de dados.
No lado servidor, com javascript temos o NodeJS que faz essa conexão. Ou mesmo pode usar várias outras linguagens como ASP.NET, PHP, Java, Python, Ruby (on Rails) etc.
O que se utiliza é criar um WebService REST (mais fácil) ou WebSocket (menos utilizado) para a comunicação do servidor com a aplicação cliente.
Uma vez tendo o servidor, o cliente pode se comunicar com http ou websocket para trocar dados com o servidor e assim com o banco de dados.
Existem várias alternativas dependendo do framework javascript que você for usar se você for usar um.
Procure por WebServices e requisições AJAX.

A: Olá, uma opção muito legal que deixa transparente pra você essa parte de XHR e ajax e tem todo um back-end à sua disposição é o Firebase, um serviço do google que pode ser acessado com javascript. Dá uma olhada lá..

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I best retest a bug in a newer or development release? I have reported a bug that occurs in Karmic on launchpad, and I have been asked to re-test it on lucid or maverick. How can I do this best?

A: Three routes:

*

*Install Ubuntu in a VM.
Pros: Your installation is persistent, and you can switch back and forth between the VM and your normal desktop with ease.
Cons: It'll be slow.

*Use a LiveCD.
Pros: Most straightforward, same method as when you first installed Ubuntu.
Cons: No persistence of session, your environment is lost when you restart.

*Install on a separate machine. CD read times are sloooow.
Pros: Persistence, speed.
Cons: Expensive if you don't have the hardware.
Personally, I'd go the VM route. You'll need to do with a LiveCD or physical install if your bug involves the hardware.

A: This depends on what bug you're trying to re-test.  For almost all bugs, testing in a VM is great.  As mentioned on another answer, Testdrive is good for that.
For hardware related bugs you'll need to run on the real hardware, which means that a LiveCD is a more appropriate method.

A: I depends on what kind of bug it was (estethic, a program crash, etc) but the simplest way would be to download Lucid's live cd, boot it and see if you can reproduce the bug.
If it's something that requires a real installation and it's not enough booting a live cd, then install Lucid on a virtual machine using VirtualBox, and you can test almost anything in there without affecting your current environment.

A: For testing Maverick, testdrive is easiest. It'll automatically download the latest Maverick daily and run it in a Virtual Machine.
sudo apt-get install testdrive virtualbox-ose
testdrive

A: Without upgrading? You may need to setup a Virtual instance of Lucid or Maverick or install that specific version under a new partition on your machine. I find that VirtualBox works well (and is free) for Ubuntu.


text:
Q: Is revtex documentclass compatible with glossaries package? I would like to use the documentclass revtex4 and in it I would like to use the package glossaries-extra.
Unfortunately, when I put the two together, I get the following message: Error: Missing \glsxtr@resource in aux file. (Have you used \glsxtrresourcefile or \GlsXtrLoadResources?) system returned with code 768.
And it looks like, the glossaries-extra package is not able to find my entries, but I do not see why it should not work, I use the same kind of code for many documents (with \documentclass{article} for example) without any trouble.
Here is my minimal non-working example aipsamp-test.tex:
% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }
% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }

%\documentclass[twocolumn]{article}
\documentclass[%
        aip,
        amsmath, amssymb,
        reprint,% Neither reprint nor twocolumn options work.
%       twocolumn,
    ]{revtex4-2} % or revtex4-1.

    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}

    \begin{filecontents}{SymbolsAcronymsTest.bib}
        @acronym{fem,short= {FEM}, long= {Finite Element Method}}

        @symbol{dens,
            name={\ensuremath{ \rho }},
            description={mass density},
        }
    \end{filecontents}

    \newcommand{\PathSymbolsEntries}{./SymbolsAcronymsTest}%.bib
    \usepackage[record, automake]{glossaries-extra}
        \newglossary*{acronym}{Abbreviations}
        \newglossary*{symbol}{Nomenclature}

        \GlsXtrLoadResources[
            src={\PathSymbolsEntries},
            type={acronym},
            match={entrytype=acronym},
        ]

        \GlsXtrLoadResources[
            src={\PathSymbolsEntries},
            type=symbol,
            match={entrytype=symbol},
        ]

\begin{document}
    \title{Sample Title}
    \author{A. Author}
    \date{\today}
    \begin{abstract}
        An article usually includes an abstract.
    \end{abstract}
    \maketitle

    \section{First-level heading}
        This sample document demonstrates proper use of REV.
        $\gls{dens}$, \gls{fem}

    \printunsrtglossary[type=acronym]
    \printunsrtglossary[type=symbol]
\end{document}

Is there known incompatibilities ? Or do you have any ideas ?
Thanks by advance.
Edit
The issue is clearly seen through the shell command:
pdflatex --shell-escape ./aipsamp-test.tex 1>log.txt
pdflatex --shell-escape ./aipsamp-test.tex 1>log.txt
Error: Missing \glsxtr@resource in aux file. (Have you used \glsxtrresourcefile or \GlsXtrLoadResources?)
system returned with code 768

Also as the previous command shows it the error does not stop the compilation but just gives a warning in the terminal. So the problem does not appear in the logfile. Therefore, I think that the problem comes from the glossaries-extra internal runsystem(bib2gls aipsamp-test) from the automake option.
Otherwise in the produced document, the section Acronym and Nomenclature are empty and there is question mark where rho and FEM should appear, as it can be seen in red in the screenshot below.
Here is the log file aipsamp-test.log generated:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.9.17)  17 SEP 2020 16:58
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**./aipsamp-test.tex
(./aipsamp-test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/revtex4-2.cls
Document Class: revtex4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/re
vtex/ for documentation)
 Copyright (c) 2019 American Physical Society.
 mailto:revtex@aps.org
 Licensed under the LPPL:
http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
 Arthur Ogawa <arthur_ogawa at sbcglobal dot net>
 Based on work by David Carlisle <david at dcarlisle.demon.co.uk>Version (4.2c)
: Modified by Mark Doyle
 .
ltxutil[2019/01/18/14:29:48 4.2c utilities package (portions licensed from W. E
. Baxter web at superscript.com)]
LaTeX Info: Redefining \@centercr on input line 315.
Class revtex4-2 Info: Repairing broken LaTeX eqnarray on input line 365.
\eqncolsep=\skip47
Class revtex4-2 Info: Repairing hyperref-unfriendly LaTeX definition of \mpfoot
note on input line 440.
Class revtex4-2 Info: Repairing broken LateX \@sect on input line 762.
\intertabularlinepenalty=\count167
\@tbpen=\count168
\@arstrutbox@hline=\box45
Class revtex4-2 Info: Repairing broken LaTeX \@xbitor on input line 1793.
Class revtex4-2 Info: Making \typeout \long on input line 2053.
ltxfront[2019/01/18/14:29:48 4.2c frontmatter package (AO,DPC,MD)]
\c@affil=\count169
\c@collab=\count170
\absbox=\box46
ltxgrid[2019/01/18/14:29:48 4.2c page grid package (portions licensed from W. E
. Baxter web at superscript.com)]
\c@linecount=\count171
\output@latex=\toks15
\box@size@1=\box47
\box@size@2=\box48
\@protection@box=\box49
\@topmark@saved=\toks16
\footins@saved=\box50
\footins@recovered=\box51
\column@recovered=\box52
\pagesofar=\box53
\footsofar=\box54
\pagegrid@col=\count172

Class revtex4-2 Warning: Failed to recognize \@vspace, \@vspacer, \@no@pgbk, \@
newline, and \\; no patches applied. Please get a more up-to-date class, .

\c@part=\count173
\c@section=\count174
\c@subsection=\count175
\c@subsubsection=\count176
\c@paragraph=\count177
\c@subparagraph=\count178
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\c@figure=\count179
\fbox@1=\box55
\c@table=\count180
\fbox@2=\box56
\c@video=\count181
\fbox@4=\box57
\@bibdataout=\write3
\widetext@top=\box58
\widetext@bot=\box59
Class revtex4-2 Info: Selecting society aip on input line 7581.
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/aip4-2.rtx
File: aip4-2.rtx 2019/01/18/14:29:48 4.2c AIP substyle for REVTeX
Class revtex4-2 Info: RevTeX society AIP selected on input line 87.
)

Class revtex4-2 Warning: No journal specified, using default cha.

Using journal substyle cha.
Class revtex4-2 Info: Reading file aps10pt4-2.rtx on input line 7586.
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/aps10pt4-2.rtx
File: aps10pt4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for
 documentation)
Class revtex4-2 Info: RevTeX pointsize 10pt selected on input line 36.
)
Class revtex4-2 Info: Overriding 10pt on input line 7586.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/textcase/textcase.sty
Package: textcase 2019/09/14 v1.00 Text only upper/lower case changing (DPC)
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks17
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
))
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip50

For additional information on amsmath, use the `?' option.
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01 AMS text

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks18
\ex@=\dimen134
)
LaTeX Info: Redefining \text on input line 28.
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen135
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count182
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count183
\leftroot@=\count184
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count185
\DOTSCASE@=\count186
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box60
\strutbox@=\box61
\big@size=\dimen136
LaTeX Font Info:    Redeclaring font encoding OML on input line 733.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 734.
\macc@depth=\count187
\c@MaxMatrixCols=\count188
\dotsspace@=\muskip16
\c@parentequation=\count189
\dspbrk@lvl=\count190
\tag@help=\toks19
\row@=\count191
\column@=\count192
\maxfields@=\count193
\andhelp@=\toks20
\eqnshift@=\dimen137
\alignsep@=\dimen138
\tagshift@=\dimen139
\tagwidth@=\dimen140
\totwidth@=\dimen141
\lineht@=\dimen142
\@envbody=\toks21
\multlinegap=\skip51
\multlinetaggap=\skip52
\mathdisplay@stack=\toks22
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip17
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip53
\bibsep=\skip54
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count194
)
Class revtex4-2 Info: Repairing natbib's \BibitemShut on input line 7588.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/revsymb4-2.sty
Package: revsymb4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/
for documentation)
LaTeX Info: Redefining \frak on input line 101.
LaTeX Info: Redefining \Bbb on input line 117.
LaTeX Info: Redefining \REV@mathfrak on input line 125.
))
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks23
\inpenc@posthook=\toks24
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
)

LaTeX Warning: File `SymbolsAcronymsTest.bib' already exists on the system.
               Not generating it from this source.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries-extra/glossaries-e
xtra.sty
Package: glossaries-extra 2020/03/23 v1.44 (NLCT)
 (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

(/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks25
\XKV@tempa@toks=\toks26

(/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count195
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2019/09/21 v2.5h e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count196
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/base/glossaries.st
y
Package: glossaries 2020/03/19 v4.46 (NLCT)
 (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty
Package: mfirstuc 2017/11/14 v2.06 (NLCT)
\@glsmfirst=\toks27
\@glsmrest=\toks28
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/xfor/xfor.sty
Package: xfor 2009/02/05 v1.05 (NLCT)
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/datatool/datatool-base.sty
Package: datatool-base 2019/09/27 v2.32 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/substr/substr.sty
Package: substr 2009/10/20 v1.2 Handle substrings
\c@su@anzahl=\count197
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/datatool/datatool-fp.sty
Package: datatool-fp 2019/09/27 v2.32 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp.sty
Package: fp 1995/04/02

`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/defpattern.sty
Package: defpattern 1994/10/12
\actioncount=\count198
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-basic.sty
Package: fp-basic 1996/05/13
\FP@xs=\count199
\FP@xia=\count266
\FP@xib=\count267
\FP@xfa=\count268
\FP@xfb=\count269
\FP@rega=\count270
\FP@regb=\count271
\FP@regs=\count272
\FP@times=\count273
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-addons.sty
Package: fp-addons 1995/03/15
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-snap.sty
Package: fp-snap 1995/04/05
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-exp.sty
Package: fp-exp 1995/04/03
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-trigo.sty
Package: fp-trigo 1995/04/14
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-pas.sty
Package: fp-pas 1994/08/29
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-random.sty
Package: fp-random 1995/02/23
\FPseed=\count274
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-eqn.sty
Package: fp-eqn 1995/04/03
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-upn.sty
Package: fp-upn 1996/10/21
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-eval.sty
Package: fp-eval 1995/04/03
)))
\@dtl@toks=\toks29
\@dtl@tmpcount=\count275
\dtl@tmplength=\skip55
\dtl@sortresult=\count276
\@dtl@numgrpsepcount=\count277
\@dtl@datatype=\count278
\dtl@codeA=\count279
\dtl@codeB=\count280
\@dtl@foreach@level=\count281
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/base/glossaries-co
mpatible-307.sty
Package: glossaries-compatible-307 2020/03/19 v4.46 (NLCT)
)
\gls@level=\count282
\@gls@tmpb=\toks30
\gls@tmplen=\skip56
\glskeylisttok=\toks31
\glslabeltok=\toks32
\glsshorttok=\toks33
\glslongtok=\toks34

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-hy
pernav.sty
Package: glossary-hypernav 2020/03/19 v4.46 (NLCT)
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-li
st.sty
Package: glossary-list 2020/03/19 v4.46 (NLCT)
\glslistdottedwidth=\skip57
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-lo
ng.sty
Package: glossary-long 2020/03/19 v4.46 (NLCT)
 (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/tools/longtable.sty
Package: longtable 2020/01/07 v4.13 Multi-page Table package (DPC)
\LTleft=\skip58
\LTright=\skip59
\LTpre=\skip60
\LTpost=\skip61
\LTchunksize=\count283
\LTcapwidth=\dimen143
\LT@head=\box62
\LT@firsthead=\box63
\LT@foot=\box64
\LT@lastfoot=\box65
\LT@cols=\count284
\LT@rows=\count285
\c@LT@tables=\count286
\c@LT@chunks=\count287
\LT@p@ftn=\toks35
)
\glsdescwidth=\skip62
\glspagelistwidth=\skip63
)
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-su
per.sty
Package: glossary-super 2020/03/19 v4.46 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/supertabular/supertabular.sty
Package: supertabular 2020/02/02 v4.1g the supertabular environment
\c@tracingst=\count288
\ST@wd=\dimen144
\ST@rightskip=\skip64
\ST@leftskip=\skip65
\ST@parfillskip=\skip66
\ST@pageleft=\dimen145
\ST@headht=\dimen146
\ST@tailht=\dimen147
\ST@pagesofar=\dimen148
\ST@pboxht=\dimen149
\ST@lineht=\dimen150
\ST@prevht=\dimen151
\ST@toadd=\dimen152
\ST@dimen=\dimen153
\ST@pbox=\box66
))
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-tr
ee.sty
Package: glossary-tree 2020/03/19 v4.46 (NLCT)
\glstreeindent=\skip67
))
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries-extra/glossaries-e
xtra-bib2gls.sty
Package: glossaries-extra-bib2gls 2020/03/23 v1.44 (NLCT)
)
\@glsxtr@leveloffset=\count289
\glsxtrresourcecount=\count290
\@glsxtrnewgls@inner=\count291
\glsshortpltok=\toks36
\glslongpltok=\toks37
)
runsystem(bib2gls aipsamp-test)...executed.

Package glossaries-extra Warning: No file `aipsamp-test.glstex' on input line 3
3.

Package glossaries-extra Warning: No file `aipsamp-test-1.glstex' on input line
 39.

Class revtex4-2 Info: Unrecognized LaTeX tabular. Please update this document c
lass! (Proceeding with fingers crossed.) on input line 41.
Class revtex4-2 Info: Patching unrecognized longtable package. (Proceeding with
 fingers crossed) on input line 41.
Class revtex4-2 Info: cite was not loaded (OK!) on input line 41.
Class revtex4-2 Info: mcite was not loaded (OK!) on input line 41.
Class revtex4-2 Info: multicol was not loaded (OK!) on input line 41.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.d
ef
File: l3backend-pdfmode.def 2020-03-12 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count292
\l__pdf_internal_box=\box67
) (./aipsamp-test.aux)
\openout1 = `aipsamp-test.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 41.
LaTeX Font Info:    ... okay on input line 41.
\openout3 = `aipsamp-testNotes.bib'.

Class revtex4-2 Warning: Assuming \noaffiliation for authors.

LaTeX Font Info:    Trying to load font information for T1+cmss on input line 4
8.
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/t1cmss.fd
File: t1cmss.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)
LaTeX Font Info:    Trying to load font information for U+msa on input line 52.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info:    Trying to load font information for U+msb on input line 52.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)

Package glossaries-extra Warning: Glossary entry `dens' has not been defined on
 input line 52.

Package glossaries-extra Warning: Glossary entry `fem' has not been defined on
input line 52.

Package glossaries-extra Warning: No entries defined in glossary `acronym' on i
nput line 54.

Package glossaries-extra Warning: No entries defined in glossary `symbol' on in
put line 55.

No file aipsamp-test.bbl.
No file aipsamp-test.bbl.
[1{/Applis/TexLive/texlive2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./aipsamp-test.aux) )
Here is how much of TeX's memory you used:
 9602 strings out of 480608
 149647 string characters out of 5901651
 505453 words of memory out of 5000000
 25383 multiletter control sequences out of 15000+600000
 540170 words of font info for 40 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 59i,4n,41p,1053b,329s stack positions out of 5000i,500n,10000p,200000b,80000s
{/Applis/TexLive/texlive2020/texmf-dist/fonts/enc/dvips/c
m-super/cm-super-t1.enc}</Applis/TexLive/texlive2020/texmf-dist/fonts/type1/pub
lic/amsfonts/cm/cmr10.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/type1/p
ublic/cm-super/sfrm0900.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/type1
/public/cm-super/sfrm1000.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/typ
e1/public/cm-super/sfss1000.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/t
ype1/public/cm-super/sfsx0900.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts
/type1/public/cm-super/sfsx1440.pfb>
Output written on aipsamp-test.pdf (1 page, 75208 bytes).
PDF statistics:
 33 PDF objects out of 1000 (max. 8388607)
 23 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

I continued the investigations and it seems that the problem comes from the option reprint in the \documentclass: by commenting this option, the compilation returns no error and the document looks like expected. However, the layout is completely different without this option. I also notice the same problem with the option twocolumn. But the question about why these options generate troubles remains ?


text:
Q: Simple Existing Document Update in Elasticsearch using NEST Hey I trying to update existing document of ElasticSearch, I found a cURL code from Elasticsearch site
Note: Sam type with 2 document is already exists I just want to update a existing field
POST /EmployeeIndex/Sam/2/_update
{
   "doc" : {
      "Nested" : true,
      "views": 0
   }
}

Its working perfectly how I need but please help me to convert it to NEST, as i working on .NET, I managed to write a code
 var responseUpdate = client.Update<clsEmployeeElasticSearch, object>(u => u
               .Index("EmployeeIndex")
                .Type("Sam")
                    .Id(2)
                    .Doc(new { Nested= true })
                    .RetryOnConflict(3)
                    .Refresh());

But it always creating a new field in my document instead of updating existing one.
Please see attached screenshot with a code
Please help guys.

A: What you need is a PartialUpdate. Applied on your example, the following code should do what you expect.
    var responseUpdate = client.Update<clsEmployeeElasticSearch, object>(u => u
         .Index("EmployeeIndex")
         .Type("Sam")
         .Id(2)
         .Doc(new {IsActive ="true", Views="0"})
         .DocAsUpsert()
     );

A: Is it possible that you are already there but be just facing a casing missmatch issue? see from Nest reference:

Property Name Inference In many places NEST allows you to pass
  property names and JSON paths as C# expressions, i.e:
.Query(q=>q
      .Term(p=>p.Followers.First().FirstName, "martijn")) NEST by default will camelCase properties. So the FirstName property above
  will be translated to "followers.firstName".
This can be configured by setting
settings.SetDefaultPropertyNameInferrer(p=>p); This will leave
  property names untouched.
Properties marked with [ElasticAttibute(Name="")] or
  [JsonProperty(Name="")] will pass the configured name verbatim.

...
Note that you are creating a dynamic object for the update so, i belive attributes might not a be a solution if you keep it that way


text:
Q: Force content to fit full width after sidebar collapsed Bootstrap I'm using this updated Bootstrap sidebar collapse in my page, but here the sidebar & content have a fixed width for both divs, the main content is not taking full width after it has collapsed.
HTML:

...

...

But what I want is after the sidebar collapsed, main content should take full width.
I checked this and few other questions from stack overflow but didn't find what I want

A: Here's what needed to be done:
First I replaced the outdated col-xs with col. Then I replaced the remaining col-md-9 col-11 with col. Done!
The reason why it's working is because the first column for the sidebar is defined already. col then just fills out all of the available remaining space.
Here's the working code:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

                 Item 1

                    Subitem 1

                        Subitem 1 a
                        Subitem 2 b
                        Subitem 3 c

                            Subitem 3 c.1
                            Subitem 3 c.2

                        Subitem 4 d
                        Subitem 5 e

                            Subitem 5 e.1
                            Subitem 5 e.2

                    Subitem 2
                    Subitem 3

                 Item 2
                 Item 3

                    3.1
                    3.2

                        3.2 a
                        3.2 b
                        3.2 c

                    3.3

                 Item 4
                 Item 5
                 Link
                 Link
                 Link
                 Link
                 Link
                 Link
                 Link

Bootstrap 4 Sidebar Menu

A responsive, multi-level vertical accordion.


text:
Q: Is it possible to convert NetMTLMv2 hash to NTLM hash? Is there any way to convert NetNTLMv2 to ntlm hashes?
For instance ntlm value of the 123 is
3DBDE697D71690A769204BEB12283678

Same password for user "try" in computer "PC" which has private ip address 192.168.73.130 NetNTLMv2 value is
try::PC:d158262017948de9:91642a8388d64d40f6c31b694e79363e:010100000000000058b2da67cbe0d001c575cfa48d38bec50000000002001600450047004900540049004d002d00500043003100340001001600450047004900540049004d002d00500043003100340004001600650067006900740069006d002d00500043003100340003001600650067006900740069006d002d0050004300310034000700080058b2da67cbe0d0010600040002000000080030003000000000000000000000000030000065d85a4000a167cdbbf6eff657941f52bc9ee2745e11f10c61bb24db541165800a001000000000000000000000000000000000000900240063006900660073002f003100390032002e003100360038002e0031002e00310030003700000000000000000000000000

Can we convert this NetNTLMv2 to NTLM (3DBDE697D71690A769204BEB12283678) without knowing any credentials?

A: There is no answer :) But it is ok, because I did a little research and found the answer. For now, there is no way to convert NetNTLMv2 to NTLM. Actually NTLM hash is the first key to generate NetNTLMv2. I decided to explain how it works.

To calculate and compare NTLMv2 you should first calculate the NTLM value of the password which is 123 in this case.  To demonstrate it, I'll use python 2.7. Before starting you should import those modules hashlib, binascii, hmac .
NTLM value of 123 calculated with python like this:
_ntlm = hashlib.new("md4", "123".encode("utf-16-le")).digest()
ntlm = binascii.hexlify(_ntlm)

The result is 3dbde697d71690a769204beb12283678 and this value will be used as key for the first HMAC_MD5 calculation.
To do that we should concatenate the user name and domain name. If you don't work on the domain, you'll use your computer name. In this case, my username is try and my computer name is PC.
When we concatenate it, it'll become tryPC. Then this value is converted into unicode uppercase in little-endian format. We'll generate HMAC_MD5 hash of this value with using NTLM of 123 as a key.
"tryPC"==> "TRYPC" ==> '54005200590050004300' (UTF-16-le in hexadecimal)

We calculate this in Python like:
"tryPC".upper().encode("utf-16-le").encode("hex")

Then we calculate HMAC_MD5(54005200590050004300) with key 3dbde697d71690a769204beb12283678
In python it is calculated like this:
firstHMAC = hmac.new("3dbde697d71690a769204beb12283678".decode("hex"),"54005200590050004300".decode("hex"),hashlib.md5).hexdigest()
firstHMAC ==> 2381ca3f5e9c4534722cd511f6a4c983

After that we'll use firstHMAC as a key to calculate the HMAC_MD5 value of the Type2 challenge.
Type2 challenge is combined with server challenge and blob.
Network response for NetNTLMv2 is like this:
try::PC:d158262017948de9:91642a8388d64d40f6c31b694e79363e:010100000000000058b2da67cbe0d001c575cfa48d38bec50000000002001600450047004900540049004d002d00500043003100340001001600450047004900540049004d002d00500043003100340004001600650067006900740069006d002d00500043003100340003001600650067006900740069006d002d0050004300310034000700080058b2da67cbe0d0010600040002000000080030003000000000000000000000000030000065d85a4000a167cdbbf6eff657941f52bc9ee2745e11f10c61bb24db541165800a001000000000000000000000000000000000000900240063006900660073002f003100390032002e003100360038002e0031002e00310030003700000000000000000000000000

When we split this response according to : index 3 is the server challenge which is d158262017948de9
Index 5 which starts like "01010000..." indicates the blob value. Blob value also consists of blob signature, reserved fields, timestamp, random client nonce and target information. I don't give detail about the blob.
To calculate NTLMv2 we should concatenate the server challenge and the blob to calculate the HMAC_MD5 value of this by using firstHMAC as a key.
In Python we do that like this:
firstHMAC = "2381ca3f5e9c4534722cd511f6a4c983"
type2Challange = "d158262017948de9010100000000000058b2da67cbe0d001c575cfa48d38bec50000000002001600450047004900540049004d002d00500043003100340001001600450047004900540049004d002d00500043003100340004001600650067006900740069006d002d00500043003100340003001600650067006900740069006d002d0050004300310034000700080058b2da67cbe0d0010600040002000000080030003000000000000000000000000030000065d85a4000a167cdbbf6eff657941f52bc9ee2745e11f10c61bb24db541165800a001000000000000000000000000000000000000900240063006900660073002f003100390032002e003100360038002e0031002e00310030003700000000000000000000000000"
ntlmv2 = hmac.new(firstHMAC.decode("hex"),type2Challange.decode("hex"),hashlib.md5).hexdigest()
ntlmv2 ==> 91642a8388d64d40f6c31b694e79363e

If this value is equal to the 4th index of the NetNTLMv2 response, you'll be verified. In this case, the 4th index is equal to 91642a8388d64d40f6c31b694e79363e and that means you have the correct password.
According to server challenge and blob value, you'll always get the different NTLMv2 value and you only can calculate this if you have the correct password.
In other words, we can produce NetNTLMv2 with NTLM. However, we cannot convert back NetNTLMv2 to NTLM because [cryptographic] hash functions are one-way functions.


text:
Q: Best way to get data off a computer with no support for USB or Ethernet? A customer has a computer running Windows 98 (I know, cringe) and needs to take some data off the computer to put on a new laptop.
I've tried using USB, but Windows 98 doesn't have USB storage drivers. I thought I'd transfer the data via Ethernet instead, but the computer doesn't have an Ethernet port.
I then decided to try and burn the data to a CD, but we only had blank DVDs on hand. And of course, the drive doesn't write to DVDs.
The only way I can think of getting the data off the drive now is by taking it out of the computer and using a USB cable to connect it directly to the laptop, but I don't really want to poke around the insides of that PC.
Does anyone have any better ideas to get the data off the computer?

A: To be honest, taking the drive out would take about 30 seconds, it's probably the easiest way.

A: Go buy some CDs at the local supermarket or computer store!

A: download  Ubuntu Linux  CD or USB, boot from there and it will support USB
using serial port will take forever (depend on the data volume)
there are also DB25 Male / DB25 Male 15C Parallel Data Transfer Cable (norton commander or Windows 'Direct Cable Connection.")
boot Linux from floppy - but it is not GUI :)
DVD - KNOPPIX this GUI is very lightweith no problems even with 128MB
you also can do a backup of user's data if HDD dies (it is about a time)

A: Back in the day, we used special parallel or serial port cables and file transfer software to move data from PC to PC. The most famous package I remember was LapLink and it came with special cable and software for just this problem. Wikipedia describes the LapLink cable as for parallel port - http://en.wikipedia.org/wiki/LapLink_cable, but I know I have in a junkbox somewhere a couple of universal serial port null-modem cables. Perhaps, I'm mixing up the Direct Cable Connection feature of Windows that apparently is available up through Windows XP - http://en.wikipedia.org/wiki/Direct_cable_connection. If you're interested in pursuing, Microsoft still has some instructions online - http://support.microsoft.com/kb/298446.

A: The two most economical ways to do it would be to, as many suggest would be to:

*

*remove the harddrive and put it into another machine that you can copy the files off

*buy the smallest, cheapest stack of CDs and burn copies of those.

*Variant on 2, buy a cheap stack of CD's, burn a very lightweight Linux distro (Knoppix works fine) on it, and transfer off via a USB stick (assuming you can actually boot to a CD, that is)

The alternatives involve buying curiously expensive cables (it's harder and harder to find a Parallel cable, let alone whether the laptop computer you want to transfer the files to actually has said connector) coupled with very slow transfers (would take more time than to walk down to any computer superstore/Office Supply store and get some CDs).  You didn't mention whether the Windows98 computer has "open" PCI slots for an ethernet card, so that route might be difficult (finding an ISA ethernet card isn't easy anymore).  Plus you would NOT want to connect that computer to the Internet in any way shape or form.
An external USB enclosure that supports IDE (most likely what the Windows 98 computer's harddrive is) are fairly inexpensive (in the US, approximately 20-50 dollars).  Though plugging it into any computer that can actually transfer via USB would be ideal.

A: I'd just get a USB<->IDE converter (see the review on cool tools).  You wouldn't even need to remove the drive from the case if the connectors fit in behind the drive. Just plug in the data cable between the laptop and the drive, plug in the power, ????, profit!

A: Since the computer runs Win98, it has probably not enough RAM to run a full-featured distro like Ubuntu/Linux from a LiveCD. Therefore, I recommend using a lighter Linux distribution like PartedMagic which uses 175 in "Live" mode. It supports USB, so you can plug in an external USB harddisk and copy the files. You should have patience though, Win98 computers do not (often) have USB2.0 ports.
The best alternative I can think of is removing the hard disk from the computer, and put it in a newer computer with better hardware. You might need an IDE to SATA cable as well. If you do not like opening your new computer, or wish to transfer data to the laptop directly, buy an IDE to USB cable.

A: The easiest and fastest solution would be to go to your local electronic store and buy a case of CDs, R or RW, whichever you prefer.
However, another way to transfer the files would be via the network, but you didn't specify if there was a NIC in the PC.
Yet another way would be to connect an old Zip drive and get the files off of the machine that way.
And finally, the last way I can think of would be to take the HD out and plug it into another computer that can write DVDs and then simply burn the DVDs, assuming you have a computer on hand with those capabilities.

A: This calls for kermit! if it worked on XTs then it should work now. Do you have a serial cable?
But seriously, you could have got a next-day delivery of CDRs by now. Before you move the drive to another PC make sure it has support for the drive. The old drive is probably IDE and most new PCs are sata only.

A: Buy (or make) a laplink cable
http://en.wikipedia.org/wiki/LapLink_cable
Higher bandwidth than a null modem cable.
You can find the software you'll need easily enough with a google search, and you can transfer it to the Win98 box with a floppy disk.
I have one I keep around just because I've ran into similar scenarios in the past.

A: Hyperterm file transfer with a null modem cable? Odds are good the old box has one and cheap USB ones can be used on the new laptop. Even for a CDROM of data it should complete overnight.
Or you could even do full PPP over the serial port to another PC running a pppd.

A: Find, buy or scrounge a PCI network card.

A: If you're looking for drivers for a USB flash drive for Win98 FE or SE, see this page for a generic USB Mass Storage Driver.
Right click on My Computer and select Properties
On the System Properties page that opens up click on the General tab, if it is not already on that page.
Under the System heading, look for the version number (see right)
* Version 4.10.1998 is the original version of Windows 98 (98FE)
* Version 4.10.2222 is Windows 98 Second Edition (98SE)

A: If you absolutely cannot take out the hard drive, and cannot use a USB flash drive, then you can use the parallel port on the system to transfer files.  However, speeds are going to be SLOW (I'm talking dial-up era speeds) so to be fully honest with you, take out the hard drive and transfer the files from there.
It will probably be even faster than anything else since 98 (to my knowledge) doesn't have USB 2.0 support and the processing power/memory usage for transferring files will slow it down as well.

A: If you have Internet access on the old machine, you could use something like DropBox which will let you upload and download, or "share", files & folders among multiple computers running different OSs. I'm not sure if their client software directly supports Win98, but even if it doesn't you can use its web-based interface to do almost all the same things (uploading and download shared files) -- I've done that with someone I know who has a Mac with an old unsupported version of OS X.
A free account comes with 2 GB of storage space -- and if that isn't enough you can transfer the files in batches.

A: Buy this, or equivalent.  Afterward, keep for future similar data retrieval.  As an IT tech, a device like this is well worth the investment.  The one I have, I have used 3 or 4 times in critical situations.  Never fails to provide the best solution for the type of problem you have.
http://www.frys.com/product/5357858


text:
Q: OSGI JAX-RS name binding Currently I'm working with clean kura-osgi project. My aim is to implement JWT authentication, or something similar to it, just to provide secure endpoints. I have tried Authentication filter using name-binding. However seem like, in someway name-binding is not getting registered. In this case I have tested simple maven project, and found out everything works there. There is code:
TestAuth.class
@Path("/test")
public class TestAuth extends Application {

    @GET
    @Secured
    @Produces(MediaType.TEXT_PLAIN)
    public String test() {
        return "hello";
    }
}

name binding interface:
@NameBinding
@Retention(RUNTIME)
@Target({TYPE, METHOD})
public @interface Secured {}

Filter:
@Provider
@PreMatching
@Secured
public class  AuthenticationFilter implements ContainerRequestFilter {

    public void filter(ContainerRequestContext containerRequestContext) throws IOException {
        System.out.println("GG");
    }
}

I have checked a lot of ways to fix it, for an example: this but this one seems not to work also.

A: After a lot of different solution approaches I have found simple solution. Simply by registering as component fixes problem. Filter class would look like this:
@Provider
@Component(service = ContainerRequestFilter.class)
@Secured
public class AuthenticationFilter implements ContainerRequestFilter, ContainerResponseFilter {

    private static final Logger LOG = LoggerFactory.getLogger(AuthenticationFilter.class);

    public void filter(ContainerRequestContext containerRequestContext) throws IOException {
        LOG.info("Request filter called");
    }

    public void filter(ContainerRequestContext containerRequestContext,
            ContainerResponseContext containerResponseContext) throws IOException {
        LOG.info("Response filter called");
    }
}

A: This is a little bit late, but I just stumble over this problem again...
The problem here is really the @PreMatching annotation, which effectively clashes with the @NameBinding annotation.
So if you want to use the @RolesXXX annotations you are forced to define your filter as @PreMatching loosing the NameBinding feature.


text:
Q: Kubernetes cannot cleanup Flannel First I start Kubernetes using Flannel with 10.244.0.0.
Then I reset all and restart with 10.84.0.0.
However, the interface flannel.1 still is 10.244.1.0
That's how I clean up:
kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /run/flannel
rm -rf /etc/cni/
ifconfig cni0 down
brctl delbr cni0
ifconfig flannel.1 down
systemctl start docker

Am I missing something in the reset?

A: Because your ip link have the old record
look by
ip link

you can see the record, and if you want to clean the record of old flannel and cni
please try
ip link delete cni0
ip link delete flannel.1

A: In the original commands:
brctl delbr cni0
# deletes the cni0 interface

But the ifconfig flannel.1 down did not remove the interface. Thus:
ip link delete flannel.1
# deletes the flannel.1 interface
# also, 'ip link delete cni0' was unnecessary since the brctl command deleted the link


text:
Q: iPod Shuffle first gen not mounting, Ubuntu 22.04 I have a 1st gen 1GB iPod shuffle (still working well to my surprise). It's the one looking like a Thumb Drive. It's formatted in FAT32 using MBR. Uder MacOS I see two mounted drives, one is like a standard USB drive where I can copy my music, the other device is to manage the iPod. I Use rebuild_db, a python script, to use it without iTunes or Apple Music. I just paste my mp3s in the file browser, launch the python script, and the iPod is ready to play.
Under Windows, I also see it as a USB drive and I can manage files like normal.
I can also see it's content when I plug it on my android phone.
On Ubuntu 20.04, 22.04 and 22.10 (three different PCs), I hear the USB-plug-in sound, but nothing is auto-mounted. If I open the Disk Utility (Palimpsest) I see the drive as unmounted and as un-formatted . It's impossible to mount the drive.
Is there a way I can mount and access the content of the iPod ?

A: I found out this is a known libgpod bug preventing the mounting of some iPob shuffle models.
https://bugs.launchpad.net/ubuntu/+source/libgpod/+bug/565971
un-installing libgpod is a workaround. If you don't use any other iPod it's a safe solution.


text:
Q: After doing a knn classification in R, how do you get a list of the predictions for each of the test cases? After running a knn classification in (R)[http://www.r-project.org/] is there a way to list the predictions that were made for each of the test cases?
I know how to get the confusion matrix, but I'd also like the detailed results of the test phase as opposed to just the summary.
Would I have to run each case back through the model, as if doing post model development predictions? Or is the information I need an output of the test phase?

A: I'm confused. That seems to be exactly what knn returns. Adapting the example from the help page for ?knn
library(class)
train <- rbind(iris3[1:25,,1], iris3[1:25,,2], iris3[1:25,,3])
test <- rbind(iris3[26:50,,1], iris3[26:50,,2], iris3[26:50,,3])
cl <- factor(c(rep("s",25), rep("c",25), rep("v",25)))
fit <- knn(train, test, cl, k = 3, prob=TRUE)

If i combine the results with the test data, i get
head(data.frame(test, pred=fit, prob=attr(fit, "prob")))

#   Sepal.L. Sepal.W. Petal.L. Petal.W. pred prob
# 1      5.0      3.0      1.6      0.2    s    1
# 2      5.0      3.4      1.6      0.4    s    1
# 3      5.2      3.5      1.5      0.2    s    1
# 4      5.2      3.4      1.4      0.2    s    1
# 5      4.7      3.2      1.6      0.2    s    1
# 6      4.8      3.1      1.6      0.2    s    1

so there's a prediction for each test row.


text:
Q: Creating fast plumbing quotes with lists of equipment in excel - then turning into a word doc or PDF I would like to create a series of events that happen - to correspond with a drop down list in excel. These would be for example
Within a header 'plant room' in Excel you select a size and type of hot water cylinder from a list.
When selected a list of components is populated elsewhere - probably on another tab.
The same is done with the basic elements of bathrooms, showers, and radiators (design will vary, but basic valves, taps etc will be the same).
On another tab would appear a summary of the cost to the customer, including 15% mark up on parts and labour, which is also recorded as part of the cost for that job.
Once all the basics are in there, we would be able to amend and change elements, this information would then be easily exported to a nicely designed word doc including information on warranties, terms and conditions, compliance etc
I know some of this would be achieved with macros, but I don't know what terms to search for and I'm very much an amateur.
Thanks

A: You've asked for where to start so I'll answer some of that. We can't create the entire file for you, but this may get you a little started and then you can come back with specific questions about one step of the process.

Within a header 'plant room' in Excel you select a size and type of
hot water cylinder from a list.

How to make a drop-down list. (If that link rots, you can find similar instructions with a web-search, I'm sure.) I'd recommend a single list that combines both size and type into a single list ("40 gallon Gas") as opposed to one list for size and another for type. This will be easier to work with.

When selected a list of components is populated elsewhere - probably
on another tab. The same is done with the basic elements of bathrooms,
showers, and radiators (design will vary, but basic valves, taps etc
will be the same).

Macros can indeed be used to make something happen when a certain cell is changed. Here is one example of how to make this happen. This code would live in the sheet object (as opposed to the workbook object or in a module) and is triggered whenever any cell changes but only does something interesting when cell A1 changes. Maybe search for "getting started in vba" or something. You could also do this all with formulas by having all your pricing data in a big table and using FILTER() or something.
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        ' Go do macros things because that special cell was changed
    End If
End Sub

You may want to consider having the user populate a whole list of things they want to price out and then pushing a button for the macro to run through that list and add the components / labor for each in a row. I would probably have that macro clear the list as it blows out each item to prevent the user from clicking the button twice by accident and adding everything again.

On another tab would appear a summary of the cost to the customer,
including 15% mark up on parts and labour, which is also recorded as
part of the cost for that job.

You could probably do this with formulas if you were consistent in how you setup your data on the tab the macro changes. You could also bake this into the macro itself, if you prefer.

Once all the basics are in there, we would be able to amend and change
elements, this information would then be easily exported to a nicely
designed word doc including information on warranties, terms and
conditions, compliance etc

Word has its own VBA objects, methods, etc. That's a big question. Here's the first hit from my basic web search. Conceptually, I'd say you could start with a word file that has a nice header, your warranties, and anything else you like. Include a placeholder for each bit of data you want to copy from Excel. For instance, it could have the literal text [TOTAL COST]. The VBA in Excel would copy that file, open it for editing, and then find / replace the placeholder text with the value from the Excel file. This is just one idea.

Work on each piece one at a time. If you get stuck on a particular step, try to find your own solution, first. If you can't figure it out and can't figure out why you can't figure it out, come back and ask a


text:
Q: how do you add a named range to worksheet using php pear spreadsheet excel writer Is it posible using Excel_spreadsheet_writer to create a name such as
$workbook  = new Spreadsheet_Excel_Writer();
$worksheet = &$workbook->addWorksheet('CheckNames');

$worksheet->writeName(0, 0, 'AnswerToEverythig', '42');

$worksheet->write(0, 1, 'Double =');

$worksheet->writeFormula(0, 2, '=AnswerToEverythig * 2');

$workbook->send('CheckNames.xls');
$workbook->close();

and dispay 84 in cell C1
As recommended by cypher I've tried PHPExcel but now get Internal Server Error on the following
$prices_sheet->setCellValueByColumnAndRow(4, $row, '=IF(Round_Up=0,  (C'.$row.'+D'.$row.'),  0.01  )');

changing the formula to
'=IF(0=0,  (C'.$row.'+D'.$row.'),  0.01  )'

stops the error.
Therefore PHPExcel has problems resolving formulas using named ranges.
Found This
http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=209472

A: I'm not sure how about SpreadSheetExcelWriter, but it certainly can be done with PHPExcel. I've been using PHPExcel for a long time and I can only recommend it.


text:
Q: How to prevent specifying the versions of sibling modules in maven-assembly-plugin? The simplified setup of my project is as follows:
root
|--parent
   |--service-1
   |--service-2
   |--service-aggregator
I need to assemble the 'service-1' & 'service-2' modules in 'service-aggregator'. I am using maven-assembly-plugin for the same and it works fine, however I foresee a maintenance issue wherein whenever the version of either of service-1 or service-2 will change, I will need to update the service-aggregator pom.xml also.
Hence, I am looking for a way to prevent writing the version of the service-1 / -2 in the service-aggregator pom.xml i.e. I just need service-aggregator to simply pick the latest version of service-1 / -2.
I have gone through the examples provided in maven-assembly-plugin documentation but those contain the version being mentioned in the assembly module (service-aggregator in my example).
Please let me know if any detail is missing & I will add it.
Here is the key contents of service-aggregator pom.xml:

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>com.company.project</groupId>
    <artifactId>parent</artifactId>
    <version>0.0.1</version>
</parent>
<groupId>com.company.project.parent</groupId>
<artifactId>service-aggregator</artifactId>

<name>service-aggregator</name>
<dependencies>
    <dependency>
        <groupId>com.company.project.parent</groupId>
        <artifactId>service-1</artifactId>
        <version>0.0.1</version> <!-- this is the line troubling me -->
    </dependency>
    <dependency>
        <groupId>com.company.project.parent</groupId>
        <artifactId>service-2</artifactId>
        <version>0.0.1</version> <!-- this is the line troubling me -->
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <skipAssembly>${skip.assembly}</skipAssembly>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<properties>
    <skip.assembly>false</skip.assembly>
</properties>

A: The best thing is to use properties like this:
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>com.company.project</groupId>
    <artifactId>parent</artifactId>
    <version>0.0.1</version>
</parent>
<groupId>com.company.project.parent</groupId>
<artifactId>service-aggregator</artifactId>

<name>service-aggregator</name>
<dependencies>
    <dependency>
        <groupId>com.company.project.parent</groupId>
        <artifactId>service-1</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>com.company.project.parent</groupId>
        <artifactId>service-2</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <skipAssembly>${skip.assembly}</skipAssembly>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


text:
Q: Refer to the value of switch statement in a branch Is there a way in Swift to refer to the value I am switching on in a branch? For example:
switch UIDevice.current.userInterfaceIdiom {
  // cases
  default:
    fatalError("User interface idiom \(value) is not supported")
}

I am thinking about something similar to the implicit error reference inside catch block:
do {
  // ...
} catch {
  print(error) // 'error' is defined implicitly
}

Of course, I can create a variable myself, but I'd like to avoid that.

A: There is no built-in variable, but you can easily capture the value yourself with the case let pattern:
switch UIDevice.current.userInterfaceIdiom {
  // cases
case let value:
    fatalError("User interface idiom \(value) is not supported")
}

Note: This will match anything, so it replaces the default case and it should be the last case in your switch.

You can use a where clause to allow the capture of values other than everything:
switch 1 + 2 * 3 {
case let value where 0...9 ~= value:
    print("The value \(value) is a single digit value")
case let value:
    print("\(value) is not a single digit value.")
}

but it would be easier in that case just to assign the value to the variable before the switch.


text:
Q: How to iterate through a collection of maps of different kinds using range based 'for' loops? I can iterate through a map as follows:
std::map<int, std::string> intMap = { {1, "one"}, {2, "two"}, {3, "three"} };

for (const auto &[k, v]: intMap)
{
    doSomething(k, v);
}

I have another map (of different type and size) defined as follows:
std::map<float, std::string> floatMap = { {1.0, "one"}, {2.0, "two"}};

I want to do the same thing for this map as well (doSomething(k, v) is templated)
for (const auto &[k, v]: floatMap)
{
    doSomething(k, v);
}

Is there a way where I can do this for both the maps by iterating through the collection of maps?
Something like:
for (const auto &map: {intMap, floatMap})
{
    for (const auto &[k, v]: map)
    {
        doSomething(k, v);
    }
}

This however gives the error:

cannot deduce type of range in range-based 'for' loop

What's the cleanest way (> C++17) to iterate through a collection of maps (of different kinds) using range-based 'for' loops?
Thanks!

A: You can use fold expression to expand immediately invoked lambda to do this:
[](const auto&... maps) {
  ([&] {
    for (const auto& [k, v] : maps)
      doSomething(k, v);
   }(), ...);
}(intMap, floatMap);

Demo.


text:
Q: React, Losing styles after array.map() I have a array of objects.
In my React Component, i have a block of html code:

Benched

            Comedy

          7.1

If i paste him manualy - All Works Great, but if i use Array.map, styles are losing (Card size is wrong).
  const elements = content.map((content, index) => {
    return (

Benched

              Comedy

            7.1

    );
  });

How I can fix that?

A: I took your card html markup for item div and ran it in jsFiddle to see if card sizes change. It worked normally. Check the code here.

function CardList() {
  var content = [
   { id: 1, name: 'card 1' },
    { id: 2, name: 'card 2' },
    { id: 3, name: 'card 3' },
  ];

  return (

      {content.map((item, index) => (

                {item.name}

Benched

                Comedy

              7.1

      ))}

  );
}

ReactDOM.render(<CardList />, document.querySelector("#app"));
.wrapper {
  display: flex;
}

.item {
  margin: 1rem;
}

.card {
  padding: .5rem;
  background-color: #21D4FD;
}

.card.card--big {
  padding: 2rem;
}

A: The problem is coming from the parent element before .item class. you need to correctly style whatever the parent element is. for instance, if the parent div className is .wrapper you can style it to a 100vh then style the item height in percentage like 80% for instance. this will force the item height to be uniform. you can also use display: flex on the parent element if the width is the problem.


text:
Q: Add element span without changing the position of existing centered elements this is my first topic here, I've already tried some solutions for my scenario but withou success, so I think I could use some help:
I'm working in a existing html page and I'm intern, so I need to change without modifying anything else (or at least the minimum).
So here's my problem:
<form action="">

  <input type="text" id="example3" name="fname" value="John">

  <input type="text" id="example2" name="lname" value="Doe">

  <input type="text" id="example2" name="lname" value="Example">myText

  <input type="submit" value="Submit">

</form>

In the code above the elements are showed centered.
I want to add some text, like "myText" of span tag, when I click the button in the right side of an input element , but when I try to do this, the input element loses the "align" of others inputs (it comes left). So how can I add this "span text" but keep the input elements aligned?

*

*I need to avoid changing the others elements css.

Im attaching an example code.

<!DOCTYPE html>

Example

<form action="">

  <input type="text" id="example3" name="fname" value="John">

  <input type="text" id="example2" name="lname" value="Doe">

  <input type="text" id="example2" name="lname" value="Example">!!!

  <button id="button">Show element</button>
  <input type="submit" value="Submit">

</form>

A: So you basically want to add myText next to the value of the input?
Like in your example, it would become "Example !!!" in the input box.
In that case just use javascript. Get the current input value and append myText to it.
$(document).ready(function() {
       $("#button").click(function(){
        let myText = '!!!'
        let currentValue = $("#example2").val();
        $("#example2").val(currentValue + ' ' + myText)
        return false;
    })
   });

// EDIT (I understand more clearly what you want after your comment)
You could play around with position: relative and position: absolute in your css.
  .example-class{
        position:relative;  // add this
         width: 400px;
        height:300px;
        padding:5%;
  }

.myText{
  display:none;
  position:absolute; // add this
  right: 80px; // play with this one.
}

Normally that should do the trick.

A: Set position absolute to your span

$(document).ready(function() {
  $("#button").click(function() {
    $("#myText").show();
    return false;
  })
});
input {
  width: 92%;
  text-align: center;
  align: left;
  align-items: start;
}

.example-class {
  width: 400px;
  height: 300px;
  padding: 5%;
}

.myText {
  display: none;
  position: absolute; /*<-- the change */
}

Example

<form action="">

      <input type="text" id="example3" name="fname" value="John">

      <input type="text" id="example2" name="lname" value="Doe">

      <input type="text" id="example2" name="lname" value="Example">!!!

      <button id="button">Show element</button>
      <input type="submit" value="Submit">

</form>


text:
Q: Why doesn't Prolog find a solution for 'Fox, goose and bag of beans puzzle' and shows 'true' instead? I wanted to solve the "Fox, goose and bag of beans puzzle" with Prolog as an exercise.
So I wrote
p(left).
p(right).
valid((Man, Goose, Fox, Beans)) :- p(Man),p(Goose),p(Fox),p(Beans), Man == Goose.
valid((Man, Goose, Fox, Beans)) :- p(Man),p(Goose),p(Fox),p(Beans), Man == Beans, Goose \= Fox.
valid((Man, Goose, Fox, Beans)) :- p(Man),p(Goose),p(Fox),p(Beans), Man == Fox, Goose \= Beans.

step((Man1, Goose, Fox, Beans), "Man", (Man2, Goose, Fox, Beans)) :-
    valid((Man1, Goose, Fox, Beans)), valid((Man2, Goose, Fox, Beans)),
    Man1 \= Man2.

step((Man1, Goose1, Fox, Beans), "Goose", (Man2, Goose2, Fox, Beans)) :-
    valid((Man1, Goose1, Fox, Beans)), valid((Man2, Goose2, Fox, Beans)),
    Man1 \= Man2, Goose1 \= Goose2.

step((Man1, Goose, Fox1, Beans), "Fox", (Man2, Goose, Fox2, Beans)) :-
    valid((Man1, Goose, Fox1, Beans)), valid((Man2, Goose, Fox2, Beans)),
    Man1 \= Man2, Fox1 \= Fox2.

step((Man1, Goose, Fox, Beans1), "Beans", (Man2, Goose, Fox, Beans1)) :-
    valid((Man1, Goose, Fox, Beans1)), valid((Man2, Goose, Fox, Beans2)),
    Man1 \= Man2, Beans1 \= Beans2.

reachable(S, _,[], S).
reachable(S, Visited, [Step|Steps], Z) :-
    step(S,Step,Tmp),valid(Tmp), not(member(Tmp,Visited)),
    reachable(Tmp, [Tmp|Visited], Steps, Z).

start((left,left,left,left)).
goal((right,right,right,right)).

solve(Steps) :- start(S), goal(Z), reachable(S, [], Steps, Z).

Question
I thought with solve(X). I would get a sequence of valid steps. But instead, I get
?- solve(X).
false.

Why don't I get a list of steps that go from start to goal?
Code explained
valid checks for a 4-tuple, where the first element is the position of "Man", the second is the position of "Goose", the third is the position of "Beans" if nobody gets eaten.
step(Situation1, Description, Situation2) makes a step from a valid situaiton to another valid situation.
reachable(Start, SituationList, Steps, Goal) checks if the situation Goal can be reached from the situation Goal while every situation in SituationList gets visited exactly once and Steps is a description what steps were taken in which order.

A: The primary issue causing the failure is a typo:
step((Man1, Goose, Fox, Beans1), "Beans", (Man2, Goose, Fox, Beans1)) :-

Should be:
step((Man1, Goose, Fox, Beans1), 'Beans', (Man2, Goose, Fox, Beans2)) :-

This will generate correct solutions. There are a few other clean up points:

*

*You are using double quotes on strings, which in Prolog, is actually a sequence of ASCII codes (prolog List). If you want a string displayed as just a string, you would use Prolog atoms which are enclosed in single quotes. So, for example, 'Man' instead of "Man".

*The goal of valid(Tmp) in your reachable/2 clause is superfluous since the prior goal of step ensures that Tmp will be valid according to the valid rule.

*In this specific application, the first of two valid goals in each step/3 clause isn't necessary since your first argument comes from a previously validated step. (It depends upon how "general" you want step/3 to behave).

Beyond that, the solve/1 still produces many duplicate results, but they are all correct and all the correct solutions are discovered.


text:
Q: Password recovery in laravel I am facing the following problem with the password reset, I did all the correct configuration and I am the Postmark to reset the password, and locally everything works fine, the problem and when it goes up to the server and the following error appears:
Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into `password_resets` (`email`, `token`, `created_at`) values (dev@gemail.com, $2y$10$0KSaAg13p5yWwEJTrKiFAeraitpjGgRV/GLbe3t2kW9qt7Nt5sajW, 2020-05-25 15:48:22)) in file /var/www/api.aqbank.com.br/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

Controller
    class ForgotPasswordController extends Controller
    {
    use SendsPasswordResetEmails;

    protected function sendResetLinkResponse(Request $request, $response)
    {
        return response (['message'=>$response]);
    }

    protected function sendResetLinkFailedResponse(Request $request, $response)
    {
        return response(['error'=>$response], 422);
    }

}

Do you know how to tell me where I might be missing?

A: Seems as if your password_resets has an 'id' column.  That table normally does not use an id column.  Remove it and give it a try.


text:
Q: C# NullReference yet Visual Studio shows object is not null When I press the stop button on the form in my example code, the driver.Quit() call throws a NullReference exception, but when I hover over the object in the IDE when it breaks on the exception, the object is not null.
Furthermore, driver.Quit() is called within a null check condition.
public partial class ProxyScraperForm : Form
{

    private BindingList<IProxyScraperSite> sites = new BindingList<IProxyScraperSite>();
    private List<IWebDriver> activeDrivers = new List<IWebDriver>();

    public BindingList<IProxyScraperSite> Sites { get { return this.sites; } }

    public ProxyScraperForm()
    {
        InitializeComponent();

        sites.Add(new ProxyScraperSiteUsProxyOrg());
        sites.Add(new ProxyScraperSiteFreeProxyListNet());
        sites.Add(new ProxyScraperSiteFreeProxyListsNet());
        sites.Add(new ProxyScraperSiteHideMyName());
        sites.Add(new ProxyScraperSiteHidester());
        scraperDataGridView.DataSource = sites;
    }

    private void scrapeButton_Click(object sender, EventArgs e)
    {
        foreach (var site in sites)
        {
            Task.Run(async () =>
            {
                var driver = SeleniumUtility.CreateDefaultFirefoxDriver();
                activeDrivers.Add(driver);
                await site.ScrapeAsync(driver);
                driver.Quit();
                activeDrivers.Remove(driver);
            });
        }
    }

    private void stopButton_Click(object sender, EventArgs e)
    {
        foreach (var driver in activeDrivers)
        {
            if (driver != null)
            {
                driver.Quit();
            }
        }

        activeDrivers.Clear();

        foreach (var site in sites)
        {
            site.Status = "Idle";
        }
    }

    private void proxyScraperForm_FormClosing(object sender, FormClosingEventArgs e)
    {
        stopButton.PerformClick();
        this.DialogResult = DialogResult.Cancel;
    }
}

Inside site.ScrapeAsync
public class ProxyScraperSiteHideMyName : ProxyScraperSiteBase
{
    public ProxyScraperSiteHideMyName() { SiteName = "HideMyName"; }

    public override Task ScrapeAsync(IWebDriver driver, PauseOrCancelToken pct = null)
    {
        return Task.Run(async () =>
        {
            try
            {
                Status = "Starting";
                driver.Navigate().GoToUrl("https://hidemy.name/en/proxy-list/");
                var wait = new WebDriverWait(driver, new TimeSpan(0, 0, 30));
                var lastPageLinkElement = wait.Until(extras.ExpectedConditions.ElementIsVisible((By.XPath("/html/body/div[1]/div/section[1]/div/div[4]/ul/li[10]/a"))));
                var totalPages = Int32.Parse(lastPageLinkElement.Text);
                for (int i = 0; i < totalPages; i++)
                {
                    Status = $"Scraping page {i + 1} of {totalPages}";
                    var mc = Regex.Matches(driver.PageSource, RegexUtility.IPv4AndPortWithSeperatorRegexString);
                    foreach (Match m in mc)
                    {
                        try
                        {
                            var proxy = new Proxy(m.Groups[1].Value + m.Groups[2].Value);
                            OnProxyScraped(proxy);
                        }
                        catch (Exception ex)
                        {
                            System.Diagnostics.Debug.WriteLine(ex); ;
                        }
                    }

                    if (pct != null) { await pct.PauseOrCancelIfRequested(); }

                    if (i < totalPages - 1)
                    {
                        var nextButton = wait.Until(extras.ExpectedConditions.ElementToBeClickable(By.XPath("//li[@class='arrow__right']/a")));
                        nextButton.Click();
                    }
                }
                Status = "Completed!";
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        });
    }
}

Stack trace.
at OpenQA.Selenium.DriverService.Stop()
at OpenQA.Selenium.DriverService.Dispose(Boolean disposing)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Dispose(Boolean disposing)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.Dispose(Boolean disposing)
at OpenQA.Selenium.Remote.RemoteWebDriver.Quit()
at HelperLib.ProxyLib.Scraping.ProxyScraperForm.stopButton_Click(Object sender, EventArgs e) in C:\Users\david\source\repos\HelperLib\HelperLib\ProxyLib\Scraping\ProxyScraperForm.cs:line 55
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at HelperLib.ProxyLib.Testing.proxyTesterView.AddFromScraperToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\david\source\repos\HelperLib\HelperLib\ProxyLib\Testing\ProxyTesterView.cs:line 127
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at TestingApp.Program.Main() in C:\Users\david\source\repos\TestingApp\TestingApp\Program.cs:line 19

A: Here is my selenium testing code, and hope it can help you
var tasks = new List<Task>
        {
            new Task(PickUserFirefox)
        };

        tasks.ForEach(
            task => task.Start()
        );
        Task.WaitAll(tasks.ToArray());
    }

    private static void PickUserFirefox()
    {
        FirefoxTesting(StaticRandom.Instance.Next(1000,9999), "abcd");
    }

  private static void FirefoxTesting(int id, string fileIds)
    {
        System.Environment.SetEnvironmentVariable("webdriver.gecko.driver", @"D:\Work\Testing\SelenimDriver\geckodriver.exe");
        IWebDriver driver = new FirefoxDriver();
        driver.Navigate().GoToUrl(URL + id + "/" + fileIds);
        Thread.Sleep(1000);
         try
        {
            //Do something here
        }
        catch (Exception e)
        {
            //Error handle here
        }
        Thread.Sleep(1000);
        IWebElement btn = driver.FindElement(By.Id("btnSubmit"));
        btn.Click();
        Thread.Sleep(1000);
        //driver.Close();
        driver.Quit();
    }

A: Solved by using a ConcurrentDictionary and wrapping driver.Quit() calls in lock statements.
public partial class ProxyScraperForm : Form
{

    private BindingList<IProxyScraperSite> sites = new BindingList<IProxyScraperSite>();
    private ConcurrentDictionary<string, FirefoxDriver> activeDrivers = new ConcurrentDictionary<string, FirefoxDriver>();
    private object lockObj = new object();

    public BindingList<IProxyScraperSite> Sites { get { return this.sites; } }

    public ProxyScraperForm()
    {
        InitializeComponent();

        sites.Add(new ProxyScraperSiteUsProxyOrg());
        sites.Add(new ProxyScraperSiteFreeProxyListNet());
        sites.Add(new ProxyScraperSiteFreeProxyListsNet());
        sites.Add(new ProxyScraperSiteHideMyName());
        sites.Add(new ProxyScraperSiteHidester());
        scraperDataGridView.DataSource = sites;
    }

    private void scrapeButton_Click(object sender, EventArgs e)
    {
        foreach (var site in sites)
        {
            Task.Run(async () =>
            {
                var driver = SeleniumUtility.CreateDefaultFirefoxDriver();
                activeDrivers.TryAdd(site.SiteName, driver);
                await site.ScrapeAsync(driver);
                lock (lockObj)
                {
                    driver.Quit();
                }
                activeDrivers.TryRemove(site.SiteName, out driver);
            });
        }
    }

    private void stopButton_Click(object sender, EventArgs e)
    {
        foreach (var driver in activeDrivers)
        {
            lock (lockObj)
            {
                driver.Value.Quit();
            }
        }

        activeDrivers.Clear();

        foreach (var site in sites)
        {
            site.Status = "Idle";
        }
    }

    private void proxyScraperForm_FormClosing(object sender, FormClosingEventArgs e)
    {
        stopButton.PerformClick();
        this.DialogResult = DialogResult.Cancel;
    }
}


text:
Q: Advance grouping and reshaping transformation using pandas I have a pandas dataframe like this.
Territory_id    client_id   patient_id  Total Clinic    Clinic Number   Attribute.2         Value
    43              172         6021        1               Clinic 1    Service Date      06/22/2017
    43              172         6021        1               Clinic 1    Product              A
    43              172         6021        1               Clinic 1    Qty                  1
    43              172         6021        1               Clinic 1    Amount              80.63
    43              172         6021        1               Clinic 1    Age                11 y 4 m
    43              172         6021        1               Clinic 1    Days Last Clinic    0
    43              172         6137        1               Clinic 1    Service Date      06/22/2017
    43              172         6137        1               Clinic 1    Product              B
    43              172         6137        1               Clinic 1    Qty                  1
    43              172         6137        1               Clinic 1    Amount              80.63
    43              172         6137        1               Clinic 1    Age                  7 y
    43              172         6137        1               Clinic 1    Days Last Clinic     0
    43              187         5658        5               Clinic 1    Service Date      06/07/2017
    43              187         5658        5               Clinic 1    Product               C
    43              187         5658        5               Clinic 1    Qty                   1
    43              187         5658        5               Clinic 1    Amount                0
    43              187         5658        5               Clinic 1    Age                9 y 1 m
    43              187         5658        5               Clinic 1    Days Last Clinic     0
    43              187         5658        5               Clinic 2    Service Date        06/30/2017
    43              187         5658        5               Clinic 2    Product               D
    43              187         5658        5               Clinic 2    Qty                   2
    43              187         5658        5               Clinic 2    Amount              52.48
    43              187         5658        5               Clinic 2    Age                 9 y 1 m
    43              187         5658        5               Clinic 2    Days Last Clinic    23
    43              187         5658        5               Clinic 3    Service Date       09/12/2017
    43              187         5658        5               Clinic 3    Product               E
    43              187         5658        5               Clinic 3    Qty                   3
    43              187         5658        5               Clinic 3    Amount              78.72
    43              187         5658        5               Clinic 3    Age                9 y 4 m
    43              187         5658        5               Clinic 3    Days Last Clinic    74
    43              187         5658        5               Clinic 4    Service Date       09/05/2018
    43              187         5658        5               Clinic 4    Product               F
    43              187         5658        5               Clinic 4    Qty                   2
    43              187         5658        5               Clinic 4    Amount              53.72
    43              187         5658        5               Clinic 4    Age                 10 y 4 m
    43              187         5658        5               Clinic 4    Days Last Clinic     358

I want the results to be reshaped by Attribute.2 column names. There are 6 attributes Service Datea, Product, Qty, Amount, Age, Day Last Clinic. I want these columns should be moved to 1 row and other column values should be picked up with the last one or first one both are the same.

I tried this using pivot table but its only returns the first records with this.
df.pivot_table(index=['Territory_id','client_id','patient_id','Total Clinic','Clinic Number'],
              columns='Attribute.2',
              values='Value',
              aggfunc='first'
              )

Need help.
Thanks

A: Try reset_index at the end:
df.pivot_table(index=['Territory_id','client_id','patient_id','Total Clinic','Clinic Number'],
              columns='Attribute.2',
              values='Value',
              aggfunc='first'
              ).reset_index()

Output:
Attribute.2  Territory_id  client_id  patient_id  Total Clinic Clinic Number       Age Amount Days Last Clinic Product Qty Service Date
0                      43        172        6021             1      Clinic 1  11 y 4 m  80.63                0       A   1   06/22/2017
1                      43        172        6137             1      Clinic 1       7 y  80.63                0       B   1   06/22/2017
2                      43        187        5658             5      Clinic 1   9 y 1 m      0                0       C   1   06/07/2017
3                      43        187        5658             5      Clinic 2   9 y 1 m  52.48               23       D   2   06/30/2017
4                      43        187        5658             5      Clinic 3   9 y 4 m  78.72               74       E   3   09/12/2017
5                      43        187        5658             5      Clinic 4  10 y 4 m  53.72              358       F   2   09/05/2018


text:
Q: Using Gatsby `createResolvers` to set default image if GraphQL returns null? I'm working on a gatsby site using gatsby-source-wordpress to source posts for the blog. However, if any of the WordPress posts do not include a featured image this causes the build to fail. I understand that this is expected behavior.
Here is the build error I am seeing:
  29 |           {posts.map(({ node: post }, index) => (
  30 |

> 31 |
     |                                               ^
  32 |

  33 |                 <Link to={`/insights/${post.slug}`}>
  34 |                   {post.title}

  WebpackError: TypeError: Cannot read property 'localFile' of null

This is caused by the resulting query, which is returning a null result in the second node because there is no featured image on the post:
{
  "data": {
    "allWordpressPost": {
      "edges": [
        {
          "node": {
            "id": "28ec9054-5b05-5f94-adcb-dcbfc14659b1",
            "featured_media": {
              "id": "f12d613b-e544-560b-a86f-cd0a7f87801e",
              "localFile": {
                "id": "7fca2893-ff80-5270-9765-d17d3dc21ac2",
                "url": "https://www.mycustomdomain.com/wp-content/uploads/2020/01/some-featured-image.jpg"
              }
            }
          }
        },
        {
          "node": {
            "id": "91a236ed-39d5-5efc-8bed-290d8344b660",
            "featured_media": null
          }
        }
      ]
    }
  }
}

How I would like to fix:
As an ideal solution, I would like to use schema customization to set a default image if there is no featured image in WordPress. But I am at a total loss how to correctly do so. I am working from this documentation to guide me, but I'm just not getting my head wrapped around it properly.
A similar working example:
Tag data is similar to featured images in that the query returns null if the post has no tags. However I am able to set a default undefined tag using createResolvers like so:
exports.createResolvers = ({ createResolvers }) => {
  const resolvers = {
    wordpress__POST: {
      tags: {
        resolve(source, args, context, info) {
          const { tags } = source
          if (tags === null || (Array.isArray(tags) && !tags.length)) {
            return [
              {
                id: 'undefined',
                name: 'undefined',
                slug: 'undefined',
              }
            ]
          } else {
            return info.originalResolver(source, args, context, info)
          }
        },
      },
    },
  }
  createResolvers(resolvers)
}

And this works as shown in the following query results:
{
  "data": {
    "allWordpressPost": {
      "edges": [
        {
          "node": {
            "id": "28ec9054-5b05-5f94-adcb-dcbfc14659b1",
            "tags": [
              {
                "id": "undefined"
              }
            ]
          }
        },
        {
          "node": {
            "id": "91a236ed-39d5-5efc-8bed-290d8344b660",
            "tags": [
              {
                "id": "50449e18-bef7-566a-a3eb-9f7990084afb"
              },
              {
                "id": "8635ff58-2997-510a-9eea-fe2b88f30781"
              },
              {
                "id": "97029bee-4dec-5198-95af-8464393f71e3"
              }
            ]
          }
        }
      ]
    }
  }
}

What I tried for images (isn't working...)
When it comes to nested nodes and image files I'm at a total loss. I am heading in the following direction based on this article and this code example, but so far it isn't working:
exports.createResolvers = ({
  actions,
  cache,
  createNodeId,
  createResolvers,
  store,
  reporter,
}) => {
  const { createNode } = actions
  const resolvers = {
    wordpress__POST: {
      featured_media: {
        type: `File`,
        resolve(source, args, context, info) {
          return createRemoteFileNode({
            url: 'https://www.mycustomdomain.com/wp-content/uploads/2017/05/placeholder.png',
            store,
            cache,
            createNode,
            createNodeId,
            reporter,
          })
        },
      },
    },
  }
  createResolvers(resolvers)
}

I realize the above code does not have an if else statement, so the expectation is that all featured images would be replaced by the placeholder image. However the resulting GraphQL query is unaffected (as shown at top).
Can anyone point me in the right direction here? I can't seem to wrap my head around what information I can find out there.

A:
WebpackError: TypeError: Cannot read property 'localFile' of null

'localFile' of null means that nulled is a parent of localfile - featured_media ... you can see that in results:

"featured_media": null

... so you're trying to fix localfile while you should work on featured_media level
why?
You can easily render conditionally [in react] what you need (placeholde, component) on nulled nodes ... why at all you're trying to fix graphql response?


text:
Q: How to change the precision of ticks in julia plot I'm plotting in julia for the first time and have installed the Juno IDE. I'm plotting with Plots.jl and every time I plot, the y-axis tics have lots of decimals.
I've tried multiple backends, like GR, Plotly, PlotlyJS, but none have changed the behavior I'm seeing.
This is the code I have currently producing my results:
    using Plots
    gr()
    x = 1:10; y = rand(10)
    p = plot(x,y)

And the figure that's output:
https://github.com/bojohnson02/Random/blob/master/fig.pdf

A: That's a temporary bug caused by some changes to Showoff, the package that Plots uses to create the axis ticks. It should be fixed already, so updating your packages should work (]up). If it doesn't work yet, and you're in a hurry, installing master of the two packages should do the trick (] add Plots#master followed by ] add Showoff#master).


text:
Q: Loading Packages issues Continued LoadLibrary failure: The specified module could not be found I have previously posted about an issue I have in R in which I can't load any packages and I have fatal errors. I have tried installing r multiple times to no avail. You can see the previous post here. R installation won't let me open packages library issue
When I have tried restarting R-studios or terminating the session. It fails to terminate and I receive this error I was wondering if anyone could shed some light on this issue and what is going on.
During startup - Warning message:
package 'stats' in options("defaultPackages") was not found
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The specified module could not be found.

A: Did you just install Rtools?
Try these instructions: https://cran.r-project.org/bin/windows/Rtools/
P.S., the PATH is not the PATH to the file location and should look as:
writeLines('PATH="${RTOOLS40_HOME}/usr/bin;${PATH}"', con = "~/.Renviron")


text:
Q: Android managing items on AlertDialog I have this situation.
On my layout I have 3 buttons and one radiogroup with two radiobuttons.
The user must press button1, button2, pick one of the radiobuttons and after that, it will press button3 and a query to a database will be performed.
After pressing button1, a query will be performed and the result will be shown on an MultipleChoiceItems AlertDialog.
I have some questions.
MultipleChoiceItems
I have three problems with this AlertDialog.
First:
The query result is shown on my AlertDialog but if I press any of the items no checkmark is placed on the checkbox. I can see in my toast message that the items is being checked.
Second:
The query is perform to the database but can I add one element that is not returned by the query?
Imagine the AlertDialog, after the query, shows One,Two,Three. I want to add one more item. Something like This was not returned by the query,One,Two,Three.
Third:
public AlertDialog.Builder setMultiChoiceItems (Cursor cursor, String isCheckedColumn, String labelColumn, DialogInterface.OnMultiChoiceClickListener listener) second parameter is to set the items checked or unchecked. My database does not have this column so I've passed one column that I know it is always different than zero. Is there a way to bypass this?
This is my code:
public class MyClass extends ListActivity implements OnClickListener, OnCheckedChangeListener {
    Database db = new Database(this);
    int order;
    boolean groupCheck = false;
    boolean orderCheck = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.n);

        Button proc = (Button) findViewById(R.id.procButtonProc);
        proc.setOnClickListener(this);
        Button pickGroup = (Button) findViewById(R.id.procButtonGroup);
        pickGroup.setOnClickListener(this);
        RadioGroup pickOrder = (RadioGroup) findViewById(R.id.procRadioOrder);
        pickOrder.setOnCheckedChangeListener(this);
    }

    @Override
    public void onClick(View v) {

        if (v.getId() == R.id.procButtonGroup) {

            db.open();
            final Cursor query = db.getData(0, 0, null);
            AlertDialog.Builder pickGroup = new AlertDialog.Builder(this);
            pickGroup.setTitle(getString(R.string.procGroupTitle));

            pickGroup.setMultiChoiceItems(query, "GROUP_NAME", "GROUP_NAME", new DialogInterface.OnMultiChoiceClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which, boolean isChecked) {
                    // TODO Auto-generated method stub

                    if (isChecked) {
                        query.moveToPosition(which);
                        String str = query.getString(1).toString();
                        Toast.makeText(MyClass.this, "You have selected " + str, Toast.LENGTH_LONG).show();
                        // ListView list = ((AlertDialog) dialog).getListView();
                        // list.setItemChecked(which, true);

                    }
                }
            });

            pickGroup.setPositiveButton("OK", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                }
            });

            pickGroup.show();
            db.close();

        }

        if (v.getId() == R.id.procButtonProc) {

            if (orderCheck == true && groupCheck == true) {
                // Based on the conditions, perform query on the database

            } else {
                Toast.makeText(getApplicationContext(), "Select GROUP, N and ORDER", Toast.LENGTH_SHORT).show();
            }
        }
    }

    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
        // TODO Auto-generated method stub
        switch (checkedId) {
            case R.id.procOrderASC:
                order = 0;
                orderCheck = true;
                break;
            case R.id.procOrderDSC:
                order = 1;
                orderCheck = true;
                break;
        }
    }
}

Thanks,
favolas