share ethernet connexion to ethernet usb adaptor thanks to raspberry pi

Question: I try to connect my ps4 with my vpn connexion without using the computer. I install the vpn on a raspberry pi 2 and i connect my raspberry to internet by the ethernet connexion. I use the raspberry with SSH on my laptop. I also have an usb/ethernet shield and I want to plug this shield on my raspberry in order to share the ethernet connexion through usb/ethernet adaptor. Do you know how can i configure my usb/ethernet shield as output on my raspberry pi2 ?
Thank you
Comment: I don't see a question here.
Comment: Sorry, i edit my message and ask my question
Answer: Ethernet shields are neither input or output, they are both. Generally they are used as a transceiver where data is sent and received by the same shield over the same cable. If you can open a web page with it, it is working just fine both sending and receiving. I believe your best solution is to purchase a small ethernet switch, they are only a few shekels and already debugged.
Comment: Thank you for your answer. I know that ethernet/usb shield are input or output. But is it not necessary to define the ethernet/usb shield as output on my raspberry like the same thing on windows for exemple ? Because if i use the ethernet port of my pi2 as input and i plug the ethernet shield on the usb, how do the pi2 know that usb port is output for sharing connexion?
Comment: That would be software on the Pi and defined by the protocol you are using.  For it to share it has to receive a request so somebody else knows it exists unless your protocol uses some form of broadcast.


How can I ask the Selenium-WebDriver to wait for few seconds in Java?

Question: I'm working on a Java Selenium-WebDriver. I added
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);

and
WebElement textbox = driver.findElement(By.id("textbox"));

because my Applications takes few seconds to load the User Interface. So I set 2 seconds implicitwait. but I got unable to locate element textbox
Then I add Thread.sleep(2000);
Now it works fine. Which one is a better way?
Comment: possible duplicate of [selenium webdriver - explicit wait vs implicit wait](http://stackoverflow.com/questions/10404160/selenium-webdriver-explicit-wait-vs-implicit-wait)
Answer: Well, there are two types of wait: explicit and implicit wait.
The idea of explicit wait is
WebDriverWait.until(condition-that-finds-the-element);

The concept of implicit wait is
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

You can get difference in details here.
In such situations I'd prefer using explicit wait (fluentWait in particular):
public WebElement fluentWait(final By locator) {
    Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
            .withTimeout(30, TimeUnit.SECONDS)
            .pollingEvery(5, TimeUnit.SECONDS)
            .ignoring(NoSuchElementException.class);

    WebElement foo = wait.until(new Function<WebDriver, WebElement>() {
        public WebElement apply(WebDriver driver) {
            return driver.findElement(locator);
        }
    });

    return  foo;
};

fluentWait function returns your found web element.
From the documentation on fluentWait:
An implementation of the Wait interface that may have its timeout and polling interval configured on the fly.
Each FluentWait instance defines the maximum amount of time to wait for a condition, as well as the frequency with which to check the condition. Furthermore, the user may configure the wait to ignore specific types of exceptions whilst waiting, such as NoSuchElementExceptions when searching for an element on the page.
Details you can get here
Usage of fluentWait in your case be the following:
WebElement textbox = fluentWait(By.id("textbox"));

This approach IMHO better as you do not know exactly how much time to wait and in  polling interval you can set arbitrary timevalue which element presence will be verified through .
Regards.
Comment: That's `import com.google.common.base.Function;`, not `import java.util.function.Function;`
Comment: Now it is:
`.withTimeout(Duration.ofSeconds(30)).pollingEvery(Duration.ofSeconds(5))`
in stead of:
`.withTimeout(30, TimeUnit.SECONDS).pollingEvery(5, TimeUnit.SECONDS)`
Comment: I was just calling that out for others who may be wondering which `Function` was being used.  It wasn't obvious to me at first.  Thanks for the answer.
Comment: Or you could just use a lambda expression: `driver -> driver.findElement(locator)`. When using this you won't need an import statement at all.
Comment: haventchecked, actually using intelij IDEA for development, it's helping with auto-imports (when working in maven-based project)
Comment: Does somebody has a complete working example to look at eg. on Github?
Comment: Can anyone translate the above to C#?
Answer: This thread is a bit older, but thought I'd post what I currently do (work in progress).
Though I'm still hitting situations where the system is under heavy load and when I click a submit button (e.g., login.jsp), all three conditions (see below) return true but the next page (e.g., home.jsp) hasn't started loading yet.
This is a generic wait method that takes a list of ExpectedConditions.
public boolean waitForPageLoad(int waitTimeInSec, ExpectedCondition<Boolean>... conditions) {
    boolean isLoaded = false;
    Wait<WebDriver> wait = new FluentWait<>(driver)
            .withTimeout(waitTimeInSec, TimeUnit.SECONDS)
            .ignoring(StaleElementReferenceException.class)
            .pollingEvery(2, TimeUnit.SECONDS);
    for (ExpectedCondition<Boolean> condition : conditions) {
        isLoaded = wait.until(condition);
        if (isLoaded == false) {
            //Stop checking on first condition returning false.
            break;
        }
    }
    return isLoaded;
}

I have defined various reusable ExpectedConditions (three are below).  In this example, the three expected conditions include document.readyState = 'complete', no "wait_dialog" present, and no 'spinners' (elements indicating async data is being requested).
Only the first one can be generically applied to all web pages.
/**
 * Returns 'true' if the value of the 'window.document.readyState' via
 * JavaScript is 'complete'
 */
public static final ExpectedCondition<Boolean> EXPECT_DOC_READY_STATE = new ExpectedCondition<Boolean>() {
    @Override
    public Boolean apply(WebDriver driver) {
        String script = "if (typeof window != 'undefined' && window.document) { return window.document.readyState; } else { return 'notready'; }";
        Boolean result;
        try {
            result = ((JavascriptExecutor) driver).executeScript(script).equals("complete");
        } catch (Exception ex) {
            result = Boolean.FALSE;
        }
        return result;
    }
};
/**
 * Returns 'true' if there is no 'wait_dialog' element present on the page.
 */
public static final ExpectedCondition<Boolean> EXPECT_NOT_WAITING = new ExpectedCondition<Boolean>() {
    @Override
    public Boolean apply(WebDriver driver) {
        Boolean loaded = true;
        try {
            WebElement wait = driver.findElement(By.id("F"));
            if (wait.isDisplayed()) {
                loaded = false;
            }
        } catch (StaleElementReferenceException serex) {
            loaded = false;
        } catch (NoSuchElementException nseex) {
            loaded = true;
        } catch (Exception ex) {
            loaded = false;
            System.out.println("EXPECTED_NOT_WAITING: UNEXPECTED EXCEPTION: " + ex.getMessage());
        }
        return loaded;
    }
};
/**
 * Returns true if there are no elements with the 'spinner' class name.
 */
public static final ExpectedCondition<Boolean> EXPECT_NO_SPINNERS = new ExpectedCondition<Boolean>() {
    @Override
    public Boolean apply(WebDriver driver) {
        Boolean loaded = true;
        try {
        List<WebElement> spinners = driver.findElements(By.className("spinner"));
        for (WebElement spinner : spinners) {
            if (spinner.isDisplayed()) {
                loaded = false;
                break;
            }
        }
        }catch (Exception ex) {
            loaded = false;
        }
        return loaded;
    }
};

Depending on the page, I may use one or all of them:
waitForPageLoad(timeoutInSec,
            EXPECT_DOC_READY_STATE,
            EXPECT_NOT_WAITING,
            EXPECT_NO_SPINNERS
    );

There are also predefined ExpectedConditions in the following class:  org.openqa.selenium.support.ui.ExpectedConditions
Comment: Great answer!  I've never seen someone pass a ExpectedCondition item in via the method constructor.  What a great idea.  +1
Comment: Jeff Vincent, can you please tell me will this work for page to wait 5 minutes if yes then please suggest which place parameter needs to send?
Comment: This is a great answer. I have similar function like this, however, I have to call it in every function so that my script waits until page load (spinner). Is there way that I can hook this waitForSpinner function silently into ImplicitWait so that i need not call it everytime in my function? Like define the function, hook it to driver once and boom.
Answer: If using webdriverJs (node.js),
driver.findElement(webdriver.By.name('btnCalculate')).click().then(function() {
    driver.sleep(5000);
});

The code above makes browser wait for 5 seconds after clicking the button.
Comment: Why would you post this when the question is specifically about Java, not node/JavaScript? It's as off topic as answering how to do it in ruby.
Comment: @Thor84no Mainly since some of us searching for the web solution find this answer
Comment: recommendation to use sleep is definitely not a good solution
Answer: Using Thread.sleep(2000); is an unconditional wait. If your test loads faster you will still have to wait. So in principle using implicitlyWait is the better solution.
However, I don't see why implicitlyWait does not work in your case. Did you measure if the findElement actually takes two seconds before throwing an exception. If so, can you try to use WebDriver's conditional wait as described in this answer?
Answer: I like to use custom conditions. Here's some code in Python:
def conditions(driver):
    flag = True
    ticker = driver.find_elements_by_id("textbox")
    if not ticker:
        flag = False
    return flag

... click something to load ...
self.wait = WebDriverWait(driver, timeout)
self.wait.until(conditions)

Whenever you need to wait, you can do it explicitly by checking existance of a certain element (such element may vary from page to page). find_elements_by_id returns list - empty or not, you have just to check.
Answer: click appears to be blocking? - here's another way to wait if you're using WebDriverJS:
driver.findElement(webdriver.By.name('mybutton')).click().then(function(){
  driver.getPageSource().then(function(source) {
    console.log(source);
  });
});

The code above waits after the button is clicked for the next page to load and then grabs the source of the next page.
Comment: What makes the code wait for the next page to load? Is it just that the first call in the callback is getPageSource?
Answer: Implicitly wait and Thread.sleep Both are used for synchronization only..but the difference is we can use Implicitly wait for entire program but Thread.sleep will works for that single code only..Here my suggestion is use Implicitly wait once in the program when every time your Webpage will get refreshed means use Thread.sleep at that time..it will much Better :)
Here is My Code :
package beckyOwnProjects;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

public class Flip {

    public static void main(String[] args) throws InterruptedException {
        WebDriver driver=new FirefoxDriver();
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(2, TimeUnit.MINUTES);
        driver.get("https://www.flipkart.com");
    WebElement ele=driver.findElement(By.cssSelector(".menu-text.fk-inline-block"));
    Actions act=new Actions(driver);
    Thread.sleep(5000);
    act.moveToElement(ele).perform();
    }

}

