text:
Q: Laravel setting vhosts on XAMPP for pretty urls (routing issue) I use XAMPP localhost server and I recently got into possession of a introductory book regarding Laravel. I'd like to configure it propery but I stumbled upon a rock.
I don't know much about routing, but I enabled mod_rewrite, and included opt/lampp/etc/extra/httpd-vhosts.conf in /opt/lampp/etc/httpd.conf using the setting that Dayle Rees recommends, that is:
<VirtualHost *:80>
    ServerName my_project
    DocumentRoot /opt/lampp/htdocs/my_project/public
    CustomLog /opt/lampp/htdocs/my_project/app/storage/logs/access.log common
    ErrorLog /opt/lampp/htdocs/my_project/app/storage/logs/error.log
    <Directory /opt/lampp/htdocs/my_project/public>
     <IfModule mod_rewrite.c>
      Options -MultiViews
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
     </IfModule>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot opt/lampp/htdocs/choqlet/
    ServerName choqlet
    ServerAlias localhost/choqlet
</VirtualHost>

After i've done this, due to the rerouting, I do have an access to the laravel files, but when I want to access my other projects on the localhost, I constantly get redirected to the Laravel's index. Here's the .htaccess file contents from laravel's public folder:
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
       Options -MultiViews
    </IfModule>

    RewriteEngine On

     Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

     Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I guess that I'm doing something totally wrong here or Rewrite rules are just screwed?


text:
Q: npm (version 5.5.1) install errors I have installed node version 9.2.0 and npm version 5.5.1
On the command line, I want to install packages:
$ npm install express --save
npm WARN bookstore@1.0.0 No repository field.

npm ERR! path C:\Users\ad\Projects\bookstore\node_modules\bytes
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename
'C:\Users\ad\Projects\bookstore\node_modules\bytes' ->
'C:\Users\ad\Projects\bookstore\node_modules\.bytes.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ad\AppData\Roaming\npm-cache\_logs\2018-03-
14T06_36_04_014Z-debug.log

