text:
Q: laravel чтение файлов конфигурации по требованию laravel при загрузки читается сразу все файлы из /config/. Часть конфигурационных файлов нужна при определённых действиях которые выполняются отдельной задачей. В итоге получается так что он загружает всё подряд. А хотелось бы, чтобы загружал только необходимое, а остальные при первом запросе.
Т.е. например есть файлы:
/config/app.php
/config/database.php
/config/other.php

Хотелось бы чтобы laravel загрузил при bootstrap только:
/config/app.php
/config/database.php

а дополнительный файл конфигурации
/config/other.php

только если сделаю обращение:
config('other.name');

Laravel 8.83.27

A: так это не работает к счастью/сожалению. Когда Вы заходите на страницу, то загружается index.php он делает все основные манипуляции для запуска ядра ларавель. То есть подгружает библиотеки (autoload), читает конфиги, формирует провайдеры и фасады из этих конфигов. формирует маршруты, консольные команды регистрирует и так далее и после собранные данные собираются в app.
получить который вы можете например так: app(). Там будет всё что касается вашего приложения на момент обращения к странице.
Далее выполняется ваш запрос. И это работает каждый релоад браузера. Так как после перезагрузки страницы память очищается и всё что было загружено удаляется из памяти сборщиком. Поэтому за этим не следим при разработке.
В процессе Runtime всё это не будет создаваться постоянно, а браться уже из существующих. Или использоваться singleton объекты, если где-то вызывается создание объекта который зарегистрирован как singleton.
Что касается Вашего вопроса. Для того чтобы чтение некоторых частей систем было быстрее в несколько раз. Например при получении конфигов есть config:cache и route:cache команда. В результате пусть у вас хоть 100 файлов конфигов будет создано, если они в кеше чтение их будет моментальное и что-то читать в определённый момент не имеет смысла. В качестве кеша можно использовать Redis например.
Если Вам принципиально именно такое поведение.
Можете сделать ваши конфиги в бд в таблице settings.
и свой хелпер db_config('other.name') где он будет обращаться к вашему сервису
SettingService, а он в свою очередь по требованию будет делать селект из бд и добавлять в массив $settings и если уже есть в массиве, то повторно не грузит. А конфиги ядра которые загружаются всегда(для каких-либо сервисов и библиотек) оставить как есть. В результаты вы можете ваши конфиге в админке редактировать их динамически
Пример
db_config('other.name') // вернет из вашей бд
db_config('database.connections') // вернёт конфиг из файловой системы (проверит массив, потом в бд и вызовет дефолтную функцию config('database.connections')


text:
Q: FAILED (remote: unknown command) fastboot oem unlock in adb I tried everything, I have a SAMSUNG GALAXY A02s. I want to unlock the bootloader of my device.
I have enabled OEM unlocking
I have enabled USB debugging
^^ ---> developer options..
I also deleted the two adb key files in C:\users\{USER}\.android
STILL I can't unlock my bootloader via fastboot...

*

*I did: fastboot OEM unlock --> FAILED

*I did: fastboot oem unlock --> FAILED

*I did: fastboot flashing unlock --> FAILED

*I did: fasboot oem unlock {SERIAL NUMBER/DEVICE NAME} --> FAILED

*I did: fastboot oem unlock critical --> FAILED

*I did: fastboot oem unlock_critical --> FAILED

I also changed my drivers lots of times. So the drivers are fine.
Everytime I do fastboot oem unlock . it gives me::::::
ERROR: FAILED (remote: unknown command)
Please someone help me.

A: Yoh, in order to unlock oem, go to download mode on your samsung phone. There should be 3 option. One for installing custom room, the other for boot unlocker and the other to cancel downmode. Just try it that way.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Whats the recommended way to update every instance of a source model when a new target instance is created in a manytomany model? I have a website where I want to display a basic html table like so:
Product_Name | Attribute_1 | Attribute_2
-----------------------------------------
Soap         | True        | True
Shampoo      | False       | True

So I have created the classes Product and Attribute with a ManyToMany relationship.
Models.py
class Product(models.Model):
    name = models.CharField(max_length=10)
    attributes = models.ManyToManyField(on_delete='CASCADE')

class Attribute(models.Model):
    name = models.CharField(max_length=1, default='N')

So I have two Attribute instances - Attribute_1 and Attribute_2.
When I create a new attribute (Attribute_3), is there a way I can update the relationships of all of my Product instances with a link to the new Attribute?
I know that Django creates a through table for m2m relationships. According to the docs, I know I can do something like:
for prod_obj in Product.objects.all():
    prod_obj.add(new_attribute_object)
But how do I ensure this happens automatically/consistently every time I create an attribute object?

A: You should write a custom save method for your Attribute model that a) checks to see whether the Attribute object is being created for the first time; and b) if so, adds that Attribute to each Product in your database. For more information on writing a custom save method, see this post.


text:
Q: iText removes signatures (flattening process) but keeps their visual representation I used the function from the following link to remove all the signatures from a pdf.
iText Remove signatures
What I got was a pdf without the signatures but with their visual representation in the pdf content. Isn't there a function that removes the visual representation too ?
I need this because I want to calculate the hash of the original pdf. Thanks !

A: You claim: I used this function from the following link to remove all the signatures from a PDF, but that example isn't meant to remove the signatures, it's meant to flatten the signatures (the example is called FlattenSignatures).
Flattening means that the signature field is removed (the signature is gone), but that the corresponding widget annotation (the visual representation as you call it) is preserved.
If you want to remove a signature field and its widget annotations, you need to remove the field:
PdfReader reader = new PdfReader(src);
AcroFields acroFields = reader.getAcroFields();
acroFields.removeField("my_signature_name");
PdfStamper stamper = new PdfStamper(reader, dest);
stamper.close();
reader.close();

