问:
Math symbols not rendered correctly in R notebook format from KableExtra table objects
UPDATE: KableExtra creator haozhu233 added mathjax support to the package. See my original issue and his comments on Github: https://github.com/haozhu233/kableExtra/issues/473#issuecomment-668224096

When I try and create a table using kable and kableExtra I cannot get math symbols to display correctly. I am able to produce math characters in normal kable tables like expected. I've tried different variations of the options escape = FALSE and protect_latex = T without any luck. The math symbols display correctly if I knit to PDF or HTML, it's just the inline display (and preview) and notebook display that show the raw characters.

As far as I can see from the HTML output, the only difference between the kable table and the kableExtra table is that the latter contains some extra info on the class and style. The R objects are also of a different class, which makes me wonder if the problem might be that mathjax is not called to render kableExtra objects? If so, is there a way I can tell Rstudio to call on mathjax when rendering HTML from kableExtra objects?

I've reproduced this problem on two different computers and using the RStudio Cloud.

Note: i filed a Github Issue but realized that it might be more appropriate to ask here. I've also posted on the Rstudio community without getting a response so I thought I'd try my luck here.

Reprex:

```<code>---
title: "Kable Extra Math Symbols"
output: html_notebook
---

```{r}

math_symb <- c(1,2,3,4)

kable_table <- knitr::kable(math_symb, col.names = "$R^{2}$")
styled_kable_table <- kableExtra::kable_styling(kable_table)

kable_table
styled_kable_table
```{}
</code>```

From the example the object kable_table is rendered with the column name "R2", which is what I want to achieve whereas the styled_kable_table object is displayed with the the undesired column name "$R^2$"

Session Info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
2 LC_COLLATE=Norwegian Bokmål_Norway.1252 LC_CTYPE=Norwegian Bokmål_Norway.1252
[3] LC_MONETARY=Norwegian Bokmål_Norway.1252 LC_NUMERIC=C
[5] LC_TIME=Norwegian Bokmål_Norway.1252

attached base packages:
2 stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
2 Rcpp_1.0.4.6 rstudioapi_0.11 xml2_1.3.2 knitr_1.28 magrittr_1.5 hms_0.5.3
[7] munsell_0.5.0 rvest_0.3.5 viridisLite_0.3.0 colorspace_1.4-1 R6_2.4.1 rlang_0.4.6
[13] stringr_1.4.0 httr_1.4.1 highr_0.8 tools_3.6.3 webshot_0.5.2 xfun_0.14
[19] htmltools_0.4.0 ellipsis_0.3.0 yaml_2.2.1 digest_0.6.25 tibble_3.0.1 lifecycle_0.2.0
[25] crayon_1.3.4 kableExtra_1.1.0 readr_1.3.1 vctrs_0.3.0 glue_1.4.1 evaluate_0.14
[31] rmarkdown_2.1 stringi_1.4.6 compiler_3.6.3 pillar_1.4.4 scales_1.1.1 pkgconfig_2.0.3

答:
This works:

```<code>```{r, results ='asis'}

math_symb <- c(1,2,3,4)

kable_table <- knitr::kable(math_symb, col.names = "$R^{2}$")
styled_kable_table <- kableExtra::kable_styling(kable_table)

kable_table
cat(styled_kable_table)
```
</code>```

However, I have to investigate, why it works.

Body:
UPDATE: KableExtra creator haozhu233 added mathjax support to the package. See my original issue and his comments on Github: https://github.com/haozhu233/kableExtra/issues/473#issuecomment-668224096

When I try and create a table using kable and kableExtra I cannot get math symbols to display correctly. I am able to produce math characters in normal kable tables like expected. I've tried different variations of the options escape = FALSE and protect_latex = T without any luck. The math symbols display correctly if I knit to PDF or HTML, it's just the inline display (and preview) and notebook display that show the raw characters.

As far as I can see from the HTML output, the only difference between the kable table and the kableExtra table is that the latter contains some extra info on the class and style. The R objects are also of a different class, which makes me wonder if the problem might be that mathjax is not called to render kableExtra objects? If so, is there a way I can tell Rstudio to call on mathjax when rendering HTML from kableExtra objects?

I've reproduced this problem on two different computers and using the RStudio Cloud.

Note: i filed a Github Issue but realized that it might be more appropriate to ask here. I've also posted on the Rstudio community without getting a response so I thought I'd try my luck here.

Reprex:

---
title: "Kable Extra Math Symbols"
output: html_notebook
---

```{r}

math_symb <- c(1,2,3,4)

kable_table <- knitr::kable(math_symb, col.names = "$R^{2}$")
styled_kable_table <- kableExtra::kable_styling(kable_table)

kable_table
styled_kable_table
```{}

From the example the object kable_table is rendered with the column name "R2", which is what I want to achieve whereas the styled_kable_table object is displayed with the the undesired column name "$R^2$"

Session Info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
2 LC_COLLATE=Norwegian Bokmål_Norway.1252 LC_CTYPE=Norwegian Bokmål_Norway.1252
[3] LC_MONETARY=Norwegian Bokmål_Norway.1252 LC_NUMERIC=C
[5] LC_TIME=Norwegian Bokmål_Norway.1252

attached base packages:
2 stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
2 Rcpp_1.0.4.6 rstudioapi_0.11 xml2_1.3.2 knitr_1.28 magrittr_1.5 hms_0.5.3
[7] munsell_0.5.0 rvest_0.3.5 viridisLite_0.3.0 colorspace_1.4-1 R6_2.4.1 rlang_0.4.6
[13] stringr_1.4.0 httr_1.4.1 highr_0.8 tools_3.6.3 webshot_0.5.2 xfun_0.14
[19] htmltools_0.4.0 ellipsis_0.3.0 yaml_2.2.1 digest_0.6.25 tibble_3.0.1 lifecycle_0.2.0
[25] crayon_1.3.4 kableExtra_1.1.0 readr_1.3.1 vctrs_0.3.0 glue_1.4.1 evaluate_0.14
[31] rmarkdown_2.1 stringi_1.4.6 compiler_3.6.3 pillar_1.4.4 scales_1.1.1 pkgconfig_2.0.3

Body:
This works:

```{r, results ='asis'}

math_symb <- c(1,2,3,4)

kable_table <- knitr::kable(math_symb, col.names = "$R^{2}$")
styled_kable_table <- kableExtra::kable_styling(kable_table)

kable_table
cat(styled_kable_table)
```

However, I have to investigate, why it works.


来源: stackexchange

问:
Maven 3.0.4 installation to Ubuntu mvn not found
I tried to install Maven to Ubuntu but something goes wrong.

I downloaded Maven and untarred it to folder /usr/local/apache-maven/apache-maven-3.0.4.
Then I added these rows to /etc/environment.

export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4

export M2=$M2_HOME/bin

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$JAVA_HOME:$JRE_HOME:$M2:$PATH"

But when I try to verify my installation by mvn --version I get this message

'The program 'mvn' can be found in the following packages:  * maven  *
maven2 Try: sudo apt-get install '

SOLVED. Sorry that if forget to reply to this. I added export rows to ~/.bashrc and after that it started to work.

答:
Since Ubuntu 16.04.3 LTS release, Maven can be installed from the official repository by running following commands:

sudo apt update

sudo apt install maven

Each time you hit sudo apt update it will update to the latest version.

Update: After installation is complete, run in the terminal mvn -v to see if package was installed.

ContentLicense: CC BY-SA 3.0

ContentLicense: CC BY-SA 4.0


问:
Docker running problem on a project using Windows 10 ,version 2004

ERROR:

failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer \?\C:\ProgramData\Docker\windowsfilter\7fc71f0548706244b490a4c6f442b5ef1caf4ccc8db51580153db20583d55110: The system cannot find the path specified.

答:
I had a similar problem with the volumes, was solved by running

docker system prune --volumes -a

and restarting the docker service

This removes all the volumes so you might lose data, keep that in mind before running the command


问:
TCP Connection Hijacking
I have a small project that I've been working on in C++, and due to the nature of what it does, I need to insert packets in to a live TCP stream. (The purpose is innocent enough, http://ee.forumify.com/viewtopic.php?id=3299 if you MUST know)
I'm creating a level editor for a game, and due to the nature of the handshakes, I can't simply establish a new connection with a high level library such as WinSock. Until now, it has relied on Winsock Packet Editor to do the dirty work, but if I were to let the application handle it all, it would make everyone happy.

So my question is this: Is there an API somewhere that will allow me to take control of a live TCP stream, and preferably one that keeps it valid after it finishes? And I would prefer to not have to inject any DLLs. Also, Detours is a no-no as I'm using GCC/Mingw.