What does this mean? Maybe I should uninstall node version 9 and revert to the LTS-version 8? And how to do that in Windows?
Please, I need help; thank you in advance!
EDIT: Could it be caused by a slow internet connection; npm not being able to find a file.?
EDIT 2: I was able to uninstall node version 9.2.0, then installed version 8.10.0 :-( Still the same error messages!

A: First Use Below Command
touch .npmignore

Then Install Express
npm install express --save

A: I found a solution, but this is really stupid! Let me explain: I have been using Visual Studio Code for months now, and it's inbuilt command line (bash). Never had any issues with it!
But now; there must be something wrong with VS Code, giving these errors.
I tried an alternative: Git-Bash command window and separately Sublime Text 3. And it works! I could install all dependencies that were needed, without any errors or warnings!
Can someone explain this strange behavior I had using VS Code?

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do I install a node module in meanio project? I have created a new project with mean and now I am stumped on how to propery integrate a new node module  (lodash).  I have installed the node module npm install lodash --save and I see that it has added it to the package.json file and the assets are in the root node_modules folder.
How do I actually use it in my project??

A: You can use lodash without installing it. Because mean.io already has lodash used in it's core part.
If you means your own package, you can npm install in your package directory(with its own package.json). Each time other's mean install your package, it will install all the modules.


text:
Q: Nice example where $D^{\alpha}\Lambda_{f}\neq\Lambda_{D^{\alpha}f}$? Let $\Omega\subset\mathbb{R}^n$ be open and $f$ be a locally integrable function. The distribution associated with $f$, $\Lambda_{f}\in D'(\Omega)$, is defined via \begin{equation}
\Lambda_{f}(\phi)=\int f\phi,
\end{equation} where $\phi\in D(\Omega)$ is a test function.
For $\mu$, a regular measure, $\Lambda_{\mu}$ is defined to be $\Lambda_{\mu}(\phi)=\int\phi d\mu$.
The distribution derivative of $f$ is the distribution defined by \begin{equation}
(D^{\alpha}\Lambda_{f})(\phi)=(-1)^{|\alpha|}\Lambda_{f}(D^{\alpha}\phi),
\end{equation} where $D^{\alpha}$ is the derivative operator with multi-index $\alpha$.
One natural question is the commutability of $D^{\alpha}$ and $\Lambda$, that is, whether \begin{equation}
D^{\alpha}\Lambda_{f}=\Lambda_{D^{\alpha}f}.
\end{equation}
If $f\in C^{N}(\Omega)$ for some $N>|\alpha|$, then this is true. Rudin says in general this is false by giving a counterexample on $\mathbb{R}$. He takes $f$ to be a left-continuous function of bounded variation, then $Df$ exists a.e. Then he shows $D\Lambda_{f}(\phi)= \Lambda_{\mu}$, where $\mu([a,b])=f(b)-f(a)$.
This shows $D$ and $\Lambda$ commute only if $f$ is absolutely continuous.
However, this example is not quite satisfactory in the sense Rudin interprets $D$ as the a.e. derivative, rather than a regular derivative. In fact, if $f$ is differentiable then it is absolutely continuous.
A good counterexample would be one in which $f\in C^{N-1}(\Omega)$ with $N=|\alpha|$ and the commutativity fails.
Thanks very much!

A: The Cantor function belongs to $C^0$ and its distributional derivative of order $1$ is not described by the pointwise derivative (which exists a.e. This qualifies as "good counterexample" for $N=1$ under the terms of your question.
Counterexamples for higher values of $N$ can be obtained by taking the indefinite integral of the Cantor function $N-1$ times.


text:
Q: How to fit content inside div element? I am trying to fix my content inside my div tag. I have only fit in some of the content inside it, but there is more that needs to be put inside it. I need help.
Note I am doing Angular but I need to fix my HTML & CSS only.
My HTML

Please Type In Your Address

<form (ngSubmit)="onSubmit()" [formGroup]="addressData">
   <input class="addressBar" type="text" placeholder="Address" maxlength="30" formControlName="address" autofocus>
</form>

<button class="button">Proceed</button>

<button class="button">Cancel</button>

CSS
.button {
    padding: 20px 30px;
    font-size: 25px;
    background-color: lightblue;
    position: relative;
    top: 28em;
    left: 3em;
}

.button:hover {
   padding: 22px 32px;
}

.contentBox {
    display: inline-block;
    background-color: lightgray;
}

.addressBar {
    padding: 20px;
    font-size: 30px;
    border: 3px black inset;
    text-align: center;
    position: relative;
    top: 3em;
 }

Output

You can see the two buttons are not within the div (in grey). How do I expand the div so it will be behind the buttons, providing the background for all the content?
Thanks!

A: It's because you're using position: relative for your address bar and buttons. This shifts that element down by whatever your top value is, relative to where it's normal position is. I would use margin-top to achieve the same effect for your purpose.

.button {
    padding: 20px 30px;
    font-size: 25px;
    background-color: lightblue;
}

.button:hover {
   padding: 22px 32px;
}

.contentBox {
    display: inline-block;
    background-color: lightgray;
}

.addressBar {
    padding: 20px;
    font-size: 30px;
    border: 3px black inset;
    text-align: center;
    margin-top: 3em;
 }

Please Type In Your Address

<form (ngSubmit)="onSubmit()" [formGroup]="addressData">
   <input class="addressBar" type="text" placeholder="Address" maxlength="30" formControlName="address" autofocus>
</form>

<button class="button">Proceed</button>

<button class="button">Cancel</button>

You can read more about the position property here

A: You need to replace your top styles with margin as shown in the fiddle https://jsfiddle.net/saksham_malhotra/cnLrv87f/
By providing top coordinates with position relative, you are shifting your element position without considering the containing element.

A: Try this:

Please Type In Your Address

<form (ngSubmit)="onSubmit()" [formGroup]="addressData">
   <textarea class="addressBar" type="text" placeholder="Address" maxlength="30" formControlName="address" autofocus></textarea>
</form>

<button class="button">Proceed</button>

<button class="button">Cancel</button>


text:
Q: Protobuf with C++ plugins We're working on a relatively large-scale C++ project where we chose at the very beginning to use protobuf as our Lingua Franca for stored and transmitted data.
We had our first problem because of end-of-program memory leaks due to the protobuf generated classes metadata that are stored as static pointer, allocated during the first call to the constructor and never deallocated. We found a nice function provide by Mr. Google to do this clean-up:
google::protobuf::ShutdownProtobufLibrary();

Works fine except there is no symmetric call, so once it's done you can no longer use anything  . You have to do that exactly one time in your executable. We did what any lazy developper would have done:
struct LIBPROTOBUF_EXPORT Resource
{
    ~Resource()
    {
        google::protobuf::ShutdownProtobufLibrary();
    }
};

bool registerShutdownAtExit()
{
    static Resource cleaner;
    return true;
}

And we added in the protobuf generation of cc files a:
static bool protobufResource = mlv::protobuf::registerShutdownAtExit();

It worked fine for several months.
Then we added the support for dynamically loadable plugins (dlls) in our tool. Some of them using protobuf. Unloading of the plugins worked fine, but when more than one of them used protobuf, we had a nice little crash when unloading the last one.
The reason: the last to unload would destroy the cleaner instance, itself trying to google::protobuf::ShutdownProtobufLibrary(), itself trying to destroy metadata of unloaded types... CRASH.
Long story short: are we condemned to either have lots of "normal" memory leaks or a crash when closing our tool. Does anyone have experienced the same problem and found a better solution? Is my diagnosis bad?

A: Like johnathon suggested in his comment, use a reference counting scheme, or register your destruction routine with atexit. Such a routine is free-standing, but that could work fine for your case.
Relevant documentation:

*

*MSDN

*POSIX
Edit: You're right, it's basically the same thing. Didn't think this through.
Another suggestion: Use a global resource singleton for all protobuf-using plugins. This one has a global destructor, which is only registered when a plugin first uses the protobuf library. Or just set a flag whenver it's used, then call ShutdownProtobufLibrary only if the flag is set.


text:
Q: Where to place code that needs to be executed on every request in Kohana 3.1 In Kohana 3.1, where is the best place to put code that needs to be be executed on every request? In my case, it needs to manage the ACL so that I can block the request if the user is not authorized.

A: Put it to Controller class, and implement its before() method.


text:
Q: How to read multiple text files using window batch scripting? Currently I am trying to read the variable value from different text files available in my directly folder and use those variable to execute commands like uploading the content to FTP server.
I have different FTP servers on which I need to upload the same set of files. So what I want is to read the hostname, userID and password of different FTP servers which are saved in different text files and use those values to execute same set of commands for all.
Here is my FileUpload.bat looks like :-
@echo off
setlocal EnableDelayedExpansion
for %%x in (C:\Users\xxxx\Desktop\Anivirus_Upload\text_*.txt)
    do (
    for /f "usebackq delims=" %%A in ("%%~Fx")
        do (
            if "%%A"="user" set user=%%B
                if "%%A"="password" set password=%%B
                if "%%A"="localPath" set localPath=%%B
                if "%%A"="serverpath" set serverpath=%%B
                if "%%A"="Hostname" set Hostname=%%B
                echo  user %user%> ftpcmd.dat
                echo %password%>> ftpcmd.dat
                echo lcd %localPath%>>ftpcmd.dat
                echo cd %serverpath%/>>ftpcmd.dat
                echo put %1>> ftpcmd.dat
                echo quit>> ftpcmd.dat
                ftp -n -s:ftpcmd.dat %Hostname%
                del ftpcmd.dat
            )
    )

In the folder I have different text files namely
text_1
text_2

etc and each text file have values like :-
user=XXXX
Hostname=10.164.XXXXX
password=XXXXX
localPath=C:\Users\XXXX\Desktop\Service_Pack_74
serverpath=Temp/XXXX/Service_Pack_74/

I don't know where I am messing with the code while reading multiple text files.
I checked my batch file with single text file and I am able to upload the content correctly so seems the issue is with the external for loop to read multiple files from the directory.

A: Many things amiss here.
First, the do ( must be on the same physical line as the for.
Next, the delims clause of the second for loop should be delims==". With only 1 = delimiters are turned off, hence %%A will be assigned the contents of the entire line and %%B will be interpreted as the literal string %B. AND to assign value to the metavariables, you need to add a tokens clause specifying which tokens to assign.
Next, within a block (a parenthesised series of commands) any %var% is replaced by the contents of the variable var at the time the block is entered, not to any new value it adopts as the block is executed.
Next, the entire output and ftp section will be executed for each line of the file. Any output would depend on the value originally assigned to the variables you are using - possibly from a previous run.
@echo off
setlocal EnableDelayedExpansion
for %%x in (C:\Users\xxxx\Desktop\Anivirus_Upload\text_*.txt) do (
 for /f "usebackq tokens=1* delims==" %%A in ("%%~Fx") do (
  if "%%A"=="user" set user=%%B
  if "%%A"=="password" set password=%%B
  if "%%A"=="localPath" set localPath=%%B
  if "%%A"=="Hostname" set Hostname=%%B
  if "%%A"=="serverpath" (
   set serverpath=%%B
   echo user !user!> ftpcmd.dat
   echo !password!>> ftpcmd.dat
   echo lcd !localPath!>>ftpcmd.dat
   echo cd !serverpath!/>>ftpcmd.dat
   echo put %1>> ftpcmd.dat
   echo quit>> ftpcmd.dat
   ftp -n -s:ftpcmd.dat !Hostname!
   del ftpcmd.dat
  )
 )
)

Note here that the ftp command file is built and executed using !var! which accesses the changed value of the variables when delayedexpansion is in effect.
I have no idea what you want in your ftp-put command. As it is, the routine will substitute whatever is the first parameter to the batch file for %1
I'm also assuming that each variable is guaranteed to appear in each file, and that the serverpath will be last in that file.


text:
Q: AttributeError: 'NoneType' object has no attribute 'group' when trying to convert pandas dataframe to nltk corpus I'm using a function that takes the content of a pandas dataframe, reads it and appends it to a text file, then takes the contents of that text file and puts it into a corpus.
def CreateCorpusFromDataFrame(corpusfolder,df):
    for index, r in df.iterrows():
        id=r['Date']
        tweet=r['Text']
        fname='tweets'+'.txt'
 corpusfile=open(corpusfolder+'/'+fname,'a')
        corpusfile.write(str(tweet) +" ")
        corpusfile.close()

When viewing the 'tweets.txt' file, I can see that the tweets are being added to the text file after running this function. But the part of the function that may be faulty is when I use the function and assign the corpus to an object. The object shows up as 'None'.
corpusdf = CreateCorpusFromDataFrame('corpus_folder',mydf)
print(corpusdf)

Then when I try to read the files from the corpus folder with this code:
from nltk.corpus.reader import CategorizedPlaintextCorpusReader
my_corpus=CategorizedPlaintextCorpusReader('corpus_folder/',
r'.*', cat_pattern=r'(.*)_.*')
my_corpus.fileids()
my_corpus.categories()

I get the following error:
AttributeError: 'NoneType' object has no attribute 'group'

The problem seems to be that the the tweets from the dataframe are being written into the text file but not the folder?
See this for further explanation of code:
How to create corpus from pandas data frame to operate with NLTK
https://groups.google.com/forum/#!topic/nltk-users/YFCKjHbpUkY
Need to set categorized corpus reader in NLTK and Python, corpus texts in one file, one text per line


text:
Q: NHibernate sql query without map one column one row I have a settings table without a primary key that I want to be able to select one column/one row from without any mappings.
How can I do this?

A: We can still use raw SQL (underlying DB Engine related):
var session = ... ; // standard session, with access to other mapped stuff
var sql = "SELECT settingCol FROM dbo.myTable WHERE ... ";
var result = session
    .CreateSQLQuery(sql)
    .UniqueResult<string>(); // or <int>

and work with that result without being mapped to any entity. Check the
17.1. Using an ISQLQuery


text:
Q: RealmSwift currentUser cannot be called if more that one valid, logged-in user exists I have a realm platform and I can register and login a user fine. When I try to open a Synced Realm file with the current User it will not allow it and Xcode throws the error currentUser cannot be called if more that one valid, logged-in user exists. I have followed all the information I can find on realms docs and I can't make sense as to why this is happening. I have a Login View Controller and a separate View Controller that contains the realm file. Here is example code of the problem I am dealing with.
LogInViewController
import Cocoa
import RealmSwift

class LoginViewController: NSViewController {

    @IBOutlet weak var username: NSTextField!
    @IBOutlet weak var password: NSSecureTextField!

    let realm = try! Realm()

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func loginButtonPressed(_ sender: NSButton) {
        let login = SyncCredentials.usernamePassword(username: "\(username.stringValue)", password: "\(password.stringValue)", register: false)
        SyncUser.logIn(with: login, server: Constants.AUTH_URL, onCompletion: { [weak self] (user, err) in
            if let _ = user {
                if let mainWC = self?.view.window?.windowController as? MainWindowController {
                    mainWC.segueToHome()
                    print("Login Pressed")
                 }
             } else if let error = err {
                 fatalError(error.localizedDescription)
             }
         })
    }
}

SecondViewController
import Cocoa
import RealmSwift

class ViewController: NSViewController {

    @IBOutlet weak var textField: NSTextField!

    override func viewDidLoad() {
        super.viewDidLoad()

        let config = SyncUser.current!.configuration(realmURL: Constants.REALM_URL, fullSynchronization: false, enableSSLValidation: true, urlPrefix: nil)
        self.realm = try! Realm(configuration: config)
    }

    func save(data: Data) {
        do {
            try realm.write {
                realm.add(data)
            }
        } catch {
            print("there was an error saving data \(error)")
        }
    }

    @IBAction func saveData(_ sender: NSButton) {
        let saveData = Data()
        saveData.textField = textField.stringValue
        save(data: data)
    }

    func loadData() {
        data = realm.objects(Data.self).sorted(byKeyPath: "timestamp", ascending: false)
    }
}

A: Maybe, this page help you solve the problem.
I solved the same problem.
    ///
    /// quit all other users session
    ///
    for u in SyncUser.all {
        u.value.logOut()
    }
    ///
    ///
    ///
    let creds: SyncCredentials = SyncCredentials.usernamePassword(
        username: YOUR_USER,
        password: YOUR_PASS
    )
    SyncUser.logIn(
        with: creds,
        server: YOUR_AUTH_URL
    ) { (user: SyncUser?, err: Error?) in
        ///
        /// Your action ...
        ///
    }

After logOut and logIn, this method will success probably.
    let config = SyncUser.current!.configuration(realmURL: Constants.REALM_URL, fullSynchronization: false, enableSSLValidation: true, urlPrefix: nil)
    self.realm = try! Realm(configuration: config)

A: If you are using Realm with Firebase, a snippet like this will save you from authentication headaches.
Check to see if the SyncUser uid matches the uid from firebase, and sign out extraneous accounts.
        for syncUser in SyncUser.all {
            if(syncUser.key != (FirebaseAuth.Auth.auth().currentUser?.uid ?? "")) {
                syncUser.value.logOut()
            }
        }


text:
Q: Intuition behind orthogonal sin functions When deriving Fourier series, an important step is to establish that the integral of the product of two periodic sin functions is 0 if they have a different frequency.
This then allows you to define Fourier series as the basis for an inner product space.
The usual derivation makes use of trig identities. Here's an example: Orthogonality of sine and cosine integrals.
However I don't find these derivations very intuitive.
Is there another way to see why the integral of sin/cos functions of different frequencies is always 0?

A: I'm not sure if this is quite what you're looking for, but this is the best I could come up with. Orthogonality of $\cos(n\theta), \cos(m\theta), \sin(n\theta)$, and $\sin(m\theta)$ for $n^2 \neq m^2$ follows directly from orthogonality of $e^{in\theta}$ and $e^{im \theta}$ for $n \neq m$. To understand why $e^{in\theta}$ and $e^{im \theta}$ are orthogonal for $n \neq m$, consider the integral
\begin{equation}
\int_0^{2\pi} e^{i(n-m) \theta} d\theta.
\end{equation}
As $\theta$ ranges from $0$ to $2\pi$, the integrand traverses the unit circle an integer number of times. By symmetry, it is clear that the real and imaginary parts of this integral are zero. Finally, notice that we can write both $\sin(n\theta)$ and $\cos(n\theta)$ as linear combinations of $e^{in\theta}$ and $e^{-in\theta}$. Hence, any product of these trig functions is a linear combination of $e^{i(n+m)\theta}$, $e^{i(n-m)\theta}$, $e^{i(m-n)\theta}$, and $e^{i(-m-n)\theta}$. The corresponding integrals are all zero by orthogonality of the complex exponentials since $n^2 \neq m^2$.

A: Perhaps finite Fourier series is more intuitive because
instead of infinite series and integrals you only have
to deal with finite sums. This is described in the Wikipedia
article Discrete Fourier transform. Notice that $\,\exp(i\theta) = \cos(\theta)+i\sin(\theta)\,$ so you can extract
$\,\sin\,$ and $\,\cos\,$ by using real and imaginary
parts of $\,\exp(i\theta).$
Fix an integer $\,N>0\,$ and suppose $\,z\,$ is a number such
that $\,z,z^2,z^3,\dots, z^N=1\,$ are all different. Such a
number is a primitive $N$th root of unity.
Define the geometric sequences $\,w_k(j) := z^{jk}\,$ for
any integers $\,j,k.\,$ Each such sequence satisfies
$\, w_k(j) = w_j(k),\,$ $\, w_k(i+j) = w_k(i)w_k(j)\,$ and
$\, w_k(j+N) = w_{k+N}(j) = w_k(j).\,$ Thus, only $\,N\,$
of these sequences are distinct and so we can uniquely
express any sequence of numbers of period $\,N\,$ as a sum of these geometric sequences.
To determine the coefficients of such an expression we can use the important identity
 (because roots of unity are the vertices of a regular
polygon inscribed in the unit circle)
$$ \sum_{j=0}^{N-1} w_k(j) = 0 \;\;\text{ if }\;\;0<k<N.$$
But
$$ \sum_{j=0}^{N-1} w_0(j) = N \;\;\text{ since }\;\; w_0(j)=1. $$
Now if $\,\{a_0,a_1,\dots,a_k,\dots\}\,$ is any period $\,N\,$ sequence,
then $\,a_j = \sum_{k=0}^{N-1} c_k\,w_k(j)\,$ where
$\, c_k := \frac1N \sum_{j=0}^{N-1} a_j\,w_k(-j).\,$
Now Fourier series is just the limit of period $\,N\,$
Fourier series as $\,N\to\infty.$


text:
Q: Are the fusion categories weakly Frobenius? A well-known open problem (generalizing Kaplansky 6th conjecture) asks whether every (spherical) fusion category $\mathcal{C}$ (over $\mathbb{C}$) is of Frobenius type, i.e. for every simple object $X$ in $\mathcal{C}$ then $\dim(\mathcal{C})/\dim(X)$ is an algebraic integer.
A (spherical) fusion category $\mathcal{C}$ (over $\mathbb{C}$) will be called weakly Frobenius if for every simple object $X$ in $\mathcal{C}$ then there is a positive integer $n$ such that $\dim(\mathcal{C})^n/\dim(X)$ is an algebraic integer (in other words, the ideal generated by $\dim(\mathcal{C})$ is included in the radical of the ideal generated by $\dim(X)$).
Question: Are the (spherical) fusion categories (over $\mathbb{C}$) weakly Frobenius?
If so, that would provide a good categorification criterion, because it is not true at the level of fusion rings. For example, consider the following simple integral fusion ring of rank $6$, FPdim $1320$ and type $[1,9,10,11,21,24]$. Its categorification would be pseudo-unitary and spherical (as it is integral), so would not be weakly Frobenius because $7$ is prime factor of $21$ but not of $1320$.
Here are the fusion coefficients:
[
[[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]],
[[0,1,0,0,0,0],[1,0,0,1,1,2],[0,0,1,1,1,2],[0,1,1,1,1,2],[0,1,1,1,3,4],[0,2,2,2,4,3]],
[[0,0,1,0,0,0],[0,0,1,1,1,2],[1,1,0,0,2,2],[0,1,0,1,2,2],[0,1,2,2,3,4],[0,2,2,2,4,4]],
[[0,0,0,1,0,0],[0,1,1,1,1,2],[0,1,0,1,2,2],[1,1,1,1,2,2],[0,1,2,2,4,4],[0,2,2,2,4,5]],
[[0,0,0,0,1,0],[0,1,1,1,3,4],[0,1,2,2,3,4],[0,1,2,2,4,4],[1,3,3,4,7,8],[0,4,4,4,8,9]],
[[0,0,0,0,0,1],[0,2,2,2,4,3],[0,2,2,2,4,4],[0,2,2,2,4,5],[0,4,4,4,8,9],[1,3,4,5,9,11]]
]

This example is very interesting because it cannot be excluded by a known criterion. It first appeared in this paper (Appendix A.2). Idem for the example following the above one in this paper (rank $7$, FPdim $560$ and type $[1,6,7,7,10,10,14]$).


text:
Q: How to check if programm installed with cmd @echo off
color 06
title created by AAIE
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install youtube-dl
set /p input="Enter Link For Playlist:"
set /p index="Enter Index For videos Seprated by ',':"
mkdir playlist_videos
cd playlist_videos
youtube-dl --playlist-items %index% %input%

how can I check if choco or youtube_dl is installed in windows or not or the main question what is the conditions i need to check if it true then use commands directly if not installed then it will install them
and use the same commands

A: Here are some examples using where to locate and perform actions based on the result:
@echo off
(where choco.exe)>nul 2>&1
if errorlevel 1 (
    echo Choco not installed. Installing now..
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
)

choco install youtube-dl
set /p input="Enter Link For Playlist:"
set /p index="Enter Index For videos Seprated by ',':"
mkdir playlist_videos
cd playlist_videos
youtube-dl --playlist-items %index% %input%

or by using conditional operators:
@echo off
(where choco.exe)>nul 2>&1 && goto :installed || goto :install
:install
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

:installed
choco install youtube-dl
set /p input="Enter Link For Playlist:"
set /p index="Enter Index For videos Seprated by ',':"
mkdir playlist_videos
cd playlist_videos
youtube-dl --playlist-items %index% %input%

Note these are straight forward examples, there are no error handling built in, like what happens if coco install fails, etc.
As per your question on 2>&1 >nul
stdout (seen as 1> when redirecting) is the output stream of a command where stderr (seen as 2> when redirecting.)
When doing >nul or > file.txt we are effectively redirecting the output of a command to nul (not seen on console) or to a file (logging purpose) but not everything goes to the stdout stream by default. so we need to redirect stderr stream to stdout, then redirect stdout to nul or a file.
You can obviously also redirect independently.
commandname 1>out.log 2>error.log


text: Q: Almost sure equality of 0 and the index of a null set Let $X$ be a real valued random variable, $I_A$ represents the indicator function,  and $A$ a null set, i.e $P(A)=0$, Is it true (without assuming that the random variable $X$ is bounded) that $XI_A=0$ almost surely.


text:
Q: PHP performant search a text for given usernames I am currently dealing with a performance issue where I cannot find a way to fix it. I want to search a text for usernames mentioned with the @ sign in front. The list of usernames is available as PHP array.
The problem is usernames may contain spaces or other special characters. There is no limitation for it. So I can't find a regex dealing with that.
Currently I am using a function which gets the whole line after the @ and checks char by char which usernames could match for this mention, until there is just one username left which totally matches the mention. But for a long text with 5 mentions it takes several seconds (!!!) to finish. for more than 20 mentions the script runs endlessly.
I have some ideas, but I don't know if they may work.

*

*Going through username list (could be >1.000 names or more) and search for all @Username without regex, just string search. I would say this would be far more inefficient.

*Checking on writing the usernames with JavaScript if space or punctual sign is inside the username and then surround it with quotation marks. Like @"User Name". Don't like that idea, that looks dirty for the user.

*Don't start with one character, but maybe 4. and if no match, go back. So same principle like on sorting algorithms. Divide and Conquer. Could be difficult to implement and will  maybe lead to nothing.

How does Facebook or twitter and any other site do this? Are they parsing the text directly while typing and saving the mentioned usernames directly in the stored text of the message?
This is my current function:
$regular_expression_match = '#(?:^|\\s)@(.+?)(?:\n|$)#';
$matches = false;
$offset = 0;

while (preg_match($regular_expression_match, $post_text, $matches, PREG_OFFSET_CAPTURE, $offset))
{
    $line = $matches[1][0];
    $search_string = substr($line, 0, 1);
    $filtered_usernames = array_keys($user_list);
    $matched_username = false;

    // Loop, make the search string one by one char longer and see if we have still usernames matching
    while (count($filtered_usernames) > 1)
    {
        $filtered_usernames = array_filter($filtered_usernames, function ($username_clean) use ($search_string, &$matched_username) {
            $search_string = utf8_clean_string($search_string);

            if (strlen($username_clean) == strlen($search_string))
            {
                if ($username_clean == $search_string)
                {
                    $matched_username = $username_clean;
                }
                return false;
            }

            return (substr($username_clean, 0, strlen($search_string)) == $search_string);
        });

        if ($search_string == $line)
        {
            // We have reached the end of the line, so stop
            break;
        }
        $search_string = substr($line, 0, strlen($search_string) + 1);
    }

    //  If there is still one in filter, we check if it is matching
    $first_username = reset($filtered_usernames);
    if (count($filtered_usernames) == 1 && utf8_clean_string(substr($line, 0, strlen($first_username))) == $first_username)
    {
        $matched_username = $first_username;
    }

    // We can assume that $matched_username is the longest matching username we have found due to iteration with growing search_string
    // So we use it now as the only match (Even if there are maybe shorter usernames matching too. But this is nothing we can solve here,
    // This needs to be handled by the user, honestly. There is a autocomplete popup which tells the other, longer fitting name if the user is still typing,
    // and if he continues to enter the full name, I think it is okay to choose the longer name as the chosen one.)
    if ($matched_username)
    {
        $startpos = $matches[1][1];

        // We need to get the endpos, cause the username is cleaned and the real string might be longer
        $full_username = substr($post_text, $startpos, strlen($matched_username));
        while (utf8_clean_string($full_username) != $matched_username)
        {
            $full_username = substr($post_text, $startpos, strlen($full_username) + 1);
        }

        $length = strlen($full_username);
        $user_data = $user_list[$matched_username];

        $mentioned[] = array_merge($user_data, array(
            'type'          => self::MENTION_AT,
            'start'         => $startpos,
            'length'        => $length,
        ));
    }

    $offset = $matches[0][1] + strlen($search_string);
}

Which way would you go? The problem is the text will be displayed often and parsing it every time will consume a lot of time, but I don't want to heavily modify what the user had entered as text.
I can't find out what's the best way, and even why my function is so time consuming.
A sample text would be:

Okay, @Firstname Lastname, I mention you!
  Listen @[TEAM] John, you are a team member.
  @Test is a normal name, but @Thât♥ should be tracked too.
  And see @Wolfs garden! I just mean the Wolf.

Usernames in that text would be

*

*Firstname Lastname

*[TEAM] John

*Test

*Thât♥

*Wolf

So yes, there is clearly nothing I know where a name may end. Only thing is the newline.

A: I think the main problem is, that you can't distinguish usernames from text and it's a bad idea, to lookup maybe thousands of usernames in a text, also this can lead to further problems, that John is part of [TEAM] John or JohnFoo...
It's needed to separate the usernames from other text. Assuming that you're using UTF-8, could put the usernames inside invisible zero-w space \xE2\x80\x8B and non-joiner \xE2\x80\x8C.
The usernames can now be extracted fast and with little effort and if needed still verified in db.
$txt = "
Okay, @\xE2\x80\x8BFirstname Lastname\xE2\x80\x8C, I mention you!
Listen @\xE2\x80\x8B[TEAM] John\xE2\x80\x8C, you are a team member.
@\xE2\x80\x8BTest\xE2\x80\x8C is a normal name, but
@\xE2\x80\x8BThât?\xE2\x80\x8C should be tracked too.
And see @\xE2\x80\x8BWolfs\xE2\x80\x8C garden! I just mean the Wolf.";

// extract usernames
if(preg_match_all('~@\xE2\x80\x8B\K.*?(?=\xE2\x80\x8C)~s', $txt, $out)){
  print_r($out[0]);
}

Array
  (
      [0] => Firstname Lastname
      1 => [TEAM] John
      2 => Test
      3 => Thât♥
      4 => Wolfs
  )

echo $txt;
Okay, @Firstname Lastname, I mention you!
Listen @[TEAM] John, you are a team member.
@Test is a normal name, but
@Thât♥ should be tracked too.
And see @Wolfs garden! I just mean the Wolf.

Could use any characters you like and that possibly don't occur elsewhere for separation.
Regex FAQ, Test at eval.in (link will expire soon)


text:
Q: Equal distance among all points on an axis I am trying to plot a simple scatter plot like this:

The minimal code I am using for generating this plot is as follows:
ggplot(fig1c, aes(x=xvar, y=yvar)) +
  scale_x_log10(breaks=unique(fig1c$xvar)) +
  scale_y_continuous(breaks=seq(0, 10, by=1), labels=as.character(seq(0, 10, by=1))) +
  geom_point(aes(fill=Method, color=Method, shape=Method), size = 5, guides=FALSE) +
  scale_colour_brewer(palette="Set1") +
  geom_line(aes(fill=Method, color=Method)) +

What I would like to achieve is to have all the points on the x axis (5884, 13957, ...) equally spaced. I.e. I want a break between point 5884 and 13957 to be the same size as between 13957 and 21013, and so on. Any help?
Thank you

A: You might want to convert your x-values into factors. Right now, R assumes that your x-values are numbers and hence puts the appropriate space between them (the difference between 5,884 and 13,957 is larger than the difference between 21,013 and 28,708). However, you probably think of the numbers as names for your datapoints. If you tell R to treat the numbers as factors or text, it will put equal spacing between them.
ggplot(fig1c, aes(x=as.factor(xvar), y=yvar)) +
  scale_x_log10(breaks=unique(fig1c$xvar)) +
  scale_y_continuous(breaks=seq(0, 10, by=1), labels=as.character(seq(0, 10, by=1))) +
  geom_point(aes(fill=Method, color=Method, shape=Method), size = 5, guides=FALSE) +
  scale_colour_brewer(palette="Set1") +
  geom_line(aes(fill=Method, color=Method)) +

A: Your x-values should be transformed to factors for ggplot not to consider them as continuous variables. Furthermore, you should suppress the line:
scale_y_continuous(breaks=seq(0, 10, by=1), labels=as.character(seq(0, 10, by=1)))

What you should have at the end is:
fig1c$xvar <- factor(fig1c$xvar)

p <- ggplot(fig1c, aes(x=xvar, y=yvar))
p <- p + geom_point(aes(fill=Method, color=Method, shape=Method), size = 5, guides=FALSE)
p <- p + scale_colour_brewer(palette="Set1")
p <- p + geom_line(aes(group=Method, color=Method))
p


text:
Q: How to compile Material.io design with gulp-sass without using Webpack? I'm using this tutorial at Material.io and want to use Material.io with gulp-sass.
But when I try to compile it, it shows the error

@material\button\mdc-button.scss
  Error: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"

The repository is located at GitHUB.

A: It looks like you're trying to use node-sass. MDC Web Components version 5 uses the Sass Modules syntax, which is currently only supported by Dart Sass.
npm install sass

Then in gulpfile.js:
var sass = require('gulp-sass');
sass.compiler = require('sass');


text:
Q: Animation effect not working I am trying to create a simple jQuery slide show .the problem I am facing that when I use fade-out it works properly but when I am trying to use animate to slide all the images to the right it's not working ..
My jQuery code so far
HTML:

IMG1

img2

 $(document).ready(function (){
      $('#slide').each(function (){
          $(this).animate ({left:'700px'},4000)});
      });
 });

I am new to jQuery so please excuse me for this poor code .want to to know what am I doing wrong ! Thanks in advanced for the help

A: Where is the HTML for your code?
Anyways, you cannot use multiple IDs on the same page.
Seems like you are using #slide on multiple elements. Instead use classname and then
$('.slide').each(function(){
   // your code here
});

While if there are some elements inside your div with id #slide, e.g you have img tags inside that #slide div,then use
 $('#slide img').each(function(){
   // your code here
});


text:
Q: UI Automation returns blank AutomationId from IE HTML input text field I'm using "AddAutomationFocusChangedEventHandler" to capture when an input field in IE is focused on. When the AutomationElement is passed back, the AutomationId is always empty.
When I view the field in Inspect.exe, it shows the HTML input fields id value as the AutomationId. I'm not sure why UI Automation is not returning this value back to me. My application and IE are running under the same User.
Is there a problem inherent to UI Automation?
        Automation.AddAutomationFocusChangedEventHandler(OnFocusChangedHandler);

        private void OnFocusChangedHandler(object src, AutomationFocusChangedEventArgs args)
        {
            Console.WriteLine("Focus changed!");

            AutomationElement element = null;

            try
            {
                element = src as AutomationElement;
            }
            catch { }

            if (element != null)
            {
                    string name = element.Current.Name;
                    string id2 = element.Current.AutomationId;

                    int processId = element.Current.ProcessId;

                    InsertTextUsingUIAutomation(element, id2);

                    using (Process process = Process.GetProcessById(processId))
                    {
                        Console.WriteLine("  Name: {0}, Id: {1}, Process: {2}", name, id2, process.ProcessName);
                    }
                }
            }
        }