However, you claim I need this because I want to calculate the hash of the original pdf. That is totally wrong. Removing the signature won't result in the original PDF!
If you want to verify the signature, you should extract the byte range from the PDF as defined in the signature dictionary. See Verifying digital signatures in PDF documents. Note that you have asked this question before, and that it was already adequately answered: iText verify integrity of a pdf in java.
Unless the signature was added in append mode (something I wouldn't assume if I were you), there is no way for you to get the original PDF. Do you know if the signature was added in append mode? If so, please add this information to your question.

A: If the signature has been added in append node you can use the below listed code to remove the signature:
 PdfReader reader = new PdfReader(src);
    AcroFields acroFields = reader.getAcroFields();
    ArrayList<String> signatureNames = acroFields.getSignatureNames();
    if(!signatureNames.isEmpty()) {
          PdfStamper stamper = null;
          try {
               stamper = new PdfStamper(reader, dest);
               for (String name : signatureNames) {
               AcroFields.Item signature = (AcroFields.Item) stamper.getAcroFields().getFieldItem(name);
               for (int i = 0; i < signature.size(); ++i) {
                    signature.getWidget(i).clear();
                    signature.getMerged(i).clear();
                    signature.getValue(i).clear();
              }
           }
        } finally {
         if (stamper != null) {
          stamper.close();
         }
       }
    }

If you also need to remove the embedded signature dictionary you can use:
PdfDictionary dictionary = stamper.getAcroFields().getSignatureDictionary("signature_name");
if(dictionary!=null){
   dictionary.clear();
}


text:
Q: How to bind Selected Folderpath along with its Foldername to textbox while dealing with FolderBrowserDialog Box? The following is my code...By this, I can get FolderBrowserDialog Box, but Once I select any folder from this dialog box and click 'Ok'. I didn't get the selected FolderPath and its foldername in the textbox which is beside the Browse button. Please correct me...
View.xaml:
            <Grid>....
                <TextBox Grid.Column="2" Height="25" IsReadOnly="True"
                    TextAlignment="Right" VerticalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Center"
                    Width="200"
                    Text="{Binding ElementName=Mygroups,Path=DataContext.FoldernameWithPath}" />
                <Button Grid.Column="4" Content="Browse" Height="25" VerticalAlignment="Bottom" Margin="0,20,0,20" MinWidth="51"
                    Command="{Binding ElementName=Mygroups,Path=DataContext.OpenFolderCommand}"
                    CommandParameter="{Binding}" />
</Grid>

A:    <TextBox Grid.Column="2" Height="25" IsReadOnly="True"
                TextAlignment="Right" VerticalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Center"
                Width="200"
                Text="{Binding ElementName=Mygroups,Path=DataContext.FoldernameWithPath,Mode=TwoWay}" />

Text porpert is binding mode default oneway. add Mode=TwoWay.

A: Try the following OnPropertyChanged function:
        protected void OnPropertyChanged (string propertyName)
    {
        if (this.PropertyChanged != null)
        {
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }


text:
Q: Observable universe does it account for farther away galaxies measure of the observable universe? From our planet we can only see so far on any direction.
If a galaxy farther out than ours had a planet would its view extend beyond our measurements?

A: Yes, exactly.  Because the universe is only 13.7 billion years old, light from a certain radius doesn't have enough time to reach you.  Since light is travelling towards you at the same speed in all directions, and cosmological expansion is uniform in all directions, your observable universe is a sphere in which you sit at the center.  So, for a distant galaxy, this sphere would, just like ours, have a radius of 46 billion light years.  Since they're far away, this encompasses different regions of the universe.


text:
Q: GCC - "has initializer but incomplete type" error when using macros for function attributes I have a few header files with some simple glorified structs with just pure virtual methods defined within them. The code compiles fine on Windows with Visual Studio 2015, but GCC is getting stuck. First, the code:
Code Listing

namespace CustomUtils
{
    interface API_ABSTRACT overriden
    {
        virtual int GetStatus() const = 0;
    };
}

In an imported header file, interface is just defined as a stuct:
#define interface struct

And API_ABSTRACT is just a macro for nothing:
#define API_ABSTRACT

The interface typedef is part of inherited code I have no control over, and the API_ABSTRACT is in place so that I can define custom attributes in Windows and Linux to limit which API functions I export. While this builds in VS2015, on Linux, I get a build error:

error: variable 'API_ABSTRACT CustomUtils::overridden' has initializer but incomplete type

If I change the line:
interface API_ABSTRACT overriden

To what I presume it is being translated to:
struct overriden

The code will compile fine in Linux. I've tried compiling with gcc -E -dD to have the post-"pre-processed" source rendered to screen to see the typedef and #define substitutions, but it seems to only show the output for .cpp files, and not header (.h) files.
The Question
Why won't this code work when attempting to compile with GCC?
Thank you.

Edit #1

The output from gcc -E shows the offending line to be:
struct API_ABSTRACT overriden

So it seems the culprit is the API_ABSTRACT macro, which evaluates to nothing.

A: API_ABSTRACT was not defined anywhere (the corresponding file was not included). The way to check it is through tell-tale gcc -E:
struct API_ABSTRACT overriden

With -E, gcc would show preprocessed output, and having API_ABSTRACT in plain sight there means preprocessor knew nothing of it.
When C++ compiler have seen this construct (struct API_ABSTRACT overridden), it thought (according to grammar and if you grant compilers cognizance) that overriden is a variable of type API_ABSTRACT. Followed by braces, it turned the construct into initialization of said variable. However, type API_ABSTRACT was never defined, so compiler complained about initializing a variable of incomplete type.


text:
Q: How to write excel formulas into cells using Python? While writing excel formulas into cells using python code, after exporting I am able to see only the formulas  unless I double click on that cell and then somewhere outside the cell. How can I see the values of the formulas without manually double clicking on the cells?
EDIT:
The code is:
sheet9.write(15,6,xlwt.Formula('COUNTIF(SAC_STORE_DATA!$E:$E,RM_DM_Dashboard!$E$16)'))

I even tried using semicolon instead of comma after $E:$E, but its not working.


text:
Q: In R how do I add every value from 1 vector to every value from a 2nd vector? I have two vectors in R:
vector1 <- c(1:24)

vector2 <- seq.int(.05,.60,.05)

How do I combine these vectors to a third vector in that every value in 1 is added to every value in vector 2?
Meaning the result should look like:
1.05, 1.10, 1.15, 1.20...
24.05,24.10,24.15,24.20...

Any help would be great.
Thanks,
Jonathan

A: You can use outer() here to get the sum of all the combinations. It returns a matrix so I just use c() to make that a vector. If you want to keep it as a matrix, just drop that part.
c(outer(vector2, vector1, `+`))


text:
Q: How is the perturbation in one column of a symmetric matrix reflected in its eigenvalues? Suppose we have a 0-1 square symmetric matrix. Then it's eigenvalues are real. But I have observed that by multiplying any of its column by a positive constant, even if the matrix is not symmetric still its eigenvalues are real. Further, the inertia (the number of positive, negative, zero eigenvalues) remains the same. Now how to prove these observations.
Also if possible, suggest me - 'what is the relationship between the spectra of the two matrices?'.

A: In general, suppose $A$ is a real symmetric matrix and $D$ is a positive diagonal matrix. By Sylvester's law of inertia, the inertia of $A$ and $B=D^{1/2}AD^{1/2}$ are identical to each other. Yet, $B$ is similar to $AD$ because $B=D^{1/2}(AD)D^{-1/2}$. Hence $AD$ has identical spectrum to $B$ and in turn it has the same inertia as $A$.
In your case, $D$ is obtained from modifying exactly one entry of the identical matrix to an arbitrary positive value. So, the above argument applies too.
There are some known bounds on the eigenvalues of $AD$ based on the eigenvalues of $A$. E.g. when the eigenvalues are arranged in descending order, it is known that the sum of squared differences between the two ordered spectra are bounded by the squared Frobenius norm of $D^{1/2}AD^{1/2}-A$ (cf. Stewart and Sun, Matrix Perturbation Theory, Academic Press). For bounds like this, you may consult any book or research paper on matrix perturbation theory.


text:
Q: Wrapper not working? I am trying to code my portfolio page. And it seems like every time i do a wrapper div. And put everything including the content, footer and sidebar inside the wrapper, that the footer still doesnt seem to always stay at the bottom of the page. When i add more content it goes over the footer. The footer doesnt stay at the bottom. So I need these things fixed if someone can help me.
Here is the html:
<!doctype html>

<meta charset="utf-8">
<title>Crescent Moon Designs ~ Coming Soon!</title>
<link href="style.css" rel="stylesheet" type="text/css">

Home

About

Portfolio

Tutorials

Contact

Sidebar Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu.
Vestibulum eu porttitor mauris. Praesent sed malesuada dui.
Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

Content Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu.
Vestibulum eu porttitor mauris. Praesent sed malesuada dui.
Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

All Rights Reserved © Crescent Moon Designs 2016

Here is the css:
@charset "utf-8";
body {
    background-image: url('images/mainbg.jpg');
    background-repeat: fixed;
    background-color: #ffffff;
    margin-top: 10px;
}

#wrapper {
    margin-left: 240px;
    clear: both;
}

#header {
    background: url('images/cmdblack.png');
    height: 250px;
    width: 800px;
}

#footer {
    margin: auto 0;
    clear: both;
    position: relative;
    top: 800px;
}

#sidebarleft {
    position: absolute;
    left: 229px;
    top: 334px;
}

.side_title {
    font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
    color: #000000;
    text-align: center;
    letter-spacing: 2px;
}

#sidetext {
    background-color: #fff;
    font-family: verdana, arial, serif;
    font-size: 11px;
    color: #494949;
    padding: 8px;
}

.content_title {
    font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
    color: #000000;
    text-align: center;
    letter-spacing: 2px;
}

#content_box {
    position: absolute;
    left: 555px;
    top: 334px;
}

.content_text {
    background-color: #fff;
    font-family: verdana, arial, serif;
    font-size: 11px;
    color: #494949;
    padding: 18px;
}

#menu_top {
    position: absolute;
    left: 273px;
    top: 260px;
    border-bottom: 1px solid #000000;
}

#menu_top1 li {
    display: inline;
    padding: 8px;
    padding-top: 0;
}

li a {
    font-family: sans-serif;
    font-size: 25px;
    font-weight: lighter;
    font-style: normal;
    text-decoration: none;
    color: #000000;
    padding: 10px;
}

li a:hover {
    font-family: sans-serif;
    font-size: 25px;
    font-weight: lighter;
    font-style: italic;
    text-decoration: none;
    color: #3D3D3D;
    border-radius: 9px;
    padding: 10px;
}

.listimg {
    padding-right: 7px;
}

A: I've gone through and slightly modified your structure. You were using a TABLE tag and tables really should only be used for tabular data, not for layout. I've modified this so it is now using a DIV instead. I've made the following changes to your HTML and CSS -

*

*I've given the first DIV within your "content_box" the style "width: 600px;".

*I've moved your footer into your "content" area and removed the "position: relative;" as this isn't required.

*I've also removed the "top: 800px" otherwise it will just move it very far from the top of the results. Instead I've now added a "min-height: 800px" on your "content_text" class so that the footer isn't right next to your content when there's only a small amount of content. You can reduce this size if you want to move it up the page.

*You had an error where you and LI tags with no UL parent, I've fixed this too.

Hopefully it achieves what you were seeking. :)
Modified HTML:
<!doctype html>

    <meta charset="utf-8">
    <title>Crescent Moon Designs ~ Coming Soon!</title>
    <link href="style.css" rel="stylesheet" type="text/css">

Home

About

Portfolio

Tutorials

Contact

                        Sidebar Title

                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu.
                    Vestibulum eu porttitor mauris. Praesent sed malesuada dui.
                    Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

                    Content Title

                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vestibulum turpis fermentum ante pharetra aliquam. Duis fringilla sit amet nibh quis ornare. Duis vulputate libero sit amet convallis posuere. Ut iaculis bibendum purus sit amet commodo. Vivamus sit amet posuere nisi. Donec hendrerit congue urna, quis semper nisi ultrices vitae. Proin porta mauris eget turpis sollicitudin, non mattis metus finibus. Sed rhoncus, dolor sit amet interdum posuere, metus neque placerat tellus, nec bibendum elit ante at diam. Aenean eget sodales dolor. Curabitur posuere euismod erat, pharetra venenatis nibh scelerisque eu. Cras rhoncus augue fermentum est interdum egestas. Donec a diam eros.

                All Rights Reserved © Crescent Moon Designs 2016

Modified CSS:
@charset "utf-8";
body {
    background-image: url('images/mainbg.jpg');
    background-repeat: fixed;
    background-color: #ffffff;
    margin-top: 10px;
}

#wrapper {
    margin-left: 240px;
    clear: both;
}

#header {
    background: url('images/cmdblack.png');
    height: 250px;
    width: 800px;
}