I've toyed around with WinPCap and I have some working code (I can collect a packet, and from that generate a proper packet to send) but since it operates at such a low level, I cannot anticipate all of the potential protocols that the end user might use. Yes, chances are that they'll be using IPv4 over Ethernet, but what about those people who still use PPP, or some other obscure protocol? Also, the connection  gets dropped by the client application after mine is done with it, as the latest ID values in the packets have changed and the client assumes that it has disconnected.

So, if anyone could provide a high-level TCP stream manipulator, I would be very happy. If not, I'll just continue tinkering with WinPCap and tell all the dial-up users to go get better internet.

Target platform: Microsoft Windows XP through Windows 7

答:
you should look at the source code of ettercap http://ettercap.sourceforge.net/
or hunt, tcp hijacker http://packetstormsecurity.org/files/view/21967/hunt-1.5.tgz

Those 2 softs do what you're after.

Title: TCP Connection Hijacking


问:
Stepwise subsetting of a list in Python
My current solution looks like:

```<code>import numpy as np

chunksize = 10
l = list(np.arange(0,99))

while len(l) > chunksize:
    l_subset = l
    l_subset = l_subset[0:chunksize]
    l.pop(0)
    print(l_subset)
</code>```

This doesn't look like a very efficient solution, since .pop requires traversing the list. What are fast ways to do that?

答:
You can use

```<code>del l[0]
</code>```

This will only remove the item at index zero without returning it.

Title: Stepwise subsetting of a list in Python

Body:
My current solution looks like:

import numpy as np

chunksize = 10
l = list(np.arange(0,99))

while len(l) > chunksize:
    l_subset = l
    l_subset = l_subset[0:chunksize]
    l.pop(0)
    print(l_subset)

This doesn't look like a very efficient solution, since .pop requires traversing the list. What are fast ways to do that?

Body:
You can use

del l[0]

This will only remove the item at index zero without returning it.


问:
Why is this CSS selector returning no results?
I am following along with a webscraping example in Automate-the-boring-stuff-with-python but my CSS selector is returning no results

```<code>import bs4
import requests
import sys
import webbrowser

print("Googling ...")
res = requests.get('https://www.google.com/search?q=' + ' '.join(sys.argv[1:]))
res.raise_for_status()

soup = bs4.BeautifulSoup(res.text, "html.parser")
linkelems = soup.find_all(".r a")

numopen = min(5, len(linkelems))
for i in range(numopen):
webbrowser.open('https://google.com' + linkelems[i].get('href'))
</code>```

Has google since modified how they store search links ?
From inspecting the search page elements I see no reason this selector would not work.

答:
There are two problems:

1.) Instead of soup.find_all(".r a") use soup.select(".r a") Only .select() method accepts CSS selectors

2.) Google page needs that you specify User-Agent header to return correct page.

```<code>import bs4
import sys
import requests

headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0'}

print("Googling ...")
res = requests.get('https://www.google.com/search?q=' + ' '.join(sys.argv[1:]), headers=headers)
res.raise_for_status()

soup = bs4.BeautifulSoup(res.text, "html.parser")
linkelems = soup.select(".r a")

for a in linkelems:
    print(a.text)
</code>```

Prints (for example):

```<code>Googling ...
Tree - Wikipediaen.wikipedia.org › wiki › Tree

... and so on.
</code>```

Body:
I am following along with a webscraping example in Automate-the-boring-stuff-with-python but my CSS selector is returning no results

import bs4
import requests
import sys
import webbrowser

print("Googling ...")
res = requests.get('https://www.google.com/search?q=' + ' '.join(sys.argv[1:]))
res.raise_for_status()

soup = bs4.BeautifulSoup(res.text, "html.parser")
linkelems = soup.find_all(".r a")

numopen = min(5, len(linkelems))
for i in range(numopen):
webbrowser.open('https://google.com' + linkelems[i].get('href'))

Has google since modified how they store search links ?
From inspecting the search page elements I see no reason this selector would not work.

Body:
There are two problems:

1.) Instead of soup.find_all(".r a") use soup.select(".r a") Only .select() method accepts CSS selectors

2.) Google page needs that you specify User-Agent header to return correct page.

import bs4
import sys
import requests

headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0'}

print("Googling ...")
res = requests.get('https://www.google.com/search?q=' + ' '.join(sys.argv[1:]), headers=headers)
res.raise_for_status()

soup = bs4.BeautifulSoup(res.text, "html.parser")
linkelems = soup.select(".r a")

for a in linkelems:
    print(a.text)

Prints (for example):

Googling ...
Tree - Wikipediaen.wikipedia.org › wiki › Tree

... and so on.


问:
Friend function in class defined in namespace
I'm trying to make a function in DataBase namespace declared in DataBase.h file with implementation in DataBase.cpp that needs an access to a protected member of Collection class.

Here is what i currently have

Collection.h:

```<code>class Collection
{
   ...
protected:
   string name;
   friend Collection& DataBase::getCollection(string name);
};
</code>```

DataBase.h:

```<code>namespace DataBase {
    ...
    Collection& getCollection(std::string collectionName);
}
</code>```

DataBase.cpp:

```<code>namespace DataBase {
    ...
    Collection& getCollection(std::string collectionName)
    {
        for (auto& collection : _collections)
            if(collection.name == collectionName)
            {
               ...
            }
    }

}
</code>```

The problem is I can't access name property.

答:
You have to forward declare the friend function including namespace. I do not know how you are using _collections, so I changed the example a bit and I put everything in one file to start with something that works.

```<code>#include <string>
#include <vector>
using namespace std;

class Collection;

namespace DataBase {
    Collection* getCollection(std::vector<Collection>& collections, std::string collectionName);
}

class Collection
{
protected:
  string name;
  friend Collection* DataBase::getCollection(std::vector<Collection>& collections, std::string name);
};

namespace DataBase {
  Collection* getCollection(std::vector<Collection>& collections, std::string collectionName)
  {
    for (auto& collection : collections)
      if (collection.name == collectionName)
      {
        return &collection;
      }
    return nullptr;
  }
}
</code>```

Body:
I'm trying to make a function in DataBase namespace declared in DataBase.h file with implementation in DataBase.cpp that needs an access to a protected member of Collection class.

Here is what i currently have

Collection.h:

class Collection
{
   ...
protected:
   string name;
   friend Collection& DataBase::getCollection(string name);
};

DataBase.h:

namespace DataBase {
    ...
    Collection& getCollection(std::string collectionName);
}

DataBase.cpp:

namespace DataBase {
    ...
    Collection& getCollection(std::string collectionName)
    {
        for (auto& collection : _collections)
            if(collection.name == collectionName)
            {
               ...
            }
    }

}

The problem is I can't access name property.

Body:
You have to forward declare the friend function including namespace. I do not know how you are using _collections, so I changed the example a bit and I put everything in one file to start with something that works.

#include <string>
#include <vector>
using namespace std;

class Collection;

namespace DataBase {
    Collection* getCollection(std::vector<Collection>& collections, std::string collectionName);
}

class Collection
{
protected:
  string name;
  friend Collection* DataBase::getCollection(std::vector<Collection>& collections, std::string name);
};

namespace DataBase {
  Collection* getCollection(std::vector<Collection>& collections, std::string collectionName)
  {
    for (auto& collection : collections)
      if (collection.name == collectionName)
      {
        return &collection;
      }
    return nullptr;
  }
}


问:
Checking if a variable is not nil and not zero in ruby
I am using the following code to check if a variable is not nil and not zero

```<code>if(discount != nil && discount != 0)
  ...
end
</code>```

Is there a better way to do this?

答:
I prefer using a more cleaner approach  :

```<code>val.to_i.zero?
</code>```

val.to_i will return a 0 if val is a nil,

after that, all we need to do is check whether the final value is a zero.

OwnerDisplayName: hectorsq

Body:
I am using the following code to check if a variable is not nil and not zero

if(discount != nil && discount != 0)
  ...
end

Is there a better way to do this?

Body:
I prefer using a more cleaner approach  :

val.to_i.zero?

val.to_i will return a 0 if val is a nil,

after that, all we need to do is check whether the final value is a zero.


问:
How can I securely store the scripts for my cronjobs?
I have a PHP script, that goes through all users in a database and deletes every account that has not been activated and whose activation code sent by email has expired. My question is not so much about the script itself but about cronjobs. I want that PHP script to run once everyday and I understand how you set up cronjobs but my question is this: Where do I put my script? I obviously don't want it to be accessible to any user of the website only to the cronjobs on my server. So I probably wouldn't wanna put it in the root directory of my website. What I was thinking is that perhaps it would work if I put it inside the root folder of my webspace where the root folder for my website is located as well.This image shows my webspace. 'Portfolio' is the root of a website that has an actual domain name assigned to it.</p>