text:
Q: Action method with JSON API call gives 500 error I am doing an API call which is working fine at localhost but when I run it on the server, the page first is asking for an authorization (screenshot attached). If I skip the step, I get the following error.

401 - Unauthorized: Access is denied due to invalid credentials. You
  do not have permission to view this directory or page using the
  credentials that you supplied.

If I supply server admin credential I get this:

Configuration Error Description: An error occurred during the
  processing of a configuration file required to service this request.
  Please review the specific error details below and modify your
  configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file:
  Failed to start monitoring changes to 'C:...\test' because access is
  denied.
An application error occurred on the server. The current custom error
  settings for this application prevent the details of the application
  error from being viewed remotely (for security reasons). It could,
  however, be viewed by browsers running on the local server machine.

I have customErrors mode = "Off" already set up in server's web.config file.
<system.web>
   ...
   <customErrors mode="Off" />
   ...
</system.web>

Below is my code:
public ActionResult ApiTest{
   var baseUri = "https://<apiurl>/products";
   var json = "{\"requestList\": {\"access_id\": \"access_id\", \"access_key\": \"access_key\", \"clientIpAdr\": \"x.x.x.x\", \"currency\": \"USD\", \"lang\": \"en\", \"filters\": { \"product_category\": 1, \"reference_no\": \"xxxxxx\" } } }";
   var result = "";

   var request = (HttpWebRequest)WebRequest.Create(baseUri);
   request.ContentType = "application/json";
   request.Accept = "text/json";
   request.Method = "POST";
   request.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
   ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

   using (var sw = new StreamWriter(request.GetRequestStream()))
   {
       sw.Write(json);
       sw.Flush();
       sw.Close();
   }

   try
   {
       var response = (HttpWebResponse)request.GetResponse();
       using (var sr = new StreamReader(response.GetResponseStream()))
       {
           result = sr.ReadToEnd();
       }
   }

   catch (WebException webex)
   {
       WebResponse errResp = webex.Response;
       using (Stream respStream = errResp.GetResponseStream())
       {
           StreamReader reader = new StreamReader(respStream);
           result = reader.ReadToEnd();
       }
   }

   dynamic jsonObj = JsonConvert.DeserializeObject(result);
      var models = jsonObj.master;
   }

   ViewBag.Result = result;
   return View();
}