#footer {
    margin: auto 0;
    clear: both;
}

#sidebarleft {
    position: absolute;
    left: 229px;
    top: 334px;
}

.side_title {
    font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
    color: #000000;
    text-align: center;
    letter-spacing: 2px;
}

#sidetext {
    background-color: #fff;
    font-family: verdana, arial, serif;
    font-size: 11px;
    color: #494949;
    padding: 8px;
}

.content_title {
    font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
    color: #000000;
    text-align: center;
    letter-spacing: 2px;
}

#content_box {
    position: absolute;
    left: 555px;
    top: 334px;
}

.content_text {
    background-color: #fff;
    font-family: verdana, arial, serif;
    font-size: 11px;
    color: #494949;
    padding: 18px;
    min-height: 800px;
}

#menu_top {
    position: absolute;
    left: 273px;
    top: 260px;
    border-bottom: 1px solid #000000;
}

#menu_top1 li {
    display: inline;
    padding: 8px;
    padding-top: 0;
}

li a {
    font-family: sans-serif;
    font-size: 25px;
    font-weight: lighter;
    font-style: normal;
    text-decoration: none;
    color: #000000;
    padding: 10px;
}

li a:hover {
    font-family: sans-serif;
    font-size: 25px;
    font-weight: lighter;
    font-style: italic;
    text-decoration: none;
    color: #3D3D3D;
    border-radius: 9px;
    padding: 10px;
}

.listimg {
    padding-right: 7px;
}

A: Error is inside your HTML code. Please check all the opening tag has their respective closing tags where expected.

@charset "utf-8";
 body {
  background-image: url('images/mainbg.jpg');
  background-repeat: fixed;
  background-color: #ffffff;
  margin-top: 10px;
}
#wrapper {
  margin-left: 240px;
  clear: both;
}
#header {
  background: url('images/cmdblack.png');
  height: 250px;
  width: 800px;
}
#footer {
  margin-top: 20px;
  background: #eee;
  margin: auto 0;
  clear: both;
  position: relative;
  top: 800px;
}
#sidebarleft {
  position: absolute;
  left: 229px;
  top: 334px;
}
.side_title {
  font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-style: italic;
  font-weight: bold;
  color: #000000;
  text-align: center;
  letter-spacing: 2px;
}
#sidetext {
  background-color: #fff;
  font-family: verdana, arial, serif;
  font-size: 11px;
  color: #494949;
  padding: 8px;
}
.content_title {
  font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-style: italic;
  font-weight: bold;
  color: #000000;
  text-align: center;
  letter-spacing: 2px;
}
#content_box {
  position: absolute;
  left: 555px;
  top: 334px;
}
.content_text {
  background-color: #fff;
  font-family: verdana, arial, serif;
  font-size: 11px;
  color: #494949;
  padding: 18px;
}
#menu_top {
  position: absolute;
  left: 273px;
  top: 260px;
  border-bottom: 1px solid #000000;
}
#menu_top1 li {
  display: inline;
  padding: 8px;
  padding-top: 0;
}
li a {
  font-family: sans-serif;
  font-size: 25px;
  font-weight: lighter;
  font-style: normal;
  text-decoration: none;
  color: #000000;
  padding: 10px;
}
li a:hover {
  font-family: sans-serif;
  font-size: 25px;
  font-weight: lighter;
  font-style: italic;
  text-decoration: none;
  color: #3D3D3D;
  border-radius: 9px;
  padding: 10px;
}
.listimg {
  padding-right: 7px;
}

        Home

        About

        Portfolio

        Tutorials

        Contact

          Sidebar Title

          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent
          sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

          Content Title

          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent
          sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, r Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet
          nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis,
          aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, r Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor.
          Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum
          tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, r
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris.
          Praesent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor
          mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, r Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet
          quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel
          imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, r Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
          et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
          et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum,
          r Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris.
          Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis
          vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui. Lorem ipsum dolor sit amet, consectetur adipiscing
          elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies
          eget elit fermentum, rutrum dignissim dui.utrum dignissim dui.

    All Rights Reserved © Crescent Moon Designs 2016

A: Your wrapper should be centered and all of the divs inside should be relative positioned and floating.
You can do something like:
#wrapper {
 position: absolute;
 width: 60%; /*you can set the width in px too*/
 left: 50%;
 top: 20px;
 margin: 0 0 0 -30%; /*this will make the div go left half of its width*/
}

#menu_top {
 position: relative;
 width:100%;
 float:left;
 background: #0f0;
}

#footer {
 position: relative;
 width:100%;
 float:left;
 background: #00f;
}

And then do the same for all of your other divs. Sidebar can be a div with 20% or 30% and content with 80% or 70%.
This is not the best way of doing it. You should use a framework like Bootstrap.
If you'd like to build your own HTML/CSS then first search by responsive design and grid structures.

A: Use the following modified code ::
Here is your HTML:
 <!doctype html>

   <meta charset="utf-8">
   <title>Crescent Moon Designs ~ Coming Soon!</title>
   <link href="style.css" rel="stylesheet" type="text/css">

Home

About

Portfolio

Tutorials

Contact

Sidebar Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse  et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, enenatisvel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu.Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nuncnulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

Content Title

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus,venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu.Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis,aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitormauris. Praesent sed malesuada dui. Nunc nulla libero, ultricieseget elit fermentum, rutrum dignissim dui.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et interdum tortor. Nullam eu justo ipsum. Praesent ligula metus, venenatis vel imperdiet quis, aliquet nec lorem. Suspendisse ut elit arcu. Vestibulum eu porttitor mauris. Praesent sed malesuada dui. Nunc nulla libero, ultricies eget elit fermentum, rutrum dignissim dui.

All Rights Reserved © Crescent Moon Designs 2016

And use the following CSS::
@charset "utf-8";
body {
background-image: url('images/mainbg.jpg');
background-repeat: fixed;
background-color: #ffffff;
margin-top: 10px;
}

#wrapper {
float: left;
width: 100%;
}

#header {
background: url('images/cmdblack.png');
}

#footer {
clear: both;
position: absolute;
text-align: center;
bottom: 0;
width: 100%;
left: 0;
padding: 20px 0;
}

#sidebarleft {
float: left;
width: 25%;
}

.side_title {
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size: 14px;
font-style: italic;
font-weight: bold;
color: #000000;
text-align: center;
letter-spacing: 2px;
}

#sidetext {
background-color: #fff;
font-family: verdana, arial, serif;
font-size: 11px;
color: #494949;
padding: 18px;
}

.content_title {
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size: 14px;
font-style: italic;
font-weight: bold;
color: #000000;
text-align: center;
letter-spacing: 2px;
}

#content_box {
float: left;
width: 75%;
}

.content_text {
background-color: #fff;
font-family: verdana, arial, serif;
font-size: 11px;
color: #494949;
padding: 18px;
}

#menu_top {
text-align: center;
border-bottom: 1px solid #000000;
padding: 20px;
margin-bottom: 30px;
}

#menu_top1 li {
display: inline;
padding: 8px;
padding-top: 0;
}

li a {
font-family: sans-serif;
font-size: 25px;
font-weight: lighter;
font-style: normal;
text-decoration: none;
color: #000000;
padding: 10px;
}

li a:hover {
font-family: sans-serif;
font-size: 25px;
font-weight: lighter;
font-style: italic;
text-decoration: none;
color: #3D3D3D;
border-radius: 9px;
padding: 10px;
}

.listimg {
padding-right: 7px;
}

It is the working Code.