答: I suggest you to put the script in the dummy folder in your root directory. and simply change the permission of that folder so that no one can open the folder or its content by just browsing it...</p>


问:
Form all possible unique 3 digit number combinations from given elements in Python,
Consider a non-empty array inarr containing non-zero positive single digit integers, separated by ','

Print a string based on the following conditions:

Form all possible unique 3 digit number combinations with the elements of inarr

Identify the maximum number among the three-digit combinations formed

Print maximum number along with the total number of unique three-digit combinations formed, separating them with a ','.

Assumption: inarr contains at least 3 elements

Note: An element present at a particular index should not be considered more than once while forming a combination.

Input: Read inarr from standard input stream

Explanation: Sample Input 1,2,1,4 for the input inarr all possible unique 3 digit number combinations are: 121,411,124,214,114,142,141,211,421,112,241,412 The maximum number is 421 and total unique combinations are 12, therefore output will be 421,12

答:
from itertools import permutations

elements = list(input("").split(',')) #makes a list of the input elements,
                                      #splitting them at ','

p = permutations(elements, 3)         #stores all possible permutations in p

x = list(set(p))                      #set removes duplicates, stores a list in x

list = []

for i in x:                           #i iterates the elements in x, here a tuple
    p = ''.join(i)                    #join concatenates the strings inside tuple
    list.append(int(p))

list.sort()
print(str(list[-1])+','+str(len(list))) #prints the last element and length
```


问:
How to get JSON file from google drive?
I have a JSON file uploaded on google drive, I am trying to parse it in my android app. How can I get the link where it's only JSON file.

I have tried to download the file from public link and using the downloading link as the url to JSON, but looks like that link expires after a few hours.

Also, I have tried "https://googledrive.com/host/FILE_ID" but this is also not working.

any help would be appreciated.

答:
Try this endpoint, it might work for you.
It will download your file</p>

```<code>https://drive.google.com/uc?export=view&id=YOUR_ID
</code>```

Title: How to get JSON file from google drive?

Body:
Try this endpoint, it might work for you.
It will download your file

https://drive.google.com/uc?export=view&id=YOUR_ID


问:
Create Folder depends on ID , upload images , and save the path in database in asp.net MVC
i am work in Property Project that allow system user when add Property upload Images for it . what i need to doing create folder depends on ID of property ,save the path in database and uploaded the images in this folder .

i create in my Property model :

```<code>public string Images { get; set; }
</code>```

in View i create :

```<code>                <div class="row">
                    <div class="col-md-2"></div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label"> choose image   </label>
                            <input multiple type="file" title="choose image" id="files" name="PropImage" onchange="show(this)" />
                        </div>
                    </div>
                    <div class="col-md-4"></div>
                </div>
</code>```

my JavaScript :

```<code> <script type="text/javascript">
        function handleFileSelect() {
            //Check File API support
            if (window.File && window.FileList && window.FileReader) {

                var files = event.target.files; //FileList object
                var output = document.getElementById("result");

                for (var i = 0; i < files.length; i++) {
                    var file = files[i];
                    //Only pics
                    if (!file.type.match('image')) continue;

                    var picReader = new FileReader();
                    picReader.addEventListener("load", function (event) {
                        var picFile = event.target;
                        var div = document.createElement("div");
                        div.innerHTML = "<img class='thumbnail' src='" + picFile.result + "'" + "title='" + picFile.name + "'/>";
                        output.insertBefore(div, null);
                    });
                    //Read the image
                    picReader.readAsDataURL(file);
                }
            } else {
                console.log("Your browser does not support File API");
            }
        }

        document.getElementById('files').addEventListener('change', handleFileSelect, false);