I am completely screwed up!! :(
EDIT:
Content of Web.config used on the server:
<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <configSections>

    </configSections>
    <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\xxx.mdf;Initial Catalog=xxx;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="xxx" connectionString="metadata=res://*/Models.xxx.csdl|res://*/Models.xxx.ssdl|res://*/Models.xxx.msl;provider=System.Data.SqlClient;provider connection string="data source=localhost;initial catalog=xxx;user id=xxx;password=xxx;TransparentNetworkIPResolution=False;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
        <add name="CLXLandingEntities" connectionString=".." providerName="System.Data.EntityClient" />
    </connectionStrings>
    <appSettings>
        <add key="webpages:Version" value="2.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />

        <add key="CryptoKey" value="xxx" />

        <add key="GeneralInquiry" value="abd010e9-f9fe-4e2b-bbc6-b8a3ece2f7a1" />
        <add key="ScheduledTestDrive" value="ddf52846-10bf-415c-a8ea-a44d313a11ad" />
        <add key="MakeAnOffer" value="6d27d834-5ce5-4ea7-b8b6-e38fe16fdba7" />
        <add key="BaseDomain" value="http://basedomain.com/" />

        <add key="enableSimpleMembership" value="false" />

        <add key="VehicleDescriptionPlaceholderText" value="Respond To This AD For Details" />

        <add key="SiteMode" value="L" />
        <add key="DevEmail" value="xxx@gmail.com" />

        <add key="ManualUploadDisplay" value="On"/>

        <add key="imageoptim_username" value="xxx"/>
        <add key="imageoptim_doc" value="https://imageoptim.com/api/get?username=xxx"/>

        <add key="exclude_vehicle_price_in_search" value="10" />

        <add key="public_warranty_sales_person_id" value="xxx"/>
        <add key="public_warranty_default_dealer_id" value="xxx"/>

        <add key="PhotoDefaultWatermark" value="xxx" />

        <add key="RenderCononical" value="YES" />

        <add key="MessageBirdSubject" value="xxx" />

        <add key="TagLine" value="Cars for sale."/>

    </appSettings>
    <system.web>
        <caching>
            <outputCacheSettings>
                <outputCacheProfiles>
                    <add name="CacheCompressedContent10Minutes" duration="600"/>
                </outputCacheProfiles>
            </outputCacheSettings>
        </caching>
        <customErrors mode="Off" />

        <sessionState timeout="60"></sessionState>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            </assemblies>
        </compilation>
        <authentication mode="Forms">
            <forms loginUrl="~/login" timeout="2880" />
        </authentication>
        <pages  validateRequest="false">
            <namespaces>
                <add namespace="System.Web.Helpers" />
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization" />
                <add namespace="System.Web.Routing" />
                <add namespace="System.Web.WebPages" />
            </namespaces>
        </pages>

        <httpRuntime maxRequestLength="1048576"  requestPathInvalidCharacters="" requestValidationMode="2.0"/>
        <httpModules>
            <add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
            <add name="ContentCompresser" type="MinifyContent.ContentCompresser, MinifyContent" />
        </httpModules>
    </system.web>
    <system.webServer>
        <urlCompression doStaticCompression="true" doDynamicCompression="true" />
        <staticContent>
            <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
        </modules>
        <handlers>
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

        </handlers>
        <httpRedirect enabled="false" destination="http://example.com/" exactDestination="false" httpResponseStatus="Found" />
        <security>

            <requestFiltering allowDoubleEscaping="true">
                <requestLimits maxAllowedContentLength="1073741824" />
            </requestFiltering>
        </security>

        <rewrite>
            <rules>
                <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
            </rules>
        </rewrite>

    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
                <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
                <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    </entityFramework>
    <resizer>
        <plugins>
            <add name="MvcRoutingShim" />
            <add name="SimpleFilters" />
        </plugins>
    </resizer>

</configuration>


text:
Q: How to place marginal notes in a center column between two independent text columns I have looked at \usepackage{multicol} and several other options, but none seems to provide a layout like this. Being still fairly new to LaTeX, I hardly know where to look for more information. Many packages seem to exist, so I am hoping someone here knows of one that addresses this requirement.
Please see the attached image for an example of the dual-language layout I seek with marginal references centered, for one language only, between them.

Thank you!

A: This can be done with the pair of packages reledmac and reledpar (successors to eledmac and eledpar, which succeeded ledmac and ledpar).
Here is a simple example, but note that many other modifications are possible.
\documentclass[]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{reledmac,reledpar}

\usepackage[latin,british]{babel}% just for this example
\usepackage{ragged2e}% \RaggedLeft = better line-breaking

\setlength{\Lcolwidth}{0.4\textwidth}
\setlength{\Rcolwidth}{0.4\textwidth}
\setlength{\ledlsnotewidth}{0.1\textwidth}
\renewcommand*{\ledlsnotefontsetup}{\RaggedLeft\footnotesize\sffamily}
\leftnoteupfalse% aligns start of note with position in main text; can
                % be a problem at the bottom of the page (but the
                % reverse causes problems at the top of a page)

\begin{document}

\begin{pairs}
  \begin{Leftside}
    \selectlanguage{latin}
    \beginnumbering
    \pstart

    {[1]} His ita gestis, accidit ut peccarent duo eunuchi, pincerna
    regis Aegypti, et pistor, domino suo. [2] Iratusque contra eos
    Pharao (nam alter pincernis praeerat, alter pistoribus), [3] misit
    eos in carcerem principis militum, in quo erat vinctus et
    Joseph. [4] At custos carceris tradidit eos Joseph, qui et
    ministrabat eis: aliquantulum temporis fluxerat, et illi in
    custodia tenebantur. [5] Videruntque ambo somnium nocte una, juxta
    interpretationem congruam sibi:

    [6] ad quos cum introisset Joseph mane, et vidisset eos tristes,
    [7] sciscitatus est eos, dicens: Cur tristior est hodie solito
    facies vestra? [8] Qui responderunt: Somnium vidimus, et non est
    qui interpretetur nobis. Dixitque ad eos Joseph: Numquid non Dei
    est interpretatio? referte mihi quid videritis. [9] Narravit
    prior, praepositus pincernarum, somnium suum: Videbam coram me
    vitem, [10] in qua erant tres propagines, crescere paulatim in
    gemmas, et post flores uvas maturescere:

    [11] calicemque Pharaonis in manu mea: tuli ergo uvas, et expressi
    in calicem quem tenebam, et tradidi poculum Pharaoni. [12]
    Respondit Joseph: Haec est interpretatio somnii: tres propagines,
    tres adhuc dies sunt: [13] post quos recordabitur Pharao
    ministerii tui, et restituet te in gradum pristinum: dabisque ei
    calicem juxta officium tuum, sicut ante facere consueveras. [14]
    Tantum memento mei, cum bene tibi fuerit, et facias mecum
    misericordiam: ut suggeras Pharaoni ut educat me de isto carcere:
    [15] quia furto sublatus sum de terra Hebraeorum, et hic innocens
    in lacum missus sum.

    [16] Videns pistorum magister quod prudenter somnium dissolvisset,
    ait: Et ego vidi somnium: quod tria canistra farinae haberem super
    caput meum: [17] et in uno canistro quod erat excelsius, portare
    me omnes cibos qui fiunt arte pistoria, avesque comedere ex
    eo. [18] Respondit Joseph: Haec est interpretatio somnii: tria
    canistra, tres adhuc dies sunt: [19] post quos auferet Pharao
    caput tuum, ac suspendet te in cruce, et lacerabunt volucres
    carnes tuas. [20] Exinde dies tertius natalitius Pharaonis erat:
    qui faciens grande convivium pueris suis, recordatus est inter
    epulas magistri pincernarum, et pistorum principis.

    [21] Restituitque alterum in locum suum, ut porrigeret ei poculum:
    [22] alterum suspendit in patibulo, ut conjectoris veritas
    probaretur. [23] Et tamen succedentibus prosperis, praepositus
    pincernarum oblitus est interpretis sui.

    \pend
    \endnumbering
  \end{Leftside}

  \begin{Rightside}
    \beginnumbering
    \pstart

    \ledleftnote{The first verse.}%
    {[1]} After this, it came to pass, that two eunuchs, the butler
    and the baker of the king of Egypt, offended their lord. [2] And
    Pharao being angry with them (now the one was chief butler, the
    other chief baker) [3] He sent them to the prison of the commander
    of the soldiers, in which Joseph also was prisoner, [4] But the
    keeper of the prison delivered them to Joseph, and he served
    them. Some little time passed, and they were kept in custody. [5]
    And they both dreamed a dream the same night, according to the
    interpretation agreeing to themselves:

    [6] And when Joseph was come in to them in the morning, and saw
    them sad, [7] He asked them, saying: Why is your countenance
    sadder today than usual? [8] They answered: We have dreamed a
    dream, and there is nobody to interpret it to us. And Joseph said
    to them: \ledleftnote{Doth not interpretation belong to God?: When
      dreams are from God, as these were, the interpretation of them
      is a gift of
      God.}%
    Doth not interpretation belong to God? Tell me what you have
    dreamed. [9] The chief butler first told his dream: I saw before
    me a vine, [10] On which were three branches, which by little and
    little sent out buds, and after the blossoms brought forth ripe
    grapes:

    [11] And the cup of Pharao was in my hand: and I took the grapes,
    and pressed them into the cup which I held, and I gave the cup to
    Pharao. [12] Joseph answered: This is the interpretation of the
    dream: The three branches are yet three days: [13] After which
    Pharao will remember thy service, and will restore thee to thy
    former place: and thou shalt present him the cup according to thy
    office, as before thou wast wont to do. [14] Only remember me,
    when it shall be well with thee, and do me this kindness: to put
    Pharao in mind to take me out of this prison: [15] For I was
    stolen away out of the land of the Hebrews, and here without any
    fault was cast into the dungeon.

    \ledleftnote{This is the verse about the chief baker}%
    [16] The chief baker seeing that he had wisely interpreted the
    dream, said: I also dreamed a dream, That I had three baskets of
    meal upon my head: [17] And that in one basket which was
    uppermost, I carried all meats that are made by the art of baking,
    and that the birds ate out of it. [18] Joseph answered: This is
    the interpretation of the dream: The three baskets are yet three
    days: [19] After which Pharao will take thy head from thee, and
    hang thee on a cross, and the birds shall tear thy flesh. [20] The
    third day after this was the birthday of Pharao: and he made a
    great feast for his servants, and at the banquet remembered the
    chief butler, and the chief baker.

    \ledleftnote{This is verse 21}%
    [21] And he restored the one to his place to present him the cup:
    [22] The other he hanged on a gibbet, that the truth of the
    interpreter might be shewn. [23] But the chief butler, when things
    prospered with him, forgot his interpreter.  \pend
    \endnumbering
  \end{Rightside}
\end{pairs}
\Columns

\end{document}


text:
Q: Paired t test or 2 sample t test I'm trying to test the hypothesis that there is no significant difference between the data below. I'm having trouble deciding whether I should use a paired sample t test or 2 sample t test. The sentence "In the 1990's a group of researchers reported the results of a study that
controlled for genetic and socioeconomic differences by examining 15 pairs
of monozygotic twins..." is making me lean towards using a paired t test. Although I'm still quite unsure.

A: Ask yourself 'Is each twin with schizophrenia uniquely matched with a twin without schizophrenia?'. If the answer is 'yes' then the study design is paired, if 'no' then they are independent groups.


text:
Q: setTimeout inside setTimeout inside a setInterval I'm trying to make a string that will write itself letter by letter until completing the sentence, and the speed of appearing each letter is based on an input that varies from 1 to 10. At the end of the string, it will blink for 5 seconds until that an alien will appear. My idea was to create a setInterval to add the letters and when the counter added the array size it would return the final animation of the loop with the new setInterval call, and before it was called again it had already been cleared, and called again in a recursion by setTimout callback to maintain the infinite loop. But it's not reaching setTimout, why?
//script.js
const speedInput = document.getElementsByClassName('speed--input')[0];
const alien = document.getElementsByClassName('alien')[0];
const textDiv = document.getElementsByClassName('text')[0];
const textShow = document.getElementsByClassName('text--show')[0];

const textDB = 'We go to dominate the world.';
const textStr = '';

let count = 0;
let speed = speedInput.value * 100;

const textChangeHandle = (count, textStr, textDB) => setInterval(() => {
  if (count < textDB.length) {
    textStr += textDB[count];
    textShow.innerHTML = textStr;
    textDiv.style.width = `${40 * count}px`;
    count++;
  } else {
    textShow.style.animation = 'bip 1s linear 1s infinite'
    return () => {
      setTimeout(() => {
        textShow.style.animation = '';
        textStr = '';
        count = 0;
        textShow.style.opacity = 0;
        alien.style.opacity = 1;

        setTimeout(() => {
          alien.style.opacity = 0;
          textShow.style.opacity = 1;
          textChangeHandle(count, textStr, textDB)
        }, 5000)
      }, 5000);
      clearInterval(textChangeHandle);
    }
  }
}, speed)

textChangeHandle(count, textStr, textDB);

//index.html
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="style/style.css">

  <title>Document</title>

    Speed
    <input class="speed--input" type="number" min="1" max="10" value="1">

//style.css
*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background-color: #3cd070;
}