text:
Q: Magento 2 - Paytrace charging card multiple times when "billing zip code" error Trying to figure out what might be causing this issue with PayTrace processing on my site?
Customer enters their payment info and when they submit they get a zip code error. (We're seeing this mainly with Canadian zip codes). The info seems to be correct for them so they submit until it goes through. Every time they click submit, on the paytrace side the order # and payment gets accepted. On the Magento side we get nothing, then when it does got through, we can see a gap in order numbers but not the error orders.
Ex from a customer today: He kept hitting the submit order button and kept getting the "billing zip code" error. His credit card was charged 5 times and a Magento order number was assigned on paytrace, yet there is no actual order created in Magento.
Any insight to what might be going on in the backend would be helpful.
We are on Magento 2.3.6


text:
Q: Simple query rephrasing for optimization The following query:
select exists(select id
              from   avl_adc_equipo cfg
              where  cfg.imei=354676052451142
              and    cfg.adc=2)

Executes pretty fast, but as it gets called thousands of times using variations in imei and adc columns, it adds quite a high number of seconds.
It's explain analyze verbose output is:
Result  (cost=4.29..4.30 rows=1 width=0) (actual time=0.010..0.010 rows=1 loops=1)
  Output: $0
  InitPlan 1 (returns $0)
    ->  Index Only Scan using pk_avl_adc_equipo on public.avl_adc_equipo cfg  (cost=0.28..4.29 rows=1 width=0) (actual time=0.009..0.009 rows=0 loops=1)
          Index Cond: ((cfg.imei = 354676052451142::bigint) AND (cfg.adc = 2))
          Heap Fetches: 0
Planning time: 0.060 ms
Execution time: 0.027 ms

So, it's basically already using the table's PK for performance, but I guess the exists part is not the better approach.
Table schema:

Indexes:
    "pk_avl_adc_equipo" PRIMARY KEY, btree (imei, adc)
Foreign-key constraints:
    "fk_avl_adc_nombre__avl_adc_equipo" FOREIGN KEY (id_adcnom) REFERENCES avl_adc_nombre(id_adcnom) ON UPDATE RESTRICT ON DELETE RESTRICT

Any ideas? Anything else should I provide?


text:
Q: Any open source browser GUI automation tool that will support clicking specific icons wherever they may be on the page? On either the Windows or Linux platform, is there a GUI automation tool that will open up a browser page (any browser, I don't care) and then click on every instance of a specific icon image, wherever it may be on the page and however many times it exists.
I seem to recall this ability in IBM's Rational Robot.  Is there an open source alternative for the penniless ( oh yah... and the morally superior :-) )
EDIT:
I'd like to be able to click a specific bitmap or rectangle of pixels, where ever it is on the page, even if it is in a larger image or if it appears in a flash window.  Where ever the image exists on the page, and whatever name the container or image has, click it.

A: Please take a look at sikuli.org.
Also see: sikuli related questions on SO
It uses image-based screenshot recognition and has an integrated script editor that allows you to insert target button images directly inline with the script.
It runs on Windows and Mac OS, and will work with any applications (browsers included).
The scripting language is Jython.
The library is open source with MIT license. Actually, it is developed at MIT.

A: Have you taken a look at Watir? It's a browser-based web application automation framework written in Ruby.

A: If you know the image url, use this selenium selector:
"dom:var elist=document.getElementsByTagName('img');var toret = null;
for (var i=0; i<elist.length; i++) { if (elist[i].src=='something.png') {
toret = elist[i]; } }; toret"

http://seleniumhq.org/docs/04_selenese_commands.html#locating-by-dom

A: AutoIt is another great tool for automation. You could check the User Defined Function (UDF) for IE, which comes as a part of default package.
It provides a whole lot automation IE Management, Windows System level management, Sound Management etc.,
You could start by downloading the no-install package http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-sfx.exe and look into the examples of IE Management UDF in the UDFs3.chm help file.

A: If your image is identifiable on the page by a CSS id, you should be able to accomplish this using cucumber/webrat and/or cucumber/selenium (the latter if you also want to test javascript in the page). Not a GUI tool but very powerful.

A: The answer is NO: there is not an open source tool that does this. That is because this is a bad idea. Commercial tools like Rational tried to do this because they tried to be all things to all people (even if they didn't work very well). But selecting by bitmap image is easy to think about and hard to perform reliably so none of the modern popular tools even try. Instead they focus on how to be SUCCESSFUL.
The right thing to do, as others have already said here is to select images by CSS selector or by image file name. This can be done reliably by any modern GUI test tool: Watir, Selenium, Webrat ...


text:
Q: Author indentation ISSUE While Writing IEEE paper There is an indentation problem in author section of the IEEE paper.
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}

\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}

\title{PAPER TITLE\\
%{\footnotesize \textsuperscript{*}Note: Sub-titles are not captured in Xplore and should not be used}
}
%\thanks{Identify applicable funding agency here. If none, delete this.}

\author{
\IEEEauthorblockN{Author1}
\IEEEauthorblockA{\textit{Engineering Department} \\
\textit{XYZ Univeristy of Engineering and Technology }\\
Karachi, Pakistan \\
 author1@gmail.com}
\and
\\
\IEEEauthorblockN{author2}
\IEEEauthorblockA{\textit{ Engineering Department} \\
\textit{XYZ Univeristy of Engineering and Technology}\\
Karachi, Pakistan \\
  author2@gmail.com}
\and
\\
\IEEEauthorblockN{Author3}
\IEEEauthorblockA{\textit{Engineering Department} \\
\textit{XYZ Univeristy of Engineering and Technology}\\
Karachi, Pakistan \\
  author3@gmail.com}
\and
\\
\IEEEauthorblockN{ author4 }
\IEEEauthorblockA{\textit{Engineering Department} \\
\textit{XYZ Univeristy of Engineering and Technology}\\
Karachi, Pakistan \\
author4@gmail.com}
\and
\\
\IEEEauthorblockN{ author5}
\IEEEauthorblockA{\textit{Engineering Department} \\
\textit{XYZ Univeristy of Engineering and Technology}\\
Karachi, Pakistan \\
author5@gmail.com }
}

A: IEEEtrans manual recommend to use the long format if you have more than three authors.
\author{\IEEEauthorblockN{Michael Shell\IEEEauthorrefmark{1}, Homer Simpson\IEEEauthorrefmark{2}, James K irk\IEEEauthorrefmark{3}, Montgomer Scott\IEEEauthorrefmark{3} and Eldon Tyrell\IEEEauthorrefmark{4}}
\IEEEauthorblockA{\IEEEauthorrefmark{1}School of Ele ctrical and Computer Engineering\\
Georgia Institute of Technology, Atlanta, Georgia 30 332 --0250\\
Email: mshell@ece.gatech.edu} \IEEEauthorblockA{\IEEEauthorrefmark{2}Twentieth Cen tury Fox, Springfield, USA\\
Email: homer@thesimpsons.com}}


text:
Q: as.Date function gives different result in a for loop Slight problem where my as.Date function gives a different result when I put it in a for loop. I'm looking in a folder with subfolders (per date) that contain images. I build date_list to organize all the dates (for plotting options in a later stage). The Julian Day starts from the first of January of the year, so because I have 4 years of date, the year must be flexible.
# Set up list with 4 columns and counter Q. jan is used to set all dates to the first of january
date_list <- outer(1:52, 1:4)
q = 1
jan <- "-01-01"

for (scene in folders){
  year <- as.numeric(substr(scene, start=10, stop=13))
  day <- as.numeric(substr(scene, start=14, stop=16))
  datum <- paste(year, day, sep='_')
  date_list[q, 1] <- datum
  date_list[q, 2] <- year
  date_list[q, 3] <- day
  date_list[q, 4] <- as.Date(day, origin = as.Date(paste(year,jan, sep="")))
  q = q+1
}

Output final row:
[52,] "2016_267" "2016" "267" "17068"

What am i missing in date_list[q, 4] that doesn't transfer my integer to a date?
running the following code does work, but due to the large amount of scenes and folders I like to automate this:
 as.Date(day, origin = as.Date(paste(year,jan, sep="")))

Thank you for your time!

A: Do you mean to output your day as 3 numbers? Should it not be 2 numbers?
day <- as.numeric(substr(scene, start=15, stop=16))

or
day <- as.numeric(substr(scene, start=14, stop=15))

That could at least be part of the issue. Providing an example of what typical values of "scene" are would be helpful here.

A: Well, I assume this would answer your first question:
date_list[q, 4] <- as.character(as.Date(datum,format="%Y_%j"))

as.Date accept a format argument, (the %Y and %j are documented in strptime), the %jis the julian day, this is a little easier to read than using origin and multiple paste calls.
Your problem is actually linked to what a Date object is:
> dput(as.Date("2016-01-10"))
structure(16810, class = "Date")

When entered into a matrix (your date_list) it is coerced to character w
without special treatment before like this:
> d<-as.Date("2016-01-10")
> class(d)<-"character"
> d
[1] "16810"

Hence you get only the number of days since 1970-01-01. When you ask for the date as character representation with as.character, it gives the correct value because the Date class as a as.character method which first compute the date in human format before returning a character value.

Now if I understood well your problem I would go this way:
First create a function to work on one string:
name_to_list <- function(name) {
  dpart <- substr(name, start=10, stop=16)
  date <- as.POSIXlt(dpart, format="%Y%j")
  c("datum"=paste(date$year+1900,date$yday,sep="_"), "year"=date$year+1900, "julian_day"=date$yday, "date"=as.character(date) )
}

this function just get your substring, and then convert it to POSIXlt class, which give us julian day, year and date in one pass. as the year is stored as integer since 1900 (could be negative), we have to add 1900 when storing the year in the fields.
Then if your folders variable is a vector of string:
lapply(folders,name_to_list)

wich for folders=c("LC81730382016267LGN00","LC81730382016287LGN00","LC81730382016167LGN00") gives:
[[1]]
       datum         year   julian_day         date
  "2016_266"       "2016"        "266" "2016-09-23"

[[2]]
       datum         year   julian_day         date
  "2016_286"       "2016"        "286" "2016-10-13"

[[3]]
       datum         year   julian_day         date
  "2016_166"       "2016"        "166" "2016-06-15"


text:
Q: Firebase looping continuously with new data being added unnecessarily to nodes while using Android Studio I have 2 'create event' activities, where a person can enter the details of an event and upload them to Firebase. The task seems pretty simple but for some reason Firebase Database is looping continuously and adding data unnecessarily. I want an Event node with each event details as child nodes
CreateEvent2.java
package com.example.admin.college20;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class CreateEvent2 extends AppCompatActivity {

    private EditText mEventTitle, mEventLocation, mEventCategory;
    private Button mNextButton;

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

        mEventTitle = (EditText) findViewById(R.id.event_title);
        mEventLocation = (EditText) findViewById(R.id.event_location);
        mEventCategory = (EditText) findViewById(R.id.event_category);
        mNextButton = (Button) findViewById(R.id.nextButton);

        final String event_title = mEventTitle.getText().toString().trim();
        final String event_location = mEventLocation.getText().toString().trim();
        final String event_category = mEventCategory.getText().toString().trim();

        mNextButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                 if(event_title !=null && event_location !=null && event_category!=null ){
                Intent i = new Intent(CreateEvent2.this, CreateEvent3.class);
                i.putExtra("title", event_title);
                i.putExtra("location", event_location);
                i.putExtra("category", event_category);
                startActivity(i);
            }
        }

        });

    }
}