</code>```

now in my controller i cant create folder because the ID of property not created yet , how i can do ? and should i have  permissions to create folder ?

my controller :

public ActionResult CreateProperties(AddPropertyViewModel model,
            List PropImage)
        {

```<code>        if (ModelState.IsValid)
        {

            foreach (var item in PropImage)
            {
                var path = Path.Combine(Server.MapPath(@"~\ImgUp\" /*+ PropImagefolderName*/), item.FileName);//+ IdentityImageFolderName)
                item.SaveAs(path);

            }

            //model.PropertiesVM.ID = properToAdd.PropAddress.Id;
            // string name = Path.GetFileNameWithoutExtension(fileName); //getting file name without extension
            // string myfile = name + "_" + properToAdd.ID + ext; //appending the name with id
            // store the file inside ~/project folder(Img)
            var imagepath = Server.MapPath(PropImageDirctory);
            //var IdentityPath = Server.MapPath(IdentityImageDirctory);
            properToAdd.Images = imagepath;
            properToAdd.Build_area = model.PropertiesVM.Build_area;
            properToAdd.Earth_area = model.PropertiesVM.Earth_area;
            properToAdd.AddedDate = DateTime.Now;
            properToAdd.Prop_Type_ID = Prop_type_ID;
            properToAdd.Plate_ID = plateID;
            properToAdd.Branch_ID = BranshID;
            properToAdd.Price = model.PropertiesVM.Price;
            properToAdd.AddedBy = FullName; /*currentUserName;*/

            db.D_Properties.Add(properToAdd);

            //IdentityImage.SaveAs(Path.Combine(IdentityFolderPath, IdentityImageFileName));
            // InstrumentImage.SaveAs(Path.Combine(IdentityPath, InstrumentImageFileName));
            db.SaveChanges();
            TypesDropDownList();
            PlatesDropDownList();
            BranchesDropDownList();
            TempData["noti"] = "Success";
            return RedirectToAction("CreateProperties");
        }

            //ViewBag.message = "Please choose only Image file";
            // If we got this far, something failed, redisplay form
            TypesDropDownList();
            PlatesDropDownList();
            BranchesDropDownList();
            TempData["noti"] = "Error";
        return View();

    }
</code>```

答:
if you are going to upload images by ajax or whatever before saving properties details it means still you are not assigning any id for new records then in my view you can do as following.

you have tempImgs folder on server. rename file to $_SESSION['userid']+i

when submiting property record

get the new submitted record ID.

create directory like '../uploads/'+<<new record id>>

move file from tempImgs to the new created folder

hope this answers to your concern

Body:
i am work in Property Project that allow system user when add Property upload Images for it . what i need to doing create folder depends on ID of property ,save the path in database and uploaded the images in this folder .

i create in my Property model :

public string Images { get; set; }

in View i create :

                             choose image
                            <input multiple type="file" title="choose image" id="files" name="PropImage" onchange="show(this)" />

my JavaScript :


问:
How to execute a method with a button click
How can I add a function to a button that will run a method I've created. I want to write out an array into a message dialog box with a press of a button, but I don't seem to be getting anywhere so i turned to stackoverflow for some help, since googling didn't really help me with my problem.

```<code> static void Tractors(Tractor[] tractors)
    {

        for (int i = 0; i < tractors.Length; i++)
        {
            Console.WriteLine((i + 1) + ", " + tractors[i].ToString());
        }
    }
</code>```

This is my function that writes out the table of "Tractors".

```<code> private void button1_Click(object sender, EventArgs e)
        {

        }
</code>```

What should I write into the button1_click method so that it would work?

答:
You need to bind the event handler with the button control and write the logic inside this event handler. If its windows form application you can do like this.</p>

```<code>this.button1 = new System.Windows.Forms.Button();
this.button1.Click += new System.EventHandler(this.button1_Click);

private void button1_Click(object sender, EventArgs e)
{
//Call your methods here
}
</code>```

Body:
How can I add a function to a button that will run a method I've created. I want to write out an array into a message dialog box with a press of a button, but I don't seem to be getting anywhere so i turned to stackoverflow for some help, since googling didn't really help me with my problem.

 static void Tractors(Tractor[] tractors)
    {

        for (int i = 0; i < tractors.Length; i++)
        {
            Console.WriteLine((i + 1) + ", " + tractors[i].ToString());
        }
    }

This is my function that writes out the table of "Tractors".

 private void button1_Click(object sender, EventArgs e)
        {

        }

What should I write into the button1_click method so that it would work?

Body:
You need to bind the event handler with the button control and write the logic inside this event handler. If its windows form application you can do like this.

this.button1 = new System.Windows.Forms.Button();
this.button1.Click += new System.EventHandler(this.button1_Click);

private void button1_Click(object sender, EventArgs e)
{
//Call your methods here
}


问:
Question about creating an excel file in Python. Question about syntax
Considering I have this code. (Creating a new excel file)

```<code>import openpyxl
wb = openpyxl.Workbook()
sheet = wb['Sheet']
sheet.title = 'Hobbies'
wb.save("test.xlsx")
</code>```

I'm trying to figure out this lines:

```<code>sheet = wb['Sheet']
sheet.title = 'Hobbies'
</code>```

What do they mean?

```<code>sheet = wb['Sheet']
</code>```

wb is an instance of Workbook() class.

Is sheet an instance too? Because in the command below we then use it
to call title method. What the meaning of the square brackets with the Sheet quotation marks?

I also saw something similar in tkinter module to change the font parameter,
after creating an instance to change the text of the instance attribute. like that, it's the same like my first example?

```<code>lable1 = tkinter.Label(frame1, font=("ariel",11))
lable1 .grid(row=0, column=0, padx=8)

lable1['text'] = "new label"
</code>```

Can someone explain it to me more deeply ? I'm confused with it.

答:
Let's comment your code line by line:

wb = openpyxl.Workbook()
```

<p>In this line you create an object of type Workbook, which will be saved later as an xlsx on disk. By default an xlsx file has only one sheet called 'Sheet'. You can add several other sheets if you need, but that's another story.</p>

<pre class="lang-py prettyprint-override"><code>sheet = wb['Sheet']
</code>```

The sheet variable will refer that single sheet of your object. The 'sheet' variable is of type Worksheet and has an attribute called title with the value 'Sheet'. As an exercise, run the following code to see the titles of all the sheets of a Workbook:

for s in wb:
    print(s.title)
```

<p>Let's go further with your code:</p>

<pre class="lang-py prettyprint-override"><code>sheet.title = 'Hobbies'
</code>```

In this line you just change the title of that single sheet of the file. After you save the file just open it and you will notice that it contains a single sheet called 'Hobbies'. If you haven't ran the above line, that single sheet of the file would have been called 'Sheet' which is the default name.

Body:
Considering I have this code. (Creating a new excel file)

import openpyxl
wb = openpyxl.Workbook()
sheet = wb['Sheet']
sheet.title = 'Hobbies'
wb.save("test.xlsx")

I'm trying to figure out this lines:

sheet = wb['Sheet']
sheet.title = 'Hobbies'

What do they mean?

sheet = wb['Sheet']

wb is an instance of Workbook() class.

Is sheet an instance too? Because in the command below we then use it
to call title method. What the meaning of the square brackets with the Sheet quotation marks?

I also saw something similar in tkinter module to change the font parameter,
after creating an instance to change the text of the instance attribute. like that, it's the same like my first example?

lable1 = tkinter.Label(frame1, font=("ariel",11))
lable1 .grid(row=0, column=0, padx=8)

lable1['text'] = "new label"

Can someone explain it to me more deeply ? I'm confused with it.

Body:
Let's comment your code line by line:

wb = openpyxl.Workbook()

In this line you create an object of type Workbook, which will be saved later as an xlsx on disk. By default an xlsx file has only one sheet called 'Sheet'. You can add several other sheets if you need, but that's another story.

sheet = wb['Sheet']

The sheet variable will refer that single sheet of your object. The 'sheet' variable is of type Worksheet and has an attribute called title with the value 'Sheet'. As an exercise, run the following code to see the titles of all the sheets of a Workbook:

for s in wb:
    print(s.title)

Let's go further with your code:

sheet.title = 'Hobbies'

In this line you just change the title of that single sheet of the file. After you save the file just open it and you will notice that it contains a single sheet called 'Hobbies'. If you haven't ran the above line, that single sheet of the file would have been called 'Sheet' which is the default name.


问:
GLIBC install failed, programs are missing or too old
I had tried to install glibc-2.15 with non-root, after googling and trying two days,  I am looking help here.

```<code>After configure, it output following error:
../glibc-2.15/configure --prefix=${PWD/objDir/destDir}
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: running configure fragment for add-on libidn
configure: running configure fragment for add-on nptl
checking for assembler gnu_indirect_function symbol type support... yes
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for assembler .type directive prefix... @
checking sysdep dirs... sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld... yes
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... 2.25.1, ok
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... 2.25.1, ok
checking for pwd... /bin/pwd
checking for gcc... gcc
checking version of gcc... 4.9.3, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 4.2.1, bad
checking for gnumsgfmt... no
checking for gmsgfmt... gmsgfmt
checking version of gmsgfmt... 0.18.3, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.13, ok
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for readelf... readelf
checking for autoconf... autoconf
checking whether autoconf works... yes
configure: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.
</code>```

and in configure.log:

```<code>cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ../glibc-2.15/configure --prefix=/home/zhongxm/glibc/destDir

## --------- ##
## Platform. ##
## --------- ##

hostname = mercury
uname -m = x86_64
uname -r = 3.0.6-gentoo
uname -s = Linux
uname -v = #1 SMP Sun Dec 11 16:24:12 CST 2011

/usr/bin/uname -p = Intel(R) Xeon(R) CPU E7450 @ 2.40GHz
/bin/uname -X     = unknown

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

PATH: /home/zhongxm/bin
PATH: /home/zhongxm/local/bin
PATH: /home/zhongxm/bin/x86_64
PATH: /home/zhongxm/bin/scripts
PATH: /home/zhongxm/tool/jdk/bin
PATH: /home/zhongxm/tool/bedtools/bin
PATH: /home/zhongxm/tool/annovar
PATH: /home/zhongxm/tool/ngsShoRT
PATH: /home/zhongxm/tool/qualimap
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3
PATH: /opt/svn/bin
PATH: /usr/local/meme/bin
PATH: /data/tool/hisat
PATH: /rd1/user/zh2yyongxm/bin
PATH: /rd1/user/zhongxm/script/
PATH: /rd1/user/zhangsj/bin
PATH: /rd1/user/data/bin/x86_64/

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

configure:2367: checking build system type
configure:2381: result: x86_64-unknown-linux-gnu
configure:2401: checking host system type
configure:2414: result: x86_64-unknown-linux-gnu
configure:2483: checking for gcc
configure:2499: found /usr/bin/gcc
configure:2510: result: gcc
configure:2739: checking for C compiler version
configure:2748: gcc --version >&5
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2759: $? = 0
configure:2748: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:2759: $? = 0
configure:2748: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2748: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2764: checking for suffix of object files
configure:2786: gcc -c   conftest.c >&5
configure:2790: $? = 0
configure:2811: result: o
configure:2815: checking whether we are using the GNU C compiler
configure:2834: gcc -c   conftest.c >&5
configure:2834: $? = 0
configure:2843: result: yes
configure:2852: checking whether gcc accepts -g
configure:2872: gcc -c -g  conftest.c >&5
configure:2872: $? = 0
configure:2913: result: yes
configure:2930: checking for gcc option to accept ISO C89
configure:2994: gcc  -c -g -O2  conftest.c >&5
configure:2994: $? = 0
configure:3007: result: none needed
configure:3077: checking how to run the C preprocessor
configure:3108: gcc -E  conftest.c
configure:3108: $? = 0
configure:3122: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
                            ^
compilation terminated.
configure:3122: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3147: result: gcc -E
configure:3167: gcc -E  conftest.c
configure:3167: $? = 0
configure:3181: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
                            ^
compilation terminated.
configure:3181: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3268: checking for g++
configure:3284: found /usr/bin/g++
configure:3295: result: g++
configure:3322: checking for C++ compiler version
configure:3331: g++ --version >&5
g++ (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3342: $? = 0
configure:3331: g++ -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:3342: $? = 0
configure:3331: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3331: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3346: checking whether we are using the GNU C++ compiler
configure:3365: g++ -c   conftest.cpp >&5
configure:3365: $? = 0
configure:3374: result: yes
configure:3383: checking whether g++ accepts -g
configure:3403: g++ -c -g  conftest.cpp >&5
configure:3403: $? = 0
configure:3444: result: yes
configure:3949: running configure fragment for add-on libidn
configure:3949: running configure fragment for add-on nptl
configure:4091: checking for assembler gnu_indirect_function symbol type support
configure:4107: result: yes
configure:4110: checking whether .text pseudo-op must be used
configure:4120: gcc  -c conftest.s 1>&5
configure:4123: $? = 0
configure:4134: result: yes
configure:4138: checking for assembler global-symbol directive
configure:4151: gcc  -c conftest.s 1>&5
configure:4154: $? = 0
configure:4162: result: .globl
configure:4173: checking for assembler .type directive prefix
configure:4189: gcc  -c conftest.s 1>&5
configure:4192: $? = 0
configure:4200: result: @
configure:4223: checking sysdep dirs
configure:4468: result: sysdeps/generic/elf sysdeps/generic
configure:4545: checking for a BSD-compatible install
configure:4613: result: /usr/bin/install -c
configure:4628: checking whether ln -s works
configure:4632: result: yes
configure:4656: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as
configure:4670: result: yes
configure:4675: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld
configure:4689: result: yes
configure:4699: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4726: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4741: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4751: result: 2.25.1, ok
configure:4762: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4789: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4804: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4814: result: 2.25.1, ok
configure:4829: checking for pwd
configure:4847: found /bin/pwd
configure:4860: result: /bin/pwd
configure:4878: checking for gcc
configure:4905: result: gcc
configure:4920: checking version of gcc
configure:4930: result: 4.9.3, ok
configure:4941: checking for gnumake
configure:4971: result: no
configure:4941: checking for gmake
configure:4957: found /usr/bin/gmake
configure:4968: result: gmake
configure:4983: checking version of gmake
configure:4993: result: 4.2.1, bad
configure:5005: checking for gnumsgfmt
configure:5035: result: no
configure:5005: checking for gmsgfmt
configure:5021: found /usr/bin/gmsgfmt
configure:5032: result: gmsgfmt
configure:5047: checking version of gmsgfmt
configure:5057: result: 0.18.3, ok
configure:5068: checking for makeinfo
configure:5084: found /usr/bin/makeinfo
configure:5095: result: makeinfo
configure:5110: checking version of makeinfo
configure:5120: result: 4.13, ok
configure:5131: checking for sed
configure:5147: found /bin/sed
configure:5158: result: sed
configure:5173: checking version of sed
configure:5183: result: 4.2.1, ok
configure:5234: checking for readelf
configure:5250: found /usr/bin/readelf
configure:5261: result: readelf
configure:5288: checking for autoconf
configure:5304: found /usr/bin/autoconf
configure:5315: result: autoconf
configure:5330: checking whether autoconf works
configure:5341: result: yes
configure:5350: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_PWD_P=/bin/pwd
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AS=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
ac_cv_prog_AUTOCONF=autoconf
ac_cv_prog_CC=gcc
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_LD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
ac_cv_prog_MAKE=gmake
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_MSGFMT=gmsgfmt
ac_cv_prog_SED=sed
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_READELF=readelf
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
libc_cv_asm_global_directive=.globl
libc_cv_asm_gnu_indirect_function=yes
libc_cv_asm_type_prefix=@
libc_cv_autoconf_works=yes
libc_cv_dot_text=.text
libc_cv_nss_crypt=no
libc_cv_prog_as_gnu=yes
libc_cv_prog_ld_gnu=yes

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

AR='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ar'
AS='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as'
ASFLAGS_config=''
AUTOCONF='autoconf'
AWK=''
BASH_SHELL=''
BISON=''
BUILD_CC=''
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXX_SYSINCLUDES=''
DEFINES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_INFO=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
KSH=''
LD='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld'
LDFLAGS=''
LIBGD=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE='gmake'
MAKEINFO='makeinfo'
MIG=''
MSGFMT='gmsgfmt'
OBJCOPY='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objcopy'
OBJDUMP='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objdump'
OBJEXT='o'
PACKAGE_BUGREPORT='http://sourceware.org/bugzilla/'
PACKAGE_NAME='GNU C Library'
PACKAGE_STRING='GNU C Library (see version.h)'
PACKAGE_TARNAME='glibc'
PACKAGE_URL='http://www.gnu.org/software/glibc/'
PACKAGE_VERSION='(see version.h)'
PATH_SEPARATOR=':'
PERL=''
PWD_P='/bin/pwd'
READELF='readelf'
RELEASE=''
SED='sed'
SHELL='/bin/sh'
SYSINCLUDES=''
VERSION=''
VERSIONING=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
add_on_subdirs=' libidn'
add_ons='libidn nptl'
all_warnings=''
base_machine='x86_64'
bindir='${exec_prefix}/bin'
bindnow='no'
bounded='no'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
cross_compiling='no'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
elf='yes'
enable_check_abi='no'
exceptions=''
exec_prefix='NONE'
fno_unit_at_a_time=''
force_install='yes'
gnu89_inline=''
have_libaudit=''
have_libcap=''
have_selinux=''
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
ldd_rewrite_script=''
libc_cv_Bgroup=''
libc_cv_as_i686=''
libc_cv_as_needed=''
libc_cv_cc_avx=''
libc_cv_cc_fma4=''
libc_cv_cc_novzeroupper=''
libc_cv_cc_sse4=''
libc_cv_cc_submachine=''
libc_cv_cc_with_libunwind=''
libc_cv_cpp_asm_debuginfo=''
libc_cv_forced_unwind=''
libc_cv_fpie=''
libc_cv_gcc_static_libgcc=''
libc_cv_gcc_unwind_find_fde=''
libc_cv_hashstyle=''
libc_cv_have_bash2=''
libc_cv_have_initfini=''
libc_cv_have_ksh=''
libc_cv_libgcc_s_suffix=''
libc_cv_localedir=''
libc_cv_nss_crypt='no'
libc_cv_output_format=''
libc_cv_pic_default=''
libc_cv_rootsbindir=''
libc_cv_slibdir=''
libc_cv_ssp=''
libc_cv_sysconfdir=''
libc_cv_z_combreloc=''
libc_cv_z_execstack=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mach_interface_list=''
mandir='${datarootdir}/man'
multi_arch='default'
nopic_initfini=''
old_glibc_headers=''
oldest_abi='default'
oldincludedir='/usr/include'
omitfp='no'
pdfdir='${docdir}'
prefix='/home/zhongxm/glibc/destDir'
profile='no'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
shared='default'
sharedstatedir='${prefix}/com'
sizeof_long_double=''
static='yes'
static_nss='no'
subdirs='  '
submachine=''
sysconfdir='${prefix}/etc'
sysdeps_add_ons=' nptl'
sysnames=' sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic'
target_alias=''
use_default_link='default'
use_ldconfig=''
with_fp='yes'
xcoff='no'

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

/* confdefs.h */
#define PACKAGE_NAME "GNU C Library"
#define PACKAGE_TARNAME "glibc"
#define PACKAGE_VERSION "(see version.h)"
#define PACKAGE_STRING "GNU C Library (see version.h)"
#define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
#define PACKAGE_URL "http://www.gnu.org/software/glibc/"
#define HAVE_LIBIDN 1
#define ASM_GLOBAL_DIRECTIVE .globl
#define ASM_TYPE_DIRECTIVE_PREFIX @
#define USE_MULTIARCH 1

configure: exit 1
</code>```

I had checked that programs mentioned in INSTALL is newer than it needed. Considering my software may too new, I had install make-3.79 which is mentioned in INSTALL, gcc texinfo, but they didn't solved my problem. I hardly know what to do? Is any other way can I install GLIBC without root privileges.

The related information of my machine:

```<code>uname -a
Linux mercury 3.0.6-gentoo #1 SMP Sun Dec 11 16:24:12 CST 2011 x86_64 Intel(R) Xeon(R) CPU E7450 @ 2.40GHz GenuineIntel GNU/Linux

gcc --version
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

texi2pdf --version
texi2dvi (GNU Texinfo 4.13) 1.135

Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
</code>```

Any suggestion would be grateful!
Best wishes!

Edit:

Mrak Plotnick, thanks for your reply very much!

According to your suggestion, it output new error as follow, could you give me another advice?

```<code>../glibc-2.15/configure --prefix=${PWD/objDir/destDir} --disable-multilib
........
In file included from <command-line>:0:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123:30: error: inlining failed in call to always_inline 'syslog': function not inlinable
 ldbl_strong_alias (__syslog, syslog)
                              ^
./../include/libc-symbols.h:102:26: note: in definition of macro '_strong_alias'
   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
                          ^
../sysdeps/generic/math_ldbl_opt.h:12:44: note: in expansion of macro 'strong_alias'
 #define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
                                            ^
../misc/syslog.c:123:1: note: in expansion of macro 'ldbl_strong_alias'
 ldbl_strong_alias (__syslog, syslog)
 ^
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c:155:3: error: called from here
   syslog(INTERNALLOG,
   ^
make[2]: *** [/home/zhongxm/glibc/v2/objDir/sysd-rules:1311: /home/zhongxm/glibc/v2/objDir/misc/syslog.os] Error 1
make[2]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15/misc'
make[1]: *** [Makefile:220: misc/subdir_lib] Error 2
make[1]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15'
make: *** [Makefile:7: all] Error 2
</code>```

Also, I had tried to installed latest gcc (which install latest gmp, mpfr and mpc first) and glibc, but when I add the path of lib in glib to LD_LIBRARY_PATH, it output "Segmentation fault", any other suggestions?

Any suggestion would be grateful! Best wishes!

答: Your make is old. Compile and install GNU make, and create a soft link of gmake to make.</p>

Body:
I had tried to install glibc-2.15 with non-root, after googling and trying two days,  I am looking help here.

After configure, it output following error:
../glibc-2.15/configure --prefix=${PWD/objDir/destDir}
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: running configure fragment for add-on libidn
configure: running configure fragment for add-on nptl
checking for assembler gnu_indirect_function symbol type support... yes
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for assembler .type directive prefix... @
checking sysdep dirs... sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as... yes
checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld... yes
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as... 2.25.1, ok
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld... 2.25.1, ok
checking for pwd... /bin/pwd
checking for gcc... gcc
checking version of gcc... 4.9.3, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 4.2.1, bad
checking for gnumsgfmt... no
checking for gmsgfmt... gmsgfmt
checking version of gmsgfmt... 0.18.3, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.13, ok
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for readelf... readelf
checking for autoconf... autoconf
checking whether autoconf works... yes
configure: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

and in configure.log:

cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ../glibc-2.15/configure --prefix=/home/zhongxm/glibc/destDir

## --------- ##
## Platform. ##
## --------- ##

hostname = mercury
uname -m = x86_64
uname -r = 3.0.6-gentoo
uname -s = Linux
uname -v = #1 SMP Sun Dec 11 16:24:12 CST 2011

/usr/bin/uname -p = Intel(R) Xeon(R) CPU E7450 @ 2.40GHz
/bin/uname -X     = unknown

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

PATH: /home/zhongxm/bin
PATH: /home/zhongxm/local/bin
PATH: /home/zhongxm/bin/x86_64
PATH: /home/zhongxm/bin/scripts
PATH: /home/zhongxm/tool/jdk/bin
PATH: /home/zhongxm/tool/bedtools/bin
PATH: /home/zhongxm/tool/annovar
PATH: /home/zhongxm/tool/ngsShoRT
PATH: /home/zhongxm/tool/qualimap
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3
PATH: /opt/svn/bin
PATH: /usr/local/meme/bin
PATH: /data/tool/hisat
PATH: /rd1/user/zh2yyongxm/bin
PATH: /rd1/user/zhongxm/script/
PATH: /rd1/user/zhangsj/bin
PATH: /rd1/user/data/bin/x86_64/

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

configure:2367: checking build system type
configure:2381: result: x86_64-unknown-linux-gnu
configure:2401: checking host system type
configure:2414: result: x86_64-unknown-linux-gnu
configure:2483: checking for gcc
configure:2499: found /usr/bin/gcc
configure:2510: result: gcc
configure:2739: checking for C compiler version
configure:2748: gcc --version >&5
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2759: $? = 0
configure:2748: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:2759: $? = 0
configure:2748: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2748: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2764: checking for suffix of object files
configure:2786: gcc -c   conftest.c >&5
configure:2790: $? = 0
configure:2811: result: o
configure:2815: checking whether we are using the GNU C compiler
configure:2834: gcc -c   conftest.c >&5
configure:2834: $? = 0
configure:2843: result: yes
configure:2852: checking whether gcc accepts -g
configure:2872: gcc -c -g  conftest.c >&5
configure:2872: $? = 0
configure:2913: result: yes
configure:2930: checking for gcc option to accept ISO C89
configure:2994: gcc  -c -g -O2  conftest.c >&5
configure:2994: $? = 0
configure:3007: result: none needed
configure:3077: checking how to run the C preprocessor
configure:3108: gcc -E  conftest.c
configure:3108: $? = 0
configure:3122: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
                            ^
compilation terminated.
configure:3122: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3147: result: gcc -E
configure:3167: gcc -E  conftest.c
configure:3167: $? = 0
configure:3181: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
                            ^
compilation terminated.
configure:3181: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3268: checking for g++
configure:3284: found /usr/bin/g++
configure:3295: result: g++
configure:3322: checking for C++ compiler version
configure:3331: g++ --version >&5
g++ (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3342: $? = 0
configure:3331: g++ -v >&5
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.3 p1.4, pie-0.6.4' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.4, pie-0.6.4)
configure:3342: $? = 0
configure:3331: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3331: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3342: $? = 1
configure:3346: checking whether we are using the GNU C++ compiler
configure:3365: g++ -c   conftest.cpp >&5
configure:3365: $? = 0
configure:3374: result: yes
configure:3383: checking whether g++ accepts -g
configure:3403: g++ -c -g  conftest.cpp >&5
configure:3403: $? = 0
configure:3444: result: yes
configure:3949: running configure fragment for add-on libidn
configure:3949: running configure fragment for add-on nptl
configure:4091: checking for assembler gnu_indirect_function symbol type support
configure:4107: result: yes
configure:4110: checking whether .text pseudo-op must be used
configure:4120: gcc  -c conftest.s 1>&5
configure:4123: $? = 0
configure:4134: result: yes
configure:4138: checking for assembler global-symbol directive
configure:4151: gcc  -c conftest.s 1>&5
configure:4154: $? = 0
configure:4162: result: .globl
configure:4173: checking for assembler .type directive prefix
configure:4189: gcc  -c conftest.s 1>&5
configure:4192: $? = 0
configure:4200: result: @
configure:4223: checking sysdep dirs
configure:4468: result: sysdeps/generic/elf sysdeps/generic
configure:4545: checking for a BSD-compatible install
configure:4613: result: /usr/bin/install -c
configure:4628: checking whether ln -s works
configure:4632: result: yes
configure:4656: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as is GNU as
configure:4670: result: yes
configure:4675: checking whether /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld is GNU ld
configure:4689: result: yes
configure:4699: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4726: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4741: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
configure:4751: result: 2.25.1, ok
configure:4762: checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4789: result: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4804: checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
configure:4814: result: 2.25.1, ok
configure:4829: checking for pwd
configure:4847: found /bin/pwd
configure:4860: result: /bin/pwd
configure:4878: checking for gcc
configure:4905: result: gcc
configure:4920: checking version of gcc
configure:4930: result: 4.9.3, ok
configure:4941: checking for gnumake
configure:4971: result: no
configure:4941: checking for gmake
configure:4957: found /usr/bin/gmake
configure:4968: result: gmake
configure:4983: checking version of gmake
configure:4993: result: 4.2.1, bad
configure:5005: checking for gnumsgfmt
configure:5035: result: no
configure:5005: checking for gmsgfmt
configure:5021: found /usr/bin/gmsgfmt
configure:5032: result: gmsgfmt
configure:5047: checking version of gmsgfmt
configure:5057: result: 0.18.3, ok
configure:5068: checking for makeinfo
configure:5084: found /usr/bin/makeinfo
configure:5095: result: makeinfo
configure:5110: checking version of makeinfo
configure:5120: result: 4.13, ok
configure:5131: checking for sed
configure:5147: found /bin/sed
configure:5158: result: sed
configure:5173: checking version of sed
configure:5183: result: 4.2.1, ok
configure:5234: checking for readelf
configure:5250: found /usr/bin/readelf
configure:5261: result: readelf
configure:5288: checking for autoconf
configure:5304: found /usr/bin/autoconf
configure:5315: result: autoconf
configure:5330: checking whether autoconf works
configure:5341: result: yes
configure:5350: error:
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_PWD_P=/bin/pwd
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AS=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as
ac_cv_prog_AUTOCONF=autoconf
ac_cv_prog_CC=gcc
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_LD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld
ac_cv_prog_MAKE=gmake
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_MSGFMT=gmsgfmt
ac_cv_prog_SED=sed
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_READELF=readelf
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
libc_cv_asm_global_directive=.globl
libc_cv_asm_gnu_indirect_function=yes
libc_cv_asm_type_prefix=@
libc_cv_autoconf_works=yes
libc_cv_dot_text=.text
libc_cv_nss_crypt=no
libc_cv_prog_as_gnu=yes
libc_cv_prog_ld_gnu=yes

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

AR='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ar'
AS='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/as'
ASFLAGS_config=''
AUTOCONF='autoconf'
AWK=''
BASH_SHELL=''
BISON=''
BUILD_CC=''
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXX_SYSINCLUDES=''
DEFINES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_INFO=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
KSH=''
LD='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld'
LDFLAGS=''
LIBGD=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE='gmake'
MAKEINFO='makeinfo'
MIG=''
MSGFMT='gmsgfmt'
OBJCOPY='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objcopy'
OBJDUMP='/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/objdump'
OBJEXT='o'
PACKAGE_BUGREPORT='http://sourceware.org/bugzilla/'
PACKAGE_NAME='GNU C Library'
PACKAGE_STRING='GNU C Library (see version.h)'
PACKAGE_TARNAME='glibc'
PACKAGE_URL='http://www.gnu.org/software/glibc/'
PACKAGE_VERSION='(see version.h)'
PATH_SEPARATOR=':'
PERL=''
PWD_P='/bin/pwd'
READELF='readelf'
RELEASE=''
SED='sed'
SHELL='/bin/sh'
SYSINCLUDES=''
VERSION=''
VERSIONING=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
add_on_subdirs=' libidn'
add_ons='libidn nptl'
all_warnings=''
base_machine='x86_64'
bindir='${exec_prefix}/bin'
bindnow='no'
bounded='no'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
cross_compiling='no'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
elf='yes'
enable_check_abi='no'
exceptions=''
exec_prefix='NONE'
fno_unit_at_a_time=''
force_install='yes'
gnu89_inline=''
have_libaudit=''
have_libcap=''
have_selinux=''
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
ldd_rewrite_script=''
libc_cv_Bgroup=''
libc_cv_as_i686=''
libc_cv_as_needed=''
libc_cv_cc_avx=''
libc_cv_cc_fma4=''
libc_cv_cc_novzeroupper=''
libc_cv_cc_sse4=''
libc_cv_cc_submachine=''
libc_cv_cc_with_libunwind=''
libc_cv_cpp_asm_debuginfo=''
libc_cv_forced_unwind=''
libc_cv_fpie=''
libc_cv_gcc_static_libgcc=''
libc_cv_gcc_unwind_find_fde=''
libc_cv_hashstyle=''
libc_cv_have_bash2=''
libc_cv_have_initfini=''
libc_cv_have_ksh=''
libc_cv_libgcc_s_suffix=''
libc_cv_localedir=''
libc_cv_nss_crypt='no'
libc_cv_output_format=''
libc_cv_pic_default=''
libc_cv_rootsbindir=''
libc_cv_slibdir=''
libc_cv_ssp=''
libc_cv_sysconfdir=''
libc_cv_z_combreloc=''
libc_cv_z_execstack=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mach_interface_list=''
mandir='${datarootdir}/man'
multi_arch='default'
nopic_initfini=''
old_glibc_headers=''
oldest_abi='default'
oldincludedir='/usr/include'
omitfp='no'
pdfdir='${docdir}'
prefix='/home/zhongxm/glibc/destDir'
profile='no'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
shared='default'
sharedstatedir='${prefix}/com'
sizeof_long_double=''
static='yes'
static_nss='no'
subdirs='  '
submachine=''
sysconfdir='${prefix}/etc'
sysdeps_add_ons=' nptl'
sysnames=' sysdeps/x86_64/elf nptl/sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/wordsize-64 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/x86_64 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86_64/multiarch nptl/sysdeps/x86_64 sysdeps/x86_64 sysdeps/wordsize-64 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic'
target_alias=''
use_default_link='default'
use_ldconfig=''
with_fp='yes'
xcoff='no'

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

/* confdefs.h */
#define PACKAGE_NAME "GNU C Library"
#define PACKAGE_TARNAME "glibc"
#define PACKAGE_VERSION "(see version.h)"
#define PACKAGE_STRING "GNU C Library (see version.h)"
#define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
#define PACKAGE_URL "http://www.gnu.org/software/glibc/"
#define HAVE_LIBIDN 1
#define ASM_GLOBAL_DIRECTIVE .globl
#define ASM_TYPE_DIRECTIVE_PREFIX @
#define USE_MULTIARCH 1

configure: exit 1

I had checked that programs mentioned in INSTALL is newer than it needed. Considering my software may too new, I had install make-3.79 which is mentioned in INSTALL, gcc texinfo, but they didn't solved my problem. I hardly know what to do? Is any other way can I install GLIBC without root privileges.

The related information of my machine:

uname -a
Linux mercury 3.0.6-gentoo #1 SMP Sun Dec 11 16:24:12 CST 2011 x86_64 Intel(R) Xeon(R) CPU E7450 @ 2.40GHz GenuineIntel GNU/Linux

gcc --version
gcc (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

texi2pdf --version
texi2dvi (GNU Texinfo 4.13) 1.135

Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Any suggestion would be grateful!
Best wishes!

Edit:

Mrak Plotnick, thanks for your reply very much!

According to your suggestion, it output new error as follow, could you give me another advice?

../glibc-2.15/configure --prefix=${PWD/objDir/destDir} --disable-multilib
........
In file included from <command-line>:0:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123:30: error: inlining failed in call to always_inline 'syslog': function not inlinable
 ldbl_strong_alias (__syslog, syslog)
                              ^
./../include/libc-symbols.h:102:26: note: in definition of macro '_strong_alias'
   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
                          ^
../sysdeps/generic/math_ldbl_opt.h:12:44: note: in expansion of macro 'strong_alias'
 #define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
                                            ^
../misc/syslog.c:123:1: note: in expansion of macro 'ldbl_strong_alias'
 ldbl_strong_alias (__syslog, syslog)
 ^
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c:155:3: error: called from here
   syslog(INTERNALLOG,
   ^
make[2]: *** [/home/zhongxm/glibc/v2/objDir/sysd-rules:1311: /home/zhongxm/glibc/v2/objDir/misc/syslog.os] Error 1
make[2]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15/misc'
make[1]: *** [Makefile:220: misc/subdir_lib] Error 2
make[1]: Leaving directory '/home/zhongxm/glibc/v2/glibc-2.15'
make: *** [Makefile:7: all] Error 2

Also, I had tried to installed latest gcc (which install latest gmp, mpfr and mpc first) and glibc, but when I add the path of lib in glib to LD_LIBRARY_PATH, it output "Segmentation fault", any other suggestions?

Any suggestion would be grateful! Best wishes!


答:
When you call wb['Sheet'] you're looking up a worksheet inside of the workbook with the title of 'Sheet'.

We can verify it here:

```<code>import openpyxl
wb = openpyxl.Workbook()

print(f'Before: {wb.sheetnames}')  # Output: Before: ['Sheet']
sheet = wb['Sheet']
sheet.title = 'Hobbies'
print(f'After: {wb.sheetnames}')  # Output: After: ['Hobbies']

print(f'Type of sheet: {type(sheet)}') # Output: Type of sheet: <class 'openpyxl.worksheet.worksheet.Worksheet'>
wb.save("test.xlsx")
</code>```

As you can see above, the variable sheet is an instance of the worksheet class. So basically what is happening is that you're changing the title of the default worksheet that is created inside of a workbook.

Title: Question about creating an excel file in Python. Question about syntax

Body:
When you call wb['Sheet'] you're looking up a worksheet inside of the workbook with the title of 'Sheet'.

We can verify it here:

import openpyxl
wb = openpyxl.Workbook()

print(f'Before: {wb.sheetnames}')  # Output: Before: ['Sheet']
sheet = wb['Sheet']
sheet.title = 'Hobbies'
print(f'After: {wb.sheetnames}')  # Output: After: ['Hobbies']

print(f'Type of sheet: {type(sheet)}') # Output: Type of sheet: <class 'openpyxl.worksheet.worksheet.Worksheet'>
wb.save("test.xlsx")

As you can see above, the variable sheet is an instance of the worksheet class. So basically what is happening is that you're changing the title of the default worksheet that is created inside of a workbook.


问:
React: 2 way binding props
How can I do a 2 way binding of a variable from the parent component (Form.js), such that changes occurred in the child component (InputText.js) will be updated in the parent component?

Expected result: typing values in the input in InputText.js will update the state of Form.js

In Form.js

```<code>render() {
    return (
      <div>
        <InputText
          title="Email"
          data={this.state.formInputs.email}
        />

        <div>
          Value: {this.state.formInputs.email} // <-- this no change
        </div>

      </div>
    )
  }
</code>```

In InputText.js

```<code>export default class InputText extends React.Component {

  constructor(props) {
    super(props);
    this.state = props;
    this.handleKeyChange = this.keyUpHandler.bind(this);
  }

  keyUpHandler(e) {
    this.setState({
      data: e.target.value
    });
  }

  render() {
    return (
      <div>
        <label className="label">{this.state.title}</label>
        <input type="text" value={this.state.data} onChange={this.handleKeyChange} /> // <-- type something here
        value: ({this.state.data}) // <-- this changed
      </div>
    )
  }
}
</code>```

答: You can simply pass a callback from Form.js to InputText and then call that callback in InputText on handleKeyChange</p>

Title: React: 2 way binding props

Body:
How can I do a 2 way binding of a variable from the parent component (Form.js), such that changes occurred in the child component (InputText.js) will be updated in the parent component?

Expected result: typing values in the input in InputText.js will update the state of Form.js

In Form.js

render() {
    return (

        <InputText
          title="Email"
          data={this.state.formInputs.email}
        />

          Value: {this.state.formInputs.email} // <-- this no change

    )
  }

In InputText.js

export default class InputText extends React.Component {

  constructor(props) {
    super(props);
    this.state = props;
    this.handleKeyChange = this.keyUpHandler.bind(this);
  }

  keyUpHandler(e) {
    this.setState({
      data: e.target.value
    });
  }

  render() {
    return (

        {this.state.title}
        <input type="text" value={this.state.data} onChange={this.handleKeyChange} /> // <-- type something here
        value: ({this.state.data}) // <-- this changed

    )
  }
}


问:
Select nested elements by class
I'm working on a macro to analyse one certain website and I'm trying to select nested elements by class. The html code is as follows:

```<code><div class="publication_info">
<table>
  <tr>
    <th class="first">A</th>
    <th class="second">B</th>
    <th class="third">C</th>
  </tr>
</table>
</div>
</code>```

I'm trying to retrieve the content of the cell with the class "third" (which would be the letter C). My approach is to first select the table by the class "publication_info" and afterwards the cell by the class "third", but it doesn't work. My code is:

```<code>Dim html As HTMLDocument
Set html = New HTMLDocument

With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", url, False
    .send
    html.body.innerHTML = .responseText
End With

With html
    Set oInfos = .getElementsByClassName("publication_info")(0).getElementsByClassName("third")(0)
End With
</code>```

Strangely enough, the table can be accessed easily.

Any ideas? Your help is much appreciated!
Best regards

答:
If you can scrape the table, but not its content, then I assume that the content is dynamically reloaded. In this case you have to work with Internet Explorer. MSXML2.XMLHTTP cannot handle dynamic content, it only fetches the first static part of a page.

Try it like this:

```<code>Sub TestForThird()

Dim url As String
Dim IE As Object
Dim nodeTable As Object
Dim nodeThird As Object

  url = "Here your URL"

  'Initialize Internet Explorer and load page
  Set IE = CreateObject("InternetExplorer.Application")
  IE.Visible = True
  IE.navigate url
  Do: DoEvents: Loop Until IE.readyState = 4

  'Wait to load dynamic content to the table
  Application.Wait (Now + TimeSerial(0, 0, 5))

  'Get table
  Set nodeTable = IE.document.getElementsByClassName("publication_info")(0)

  'Get third from table
  Set nodeThird = nodeTable.getElementsByClassName("third")(0)

  'Show innertext
  mesgbox nodeThird.innertext
End Sub
</code>```

Title: Select nested elements by class

Body:
I'm working on a macro to analyse one certain website and I'm trying to select nested elements by class. The html code is as follows:

    A
    B
    C

I'm trying to retrieve the content of the cell with the class "third" (which would be the letter C). My approach is to first select the table by the class "publication_info" and afterwards the cell by the class "third", but it doesn't work. My code is:

Dim html As HTMLDocument
Set html = New HTMLDocument

With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", url, False
    .send
    html.body.innerHTML = .responseText
End With

With html
    Set oInfos = .getElementsByClassName("publication_info")(0).getElementsByClassName("third")(0)
End With

Strangely enough, the table can be accessed easily.

Any ideas? Your help is much appreciated!
Best regards

Body:
If you can scrape the table, but not its content, then I assume that the content is dynamically reloaded. In this case you have to work with Internet Explorer. MSXML2.XMLHTTP cannot handle dynamic content, it only fetches the first static part of a page.

Try it like this:

Sub TestForThird()

Dim url As String
Dim IE As Object
Dim nodeTable As Object
Dim nodeThird As Object

  url = "Here your URL"

  'Initialize Internet Explorer and load page
  Set IE = CreateObject("InternetExplorer.Application")
  IE.Visible = True
  IE.navigate url
  Do: DoEvents: Loop Until IE.readyState = 4

  'Wait to load dynamic content to the table
  Application.Wait (Now + TimeSerial(0, 0, 5))

  'Get table
  Set nodeTable = IE.document.getElementsByClassName("publication_info")(0)

  'Get third from table
  Set nodeThird = nodeTable.getElementsByClassName("third")(0)

  'Show innertext
  mesgbox nodeThird.innertext
End Sub


问:
Display a neat set of files in my application
I have a set of files written to a temporary directory which I want to display to the user. In this instance I wish them to be able to select a file and then have the option of saving it. Is there a decent control in C# for doing this?</p>

答:
I think you could use OpenFileDialog and FolderBrowserDialog for example:</p>

```<code>using (OpenFileDialog dialog = new OpenFileDialog())
{
  dialog.InitialDirectory = "c:\\";//your temp directory path
  dialog.Title = "Select files to move/copy";
  if (dialog.ShowDialog() == DialogResult.OK)
  {
     string[] files = dialog.FileNames;
     using (FolderBrowserDialog save = new FolderBrowserDialog())
     {
        save.Description = "Select location to save files";
        if (save.ShowDialog() == DialogResult.OK)
        {
           foreach (string file in files)
           {
              FileInfo finfo = new FileInfo(file);
              File.Move(file, save.SelectedPath + finfo.Name);
           }
         }
      }
   }
}
</code>```

Body:
I think you could use OpenFileDialog and FolderBrowserDialog for example:

using (OpenFileDialog dialog = new OpenFileDialog())
{
  dialog.InitialDirectory = "c:\\";//your temp directory path
  dialog.Title = "Select files to move/copy";
  if (dialog.ShowDialog() == DialogResult.OK)
  {
     string[] files = dialog.FileNames;
     using (FolderBrowserDialog save = new FolderBrowserDialog())
     {
        save.Description = "Select location to save files";
        if (save.ShowDialog() == DialogResult.OK)
        {
           foreach (string file in files)
           {
              FileInfo finfo = new FileInfo(file);
              File.Move(file, save.SelectedPath + finfo.Name);
           }
         }
      }
   }
}


问:
Regex to match string containing two names in any order
I need logical AND in regex.

something like

jack AND james

agree with following strings

'hi jack here is james'

'hi james here is jack'

答:
You can make use of regex's quantifier feature since lookaround may not be supported all the time.

```<code>(\bjames\b){1,}.*(\bjack\b){1,}|(\bjack\b){1,}.*(\bjames\b){1,}
</code>```

ContentLicense: CC BY-SA 2.5

Body:
You can make use of regex's quantifier feature since lookaround may not be supported all the time.

(\bjames\b){1,}.*(\bjack\b){1,}|(\bjack\b){1,}.*(\bjames\b){1,}


问:
mapStateToProps get url param?
I am using create-app-react with redux and react-router-dom with 5.2.0 version.

In App.js

```<code>function App() {
  return (
    <BrowserRouter>
      <div className="container">
        <Header />
        <Switch>
          <Route exact path="/" component={HomePage} />
          <Route path="/about" component={AboutPage} />
          <Route path="/courses" component={CoursesPage} />
          <Route path="/course" component={ManageCoursePage} />
          <Route path="/course/:slug" component={ManageCoursePage} />
          <Route component={PageNotFound} />
        </Switch>
      </div>
    </BrowserRouter>
  )
}
</code>```

In coursePage.js

```<code>.......
.......
function mapStateToProps(state, ownProps) {
  const slug = ownProps.match.params.slug
........
}
.......
export default connect(mapStateToProps, mapDispatchToProps)(ManageCoursePage)
</code>```

.......

the course slug in the URL with

```<code>const slug = ownProps.match.params.slug;
</code>```

However, I am finding that "params" is an empty object. To work around this I did the following, which works

```<code>const slug = ownProps.location.pathname.split('/').reverse()[0];
</code>```

I do not understand how "ownProps.match" does not have the url information when "ownProps.location"

Screenshot for what i did breakpoints it as below:

Could you please help to resolve this issue?

Thanks in advance

答: Your route <Route path="/courses" component={CoursesPage} /> don't have any params. You can for example rewrite this as <Route path="/courses/:courseId" component={CoursesPage} />. After you can access ownProps.match.params.courseId in your CoursesPage component.

Title: mapStateToProps get url param?

Body:
I am using create-app-react with redux and react-router-dom with 5.2.0 version.

In App.js

function App() {
  return (
    <BrowserRouter>

        <Switch>
          <Route exact path="/" component={HomePage} />
          <Route path="/about" component={AboutPage} />
          <Route path="/courses" component={CoursesPage} />
          <Route path="/course" component={ManageCoursePage} />
          <Route path="/course/:slug" component={ManageCoursePage} />
          <Route component={PageNotFound} />
        </Switch>

    </BrowserRouter>
  )
}

In coursePage.js

.......
.......
function mapStateToProps(state, ownProps) {
  const slug = ownProps.match.params.slug
........
}
.......
export default connect(mapStateToProps, mapDispatchToProps)(ManageCoursePage)

.......

the course slug in the URL with

const slug = ownProps.match.params.slug;

However, I am finding that "params" is an empty object. To work around this I did the following, which works

const slug = ownProps.location.pathname.split('/').reverse()[0];

I do not understand how "ownProps.match" does not have the url information when "ownProps.location"

Screenshot for what i did breakpoints it as below:

Could you please help to resolve this issue?

Thanks in advance