.text {
  position: fixed;
  top: 50%;
  left: 50%;
  height: auto;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  font-size: 40px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.text .alien {
  opacity: 0;
  height: 600px;
  width: auto;
  margin-bottom: 50px;
  position: absolute;
}

.text .text--show {
  font-size: 40px;
  width: 100%;
  position: absolute;
  display: block;
  text-align: center;
  -webkit-animation: bip 1s linear 1s infinite;
          animation: bip 1s linear 1s infinite;
}

.speed {
  position: fixed;
  top: 90%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.2);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  padding: 10px 20px;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.speed .speed--input {
  border: 0;
  outline: 0;
  width: 40px;
  height: 25px;
  margin: 10px;
  text-align: center;
}

@-webkit-keyframes bip {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes bip {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

A: There is also the animation frame api
It will run your function exactly before the next "natural" repaint of the browser.
Additionally and probably useful in your case, it will pass the current time in your callback, so you can take a time detail and animate according to this. That way you can get a smooth animation of equal length for everyone, even when the frame rate is inconsistent.
Consider the following snippet, which will basically cause an infinite loop.
function draw(now) {
   requestAnimationFrame(draw)
}

requestAnimationFrame(draw)

Now you only need to remember the time and take the time delta next time the function is called. If enough time has passed, you can write another character. (Normally you would change a value divided by the time delta, but since you have characters, they will be either there or not.
let speed = 300
let timePassedSinceLastChar = 0
let then = null

function draw(now){
  now *= 0.001;
  const deltaTime = now - then;
  then = now;
  timePassedSinceLastChar += deltaTime;
  if (timePassedSinceLastChar >= speed) {
     drawChar()
     timePassedSinceLastChar = 0
  }
  requestAnimationFrame(draw)
}

requestAnimationFrame(draw)

Furthermore, the requestAnimationFrame function returns the id of the requested frame. That allows to cancel the loop.
const frameId = requestAnimationFrame(draw)
cancelAnimationFrame(frameId)

So the final code could look something like this.

const textDB = 'We go to dominate the world.';
let charIndex = 0;
let frameId = null
let then = 0
let sinceDraw = 0
let speed = () => Math.random() * 0.4 + 0.05 // randomize the speed a bit
let $p = document.querySelector('p')

function draw(now) {
  // cancel on end of string
  if (charIndex >= textDB.length) {
    cancelAnimationFrame(frameId)
    console.log('done')
    return
  }

  // get the time delta
  now *= 0.001; // convert to seconds
  const deltaTime = now - then;
  then = now;
  sinceDraw += deltaTime

  // if its time to draw again, do so
  if (sinceDraw >= speed()) {
    let char = textDB[charIndex]
    $p.textContent += char
    charIndex++
    sinceDraw = 0
  }
  // request another frame
  frameId = requestAnimationFrame(draw)
}

// request the first frame
frameId = requestAnimationFrame(draw)

A: The issue is that in the else statement, you are returning a function that is never called.
return () => {
  setTimeout(() => {
    textShow.style.animation = '';
    textStr = '';
    count = 0;
    textShow.style.opacity = 0;
    alien.style.opacity = 1;

    setTimeout(() => {
      alien.style.opacity = 0;
      textShow.style.opacity = 1;
      textChangeHandle(count, textStr, textDB)
    }, 5000)
  }, 5000);
  clearInterval(textChangeHandle);
}

Just remove the return statment and call the setTimeout function directly.
const textChangeHandle = (count, textStr, textDB) => setInterval(() => {
  if (count < textDB.length) {
    textStr += textDB[count];
    textShow.innerHTML = textStr;
    textDiv.style.width = `${40 * count}px`;
    count++;
  } else {
    textShow.style.animation = 'bip 1s linear 1s infinite'
    setTimeout(() => {
      textShow.style.animation = '';
      textStr = '';
      count = 0;
      textShow.style.opacity = 0;
      alien.style.opacity = 1;

      setTimeout(() => {
        alien.style.opacity = 0;
        textShow.style.opacity = 1;
        textChangeHandle(count, textStr, textDB)
      }, 5000)
    }, 5000);
    clearInterval(textChangeHandle);
  }
}, speed)

A: I found the solution. With setInterval, the code was creating multiple instances of callbacks and overloading memory.
///script.js
const textEl = document.getElementById('text');
const inputEl = document.getElementById('input');
const alienEl = document.getElementById('alien');

const text = 'We go to dominate the world!';

let idx = 0;
let speed = 300 / inputEl.value;

writeText();

function writeText () {
  if(idx === 0) setTimeout(() => textEl.style.opacity = 1, speed)

  textEl.innerText = text.slice(0, idx);

  idx++;

  if (idx > text.length) {
    idx = 0;
    textEl.style.animation = 'bip 1s linear 1s infinite';
    setTimeout(() => {
      textEl.style.animation = ''
      textEl.style.opacity = 0;
      setTimeout(() => {
        alienEl.style.opacity = 1;
        setTimeout(() => {
          alienEl.style.opacity = 0;
          setTimeout(writeText, speed);
        }, 5000)
      }, 1000);
    }, 5000)
  } else {
    setTimeout(writeText, speed);
  }
}

inputEl.addEventListener('input', (e) => speed = 300 / e.target.value);


text:
Q: Performance issue in using SELECT *?
Possible Duplicate:
Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc
What is the reason not to use select *?

Is there any performance issue in using SELECT * rather than SELECT FiledName, FiledName2 ... ?

A: The only performance issue will be if your application only needs a subset of the fields returned by select *.  There is no performance difference in the database as they are effectively the same thing.

A: Every time you do a select *, there is may be an additional query to get the list of columns.  In high transaction environments this could become a visible overhead, but once every now and then will make no difference.
Also, when inserting records, never use select * in an insert in case columns are added.

A: I don't know about computing performance but in terms of read/maintain-ability (i.e. Human Performance) we don't use select * at my shop.  Everything is explicitly selected.

A: I'm not a DBA, but from what I recall learning from our DBA, the reasoning (at least with SQL Server) is that the DB caching algorithms don't cache '*' queries well, but if you are running the same query with exact columns specified multiple times, it will cache that well.
I'm sure a more knowledgeable DBA could go into the exact details of how the caching mechanism works, but that's why there is a performance hit.
NOTE: Caching performance only works if the query is going to be run multiple times, especially in a small time frame, so otherwise you would see no performance difference.

A: Maybe. It depends largely on the database engine, how it stores stuff, how many rows are coming back, how many other columns there are and the sizes of the other columns.
If you are using a row-based database (i.e. most of them) which stores all the columns together (almost all do, except for BLOBs which are often stored separately, especially the larger ones), then doing SELECT * has little impact on the server itself - it has to fetch the entire row anyway.
On the other hand, if you're sending the data over a network (or even locally, as it'll impact the size of buffers used etc), then it may help to have fewer columns, as there will be fewer bytes to send back. This difference could be dwarfed anyway by server performance if the query is in any way difficult (e.g. requires IO).
If you have big blobs in the rows, SELECT * is not very clever - otherwise, it's unlikely to make much difference, but could.
There are a few "column based" database engines knocking around - they are completely different - for them, "SELECT *" is a total performance killer; be sure to avoid it. The chances are, if you're using one, you are completely aware of this though (typically they're used for very large datawarehouse apps).
For me, the main advantage of not using "SELECT *" is maintainability. You get no surprises when someone adds extra columns to the table; your query "fails fast" when someone removes one of the columns you were using. It makes the code more self-documenting as someone can casually see what columns you wanted.

A: If you need a subset of the columns, you are giving bad help to the optimizer (cannot choose for index, or cannot go only to index, ...)
Some database can choose to retrieve data from indexes only. That thing is very very helpfull and give an incredible speedup. Running SELECT * queries does not allow this trick.
Anyway, from the point of view of application is not a good practice.

Example on this:

*

*You have a table T with 20 columns (C1, C2, ..., C19 C20).

*You have an index on T for (C1,C2)

*You make SELECT C1, C2 FROM T WHERE C1=123

*The optimizer have all the information on index, does not need to go to the table Data

Instead if you SELECT * FROM T WHERE C1=123, the optimizer needs to get all the columns data, then the index on (C1,C2) cannot be used.
In joins for multiple tables is a lot helpful.

A: Take a look at this post:
What is the reason not to use select *?
and these:

*

*Performance benefit when SQL query is limited vs calling entire row

*Which is faster or best, select * or select column1 colum2 column3

*SQL query question select * from view or select col1 col2 col3 from view

*Which is faster, select * or select column1 column2 etc

A: If all fields are specified, then no, there shouldn't be a meaningful difference performance-wise. But if you just want a couple specific fields from a table with a dozen columns, it's slower.
There are readability and maintainability issues with SELECT *. It makes sense to use specific field names all the time, even if you want to select all fields.

A: Performance, not much.  It's just a bit clumsy: in a table, say, with 10 columns, joined on two other tables or even more, particularly with large result sets, SELECT * can return dozens of columns, often with mostly unused or even useless data.  In terms of the hit on the DBMS, there wouldn't be much, but all that data still needs to travel across the wire somehow; network bandwidth and consequent latencies certainly add up.  I've seen this first-hand in high-volume environments.  It definitely matters.
Aside from the bandwidth issues, you can also run into ambiguous column-naming problems (disambiguating usually means removing SELECT * anyway, so you might as well do it from the start), and it's also considered good practice to be explicit about the needs of the code inside the code; doing so helps in lots of ways -- with debugging, with collaborating, etc.

A: If you use select * in a join then you are automatically sending more information than you need becasue the join field(s) are repeated. This is a waste of processing time and network resources and can cause performance problems. Further not specifying the fields means that your application can break when new fields are added especially if they are fields that the user is not intended to see but which are there for auditing or database type processing. Select * in an insert is always a bad idea as somewhere along the line some somen who is less than smart may actually change the order of the columns in the table .

A: Supposedly yes.  I'm whole-heartedly told at work that I should never use SELECT *.  In fact, it's in our policy not to use it because a) it means there's ambiguity in what is used and what's available just by looking at the query and b) it's slower as the SQL server has to find each column it needs and return them.
I've never seen any proof of this, however.
EDIT: Also, if a stored procedure is compiled on the server and uses SELECT *, when the underlying table structure changes supposedly it won't select back the newly introduced columns as SQL compiles SELECT * down to the individual columns.