CreateEvent3.java
package com.example.admin.college20;

import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.firebase.client.Firebase;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

public class CreateEvent3 extends AppCompatActivity {
    private EditText mEventDesc, mEventFBUrl, mEventWebLink;
    private Button upload_image_button, done_button;
    private static final int GALLERY_INTENT = 1;
    private String event_desc, event_weblink, event_fb_url;
    private ProgressDialog progressDialog;

    DatabaseReference mDatabaseReference;

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

        mEventDesc = (EditText) findViewById(R.id.event_desc);
        mEventFBUrl = (EditText) findViewById(R.id.fb_event_url);
        mEventWebLink = (EditText) findViewById(R.id.event_weblink);
        upload_image_button = (Button) findViewById(R.id.upload_image_button);
        done_button = (Button) findViewById(R.id.done_button);
        mDatabaseReference = FirebaseDatabase.getInstance().getReference().child("Event");
        progressDialog = new ProgressDialog(this);

        event_desc = mEventDesc.getText().toString().trim();
        event_weblink = mEventWebLink.getText().toString().trim();
        event_fb_url = mEventFBUrl.getText().toString().trim();

        upload_image_button.setVisibility(View.VISIBLE);
        upload_image_button.setBackgroundColor(Color.TRANSPARENT);

        upload_image_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                intent.setType("image/*");
                startActivityForResult(intent, GALLERY_INTENT);
            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();

        done_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                    startPosting();

                    Intent i = new Intent(CreateEvent3.this, MainPage1.class);
                    startActivity(i);
                }

        });
    }

    private void startPosting() {

        progressDialog.setMessage("Uploading");
        progressDialog.show();
        Bundle bundle = getIntent().getExtras();
        final String event_title = bundle.getString("title");
        final String event_location = bundle.getString("location");
        final String event_category = bundle.getString("category");

        mDatabaseReference.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {

                DatabaseReference databaseReference = mDatabaseReference.push();
                databaseReference.child("Event Title").setValue(event_title);
                databaseReference.child("Event Location").setValue(event_location);
                databaseReference.child("Event Category").setValue(event_category);
                databaseReference.child("Event Description").setValue(event_desc);
                databaseReference.child("Event Weblink").setValue(event_weblink);
                databaseReference.child("Event FB").child(event_fb_url);
                progressDialog.dismiss();
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {

            }
        });
    }

}

activity_create_event2.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.admin.college20.CreateEvent2"
    android:background="@drawable/create_event_1">

    <EditText
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:hint="Event Title"
        android:layout_marginTop="90dp"
        android:id="@+id/event_title"
        android:inputType="textMultiLine"
        android:layout_alignParentTop="true"
        android:layout_alignRight="@+id/event_location"
        android:layout_alignEnd="@+id/event_location" />

    <EditText
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:hint="Event Location"
        android:id="@+id/event_location"
        android:inputType="textMultiLine"
        android:layout_centerVertical="true"
        android:layout_alignLeft="@+id/contact_info"
        android:layout_alignStart="@+id/contact_info" />

    <EditText
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:hint="Event Category"
        android:id="@+id/event_category"
        android:inputType="textMultiLine"
        android:layout_marginTop="32dp"
        android:layout_below="@+id/event_location"
        android:layout_alignLeft="@+id/contact_info"
        android:layout_alignStart="@+id/contact_info" />

    <EditText
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:hint="Contact Number"
        android:id="@+id/contact_info"
        android:inputType="textMultiLine"
        android:layout_above="@+id/nextButton"
        android:layout_marginBottom="20dp"
        android:layout_centerHorizontal="true" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:text="New Button"
        android:id="@+id/nextButton"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="27dp" />

</RelativeLayout>

activity_create_event3.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    tools:context="com.example.admin.college20.CreateEvent3"
    android:background="@drawable/create_event_2">

    <EditText
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:id="@+id/event_desc"
        android:layout_marginTop="144dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:inputType="textMultiLine"
        android:hint="Enter short description here..."
        />

    <EditText
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:id="@+id/fb_event_url"
        android:layout_below="@+id/event_desc"
        android:layout_alignLeft="@+id/event_desc"
        android:layout_alignStart="@+id/event_desc"
        android:layout_marginTop="134dp" />

    <EditText
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:id="@+id/event_weblink"
        android:layout_marginTop="49dp"
        android:layout_below="@+id/fb_event_url"
        android:layout_alignLeft="@+id/fb_event_url"
        android:layout_alignStart="@+id/fb_event_url" />

    <Button
        style="?android:attr/buttonStyleSmall"
        android:layout_width="300dp"
        android:layout_height="60dp"
        android:id="@+id/upload_image_button"
        android:layout_marginTop="50dp"
        android:layout_below="@+id/event_desc"
        android:layout_alignLeft="@+id/event_desc"
        android:layout_alignStart="@+id/event_desc" />

    <Button
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:id="@+id/done_button"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="15dp" />

</RelativeLayout>

A: Yep, this is absolutely a loop.
First to explain what's going on. The ValueEventListener set on your event node is saying: whenever something changes on the Event node, run the onDataChange method. And the onDataChange method is saying: make this change on the Event node. Hence you're into a loop.
The code that's in the ValueEventListener seems to be in the wrong place; onDataChange is for what you want your app to do with new data at that location.
You could move your push() and setValue() stuff out of the listener and put it directly in the startPosting() method and it will only execute once.

A: Reason of continuous loop is you are pushing data on node where you have added valueEventListener.
So when you called startPosting() -> onDataChange -> It try to push data on node -> Node is changed -> onDataChange -> It try to push data on node -> Node is changed.
This loop will be continuous. I don't found any use of adding addValueEventListener while posting data.

A: I had the same problem. I wanted to use addValueEventListener because I had to get a value, but the value was constantly changing when I set a new one.
Use addListenerForSingleValueEvent() instead of addValueEventListener().


text:
Q: Is this a valid proof for $n! \gt 2^n$ for $n \ge 4$ Prove that for every integer $n \ge 4$ the following inequality holds $n! \gt 2^n$
Is my proof by mathematical induction correct?
Base case: when $n=4$, we have $4! \gt 2^4$, this is $24 \gt 16$, therefore true.
Hypothesis: assume $n=k$ for $n \ge 4$, therefore $k! \gt 2^k$
Induction: Prove for $k+1$, we have to prove $(k+1)! \gt 2^{k+1}$
$$\tag{*}(k+1)! \gt 2^{k+1}$$
$$(k+1) \cdot k! \gt 2^k \cdot 2$$
since $k \ge 4$, this means $(k+1) \gt 2$ for all $k$ and from our assumption we know that $k! \gt 2^k$
Therefore,
$$(k+1) \cdot k! \gt 2^k \cdot 2$$
is true completing the proof.
Is this correct?

A: As David mentioned, your inductive hypothesis should be that $k!>2^k$.
Also, the logic flow in your inductive step leaves a little to be desired. You want to show that $(k+1)!>2^{k+1}$, by using that $k\geq 4$ and that $k!>2^k$. But the first thing to do is to restate what you want to prove (I put a $*$ next to the equation I refer to).
The natural way, with precisely the ideas you used, would be: since $k!>2^k$ and $(k+1)>2$, we have
$$
(k+1)!=k!(k+1)>2^k\times 2=2^{k+1}.
$$


text:
Q: Create new numeric variable based on condition I am trying to create a new variable that consists of the patients weight in kg at the time of visit 1, but I am having trouble with the logic.  I have tried the following code but have have no luck
WL_A <- function(visitnum, Weight_KG) {
  if (visitnum == 1)
    return(Weight_KG)
}

data
structure(list(Sid = structure(1:5, .Label = c("A", "B", "C",
"D", "E"), class = "factor"), Weight_KG = c(100L, 500L, 70L,
90L, 82L), visitnum = c(1L, 2L, 1L, 1L, 12L), BMI = c(13L, 25L,
20L, 18L, 7L)), .Names = c("Sid", "Weight_KG", "visitnum", "BMI"
), class = "data.frame", row.names = c("1", "2", "3", "4", "5"))


text:
Q: Resume Activity after going to home page From my MainActivity (Launcher Activity) I press a button to start my GameActivity. I have it so when I hit the Back button in Game Activity, I don't return to my MainActivity and instead return to my home screen. Now when I resume my app it goes to MainActivity instead of returning to GameActivity despite being shown.

Goal
Main Activity -> Game Activity -> Home -> Game Activity
Current Result
Main Activity -> Game Activity -> Home -> Home Activity

A couple things..

*

*It works perfectly when I navigate with my home and menu buttons.

*I have no launchMode in my Manifest

So let us see what I have done!

Main Activity Button Click
 Button startButton = findViewById(R.id.buttonStart);
    startButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, GameActivity.class);
            //stops back button to return to add player screen
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);

            startActivity(intent);

        }
    });

Manifest Simplified
 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainPage.MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar"
        android:screenOrientation="portrait"
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".GamePage.GameActivity"
        android:label="@string/title_activity_game"
        android:theme="@style/AppTheme.NoActionBar"
        android:screenOrientation="portrait" />
</application>