Answer: Sometimes implicit wait fails, saying that an element exists but it really doesn't.
The solution is to avoid using driver.findElement and to replace it with a custom method that uses an Explicit Wait implicitly. For example:
import org.openqa.selenium.NoSuchElementException;

public WebElement element(By locator){
    Integer timeoutLimitSeconds = 20;
    WebDriverWait wait = new WebDriverWait(driver, timeoutLimitSeconds);
    try {
        wait.until(ExpectedConditions.presenceOfElementLocated(locator));
    }
    catch(TimeoutException e){
        throw new NoSuchElementException(locator.toString());
    }
    WebElement element = driver.findElement(locator);
    return element;
}

There are additional reasons to avoid implicit wait other than sporadic, occasional failures (see this link).
You can use this "element" method in the same way as driver.findElement.
For Example:
    driver.get("http://yoursite.html");
    element(By.cssSelector("h1.logo")).click();

If you really want to just wait a few seconds for troubleshooting or some other rare occasion, you can create a pause method similar to what selenium IDE offers:
    public void pause(Integer milliseconds){
    try {
        TimeUnit.MILLISECONDS.sleep(milliseconds);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

Answer: Use Actions -

The user-facing API for emulating complex user gestures.

See  Actions#pause method.
Answer: Sometimes implicit wait seems to get overridden and wait time is cut short.  [@eugene.polschikov] had good documentation on the whys.  I have found in my testing and coding with Selenium 2 that implicit waits are good but occasionally you have to wait explicitly.
It is better to avoid directly calling for a thread to sleep, but sometimes there isn't a good way around it.  However, there are other Selenium provided wait options that help. waitForPageToLoad and waitForFrameToLoad have proved especially useful.
Answer: Answer : wait for few seconds before element visibility using Selenium WebDriver go through below methods.
implicitlyWait() : WebDriver instance wait until full page load. You muse use 30 to 60 seconds to wait full page load.
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

ExplicitlyWait WebDriverWait() : WebDriver instance wait until full page load.
WebDriverWait wait = new WebDriverWait(driver, 60);

wait.until(ExpectedConditions.visibilityOf(textbox));

driver.findElement(By.id("Year")).sendKeys(allKeys);

Note : Please use ExplicitlyWait WebDriverWait() to handle any particular WebElement.
Answer: Implicit Wait: During Implicit wait if the Web Driver cannot find it immediately because of its availability, the WebDriver will wait for mentioned time and it will not try to find the element again during the specified time period. Once the specified time is over, it will try to search the element once again the last time before throwing exception. The default setting is zero. Once we set a time, the Web Driver waits for the period of the WebDriver object instance.
Explicit Wait: There can be instance when a particular element takes more than a minute to load. In that case you definitely not like to set a huge time to Implicit wait, as if you do this your browser will going to wait for the same time for every element.
To avoid that situation you can simply put a separate time on the required element only. By following this your browser implicit wait time would be short for every element and it would be large for specific element.
Answer: Thread.sleep(1000);

is the worse: being a static wait, it will make test script slower.
driver.manage().timeouts.implicitlyWait(10,TimeUnit.SECONDS);

this is a dynamic wait

it is valid till webdriver existence or has a scope till driver lifetime
we can implicit wait also.

Finally, what I suggest is
WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.<different canned or predefined conditions are there>);

with some predefined conditions:
isAlertPresent();
elementToBeSelected();
visibilityOfElementLocated();
visibilityOfAllElementLocatedBy();
frameToBeAvailableAndSwitchToIt();

It is also dynamic wait
in this the wait will only be in seconds
we have to use explicit wait for a particular web element on which we want to use.


Can I splice a standard AC power plug onto a 2-pin DIN table lamp cord?

Question: I've acquired a table lamp with a 20W 12V bulb (possibly from IKEA?). The cord terminates with a female 2-pin DIN (41529) connector that I do not have an adapter for. Am I correct to assume that it needs an AC adapter to connect to my 120V wall socket, or could I simply splice a standard wall plug in place if the DIN connector?
Comment: This really falls under if you need to ask... if you don't know if this lamp requires an adapter please do not try to spice a cable into it.
Comment: NO NO NO do not put 120V AC power on this!!!  You need a common old 12V wall-wart.  If you ever got rid of an internet router you probably have one. Put a coaxial/barrel power connector on it that mates to your wall-wart.  *AC mains is quite powerful and dangerous - don't mess with it! I know it seems harmless, but only because a LOT of engineering is done "behind the curtain" to protect appliance users. NEC, UL White Book etc.*
Comment: Easy thing: unless you are not a trained/certified person, you should not do anything with mains power, as well as you should not work on car brakes if you are not a trained car mechanic. this said, get you a power adaptor for 12V with enough rated power and on the 12V side you are save to connect your lamp cord...
Answer: DIN41259

(AKA DIN loudspeaker connector)
is not suited for line voltage, so yeah that lamp wants 12V on that connector, a 12V supply capable of 12V and 1800mA or more should be used here instead.
Comment: Thanks for the straightforward answer!
Answer: Don't do this. If the bulb is rated at 12V it will burn/explode.
I would never connect anything to the mains unless it is designed to do so it's not worth the risk.
See if you can track down the missing adapter, if not throw it away.
Answer: NO AC PLUG, it almost certainly takes a 12V adapter. Is the plug polarized? (or is it symmetrical?).  You probably also need to determine if it is AC or DC (although an AC bulb probably would be fine on DC, but NOT the other way around!).
Do this by examining the bulb for printed ratings, or a model number for the fixture. See if you can find any information online. Also beware if the socket could take a larger wattage bulb, to insure you don't change a bulb out in the future that overloads the adapter. (See if there is a sticker in the hood stating 'maximum bulb size xxx', and get an adapter big enough for that wattage [volts x amps = watts]).
You will also need enough power (adapter rating) so the adapter won't burn out or catch fire, as Jasen advised above!
12V @ 20W bulb will draw about 1.66Amps, so like Jasen said, a 12V adapter rated around 1800mA to 2 Amps [2000mA]. This will be a larger sized adapter, say 4" long, not the small ones.


asynch process in asp.net

Question: I am migrating an app written on asp.net 1.1. There is a process which can take 5 minutes on one page, processing data in SQL, and letting the user know when it's complete.
To get around the HTTP page timeout, the process runs asynchronously and the page refreshes every 5 seconds checking for completion. It's very simple. Here is the problem: I use a session variable as a semaphore to signal process completion.
This is not working now as I cannot read the semaphore set in the asynch process. The asynch process can read the session from the calling routine, but cannot write back.
First, is there a way to get the asynch process to write to a session variable which can be read by another process? This probably is not the best approach today, but getting the app working is my biggest priority.
Second, if I rewrite it, what approach should be used? This is an asp web app. Not MVC.
Answer: use callback technologie it allow you to query an operation server side from your client and get a return from server so no session to manage any more:
http://msdn.microsoft.com/en-us/library/ms178210(v=vs.80).aspx

asynch process in asp.net


Oracle data file size

Question: My client's tablespaces are autoextend off and i add monthly or bimonthly 3 or 6 gb space for tablespaces.
Can you advise me if there is a recommended datafile size for Oracle 11gR2 on Windows 64 Bits?
We agree that datafile max size shouldn't exceed 32 GB  but i would like to know if there is a recommended size and if it is it depend on which parameters.
Comment: "_We agree that datafile max size shouldn't exceed 32 GB_" -- who are "we" and why "we" agree on that number? Is it arbitrary? And why are you playing the role of autoextend instead of letting Oracle do that?
Comment: Mustaccio, Before Oracle 10g came out it was common to  do warm database backups by putting table spaces into backup mode copying the data files to a backup directory and compressing the files. At that time it was faster to compress files that were less than 30 GB. Plus before 10g, i think, there were limits on data file size. So its not just arbitrary its based on what was done in the past and what the limits had been.
Comment: But... that was, like, 15 years ago! SE didn't even exist back then! Why would we stick to this cargo cult now?
Answer: From the comments I see there are some misconceptions about tablespaces and datafile sizes. Here is some Information from the manuals.
There are two types of tablespaces in Oracle: bigfile tablespaces and smallfile tablespaces.
In the description of the  CREATE TABLESPACE statement in the SQL Language Reference we read:

BIGFILE | SMALLFILE
Use this clause to determine whether the tablespace is a bigfile or smallfile tablespace. This clause overrides any default tablespace type setting for the database.

A bigfile tablespace contains only one data file or temp file, which can contain up to approximately 4 billion (232) blocks. The minimum size of the single data file or temp file is 12 megabytes (MB) for a tablespace with 32K blocks and 7MB for a tablespace with 8K blocks. The maximum size of the single data file or temp file is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.
A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022data files or temp files, each of which can contain up to approximately 4 million (222) blocks.

If you omit this clause, then Oracle Database uses the current default tablespace type of permanent or temporary tablespace that is set for the database. If you specify BIGFILE for a permanent tablespace, then the database by default creates a locally managed tablespace with automatic segment-space management.
Restriction on Bigfile Tablespaces
You can specify only one data file in the DATAFILE clause or one temp file in the TEMPFILE clause.

More information can be found in the Oracle Database Administrator's Guide:

About Bigfile Tablespaces
A bigfile tablespace is a tablespace with a single, but potentially very large (up to 4G blocks) data file. Traditional smallfile tablespaces, in contrast, can contain multiple data files, but the files cannot be as large.
The benefits of bigfile tablespaces are the following:

A bigfile tablespace with 8K blocks can contain a 32 terabyte data file. A bigfile tablespace with 32K blocks can contain a 128 terabyte data file. The maximum number of data files in an Oracle Database is limited (usually to 64K files). Therefore, bigfile tablespaces can significantly enhance the storage capacity of an Oracle Database.
Bigfile tablespaces can reduce the number of data files needed for a database. An additional benefit is that the DB_FILES initialization parameter and MAXDATAFILES parameter of the CREATE DATABASE and CREATE CONTROLFILE statements can be adjusted to reduce the amount of SGA space required for data file information and the size of the control file.
Bigfile tablespaces simplify database management by providing data file transparency. SQL syntax for the ALTER TABLESPACE statement lets you perform operations on tablespaces, rather than the underlying individual data files.

Bigfile tablespaces are supported only for locally managed tablespaces with automatic segment space management, with three exceptions: locally managed undo tablespaces, temporary tablespaces, and the SYSTEM tablespace.

Note:

Bigfile tablespaces are intended to be used with Automatic Storage Management (Oracle ASM) or other logical volume managers that supports striping or RAID, and dynamically extensible logical volumes.
Avoid creating bigfile tablespaces on a system that does not support striping because of negative implications for parallel query execution and RMAN backup parallelization.
Using bigfile tablespaces on platforms that do not support large file sizes is not recommended and can limit tablespace capacity. See your operating system specific documentation for information about maximum supported file sizes.

The DB_BLOCK_SIZE is usually 8K, so the datafiles of a smallfile tablespace is limited by 32G. The datafile of a largefile tablespace is limited by about 32T (or by the maximum filesize allowed by the OS). But a bigfile tablespace van only have one datafile. So if you have 8K DB_BLOCK_SIZE  the tablespace size is limitedto 32M in both cases.
Yous shouldn't use bigfile tablespaces if you do not use a volume manager that allows the  arbitrary extention of the size of a volume. This must be also true for the systems where you may run copies of the database, e,g, systems where you do restore tests or test systems.
The advantage of a bigfile tablespace is that you do not have to add data files if you want to extend the tablespac because Oracle can extend the file automatically.
But except for very large and fast growing tablespaces I prefer smallfile tablespaces. Thirty 32G files are easier to manage than one 1T file. For example assume you have to copy the datafiles of a tablespace. If you have a single 1T file, you can start only a single copy command. If you have 32 files of size 32G you can start 32 copy commands in parallel and if your storage is fast enough it will take only a thirty-second of the time to copy the tablespace. If you want to zip this copy you have the same advantage if you have many small files instead of one large.
With RMAN you have the possibility to to a copy of a file in parallel, but not before 12c.
So all in all I prefer smallfile tablespaces in most cases. If the system tablespace is a bigfile tablespace then all tablespaces must be bigfile tablespaces. So I suggest to create the system tablespace as smallfile tablespace except you want to force all tablespaces to be created as bigfile tablespaces.
When I use smallfile tablespaces one may restrict the size of a datafile to less than 32G if one fears that the tablespace may be blown up by a defect application. But finally I allow datafiles to grow up to 32G.
Answer: There is no recommended max size that I am aware of. For me it is a matter of convenience. I keep my datafiles to 10GB each to make copying easier, a 10GB file is less likely to have issues copying than a 32 GB size file.
Comment: t seems that you don't know about bigfile and smallfile tablespaces and how this is related to the number of datafiles of a tablespace and the size of a data file,
Comment: @miracle173 You are correct, I am ashamed to admit that I was not aware of the bigfile/smallfile parameter of create tablespace. Thank you for bringing that to my attention.  Fortunately, my largest tablespace is about 200 GB so it hasn't been an issue for me. For my large tablespaces I use 30 GB rather than 10 GB.
Answer: You don't tell, how you add the space, via autoextend or new datafiles!
There is no clear recommendation, that suits to every environment and every personal opinion.
Nowadays on 64-bit machines and filesystems with very large file support, you don't need to care about filesizes. On Win10, you have a file limit of 16EIB (2^60), which you will probably never reach ever.
The time is over, that filesystems have relevant hard limits.
On the other side, Oracle has internal limits, which cannot be exceeded.
If you have sufficient diskspace, increase tablespaces by AUTOEXTEND their datafiles (if not at maximum) to the maximum allowed in relation to Tablespace blocksize. You can limit AUTOEXTEND yourself per datafile, if you like.
Don't think too much about recommended datafile size. You will find many people with different opinions and pro's and con's for each. It's nowadays a philosophic question.
My personal advice:
You should limit datafiles to maximum allowed size directly (8k block=32GB, 16k=64GB, 32k=128GB), that can be managed within acceptable time in case of trouble like data-loss. If you have very fast HW, then files might get bigger without problems.
Comment: I also don't recommend the bigfile option in most cases. But the the datafile size is limited to 32G for 8k block size.
Comment: It seems that you don't know about bigfile and smallfile tablespaces and how this is related to the number of datafiles of a tablespace and the size of a data file,
Comment: Agreed regarding datafile size limits depending on blocksize. I've simply forgotten this relation. I will update my post accordingly.
However, the bigfile option will most probably not be an option for the requestor.

Oracle data file size


Adding file uploads to commerce product line items?

Question: Does anyone have any experience with adding file uploads to the add to cart forms on product pages within commerce? I've seen some examples of users attaching them to orders (didn't work for me), but I'm looking to give customers the ability to attach per each line item.
Answer: You will not be able to upload an asset into a line item at Commerce 1 or 2.
You only 2 options are
1) Upload the asset to an order custom field(s). Submit a new question with your code if this is not working for you.
2) Upload the asset anywhere else, (including optionally the order), and then put the URL of the asset into the line items options data. See https://docs.craftcms.com/commerce/v2/adding-to-and-updating-the-cart.html#line-item-options-and-notes