A: SELECT * is translated to SELECT Field1 , Field2 .... etc before it is run so they are effectively the same thing. No difference in performance.
However, readability and maintaiability are better when its SELECT Field1 , Field2 ..

A: Technically, it would depend on the relational database management system you are using. I think the performance hit would be microseconds. If you are absolutely trying to squeeze the last bit of performace out of your system, I would say don't use them.
I personally use it all the time.

A: If you are only using a subset of the fields, then the performance difference can be substantial.  See the following example, which involves retrieving 1,411,771 rows from CScout's analysis of the Linux code.
$ time sh -c "echo 'select * from IDS' | mysql cslinux >/dev/null"
real    0m5.622s
user    0m2.580s
sys     0m0.532s

$ time sh -c "echo 'select EID from IDS' | mysql cslinux >/dev/null"
real    0m4.492s
user    0m0.716s
sys     0m0.096s

An this is not even measuring the performance impact on the server.

A: If your embedding sql in code then your should always use the long form for clarity, not performance.  For ad-hoc queries the select * syntax is ESSENTIALLY no less efficient than specifying column names unless you have a massive number of columns which you shouldn't unless you're denormalizing.
I should get 1 point for using 2 unlesses in a sentence and still habving it make sense!! :)

A: SELECT * requires SQL to find all the column names however this is not the biggest performance hit by a long shot.
The biggest performance hit of a SELECT * statement is when you are performing a query which requires a Nonclustered index to evaluate.  Even if the nonclustered index is a covering index of every column, SQL will still look up the primary key and get the values from the clustered index.
On top of this, if you only need one or two columns, you have the network bottleneck to deal with due to returning a bigger result set than required.