A: In that case, just call finish() right after launching you GameActivity.
Button startButton = findViewById(R.id.buttonStart);
    startButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, GameActivity.class);
            startActivity(intent);
            finish();
        }
    });

Edit: Update launchMode for your GameActivity also:
<activity android:name=".GameActivity" android:launchMode="singleInstance">

A: when you tap on the back button of device the method onBackPress is called, you can override him to redirect user according your necessity, which mean you can change the action for the Back Button, Code:
//When Back Button on click, it will come to this method.
@Override
public void onBackPressed() {
    //Do anything you want here,
}

A: It doesn't seem like this is possible to do using the conventional back-stack mechanism. You can't return to the home screen using the back button without popping off all the Activities in your back-stack first (hence destroying them, if you have no memory leaks).
Then, when you click the menu button, a screenshot of your last displayed Activity should be shown, but since all of your Activities are destroyed your launcher Activity is loaded.
One way you can handle re-entering the app at the point of your choosing is by implementing a navigation Activity (in many cases this is a splash screen) as the launcher Activity. In this Activity, you would determine (using persistent storage i.e. SharedPreferences) which Activity/back-stack state the app should be set to.
For this example, you could store a boolean with key isInGame in SharedPreferences when you enter GameActivity. Then in the navigation activity, you can retrieve the value and launch GameActivity if true. Obviously, for handling game/app state you will have to store a lot more, but this demonstrates simple navigation.


text:
Q: How to interpret a PCA score plot? I get a following score plot for the breast cancer dataset. The score plot has been clustered into two categories. I want to know what inferences could I draw from it?

A: The content of the interpretation will depend on the interpretation of the two components. Do the groups of variables that load strongly in each component have a coherent meaning? Assuming the two components that emerged are coherent (and this coherence is going to be convincing to readers of your research), you can say a couple of things, but you could also test these hypotheses in statistical tests with OLS or a t-test or similar (for my first point) and OLS or correlation (for my second point).
First, you can say that category membership has a strong relationship with component 1, but category membership has an unclear or weak(er) relationship with component 2. So you would expect (and can test that) the mean value of the first component for the blue group to be greater than the mean for the yellow group. For component 2, this relationship is not clear, but you could test it to show whether the means are significantly different.
There also appears to be a correlation between C1 and C2 for the yellow group but less so for the blue group. You could subset your dataset into yellow and blue data sets and perform a correlation test on each. It seems clear that the correlation coefficients would be different for the two groups. The meaning behind this difference in correlations depends on the coherence and "meaning" of the components, as interpretable by which variables are loading strongly in each component.


text:
Q: Is NSDateFormatter available in Swift 3? I am trying to use it in my code after using DatePicker but no suggestions are coming for NSDateFormatter and only DateFormatter is coming.
If anyone has used in their code, kindly share it here.
Also, what changes should i make in order to receive the suggestions.
I want to change the format from MM-DD-YYYY to DD-MM-YYYY.

A: Swift 3 has dropped NS prefix, so you wont get suggestion for NSDateFormatter. DateFormatter is same as NSDateFormatter, just the name is changed. You can use DateFormatter in same way you have been using NSDateFormatter. Check SE-0086 proposal for more details.

A: try this
let dateFormatter = DateFormatter()
        //format in which recived Date Present
        dateFormatter.dateFormat = "dd-MMM-yyyy"
        let newDate = dateFormatter.date(from: "20-MAR-2017")
        // format to which you need your date to convert
        dateFormatter.dateFormat = "MMM-dd-yyyy"
        if let newDate  = newDate{
            let dateStr = dateFormatter.string(from: newDate)

            print(dateStr) //Output: MAR-20-2017

        }


text:
Q: How to create a instance I am having two classes, a main class and class which extends JPanel and implements Runnable. I am trying to create two threads for the same instance of the JPanel class in an actionListener, but i just don't know where to create the JPanel1 object...
//Edit: Button1 is the start of the application .After that , button 2 will appear with a quick animation of labels and when clicked it(button2) will start the same animation too. How can i do whenever one of these buttons is clicked to launch the run method ?
public void run() {

            if(isTom){

            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {

            }
            panel.removeAll();
            panel.add(tomLabel1);
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
            }
            panel.add(tomLabel2);
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                }
            panel.add(tomLabel3);
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {

            }
            panel.add(tomLabel4);
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                }
            panel.add(tomLabel5);
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                }

            panel.removeAll();
            repaint();
            revalidate();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
            }

            }

public Game(){

        JFrame frame = new JFrame();
        Panel1 key = new Panel1();
        key.addKeyListener(key);
        frame.add(key);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
        frame.setUndecorated(true);
        frame.setVisible(true);
    }
    public static void main(String[] args) {
        new Game();

    }

    public class Panel1 extends JPanel implements KeyListener,Runnable{
    JButton button1 = new JButton("BUTTON1");
    JButton button2 = new JButton("BUTTON2");
    add(button1);add(button2);

        Thread t = new Thread(this); // This works, but i need it inside the actionListener.

         button1.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e){
                    System.out.println("button1");
                    Thread x = new Thread(j);//'j' is an JPanel1 object. I need something like this i guess
                    x.setName("Thread x");});

         button2.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e){
                    System.out.println("button2");
                    Thread y = new Thread(j);
                    y.setName("Thread y");
                                           });

public void run(){
     System.out.println(Thread.currentThread().getName());
}

A: First, Swing is NOT thread safe!  This means that you should NEVER create or modify the UI from outside of context of the Event Dispatching Thread!
Second, Swing is a single threaded environment, this means that you should never block or execute long running code from within the context of the Event Dispatching Thread, this will cause the UI to freeze until the block is removed.
Your concept is correct, you implementation is wrong, you should use a Swing Timer instead.
Instead of removing and adding labels, use a single label and change it's properties (text/icon, what ever)
See Concurrency in Swing and How to use Swing Timers for more details

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class Test {

    public static void main(String[] args) {
        new Test();
    }

    public Test() {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
                    ex.printStackTrace();
                }

                try {
                    JFrame frame = new JFrame("Testing");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.add(new TestPane());
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
                } catch (IOException exp) {
                    exp.printStackTrace();
                }
            }
        });
    }

    public class TestPane extends JPanel {

        private JButton button1;
        private JButton button2;

        private SplashScreen splashScreen;

        public TestPane() throws IOException {
            button1 = new JButton("Button One");
            button2 = new JButton("Button Two");

            JPanel buttons = new JPanel();
            buttons.add(button1);
            buttons.add(button2);

            button1.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    splashScreen.run();
                }
            });

            button2.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    splashScreen.run();
                }
            });

            splashScreen = new SplashScreen();

            setLayout(new BorderLayout());
            add(splashScreen);
            add(buttons, BorderLayout.SOUTH);
        }

    }

    public static  class SplashScreen extends JPanel {

        protected static final int IMAGE_COUNT = 4;

        private JLabel label;
        private Timer timer;

        private int delta;
        private int count;
        private Icon[] icons;

        private Dimension preferredSize;

        public SplashScreen() throws IOException {
            String path = "/images/splash";
            String ext = ".png";
            icons = new Icon[IMAGE_COUNT];
            int maxWidth = 0;
            int maxHeight = 0;
            for (int index = 0; index < IMAGE_COUNT; index++) {
                String name = path + (index + 1) + ext;
                System.out.println(name);
                icons[index] = new ImageIcon(ImageIO.read(getClass().getResource(name)));
                maxWidth = Math.max(maxWidth, icons[index].getIconWidth());
                maxHeight = Math.max(maxHeight, icons[index].getIconHeight());
            }
            preferredSize = new Dimension(maxWidth, maxHeight);

            timer = new Timer(250, new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (count >= IMAGE_COUNT) {
                        count = IMAGE_COUNT - 2;
                        delta = -1;
                    } else if (count < 0) {
                        ((Timer)e.getSource()).stop();
                    } else {
                        label.setIcon(icons[count]);
                        count += delta;
                    }
                }
            });

            setLayout(new BorderLayout());
            label = new JLabel();
            add(label);
        }

        @Override
        public Dimension getPreferredSize() {
            return preferredSize;
        }

        public void run() {

            if (!timer.isRunning()) {

                delta = 1;
                count = 0;
                timer.start();

            }

        }

    }

}

A: Create a new instance of a Thread with your Panel1 class instance:
button1.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                System.out.println("button1");
                Thread x = new Thread(Panel1.this);
                x.start();
                x.setName("Thread x");});

Repeat for the other button with a new Thread object:
button2.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                System.out.println("button2");
                Thread y = new Thread(Panel1.this);
                y.start();
                y.setName("Thread y"); });

Panel1.this is referring to the instance of the Panel1 class that is currently running, making sure that your Threads are executing run() of that instance.


text:
Q: Problem with Save-Load system in batch-files I've been attempting to make this huge batch-file program and during one of the sessions of making it, I realized at some point the program would need to perform two separate tasks. Therefore I made another Mini program to help my big program, it was all going great until I started needing to transfer information from the big program to the small one.
I though it would be no problem and I just made a .sav file that saved all the necessary information for the smaller program there! After this, I made the code for the small program in the way that it would load up all the information from the .sav file. I though I was all good and clear but whenever I loaded up the program, none of the necessary data loaded with it
Instead of it loading the data such as per say var=2 it loaded data like var=, meaning that my code just gave me "ECHO IS OFF" errors often, and sometimes even crashed
I have tried looking all over the internet for a solve but I couldn't find anyone else with the same problem
I hope you guys can help me with it, Here is about how my code looks without the actual var/ Location names
Big Program:
(
echo %var1%
echo %var2%
echo %var3%
) > "Location\name.sav"