Why was House cancelled?

Question: I feel like House is one of those shows that could continue forever. Why was it cancelled?
Comment: I don't have time right now to turn this into an answer, but if someone else does that's cool with me, but here is an article about it from TV Line: https://www.tvguide.com/news/house-cancellation-1043356/
Comment: "I want this show to continue forever" is a **very** dangerous statement to make. Observe the infamous decline in quality of *The Simpsons*, or *Fairly Odd Parents*, or *Dexter*, and ask yourself whether you want that to happen to your own favourite show. Or to paraphrase *Jurassic Park*: "Your executives were so preoccupied with whether they *could*, they didn't stop to think whether they *should*."
Comment: @F1Krazy true, I used to think "I wish _X_ continued forever" but then seeing how some of my favorite shows declined in quality after too long I also prefer to have a good wrap up a la Breaking Bad.
Comment: Arguably they already pushed one season too much. I don't think I would call a series not overextending itself too much as being "cancelled".
Answer: Long story short, because of money.
According to this article Universal TV wanted to produce a new season but Fox network was spending $5 million per episode and wanted a cut in the show's license before renewing. They couldn't agree on an amount.

"Universal came off as aggressive," one exec says. "It was such a big gap that [Fox] didn't pursue the discussions." Universal insiders say the studio was surprised by the decision and had been willing to work out a compromise.

After that there were some budget cuts, but the negotiations were dragged for too long and Fox had other shows performing well enough to let House go.

Fox execs and (David) Shore (executive producer) agreed to wrap things up, and on February 8, the cast and crew were informed. By then, Shore had made his peace with the decision. "He was interested in another year," says an insider. "But he wanted to go out as strong as possible."

Why was House cancelled?


Thermostat wiring on a non programical white and rogers