A: I will echo what others have said regarding "select *" retrieving a list of columns as part of the request handling.  By contrast, you can also select columns by ordinal, which saves even more time since the RDBMS engine doesn't even need to look up the column to determine the position of the column to retrieve.  I find this highly useful for aggregate queries.
For example: select count(1) from ... versus select count(*) from ...
In this example, the RDBMS only needs to know that it needs the count of the first column, and ZING, it's off.  In the (unfortunately) more common select count(*), the RDBMS retrieves a list of all the columns, and then verifies each row to determine if it's valid for counting (as opposed to validating the 1st column only).
This works great most of the time.  I'm pretty sure most DB systems count NULL values in the count, but you should watch out for this and verify before assuming.
YMMV, void where prohibited, etc.!

A: Performance
This will always be bad if you do not NEED all the columns. Returning more data than is needed will throttle the database and your lan/wan bandwidth.
Readability
Knowing which columns are in the view, procedure can be very useful , SELECT * is not helpful at all and I would consider it counter-productive.
*Testing
If you make a schema change, all your code that use SELECT * within should be invalidated because any tests you write to check metadata should check the output of the view, proc.
*Of course, assuming you have tests in place as all good DB Dev's should have :)

A: I agree with just about all the answers except certain performance claims. If you are actually going to use all the columns in the table, I'd argue the SELECT * version is a smidgen faster. Here's why:
Take these two queries on a table where there is a unique index on (id,x):
SELECT x,y,z,w FROM tab WHERE id='abc' ORDER BY s

SELECT x,y,z,w FROM tab WHERE id='abc'
AND x in ('a','b','c','d','e','f','g','h',...)
ORDER BY ('a','b','c','d','e','f','g','h',...)

Which is faster? If the 'x in' clause names all the values for x in the table for id 'abc' then the first query is probably faster. Now let's rename these fields:
SELECT field_name, field_type, field_offset, field_len
FROM internal_field_catalog
WHERE table_name = 'abc'
ORDER BY field_order

So when retrieving the data, the SELECT * allows the engine to do (the equivalent of) a single memcpy to move the row data to the result set and when retrieving the field data it probably is selected faster.
All I'm saying is there is an edge case where SELECT * is perfectly useful and probably faster. One reason you might always need all columns from a table is when storing object persistence in an RDBMS (for some reason). To every rule of thumb there is an exception.


text:
Q: Bluetoothctl GATT mysterious output byte I use bluetoothctl (a Linux command line tool based on BlueZ) to read a BLE GATT heart rate sensor (I select the heart rate measurement attribute then use "notify on").
In the previous bluetoothctl version, here was an output sample:
[CHG] Attribute /org/bluez/hci0/dev_F7_AD_24_25_D4_05/service000c/char000d Value: 0x00 //flags
[CHG] Attribute /org/bluez/hci0/dev_F7_AD_24_25_D4_05/service000c/char000d Value: 0x40 //HR

In the current version, here is another output sample:
[CHG] Attribute /org/bluez/hci0/dev_A0_9E_1A_3B_6F_24/service0026/char0027 Value:
  00 4c                                            .L

So, all bytes are now on the same line, OK, but there is now an extra byte at the end (".L") whose meaning I don't know (not in the GATT spec) but whose content varies. The bluetoothctl documentation is unfortunately rather sparse (https://docs.ubuntu.com/core/en/stacks/bluetooth/bluez/docs/reference/gatt-services) and is of no help to me.
Does anyone know if this byte has any meaning, and if so, how to interpret it?

A: It seems to first print the bytes in hex and then in ascii. It prints "." for the 0x00 byte and "L" for the 0x4c byte.


text:
Q: Clear all subdirectories, but not remove them in NAnt How to clear subdirectories without removing them in NAnt?
As the result of script execution, I need a directory with the same subdirectories, but empty:
<delete>
  <fileset basedir="\\${conf.server.frontend}\wwwroot">
    <include name="???" />
  </fileset>
</delete>

A: This is what you need:
<delete>
    <fileset basedir="\\${conf.server.frontend}\wwwroot">
        <include name="**\*" />
    </fileset>
</delete>


text:
Q: Can you define the parameters of a Apache Commons Command Line to feed to a method? I have been recently running JUnit on some code and ran across an issue that I haven't been able to figure it out.
The application is run in Linux and therefore uses Apache Commons CLI.
In the code that i am testing, i ran across this method, code has been generalized
public void processCmdl (CommandLine cmdl) throws Exception

I also came across
public CommandLine getCmdLine() {return this.commandLine}

In my testing, both of these return Null to my tests and cause the tests to fail with null pointer exception errors.
My question is, is there anyway to define the parameters of the CommandLine object? so that it can be passed to the methods or defined in them so that they can be returned?  The methods will then process the CommandLine using Options and Parsers.
I know that the main(String[] args) uses a String[] to handle the arguments from the command Line.
I just want to see if there was anyway to define parameters of the CommandLine ie.
java run.jar -p param.....

so that when the Command line object is read, there are no null values that kick the tests out.
Thank you!!!