Small program:
< "Location\name.sav" (
set /p var1=
set /p var2=
set /p var3=
)

I have no typos or errors, I checked like a million times
If anyone knows how to solve this, Please help~

A: The code snippets you have posted seem ok.
What is missing is where you assign values to the variables.
If you assign these values within the same () codeblock then you cannot echo these values as in your code.
You will have to use delayed expansion of variables to use echo with the uptodate values.
See setlocal /? for details on the use of delayed expansion.
After you have enabled delayedexpansion you can change the echo %var1% to echo !var1! to get the values to show.

A: There is a simpler way of doing this, which requires only that you use a predetermined string of one or more characters at the beginning of each variable name.
The following example uses the string var at the beginning of each variable name, and hopefully shows you how it works, just copy it and try it:
@Echo Off
SetLocal EnableExtensions

Rem Make sure there are no existing variables in the environment named beginning with var.
For /F "Delims==" %%G In ('"(Set var) 2> NUL"') Do Set "%%G="

Rem Code which defines your variables each beginning with the string var.
Set "var1=some value"
Set "var2=another value"
Set "var3=different value"

Rem See the now defined var variables
Set var & Pause

Rem send each of your variables and their values out to a sav file.
Set var 1> "myfile.sav" 2> NUL

Rem Undefine your variables again.
For /F "Delims==" %%G In ('"(Set var) 2> NUL"') Do Set "%%G="

Rem check that the variables no longer exist.
Set var & Pause

Rem Get your variables back from the sav file.
For /F UseBackQ^ Delims^=^ EOL^= %%G In ("myfile.sav") Do Set "%%G"

Rem See the variables now defined again.
Set var & Pause

A: along the same lines of Compo's answer, however it's easier still to save to a batch file that you can call, and if you use some macros to automate the saving of variables as you define them.
@Echo off
::: To safely define macros.
 SETLOCAL EnableExtensions DISABLEdelayedExpansion
rem ::: %Save% macro is built into the definition of each def/vartype macro to autosave variables when defined
rem ::: - def Vartypes: [[/S] standard string.] [[/P] Set /P input prompt] [[/I] Set /A Integer variable]
 Set User="%TEMP%\%~n0_!#Sv.name!_sav.bat"
 Set Save=(For /F "Tokens=1 Delims==" %%i in ('Set #Sv.') Do (If not "!%%i!"=="" Echo/Set "%%i=!%%~i!"))^>%User%
 Set "Loc=(Set "#Sv.Loc=@"&Title !#Sv.Loc!)&%Save%"
rem :::  usage: %def/S:VAR=Varname%VariableValue
 Set "def/S=For %%n in (1 2)Do If %%n==2 (Set "#Sv.VAR=!str!"&%Save%)Else Set str="
rem :::  usage: %def/P:VAR=Varname%Output prompt string
 Set "def/P=For %%n in (1 2)Do If %%n==2 ((For /L %%v in (1 1 10)Do if "!#Sv.VAR!" == "" (Set /P "#Sv.VAR=!promptstr!: "))&%Save%)Else Set promptstr="
rem :::  usage: %def/I:VAR=Varname%=Equation | %/A:V=Varname%+=IntegerVal | %/A:V=Varname%+=!IntegerVaR!
 Set "def/I=For %%n in (1 2)Do If %%n==2 (Set /A "#Sv.VAR!sum!"&%Save%)Else Set sum="
rem ::: Required to execute macros.
 SETLOCAL ENABLEdelayedExpansion
:Welcome
rem ::: first variable should be name as save macro uses the name to reference user save.
 If Exist "%TEMP%\%~n0_*_sav.bat" (Echo/Existing Users:&Echo/&(For /F "Delims=" %%G in ('Dir "%TEMP%\%~n0_*_sav.bat" /B')Do For /F "Tokens=2 Delims=_" %%o in ("%%~nG") Do  < Nul Set /P "=[%%o] ")&Echo/)
 Set /P "#Sv.Name=Enter your name: "
 If Exist %User% (Echo/[C]ontinue / [D]elete?&For /F "Delims=" %%O in ('Choice /N /C:cd')Do If /I "%%O"=="C" (Goto :Load)Else (Del /P %User% & Goto :welcome))
