text:
Q: Error in hash value while trying to download requirements.txt using Dockerfile Dockerfile:
FROM ubuntu:16.04
MAINTAINER ABC

ENV DEBIAN_FRONTEND noninteractive

RUN rm -rf /var/lib/apt/lists/*
RUN apt clean
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
  apt-transport-https \
  ca-certificates \
  curl \
  software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y python3-pip
RUN apt-get install -y python3-dev
RUN apt-get install -y libmysqlclient-dev
RUN apt-get install -y libpq-dev
RUN apt-get install -y mysql-server
RUN apt-get install -y postgresql
RUN apt-get install -y postgresql-server-dev-9.5
RUN apt-get install -y python3.6

COPY ./requirements.txt /requirements.txt
RUN mkdir /var/crackd_setup/ \
   && cd /var/crackd_setup/
RUN apt-get install -y python3.6-venv
RUN python3.6 -m venv MyDjangoEnv
RUN /bin/bash -c "source MyDjangoEnv/bin/activate" \
   && python3.6 -m pip install --upgrade pip setuptools wheel
RUN apt-get update

RUN rm ~/.cache/pip -rf
RUN pip install --no-cache-dir -r /requirements.txt

Error that I'm still getting after each build command:
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    matplotlib==3.1.1 from https://files.pythonhosted.org/packages/57/4f/dd381ecf6c6ab9bcdaa8ea912e866dedc6e696756156d8ecc087e20817e2/matplotlib-3.1.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=bab9d848dbf1517bc58d1f486772e99919b19efef5dd8596d4b26f9f5ee08b6b (from -r /requirements.txt (line 38)):
        Expected sha256 bab9d848dbf1517bc58d1f486772e99919b19efef5dd8596d4b26f9f5ee08b6b
             Got        7a00dd0dff395d85a9dd815ba813e3a8f82c7ce0d58f600a0c176ab68bf1a2d9

    torch==1.1.0 from https://files.pythonhosted.org/packages/69/60/f685fb2cfb3088736bafbc9bdbb455327bdc8906b606da9c9a81bae1c81e/torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=40c644abef1767dcac58f3285021ea963123b392e5628d402e985123ea8701ca (from -r /requirements.txt (line 65)):
        Expected sha256 40c644abef1767dcac58f3285021ea963123b392e5628d402e985123ea8701ca
             Got        ab6fd553cbe1d9bbd2d0ac874a0ca7ad790166345eb70bac7bac55aea24d9bfd

The command '/bin/sh -c pip install --no-cache-dir -r /requirements.txt' returned a non-zero code: 1

Am I missing something on this?
Referred this: Python packages hash not matching whilst installing using pip
but it didn't work so far.
Also, Can I reduce build time for last statement? there are about 85 libraries in requirements.txt and each build result takes around 10 mins.

A: Can you check if packages are completely getting downloaded? As encryption check fails here:
Check this: https://github.com/MycroftAI/mycroft-precise/issues/79
you can try installing erroneous packages independently(like pip install matplotlib==3.1.1) as to see if the issue is exactly with batch installation.
Hope this helps!!


text:
Q: Previewing more context when searching PDF using Preview in macOS When searching (CMD + F) a PDF in Preview for macOS, we are shown the searched word(s) in context in the column to the left. This context usually shows 2-3 lines.
Question: Is there a way to show more than that to get more text in context of that matching text passages?
Thanks.

redpajama_set_name: RedPajamaStackExchange


text:
Q: DataGridView displays the Time as a date I have a CSV file which has a column for time and the time is formatted to look like (in the CSV file)
    08:22:07
DataGridView will convert it to look like
12/30/1899 8:22 AM

Any suggestions?
My code looks like
    public static DataTable ParseCSV(string path, String pattern)
    {
        if (!File.Exists(path))
            return null;
        string full = Path.GetFullPath(path);
        string file = Path.GetFileName(full);
        string dir = Path.GetDirectoryName(full);
        string connString = "Provider=Microsoft.Jet.OLEDB.4.0;"
            + "Data Source=\"" + dir + "\\\";"
            + "Extended Properties=\"text;HDR=Yes;FMT=Delimited\"";
        string query = "SELECT [Pc-Tag], [User-Name], [Date], [Time] FROM " + file;// +" WHERE [User-Name] LIKE " + pattern;
        DataTable dTable = new DataTable();
        OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
        try
        {
            dAdapter.Fill(dTable);
        }
        catch (InvalidOperationException ioe)
        {
            Console.WriteLine(ioe.Message.ToString());
        }
        dAdapter.Dispose();
        return dTable;
    }

A: You could configure the column to use a certain format string like T, which is the long time format (hh:mm:ss).
Use the DefaultCellStyle.Format property of the column containing your time value to do that. You can either use the Forms designer (click the little arrow that's displayed when you select the DataGridView control and then choose "Edit columns", select the column and then press the "..." button for the DefaultCellStyle property) or you can do it in code.
Just make sure to add the columns manually (either in the designer or in code) and set the AutoGenerateColumns property to false.

A: How many rows do you expect?
For few (<1000) rows I would do:
....
dAdapter.Dispose();

dtable.Columns.Add("Custom", typeof(string));

foreach(var row in dtable.Rows)
{
     row["Custom"] = "17:15:30"; //here goes your logic to convert the Time Value
                                 // example: row["Time"].ToString("T");
}

return dTable;

Another solution with better performance is to add an expression column;
http://msdn.microsoft.com/de-de/library/system.data.datacolumn.expression%28v=vs.80%29.aspx
var expression = "SUBSTRING([Time], 11, IF(LEN([Time]) = 19, 8, 7))";
dtable.Columns.Add("Custom", typeof(string), expression);


text:
Q: Is there a way to prevent selection across elements? I have two divs. Users can select text in either div. When they drag from one to the other, it selects parts of both and creates a big, ugly, unpredictable selection.
Is there any way to force a selection to finish in the same element it started in (i.e. by preventing it from extending into other components regardless of where the user moves their cursor)?


text:
Q: How to read VMware interrupt backlog? The VMware document titled "Timekeeping in VMware Virtual Machines" have the following referente to the issues with the time drift:

If the virtual machine is running too slowly, perhaps as a result of competition for CPU time from other virtual
  machines or processes running on the host machine, it might be impossible to feed the virtual machine enough
  interrupts to keep up with real time. In current VMware products, if the backlog of interrupts grows beyond 60
  seconds, the virtual machine gives up on catching up, simply setting its record of the backlog to zero.

Where is this backlog counter and how can I read it to monitor this behaviour?


text:
Q: Change Array into Database Query in PHP I have an array as follows:
 Array ( [item-name] => SM58
         [make] => Shure
         [model] => SM58
         [qty] => 5
         [status] => Available
       )

And I want to change it into a database query such as:
INSERT INTO `Inventory`(`item-name`, `make`, `model`, `qty`, `status`) VALUES ('SM58','Shure','SM58','5',[Available])

I just can't quite work out how I achieve it.

A: You can use PDO:
$stmt = $PDOinstance->prepare("
  INSERT INTO `Inventory` (`item-name`, `make`, `model`, `qty`, `status`)
  VALUES (:item-name, :make, :model, :qty, :status)
");
$stmt->execute($yourArray);

A: Try this
   foreach($array as $index => $value){
    $fields .= "`".$index."`".",";
    $values .= "'".mysql_real_escape_string($value)."'".","; //This escapes for mysql
    }
    $fields = rtrim($fields,",");
    $values = rtrim($values,',');
    $sql = "INSERT INTO `Inventory`($fields) VALUES ($values)";

However as the mysql_* function is depreciated you would be better using the above post with PDO and prepared statements or you could use the mysqli_* function along with prepared Statements. Below are the links to the two resources.
PDO: http://www.php.net/manual/en/book.pdo.php  MySQLI: http://uk1.php.net/mysqli


text:
Q: How does sympy simplify ln((exp(x)+1)/exp(x)) to log(1+exp(-x))? If I use simplify() function in sympy, log((exp(x)+1)/exp(x)) does simplify to log(1+exp(-x)), however, as I read the doc, the simplify function is "can be unnecessarily slow", I tried other simplification methods, but non of them works, so I'm wondering how do I simplify ln((exp(x)+1)/exp(x)) to the form like this log(1+exp(-x)) without calling simplify().

A: The exact function you want to use depends on the general form of the expressions you are dealing with. cancel apparently works, but perhaps only by accident. In general, cancel cancels common factors from a numerator and denominator, like cancel((x**2 - 1)/(x - 1)) -> x + 1. I think it is only working here because it represents the expression in terms of exp(-x). If it instead used exp(x), it wouldn't simplify, because (x + 1)/x doesn't have any common factors. This might be why you are seeing different results from cancel in different versions. See this issue for more information.
For this expression, I would use expand() (or the more targeted expand_mul). expand will distribute the denominator over the numerator, i.e., (exp(x) + 1)/exp(x) will become exp(x)/exp(x) + 1/exp(x). SymPy then automatically cancels exp(x)/exp(x) into 1 and converts 1/exp(x) into exp(-x) (they are internally both represented the same way).
In [1]: log((exp(x)+1)/exp(x)).expand()
Out[1]:
   ⎛     -x⎞
log⎝1 + ℯ  ⎠

There's a guide on some of the simplification functions in the tutorial.

A: You can more directly just use sympy.polys.polytools.cancel(), which is available as a method on your expression with .cancel().
>>> from sympy.abc import x
>>> from sympy import *
>>> my_expr = log((exp(x)+1)/exp(x))
>>> my_expr.cancel()
log(1 + exp(-x))

This is what is doing the work of simplifying your expression inside simplify().
A very naive benchmark:
>>> import timeit
>>> %timeit my_expr.simplify()
100 loops, best of 3: 7.78 ms per loop
>>> %timeit my_expr.cancel()
1000 loops, best of 3: 972 µs per loop

Edit: This isn't a stable solution, and I would advise that you take a look at asmeurer's answer where he suggests using expand().


text:
Q: How to use a FOR loop in the main Method I cant seem to figure out how to make a for loop, so after they do the addition (1), it will go back to the menu. I need to use a for loop to do this also.
I cut out the rest of the code to save space. So I just need help on the Addition and I can do the rest.
(I never used this site, so I dont know how to post code correctly.)
public static void main (String args[])
{
    Scanner userInput = new Scanner(System.in);

    int add, add2, sub, sub2, multi, multi2, divi, divi2, rema, rema2, power, power2, Conf;
    System.out.println("(1) Addition~");
    System.out.println("(2) Subtraction~");
    System.out.println("(3) Multiply~");
    System.out.println("(4) Divide~");
    System.out.println("(5) Remainder~");
    System.out.println("(6) Power~");
    System.out.println("(7) Quit~");
    Conf = userInput.nextInt();

    if(Conf == 1)
    {

        System.out.print("Enter first number to add: ");
        add = userInput.nextInt();
        System.out.print("Enter second number to add: ");
        add2 = userInput.nextInt();
        Ansr();
        Adder(add, add2);

        Sp();
        }

    else if(Conf == 7);
    System.out.println("Exiting Program...");
        System.exit(0);
        userInput.close();
    }
}

A: Your question needs a bit more clarity like why do you need a for loop for addition.
A while loop would be syntactically a better choice in this case.
Try this:
public static void main (String args[])
{
    Scanner userInput = new Scanner(System.in);

    int add, add2, sub, sub2, multi, multi2, divi, divi2, rema, rema2, power, power2, Conf;

    Conf = 0;

    while(Conf != 7)
    {
       System.out.println("(1) Addition~");
       System.out.println("(2) Subtraction~");
       System.out.println("(3) Multiply~");
       System.out.println("(4) Divide~");
       System.out.println("(5) Remainder~");
       System.out.println("(6) Power~");
       System.out.println("(7) Quit~");

       Conf = userInput.nextInt();

       if(Conf == 1)
       {

           System.out.print("Enter first number to add: ");
           add = userInput.nextInt();
           System.out.print("Enter second number to add: ");
           add2 = userInput.nextInt();
           Ansr();
           Adder(add, add2);

           ............
       }
       else if()
       {
            // add additional else if for other operations
       }
    }

    userInput.close();
}


text:
Q: Why do I always return position 10 in my code? In my program for sorting an array of strings, I always get a position of 10 when binary searching a name. Why does this occur?
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

const int MAXNAMES = 20;

void readArray(string names[])
{
    ifstream inFile("names.txt");
    string line;
    int counter = 0;

    if (!inFile.is_open())
    {
        cout << endl << "Cannot locate file names.txt" << endl;
        exit(0);

    }
    else
    {
        cout << "Succesfully opened \"names.txt\" file." << endl;
    }

    while (getline(inFile, line))
    {
        names[counter++] = line;
    }

    inFile.close();
}

void displayArray(string names[])
{
    for (int i = 0; i < MAXNAMES; i++)
    {
        cout << names[i] << endl;
    }

    cout << endl;
}

void selectionSort(string names[])
{
    int i, j, minIndex;
    string minString;

    for (i = 0; i < MAXNAMES - 1; i++)
    {

        minIndex = i;
        minString = names[i];

        for (j = i + 1; j < MAXNAMES; j++)
        {
            if (minString.compare(names[j]) > 0)
            {

                minString = names[j];
                minIndex = j;
            }
        }

        if (minIndex != i)
        {
            string temp = names[i];
            names[i] = names[minIndex];
            names[minIndex] = temp;
        }
    }
}

void sequentialSearch(string names[], string name)
{
    bool found = false;
    int index = 0;

    for (int i = 0; i < MAXNAMES; i++)
    {
        if (name.compare(names[i]) == 0)
        {
            found = true;
            index = i;
            break;
        }
    }

    if (!found)
        cout << "The name is not found." << endl;
    else
        cout << endl << "The name is found at index: " << index + 1 << "." << endl;
}

void bubbleSort(string names[])
{
    string temp;
    for (int j = 0; j < MAXNAMES - 1; j++)
    {

        for (int i = j + 1; i < MAXNAMES; i++)
        {
            if (names[j].compare(names[i]) > 0)
            {
                temp = names[j];
                names[j] = names[i];
                names[i] = temp;
            }
        }
    }
}

int binarySearch(string names[], string name)
{
    int l = 0;
    int r = MAXNAMES - 1;

    while (l <= r)
    {
        int m = l + (r - l) / 2;
        int res = 0;

        if (name == names[m])
            res = 0;
        if (res == 0)
            return m;

        if (name > (names[m]))
            l = m + 1;
        else
            r = m - 1;
    }

    return -1;
}

int main()
{
    string names[MAXNAMES];
    readArray(names);
    cout << "Array before sort:" << endl << endl;
    displayArray(names);
    cout << "Array after selection sort is:" << endl << endl;
    selectionSort(names);
    displayArray(names);
    string nameToSearch;
    cout << "Enter a name to (sequential) search for: ";
    std::getline(std::cin, nameToSearch);
    sequentialSearch(names, nameToSearch);
    string choice;
    cout << endl << "Replace first element of the array \"" << names[0] << "\" with \"" << nameToSearch << "\" Yes or No: ";
    std::getline(std::cin, choice);

    if (choice.compare("Yes") == 0 || choice.compare("yes") == 0)
    {
        names[0] = nameToSearch;
    }

    bubbleSort(names);
    cout << endl << "Array after Bubble Sort is:" << endl;
    displayArray(names);
    cout << "Enter a name to (binary) search for: ";
    std::getline(std::cin, nameToSearch);
    int index = binarySearch(names, nameToSearch);

    if (index == -1)
        cout << endl << "The name is not found." << endl;
    else
        cout << endl << "The name is found at position " << (index + 1) << endl;

    return 0;
}

Here is the input file used for the code:
names.txt
Collins, Bill
Smith, Bart
Allen, Jim
Griffin, Jim
Stamey, Marty
Rose, Geri
Taylor, Terri
Johnson, Jill
Allison, Jeff
Looney, Joe
Wolfe, Bill
James, Jean
Weaver, Jim
Pore, Rob
Rutherford, Rose
Javens, Renee
Harison, Rose
Setzer, Cathy
Pike, Gordon
Holland, Beth

A: In binarySearch, you have this sequence:
    int res = 0;

    if (name == names[m])
        res = 0;
    if (res == 0)
        return m;

Since res will always be zero when that 2nd if is reached, it will always return on the first time thru the loop.
You can remove res completely, and just replace all that with
    if (name == names[m])
        return m;


text:
Q: Calculating distance beetween longitude latitude pairs in Arcmap or Qgis How can i calculate DISTANCE column between each rows (around 100) in attribute table of Arcmap or Qgis?
Here is the header row:
name lon1 lat1 lon2 lat2 DISTANCE(empty)
Thanks in advance!

A: I suppose you want to calculate the distance between lon1-lat1 and lon2-lat2 for each row?
See this post:
How do I calculate distance between two latitude-longitude points?


text:
Q: Case Expression and dates I have the below case expression.
SELECT end_dt,
CASE WHEN TO_CHAR(A.END_DT,'MM/DD/YYYY') = '01/01/3000' THEN ''
 WHEN TO_CHAR(A.END_DT,'MM/DD/YYYY') > TO_CHAR(SYSDATE,'MM/DD/YYYY') THEN TO_CHAR(SYSDATE,'MM/DD/YYYY')
  ELSE TO_CHAR(A.END_DT,'MM/DD/YYYY')
   END ENDDATE,

CASE WHEN TO_CHAR(A.END_DT,'YYYYMM') = '300001' THEN ''
 WHEN TO_CHAR(A.END_DT,'YYYYMM') > TO_CHAR(SYSDATE,'YYYYMM') THEN TO_CHAR(SYSDATE,'YYYYMM')
  ELSE TO_CHAR(A.END_DT,'YYYYMM')
   END ENDDATE_YYYYMM,

CASE WHEN TO_CHAR(A.END_DT,'YYYY') = '3000' THEN ''
 WHEN TO_CHAR(A.END_DT,'YYYY') > TO_CHAR(SYSDATE,'YYYY') THEN TO_CHAR(SYSDATE,'YYYY')
 WHEN TO_CHAR(A.END_DT,'YYYY') > TO_CHAR(SYSDATE,'YYYY') THEN TO_CHAR(SYSDATE,'YYYY')
  ELSE TO_CHAR(A.END_DT,'YYYY')
   END ENDDATE_YYYY

   FROM  A
  LEFT  D ON A.ID = D.ID

  WHERE 1=1

    ORDER BY 1

OutPut:
End_dt                   ENDDATE       ENDDATE_YYYYMM   ENDDATE_YYYY
 12/5/2012 14:33:24       01/05/2018     201212             2012

Expected output:
  End_dt                   ENDDATE       ENDDATE_YYYYMM   ENDDATE_YYYY
 12/5/2012 14:33:24       12/5/2012     201212             2012

Why do I get a result of 01/05/2018 and not 12/5/2012?

A: You're doing string comparisons on dates. Stop. Do date comparisons on dates.
The string '12/5/2012' is greater than the string '01/05/2018' because 1 is greater than 0. Oracle is performing a binary comparison.
SQL> select *
  2    from dual
  3   where '12/5/2012' > '01/05/2018';

D
-
X

Stop converting all your dates to strings and all will be well
SQL> select *
  2    from dual
  3   where date '2018-05-01' > date '2012-05-12';

D
-
X

Incidentally, the empty string '' is equivalent to NULL in Oracle.
Your query should look like:
CASE WHEN A.END_DT = date '3000-01-01' then null
     WHEN A.END_DT > SYSDATE THEN TO_CHAR(SYSDATE,'MM/DD/YYYY')
     ELSE TO_CHAR(A.END_DT,'MM/DD/YYYY')
     END ENDDATE,

A: Don't do date comparisons as strings.  It works for the other values, because you have the right format -- YYYYMMDD (or a partial piece of that).
Try this logic:
SELECT end_dt,
       (CASE WHEN TO_CHAR(A.END_DT, 'MM/DD/YYYY') = '01/01/3000' THEN ''
             WHEN A.END_DT > SYSDATE
             THEN TO_CHAR(SYSDATE, 'MM/DD/YYYY')
             ELSE TO_CHAR(A.END_DT, 'MM/DD/YYYY')
        END) as ENDDATE,
       (CASE WHEN TO_CHAR(A.END_DT, 'YYYYMM') = '300001' THEN ''
             WHEN TO_CHAR(A.END_DT, 'YYYYMM') > TO_CHAR(SYSDATE, 'YYYYMM')
             THEN TO_CHAR(SYSDATE,'YYYYMM')
             ELSE TO_CHAR(A.END_DT,'YYYYMM')
        END) as ENDDATE_YYYYMM,
       (CASE WHEN TO_CHAR(A.END_DT, 'YYYY') = '3000' THEN ''
             WHEN TO_CHAR(A.END_DT, 'YYYY') > TO_CHAR(SYSDATE, 'YYYY')
             THEN TO_CHAR(SYSDATE, 'YYYY')
             WHEN TO_CHAR(A.END_DT, 'YYYY') > TO_CHAR(SYSDATE,'YYYY')
             THEN TO_CHAR(SYSDATE, 'YYYY')
             ELSE TO_CHAR(A.END_DT, 'YYYY')
        END) as ENDDATE_YYYY


text:
Q: pygi how to toggle button without running function I'm writing this application using quickly.
I'm looking for a way to toggle button without running function which is connected to this button.
def on_button_text_italic_toggled(self, widget):
    print "Italic"

def on_buttone_test_clicked(self, widget):
    self.button_text_italic.set_active(True)

So I need this to make button_text_italic to be toggled but without printing out "Italic" text.
Thanks for any help!

A: If you want the function to be run most of the time the toggle signal is emitted, and not when you manually toggle it (e.g. when loading saved settings and displaying the appropriate state), then you need to block and unblock the signal. To do so you'll need the handle_id that was returned when the signal was connected to the function.  Just assign a variable when you connect the signal. Here's an example:
#!/usr/bin/python
from gi.repository import Gtk

def on_toggle(widget,data=None):
    print "toggled, emitted signal"

def on_button1_clicked(widget, data=None):
    print "manually toggle, no signal"
    toggle.handler_block(handle_id)
    state=toggle.get_active()
    toggle.set_active(not state)
    toggle.handler_unblock(handle_id)

win=Gtk.Window()
win.connect('destroy', Gtk.main_quit)
box=Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
button1=Gtk.Button('Toggle with no signal')
button1.connect('clicked', on_button1_clicked)
button1.show()
box.pack_start(button1,True,True,10)
toggle=Gtk.ToggleButton('Toggle')
handle_id=toggle.connect('toggled', on_toggle)
toggle.show()
box.pack_start(toggle,True,True,0)
box.show_all()
win.add(box)
win.show()
Gtk.main()

A: on_button_text_italic_toggled is an object method which gets invoked when the on_buttone_test_clicked gets called so it is natural to execute it's specified code.
You will have to replace the print "Itallic" line with pass a Python keyword but this leaves you with the on_button_text_italic_toggled doing nothing so you may not want to invoke it.
You can learn more about functions here and how to define classes and methods here


text:
Q: What is a topology? Having read through the mathematical definition of endowing a set with a topology I must admit that I'm still struggling to conceptualise what such a mathematical construct is.
I've read articles that talk about a topology on a set as defining a notion of "nearness" between elements of that set without needing to introduce the notion of distance (a metric). Is what is meant by this that, say for example I have a set $X=\lbrace a,b,c,d\rbrace$, then I can define a topology on this set $\tau = \lbrace \emptyset ,\lbrace a\rbrace, \lbrace a,b\rbrace, \lbrace a,b,c\rbrace, \lbrace a,b,c,d\rbrace\rbrace$. Now, as $\lbrace a\rbrace\cup\lbrace a,b\rbrace = \lbrace a,b\rbrace$ and $\lbrace a\rbrace\cup\lbrace a,b\rbrace\cup\lbrace a,b,c\rbrace = \lbrace a,b,c\rbrace$, would it be correct to say that $a$ is "nearer" to $b$ than it is to $c$ as $b$ is contained within a smaller neighbourhood of $a$? Is this what is also meant when people speak of two objects being topologically equivalent, as although they may look very different, the relationships between the points remain the same, i.e. $b$ is still "nearer" to $a$ than $c$ even though there may be a huge number of different points added to the neighbourhoods of each of them under some continuous deformation?

A: A topology doesn't encode the idea of 'nearness' between points in the same way a metric does.  Instead, it tells us when a point is 'near' to a set.
If we restrict ourselves to Hausdorff spaces for simplicity, then two points are either the same, or they are different points, and there is no topological distinction between two points at a distance of $1$ and two points at a distance of $2$.  However, it does make sense to say that the point $0$ is 'near' to the open interval $(0,1)$ - it is not contained in that interval, but there are points in $(0,1)$ that get arbitrarily close to $0$.
If $X$ is a topological space, $x\in X$ and $S\subset X$ is any subset, we say $x$ is near to $S$ if $x$ is contained in the closure of $S$ - the intersection of all closed sets containing $S$.  For example, the closure of $(0,1)$ in $\mathbb R$ is $[0,1]$, which contains $0$, so we can say that $0$ is near to $(0,1)$.
$\DeclareMathOperator{\cl}{cl}$
We even get an alternative definition of a topology this way.  Given a set $X$, a closure operator on $X$ is a function $\cl\colon\mathcal P(X)\to\mathcal P(X)$ such that:

*

*$\cl(\emptyset)=\emptyset$

*For all $A\subset X$, $A\subseteq \cl(A)$

*For all $A,B\subset X$, $\cl(A\cup B)=\cl(A)\cup\cl(B)$

*For all $A\subset X$, $\cl(\cl(A))=\cl(A)$

Think of $\cl$ as being the function that takes a subset $A\subset X$ and returns the set of points of $X$ that are near to $A$.  Then the axioms can be stated as:

*

*No point is near to the empty set.

*Every point of $A$ is near to $A$.

*The points of $X$ that are near to $A\cup B$ are the points that are near either to $A$ or to $B$.

*If $x$ is near to the set of points that are near to $A$, then $x$ is near to $A$.

Given a closure operator $\cl$, we can define a topology on $X$ by setting the closed sets to be those sets $A\subset X$ such that $\cl(A)=A$.  In particular, by axiom (4), $\cl(A)$ is always a closed set for any $A\subset X$.
Exercise: check that the family $\mathcal K$ of subsets $A\subset X$ satisfying $\cl(A)=A$ is closed under intersections and finite unions; i.e., it is the family of closed sets for a topology on $X$.
Conversely, given a topological space $X$, we can define $\cl$ to be the usual closure operator on $X$; i.e.,
$$
\cl(A)=(\textrm{intersection of all closed sets containing }A)
$$
Exercise: Check that $\cl$ satisfies the axioms of a closure operator given above.
The third exercise should convince you that the definition by closures gives us an alternative definition of a topological space:
Exercise: Let $(X,\tau)$ be a topological space, and let $\cl$ be the usual closure operator as defined immediately above.  Show that the family $\mathcal K$ induced by $\cl$ is precisely the family of closed sets of $X$.
Conversely, let $(X,\tilde{\cl})$ be a set together with a closure operator $\tilde{\cl}$, and let $\mathcal K$ be the induced family of closed sets.  Define a topology $\tau$ on $X$ by $\tau = \{X\setminus L\colon L\in\mathcal K\}$.  Show that the usual closure operator on $(X,\tau)$ coincides with $\tilde{\cl}$.
Extension: Recall that a function $f\colon X\to Y$ between topological spaces $(X,\tau),(Y,\sigma)$ is called continuous if $f^{-1}(U)$ is open in $X$ whenever $U$ is open in $Y$ (if you like, $f^{-1}(U)\in\tau$ for all $U\in\sigma$).  Give a definition of a continuous map in terms of closure operators.
Further extension: Study what happens if we omit axiom (4) in the definition of a closure operator (and have a chat with me to discuss what you're discovered!)


text:
Q: How to run python unittests for multiple implementations in one go I'm having trouble figuring out the proper way of using pythons unittest framework
I currently have 3 different implementations for a data structure class and unittests to test various things in the class as follows:
import fooHorse
import fooSnake
import fooMoose
import unittest

foo = fooHorse.foo()
#foo = fooSnake.foo()
#foo = fooMoose.foo()

class testFoo(unittest.TestCase):
    def testSomething(self):
        foo.do_something()
    ...
    def testSomethingelse(self):
        ...
    # etc

if __name__ == "__main__":
    unittest.main()

How do I refactor the code so that all the tests are run for fooSnake.foo, fooMoose.foo and fooHorse.foo?

A: Just factor all the testing into a function and call it from the three tests :
class testFoo(unittest.TestCase):
    def _doTest(self, foo):
         foo.do_something()
         # ...

    def testFoorHorse(self):
        foo = fooHorse.foo()
        self._doTest(foo)
    # and so on.

I wouldn't try to do anything more clever so that the test logic stays simple enought to be obviously bug-free.

A: I think it is better to keep the testing code inside the classes under test (so, inside the fooHorse classes and such). I can't really tell from the code segment, so maybe you are already doing that. Then to combine multiple tests to be run at the same time, or selecting a few of them, you could create a separate testing class that creates a test suite. In there, the individual unittests can be assigned. See the python docs for details on this.


text: Q: What is the number of derangements of size $n$ such that for exactly one $i$, we have $|\sigma(i)-i|=1$ In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, derangement is a permutation that has no fixed points.The number of derangements of a set of size $n$, usually written $D_n$, is called the "derangement number" or "de Montmort number". (These numbers are generalized to rencontres numbers.) Then, $D_n=(n-1)(D_{n-1}+D_{n-2})$. Assume that $\sigma$  be a derangement of $n$ objects.  For each $1\leq i \leq n$,  set $x_i=|\sigma(i)-i|$.  What is the number of   derangements of size  $n$ such that   for exactly one $i$, we have $x_i=1$?


text:
Q: I Can't access  the root folder I do not have access to my root folder: Ubuntu says I do not have the necessary permissions to access it. I also cannot access lost + found, which gives me the same error message
Is there anyone here that can provide answers to these questions?

A: There are two different folders called the "root" folder: / (the root of the filesystem, which is really the only folder that should ever be called the "root folder"), and /root (the root user's home directory). During the normal course of operation (i.e., except while performing administrative tasks), users cannot create new files in / or /root.
You should not change the ownership or permissions of either directory (changing them for / in particular could break things very badly, perhaps even beyond creating security problems depending on what assumptions your applications and services make about the ownership and permissions of /).
If you have the gksu package installed, you can run gksudo nautilus to open a root-owned file browser window. If you do this, please be extra careful to only use it for tasks where you must be root, and to close it when you're done (so you don't later confuse it with an ordinary Nautilus window).
If you don't have gksu installed and don't want to install it, sudo -i nautilus or sudo -H nautilus are reasonably safe. (In contrast, if you were to use plain sudo nautilus, you might have to fix some things in your home directory to get Nautilus to work properly again when you're not running it as root.)
However, usually you don't need to do that either. You rarely have to manually edit the top-level contents of / or the contents of /root. I recommend providng more information--or asking a new question--to explain exactly what you're trying to accomplish. The particular task you need to do will determine how you should proceed.
Finally, a note on lost+found. This stores files recovered in filesystem repair operations. Since such files could be from anywhere in the filesystem, it's necessary to require root permissions to access them (or any information on the system could potentially be accessed by someone who is not an administrator). If you think there may be files there that you wish to reclaim, you can check by running
sudo ls /lost+found

in a Terminal window (Ctrl+Alt+T).
If there are files there that you want, then you can copy them out (and if their ownership and permissions don't give you the necessary access, change them). You can do that as root from the Terminal with cp, chmod and chown (run as root with sudo), or with a root-owned Nautilus window as described above.
If you need to change ownership and permissions for files, then:

*

*make sure not to do so for more files than necessary--for example, some people accidentally change ownership or permissions for large parts of the system and then have to reinstall, and

*I recommend this guide for understanding the ownership/permissions system in Ubuntu (which also applies to most other Unix-like OSes). Wikipedia may help too.

A: You need to do the following:
Edit /etc/ssh/sshd_config using sudo nano /etc/ssh/sshd_config
Look for the line that says:
#PermitRootLogin yes

Make sure it looks like the below line:
PermitRootLogin yes

No hashes (i.e., #) and the yes is there.

A: Yes, this is normal to Ubuntu and every Linux distributions. You can't access to the root folder because that folder is owned by root and it's user folder.
But, you can access that folder if you really want by using sudo -i command in the terminal. Be warned that, if you mess anything, it is your responsibility.
Also using nautilus by Pressing Super+F2 key and typing gksu nautilus
Changing permissions of root folder.
Assuming you want to change the permission of root user's home folder, which is /root folder, I would say, it is very bad idea to do so. Because, if you change the permission of root's home and you delete or modified some crucial file there, This may result in totally un-usable system. You may need to install Ubuntu from scratch.
But, if you really want it, the command is chmod:
sudo chmod -R 777 /root

will let you gain access to the /root folder. See the manual page for chmod command here.
To learn more about File permissions, Read this


text:
Q: xml tag with number I am new to VB. How can I customize XML tags in VB?
I need to create XML in the below format using CSV file - I followed the help https://learn.microsoft.com/en-us/dotnet/standard/linq/generate-xml-csv-files.
CSV file example:
Customernumber,name,city,phonenumber
1,xample,delhi,9999999999,****,****
2,test,chennai,9111111111,****,****
--------
-------

XML format required:
    <Root>
    <Customer1>
            <Customer Info>"Info">details</Info>
            <Customer Info>"Name">xample</Name>
            <Customer Info>"City"> Delhi</Citye>
            <Customer Info>"Contact">9999999999</Contact>
     </Customer1>
    <Customer2>
            <Customer Info>"Info">details2</Info>
            <Customer Info>"Name">test</Name>
            <Customer Info>"City">Chennai</City>
            <Customer Info>"Contact">9111111111</Contact>

    </Customer2>

similar output but with tag along with number
I am not able to print the below tag name along with number and in quotes "info".
<Customer2>
    <Customer Info>"info">details</Customer Info>

My code sample:
    Dim source As String() = File.ReadAllLines("cust.csv")
    Dim cust As XElement = _
        <Root>
            <%= From strs In source _
                Let fields = Split(strs, ",") _
                Select _
                <Customer>
                     CustomerNO=<%= fields(0) %>>
                    <CustomerInfo>
                    <Customer Info>"ID"><%= fields(0) %></ID>
                    <Contact Info>"Name"><%= fields(1) %></Name>
                    <Customer Info>"City"><%= fields(2) %></Place>
                    <Customer Info>"Contact"><%= fields(3) %></Phone>
                    </CustomerInfo>
                </Customer> _
            %>
        </Root>
    Console.WriteLine(cust)

A: I suggest that you give more consideration to the desired output before beginning the programming.
It is usually a bad idea to have tags like <Customer1> and <Customer2> because to add more customers you have to create more unique tag names. That makes extracting data from the XML more difficult. I suggest that you use an XML attribute to differentiate the <Customer> entities, e.g. <Customer ID="1">.
From the code sample in the question, it looks like you want a <CustomerInfo> element inside the <Customer> element - that is OK if there will be other child elements of <Customer>, but is redundant if there are not.
Now, you need to look at the code and see how that relates to the output you want, and what it is actually creating. Preferring elements over attributes for the data items (it is not necessary to do it that way round), you might have something like:
Dim src = "C:\temp\65879705.csv"
Dim source As String() = File.ReadAllLines(src)

Dim cust As XElement =
    <Root>
        <%= From strs In source.Skip(1)
            Let fields = Split(strs, ",")
            Select
            <Customer ID=<%= fields(0) %>>
                <CustomerInfo>
                    <Name><%= fields(1) %></Name>
                    <Location><%= fields(2) %></Location>
                    <Phone><%= fields(3) %></Phone>
                </CustomerInfo>
            </Customer>
        %>
    </Root>

Console.WriteLine(cust)

Note that I specified a full path for the file. It can be very time-consuming to try to debug why changing the content of a file has no effect, only to discover it was not looking at the file you thought it was.
Because the file has a header row ("Customernumber,name,city,phonenumber"), I used .Skip(1) to skip over the first row.
The output with the sample data in the question is:
<Root>
  <Customer ID="1">
    <CustomerInfo>
      <Name>xample</Name>
      <Location>delhi</Location>
      <Phone>9999999999</Phone>
    </CustomerInfo>
  </Customer>
  <Customer ID="2">
    <CustomerInfo>
      <Name>test</Name>
      <Location>chennai</Location>
      <Phone>9111111111</Phone>
    </CustomerInfo>
  </Customer>
</Root>

Also, please make sure to set Option Strict On as the default for new projects. It will make your programming life easier.


text:
Q: Stokes Theorem Manifold with Corners Proof I'm working through the proof for Stokes' Generalized Theorem for Manifolds and have a questions about corners. I've seen several proofs for manifolds with corners by creating diffeomorphisms to spaces like $(0,1] \times (0,1]  \times (0,1)^{n-2}$, but I was wondering why this is necessary.
For example, in the diagram below, it seems like I'm able to parse out this figure in the corner using two spaces which are diffeomorphic to just $(0,1] \times (0,1)$ rather than $(0,1] \times (0,1]$. Can't this always be done? Basically can't any corner be reduced to the case of something diffeomorphic to an open cube with one side of the boundary?


text:
Q: Read integers into a simple linked list from text file. Then bubblesort the list of integers and read out to another file Read integers into a simple linked list from text file. Then bubblesort the list of integers and read out to another file. Right now I am reading into the main but I am trying to overload the extraction operator to read it in and I am not sure how to go about that. My Bubblesort function is also causing alot of issues. Its telling me the function cannot be overloaded and the node identifier is undeclared amongst other things. Any help would be greatly appreciated
Main file
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <fstream>
#include "bubble.h"

using namespace std;
struct nodeType
{
    int info;
    nodeType* link;
};

node *head_ptr = NULL;
void Display();
void list_clear(nodeType*& head_ptr);
void list_copy(const nodeType* source_ptr, nodeType*&head_ptr, nodeType*&tail_ptr);
Bubblesort();

int main()
{
    ifstream datld;
    ofstream outld;

    Bubble D3;

    datld.open ("infile2.txt");
    if (!datld)
    {
        cout << "failure to open data.txt" << endl;
        system ("pause");
        return 1;
    }

    datld >> D3;

    while(datld)
    {
        cout << D3<< endl;
        datld >> D3;
    }

    system("pause");
    return 0;

    Bubblesort();
}

void Bubblesort()
{
    node* curr = head_ptr;
    int count = 0;
    while(curr!=NULL)
    {
        count++;
        curr = curr->NEXT;
    }
    for(int i = count ; i > 1 ; i-- )
    {
        node *temp, *swap1;
        swap1 = HEAD;
        for(int j = 0 ; j < count-1 ; j++ )
        {
            if(swap1->DATA > swap1->NEXT->DATA)
            {
                node *swap2 = swap1->NEXT;
                swap1->NEXT = swap2->NEXT;
                swap2->NEXT = swap1;
                if(swap1 == HEAD)
                {
                    HEAD = swap2;
                    swap1 = swap2;
                }
                else
                {
                    swap1 = swap2;
                    temp->NEXT = swap2;
                }
            }
            temp = swap1;
            swap1 = swap1->NEXT;
        }
    }
}

void list_clear(nodeType*& head_ptr)
//Library facilities used:cstdlib
{
    nodeType * removeptr;
    while(head_ptr!=NULL)
    {
        removeptr=head_ptr;
        head_ptr=head_ptr->link;
        delete removeptr;
    }
}

void list_copy(const nodeType* source_ptr, nodeType*&head_ptr, nodeType*&tail_ptr)
{
    nodeType* temp;// to allocate new nodes
    head_ptr=NULL;
    tail_ptr=NULL;

    if(source_ptr==NULL)
        return;

    head_ptr=new nodeType;
    head_ptr->link=NULL;
    head_ptr->info=source_ptr->info;
    tail_ptr=head_ptr;
    source_ptr=source_ptr->link;

    while(source_ptr!=NULL)
    {
        temp = new nodeType;
        temp->link=NULL;
        temp->info =source_ptr-> info;
        tail_ptr->link=temp;
        tail_ptr = tail_ptr->link;
        source_ptr = source_ptr->link;
    }
}

Header file
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
using namespace std;

class Bubble
{
private:
    int manynodes;
public:
    Bubble() { }

    void Bubblesort();

    friend ostream &operator<<( ostream &output, const Bubble &D )
    {
        output << D.manynodes;
        return output;
    }

    friend istream &operator>>( istream  &input, Bubble &D )
    {
        input >> D.manynodes;
        return input;
    }
};

A: *

*Your extraction operator looks fine. I don't know if it really does what you need, but that's another issue.

*You are declaring function Bubblesort() twice: first in the header file as void Bubblesort(), then in the main file as just Bubblesort() (this should at least give you a warning that it is considered to mean int Bubblesort()). You cannot overload a function just on the return value, hence the error.

*Indeed, you are using a type called node in several places, but you have not declared nor defined it anywhere.


text: Q: While hitting the Serive , Java.net.socketException rises Am facing this issue in android studio .... i have done a web service and given to the android team to use it and then the issues rises when they hitting the web service ..Can anyone has faced this issue i need to resolve it kindly respond, thanks in advance


text:
Q: Accessing Cq/AEM repository from external Standalone application i am trying to access the CQ/AEM repository from standalone java application but getting below error while executing the main thread

Exception in thread "main" java.util.ServiceConfigurationError: javax.jcr.RepositoryFactory: Provider org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory could not be instantiated
      at java.util.ServiceLoader.fail(Unknown Source)
      at java.util.ServiceLoader.access$100(Unknown Source)
      at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
      at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
      at java.util.ServiceLoader$1.next(Unknown Source)
      at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:192)
      at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:263)
      at pwcnew.RepositoryAccessFromOutside.main(RepositoryAccessFromOutside.java:19)
  Caused by: java.lang.NoClassDefFoundError: org/apache/jackrabbit/jcr2spi/config/RepositoryConfig
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      ... 6 more
  Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.jcr2spi.config.RepositoryConfig
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 10 more

And the java class is:
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.jcr.Node;
import org.apache.jackrabbit.commons.JcrUtils;
public class RepositoryAccessFromOutside {

    public static void main(String[] args) {
        Session repoSession = null;

        try {
            System.out.println("inside the class");
            final String path = "http://localhost:4502/crx/server";
            Repository myReposioty = JcrUtils.getRepository(path);

            repoSession = myReposioty.login(new SimpleCredentials("admin",
                    "admin".toCharArray()));

            Node rootNode = repoSession.getRootNode();
            System.out.println("Root Node::" + rootNode.toString());
            repoSession.save();
            repoSession.logout();

        } catch (RepositoryException e) {
            // TODO Auto-generated catch block
            System.out.println("Exception is" + e.getMessage());
        }

    }

}

Can anyone help me on this.
thanks in advance...

A: From the exception stack trace, it looks like your program is missing jackrabbit-jcr2spi library in its classpath.
https://mvnrepository.com/artifact/org.apache.jackrabbit/jackrabbit-jcr2spi
On a side note: I hope you are aware that AEM hosts JCR on apache sling API which provides seamless access to JCR via restful API's. Hope this helps.


text:
Q: Missing Property Exception when calling java code from groovy with null parameters I'm new to groovy and I'm trying to use Spock to do some integration tests.
I have a Java class FunctionalTestCase which I used as a framework before to do my tests.
For Spock, I'm still using this FunctionalTestCase from a groovy class. Most of the things worked without problems, but I have the following scenario:
In FunctionalTestCase I have something similar:
protected static void doSomething(@Nullable Object nullableObject)
{
    SomeInterface<InstrumentQuotationDataImage> marketDataSnapshot = new SomeInterface<InstrumentQuotationDataImage>()
    {
        @Override
        public InstrumentQuotationDataImage getData()
        {
            InstrumentQuotationDataImage instrumentQuotationData = new InstrumentQuotationDataImageImpl();
            if (nullableObject != null)
            {
                instrumentQuotationData.setDataRecord(nullableObject);
            }
            return instrumentQuotationData;
        }
    };
    marketData.getQuotationService().pushQuotation(marketDataSnapshot);
}

This method is called once at setup with a non null parameter, and pushes an object into a Service (this can be seen at the end of the code).
When I later want to call SomeInterface#getData from the object retrieved from that QuotationService, instead of nullableObject to be null it throws groovy.lang.MissingPropertyException.
Any idea why this happens from groovy? Using it from java everything works ok and the objects are null.


text:
Q: UIView changed when something is added programmatically - Swift I am working on an app for iPad. In this app, I use a Container View Controller and a View Controller. Before the question, let me show you how it works:

And my Swift code:
import UIKit

class ViewController: UIViewController {

    @IBOutlet var containerView: UIView!

    @IBOutlet var blueView: UIView!

    var frameSize: CGSize!

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

    override func viewDidAppear(animated: Bool) {
        frameSize = self.view.frame.size
        containerView.frame.origin = CGPoint(x: frameSize.width - containerView.frame.width, y: 0)

        let deviceSize = CGSize(width: 375, height: 667)

        blueView.frame = CGRect(origin: CGPoint(x: frameSize.width / 2 - deviceSize.width / 2 - containerView.frame.width / 2, y: frameSize.height / 2 - deviceSize.height / 2), size: deviceSize)

    }

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {

        let button = UIButton(frame: CGRect(origin: CGPoint(x: 20, y: 20), size: CGSize(width: 100, height: 50)))
        button.titleLabel?.text = "Button Test"
        button.backgroundColor = .redColor()

        blueView.addSubview(button)

    }

}

I run it, and everything occurs as expected.

The problem is, when I touch the screen, running code in touchesBegan.
The problem is add programativamente anything. I can't fix it. And my screen looks like this:

I can't identify what the origin and size change when I add something programmatically.
Can someone help me?

A: This occurs because the option 'Use Auto Layout'. Let disabled to solve the problem.


text:
Q: Custom Menu url is Empty I added a new menu using this code:
wp_update_nav_menu_item($menu->term_id, 0, array(
            'menu-item-title' => 'Custom menu',
            'menu-item-url' => 'http://mylink.com',
            'menu-item-db-id' => 0,
            'menu-item-object' => 'custom',
            'menu-item-parent-id' => 328,
            'menu-item-type' => 'Custom',
            'menu-item-status' => 'publish',)
        );

That code generates a menu the way I wanted. But the link is totally empty.
What did I do wrong?

A: Your menu type is:
'menu-item-type' => 'Custom',

But if we look in wp_update_nav_menu_item:
if ( 'custom' != $args['menu-item-type'] ) {

custom != Custom, so your URL gets stripped


text:
Q: What's the meaning of "those Portuguese of the intellect", as shown in "The Grammar of Science" by Karl Pearson In the page 25 of the 3rd edition, printed in 1911, of "The Grammar of Science", by Karl Pearson, the following sentence is written:

Science cannot give its consent to man's development
being some day again checked by the barriers which
dogma and myth are ever erecting round territory that
science has not yet effectually occupied.
It cannot allow
theologian or metaphysician, those Portuguese of the
intellect, to establish a right to the foreshore of our
present ignorance, and so hinder the settlement in due
time of vast and yet unknown continents of thought.

For context, in this book, Pearson, among several things, was trying to separate science from metaphysics, in which only science can be used as a method to understand the real world, whereas metaphysics, as well as theology and philosophy, cannot.

A: We have several figures of speech in the text those Portuguese of the intellect.
The Portuguese are justly famous for their great navigations during the Age of Discovery during the 15th, 16th, and 17th centuries.  These explorations produced the first global empire in history.
So this is both an instance of metonymy as well as an extended metaphor for exploring and discovering new and unknown territory that is applying the idea of explorations in the physical realm to investigations of thought and of the mind.
By 1911 when this was published, the Portuguese Empire was certainly greatly diminished, something which produced what is arguably a national character of wistful longing for the great achievements of long ago, a fading Golden Age never to be regained or repeated, yet made all the grander in collective memory when viewed through the rose-colored glasses of temporal distance.
Unfortunately, dissecting what further connotations all this may carry, perhaps even ones related to national character or church history, requires the analysis and interpretation of literature, an area of inquiry outside our site's charter.

A: In 1890 the British Empire issued an ultimatum to their longtime ally, the Portuguese, forcing them to relinquish claims to the stretch of african land that connected Angola to Mozambique, two Portuguese colonies. Portugal had laid claim to this territory on the basis of "historical discovery and recent exploration", without effectively occupying it, which, according to Britain, voided their claim.
Since Pearson's book was first published in 1892, this is the episode he's most likely referring to. In comparing metaphysicians and theologians to "Portuguese of the intellect", he questions their ability to properly "occupy" (that is, to properly explain) the intellectual subjects they claim as their own.
Suppose, for example, that the study of, say, the human mind (a subject we still do not fully understand) was marked of as purely metaphysical. This would inhibit neuroscience's research into it, and therefore, according to Pearson, hinder the subject's "scientific settlement".
Reference: https://en.wikipedia.org/wiki/1890_British_Ultimatum

A: A contemporary of Pearson's, George Fullerton, A System of Metaphysics: The Content of Consciousness (1904) seems to interpret the phrase as being an allusion to the poetical or romantic spirit (or perhaps the religious zeal) of the Portuguese:

In a foot-note Professor Pearson tells us that it is perhaps impossible satisfactorily to define the metaphysician, but that the meaning he attaches to the term will become clearer later in his book. The above extract, taken alone, seems to make the accusation against him [the metaphysician] a general shiftlessness of mind, proceeding from a poetic indifference to scientific method. The author regards him as a dangerous member of the community, because it is not recognized that he is merely a poet, and he is apt to be taken seriously. He is a "Portuguese of the Intellect," who endeavors to establish a right to the foreshore of our present ignorance, and may hinder the settlement in due time of vast and yet unknown continents of thought. This science should prevent. But as we read on we discover that the charge against this dark character is a much more specific one. The real head and front of his offending is not so much that her recklessly anticipates the cautious generalizations of science, as that he lays claim to a realm beyond the sphere of science altogether.

According to Fullerton, channeling Pearson's argument, to be a "Portuguese of the intellect" is to refuse to rein oneself in by rigorously adhering to the slow and painstaking method of true science but instead to be transported into fundamentally unscientific realms of thought—magical and poetical, without grounding in the objectively, logically, defensibly knowable. There seems to be a faint echo here of Plato's view that the Republic ought not welcome poets if it is to function as an efficient machine.
A second discussion of this characterization appears in an unidentified article in Medical Life, volume 44 (1937) combined snippets]:

I. Criticisms of Philosophy
Modern physicians have been wary of philosophy. They have subscribed to the viewpoint of Karl Pearson who termed metaphysicians the Portuguese of the intellect. The study of medical history taught them [modern physicians] that admixture of philosophy with medicine always proved disastrous. As examples were cited the sterility of the arguments of the Methodists, Pneumatists, etc., at Rome, the emptiness of the complacent philosophic eighteenth century, the retarding influence of the animism of Stahl, and the barrenness of the first three or four decades of the past century in Germany when physicians soaked in Natur Philosophie followed Hegel and Schelling.

Here the metaphysician is specifically (and invidiously) compared with "the modern physician"—a model of fact- and reason-based empirical thinking.
Whether Pearson intended "those Portuguese of the intellect" as an insult to both metaphysicians and the Portuguese is unclear. Much depends, I suppose, on whether one identifies more strongly with Dmitri Karamazov or Claude Bernard in the perennial conflict between romantic passion and artistic egotiosm (on the one hand) and scientific sobriety and deterministic human fungibility (on the other). It is certainly possible to agree that poets (aside from William Carlos Williams) tend to make bad doctors without subscribing to the notion that, in a nation of good doctors, poets are superfluous.
In a Google Books search, I didn't find any instances of "Portuguese of the intellect" that as not linked to Pearson's phrase, which leads me to believe that the expression was never a set phrase in English and that whatever sense it had in Pearson's work was a product of his mind alone.


text:
Q: iOS settings bundle PSRadioGroupSpecifier does not show selected value I implemented a PSRadioGroupSpecifier like so: 1. Regardless of which value a user selects inside the radio button group, next time the settings are opened the default value is marked as selected. Imho this is a bug in iOS, as i figured out that the value of the settings property is correctly set and could be retrieved.
Question: How to come around the false display in settings app WITHOUT using PSMultiValueSpecifier?


text:
Q: Why does JavaScript use Symbols instead of just strings? "Iterables" in JavaScript are objects with a Symbol.iterator property. For example:
let x = {
  [Symbol.iterator]: function * () {
    yield * [ 1, 2, 3];
  }
};

[ ...x ] // Array [ 1, 2, 3 ]

So Symbol.iterator is just a convention.
But why was this concept, Symbol, invented when a string could have done a similar job?
let x = {
  iterator: function * () {
    yield * [ 1, 2, 3 ];
  }
};

// Invalid, but would be equivalent to [ ...x['iterator']() ]
[ ...x ]

A: Symbol.iterator is a symbol so you can't copy or recreate it. This eliminates the possiblity that you could overwrite it accidently.
I encourage you to watch this video about Symbols in JavaScript.

A: Symbols are explained in some detail at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
In particular:

Note that Symbol("foo") does not coerce the string "foo" into a symbol. It creates a new symbol each time:
Symbol('foo') === Symbol('foo'); // false

Let's say I have some data that I want to store in some widely-visible object. I can come up with a string, say "foo", and use that as the key to store my data in the object. Later on, I can use that same string (either hard-coded or stored somewhere) to get my data back out of the object.
There are two things to keep in mind if we do this: any other code can look up our data, and any other code can overwrite our data either intentionally or by accident (e.g. they just so happened to pick the same string as us).
If we use a symbol as a key instead, then there is no way for other code to look up or modify the data, unless we explicitly give them the symbol (e.g. as an argument). This way, clashes can't occur, since lots of different code can all use the same string (like "foo" in the MDN example) but they'll always end up with different symbols, so there's no conflict.
One reason we might want to do this is if we have a single "state" object which various pieces of code will modify. If we want to keep each piece of code modular then it's important that they don't end up depending on each other indirectly via the state: by using symbols we make sure that not only can a piece of code not alter someone else's part of the state, but they also can't depend on someone else's state (i.e. choosing what to do based on reading someone's state).

A: Symbols provide a solid way of guaranteeing that no accidental property name collisions can occur. It's always possible that a string property name might inadvertently be used for a completely different purpose. Symbol instances are guaranteed to be unique; it's not possible to create two Symbol instances that compare as === to each other.


text:
Q: Why is my lcd display not showing any values? #include <Wire.h>
#include "DFRobot_LCD.h"

DFRobot_LCD lcd(16, 2); //16 characters and 2 lines of show

#define PH_PIN 25
float voltage,phvalue,temperature = 25;

float acidVoltage =  (1990); //buffer solution at 4.o
float neutralVoltage = (1389);   //buffer solution at 7.o

void breath(unsigned char color){
     for(int i=0; i<255; i++){
        lcd.setPWM(color, i);
        delay(5);
    }

    delay(500);
    for(int i=254; i>=0; i--){
        lcd.setPWM(color, i);
        delay(1000);
    }

    delay (300) ;
}

void setup()
{
    Serial.begin(11520);
    // LCD Begin //
   lcd.init();
   lcd.setCursor(4,0);
   lcd.print("Welcome");
   delay(3000);
   lcd.clear();

   lcd.setCursor(3,0);
   lcd.print("Reading PH");
    delay(5000);
   lcd.clear();

  lcd.setCursor(3,0);
   lcd.print("Please Wait");
   delay(5000);
   lcd.clear();
}

void loop(){
  void loop1();
  void loop2();
  void loop3();
}

**void loop1(){
  static unsigned long timepoint = millis();
  if(millis()-timepoint>1000U){

    timepoint = millis();
    // timepoint = read temperature

    voltage = analogRead (PH_PIN)/4095.0*3300;

    float slope = (7.0-4.0)/((neutralVoltage-1500)/30 - (acidVoltage-1500)/3.0);
    float intercept = 7.0 - slope*(neutralVoltage-1500)/3.0;

    phvalue = slope*(voltage-1500)/3.0 + intercept;   // y=k*x + b [formula]

  if (phvalue > 3.8 && phvalue < 4.1){
    Serial.print("Voltage:");
    Serial.print(voltage,1);
    Serial.print("PH:");
    Serial.println(phvalue,2);

    //LCD setting 16x2
    lcd.setCursor(0,0);
    lcd.print("PH :     ");
    lcd.print(phvalue,2);

    lcd.setCursor(0,1);
    lcd.print("Volt :     ");
    lcd.print(voltage/1000,2);
    }
    else {
    Serial.begin(11520);
  // LCD Begin //
    lcd.init();
    lcd.setCursor(4,0);
    lcd.print("Dosing Required");
    delay(2000);
    lcd.clear();
  }
  }

  }

void loop2(){
  static unsigned long timepoint = millis();
  if(millis()-timepoint>1000U){

    timepoint = millis();
    // timepoint = read temperature

    voltage = analogRead (PH_PIN)/4095.0*3300;

    float slope = (7.0-4.0)/((neutralVoltage-1500)/30 - (acidVoltage-1500)/3.0);
    float intercept = 7.0 - slope*(neutralVoltage-1500)/3.0;

    phvalue = slope*(voltage-1500)/3.0 + intercept;   // y=k*x + b [formula]

  if (phvalue > 6.8 && phvalue < 7.1){
    Serial.print("Voltage:");
    Serial.print(voltage,1);
    Serial.print("PH:");
    Serial.println(phvalue,2);

    //LCD setting 16x2
    lcd.setCursor(0,0);
    lcd.print("PH :     ");
    lcd.print(phvalue,2);

    lcd.setCursor(0,1);
    lcd.print("Volt :     ");
    lcd.print(voltage/1000,2);
    }
    else {
    Serial.begin(11520);
  // LCD Begin //
    lcd.init();
    lcd.setCursor(4,0);
    lcd.print("Dosing Required");
    delay(2000);
    lcd.clear();
  }
}
}

void loop3 (){
  static unsigned long timepoint = millis();
  if(millis()-timepoint>1000U){

    timepoint = millis();
    // timepoint = read temperature

    voltage = analogRead (PH_PIN)/4095.0*3300;

    float slope = (7.0-4.0)/((neutralVoltage-1500)/30 - (acidVoltage-1500)/3.0);
    float intercept = 7.0 - slope*(neutralVoltage-1500)/3.0;

    phvalue = slope*(voltage-1500)/3.0 + intercept;   // y=k*x + b [formula]

  if (phvalue > 9.8 && phvalue < 10.1){
    Serial.print("Voltage:");
    Serial.print(voltage,1);
    Serial.print("PH:");
    Serial.println(phvalue,2);

    //LCD setting 16x2
    lcd.setCursor(0,0);
    lcd.print("PH :     ");
    lcd.print(phvalue,2);

    lcd.setCursor(0,1);
    lcd.print("Volt :     ");
    lcd.print(voltage/1000,2);
    }
    else {
    Serial.begin(11520);
  // LCD Begin //
    lcd.init();
    lcd.setCursor(4,0);
    lcd.print("Dosing Required");
    delay(2000);
    lcd.clear();
  }
  }
  }**

I am programming a ph sensor with lcd, i have tried multiple option as i needed to do alot of else/if statementdue to the requirement, however in the bolded section of my code the lcd is not showing i am unsure what i am doing wrong, is it due to a simple error?
i need to seperate out my if statement as i need it do this acion below
if phvalue range of (3.8-4.1) it will show
ph : 3.8
volt: 1.68
else [ if out of range ] it will show
Dosing Required
this will repeat 3 times with different value

A: static unsigned long timepoint = millis();
if(millis()-timepoint>1000U)

Like in your last post you have a simple logical error.
You save a timestamp and instantly check if one second has passed since then.
This condition will never be true. That's why nothing is happening.


text:
Q: Accidentally deleted settings from H2 console. How to retrieve them I am not able to find Generic H2(Server) setting on the console. I accidentally removed it.
I tried finding the .h2.server.properties file on Mac but wasn't able to find the file

A: With h2 server stopped, open terminal, make sure that you are in your user directory (~) and delete with rm .h2.server.properties that hidden file and on your next start of h2 it will be recreated with the default contents of all example connections.

A: I was in the same situation, and it was a simple solution
The file was hidden file, so you can enable to show it


text:
Q: D3.js How can I fix only the x-coordinate for all nodes? I'm working on a visualization for a chrome extension. I'd like to fix the x-coordinate of my nodes, but leave the y-coordinate free. Is there any way to do that in D3?
This is in a force layout.

A: Yes, simply set an x coordinate before you start the force layout and then don't change it in your tick function (i.e. the handler for the tick event).


text:
Q: Vectorized numpy 1-d reclassification I have a large numpy 1-d containing about 700,000 classes. In addition, I have another similar sized array which contains the new values of the classes.
Example arrays
original_classes = np.array([0,1,2,3,4,5,6,7,8,9,10,10])
new_classes = np.array([1,0,1,2,2,10,1,6,6,9,5,12])

Desired output
>>> reclassify_function(original_classes, new_classes)
array([ 1,  1,  1,  1,  1, 12,  1,  1,  9, 12, 12])

The difficulty is that there are multiple class relations.
Original class 1 should get a new value of 0, which means that 0 and 1 are equal classes and all occurrences of these values should be assigned to the same new class number. Original class 2 should be classified as 1, which means that class 2 is equal to class 0 and 1. Original class 0-2 should thus be assigned to the same new class number etc...
As I am working with huge arrays I would like the reclassify function to be vectorized.

A: You could use scipy.sparse.csgraph.connected_components to relabel your classes. For your example data:
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components

A = np.array([0,1,2,3,4,5, 6,7,8,9,10,10])
B = np.array([1,0,1,2,2,10,1,6,6,9,5 ,12])

N = max(A.max(), B.max()) + 1
weights = np.ones(len(A), int)
graph = csr_matrix((weights, (A, B)), shape=(N, N))
n_remaining, mapping = connected_components(graph, directed=False)
print mapping[A]

Gives:
[0 0 0 0 0 1 0 0 0 2 1 1]

These are the relabeled classes. I'm sure you can figure out how to express these in terms of the input data. Note for best performance the "original" and "new" classes should be a single range of consecutive integers without gaps.

A: This is not a vectorized solution, and took about an hour on my laptop.  This creates a list of sets call class_sets; each set is a collection of equivalent classes.
original_classes = np.random.randint(0,20000,700000)
new_classes = np.random.randint(0,20000,700000)
pairs = zip(original_classes, new_classes)
class_sets = [set(next(pairs))]

for i,p in enumerate(pairs):
    ps = set(p)
    intsect = [ps.intersection(cs) for cs in class_sets]
    if any([ps.intersection(cs) for cs in class_sets]):
        index = np.argmax(intsect)
        class_sets[index] = class_sets[index].union(ps)
    else:
        class_sets.append(ps)


text:
Q: I wan to print a label which is being send as .zpl file to TSC mobile printer alpha 40L using android sdk, but its printing additional blank label So we are trying to send a .zpl file to TSC alpha 40L mobile printer however
when the time of printing label its creating one blank label and printing on the next one
I am attaching our code below and the label image in the attachments section:-
private fun printText() // Fun for sending .ZPL file
{
    launch(coroutineContext) {

        if (tscDll.IsConnected) {
            tscDll.clearbuffer()
            displayPrinterStatus(tscDll.status())
            tscDll.setup(101, 152, 4, 10, 0, 0, 0)
            displayPrinterStatus(tscDll.status())

            try {
                tscDll.sendfile("label.zpl")
            } catch (ex: Exception) {
                Log.d("background thread", "error sending picture TSC")
            }

            tscDll.printlabel(1, 1)
            displayPrinterStatus(tscDll.status())

        } else {
            withContext(Dispatchers.Main) {
                Toast.makeText(
                    this@BluetoothList, "Please connect your printer..",
                    Toast.LENGTH_SHORT
                ).show()
            }
        }
    }
}


text:
Q: SUPEE 9767 V2 fails Version 1.7.0.2 While installing new version of SUPEE 9767 v2 patch I receive the below error
patching file app/code/core/Mage/Checkout/etc/system.xml
patching file app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
patching file app/code/core/Mage/Core/Controller/Front/Action.php
patching file app/code/core/Mage/Core/Controller/Request/Http.php
can't find file to patch at input line 433
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git app/code/core/Mage/Core/Model/File/Validator/Image.php app/code/core/Mage/Core/Model/File/Validator/Image.php
|index 7f7b9d0..8618bca 100644
|--- app/code/core/Mage/Core/Model/File/Validator/Image.php
|+++ app/code/core/Mage/Core/Model/File/Validator/Image.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
patching file app/code/core/Mage/Core/etc/config.xml
patching file app/code/core/Mage/Core/etc/system.xml
patching file app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.2.1.1-1.6.0.2.1.2.php
patching file app/code/core/Mage/Customer/Model/Session.php
patching file app/code/core/Mage/Customer/controllers/AccountController.php
Hunk #1 FAILED at 340.
Hunk #2 FAILED at 607.
2 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Customer/controllers/AccountController.php.rej
patching file app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php
patching file app/code/core/Mage/ImportExport/Model/Import/Uploader.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
Hunk #1 FAILED at 502.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Sales/Model/Quote/Item.php.rej
patching file app/code/core/Mage/Widget/Model/Widget/Instance.php
patching file app/code/core/Mage/XmlConnect/Helper/Image.php
patching file app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php
patching file app/design/adminhtml/default/default/layout/main.xml
patching file app/design/adminhtml/default/default/template/notification/formkey.phtml
patching file app/design/adminhtml/default/default/template/notification/symlink.phtml
patching file app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml

A: You are missed some patches. i am sure specially SUPEE-7405 patch missed.
you can check magereport.com any other old patches you are missed.
after apply patches are not work. check the files is in your folder app/code/core/Mage/Core/Model/File/Validator/Image.php
Hope it will helpful for you.


text:
Q: Alternatives to a windows service for polling application I have a C# program that needs to query a database table and make a call to a webservice on a polling interval.
I know I could wrap this up as a windows service. However I am wondering if there are any other tools and techniques where I could call my exe on a schedule without having to create a service.

A: *

*You can schedule your program to run using Scheduled Tasks (taskschd.msc), which is basically the Windows version of cron.

*You could also have your program run on startup and sit in the tray, sleeping while it waits for its own timer to expire.


text:
Q: Multiple Gallery Slider in a Single WordPress Page I would like to ask if anyone has recommendations for multiple gallery slider in a single wordpress page?
I am looking for this type of plugin and found that most sliders when duplicated in a single page, will return similar images from the wordpress library.
Any pointers will be greatly appreciated! Thank you.


text:
Q: Sass Compile Error I am having a problem with a project I am working on where I get the following error when I try to watch. Please see the screen attached. Has anyone ever had this problem and does anyone have suggestions? I have had a look on Google and still cant seem to get it working correctly.
I am using Mavericks and project uses Sass with Susy Framework. Any suggestions would be great.
Screenshot here: http://www.glenwheeler.co.uk/uploads/terminalerror.png
Command as follows:

/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:135:in require': cannot load such file -- sass/script/node (LoadError)
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:135:inrescue in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:in require'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:ineach'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in <top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:in block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:ineach'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in <top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:20:inblock in '
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:8:in fallback_load_path'
    from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:19:in'
    from /usr/bin/compass:23:in load'
    from /usr/bin/compass:23:in'


text:
Q: SWT Shell no taskbar icon Can I hide shell icon from taskbar without using style SWT.ON_TOP? I have to hide it but it can't be over all applications.

A: From a similar question on Eclipsezone

Try creating a shell and not calling setVisible() or open() on it. Next
  create another shell (the dialog) with hidden shell as a parent.


text:
Q: Websphere 8.5.5.3 OSGi: adding and updating bundles I have Websphere 8.5.5.3 available and a tech design task at hand.
Assuming that an OSGi Application has no dependency on any bundles from the OSGi bundle repository (i.e., is self contained in terms of bundle dependencies). And assuming that the application is up and running on the Websphere, can I:

*

*Add and start a new bundle to the running application without restarting the application (other bundles).

*Update the application with a new version of a bundle that is already deployed as a part of application without restarting the application (other bundles)
I went through IBM's resources on OSGi apps in Websphere and I don't seem to be able to find how do I go about it.....

A: OK, I am answering my own question after more research, this is mostly comming from this resource and poking around the Websphere admin console (aka integrated solution console):
http://www-01.ibm.com/support/knowledgecenter/SSCKBL_8.5.5/com.ibm.websphere.osgi.nd.multiplatform.doc/ae/thread_ta_extend.html?lang=en
Assuming there's an OSGi application deployed and running on Websphere and assuming you have access to Websphere web based admin console:
To update a bundle to newer version, you have to:

*

*Deploy the new version of the bundle into internal OSGi bundle repository.
(Environment -> OSGi Bundle Repositories -> Internal bundle repository)

*Update a version of the bundle in the application
(Applications -> Application Types -> Assets -> [your.eba asset] -> Update bundle versions in this application) then choose the version from dropdown next to the bundle and then click 'Preview' and then 'Create'

*Update the application to use the latest configuration
(Applications -> Applicationtypes -> Business-level applications -> [your application] -> [your eba] -> Update to latest deployment)

To add a new bundle to the application, you have to:

*

*Create a composite bundle containing/referencing the new bundles you wish to add to your application (CBA file)

*Deploy that bundle to the internal bundle repository
(Environment -> OSGi Bundle Repositories -> Internal bundle repository)

*Register that bundle as an extension to your application
(Applications -> Application Types -> Business-level applications -> [your application] -> [your eba] -> Extensions for this composition unit -> Add)

*Update the application to use the latest configuration
(Applications -> Applicationtypes -> Business-level applications -> [your application] -> [your eba] -> Update to latest deployment)


text:
Q: Table of contents alignment problem with multi-line \pbox in \includepdf's addtotoc I'm inserting many 1-page PDF's that I also include in the table of contents.
The only issue I have is with the alignment of my entry with the toc counter for PDF # and it's corresponding page number. They are centered on the multiline \pbox I've used in the \includepdf's addtotoc.

The following code illustrates my problem, I need the multi-line entries to have the page numbering and counter aligned with the first line (as the single line entry looks).
\documentclass[12pt, a4paper]{article}
\usepackage[margin = 1in]{geometry}
\usepackage{pdfpages}
\usepackage{pbox}
\begin{document}
\tableofcontents
\includepdf[pagecommand={\thispagestyle{plain}}, addtotoc={1,subsubsection,3,\pbox{20cm}{\textbf{Abstract Author}, One line title with no alignment issues},chap:samplepdf1}]{}
\includepdf[pagecommand={\thispagestyle{plain}}, addtotoc={1,subsubsection,3,\pbox{20cm}{\textbf{Abstract Author}, Two line title with alignment issues\\ Two line title with alignment issues},chap:samplepdf2}]{}
\includepdf[pagecommand={\thispagestyle{plain}}, addtotoc={1,subsubsection,3,\pbox{20cm}{\textbf{Abstract Author}, Three line title with alignment issues\\ Three line title with alignment issues \\ Three line title with alignment issues},chap:samplepdf3}]{}
\end{document}

Maybe there is some way to insert multiple line breaks that will work? Maybe the packages are still buggy and no known fix? Would rather not start from scratch again!
Any help is much appreciated.

A: I prefer varwidth to pbox. A top aligned box is necessary, with some compensation for the excess depth when the box contains more than one line.
\documentclass[12pt, a4paper]{article}
\usepackage[margin = 1in]{geometry}
\usepackage{pdfpages}

\usepackage{varwidth}

\DeclareRobustCommand{\vw}[1]{%
  \begin{varwidth}[t]{\textwidth}\strut#1\unskip\nobreak\strut\par
  \end{varwidth}%
}

\begin{document}

\begingroup\setlength\lineskip{0pt}
\tableofcontents
\endgroup

\includepdf[
  pagecommand={\thispagestyle{plain}},
  addtotoc={
    1,
    subsubsection,
    3,
    \vw{\textbf{Abstract Author}, One line title with no alignment issues},
    chap:samplepdf1
  }
]{pyk}

\includepdf[
  pagecommand={\thispagestyle{plain}},
  addtotoc={
    1,
    subsubsection,
    3,
    \vw{\textbf{Abstract Author}, Two line title with alignment issues\\
        Two line title with alignment issues},
    chap:samplepdf2}
]{pyk}

\includepdf[
  pagecommand={\thispagestyle{plain}},
  addtotoc={
    1,
    subsubsection,
    3,
    \vw{\textbf{Abstract Author}, Three line title with alignment issues\\
        Three line title with alignment issues \\
        Three line title with alignment issues},
    chap:samplepdf3
  }
]{pyk}

\end{document}


text:
Q: C++ can't find function out of namespace Compiling the following code fails because the second function can't find the first one, even though it's outside namespaces. I couldn't figure out the problem myself, and so far I haven't found any answers on the net.
test.cpp:
#include <bits/stdc++.h>

struct myclass {};

template <typename T, typename U>
std::ostream& operator<< (std::ostream &os, const std::pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

namespace my {
    void operator<< (std::ostream os, myclass m) {
        std::cout << std::pair<int, int>(5, 4); // This is line 13.
    }
}

int main() {
    return 0;
}

Error given by the compiler (g++ test.cpp -O2 -o test.exe):
test.cpp:13:13: error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'std::pair<int, int>').
And it goes on, giving a long list of suggestions for what operator<< could have meant.
Observation 1: If the two functions differ in name, no error occurs.
Observation 2: If namespace my { } is removed, no error occurs.

A: This is a kind of name hiding; functions/operators can't be overloaded through different scopes.
According to the rule of name lookup,
(emphasis mine)

..., name lookup examines the scopes as described below, until it finds at least one declaration of any kind, at which time the lookup stops and no further scopes are examined.

For this case, the name operator<< is found at the scope of namespace my (i.e. itself), then name lookup stops, the global scope won't be examined, the global operator<< won't be considered for the following overload resolution.
And

Observation 1: If the two functions differ in name, no error occurs.

It's fine because there's no name hiding.

Observation 2: If namespace my { } is removed, no error occurs.

It's fine because the two operator<< is put at the same scope, i.e. the global namespace. Then both operator<< could be found and then considered at overload resolution, the appropriate one will be selected at last.
As the comments suggested, you can apply using to introduce the names in global namespace into namespace my; then both operator<< will be found and then considered in overload resolution.

A: The operator<< defined in namespace my prevents overload resolution to consider your operator<< defined in the global namespace. You can only rely on ADL here or bring the desired overload in the current scope:
namespace my {

std::ostream& operator<<(std::ostream& os, myclass m) {
    // Bringing the operator in the global namespace in the current scope
    using ::operator<<;
    std::cout << std::pair<int, int>(5, 4);
}

}


text:
Q: How to Store Text in Different Locales Currently, I am developing a multilingual form where users can enter information about companies in both English and Arabic (Other languages may be supported later).
I have string variables like companyNameEn to store the English name of the company and companyNameAr to store its Arabic name and so on. These names will be stored in a database once the user clicks a save Button. I feel like this is not the proper way of storing the texts for different languages as similar variables will be declared for each language by adding the language code (En, Ar, Rr...) as suffix. I believe this way makes adding a new language later a hard thing to do and makes the system hard to maintain.
I thought of defining variables of type Dictionary for each user-keyed data where I set a language code and then assign the language text as shown below:
`Dim companyName As New Dictionary(Of String, String)
`companyName.Add("en", "Company name")`
`companyName.Add("ar", "اسم الشركة")`

I am not sure of whether this is a correct way of handling data of different languages as I need a Dictionary variable for each data.


text:
Q: Properly Understanding CORS with Same Host / Different Port & Security I don't do much client side web programming, so I'm trying to grasp this concept in how it relates to my specific situation.
I have a RESTful WCF service running on a port in the 50000s.  Additionally, I have a bunch of web forms (not ASP WebForms) written in HTML5/CSS3/JavaScript that make AJAX calls to this WCF service.  The web forms are hosted on the same host, but are using port 80.  The AJAX calls made by the web forms are all GET only requests.
Additionally, I have a third-party cloud-hosted application that's in a completely different location (different host), which needs to call the WCF service as well.  This communication is performing POSTs & PUTs to the WCF service.
Obviously the calls being made from the third-party hosted cloud application is  cross origin.  From my research it appears that the different ports are in fact different origins.
I know that security & CORS are different concepts, but here is what I'm trying to accomplish and I need to better understand how all of this works:
Right now I allow all cross-origin requests, and everything is working, but I'd like to limit it down to improve security and then eventually set up HTTPS with transport security with both the webforms & WCF service using the same certificate.  The third-party cloud service hosted-app would still need to be able to communicate with the WCF service so I would need to allow it to authenticate differently, so that would be done with a secret-key being passed since everything is server-side only.
This whole communication 'triangle' feels murky to me, and I hope that SO is the right place for me to be posting this question since it isn't directly code related.

*

*Is the WCF - web forms situation described above considered cross-origin?

*A) If the above is not cross-origin, would I then only need to pass the Access-Control-Allow-Origin: 'https://my-cloud-host' in my web.config?
B) If it is I understand that just need to echo back the allowed origins(s) in the header.  What do I set (if anything) for Access-Control-Allow-Origin in IIS in this case?  What do I echo if it's not allowed, just the original origin?

*Would my idea to use the same certificate for mutual SSL Authentication work if they are hosted on different ports?  Would this prevent the cloud-service from communicating with the WCF service, or would having a second endpoint allow for this?

*Am I losing my mind?  I'm so confused by this whole thing.

A: *

*Yes. In all major browsers except for IE, a different port IS considered to be another origin.

*A) is correct. You need only to allow your port-80 origin to send requests.

*I'm not sure about that. I tend to beleive that SSL is port-awared, and you can't use the same certificate on different ports.

*You can read this excellent article to give your mind some rest.


text:
Q: Is my PostgreSQL query still running even if server closed the connection? Postgres noob here. I have a very long postgresql query running an update on about ~3 million rows. I did this via psql and after about the second hour I got this message:
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.

Is my query still running? I did run:
select *
from pg_stat_activity
where datname = 'mydb';

and I do still see a row with my update query, with the state = active, wait_event_type = IO, and wait_event = DataFileRead. Do I need to be worried that my connection closed out? Is my query still running, and is the best way to check for done-ness to keep checking up with
select *
from pg_stat_activity
where datname = 'mydb';

?

A: Your query will not succeed. Your client lost its connection, and while the backend server process that was handling your UPDATE is still going, it will notice that the client disconnected when it tries to return the query status upon completion, and abort the transaction (whether or not you had performed a BEGIN; every statement in PG is implicitly in a transaction even without BEGIN/COMMIT). You will need to re-issue the UPDATE.


text:
Q: How to ignore HostnameVerifier or add a custom HostnameVerifier on mule? I need  to ignore HostnameVerifier or add a custom HostnameVerifier on mule flow. Is it possible? (Version 3.7).
This is only for tests, because I use invalid certificates just to simulate the HTTPS enviroment.


text:
Q: how to get Xcode to set LC_RPATH (so that @rpath loads will work)? I want to make a command-line tool with a few bundled frameworks that it needs (SDL and related libs).  I have Xcode set to "Embed & Sign" these frameworks, and this results in them being copied to the build folder next to the executable.  The resulting executable runs correctly within Xcode.
But when I try to run the same executable on the command line, it fails with:
dyld: Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
  Referenced from: /Users/jstrout/Data/CPP-dev/soda/Build/Products/Debug/./soda
  Reason: image not found
zsh: abort      ./soda

even though, relative to the current (and executable) directory, the image is indeed at SDL2.framework/Versions/A/SDL2.  The problem appears to be that rpath is not set correctly.  All my searching says that I should find an LC_RPATH command in the output of otool -l on my executable, but in fact there is no LC_RPATH command in there at all (despite several LC_LOAD_DYLIB commands that reference @rpath).
So.  What must I do in Xcode to get it the linker to emit the proper LC_RPATH command?  Or, if I'm barking up the wrong tree entirely: how do I get my command-line executable to reference frameworks that are sitting right next to it?

A: The answer appears to be (thanks to @Siguza):

*

*Navigate to project settings, selecting the Target on the left and "All" on the top.

*Under "Linking", find "Other Linker Flags", and enter -rpath @executable_path/
Building now produces a proper LC_RPATH command in the executable, and it is able to find frameworks sitting next to it.


text:
Q: Evolutionary Algorithms for Noisy Optimization
*

*In the field of Machine Learning, we are often tasked with optimizing a "noisy function", as compared to a "deterministic function" in classical optimization problems.

*This means that we have to "reconstruct" the function we want to optimize based on the observed data we have - since data is said to usually come from a semi-random data generating process; as a result, the function we are interested in optimizing is usually said to have a stochastic component.

*This means that had we collected the same data at a different time, it is possible that the data would not be identical to the same data collected at a different point in time - since the function (e.g. Loss Function of a Machine Learning Model) we are interested in optimizing is ultimately based on this data having a random component, (I have heard that) it is important the algorithms we use for optimizing these functions has some inherent ability to be "robust"; meaning that the solution the optimization algorithm returns for this function should (within reason) be similar to the solution for the same function based on slightly different data.

*An optimization algorithm that is not "robust" potentially has the ability to return significantly different solutions to the same objective function based on slight variations in the data, and this of course is of concern.
My Question: In terms of High Dimensional Loss Functions that are Non-Convex and expensive to differentiate, I have heard that Evolutionary Algorithms (e.g. Genetic Algorithms, Simulated Annealing, Differential Evolution, etc.) can display considerable advantages compared to Gradient Based Optimization Algorithms (e.g. Gradient Descent) - this is because repeatedly taking derivatives of functions with many variables is usually a lot more "computationally expensive" compared to the operations typically performed by Evolutionary Algorithms (e.g. crossover, mutation) .
But in the case of "noisy optimization" -  do Evolutionary Algorithms present any advantages compared to Gradient Based Optimization Algorithms when considering properties such as the "robustness" of solutions??
Can someone please comment on this?
Thanks!

A:
I have heard that Evolutionary Algorithms (e.g. Genetic Algorithms, Simulated Annealing, Differential Evolution, etc.) can display considerable advantages compared to Gradient Based Optimization Algorithms (e.g. Gradient Descent) - this is because repeatedly taking derivatives of functions with many variables is usually a lot more "computationally expensive" compared to the operations typically performed by Evolutionary Algorithms (e.g. crossover, mutation) .

Evolutionary algorithms proceed by doing random mutation, keeping the best candidates, and mutating them again. This is a slow and noisy process, same as biological evolution that needed millions of years to achieve what it achieved. Gradient descent is more computationally demanding, but by moving along the gradient each step is supposed to go in the "correct direction", hence move faster. If each step is slower, but you need less steps, the you may be faster overall. With evolutionary algorithms you need the computational resources for doing a lot of iterations.
Evolutionary algorithms are used for some tasks like architecture search or reinforcement learning, but not for optimization in general because they would be inefficient. This post summarizes the common disadvantages:

*

*GA based methods generally require more iterations to reach the
minima compared to well-optimized SGD based methods.

*If the
mutation rate is high, learning becomes unpredictable and noisy. If
the mutation rate is low, learning becomes slow and can stick in local
minima.

*Bad performance for high dimensional and complex data
patterns (this needs further investigation especially with CNN
architecture which we have not investigated here).

*GA is a
population-based learning, therefore, we cannot take inspirations from
this method to find more about the learning method used by our brains.

This also answers your question about robustness, since the algorithm is completely randomized, the results are not necessary robust in terms of their consistency.


text:
Q: mongodb how to combine aggregate and $regex in a query I want to run a query which shows the selected information but also prints a blank line if there are no details associated with a detail.  Eg.  The following will show the id, name, address and age of customers along with their rankings (where they have rankings) based on their address.  But if one customer has a ranking and the other doesnt then I get an error message.  Would I use a aggregate and $project instead and if so, where go I place the $project. Thank you
    with MongoClient() as client:
        db = client.get_database("test")
        coll = db.get_collection("info")
        for col in coll.find({"cust.address": { "$regex":address}}):
          print (col["_id"] , ":",  col["cust"]["name"],":",  col["cust"]["age"], col["ranking"] )


text:
Q: Level set as the orbit of the action of a Lie Group? I'm wondering the following. Given a smooth function $f:\mathbb R^n\rightarrow \mathbb R^m$ with $m<n$ and level sets $\mathcal O(y)=\{x\in\mathbb R^n| f(x)=y \}$.
What are the conditions on $f$ for which $\mathcal O(y)$ are the orbits of a Lie group action on $\mathbb R^n$? I think that also there are necessary conditions on the kind of action, e.g. that it ought to be proper?

A: I think the question is probably too broad to have a very satisfying general answer. But (assuming you're looking for a smooth Lie group action) here are a couple of necessary, but certainly not sufficient, conditions:

*

*Each level set of $f$ must be a smooth submanifold, because every orbit of a smooth Lie group action is an (immersed) submanifold.

*Each compact level set of $f$ must have nonnegative Euler characteristic, because the group action restricts to a transitive action on each level set, and a theorem of Mostow shows that a compact homogeneous space must have nonnegative Euler characteristic.


text:
Q: how to examine onKeyPress event in console I have the following line:
onKeyPress={(e)=>(e.key==='Enter' ? this.addTodo(e):null)}

assume in the addToo() we have console.log(e)
where can you examine things like:
e.target
e.key

in the console I'm getting the following:
Proxy {dispatchConfig: {…}, _targetInst: FiberNode, isDefaultPrevented: ƒ,
isPropagationStopped: ƒ, _dispatchListeners: ƒ, …}

[[Handler]]:Object
[[Target]]:SyntheticKeyboardEvent
[[IsRevoked]]:false

I can expand these but can't locate e.key or e.target
UPDATE: adding e.persist() before the console.log preserves the information and then you can examine the details of e in the console.log

A: just need to add e.persist() and then you can examine the contents of e in the console