Question: Has anyone ever seen the common wire connected to the red wire??
Comment: This sounds like classic [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Please let us know why this is important to you.
Comment: Welcome to Home Improvement!  A picture or more explanation might help.
Comment: Can you post photos of the wiring at both the thermostat and furnace/air-handler ends of the equation?
Answer: In the case of a switch leg on a multi wire branch circuit the white should be connected to the red and the white reidentified as a hot wire at both ends. Yes I have seen it and wired them this way in the past.
Comment: I think someone did a stealth edit to change this to being about thermostats.  I also thought it was about mains wiring until rereading just now.
Answer: This may be about terms and names.
The craze of smart thermostats like the Nest has made everybody interested in a heretofore-unused-by-thermostats wire called the "C" wire.  And C is for common; in thermostat wiring it's analogous to mains Neutral or electronics GND.  98% of the time when someone says "common" they're after that.
However, old steam thermostats like yours also have a wire which is the power source, and is called the R wire.  The thermostat connects R to call-for-heat (W), fan (G), call-for-AC (Y), etc. It is, well, a kind of common... though you would be unwise to call it that today, due to the confusion it would create with smart 'stat wiring.
And the conventional color for the R wire is, in fact, red.
However these are only conventions. Given that every thermostat has R, I would expect them to use Red for R.  However I suppose if someone was eccentric they could use red for C.  I wouldn't, though.
Your thermostat does not need and cannot use the C wire, so that's not an issue for you.    Prepare for the day it is!


Display most important attribute in list view

Question: In the list view, I want to display the 3 most important attributes of the product below the productname.
What is the best way to fix this?
Is there a way to highlight some attribute, so that these can be displayed there?
Comment: How do you define "most important"?
Comment: The attributes that we think are the most imported attributes. But that depends on the category. For example for Notebooks this will be the processor. But for Monitors, this will be the screen size. So we need to define this for every category.
Answer: Jelle,Magento donot have enable this feature to enable attribute from admin You need to Customization on this.
Also  enable this attribute in Used in product list for getting quick data
Comment: Amit, thanks for your reply. Is there an easy way to add this option. So that attributes can be highlighted, so that I can echo these attributes?
Answer: Here is how I would do it.
you can make a multiselect category attribute that has as options the product attributes. And for each category you select the attributes that you want displayed. below the title.
Here is a tutorial on how to add a category attribute.
But you need this category attribute to have as options the product attributes.
Here is an example on how you can add an attribute with a custom source. the example is for  products but it works the same for category attributes.
Let's call the attribute important_attributes.
The most important part in the example above is the method Easylife_Provider_Model_Attribute_Source_Provider::getAllOptions. that's the one that generates the attribute options.
In your case you need to replace the method with something like this:
public function toOptionArray($withEmpty = true)
{
    if (is_null($this->_options)) {
        $collection = Mage::getResourceModel('catalog/product_attribute_collection')
            ->addVisibleFilter(); //this will get you the product attributes collection. you can supply a sort order if needed
        ;
        $this->_options = array();
        if ($withEmpty) {
            $this->_options[] = array(
                'label'=>'',
                'value'=>''
            );
        }
        foreach ($collection as $attribute) {
            $this->_options[] = array(
                'label' => $attribute->getFrontendLabel(),
                'value' => $attribute->getData('attribute_code')
            );
        }
    }
    return $this->_options;
}

Now in the product listing you have to check if you are in category context (because the same list is used in search results).
if (Mage::registry('current_category')) {
    $attributeCodes = Mage::registry('current_category')->getImportantAttributes();
    if (!is_array($attributeCode)) { //sometimes this comes as an array other times as strings depending on the setting for flat catalog
        $attributeCodes = explode(',', $attributeCodes);
    }
}

And for each product in the foreach loop check this:
foreach ($attributeCodes as $code) {
    if ($_product->hasData($code)) {
        echo $_product->getAttributeText($code);
    }
}

The code is not tested, but the idea is there. I hope it helps.


Nginx log entries to multiple files

Question: I'd like to log the same access.log entries to separate files, so when a request comes in it should populate a.log and b.log. Is there any way to do this with nginx?
Answer: Yes, just have two access_log directives in the same block.
Since access_log in one block overrides any such directives in outer blocks, you have to copy and paste the directive from the outer block into the inner block if you need to log twice in an inner bock.
Comment: I know, this is ancient, but does it still work? If so, then what is the exact nginx.conf line for it?

Nginx log entries to multiple files


How to modify include file in jsp page without showing blank content

Question: I am a beginner with jsp servlets, and I need some help having my page not show up blank when I make changes. I am trying to include the the code from a donate-box.jsp into the layout of the org-about-panel.jsp page, which itself is included in another view jsp file. When I makes change to donate-box, then load the view file, I am seeing a blank site, and then upon refreshing, it shows up as before without the donate-box.
Here is the code I am trying to include, from the donate-box:
    <logic:notEqual name="hideDonateBox" value="true">

    <form action="https://<%=request.getServerName()%><%=contextPath%>/cartDonate.do method="get">
    <input type="hidden" name="targetPage" value="<%=requestedPathWithQuery%>">

    <logic:notEmpty name="detailOrgBean" property="offerings">

    <logic:iterate name="detailOrgBean" property="relatedOfferings" id="receiver"         indexId="oppIndex" length="5">

    <input type="radio" name="receiverId"
           value="<bean:write name="receiver" property="id"/>">

$ -

        /donate/<%= formatter.getUrlPath((Receiver) receiver) %>">

         " CHECKED>
         ">

          $   (Other)

This file is being included in another file with this code. I have tried commenting out the logic:notequal or logic:empty tags.
<%@ include file="/templates/donate-box.jsp" %>
Thanks in advance!
Comment: I strongly suggest reading up on [JSTL](http://www.ibm.com/developerworks/java/library/j-jstl0211/index.html) before proceeding.
Answer: This problems appears because your jsp (donate-box) can't be compiled (Such behavior I've seen in tomcat).
From quick look, I can say that requestedPathWithQuery - variable is undefined in scripting.
For more precise description you can take a look in logs


Project Astoria

Question: Anyone know the Reasoner why Microsoft put Project Astoria on hold?  It was in a Windows 10 build, but they removed it.  If it was testable by users and it wasn't effecting anything negatively, why would they still remove it?
Answer: It was affecting a lot. The builds were slow, apps were crashing a lot..
And the worst was the "on-time" performances. (The longer you were using the build, worst were the performances) so they had to remove the Android-core in W10M. We've since huge perfs improvements since then
I know they're currently asking for iOS devs to send their apps to test the new iOS Bridge, but no news about Android
Comment: Both answers helped out, thanks to the both of you guys!
Answer: Reason 1 : Long time effects
The project to run Android apps directly on Windows phone will affect Windows phone ecosystem in a long time basis. This will stop developers from making apps for windows phone since customers will be using Android apps on Windows already. Some may even think that publishing an Android app will be enough since it can run on Windows mobile. Why build 2 apps while Android can run in both?
Naturally Android apps will automatically have Universal advantage over mobile phone and tablet segment since it can run on Samsung Galaxy ( Android ) and Surface ( Windows ).
This will attract more young developers towards Android ecosystem.
Reason 2 : Affected performance
This will ruin the Windows phone ecosystem as the Android subsystem will consume more battery and drain more resources than native apps. Also they will not support live tiles, transparent tiles, contium, unified notification across devices, etc...
This will make Windows look like just an another Android if people start using Android apps on Windows phone.
Comment: Both answers helped out, thanks to the both of you guys!

Project Astoria


How do you remove the default sky in Unreal?

Question: I'd rather texture/animate my own sky. How do I remove the default sky?
Answer: The "standard" sky that comes with a new, non-empty level is just an object in the level. It's a BP_Sky_Sphere Blueprint instance, and you can find it in the World Outliner (right-hand list view in a default viewport arrangement) and delete it. It's probably called "Sky Sphere."
Once gone, you can replace it, either with your own custom solution or with some middleware, et cetera. You may also want to investigate if tweaking the existing Blueprint will serve your needs, as it has a few options.


Wiring- Simple for you

Question: Ok I have 2 switches right next to each-other on the box. One does the light in the fan/light combo, and lights above my my medicine cabinets. The other, JUST does the fan. Im tired of people taking showers without use the exhaust fan, so to skip all of the pleading and asking politely, I figured I'd just make one switch do everything. There could possibly be 2 power sources im being told, and something about just cap off the neutral from the switch that is no longer going to be used, and just match up the black and red from there to the switch that will be the only one working. Im not entirely confident in my skills but I know how to NOT kill myself. Just a simple diagram showing either scenario would be greatly appreciated.
Comment: You can also replace it with a humidistat switch, which has a humidity sensor and automatically turns on the fan above a certain level.
Comment: Turn off the breaker, open up the switch box and take a look inside (maybe pull the switches out for a better look, while leaving the switches connected).  Then report back here what you find. Then you should get an accurate answer.
Comment: As @Tester101 and add some pics if you really want to be industrious.
Comment: OK, it wont be until later this afternoon. Thanks
Answer: How about dropping the cover at the top of the fan and if the neutrals are all connected together (suggesting a single supply)
- disconnect the fan wire from whatever it's connected to and reconnect to whatever the lamp is connected to.
- Cap off the wire(s) you disconnected from the fan wire.
now turning on the light will turn on the fan.

Wiring- Simple for you


How do I dynamically reposition part of a sentence based on the width of a word in the middle of the sentence that will change?

Question: I am looking to build an animation where in the middle of a sentence, a word gets deleted by character, then a new word is retyped on-screen and the back half of the sentence repositions as each letter is typed on. I tried to do some research and have a feeling this animation may need to utilize sourceRectAtTime or Delta expressions along with the type-on character text animator. What are your thoughts on accomplishing this?
Answer: I think you could achieve this just by key-framing the Source Text control in your text layer.
Unless you have hundreds of them and need to do it programatically, I would just keyframe the changes of text, and the repositioning would happen automatically.
If I have misunderstood what you mean, please add some screen shots to explain what you need.
Comment: Hi tomh, I think this will also accomplish what I need to do, IVE just never had to keyframe source text before. After checking out a video on YT, it looks pretty straightforward. Thanks for the tip!


Is there a way to add the workspace path to the Eclipse IDE title bar?

Question: I sometimes run more than one eclipse with a new version of a project and another with an older version in a different workspace. Add an extra window view of the "new" version and it becomes difficult to tell when alt=tabbing which eclipse belongs to which workspace.
When a lot of files are involved with minor changes the only way to tell is to get the properties of a particular file and check the path. This of course is slow, there must be better way and having the workspace path in the title bar would make it easy to spot which instance is working with which workspace.
Is there a way to include the workspace path in the title bar so one can easily tell which workspace one is working with?
Answer: If you add -showlocation in its own line at the beginning of your eclipse.ini, you will have the current workspace automatically displayed in the title bar.
(see this example of eclipse.ini)
Answer: If you go to Window -> Preferences -> General -> Workspace, there is an item "Workspace name (shown in window title):" that you can use. (I use Eclipse Helios CDT)
Comment: This is the best option if you work with multiple workspaces open in different instances of Eclipse because you can see the window title that you set from your taskbar or when you're alt-tabbing.
Comment: Perfect! You can set any custom name for the workspace and it shows right in the beginning of the title bar. This is better IMO as opposed to `-showlocation` that shows full path (could be too long) at the end of title.
Answer: Eclipse Oxygen (4.7)
In Eclipse Oxygen you can add the workspace path to the configurable Window title.

Window > Preferences
General > Workspace > check Show full workspace path

Result:

Eclipse Neon (4.6) & Eclipse Mars (4.5)
The checkbox is in the same location, but it has a different text - Show workspace path in window title:
Comment: Nice detailed answer, more up-to-date than my 7 years old answer. +1
Answer: -showlocation is great, but it only changes the text at the end of the title bar, so it's often not visible in the taskbar.
If you want to change the beginning of the title bar, which shows the current Perspective, you can use Window -> Save Perspective As... and the new title will be visible in the Taskbar.
Answer: In Eclipse-Mars I am seeing "Workspace Name" as an option that lets you type your custom workspace name, not sure in which version this was introduced but this option is available on the same location where @Oncra C pointed (Window->Preferences->General->Workspace).
The value you enter gets prepended to the start of the title.


Help improving my question

Question: GWT show weather is being voted down, and I am not sure why.
Could you please have a look and suggest what is wrong with it, and how I can improve it?
Comment: I think that it is a shame that the question is closed especially since it has such a good answer.
Answer: I guess it is being down-voted because you don't show what you have searched, or what you have tried. Not showing what you have tried leads users to think you just asked the question without even trying to achieve what you want, which means the question seems a lazy question, asked from who didn't even bother of trying before asking. The other reason is that the question is so generic that it is thought not to be useful for future readers. This is also the reason the question is being voted to be closed.
Both these reasons are reports in the tooltip for the down-vote button.

Make the question more specific: Don't you know how to start, or don't you know how to do a specific thing?
Show your research, or what you tried. That would be helpful for the users to avoid suggesting something that.
In the case the question gets closed, you can still edit it to make more specific, or more detailed, and then flag it for moderation attention to be re-opened. If the moderators think the question can be re-opened, they will re-open it.
Answer: Your question has received 3 Not a real question close votes, it is likely each of those close-voters also down voted your question.
NARQ votes are usually cast because the question is incomplete or overly broad, or unlikely to lead to a concise answer. You could possibly have staed why you thought serverside activity was strange. You also followed that statement with two very open ended questions along the generally frowned upon lines of "what is better" (Stack Overflow is not a recommendation engine) and "how can I do it" (you have not included any explanation of what you have achieved so far).
You could edit your question even though you have already marked an answer. You probably won't regain the lost votes but at least you will have learnt how to ask a better quality question.
Comment: @kroiz Once you have enough rep you can see the `close` link and will be able to see the current close votes on a question.
Comment: You may want to revisit that old "What SO is Not" FAQ sheet - the scope of that answer has changed, and I feel that this situation would be better explained by "Stack Overflow is not a research assistant".
Comment: Is there a way for me to see those NARQ votes?
Comment: Makoto, don't you think that if I tried to do something for myself and could not find the info; then it would be a legit question to ask how and if it can be done?
Answer: I understand your frustration but you must understand that things on Stack Overflow are somewhat.. different. It's not a help or support forum like many others and actually it's not like any other thing I know so I'll try to explain the uniqueness.
From the about page:

Stack Overflow is a programming Q & A site

Not a forum - Q & A site.
Then in the How to Ask page:

Have you thoroughly searched for an answer before asking your question? Sharing your research helps everyone. Tell us what you found and why it didn't meet your needs.

You missed that bold part - you said in your question that you researched the matter but failed to share any of this or to explain what you learned from that research.
Bottom line, Stack Overflow is trying its best to contain high quality questions, not just stuff like "it's not working please help", or "how to  do X or Y?" - of course such things exist but it doesn't mean they are good and should be there.
Hope this clarify some things and it's not too late - you can always edit your question adding more details and then it can be reopened and upvoted.
Comment: Sir, I don't agree, I wrote I did research to find out how to use weather in my application and I wrote what that research resulted in: "this is done server side" and I wrote why it did not meet my needs: load is on the server. Maybe my question was too concise and people that don't understand the subject are having hard time getting all this info from it but at least one person (LINEMAN78) did and gave me an excellent answer that I believe could help many other that will face this question.
Comment: @kroiz, I would not say that LINEMAN78 gave you an excellent answer. You were given enough information to solve your problem.
Comment: Sorry, I don't want to bicker but it is strange to me that all of you good people are having a different opinion about this issue than me. Yes the question was a very broad initially now that that was fixed what else do you think that can be done?
Comment: @kroiz I just said why your question is considered Not a Real Question on Stack Overflow. Just saying one sentence "this is done server side" is not considered explaining your whole research. Personally I am not familiar with any of the technical stuff and of course didn't vote.
Comment: @Ben, but I asked if x can be done. LINEMAN78 replied yes and explained how - that is what **Q & A site** is all about, so sorry I disagree with you too (but you are in good company here cause it seems that everybody disagree with me here too :) )
Comment: @kroiz and got two sentences and a couple of links as an answer. Like Shadow I know nothing about the subject and haven't voted but I wouldn't upvote this answer.
Comment: @kroiz well, your question might fit under "*your answer is provided along with the question, and you expect more answers*" which is listed under [What kind of questions should I not ask here?](http://stackoverflow.com/faq#dontask) anyway I suggest to let it be. If you don't want to add more details to the question and got what you wanted no point to keep stirring the mud. :)

Help improving my question


Who trained Yoda in the ways of the Force?

Question: I was looking through comics and the TV shows and I was wondering who trained Yoda in the ways of the Force. I could be wrong but I don't remember any mention of Yoda's master.
Comment: I felt that my answer to this one covered pretty much all of the known information about Yoda's training. Is there anything else you'd like me to focus on before considering an acceptance?
Answer: Master Yoda mentions his master in the new Junior novelisation of Star Wars: The Empire Strikes Back. Beyond that, there are no (Disney) canon references to the person who taught him:

Yoda chuckles. You don't know why. You open your eyes and glance at his gnarled, withered body. His smile is as serene as the double sunset of Tatooine.
  "Story heard I once," he says. "From my master. True or not, I do not know. But good story. Listen you will."
  Yoda closes his eyes, inhales slowly, and begins.

Moving down the canon scale, there are references to a Hysalrian Jedi Master named N'Kata Del Gormo being Yoda's master. Leeland Chee (of the Star Wars Story Group) has noted that mentions of him are an "in-universe legend" and not to be considered canonical.
Comment: Ugh! Is it actually written in second person??
Comment: E.T.'s species appeared in Episode 1 in the Senate on Coruscant, if I recall correctly, and don't look much like Hysalrians. http://starwars.wikia.com/wiki/Asogian
Comment: Great answer to a good question. Also, no wonder why Yoda's master looks similar (only torso) to E.T. ^_^
Comment: @ToddWilcox - The Luke Skywalker bits are. When we're with other characters it goes back into third person. Also, it's intercut with short stubs about Jedi training that are quite interesting and fun.
Answer: While not Yoda's master, Huyang taught Yoda how to construct his lightsaber, possibly qualifying as "training him in the ways of the Force".
Huyang appeared in season five of Star Wars: The Clone Wars.

We had quite an eventful mission.
The most eventful since the time Master Yoda went to find his lightsaber crystal.
--Huyang
(Star Wars: The Clone Wars 5x09, A Necessary Bond)
Comment: To be fair, he could have been going to get a new crystal because he lost his existing light saber, or something like that.  It's not clear from the quote that it was Yoda's first crystal.  Also, he says "Master Yoda."
Comment: @ScottWhitlock Valid points. Two things to consider, however: 1)Huyang had a different line which implied that he predated Yoda. 2)This seemed to have been intended as a parallel case, continuing the theme of Huyang's perpetualness.