:Load
 CALL %User% 2> Nul
 If Not "!#Sv.Loc!" == "" (Goto :!#Sv.Loc!)
Pause
:Start
 %Loc:@=Start%
 %def/I:VAR=dollars%+=!random! %%1000 + 500
 Echo/You have $!#Sv.dollars!.
:end
%Loc:@=end%
Echo/User demo Save contents.
 TYPE %User%
Endlocal & Endlocal


text:
Q: AJAX multiple inputs not passing or sending data to PHP I have been battling with this AJAX to pass data to PHP for SQL Insertion, it seems the data does not get passed to the PHP. I have three HTML input types, text, radio button and select. The radio is used for gender, select for the country of residence, and text for the country's dialcode concatenated with the user's mobilenumber. Javascript is used to automatically retrieve the dialcode once the user selects his/her country in the dropdown. These inputs are not being passed for SQL insertion.
I am still very much an amateur and a student. I included the code here: https://jsfiddle.net/406tb35r/1/
Code is as follows:

<form action="" method="post" class="start_form" id="userDetails">

        <fieldset>
          <legend>Are you a</legend>
          <input type="radio" name="gender" class="gender" value="male">Male

          <input type="radio" name="gender" class="gender" value="female">Female

      </fieldset>
  <select id="country" name="country" class="country">
  <option data-co="" value="">Which country are from?</option>
  <option data-co="+27" value="ZA">South Africa</option>
  <option data-co="+376" value="AD">Andorra</option>
  <option data-co="+971" value="AE">United Arab Emirates</option>
  <option data-co="+93" value="AF">Afghanistan</option>
  </select>
  <?php
$countryArray = array(
  'AD'=>array('name'=>'ANDORRA','code'=>'376'),
  'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
  'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
  'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
  );

function countrySelector($defaultCountry = "", $id = "", $name = "", $classes = ""){
    global $countryArray;

    $output = "<select id='".$id."' name='".$name."' class='".$classes."'>";

  foreach($countryArray as $code => $country){
    $countryName = ucwords(strtolower($country["name"]));
    $output .= "<option data-co='".$country["code"]."' value='".$code."' ".(($code==strtoupper($defaultCountry))?"selected":"").">".$code." - ".$countryName." (+".$country["code"].")</option>";
}

  $output .= "</select>";

  return $output;
}
?>
<input align="center" type="text" name="dialcode" class="dialcode" value="" autocomplete="off" placeholder="" mssg="" maxlength="6" readonly>
        <input type="text" name="mobile" class="mobile" value="" autocomplete="off" placeholder="What is your Mobile Number?" mssg="" maxlength="12">

        <input style="width:100%;" type="submit" name="s_submit" value="Next" id="userSubmit">

        Skip
      </form>

This is the PHP for passing above data to SQL:
<?php
session_start();
//Connect to DB
  include_once 'connect.php';
   $session = $_SESSION['id'];
   $universal = new universal;
   $susername = $universal->GETsDetails($session, "username");

   if (isset($_POST['username'])) {

   $gender = preg_replace("#[<> ]#i", "", $_POST['gender']);
   $country = preg_replace("#[<> ]#i", "", $_POST['country']);
   $mobilenumber = preg_replace("#[^0-9]#i", "", $_POST['dialcode'] . $_POST['mobile']);

      if((!$username) == ""){
        return "Your details are not logged in or do not have an account with iamstein!";
      } else {
        $users = $this->db->prepare("UPDATE users SET gender = :gender, country = :country, mobilenumber = :mobilenumber, WHERE id = :id");
        $users->execute(array(":gender" => $gender, ":country" => $country, "mobilenumber" => $mobilenumber, ":id" => $session));

      }
 }?>

A: You need to properly warp the data key
data: {
            gender: gender,
            country: country,
            dialcode: dialcode,
            mobile: mobile},

You weren't passing the right format for the data key.. Alternatively you can serialize the form, just to avoid this errors and mistakes.
data:$('#userDetails').serialize(),


text:
Q: Android IOC Dagger Framework - How to inject a nested field ? I'm using Dagger for Android for dependency injections.
I have a UserService object in a Main Class:
public class Main implements Runnable {

@Inject
UserService service;

@Override
public void run() {
    for (User f : service.getUserByName("toto")) {
        System.out.print(f.getM_Nom());
    }
}

public static void main(String[] args) {
    ObjectGraph objectGraph = ObjectGraph.create(new UserModule());
    Main m = objectGraph.get(Main.class);
    m.run();
}
}

I managed to inject the "service" field and to call the method "getUserByName("")".
But in my "UserService", I have an other custom object ("RepositoryUser" class):
public class UserService implements IUserService {

@Inject
RepositoryUser m_Repository;

@Override
public List<User> getUserByName(String name) {
    return m_Repository.getAll();
}
}

My problem is that this field is not inject: the "m_Repository" field is null and I get a null pointer exception when I try to use my RepositoryUser object.
Here is my Provider:
@Module(
    injects = {UserService.class, Main.class, RepositoryUser.class}
)
 public class UserModule {

@Provides
RepositoryUser provideRepositoryUser() {
    return new RepositoryUser();
}

@Provides
UserService provideUserService() {
    return new UserService();
}
}

Any idea ?
Thanks in advance !

A: It is preferrable to use Constructor Injection in this case. This can be achieved as follows:
Main:
public class Main implements Runnable {

    private final IUserService service;

    @Inject
    public Main(IUserService service) {
        this.service = service;
    }

    @Override
    public void run() {
        for (User f : service.getUserByName("toto")) {
            System.out.print(f.getM_Nom());
        }
    }

    public static void main(String[] args) {
        ObjectGraph objectGraph = ObjectGraph.create(new UserModule());
        Main m = objectGraph.get(Main.class);
        m.run();
    }
}

UserService:
public class UserService implements IUserService {

    private final RepositoryUser m_Repository;

    @Inject
    public UserService(RepositoryUser repository) {
        m_Repository = repository;
    }

    @Override
    public List<User> getUserByName(String name) {
        return m_Repository.getAll();
    }
}

RepositoryUser:
public class RepositoryUser {

    @Inject
    public RepositoryUser() {
    }

    /* ... */
}

UserModule:
@Module(injects = Main.class)
public class UserModule {

    @Provides
    IUserService provideIUserService(UserService userService){
        return userService;
    }
}

Everywhere the @Inject annotation is present on a constructor, Dagger can automatically create an instance of that item. So when you request a RepositoryUser instance in the UserService constructor, Dagger will see the @Inject annotation on RepositoryUser's constructor, and use that to create a new instance. We do not need an @Provides method here.
The IUserService parameter on the Main constructor cannot be instantiated, since it is an interface. Using the provideIUserService method in the module, we tell Dagger that we want it to create a new UserService instance.
We do have an @Inject annotation on the Main constructor, but we request it using ObjectGraph.get(Class<T> clzz). Therefore, we need to add injects = Main.class to our module.


text:
Q: Why Browsers do not resolve simple known issues? Why Browsers do not resolve simple known issues such as:
(in the context of CSS)
Do NOT start a class name with a number! This is only supported in Internet Explorer
and
Do NOT start an ID name with a number! It will not work in Mozilla/Firefox.

A: These are not issues. This is the W3C standard.
Most good browsers try to follow standards as much as possible (Firefox, Chrome).
Some browser just doesn't care, or is trying to impose its own standard though (IE).


text:
Q: Antonym of nature, that implies the cities and infrastructure constructed by man I want to use a noun to describe the buildings and roads etc constructed by man ... as opposed to the forest and sea that exist on Earth naturally. Something besides "man-made".
ETA: Many of the answers take the examples too literally. I mean to say everything constructed or caused by humans. Not specifically the roads and buildings, not a particular object, nothing in context of a city, or organisation.
I want a generalised term, but also not a collective noun like 'assemblage' ... like nature implies everything not created by us and isn't a collective noun.
A word that can fit into this sentence :
"I took a brief retreat from (the) ______ (created by man) to enjoy the Earth gifted to us by Nature."

A: the built environment

built environment noun Man-made structures, features, and
  facilities viewed collectively as an environment in which people live
  and work. 'architects who are helping to shape the built
  environment in this newly prominent region' Oxford Living
  Dictionaries
the built environment the buildings and all other things
  constructed by human beings  Collins Dictionary
the built environment noun all the structures people have
  built when considered as separate from the natural environment
Macmillan Dictionary
In social science, the term built environment, or built world, refers
  to the human-made surroundings that provide the setting for human
  activity, ranging in scale from buildings to parks.
Wikipedia article

You can also go with artifact. Artifacts are things made by humans.

n.
  1. An object produced or shaped by human craft, especially a tool, weapon, or ornament of archaeological or historical interest.
  2. Something viewed as a product of human conception or agency rather than an inherent element American Heritage Dictionary

A: Civilization would seem to fit your example.
As in, "I took a brief retreat from civilization to enjoy the Earth gifted to us by Nature."

A: Maybe try infrastructure.
noun
1.3 the system of public works of a country, state, or region; also : the resources (such as personnel, buildings, or equipment) required for an activity
"Infra- means 'below;' so the infrastructure is the 'underlying structure' of a country and its economy, the fixed installations that it needs in order to function. These include roads, bridges, dams, the water and sewer systems, railways and subways, airports, and harbors. These are generally government-built and publicly owned."

A: assemblage TFD

the act or process of assembling or the state of being assembled;
  things gathered or collected; an assembly; collection; aggregate.

As in:

Humanity's assemblage besmirches Earth.

A: On a smaller scale, in particular materials, I think of synthetic, according to Cambridge Dictionary:

Synthetic products are made from artificial substances, often copying a natural product

In your case you could say:

Many of today's roads are made with asphalt, a synthetic material.

Attribution: "Synthetic Meaning in the Cambridge English Dictionary." Cambridge Dictionary. Accessed April 04, 2018. https://dictionary.cambridge.org/dictionary/english/synthetic.


text:
Q: SELECT WHERE Between SELECT Dates from another table I'm trying to find out if this can be made simpler/shorter. It is working but i think i can be faster,  more efficient or cleaner.
SELECT Tbl_VSchedTime.*
FROM CalendarScheduled
INNER JOIN Tbl_VSchedTime ON CalendarScheduled.[EID] = Tbl_VSchedTime.[EID]
WHERE ([Tbl_VSchedTime].[SchdDate] Between (SELECT MIN(CalendarScheduled.[SchdDate]) FROM CalendarScheduled) And (SELECT MAX(CalendarScheduled.[SchdDate]) FROM CalendarScheduled));

This is my test Select that will actually be change to Delete. In short I am selecting from Tbl_VShedTime anything matching the EIDs on the INNER JOIN and between the min and max dates in CalendarScheduled. However am forced to use a SELECT under each of the dates for it to work. It wont just work by using MIN and MAX when I have already "conjured" the table on the FROM Statement.
Is this just how I have to use it in access or did I miss something? Thanks.
Edit: The question is: Why can't I just write:
WHERE ([Tbl_VSchedTime].[SchdDate] Between MIN(CalendarScheduled.[SchdDate]) And MAX(CalendarScheduled.[SchdDate]))

A: Consider joining the aggregate query and then use aggregates in WHERE condition. Because aggregates return one row, cross join them with your current query which in MS Access means comma-separation in FROM:
CROSS JOIN Before INNER JOIN
SELECT t.*
FROM
(SELECT MIN([SchdDate]) AS MinDate, MAX([SchdDate]) AS MaxDate
 FROM CalendarScheduled) AS agg
,
CalendarScheduled c
INNER JOIN Tbl_VSchedTime t ON c.[EID] = t.[EID]
WHERE (t.[SchdDate] BETWEEN agg.MinDate AND agg.MaxDate;

CROSS JOIN After INNER JOIN
SELECT t.*
FROM
 (CalendarScheduled c
  INNER JOIN Tbl_VSchedTime t ON c.[EID] = t.[EID])
,
(SELECT MIN([SchdDate]) AS MinDate, MAX([SchdDate]) AS MaxDate
 FROM CalendarScheduled) AS agg
WHERE (t.[SchdDate] BETWEEN agg.MinDate AND agg.MaxDate;


text:
Q: When is quasiparticle same as elementary excitation, and when is not? Can anyone shed light on the comparison between these two concepts?

A: Dictionary for this answer: Excitation = particle; collective excitation = quasi-particle.
Short answer:
Elementary particles are never quasi-particles, by definition of elementary. This does not mean that what now it is thought as an elementary particle could be a quasi-particle of entities to be discovered.
Mathematical answer:
Elementary particles are those that correspond to irreducible representations of the Poincare group.
Physical answer:
Quasi-particles require the existence of an external medium or fields, whereas elementary particles do not. For example, phonons require a solid or a fluid to exist (they are collective modes of the atomic lattice vibration), likewise pions require a quark-antiquark sea. These are not fundamental particles, in the sense that they need the existence of other particles. A closed notion is that of composite particle, for example a molecule is made of atoms which, in turn, are made of a nucleus plus electrons. The difference between quasi and composite particles lies in the fact that quasi-particle are though as collective excitations of many particles (usually of the order on the Avogadro number $\sim 10^{23}$, but there may be far fewer, but not tens), while composite particles are more like building blocks where each constituent may be an elementary particle—such as an electron— or another composite particle—such as an atom— (a molecule is usually made of a few or tens of atoms, an atom usually contains from a few to tens of electrons plus a nucleus). Nevertheless, the difference between both concepts is not sharp; for example, pions are somehow made of quarks and antiquarks, they actually are also collective modes (waves) on the quark-antiquark sea, being quasi-Goldstone bosons of the approximate chiral symmetry.
The difference between elementary and composite particles is tied to the human knowledge at the time. At a certain point, it was though that nuclei were elementary, after that people realized that there were in fact more fundamental constituents (protons and neutrons), and later on quarks and gluons were discovered.

A: In the context of condensed matter physics:
To make it short, and with the caveat that it is not a universally accepted definition, an elementary excitation may be called a quasiparticle if it is fermionic (e.g. dressed electron), and collective excitation if it is bosonic in nature (e.g. phonon, magnon).
But there is not clear cut and absolute divide between such terms, and you will not get into trouble for using them in a lax manner.