text:
Q: Postfix POP3 NOQUEUE: reject: RCPT error I am getting an NOQUEUE: reject: RCPT error when trying to send mail via POP3 and Postfix (note: IMAP works fine).
Feb 21 06:57:04 r2d2 dovecot: pop3(br@telecomm.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
Feb 21 06:57:05 r2d2 dovecot: pop3-login: Login: user=<br@telecomm.com>, method=PLAIN, rip=67.85.57.155, lip=107.191.60.48, mpid=65868, TLS, session=<iwJKrZMPpABDVTmb>
Feb 21 06:57:05 r2d2 dovecot: pop3(br@telecomm.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
Feb 21 06:58:06 r2d2 postfix/smtpd[65869]: connect from ool-4355399b.dyn.optonline.net[67.85.57.155]
Feb 21 06:58:07 r2d2 postfix/smtpd[65869]: NOQUEUE: reject: RCPT from ool-4355399b.dyn.optonline.net[67.85.57.155]: 554 5.7.1 <ool-4355399b.dyn.optonline.net[67.85.57.155]>: Client host rejected: Access denied; from=<br@telecomm.com> to=<br@telecomm.com> proto=ESMTP helo=<Bradmini>
Feb 21 06:58:08 r2d2 postfix/smtpd[65869]: lost connection after RCPT from ool-4355399b.dyn.optonline.net[67.85.57.155]
Feb 21 06:58:08 r2d2 postfix/smtpd[65869]: disconnect from ool-4355399b.dyn.optonline.net[67.85.57.155]

SSL and all else appears to work correctly, just outbound POP3 won't send to gmail
I am testing on Outlook and SSL is selected with port 587
postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 4
debug_peer_list = 127.0.0.1
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = /usr/local/share/doc/postfix
inet_protocols = ipv4
mail_owner = postfix
mailman_destination_recipient_limit = 1
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydomain = ex-mailer.com
myhostname = r2d2.ex-mailer.com
mynetworks =
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf list.zippy-mail.com
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_authorized_verp_clients = permit_sasl_authenticated
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_helo_restrictions = permit_sasl_authenticated
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_sasl_authenticated, defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated
smtpd_tls_CAfile = /etc/ssl/postfix/smtpd.pem
smtpd_tls_cert_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_key_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/usr/local/etc/postfix/transport
unknown_local_recipient_reject_code = 550
vacation_destination_recipient_limit = 1
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:125
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_limit_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_maildir_limit_message = Sorry, this user has overdrawn their diskspace quota. Please try again later.
virtual_minimum_uid = 125
virtual_overquota_bounce = yes
virtual_transport = virtual
virtual_uid_maps = static:125

A: Your Outlook mail client, as shown in your image:

is not set to use SASL authentication.  Outlook's "Outgoing Server" dialogue may not be self-explanatory: "Log on to incoming mail server before sending mail" means do not SASL authenticate, but POP first.  However, your Postfix settings require SASL:
smtpd_client_restrictions = permit_sasl_authenticated

It's not clear what you want to do from your question.  If you really want POP-before-SMTP, you will need to run a daemon such as pop-before-smtp to read your mail logs and add IP addresses to a db file that postfix/smtpd reads, like this:
smtpd_client_restrictions = permit_sasl_authenticated, check_client_access hash:/var/lib/pop-before-smtp/pop.db

Otherwise, just select "Use same settings..." as the authentication method in the mail clients and use SASL.


text:
Q: Getting error message from CStdioFile::Open()? If CStdioFile::Open fails, I want to be able to report the cause of the error.
However, it appears as though it never throws an exception. Also, when I try the following:
CStdioFile file;

CFileException exc;
bool bSuccess = (file.Open(_T("FileDNE"), _O_RDONLY, &exc) == TRUE);
ASSERT_FALSE(bSuccess);

CString err;
exc.GetErrorMessage(err.GetBufferSetLength(255), 255);
std::cout << CStringA(err);

an assertion gets tripped somewhere low down in exc.GetErrorMessage:
ASSERT(afxCurrentResourceHandle != NULL);

I've read this happens when I don't use a try-catch block. But why use a try-catch block when Open doesn't throw any exceptions?
Any ideas on how to report Open errors would be helpful!

A: See CStdioFile::CStdioFile examples.


text:
Q: How to do visible component if backend refresh token success Method in authService, which send request to backend server and get response as json with access token
 refresh() {
        if (JSON.parse(localStorage.getItem('auth')) !== null && JSON.parse(localStorage.getItem('auth')) !== undefined) {
          const body = ...
          let headers = ...
          return this.http.post(this.authUrl, body.toString(), {
            headers
          });
        }
      }

Method which above works correctly
In navbar component haves button:
<button mat-menu-item (click)="addTrip()" *ngIf="isLogged()">
  <mat-icon>add</mat-icon>
  add Trip
</button>

which must be visible only if exist token in localStorage and if this token isn't expired
The method isLogged doesn't work as needed. Call subscribe this.auth.refresh.subscribe(..... return true or false ? ...) is impossible, because subscribe is unsynchronized method. How in first to get token and after return boolean value?
 isLogged() {
   if (JSON.parse(localStorage.getItem('auth')) !== null && JSON.parse(localStorage.getItem('auth')) !== undefined)   {
     this.auth.refresh();
   } else {
     return false;
   }
 }


text:
Q: Why does TensorFlow's sampled softmax loss stop gradients on sampled classes? The backbone of TensorFlow's sampled loss functions nce_loss and sampled_softmax_loss is a helper function in tensorflow.python.ops.nn_impl called _compute_sampled_logits.
_compute_sampled_logits takes as input:

*

*weights and biases of the final layer,

*the output labels

*the inputs to the final layer inputs

*the sampled values of the output layer

and return the logits and labels of only the requested sampled labels.
One of the first (line 1046) ops executed in _compute_sampled_logits is
sampled, true_expected_count, sampled_expected_count = (
        array_ops.stop_gradient(s) for s in sampled_values)

This line seems like it is stopping gradients flowing back through the sampled values if i'm reading it correctly.
My questions is: Shouldn't the gradients be stopped from flowing back through the non-sampled values as opposed to the sampled values? Why do we want to stop gradients flowing back from the sampled values?
`


text:
Q: Удаление элементов из массива STL дан одномерный статический массив из 15 элементов, нужно удалить из него все элементы значение которых превышает 5
for (int i = 0; i < lim; i++)
{
    if (arr[i] > sred)
    {
        for (j = i; j < lim; j++)
        {
            arr[i] = arr[i + 1];
        }
        --lim;
    } else { }
}
cout << endl;
for (int i = 0; i < lim; i++)
{
    cout << arr[i]<<" ";
}

lim - кол-во элементов массива, sred - число, элементы больше которого должны удаляться

A: Раз уж у вас указан STL то посоветую использовать именно алгоритмы stl для улаления элементов из вектора. В частности использовать идиому remove-erase:
  auto last_iter =
      std::remove_if(arr.begin(), arr.end(), [](int val) { return val > 5; });
  arr.erase(last_iter, arr.end());

Благодаря этому проблема решается в две строчки (можно и в одну, но так читабельнее) при этом это позволяет избежать излишних затрат на копирование при удалении из середины массива

A: Ладно, вот:
int i;
// А есть ли вообще такие элементы?
for(i = 0; i < lim; ++i) if (arr[i] > sred) break;
if (i < lim)  // Если таки есть...
{
    // i - индекс, КУДА писать (очередной)
    // j - ОТКУДА (очередной нормальный, меньше sred
    for(int j = i; ++j < lim; )
        if (arr[j] <= sred)
            arr[i++] = arr[j];
}
lim = i;

Пример полной программы: https://ideone.com/LBgRt4
Вот как примерно работает - i - индекс, куда мы пишем хороший элемент, а j - какой именно элемент пишем. Как только находим хороший - копируем его в конец хороших элементов и идем дальше.
Номер:    0   1   2   3   4   5   6   7   8   9  10  11  12  13  14      i    j
Элемент:  1   2   3   4   5   6   7   8   2   3   4   5   6   7   0
Нашли первый: ... 3   4   5   6   7   8   2   3   4   5   6   7   0      5
for(int j = i; ++j < lim; ) if (arr[j] <= sred)                               8
arr[i++] = arr[j];    4   5   2   7   8   2   3   4   5   6   7   0      6
for(int j = i; ++j < lim; ) if (arr[j] <= sred)                               9
arr[i++] = arr[j];    4   5   2   3   8   2   3   4   5   6   7   0      7
for(int j = i; ++j < lim; ) if (arr[j] <= sred)                              10
arr[i++] = arr[j];    4   5   2   3   4   2   3   4   5   6   7   0      8
for(int j = i; ++j < lim; ) if (arr[j] <= sred)                              11
arr[i++] = arr[j];    4   5   2   3   4   5   3   4   5   6   7   0      9
for(int j = i; ++j < lim; ) if (arr[j] <= sred)  (12,13-плохие)              14
arr[i++] = arr[j];    4   5   2   3   4   5   0   4   5   6   7   0     10
Выход из цикла
В массиве - 10 чисел


text:
Q: Java Object Oriented Design Question: update internal state or return new object This is a design question.  The design is pseudo-code and represents a small example but I may add a lot more methods, data, logic in the future.
In this example, I am considering two approaches.  In the execute method below, should I return an immutable "data/bean/model" object with the output of the execute method or update the state of the BusinessLogic class.
The both accomplish the same goal, I want the result of execute and either the data should be contained in a bean container or in the internally in the BusinessLogic class.
I am kind of favoring just having the BusinessLogic class because SomeObject is just a useless bean that doesn't do anything.
What are your thoughts?
public class SomeObject  {
    private String data1;
    private String data2;
}

public class BusinessLogic {

    private final IWebObject webObject;

    /* String data1; String data2 */

    public BusinessLogic(final IWebObject webObject) {
        this.webObject = webObject;
    }

    // Approach 1
    public SomeObject execute() {
        return new SomeObject();
    }

    or
    ...
    ...

    // Approach 2
    public void execute() {
        // Do something
        this.data1 = "data1";
        this.data2 = "data2";
    }

    public String getData1() { }
    public String getData2() { }

} // End of the Class //

My only problem with approach 2 is that data1 and data2 won't be immutable so.  I can call execute arbitrarily and change those values.

A: If the main purpose of the method would be to execute and not return anything, I would personally go with your second approach and keep the data internally inside the BusinessLogic class.

A: For the most part, I'd say it depends on the nature of the code that's calling the execute() method.  If it's going to just be reading the results as-is, then keeping it in the BusinessLogic class would be fine.  If you're going to be passing the results around to different methods, you should put the results in a separate class (you could have BusinessLogic implement an interface that contains just the result methods, but that could blur the line between where the BusinessLogic implementation ends and where the result implementation begins).
To start with, it'd probably be best to keep it internal -- following the "You Ain't Gonna Need It" principle.  When the time comes where you can see that you are going to need to pass the results around to other methods and other objects, you can refactor it to suit your needs at the time.

A: This isn't a general object-oriented design question - it depends on the domain you're trying to model.

*

*Should execute change the state of BusinessLogic or not? (Option 2)

*How is that class being consumed? Are data1 and data2 used in a different way? In a different context? (Option 1)

*Do data1 and data2 have different lifetimes than BusinessLogic? (Option 1)


text:
Q: Expression for external magnetic field of a cylindrical bar magnet? I would like to calculate the magnetic force of a cylindrical bar magnet on a steel ball bearing, which is a distance away in a straight line from one of its poles. What is the expression for this?
Ultimately would like to find the work done on the ball bearing due to magnetic force.

A: I'm afraid it it is a very hard task to calculate the force. Just to outline the steps as they came to my mind:

*

*Find the magnetic field around a cylindrical bar magnet. (You need to have some input, though, such as the magnetization inside). I'm afraid there is no simple expression for it but it can be calculated numerically: see arXiv:0909.3880 or this wolfram demo.

*Find the magnetic permeability $\mu=\mu_0(1+\chi)$ of the material (or its susceptibility $\chi$) [note that this is not a very good description for feromagnets, however], find the magnetic field inside the bearing so that the Maxwell equations $\nabla\cdot \vec B = 0$ and $\nabla \times (\vec B / \mu) = 0$ are fulfilled inside, outside and on the border od the steel body.

*Calculate the magnetic force by integrating $ \vec F = \int\nabla( \vec M \cdot \vec B) = \frac{\chi}{(\chi+1) \mu_0 }\int \nabla(B^2)$ over the volume of the bearing.