What does "wedge" mean?

Question: In Allen Hatcher's Algebraic Topology, $X\vee Y$ means the "wedge sum" of two (topological) spaces $X$ and $Y$. However, in $\LaTeX$, \wedge is the notation for $\wedge$, while $\vee$ is wirtten \vee. Where does this inconsistency come from?
Answer: The inconsistency comes from different mathematicians doing different branches of mathematics.
In exterior algebra, a wedge product is written with an upward-pointing wedge, like this: $\alpha \wedge \beta.$
The wedge sum in topology is written with a downward-pointing wedge.
Only one of those symbols can be called \wedge in LaTeX.
Evidently the terminology from exterior algebra won in this case.
Comment: I truly think this is not correct, as in, $\wedge$ in latex is not called `\wedge` because of *wedge product* or anything mathematical at all.
Comment: @ThoAppelsin I suppose if you look for it, you might find evidence for that claim and it would be the basis for a good answer.
Answer: A wedge refers to the shape of this object:

It doesn't matter if it's facing up or down, it's still a wedge. But since there was a need for two commands to produce $\wedge$ and $\vee$, and since $\vee$ conveniently looks like the letter V, it was probably decided that one should get the command "vee" and the other "wedge" (instead of something like "upwedge" and "downwedge", which would be harder to remember). But both are called "wedge" and it's up to the context to disambiguate.
Comment: @Javier Uh, I don't see what more you could want. Both the operations and the symbols are called wedge, and it's only a quirk of LaTeX that they had to have different commands. (And considering what you answered, saying that my answer doesn't address the "real issue" is a bit rich...)
Comment: It may be a matter of opinion, but I think the fact that there are wedge products in algebra and topology denoted with different symbols ($\wedge$ and $\vee$, resp.) must have something to do with it.
Comment: I don't think this answer addresses the real issue here since he's referring to a particular operation called 'wedge product'. Not just the symbol.
Answer: I believe the reason for the command for $\wedge$ being \wedge in $\LaTeX$ is not related to any mathematical definition, but rather related to the English dictionary meanings of those words themselves or their homonyms.
Wedge, according to Oxford Dictionaries is the word for the tapered objects that are driven between two other objects to secure or separate them. The object described essentially and usually is a triangular prism. In our world where gravity is ubiquitous, wedges lay on one of their flat edges, which looks like the $\wedge$ symbol, hence, I believe, \wedge is the command in $\LaTeX$ for the symbol. It would be rather weird to call $\vee$ the wedge, since you almost never see a wedge staying like that.
There are many other mathematical symbols in $\LaTeX$ named in a similar fashion, such as $\cup$, $\cap$, $\smile$, $\frown$, and $\diamond$, with their corresponding commands \cup, \cap, \smile, \frown, and \diamond.
Answer: The thing is that 'wedge' may also refer to the wedge product in the exterior algebra (or differential forms), which is also writen as $\wedge$.
I'm unaware of the real reason, you may try on TeX.SE, but coming from a geometrical background I believe this is how it should be, even though some topologists may disagree.

What does "wedge" mean?


Poor Persian Lime Tree

Question: I am in San Antonio where we had snow about a month ago. I bought this lime tree in early January and never repotted it but it was doing great. I put it in my garage for the snow storm, brought it back out two weeks later and let it be in a little shade for a few more days. There was some new growth. I waited a few more days then repotted. I used fertilizer and watered well. Pretty quickly,the leaves dropped and the green is gone from the branches. When I bend the branches back, some have snapped. Any suggestions?
Answer: Persian Lime cannot stand more than a few degrees below freezing before it is damaged. Snow on the ground indicates that the temperature went at least to freezing and maybe below, at which point the trunk will suffer damage. Leaf fall may have been first due to low temperatures but will have been reinforced by trunk freezing and possibly root damage as well. The brief regrowth may have been due to localized sap which was rapidly exhausted when the trunk was not able to replace it since the conducting tissues will have been killed.
About all that can be done right now is to keep the root moist but well drained in a warm but shaded place, and prune back the top to the point that cuts produce a moist surface, then hope for the best. If and when it produces new shoots from the remaining structure you can think about reshaping it.
Comment: How far back can I cut it? Or how short on the trunk? I don't see any moisture

Poor Persian Lime Tree


Toyota Funcargo (Yaris Verso) 1.3 VVTi (2NZ-FE) connector near oil filter

Question: I was seeing my Yaris Verso VVTi 2NZ-FE engine and a cable was hanging (with light grey connector, 4 pin socket, and a single wire line) that is not connected anywhere. I tried to search for the socket but could not find it.
It supposed to be disconnected?
Comment: Any switches in the area? like reverse light or oil pressure?
Comment: As much as I could see and touch I didn't find any. The cable is near front radiator, under the alternator. The "Check engine" is off too.
Answer: That looks like the oil pressure sensor wire and plug. The weird thing is that I don't see the connection on the block behind it. You might look around and see if you can find a plug similar to the one shown in this image. It should be above/after the oil filter, because it's detecting the pressure of the oil being pumped through the filter.
You should also check for a broken plug which is screwed into the block but has the plastic plug part broken off of it. After a few years, those plastic clips often become brittle, especially when exposed to heat, and can be easily broken. If that's the case you'll probably need to buy a new oil pressure sensor, or figure out a hack job to connect the wire to the broken one.


How can I list all CPAN modules depending on a given module?

Question: How can I list all CPAN modules depending on a given module? For example, create a list of modules using Class::Workflow?
Answer: There's two valid questions about dependencies:

What modules does the given module require?
The reversed question: Which modules depend on the given module?

For the former, the authoritative but non-recursive answer is usually to look at the META.yml file that's part of most modern distributions. If there is no such file, you may try looking at the Makefile.PL or Build.PL build tools that ship with it. If you want to know all dependencies and not just the direct ones, cf. ghostdog74's answer. Specifically, David Cantrell's 'CPANDeps' is very, very handy.
Obviously, the latter question is impossible to answer by inspecting the module itself. If you don't want to grep an unpacked minicpan, the best solution is something like the "used by" section of a module's CPANTS entry.
Comment: The last time I checked, the CPANTS information wasn't all that great. It assumed the names of modules from their path under lib/, so some of my modules appear to be quite popular. See, for instance, Test::URI.
Comment: CPANdeps will also go in reverse.  Right now it only goes up one level, but making it a tree is on the to-do list.
Answer: you can use a module such as CPAN::Dependency, or try this online , among many others.
Answer: I've found CPAN::Dependency and CPAN::FindDependencies on CPAN, they might help you.
Answer: Some other options:

Module::ScanDeps
Perl::PrereqScanner


Redirect Github Pages to custom domain

Question: I have created a Github Pages site and put it on repository abc of github account with username xyz.
So, my site is now live on xyz.github.io/abc
I created a cname file with my custom domain, and configured my DNS with the settings said on Github pages.
Now, my site is also live on mycustomdomain.com
Now, I don't want my site to be live on xyz.github.io/abc . I want it to redirect to mycustomdomain.com or not accessible.
Is there any way to do that?
I know that I can create User Pages site (with username.github.io) which will automatically redirect to custom domain, but I want to create project site.
Any suggestions?
Comment: The reason I want to redirect to my custom domain is because I think two websites with same content can be bad for Search Engine Optimization.
Comment: For CNAME related solutions, note that `https://mat-discover.readthedocs.io/en/latest/` will result in a formatting error, whereas `https://mat-discover.readthedocs.io/en/latest` does not (i.e. leave out the last forward slash `/`)
Answer: A CNAME solution:
Sure. Github has a nice functionality for it.
When you create CNAME folder inside of your repo, you will be redirected:
https://help.github.com/articles/adding-a-cname-file-to-your-repository/
Check out my Github Pages website: https://github.com/ondrek/ondrek.github.io
( you can browse ondrek.com, but it's impossible to browse ondrek.github.io )

A JS solution:
If you want to redirect a custom page — the only possible solution will be javascript redirection.
if (window.location.href==="https://xyz.github.io") {
    window.location.href = "https://mycustomdomain.com";
}

but it will not solve your problem with Google. You can solve this with correct using Google Webmaster Tools and tell to Google about the duplicate (for SEO purposes).
Comment: Website link is dead :/
Comment: The CNAME solution is only useful if you are starting a new site.
Comment: Thanks a lot! You saved my website! I posted [here](https://stackoverflow.com/a/66601856/1657502) my own answer based on yours, but I upvoted yours as well.
Answer: I had a GitHub Pages website (https://kamarada.github.io/), I moved it to GitLab (https://kamarada.gitlab.io/) and besides that I set up a custom domain on GitLab (https://linuxkamarada.com/). Now the question: how to make a 301 redirect from the GitHub Pages to the custom domain? Is that possible?
Well, as Ciro Santilli answered on this other question, there is no "beautiful non-plugin solution". Indeed, the solution I found is not beautiful, it is more kind of a workaround, but it works.
Inspired by the Samuel Ondrek answer on this same question (thanks a lot!), I set up CNAME redirection.
Go to your GitHub Pages repo, click Settings and below GitHub Pages, under Custom domain, enter your custom domain and click Save.
Now open another tab on your browser, open DevTools (F12), select the Network tab. Try to access your GitHub Pages website and see that a 301 redirect happens.
GitHub is going to complain that your domain is not configured properly:

Well, that does not really matter. What matters is that you have the 301 redirect required by the Google Search Console's Change of Address Tool and your website won't lose its Google ranking.
Answer: This might be a bit old but I'd still like to give an alternative answer to this. You can simply use meta refresh on your index.html
<meta http-equiv="refresh" content="1;url=http://example.com/" />
Then use a regular link (an a message also) on the page in case refresh stops. Though it is not recommended for SEO since google might index the blank page. But it would most likely work work.
Answer: You could use JavaScript to inspect the domain of the current page and redirect if necessary. If you go this route, the question and answer are already on SO:
Redirection based on URL - JavaScript
Comment: A javascript redirections doesn't help againg duplicate content for search engine spiders
Comment: For this you can use canonical tags https://support.google.com/webmasters/answer/139066?hl=en

Redirect Github Pages to custom domain


Nosql many-to-many

Question: What is the accepted pattern for handling many-to-many relationships in a document database design?
Answer: How you want to model the many-to-many will depend on what kind of queries you want to ask, how you want to update the data, etc...  Say we have foos related to bars in a many to many fashion.
You could model a foo as
<code>{
   'bars': ['bar1', 'bar2', 'bar3']
}
</code>
and model a bar as
<code>{
   'foos': ['foo_x', 'foo_y', 'foo_z']
}
</code>
Or you could model the graph or relations between foo and bar as individual documents themselves
<code>{
    from: 'foo1',
    to: 'bar1'
}

{
   from: 'foo1',
   to: 'bar2'
}

{
   from: 'foo2',
   to: 'bar3
}

{
  from 'foo3',
  to: 'bar3'
}
</code>
There are plenty of other ways too.  How you want to do it will depend on the questions you want to ask, the operations you want to support, what you want to be efficient, and the indexing available in the database.
Answer: Assuming we are talking about cases where a relationship is really necessary rather than the ones which only exist because SQL handles relationships better than complex objects, the design is similar to the standard one for SQL - two one to many relationships.
The key difference is that you have multivalue fields, so instead of a third document/table recording single connections as a pair of ids, you have a list of ids in each document.
If you run into cases where that list gets too long you are likely looking at something that would be better handled by search indexing than a relationship.
Comment: he talking about documentation
Comment: no, that's a "database document". A "document database" is something like http://www.mongodb.org/

Nosql many-to-many


Is there a managed copy function in modern doc libraries?

Question: Can I keep 2 copies of the same doc synchronized in two different libraries so that if one gets updated the other does too?
Answer: With Sharepoint Designer you could create a workflow that is initiated when an item is modified.  I know that with a 2010 workflow (also compatible with 2013, not sure about SPO) there is a copy to [document library] command.  Which would do what you need.
Here is an existing post which deals with this subject.  Here's another one for your research.


Closure and Possible Deletion: How can I tactfully write that I haven't received a reply?

Question: I've improved How can I tactfully write that I haven't received a reply?. Can it please be reopened? But why are there 2 votes for deletion?
Answer: And it's currently at -7 votes, so won't be visible to the front page even if it was opened.
The problem here is that there's no context - you're simply stating that emails are going unanswered.  You've not stated the importance of the emails, whether the emails have stated that you need a response in a timely manner, or even what the purpose of the emails are.
Without any background information, this is impossible to answer.
I don't mean to be patronizing here, but do a little role-play here.  Pretend that you aren't you and read your question from someone else's perspective.  Is there enough information here for someone to answer the question?
You're clearly no stranger to Stack Exchange and you've gain good reputation on other sites and should understand the need for clear questions.
Comment: Thanks, especially your last two paras. I edited the post now. Better?


Mozbar not showing correct PR/DA info

Question: Just installed Mozbar and worked few days fine. Now it's showing Page rank - 1 / Domain authority - 1 in every search results like this.

Uninstall extension and reinstall,
Chrome browser updated to latest,
Chrome remove and reinstall
Nothing worked :( Finally contacted moz team and they were sending some video tutorial for general issues, not addressing this error.
How can I fix this?
Answer: It worked after clearing cookies!

Mozbar not showing correct PR/DA info


What are all of the cheat codes?

Question: I've heard that there are a variety of cheat codes in both DOOM and DOOM 2, to allow things like all weapons, all keycards, walking through walls (no clipping) etc.
What are all of the cheat codes in DOOM?
Answer: Below are the cheat codes for DOOM (all versions) and DOOM 2
Godmode                    IDDQD
All weapons + key cards    IDKFA
All weapons, no key cards  IDFA
No clipping                IDSPISPOPD (DOOM 1/Ultimate DOOM only)
No clipping (DOOM2)        IDCLIP
Show all map               IDDT
Warp to Level XX           IDCLEVxx
     (In DOOM 1, this is (E)pisode,(M)ission ie 18 for episode 1 mission 8)

Use these codes to get specific items:
Give me a chainsaw!        IDCHOPPERS
Give item X                IDBEHOLDx  (Where x = item code)
Give beserker              IDBEHOLDS
Give invisibility          IDBEHOLDI
Give invulnerability       IDBEHOLDV
Give computer map          IDBEHOLDA
Give radiation suit        IDBEHOLDR
Give light amp goggles     IDBEHOLDL

Most of the cheat codes between DOOM and DOOM 2 are the same, the only real difference is for the no clip code which is IDSPISPOPD in DOOM and IDCLIP in DOOM 2 and Final DOOM.
Comment: Moar: [link](http://chemax.ru/cheat/index2.php?srch=doom)
Answer: There are more cheats, these are all:

IDFA – Get all weapons, ammo, and mega armor with this cheat code
IDKFA – Get all weapons, ammo, mega armor, and all keys with this cheat code
IDBEHOLDS – Spawn a Berserk powerup with this cheat code
IDBEHOLDI – Spawn an Invisibility powerup with this cheat code
IDBEHOLDV – Spawn an Invulnerability powerup with this cheat code
IDBEHOLDL – Spawn Light Amp Goggles with this cheat code
IDBEHOLDR – Spawn a Radiation Suit with this cheat code
IDBEHOLDA – Show computer area map with this cheat code
IDDT – Show the entire map (must be in automap mode; enter twice to reveal all items, monsters, etc) with this cheat code
IDMUSxx – Choose a BGM track (replace xx with a number 01-32) with this cheat code
IDDQD – Enable God Mode with this cheat code
FHSHH – Enemies ignore you until you attack with this cheat code
IDCLIP – Enable no clipping mode (walk through objects) with this cheat code
IDCHOPPERS – Replace your fists with chainsaws with this cheat code
IDMYPOS – Show your position in code with this cheat code
IDCLEVxx – Warp to the specified level (replace xx with a number 01-30) with this cheat code
IDCLEV31 – Unlock the first secret level with this cheat code
IDCLEV32 – Unlock the second secret level with this cheat code
Comment: IDCLEV31 and IDCLEV32 are for Doom 2, right?

What are all of the cheat codes?


what does 255 limitation for integer in Mysql mean?

Question: As the question told, what if i want to have 256 numbers. Is this mean 256 as a number or byte? Because, i will definitely need more than 255
Answer: The 255 limit applys to a field with a type of byte, called a TinyInt in MySql. As the maximum value that can be represented in a single byte is 255.
An integer by default in MySql and most DBMS will be much larger than a single byte, in MySql it is 32bits, or 4 bytes long. This means it can store values from 0 to 4billion, or from -2billion to +2billion.
The official MySql reference for integer sizes is http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
Comment: Better to reference the actual MySQL documentation than 3rd party, especially when there could be differences between versions: http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
Comment: Thanks OMG Ponies, good suggestion, I've added your link to my post
Answer: http://dev.mysql.com/doc/refman/5.5/en/numeric-types.html
"255" is a limitation of unsigned tinyint.
Answer: What 255 limit are you referring to?
This page on MySQL numeric datatypes clearly details the ranges available -- SMALLINT can hold between -32768 and 32767, INTEGER can hold a 32-bit signed integer value, etc.
Answer: The argument to any INT/BIGINT/MEDIUMINT/SMALLINT/TINYINT has nothing to do with the limit on its size or its range of values.  It's just a hint for display width.
This is more useful if you use the ZEROFILL option for integer types.  So it pads the value with zeroes.  For example, storing 1234 into an INT(10) ZEROFILL column and fetching it back returns <code>"0000001234"</code>.  This makes some reporting look nicer.  But the value stored in the database is just 1234.
The display width number doesn't make a TINYINT store any more or any less than 8 bits, no matter how large you make the width.  Likewise SMALLINT is always 16 bits, MEDIUMINT is always 24 bits, INT is always 32 bits, and BIGINT is always 64 bits.
Nor does the display width constrain any of those types to store less than the full range of values permitted by their data type size.  E.g. TINYINT(1) still allows all values -128 to 127.

The number arguments of NUMERIC or DECIMAL have a totally different meaning.  They do determine the precision and scale of the data type, according to standard SQL.


Can entropy increase during bond formation?

Question: Recently the question was asked, "Is bond formation "strictly" exothermic?"  As a corollary to that question, what is the relationship between entropy and bond formation?  Does the entropy of the bond formation reaction always decrease when a chemical bond is formed?
Comment: Yes, entropy of the system could increase. E.g., Chelation http://en.wikipedia.org/wiki/Chelation
Comment: @user26143 Chelation describes a process of multiple bond formations and breakings. I think the OP is asking about the entropy for the formation of one bond.
Comment: "Although in defolded state protein has grater entropy, greater degree of disorder, it folds into original conformation (lower entropy), and this seems to be in collision with the II law of thermodynamics. But by refolding molecules of water surrounding him increase its own entropy by forming maximum number of hydrogen bonds (they're squeezing, pushing in hydrophobic regions from protein surface inside of protein, allowing hydrophilic regions to come out to surface to form H-bonds with water), so net change in entropy of solute and protein is than increase of entropy, and process is spontaneou
Comment: Entropy of what? Isn't the entropy of the universe always increasing?
Comment: Are you talking about gas phase? In solution, solvent organization is going to make things very complicated for this question...
Comment: @Zhe Just the bond formation itself, neglecting any external effects
Answer: I do not think that an entropy decrease is a requirement to form a bond.
Think about a "normal" case: $\ce{HCl}$ (a gas) and $\ce{NH3}$ (another gas) react together to form $\ce{NH4Cl}$, which is a solid. This is an example of bond formation where entropy clearly decreases.
But now think what would happen if two liquid or solid compounds react together to form a gaseous compound. An increase of entropy has taken place. Can't think of a concrete example, but I think this might be the case of, for example, an esterification between a liquid alcohol and a liquid carboxylic acid that form an ester where, due to the lose of $\ce{-OH}$ groups, intermolecular interactions are lower and it can result with the product molecule being more volatile than the original compounds.
It's all about the number of micro states in which the compounds can exist, and gas formation from solids or liquids importantly increases entropy.
(PS: These are just some thoughts, really, I'm no physical-chemist.)


Where can I purchase exhaust blowers for custom island range hood and how do I install it?

Question: I want to purchase a custom copper island range hood that I believe doesn't come with the fan itself.  Where can I purchase the parts for the fan and light system and how do I install something like this?
Comment: Have you asked the manufacturer of the custom range hood what they recommend?
Answer: You can purchase custom hood inserts from a number of manufacturers. Your path to lots of information is to use a search in Google with range hood insert & blower unit.
One site that may be of particular interest can be found here.

Hood inserts are commonly available as many custom hood builders are craftsmen at their own art (copper, wood, stone etc) and not experts in blowers, filters and lights.
The most important thing you will want to do is to coordinate the design and build of your custom hood around a pre-determined hood insert size. Also place consideration for the control panel size, cutout and placement.


Should I add new players to my mailing list?

Question: I wonder if it's ok for me to add new player's emails to my mailing list. Should I display a notice or something before doing so? I don't see these a lot in popular mobile games, but they send emails anyway from time to time.
Answer: You should ask before signing users up for a email list. Doing so doesn't harm the users who are interested, but can make the users who aren't interested upset with you. So it's generally the "nice" thing to do.
In some jurisdictions, there may be law that require you to only offer opt-in email lists, or require you to present opt-out notices in certain ways, et cetera. The most recent such law I'm aware of is the EU's GDPR, which has some sections pertaining to email marketing.
You should consult your lawyer for specific legal advice regarding your situation and the game you plan to ship.
Comment: [I believe Canada's laws also require explicit opt-in](https://www.cyberimpact.com/en/why-email-marketing-is-different-in-canada/).
Answer: yes.. you can as the email is the only way to connect with people around the world nowadays. but another reminder is to make sure that your email notification won't be like a spam to others. make sure to send the information email only.


How long can I keep beef warm in a roaster oven?

Question: Can I keep about 10 lbs of already grilled hamburgers warm in a roaster oven overnight.  They will be submerged in beef broth......
Answer: It will be safe if the temperature is consistently above 140 F / 63 C, but it is almost certainly a very poor idea from a quality perspective.
If the temperature does not stay above 140 F, then you are incubating the hamburgers, inviting pathogens to grow:  that is dangerous and a very bad idea.
Hamburgers are one of those items that are best served immediately upon being cooked; there is no really good way to hold them or reheat them and have the same experience.
If you have to have them cooked in advance, I would refrigerate them and then reheat with the method of your choice, such as in a moderate oven (for a large quantity).
Comment: Even I, known for my lax food hygiene, have to agree with the cat: that sounds less than safe. I would do exactly what it proposes.


Execute command in other users' detached screen

Question: On my (ubuntu) server I have a gameserver running in a screen, owned by user_1. The gameserver has an interactive console to send commands to. Would it somehow be possible to execute a script as user_2 which sends input to user_1's detached screen?
Answer: I think this should work:
<code>screen -r user_2 -X stuff "you_script.sh"
screen -r user_2 -X eval "stuff \015"
</code>
Comment: Thanks for your reply, I'm still a bit lost tho.. I'm assuming it should be -r user_1, right? Since user_1 owns the screen. I'm also a bit confused about the 2 lines, are these just 2 examples or does "your_script.sh" gets assigned to 'stuff' which is then send wit the 'eval'? I just did a basic test as user_2: "screen -r user_1 -X echo test" which returns "No screen session found."
Comment: Oh, I read this question wrong I apologize. You can use `screen -r user_2 -X stuff "commands here"` to send the text `command here` from the current user to `user_2`. The second line in my answer sends a newline.


Grant external users access to sharepoint external facing site

Question: Can some please tell me how to grant external users access to SharePoint external facing site? I have a SharePoint 2013 Enterprise Standalone server.
Comment: How are "internal" users accessing the site now?
Do you have an external authentication source you control?
or would you rather use other authentication sources (Microsoft ID, Facebook, OpenID types of things?)
Comment: internal users are authenticating through AD once they are given access to the site.  I would rather not give external users AD accounts and we currently do not have an external authentication source.  Can you please give me some suggestion of good ones.  Also, is there away to do it with out an external authentication source?  Can sharepoint do the authentication if the site can be viewed externally?
Comment: you could have a separate AD that you then make a one way trust ?
Comment: Ok if the site is already externally can I just create local users on the SharePoint Server and have them authenticate that way.  If so is there any security risk in doing that way?
Answer: For external access I would suggest using identity provider with SAML authentication.

SAML token-based authentication
SAML token-based authentication in SharePoint 2013 uses the SAML 1.1 protocol and the WS-Federation Passive Requestor Profile (WS-F PRP). It requires coordination with administrators of a claims-based environment, whether it is your own internal environment or a partner environment. If you use Active Directory Federation Services (AD FS) 2.0, you have a SAML token-based authentication environment.
A SAML token-based authentication environment includes an identity provider security token service (IP-STS). The IP-STS issues SAML tokens on behalf of users whose accounts are included in the associated authentication provider. Tokens can include any number of claims about a user, such as a user name and the groups to which the user belongs. An AD FS 2.0 server is an example of an IP-STS.
SharePoint 2013 takes advantage of claims that are included in tokens that an IP-STS issues to authorized users. In claims environments, an application that accepts SAML tokens is known as a relying party STS (RP-STS). A relying party application receives the SAML token and uses the claims inside to decide whether to grant the client access to the requested resource. In SharePoint 2013, each web application that is configured to use a SAML provider is added to the IP-STS server as a separate RP-STS entry. A SharePoint farm can represent multiple RP-STS entries in the IP-STS.

Reference: Plan for SAML token-based authentication
More to read: Design Sample: Extranet with Dedicated Zones for Authentication for SharePoint 2013
Answer: i have the same situation, in my case i have 3 sites sharepoint (internet, clients [Extranet], employé [Intranet]), so, i using anonymous access for internet site, and of course windows authentication (active directory) for intranet, and for clients (external users) i use Forms-Based Authentication with SQLMemberShipProvider like that i separate external users and internal users, just if you can use separate web application between this 3 sites its better.
like that you can ensure a separation between your environments, and easy to manage it.
if you can't have multiple web application, of course you can use only one web application and activate anonymous (if you want) and use multiple authentication (windows authentication for local users and forms authentication for external users)
good luck
Answer: It all depends on the what the external users are exactly looking for and what information/attributes they can pass for authentication .
1 -> If the external users are interested to use gmail , fb or linked accounts for login to Sharepoint app , you can implement OpenID .
2 -> Site Minder can be used for authentication of external users
3 -> ADFS , IDAM can also be used .
4 -> If there is need for SSO -> Use Ping Identity OR create a custom STS which accepts SAML tokens . You will need more understanding on IDP and SP initiated approaches if SSO .
Finally if you are saying external users are anonymous users , then make web app as anonymous  :)


How can I get paid for a PhD in Europe?

Question: I'm confused: someone said that a PhD in Europe is free, someone said that you get paid. What's true? And how hard is to get a PhD salary in Physics in North Europe?
Comment: Europe is not a single country. Each country has its own ways of organizing PhD programs. Some get paid, some don't get paid for their PhD work, but for some related project, some get a stipend, in some countries you get more than others, but living costs also differ. Some include insurence some don't. etc. etc. etc.
Comment: I am used to the following system (Germany/Austria): you can do a PhD (not getting paid) and there are a lot of funding possibilities for pHd projects (which sometimes your prof applies to). In some subjects, you have a lot of students without funding (maybe some of them have a real job, or funding parents) and in some, it is not common to do pHd without funding. In other countries (I think France?) you may not do pHd without funding.
Comment: @lighthousekeeper Technically, the tuition exists in many countries, it is usually either a) very small (France - my tuition was €400/year and I paid it myself from my PhD salary) or b) covered as part of your PhD agreement (in the UK - tuition for UK/EU students is around £5000/year, and for "international" around £15000 - and covering the tuition as well as providing a bursary is a part of the PhD agreement between the Uni and the student). Can't remember the price tag for Croatia, but it was quite high (but covered through the PhD funding)
Comment: apply for funded position via websites.
Comment: From what I know, the PhD is for free in all European countries, as in, you don't pay tuition fees for it. The possibility to obtain funding depends on the country and on the field, as others have said before.
Comment: @penelope That's an insightful perspective, thanks for clarifying!
Answer: You go to their website, find a job posting, and apply. Example of a PhD Research Fellowship at the University of Oslo.
Not all positions are free, and not every PhD student is paid. You'll have to look.
Answer: There are vast differences between the different countries in Europe when it comes to this issue. You could compile a list of countries that you would be interested in doing your PhD, then look at the relevant universities there and what they offer for PhD students. For instance in the Scandinavian countries (Sweden, Norway, Denmark), you could find a paid PhD position where you are given about 3000 USD per month (before tax, more like 2000-something after tax).
Answer: Europe is not a country so PhD policies vary greatly from one country to the other.
With that being said, because you mentioned northern Europe: As far as Germany is concerned, if you do a PhD in a public university (which are the best ones) you do get paid.
Comment: "you do get paid" if you manage to secure either a research assistant position (Wissenschaftlicher Mitarbeiter) or a stipend (Stipendium). There is a certain percentage of people who do their PhD unpaid, either due to lack of funding (which is hard to get, for example, in the humanities), or if they do the PhD while working in another job.
Comment: ... or while working in industry on their PhD project (write their thesis about their [industrial] research)

How can I get paid for a PhD in Europe?


How does haloform reaction take place if the reactants NaOH and X2 react with each other?

Question: If $\ce{NaOH}$ reacts with halogen to produce $\ce{NaX}$ and $\ce{NaXO3}$, then how does haloform reaction take place?
Comment: Take a look at the mechanism [here](https://en.wikipedia.org/wiki/Haloform_reaction#Mechanism).
Answer: The disproportionation of halogens $(1)$ is an equilibrium reaction; depending on the concentrations of reactants and products it can go both ways. Since hydroxide (or more generally: a base) is among the reactants, increasing pH will drive the reaction towards the product side.
$$\ce{3 Br2 + 6 OH- <=>> 5 Br- + BrO3- + 3 H2O}\tag{1}$$
The first step of the haloform reaction is to enolise a ketone to the corresponding enole $(2)$. This is also an equilibrium lying on the reactants' side this time.
$$\ce{RC(=O)-CH3 + OH- <<=> RC(-O^-)=CH2 + H2O}\tag{2}$$
So you are correct, both equilibria should be away from what is required for the haloform reaction to proceed. However, both are equilibria. For both, we can measure an equilibrium constant and use it to calculate the concentrations of both the enolate and the free dihalogen. I don't have all the numbers here, but the result will be that both reactants are present in sufficient concentrations to drive the reaction forward. Remember that the full haloform reaction is no longer an equilibrium process; each bromination and the final separation is a non-reversible step; see $(3)$.
$$\begin{gathered}\ce{RC(-O^-)=CX2 + Br2 -> RC(=O)-CX2Br + Br-}\\[0.8em]
\ce{RC(=O)-CBr3 + OH- <<=> RC(-O^-)(-OH)-CBr3} \\[0.4em] \ce{-> RC(=O)-OH + CBr3- -> RCOO- + HCBr3}\end{gathered}\tag{3}$$
The mere presence of non-reversible steps will drive any reaction forwards.


Quick question regarding suspicious disk space use:

Question: Quite some time ago I used a friend's computer. I can't remember exactly what I was doing; but as part of whatever it was, I needed to use a USB flash drive. At a point in time soon after connecting the drive to his computer, and while viewing the drive properties through Windows Explorer, I noticed just over thirty megabytes of space became occupied without any user instruction. Within seconds, the drive again showed empty; however, the total amount of space available within that drive was then that same amount of megabytes short. What can be the cause of this strange behavior?
Comment: It takes Windows a bit of time to calculate how much space is on the drive.  I would guess that the 30+MB suddenly becoming occupied is Windows finishing its calculation.  It's not uncommon to reserve 32MB of space for a drive's firmware and internal memory.
Answer: This doesn't seem suspicious at all. As raz pointed out, Windows makes rapid estimates of space and then replaces that number with the real number after finishing calculations.
Also, all disks need to reserve space, but again, as raz mentioned, 32Mb is not unreasonable.
Answer: Windows was measuring the speed of the drive for ReadyBoost.
You can disable this in the same drive properties.


Convert InvokeRequired to Dispatch in VB WPF

Question: Hello I'm stuck on the last section of my code in which I'm converting from standard VB to VB WPF I was originally using invoke commands but I'm struggling to use them within VB WPF. Currently I'm on the final two lines but I just can't seem to figure out how to rewrite it, could you possibly help?
<code> If Me.InvokeRequired Then
        Me.Invoke(New MethodInvoker(AddressOf AccessPicture))
</code>
I'm using VB WPF
Answer: You can know if invocation is required by checking if the current thread is the UI thread and then invoke the dispatcher thread if it's required here I give you an example in c# and it's totally the same logic in VB
<code>public void EventHandler(object object,EventArgs e)
{
if (this.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
{
 // invoke using this.Dispatcher.Invoke(new EventHandler(EventHandler),object,e)
}
else
{
   //execute your code
}
}
</code>


Doubts in an introduction to classical field theory

Question: I started to study classical field theory using the book "Field Quantization" of Greiner and Reinhardt, and I have some doubts. First, the book write the Lagrangian $L(t)$ as a functional of a field $\phi(\textbf{x},t)$:
$$L(t) = L[\phi(\textbf{x},t), \dot{\phi}(\textbf{x},t)].$$
After, it defines the Lagrange density $\mathcal{L}$ by $$L(t) = \int d^{3}x \mathcal{L} ( \phi(\textbf{x},t), \nabla \phi(\textbf{x},t), \dot{\phi}(\textbf{x},t)),$$ and the book compute the variation in $L$:
$$\delta L (t) = \int d^{3}x\  \delta \mathcal{L} = \int d^{3}x\ \left( \frac{\partial \mathcal{L}}{\partial \phi}\delta \phi + \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\delta \nabla \phi + \frac{\partial \mathcal{L}}{\partial \dot{\phi}}\delta \dot{\phi} \right),$$
Using that $\delta \nabla \phi = \nabla \delta \phi $ and integrating by parts the second term, it gives
$$\int d^{3}x \nabla \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\nabla \delta \phi  = \int d^{3}x \nabla \left( \frac{\partial \mathcal{L}}{\partial (\nabla \phi)}\delta \phi \right) - \int d^{3}x \left(\nabla \frac{\partial \mathcal{L}}{\partial (\nabla \phi)} \right)\delta \phi.$$
But the book consider only the second term of the second member of the expression above. The first integral should be zero, but why?
Answer: Presumably, Greiner & Reinhardt assume Dirichlet boundary conditions (BC) so that $\delta \phi=0$ vanishes at the boundary.


How can i use pandasgui commercially if the pyqt library used is not free for commercial use?

Question: pandasgui allows commercial use under the MIT license but I noticed the library used includes PYQT5 which is under the GPL v3 licence how is that possible ?
Comment: The GPL does allow commercial use. Commercial is not the same as proprietary or closed source.
Answer: PyQt5 is dual-licensed under the GPLv3 and under a proprietary commercial license. With dual-licensed software, you as a user get to choose which license conditions you want to follow.
So, you can choose to use PyQt5 at no charge under the GPLv3 conditions, or you can choose to buy a commercial license that allows you to create closed-source products using PyQt5.
pandasgui has decided not to make the choice for you which PyQt5 license to use, but to license the pandasgui code in a way that is compatible with both license choices for PyQt5.
The critique I have on pandasgui is that they could have mentioned this dependency on a (potentially) GPL-licensed package more clearly in their documentation.
Comment: Since it's compatible with both license choice is that means that i can use Pandasgui freely without sharing the source code ?
Comment: @anas, assuming you have bought a commercial license for PyQt5, then yes.