text:
Q: Regex.Split everything inside square brackets [] I'm really a n00b when it comes to regular expressions.  I've been trying to Split a string wherever there's a [----anything inside-----] for example.
string s = "Hello Word my name_is [right now I'm hungry] Julian";
string[] words = Regex.Split( s, "------");

The outcome would be  "Hello Word my name_is " and " Julian"

A: The regex you want to use is:
Regex.Split( s, "\\[.*?\\]" );

Square brackets are special characters (specifying a character group), so they have to be escaped with a backslash.  Inside the square brackets, you want any sequence of characters EXCEPT a close square bracket.  There are a couple of ways to handle that.  One is to specify [^\]]* (explicitly specifying "not a close square bracket").  The other, as I used in my answer, is to specify that the match is not greedy by affixing a question mark after it.  This tells the regular expression processor not to greedily consume as many characters as it can, but to stop as soon as the next expression is matched.

A: @"\[.*?\]" will match the brackets of text

A: Another way to write it:
Regex.Split(str, @"\[[^]]*\]");


text:
Q: QSortFilterProxyModel - find out id index of source model is in proxy model I have QSortFilterProxyModel and QModelIndex of item in the model that is set as source to QSortFilterProxyModel. I need to know is this QModelIndex included in the SortFilterProxyModel model with current filtering settings or not. How can I do this?

A: QSortFilterProxyModel * fm;
QModelIndex      sourceIndex;

if (fm->mapFromSource(sourceIndex).isValid()) {
 // element in filter proxy
} else {
 // element is not in filter proxy
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to expand a textarea in selenium webdriver when the element path is dynamic? The textarea I need to expand has a dynamic xpath and I possibly can't use:
(JavascriptExecutor) driver.executeScript("document.getElementById('someID').setAttribute('rows', '50')");
(JavascriptExecutor) driver.executeScript("document.getElementById('someID').setAttribute('cols', '60')");

because the attributes ID, value, class etc are all dynamic.
Is there any other way to resize the textarea?
The HTML code for element is
<textarea name="comments" id="isc_4G3" $89="isc_TextAreaItem_25" $9a="$9b" class="textItem" style="margin:0px;WIDTH:1132px;HEIGHT:60px;" autocomplete="OFF" spellcheck="true" wrap="SOFT" tabindex="1863" oninput="isc_TextAreaItem_25.$43g()" handlenativeevents="false"></textarea>

Also, I had tried
Actions action = new Actions(driver);
action.moveToElement(getInternalNotesTextArea()).clickAndHold().moveByOffset(xOffset, yOffset).release().perform();

which did not work on it.

A: For dynamic attribute find element using XPATH. And Pass webelement is executescript.
WebElement textArea= webDriver.findElement(xpath_of_textarea);

JavascriptExecutor executor = (JavascriptExecutor) webDriver;

executor.executeScript("arguments[0].setAttribute('rows', '50');", textArea);
executor.executeScript("arguments[0].setAttribute('cols', '60');", textArea);

I hope it will help

A: I am posting the piece of code that worked for me
WebElement textArea= getNotesTextArea();
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].setAttribute('style', 'WIDTH:1132px;HEIGHT:365px');", textArea);

where, getNotesTextArea() returned the textarea with dynamic xpath.


text:
Q: Cannot deserialize json object into array I have this data structure:
public class AutoCompleteObject
{
    public Predictions[] predictions { get; set; }
    public string status { get; set; }
}

public class Predictions
{
    public string description { get; set; }
}

and this is the result of my api:
{
    "predictions": [
        {
            "description": "Hoisberg 142, Hamburg, Germany",
            "matched_substrings": [
                {
                    "length": 8,
                    "offset": 0
                },
                {
                    "length": 2,
                    "offset": 9
                },
                {
                    "length": 7,
                    "offset": 13
                }
            ],
            "place_id": "ChIJr_7fvYSKsUcRejFkuj1Nr0o",
            "reference": "ChIJr_7fvYSKsUcRejFkuj1Nr0o",
            "structured_formatting": {
                "main_text": "Hoisberg 143",
                "main_text_matched_substrings": [
                    {
                        "length": 8,
                        "offset": 0
                    },
                    {
                        "length": 2,
                        "offset": 9
                    }
                ],
                "secondary_text": "Hamburg, Germany",
                "secondary_text_matched_substrings": [
                    {
                        "length": 7,
                        "offset": 0
                    }
                ]
            },

        }
    ],
    "status": "OK"
}

I am trying to deserialize into my object using this:
ObservableCollection<AutoCompleteObject> res = JsonConvert.DeserializeObject<ObservableCollection<AutoCompleteObject>>(content);

But it fails stating it was unable to put the string into the array. But the result is an array and can contain many elements. What am I missing?

A: The exception thrown is the following

Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.ObjectModel.ObservableCollection`1[AutoCompleteObject]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.

So the exception point to the problem being that it expects an array. If you look at the json example you provided it starts with { which means it's a json object. To fix it you need to wrap the json object in [] or deserialize to a different class.
For example your json would have to look like this:
[
    {
        "predictions": [
            {
                "description": "Hoisberg 142, Hamburg, Germany",
                "matched_substrings": [
                    {
                        "length": 8,
                        "offset": 0
                    },
                    {
                        "length": 2,
                        "offset": 9
                    },
                    {
                        "length": 7,
                        "offset": 13
                    }
                ],
                "place_id": "ChIJr_7fvYSKsUcRejFkuj1Nr0o",
                "reference": "ChIJr_7fvYSKsUcRejFkuj1Nr0o",
                "structured_formatting": {
                    "main_text": "Hoisberg 143",
                    "main_text_matched_substrings": [
                        {
                            "length": 8,
                            "offset": 0
                        },
                        {
                            "length": 2,
                            "offset": 9
                        }
                    ],
                    "secondary_text": "Hamburg, Germany",
                    "secondary_text_matched_substrings": [
                        {
                            "length": 7,
                            "offset": 0
                        }
                    ]
                }
            }
        ],
        "status": "OK"
    }
]


text:
Q: How to view the source code of functions that are not exported in the R package I am following this tutorial and would like to use and view the source code of a function that is not exported. But it failed.
The name of this unexported function is diag(), which exists in the coxme package.
When I type coxme::diag() in Console, I can find that the function diag() does exist.
> coxme::diag()
Error: 'diag' is not an exported object from 'namespace:coxme'

But when I type coxme:::diag(), I can't find this function. I don't know why. In this tutorial, the author successfully to find the function by typing usethis:::base_and_recommended().
> coxme:::diag
Error: object 'diag' not found

A: library(coxme)
getAnywhere(diag)
getAnywhere(diag)[1]
showMethods(diag)

differing objects matching 'diag' were found
in the following places
  package:bdsmatrix
  package:base
  namespace:base
  namespace:Matrix
  namespace:bdsmatrix
Use [] to view one of them

standardGeneric for "diag" defined from package "base"

function (x = 1, nrow, ncol, names = TRUE)
standardGeneric("diag")
<environment: 0x0000014df6d2a480>
Methods may be defined for arguments: x, nrow, ncol, names
Use  showMethods(diag)  for currently available ones.

Function: diag (package base)
x="ANY"
x="bdsmatrix"
x="CsparseMatrix"
x="diagonalMatrix"
x="gchol"
x="gchol.bdsmatrix"
x="indMatrix"
x="packedMatrix"
x="RsparseMatrix"
x="TsparseMatrix"
x="unpackedMatrix"


text:
Q: How to minimize one panel out of four panel Why i am getting the errors in the abstract class.Earlier i thought there may be a class of the same so i have created a new package and created a class test but still i am getting the same error.Any Solutions to it.
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newpackage;

/**
 *
 * @author SriHari
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author SriHari
 */
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;

/**
 *
 * @author David
 */
public class Test {

    public Test() {
        createAndShowGui();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Test();
            }
        });
    }

    private void createAndShowGui() {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        final JPanel mainHolderPanel = new JPanel(new GridLayout(2, 2));

        for (int i = 0; i < 4; i++) {
            final int num = i;
            OmniPanel op = new OmniPanel(mainHolderPanel, frame) {
                @Override
                public JPanel createPanel() {
                    JPanel p = createSimplePanelInterface();
                    p.add(new JLabel("Panel " + (num + 1)));
                    return p;
                }

                @Override
                void toPanel() {
                    super.toPanel();
                    System.out.println("Frame requested to be brought to panel");
                }
            };
            mainHolderPanel.add(op.getPanel());
        }

        frame.add(mainHolderPanel);

        frame.pack();
        frame.setVisible(true);
    }
}

abstract class OmniPanel {

    protected JFrame frame;
    protected JPanel panel;
    boolean maximized = false;
    private final JComponent owner;
    private final JFrame ownerFrame;

    public OmniPanel(JComponent owner, JFrame con) {
        this.owner = owner;
        initOmniPanel();
        this.ownerFrame = con;
    }

    private void initOmniPanel() {
        panel = createPanel();
        createFrame();
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowDeiconified(WindowEvent we) {
                super.windowDeiconified(we);
                toPanel();
            }
        });
    }

    public JPanel getPanel() {
        return panel;
    }

    public JFrame getFrame() {
        return frame;
    }

    public boolean goFrame() {
        frame.add(panel);
        frame.pack();
        frame.setState(JFrame.ICONIFIED);
        frame.setVisible(true);
        return true;
    }

    protected void createFrame() {
        frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    }

    void toPanel() {
        frame.remove(panel);
        frame.dispose();
        owner.add(panel);
        owner.revalidate();
        owner.repaint();
    }

    public JPanel createSimplePanelInterface() {
        JPanel p = new JPanel();
        JButton close = new JButton("X");
        JButton minimize = new JButton("_");
        JButton maximize = new JButton("|-|");
        p.add(close);
        p.add(minimize);
        p.add(maximize);
        close.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    maximized = false;
                    ownerFrame.setGlassPane(new JComponent() {
                    });
                    ownerFrame.revalidate();
                    ownerFrame.repaint();
                } else {
                    removePanelFromOwner();
                    getFrame().dispose();
                }
            }
        });
        minimize.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    maximized = false;
                    ownerFrame.setGlassPane(new JComponent() {
                    });
                    owner.add(panel);
                    owner.revalidate();
                    owner.repaint();
                    ownerFrame.revalidate();
                    ownerFrame.repaint();
                } else {
                    removePanelFromOwner();
                    goFrame();
                }
            }
        });
        maximize.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    return;
                }
                maximized = true;
                removePanelFromOwner();
                ownerFrame.setGlassPane(panel);
                ownerFrame.revalidate();
                ownerFrame.repaint();
                panel.setVisible(true);//or glasspane wont h=show this has been a java glitch of sorts for a while
            }
        });
        p.setBorder(new LineBorder(Color.black));
        return p;
    }

    private void removePanelFromOwner() {
        owner.remove(getPanel());
        owner.revalidate();
        owner.repaint();
    }

    abstract JPanel createPanel();
}

A: Hope this will help you with the idea:
Before anything:

After Panel 1 button _ is clicked:

When 2nd icon of JFrame in taskbar which contains Panel 1 is deiconified:

UPDATE
New code also has maximize function:

after pressing |-| button on panel 3:

after pressing _ button on maximized panel 3
 panel 3:
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;

/**
 *
 * @author David
 */
public class Test {

    public Test() {
        createAndShowGui();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Test();
            }
        });
    }

    private void createAndShowGui() {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        final JPanel mainHolderPanel = new JPanel(new GridLayout(2, 2));

        for (int i = 0; i < 4; i++) {
            final int num = i;
            OmniPanel op = new OmniPanel(mainHolderPanel, frame) {
                @Override
                public JPanel createPanel() {
                    JPanel p = createSimplePanelInterface();
                    p.add(new JLabel("Panel " + (num + 1)));
                    return p;
                }

                @Override
                void toPanel() {
                    super.toPanel();
                    System.out.println("Frame requested to be brought to panel");
                }
            };
            mainHolderPanel.add(op.getPanel());
        }

        frame.add(mainHolderPanel);

        frame.pack();
        frame.setVisible(true);
    }
}

abstract class OmniPanel {

    protected JFrame frame;
    protected JPanel panel;
    boolean maximized = false;
    private final JComponent owner;
    private final JFrame ownerFrame;

    public OmniPanel(JComponent owner, JFrame con) {
        this.owner = owner;
        initOmniPanel();
        this.ownerFrame = con;
    }

    private void initOmniPanel() {
        panel = createPanel();
        createFrame();
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowDeiconified(WindowEvent we) {
                super.windowDeiconified(we);
                toPanel();
            }
        });
    }

    public JPanel getPanel() {
        return panel;
    }

    public JFrame getFrame() {
        return frame;
    }

    public boolean goFrame() {
        frame.add(panel);
        frame.pack();
        frame.setState(JFrame.ICONIFIED);
        frame.setVisible(true);
        return true;
    }

    protected void createFrame() {
        frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    }

    void toPanel() {
        frame.remove(panel);
        frame.dispose();
        owner.add(panel);
        owner.revalidate();
        owner.repaint();
    }

    public JPanel createSimplePanelInterface() {
        JPanel p = new JPanel();
        JButton close = new JButton("X");
        JButton minimize = new JButton("_");
        JButton maximize = new JButton("|-|");
        p.add(close);
        p.add(minimize);
        p.add(maximize);
        close.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    maximized = false;
                    ownerFrame.setGlassPane(new JComponent() {
                    });
                    ownerFrame.revalidate();
                    ownerFrame.repaint();
                } else {
                    removePanelFromOwner();
                    getFrame().dispose();
                }
            }
        });
        minimize.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    maximized = false;
                    ownerFrame.setGlassPane(new JComponent() {
                    });
                    owner.add(panel);
                    owner.revalidate();
                    owner.repaint();
                    ownerFrame.revalidate();
                    ownerFrame.repaint();
                } else {
                    removePanelFromOwner();
                    goFrame();
                }
            }
        });
        maximize.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if (maximized) {
                    return;
                }
                maximized = true;
                removePanelFromOwner();
                ownerFrame.setGlassPane(panel);
                ownerFrame.revalidate();
                ownerFrame.repaint();
                panel.setVisible(true);//or glasspane wont h=show this has been a java glitch of sorts for a while
            }
        });
        p.setBorder(new LineBorder(Color.black));
        return p;
    }

    private void removePanelFromOwner() {
        owner.remove(getPanel());
        owner.revalidate();
        owner.repaint();
    }

    abstract JPanel createPanel();
}


text:
Q: Fatal error: Call to a function on a non-object in I'm printing out information from a table (tblgroups). And after that I want to print out avatars (from tblusers) from members of a group (tblgroup_member)
When I try to get push the group_id (from the group I'm printing out) to the function Getmembers) it's telling me that I'm calling a function on a non-object ( $memberinfo = $group->Getmembers($group["group_id"]);). But I declare $group = new Group(); ?
It's telling me that the fault is at this line: $memberinfo = $group->Getmembers($group["group_id"]);
PHP
$group = new Group();
                foreach ($groups as $group) {

                        echo "
" . $group['group_name']  . "
";
                        echo $group['group_id'];

                        $memberinfo = $group->Getmembers($group["group_id"]);
                    /*
                        foreach ($memberinfo as $member)
                        {
                            echo "
" . $member['avatar'] . "
";
                        }

                        */
                }

FUNCTION GETMEMBERS (if necessary)
public function Getmembers($group_id) {
        $db = new Db();

            $select = "SELECT

                            g.group_id,
                            m.user_id,
                            u.avatar

                        FROM ((tblgroups g INNER JOIN tblgroup_member m ON g.group__id = m.group__id) INNER JOIN tblusers u ON u.user_id = m.user_id)
                        WHERE g.group_id = " .  $group_id . " ";

        $result = $db -> conn -> query($select);
        $result_array=array();
        while ($row = mysqli_fetch_array($result)) {
             $result_array[]=$row;
        }
        return $result_array;

    }

A: First thing you have
$group = new Group();

and then a loop
foreach ($groups as $group) {

inside the loop you are using
$memberinfo = $group->Getmembers($group["group_id"]);

here $group-> does not mean the object its the array data from the foreach. or in other words its getting over-written and $group is no longer an object
Solution
change
$group = new Group();

to
$group_obj = new Group();

then
$memberinfo = $group->Getmembers($group["group_id"]);

to
$memberinfo = $group_obj->Getmembers($group["group_id"]);


text:
Q: Can BLE in Android use custom key for encryption I have an Android device as Peripheral and a Cypress BLE chip as the Central. Is it possible to hardcode the 128 bit encryption key in both of them and use it for encryption? If yes could you please tell me how can I do this?

A: No, not for use by the built-in encryption + authentication in the BLE protocol. You can however do your own encryption on the application level.


text:
Q: Fourier transform of a wave-profile Hi I tried to do a Fourier transform of a series of points from a plot from ma wave-train profile.
The commands are as such
draupnerpoints= {{-5, 0}, {-4.8, 3}, {-4.5, 1}, {-4.2, 1}, {-4, 3.5}, {-3.8,
    0}, {-3.5, 6}, {-3.1, 0}, {-3, -5.5}, {-2.8, 0}, {-2.5, 6}, {-2.1,
     0}, {-1.8, -2.5}, {-1.5, 0}, {-1.2, 5}, {-0.8,
    0}, {-0.5, -8}, {-0.2, 0}, {0, 18}, {1/2, 0}, {2/3, -8}, {1,
    0}, {4/3, 4}, {3/2, 0}, {1.6, -4}, {2, 3}, {2.5, -3}, {3,
    3}, {3.2, -2}, {3.5, 2}, {3.8, -4}, {4.2, 0}, {4.5,
    6}, {4.8, -5}, {5, 0.1}};

ifun = Interpolation[draupnerpoints]
Plot[ifun[\[FormalX]], {\[FormalX], -5., 5.},
 Epilog -> {Red, Point[draupnerpoints]}]

which give

Now, we have the interpolated plot. But since i want to do a Discrete Fourier transform of it, I continue as such:
sr = 3(*sample rate*);
ft = Fourier[draupnerpoints, FourierParameters -> {-1, -1}];
ff = Table[(n - 1) sr/Length@draupnerpoints, {n,
   Length@draupnerpoints}]

Then I get  a series of points, which form a linear function, however this was not as expected. I expected a Fourier-type function which is similar to the plot.
How can I get a Fourier series that represents this plot from the commands issued?
Thanks

A: Here I show how to get a Fourier spectrum from your data. I have put some detailed notes on numerical Fourier transforms here.
First I look at your raw data as follows
    draupnerpoints = {{-5, 0}, {-4.8, 3}, {-4.5, 1}, {-4.2, 1}, {-4,
    3.5}, {-3.8, 0}, {-3.5, 6}, {-3.1, 0}, {-3, -5.5}, {-2.8,
    0}, {-2.5, 6}, {-2.1, 0}, {-1.8, -2.5}, {-1.5, 0}, {-1.2,
    5}, {-0.8, 0}, {-0.5, -8}, {-0.2, 0}, {0, 18}, {1/2,
    0}, {2/3, -8}, {1, 0}, {4/3, 4}, {3/2, 0}, {1.6, -4}, {2,
    3}, {2.5, -3}, {3, 3}, {3.2, -2}, {3.5, 2}, {3.8, -4}, {4.2,
    0}, {4.5, 6}, {4.8, -5}, {5, 0.1}};
ListLinePlot[draupnerpoints]

This shows that there are about 12 cycles in 10 seconds so a frequency of about 1.2 cycles per second. To re-sample this needs a sample rate of at least about 3 but more would be better. I am going to use 30.
Next I interpolate your data and sample to give me evenly spaced points
sr = 30.; (* Sample rate*)
int = Interpolation[draupnerpoints];
pts = Table[{t, int[t]}, {t, -5, 5, 1/sr}];
Plot[int[t], {t, -5, 5}, Epilog -> {Red, Point[pts]}]

Now we can calculate a spectrum. I first calculate the values of a frequency axis.  Then I  take the Fourier transform. Finally I calculate the absolute value of the spectral values.
finc = sr/Length[pts]; (* frequency increment *)
ff = Table[f, {f, 0, sr - finc, finc}];
spectrum =
  Transpose[{ff,
    Fourier[pts[[All, 2]], FourierParameters -> {-1, -1}]}];
abs = {#[[1]], Abs[#[[2]]]} & /@ spectrum;
ListLinePlot[abs, PlotRange -> All]
ListLinePlot[abs[[1 ;; 50]], PlotRange -> All]

The first plot shows the whole spectrum. The second the frequency range where your data is located. The frequency peak is actually at about 0.84 Hz so the original estimate of 1.2 Hz was rather high. Note that in the whole spectrum the second half is a mirror image of the first half. These are the negative frequencies. This is because the spectrum is periodic and the tradition is to do the positive frequencies first and the negative second which is fine as the spectrum is periodic.
Hope that helps


text:
Q: Using AzCopy in azure virtual machine I have an azure virtual machine which has some application specific CSV files(retrieved via ftp from on-premise) that needs to be stored into a blob (and eventually will be read and pushed into a Azure SQL DB via a worker role). Question is around pushing the files from VM to blob. Is it possible to get AzCopy without installing the SDK to have the files copied to the blob? Is there a better solution than this?  Please read the points below for further information
Points to note:
1) Though files could be directly uploaded to a blob rather than getting them into the VM first and copying from there, for security reasons the files will have to be pulled into the VM and this cannot be changed.
2) I also thought about a worker role talking to a VM folder share (via common virtual network) to pull the files and upload to the blob, but this does not appear to be a right solution after reading some blogs - as it requires changes to both VMs (worker role VM and the Iaas VM).
3) Azure File Service is still in preview (?) and hence cannot be used.

A:
Is it possible to get AzCopy without installing the SDK to have the
  files copied to the blob?

Absolutely yes. You can directly download AzCopy binaries without installing SDK using the following links:
Version 3.1.0: http://aka.ms/downloadazcopy
Version 4.1.0: http://aka.ms/downloadazcopypr
Source: http://blogs.msdn.com/b/windowsazurestorage/archive/2015/01/13/azcopy-introducing-synchronous-copy-and-customized-content-type.aspx


text:
Q: How to access deleted VSI's data in SoftLayer I need to access deleted VSI's to find their ID. I have the hostnames of the devices that were deleted. In essence, I need to take the hostnames of the deleted VSI's and find their ID. Here is my code (Python):
import SoftLayer
import json

USERNAME = 'set me'
API_KEY = 'set me'

client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
accountService = client['SoftLayer_Account']
objectMask= "mask[hostname,id]"

try:

 response = accountService.getallTopLevelBillingItems(mask=objectMask)
 print(json.dumps(response, sort_keys=True, indent=2, separators=(',', ': ')))

except:

 print("Unable to get the VSIs")`

A: There is no way to retrieve the deleted VSIs using the SLDN API once they were cancelled.
I'm not sure but you can try by submitting a ticket and request that information if you need those IDs for logging purposes


text:
Q: Category guides don't show on chart Amcharts I'm trying to add vertical guides on the category axis to show sport activities on my chart. I have a variable in my json file called UNIX_TIMESTAMP(start_time) which is a Unix timestamp. I use this field to show on my category axis. Here is a codepen is created with my code for the chart: https://codepen.io/thomasdesaranno-r0629748/pen/jJrQgO
this is an example of my JSON file:
{
    "id": "NULL",
    "bg": "NULL",
    "UNIX_TIMESTAMP(start_time)": 1546603542000,
    "duration": 30,
    "sport_type": "running",
    "average_hr": 60,
    "average_speed": 30,
    "calories": 496,
    "fat_percentage_of_calories": 36,
    "food": "NULL",
    "ci": "NULL",
    "emotion": "NULL"
}

Does anybody know why my guides don't show?

A: The guides can not be created automatically from dataProvider, but you can extract the data you need and create the guides:
var data = [/* your data */]
var guides = data
  .map(i => i['UNIX_TIMESTAMP(start_time)'])
  .filter(i => i !== "NULL")
  .map(timestamp => ({
    "date": timestamp,
    "color": "#0000ff",
    "lineColor": "#0000ff",
    "lineAlpha": 1,
    "label": new Date(timestamp),
    "labelRotation": 90,
    "inside": true
  }));

You now can set the guides in the chart config:
{
  // ...
  "guides": guides,
  // ...
}

Here I have created a code pen as reference.
If you want to use the dataLoader property to load external data for your chart you can use the dataUpdated event to generate the guides and add them to the chart:
{
  // ...
  "listeners": [{
    "event":"dataUpdated",
    "method": function(event) {
      event.chart.guides = event.chart.dataProvider
        .map(i => i['UNIX_TIMESTAMP(start_time)'])
        .filter(i => i !== "NULL")
        .map(timestamp => ({
          "date": timestamp,
          "color": "#0000ff",
          "lineColor": "#0000ff",
          "lineAlpha": 1,
          "label": new Date(timestamp),
          "labelRotation": 90,
          "inside": true
      }));
      event.chart.validateNow();
    }
  }],
  // ...
}

Don't forget to call chart.validateNow(), otherwise the chart don't shows the guides.
Here I have created a code pen for the dataLoader solution.
In the official docs you can read more about guides and their configuration.


text:
Q: Angular 2 Quickstart: wrong encoding of js files I'm very new to angular 2, so I'm trying to make this work: https://angular.io/guide/quickstart
The problem which I have really confuses me. All JS files, which I get as a response, have strange encoding - basically, I see a bunch of hieroglyphs. Non-js files (html and css) are ok. Please see below, html is ok. Js - totally not.

Do you guys have any idea, what can it be? Computer culture is not Chinese or Japanese, just in case.

A: You can use notepad++ or any html editor with encode options available to change the page encoding:

*

*Open your file with Notepad++

*Go to "Encoding" menu option in main menu

*Select "Convert to UTF-8-BOM"

*check if the page display correctly

A: This can be related to your js files encoding on your editor.


text:
Q: TextBox.Text does not work in Dapper I am new in Dapper. When user selects an Item-name in drop-down style Text-box and click Select Button , then that particular row should be added in datagridview.
Problem is that txt_sell_item.Text does not retrive value and add it in datagridview. Instead if i just write ItemName='bread' in my query it works. ('bread' is an item in my ItemName Column in database)
[ I also bind my datagridview with Order Class]
My Select Button Click Event is.
    using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString))
    {
         if (db.State == ConnectionState.Closed)
            db.Open();
            string query = "SELECT *FROM tbl_ItemDetail WHERE ItemName='{txt_sell_item.Text}'";
            ordersBindingSource.DataSource = db.Query<Orders>(query, commandType: CommandType.Text);
            dataGridView1.Refresh();
    }

My Order Class is...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test
{
    public class Orders
    {
        public int    ItemId      { get; set; }
        public string ItemName    { get; set; }
        public string Brand       { get; set; }
        public string Category    { get; set; }
        public int    Quantity    { get; set; }
        public int    Price       { get; set; }
    }
}

My GUI is

A: This has nothing to do with Dapper, but it is an error on your query string.
You should write it as (just adding the initial $ to understand your txt_sell_item.Text)
string query = $"SELECT * FROM tbl_ItemDetail WHERE itemName='{txt_sell_item.Text}'";

However you don't concatenate together strings to build sql command but you need to use a parameterized query.
So the query text becomes
string query = "SELECT *FROM tbl_ItemDetail WHERE ItemName=@ItemName";

and the command is
ordersBindingSource.DataSource = db.Query<Orders>(query, new {ItemName = txt_sell_item.Text});


text:
Q: f is convex if and only if $f(x):=\left \langle Mx,x\right \rangle \ge 0$ I have to show for $M \in \mathbb{R}^{(N \times n)\times (N \times n)}$ symmetric Matrix and $f:\mathbb{R}^{N\times n} \longrightarrow \mathbb{R}$ with $f(x):= \langle Mx,x\rangle$ that:
f is convex if and only if $f(x) \ge 0.$
where $\langle\cdot,\cdot\rangle$ is the standard inner product on $\mathbb{R}^{N\times n}$.
I don't know how to proof that. Perhaps someone has a hint.
Thanks in advance!!!

A: $f$ is convex $\iff$ the Hessian of $f$ is positive semi-definite. The Hessian of $f$ is the martix $2M.$
Hence: $f$ is convex $ \iff M$ is positive semi-definite $ \iff \left \langle Mx,x\right \rangle \ge 0$ for all $x$.

A: That does not seem right to me. Let $ \mathbb{R}^{{n \cdot (n + 1)}/{2}}$ be the space of the $n\times n$ symmetric matrices . Not every convex function $ f: \mathbb{R}^{{n \cdot (n + 1)}/{2}}\to \mathbb{R} $ is of the form $ f (X) = \langle M \cdot X, X \rangle $. The function
$$
\varphi(X)=\|X\|_{\infty}= \max\left\{|X_{ij}|: X=(X_{ij})_{n\times n}\in \mathbb{R}^{{n \cdot (n + 1)}/{2}}\right\}
$$
is convex because that every norm in a finite dimensional space is a convex fuction. It is a consequence of triangular inequality: for all $t\in[0,1]$ we have
$$
\|t\cdot X+(1-t)Y\|_\infty\leq \|t\cdot X\|_{\infty}+\|(1-t)\cdot Y\|_\infty\leq t\cdot\|X\|_{\infty}+(1-t)\cdot \|Y\|_\infty
$$
It is easy to see that there is no constant matrix $M\in \mathbb{R}^{({n \cdot (n + 1)}/{2})\times ({n \cdot (n + 1)}/{2}) }$ such that
$$
\langle M\cdot X, X\rangle_{\mathbb{R}^{{n \cdot (n + 1)}/{2}}}=\|X\|_\infty=\max_{ij}|X_{ij}|
$$


text:
Q: Load jquery file inside a wordpress shortcode
i׳m trying to create an accordion shortcode.
when I load the scripts with wp_enqueue_script function it seams to work only for the jquery ui library but not the custom script
jQuery(document).ready(
    function() {
           $('#ks-accordion').accordion();
       }
);

Here is the full code:
// Container

function ks_accordion($atts, $content = null) {

    extract( shortcode_atts( array(
        'id' => ''
    ), $atts ) );
    wp_enqueue_script('jquery-ui-accordion');
    wp_enqueue_script('shortcode', get_template_directory_uri().'/functions/shortcodes/js/shortcodes.js');

    return '
'.do_shortcode($content).'
';
}
add_shortcode( 'accordion', 'ks_accordion' );

// Section

function ks_accordion_section($atts, $content = null) {

    extract( shortcode_atts( array(
        'title' => 'My Title',
    ), $atts ) );

    return '
'.$title.'

'.do_shortcode($content).'

';

}
add_shortcode( 'accordion_section', 'ks_accordion_section' );

This is the code I get in the front-end:

Title

Content

Title1

Content

Title2

Content

Also I don't get why it creates these
?

Thanks

A: wp_enqueue_script('shortcode', get_template_directory_uri().'/functions/shortcodes/js/shortcodes.js', array('jquery'));

Hope this helps!

A: jQuery is loaded in noConflict mode in WordPress. To use the dollar sign, we need the following

jQuery(document).ready( function($) { // <---- put $ here
    $('#ks-accordion').accordion();
});

Much probably, do_shortcode is inserting those
, but it's just speculation.


text:
Q: Trigger breath-app or HRV measurement programmatically [Apple Watch 4] I want to trigger a HRV-measurement on my Apple Watch 4 programmatically. Is there a way to start the breath-app from my own app in background to trigger the HRV measurement? Or is it possible to trigger a HRV-measurement directly?
If not is there even an alternative to measure stress in nearly realtime programmatically on my Apple Watch 4 ?
Please provide me some Code examples if you know an answer.
Thank you in advance!

A: There is no API to trigger an HRV measurement on Apple Watch. You should file a radar with Apple to request one.

A: It is not possible to launch the Breathe app programmatically, but heart rate variability is accessible from HealthKit.


text:
Q: What is happening when this code calls FUSE like this? I am working through another person's implementation of file system with python fuse. I am trying to understand the flow of the program. When the code's main method is called it somehow calls the listDirectory method. Where is the code for this FUSE method defined? Where can I find documentation of what is happening? I searched the fuse.py file for this method and can't find it.
def listDirectory():
    print '[*] Listing Directory'
    message = str({"RequestType":4})
    print "sending message " + message
    return sendMessage(message)

def main(a, b):
    print "\n[*] Calling main method"
    FUSE(FuseHandler(a), b, foreground=True)

A: In the Fuse.py is the definition of the class FUSE.
class FUSE(object):

    """This class is the lower level interface and should not be subclassed

       under normal use. Its methods are called by fuse.

       Assumes API version 2.6 or later."""

    def __init__(self, operations, mountpoint, raw_fi=False, **kwargs):

        """Setting raw_fi to True will cause FUSE to pass the fuse_file_info

           class as is to Operations, instead of just the fh field.

           This gives you access to direct_io, keep_cache, etc."""

You're just calling the init method implicitly.


text:
Q: Codeigniter - My Model Jamie Rumbelow + HMVC callback validation in model i wonder how to use callback validation using MY model - made by Jamie Rumbelow with Modular extension - wiredesignz
i have create MY_Form_validation and modified the run function like this:
class MY_Form_validation extends CI_Form_validation {

/**
 * Stores the CodeIgniter core object.
 *
 * @access public
 *
 * @var object
 */
public $CI;

/**
 * Constructor
 *
 * @return void
 */
function __construct($config = array())
{
    // Merged super-global $_FILES to $_POST to allow for better file validation inside of Form_validation library
    $_POST = (isset($_FILES) && is_array($_FILES) && count($_FILES) > 0) ? array_merge($_POST,$_FILES) : $_POST;

    parent::__construct($config);

}
/**
 * Performs the actual form validation
 *
 * @access public
 *
 * @param string $module Name of the module
 * @param string $group  Name of the group array containing the rules
 *
 * @return bool Success or Failure
 */
public function run($module='', $group='')
{
    (is_object($module)) AND $this->CI =& $module;
    return parent::run($group);

}

it work perfectly if i run form validation with callback in controller, but i wonder how to run in inside a model, it always skip the callback
thank you for your time, and your answer :)


text:
Q: C# Code Loading Plugins Fails Inside Virtual Machine I am using Win7 Ultimate in a VMWare Player virtual machine, running on a Linux Mint host.  Under Win7 I am using Visual Studio Express 2012 to develop an application.  On startup this application loads plugins dynamically - the mechanism is fairly classic:
        var plugins = new List<IPlugin>();

        var domainInfo = new AppDomainSetup
        {
            ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
            PrivateBinPath = PluginPath
        };

        var domain = AppDomain.CreateDomain("PluginLoader", null, domainInfo);
        var pluginFiles = Directory.GetFiles(PluginPath, "my.plugin.*.dll");

        TypesInAssemblyFile finder = (TypesInAssemblyFile)domain.CreateInstanceFromAndUnwrap(
            typeof(TypesInAssemblyFile).Assembly.Location,
            typeof(TypesInAssemblyFile).FullName
        );
        var pluginFiles = Directory.GetFiles(PluginPath, "myapp.plugin.*.dll");

This works fine if the solution, project files and sources are located on the virtual machine's C: drive, or on a NAS shared folder.  If, however, I move same code to another hard disk located in the same physical machine and shared with the VM using VMWare Player's folder sharing mechanism then I get a System.IO.FileLoadException at the domain.CreateInstanceFromAndUnwrap:
An unhandled exception of type 'System.IO.FileLoadException' occurred in
myapp.modules.dll

Additional information: Could not load file or assembly 'file:///G:\myapp\my\path
\bin\Debug\myapp.modules.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)

This physical disk is mounted using VMWare Player's shared folder mechanism, the path  \\vmware-host\Shared Folders\Data is mapped to a G: drive and everything looks fine.
Does anyone have any clue why?  I've loaded the DLL in Dependency Walker and don't see anything obviously wrong and the same code works fine on the virtual machine's C:.


text:
Q: Prove $\phi: GL(X) \to GL(X)$ where $\phi(A)= A^{-1}$ is continuous ($X$ is a Banach space) I'm taking a Functional Analysis course, and in one of the lectures we proved the two following theorems, after which the third was stated as "one can show that..." -- but I'm unable to show it.
The two statements are:

*

*$GL(X)$ is open in $B(X)$ (bounded from Banach space $X$ to itself)

*(a lemma used to prove 1): For all $A \in B(X)$, if $||A||<1$ then $I-A$ is invertible, and $(I-A)^{-1}=\sum_{n=0}^\infty A^n$
After these two, he said that it can be proven that the map between $GL(X)$ to itself, which maps $A$ to its inverse $A^{-1}$ is continuous.
After several attempts, I've concluded (perhaps wrongly) that the best way to approach this is by trying to prove the following statement (continuity at every point):
Let $A_0 \in GL(X)$ and let $\epsilon>0$. Then we are looking for a $\delta>0$ such that if $||A-A_0||<\delta$ then $||A^{-1}-A_0^{-1}||<\epsilon$.
I have tried using the openness (1) by using the radius found during the proof, which is (**) $r:=\frac{1}{||A^{-1}||}$ (i.e. $B_{r}(A) \subseteq GL(X)$ for any $A \in GL(X)$), but this did not lead anywhere. I also tried thinking of writing $||A^{-1}-A_0^{-1}||$ somehow as a function of $A-A_0$ but that hasn't been fruitful either.
EDIT
Another idea: perhaps
$$||A^{-1}-{A_0}^{-1}||=
||(A-{A_0})^{-1}||<\frac{1}{||A-A_0||}$$
where the inequality follows from (**) above with $A-{A_0}$ instead of $A$, and then take $\delta=\frac{1}{\epsilon}$? But how can I justify the first equality?
How can I prove this given that the only available related theorems I can use are the former two? (and perhaps other elementary concepts I'm probably missing).
Thanks.


text:
Q: Repeated kernel panics: panic(cpu 2 caller 0xffffff8019f6799f): userspace watchdog timeout: no successful checkins from remoted since load My MacBook Pro (13-inch, 2018, Montery) freezes at the loading screen. I have tried reseting SMC, PRAM, reinstalling MacOs. The problem persists and I was able to derive the kernel panic report only in a safe mode. No peripherals attached.
panic(cpu 2 caller 0xffffff8019f6799f): userspace watchdog timeout: no successful checkins from remoted since load
service returned not alive with context : is_alive_func returned unhealthy : device not connected (code: 0x2
service: logd, total successful checkins since load (180 seconds ago): 19, last successful checkin: 0 seconds ago
service: WindowServer, total successful checkins since load (150 seconds ago): 15, last successful checkin: 0 seconds ago
service: remoted, no successful checkins since load (180 seconds ago)
service: opendirectoryd, total successful checkins since load (180 seconds ago): 18, last successful checkin: 0 seconds ago

Panicked task 0xffffff8ba7f2d000: 3 threads: pid 88: watchdogd
Backtrace (CPU 2), panicked thread: 0xffffff86db01e540, Frame : Return Address
0xffffffe5a832b690 : 0xffffff8016a81c8d
0xffffffe5a832b6e0 : 0xffffff8016be1596
0xffffffe5a832b720 : 0xffffff8016bd0963
0xffffffe5a832b770 : 0xffffff8016a21a70
0xffffffe5a832b790 : 0xffffff8016a8205d
0xffffffe5a832b8b0 : 0xffffff8016a81816
0xffffffe5a832b910 : 0xffffff8017315223
0xffffffe5a832ba00 : 0xffffff8019f6799f
0xffffffe5a832ba10 : 0xffffff8019f675f2
0xffffffe5a832ba30 : 0xffffff8019f66971
0xffffffe5a832bb60 : 0xffffff8017283a8c
0xffffffe5a832bcc0 : 0xffffff8016b872e6
0xffffffe5a832bdd0 : 0xffffff8016a5c9ab
0xffffffe5a832be60 : 0xffffff8016a731f9
0xffffffe5a832bef0 : 0xffffff8016bb35aa
0xffffffe5a832bfa0 : 0xffffff8016a22256
      Kernel Extensions in backtrace:
         com.apple.driver.watchdog(1.0)[D6F8B92D-3418-34BA-B42B-F553E0C44C29]@0xffffff8019f65000->0xffffff8019f67fff

Process name corresponding to current thread (0xffffff86db01e540): watchdogd
Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
21F79

Kernel version:
Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
Kernel UUID: 3C587984-4004-3C76-8ADF-997822977184
KernelCache slide: 0x0000000016800000
KernelCache base:  0xffffff8016a00000
Kernel slide:      0x0000000016810000
Kernel text base:  0xffffff8016a10000
__HIB  text base: 0xffffff8016900000
System model name: MacBookPro15,2 (Mac-827FB448E656EC26)
System shutdown begun: NO
Hibernation exit count: 0

System uptime in nanoseconds: 183789442963
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000002acab45d98
  Sleep   : 0x0000000000000000 0x0000000000000000 0x0000000000000000
  Wake    : 0x0000000000000000 0x000000030acc9770 0x0000000000000000
Compressor Info: 0% of compressed pages limit (OK) and 0% of segments limit (OK) with 0 swapfiles and OK swap space
Zone info:
  Zone map: 0xffffff8073560000 - 0xffffffa073560000
  . PGZ   : 0xffffff8073560000 - 0xffffff8074561000
  . VM    : 0xffffff8074561000 - 0xffffff8540fc7000
  . RO    : 0xffffff8540fc7000 - 0xffffff86da893000
  . GEN0  : 0xffffff86da893000 - 0xffffff8ba72f9000
  . GEN1  : 0xffffff8ba72f9000 - 0xffffff9073d5f000
  . GEN2  : 0xffffff9073d5f000 - 0xffffff95407c5000
  . GEN3  : 0xffffff95407c5000 - 0xffffff9a0d22c000
  . DATA  : 0xffffff9a0d22c000 - 0xffffffa073560000
  Metadata: 0xffffffe5328d0000 - 0xffffffe5528d0000
  Bitmaps : 0xffffffe5528d0000 - 0xffffffe5558d0000

last started kext at 20314425767: >driverkit.serial 6.0.0 (addr 0xffffff7fafcb5000, size 28672)
last stopped kext at 126338230190: >IOPlatformPluginLegacy  1.0.0 (addr 0xffffff7fafbb1000, size 36864)
loaded kexts:
>!ATopCaseHIDEventDriver    5450.8
>!APlatformEnabler  2.7.0d0
>X86PlatformShim    1.0.0
>AGPM   129
>!AHIDALSService    1
@filesystems.autofs 3.0
>!AUpstreamUserClient   3.6.9
>!A!IKBLGraphics    18.0.7
>!AGFXHDA   140.3
>!AGraphicsDevicePolicy 6.5.7
>!ABridgeAudio!C    240.6
@AGDCPluginDisplayMetrics   6.5.7
>!A!ICFLGraphicsFramebuffer 18.0.7
>pmtelemetry    1
|IOUserEthernet 1.0.1
>usb.!UUserHCI  1
>!AHV   1
>!ADiskImages2  126.100.13
>!AThunderboltIP    4.0.3
>!ABacklight    180.8
>!AMCCSControl  1.16
>BridgeAudioCommunication   240.6
>!AAVEBridge    6.1
>!A!IPCHPMC 2.0.1
>!A!ISlowAdaptiveClocking   4.0.0
>BCMWLANFirmware4387.Hashstore  1
>BCMWLANFirmware4378.Hashstore  1
>BCMWLANFirmware4377.Hashstore  1
>BCMWLANFirmware4364.Hashstore  1
>BCMWLANFirmware4355.Hashstore  1
>!AFileSystemDriver 3.0.1
@filesystems.tmpfs  1
@filesystems.lifs   1
@filesystems.hfs.kext   583.100.10
@BootCache  40
@!AFSCompression.!AFSCompressionTypeZlib    1.0.0
@!AFSCompression.!AFSCompressionTypeDataless    1.0.0d1
@filesystems.apfs   1934.121.2
>!ABCMWLANBusInterfacePCIeMac   1
@private.KextAudit  1.0
>!ASmartBatteryManager  161.0.0
>!AACPIButtons  6.1
>!ASMBIOS   2.1
>!AACPIEC   6.1
>!AAPIC 1.7
@!ASystemPolicy 2.0.0
@nke.applicationfirewall    402
|IOKitRegistryCompatibility 1
|EndpointSecurity   1
@Dont_Steal_Mac_OS_X    7.0.0
@kec.!AEncryptedArchive 1
>driverkit.serial   6.0.0
>!AActuatorDriver   5450.14
>!AMultitouchDriver 5450.14
>!AInputDeviceSupport   5450.4
>!AHS!BDriver   5450.8
>IO!BHIDDriver  9.0.0
>!AHIDKeyboard  228.2
@kext.triggers  1.0
>!AAudioClockLibs   140.1
>!AGraphicsControl  6.5.7
>!A!ILpssUARTv1 3.0.60
>!A!ILpssUARTCommon 3.0.60
>!AOnboardSerial    1.0
|IOAudio!F  340.2
@vecLib.kext    1.2.0
|IOAccelerator!F2   462.8
|IO!BSerialManager  9.0.0
|IO!BPacketLogger   9.0.0
|IO!BHost!CUSBTransport 9.0.0
|IO!BHost!CUARTTransport    9.0.0
|IO!BHost!CTransport    9.0.0
>IO!BHost!CPCIeTransport    9.0.0
|IOAVB!F    1040.6
@plugin.IOgPTPPlugin    1040.3
|IOEthernetAVB!C    1.1.0
|CSR!BHost!CUSBTransport    9.0.0
|Broadcom!BHost!CUSBTransport   9.0.0
|Broadcom!B20703USBTransport    9.0.0
>!AIPAppender   1.0
@!AGPUWrangler  6.5.7
>!AThunderboltDPOutAdapter  8.5.1
@!AGraphicsDeviceControl    6.5.7
>!ABacklightExpert  1.1.0
|IONDRVSupport  597
>X86PlatformPlugin  1.0.0
|IOGraphics!F   597
>!ASMBus!C  1.0.18d1
>IOPlatformPlugin!F 6.0.0d8
|IOSlowAdaptiveClocking!F   1.0.0
>usb.IOUSBHostHIDDevice 1.2
>usb.cdc.ecm    5.0.0
>usb.cdc.ncm    5.0.0
>usb.cdc    5.0.0
>usb.networking 5.0.0
>usb.!UHostCompositeDevice  1.2
>!AThunderboltPCIDownAdapter    4.1.1
>!AHPM  3.4.4
>!A!ILpssI2C!C  3.0.60
>!A!ILpssDmac   3.0.60
>!AThunderboltDPInAdapter   8.5.1
>!AThunderboltDPAdapter!F   8.5.1
>!ABSDKextStarter   3
|IOSurface  302.14
@filesystems.hfs.encodings.kext 1
>!AXsanScheme   3
>!AThunderboltNHI   7.2.81
|IOThunderbolt!F    9.3.3
>usb.!UVHCIBCE  1.2
>usb.!UVHCICommonBCE    1.0
>usb.!UVHCI 1.2
>usb.!UVHCICommon   1.0
>!AEffaceableNOR    1.0
|IOBufferCopy!C 1.1.0
|IOBufferCopyEngine!F   1
|IONVMe!F   2.1.0
>!ABCMWLANCoreMac   1.0.0
|IOSerial!F 11
|IO80211!F  1200.12.2b2
|IOSkywalk!F    1.0
>mDNSOffloadUserClient  1.0.1b8
>IOImageLoader  1.0.0
>!AOLYHALMac    1
>corecapture    1.0.4
>usb.!UHostPacketFilter 1.0
|IOUSB!F    900.4.2
>!A!ILpssI2C    3.0.60
>!A!ILpssGspi   3.0.60
>usb.!UXHCIPCI  1.2
>usb.!UXHCI 1.2
>!AEFINVRAM 2.1
>!AEFIRuntime   2.1
>!ASMCRTC   1.0
|IOSMBus!F  1.1
|IOHID!F    2.0.0
|IOTimeSync!F   1040.3
|IONetworking!F 3.4
>DiskImages 493.0.0
|IO!B!F 9.0.0
|IOReport!F 47
$quarantine 4
$sandbox    300.0
@kext.!AMatch   1.0.0d1
|CoreAnalytics!F    1
>!ASSE  1.0
>!AKeyStore 2
>!UTDM  533.120.2
|IOUSBMass!SDriver  210.120.3
|IOSCSIBlockCommandsDevice  456.121.3
|IO!S!F 2.1
|IOSCSIArchitectureModel!F  456.121.3
>!AMobileFileIntegrity  1.0.5
$!AImage4   4.2.0
@kext.CoreTrust 1
>!AFDEKeyStore  28.30
>!AEffaceable!S 1.0
>!ACredentialManager    1.0
>KernelRelayHost    1
|IOUSBHost!F    1.2
>!UHostMergeProperties  1.2
>usb.!UCommon   1.0
>!ABusPower!C   1.0
>!ASEPManager   1.0.1
>IOSlaveProcessor   1
>!AACPIPlatform 6.1
>!ASMC  3.1.9
|IOPCI!F    2.9
|IOACPI!F   1.4
>watchdog   1
@kec.pthread    1
@kec.Libm   1
@kec.corecrypto 12.0```

A: A kernel error is an unrecoverable problem that the core OS (the kernel) couldn't recover from.  It could be bad hardware like an issue with the CPU, RAM or disk/storage controller.  It could also be software like if there is a programming bug instructing the OS to access something at a wrong address.
While you say "no peripherals connected," that's not entirely true from the system standpoint. Mac computers are highly integrated now with wireless (802.11, Bluetooh, etc.) storage and a USB keyboard and trackpad, there are still peripherals that get connected without your awareness.
From the panic, it appears to looking for a "connection" to something that didn't get made due to a failed component.
Now, keep in mind, the debug messages could be misleading because a number of things get loaded into memory, for example. If some code to drive your AirPort card, for example put it in bad memory, the data would be corrupt but it might lead you to believe your wireless is bad when it really isn't.  Then again, it could be a bad wireless card writing bad data into good memory.  The point is, the debug info gives (a technician, programmer or engineer) a starting point for diagnosis.
That said, most (not all) kernel panics I've encountered we typically memory related.  I've solved ,any of these issues by replacing the cheap no-name memory modules with quality brands.  If your memory is now integrated (as almost all Mac computers are now), this will require a logic board replacement.  Either way, this is something  that needs to be diagnosed more comprehensively to be solved.


text:
Q: Looking for a horizontal treeview in jQuery Is there a treeview control out there that is horizontally aligned like an org chart?
Treeview control is normally vertically aligned. Or is such a control called something else and not treeview?

A: I found a jQuery control for a horizontal tree view. Actually, its more appropriately called org chart. Here is the link that I found having a free org chart for use with jQuery.

*

*https://github.com/caprica/jquery-orgchart


text:
Q: inheritance from win32com.client class in python I am using python2.7 with win32com module to access a win32 COM Library.
with:
import win32com.client
app = win32com.client.Dispatch('Word.Application')

I get an application object that works fine in python, although I do have only late binding
available.
Now I would like to inherite from this class:
class icad(app):
    pass

whicht throws the following exception:
TypeError: Error when calling the metaclass bases
__init__() takes at most 2 arguments (4 given)

Is there a way to inherit from these COM classes at runtime?
Metaclass seems to be the hint but I do not know where to start.


text:
Q: What is a "control point"? I'm trying to figure out a good definition of control point for use in wikipedia (see https://en.wikipedia.org/wiki/Control_point_(mathematics) )
There seems to be a bias towards ascribing a computer-graphics/CAD basis/usage for the term, but is it really limited to that field?  I was thinking that control point might be a term used more generally in mathematics/geometry/topology to describe sets of points that describe curves/surfaces/manifolds -- is it a mistake to think it a general term?

A: People in CAGD use the term "control point" in a fairly general way. Typically, we are dealing with polynomials. Suppose we are given a polynomial $C:\mathbf{R} \to V$ of degree $m$, where $V$ is some vector space, which is usually $\mathbf{R}^2$ or $\mathbf{R}^3$. The image $C([0,1])$ is then a "curve". Suppose we choose some basis $\phi_{0}, \ldots, \phi_m$ for the space of polynomials of degree $m$. Then we can find $P_0, \ldots, P_m \in V$ such that
$$
C(t) = \sum_{i=0}^m \phi_i(t)P_i
$$
Then $P_0, \ldots, P_m$ are called the "control points" of the curve with respect to the chosen basis.
Depending on which basis you choose, the corresponding control points may or may not provide a useful way of adjusting (i.e. controlling) the shape of the curve. For a basis to be useful in this way, it almost always will need to form a partition of unity. The Bernstein basis is the most commonly used one; in this case, the control points are called "Bezier" control points. Bases consisting of Lagrange polynomials are also fairly common, but the corresponding control points don't have any special name.
The extension to surfaces and volumes is straightforward. For tensor-product surfaces, you get two-dimensional arrays of control points.
So, in short, a set of "control points" is just the set of coefficients used to represent some given (vector valued) polynomial in some chosen basis.

A: Let a manifold be parameterized by $t = (t_1, \dots, t_n) \in \Bbb{R}^n$ and additionally the points $p_{i_1, \dots, i_n}, \ i_j = 1\dots m$.  Then the points $p_{\bar{i}}$ are the control points of the manifold.  There.  Making definitions can be easy when there's no desired properties.
Referring back to the wiki article, you could modify the above definition to make sure that the manifold always lies within the convex hull.
The term partitions of unity used in the article, I've seen defined in manifold and topology books, so their definition is pretty general in the sense that it uses other definitions that are for all practical purposes as general as they were required to be in general topology books.

A: Many families of shapes can be organized into a geometric object, where each point in the geometric object corresponds to a particular shape. For example, the family of all circles in the plane can be described by:

*

*Picking a point in the plane to be the center

*Picking a positive number to be the radius

We can combine this information together, and say that each specific circle corresponds to a point in $3$-space with positive $z$-coordinate.
Alternatively, we could use all of $3$-space rather if we let each point $(x,y,z)$ correspond to the circle with center $(x,y)$ and radius $e^z$.
In algebraic geometry, this notion is called a "moduli space". I don't think I've ever heard it given a name outside of algebraic geometry.
We could generalize a bit, and allow multiple points in the geometric object to correspond to the same shape. Then, we could represent a circle by a point in $(x,y,z,w)$ $4$-space such that $(x,y) \neq (z,w)$; the circle represented is the one with center $(x,y)$ and passing through $(z,w)$.
Of course, a point in $4$-space can be expressed as a pair of points in $2$-space, and they could be thought of as control points.
The use of control points really is mainly for the purposes of visualization, to let a person look at a shape and understand how moving the control points around would change the shape.


text:
Q: Unable to import dump file into oracle by SQL Developer in windows I encountered the ORA-31640 exception, unable to open dump file "C:\DATA_DUMP_DIR/20191103.DMP" for read. I think it's about the backslash issue which is on windows. Could you give some suggestion to solve this?
And I have created directory in the oracle.
Could you give some suggestions? thanks

A: Make sure the file is actually there and that the oracle OS user has read/write privileges on it. Also, please check filename's spelling.


text:
Q: Make TextField Active on Button Press Alright so I have a toolbar that I'm using as an accessory so it only appears when the keyboard appears. I have that bit working by doing this;
@IBOutlet var toolBar: UIToolbar!
@IBOutlet weak var playerInput: UITextField!

override func viewDidLoad() {
  super.viewDidLoad()

  playerInput.delegate = self
  playerInput.inputAccessoryView = toolBar
}

To test its working, I just make a temporary textField in the view somewhere, and connected it as playerInput. But that's not what my design calls for in the end. I need the textField to be ON the toolbar being used as the accessory and have a button on my navigation bar that selects the textField like the user touched it so it brings up the keyboard, toolbar, and has focus.
Is it possible to have my button function @IBAction func addButton(){} act like the user touched the textField, so it brings up the keyboard and shows the toolbar?
EDIT: When I add playerInput.becomeFirstResponder() to my button @IBAction function, nothing happens. Running this on my iPhone 6s or the iPhone Simulator, pressing the button does nothing. Adding a console print to make sure the button is working, works just fine so I know the button is working.
EDIT 2: Ok, so I have a very terrible workaround to get something to happen. I added a 2nd textField to the main view and made it hidden. Then set my toolbar accessory view to the new hidden textField. So when the button is pressed, it calls the hidden textField as first responder, which attaches the toolbar that has the real textField on it. Then the user can selected the real textField and save their entry properly. That's all working for now. The only problem is if the user dismisses the keyboard by swiping down, the beyboard will reappear once, forcing them to swipe it closed again.

A: Yes, you can achieve this with playerInput.becomeFirstResponder().


text:
Q: IE hiding text; should be simple... line-height issue? I have a menu with each item a different font-size/height -- looks fine in everything but IE which cuts the items in half...
Here's the HTML:

Ballroom Rocks LOGO

Home

The Show

Dancers

Creative Team

The Buzz

Corporate Events

Media

News

Blog

Contact

And the relevent CSS:
ul li {padding: 0; margin:0 0 2px 0; height: auto; line-height: auto; overflow: visible; display: block;vertical-align:top;}
ul li a{font-family: Impact; text-transform: uppercase; text-decoration: none; opacity: .25; color: white; margin:0; display: block; vertical-align: top; overflow: visible; line-height: auto;}
ul li a:hover, nav ul li a:hover, nav ul li a.active{color:#06c;opacity: 1;}

ul li a#nav-home{display: block; font-size:26px; height: 21px; line-height: 21px;}
ul li a#nav-theshow{display: block; font-size:27px; height: 21px; line-height: 21px; padding-top: 2px; }
ul li a#nav-dancers{display: block; font-size:35px; height: 26px; line-height: 26px; padding-top: 4px;}
ul li a#nav-cteam{display: block; font-size:26px; height: 23px; line-height: 23px;}
ul li a#nav-thebuzz{display: block; font-size:34px; height: 25px; padding-top: 3px;}
ul li a#nav-cevents{display: block; font-size:22px; height: 21px; }
ul li a#nav-media{display: block; font-size:46px; height: 30px; padding-top: 7px;}
ul li a#nav-news{display: block; font-size:34px; height: 24px; padding-top: 3px;}
ul li a#nav-blog{display: block; font-size:24px; height: 20px; padding-top: 1px;}
ul li a#nav-contact{display: block; font-size:28px; height: 23px; padding-top: 1px;}

And a link: http://www.mindsmack.com/clients/BallroomRocks/index.html
I've tried various versions and line-heights and padding... Any ideas what could be causing this?
(edit: problem was in IE7)

A: I cleaned up the css and got rid of the vertical-align and it works fine in ie7 now
header{position: absolute; left: 0; top: 0;}
header h1 a{display: block; width: 320px;background: url('../images/logo.jpg'); margin:0; text-indent: -9999px; padding: 0;}
ul{list-style-type: none; margin: 50px 0 0 70px; width: 250px;}
ul li {padding: 0; margin:0 0 2px 0; display: block;}
ul li a{font-family: Impact; text-transform: uppercase; text-decoration: none; opacity: .25; color: black; margin:0; display: block; line-height:.8em;}
ul li a:hover, nav ul li a:hover, nav ul li a.active{color:#06c;opacity: 1;}
ul li a#nav-home { font-size:26px; }
ul li a#nav-theshow { font-size:27px; }
ul li a#nav-dancers { font-size:35px; }
ul li a#nav-cteam { font-size:26px; }
ul li a#nav-thebuzz { font-size:34px; }
ul li a#nav-cevents { font-size:22px; }
ul li a#nav-media { font-size:46px; }
ul li a#nav-news { font-size:34px; }
ul li a#nav-blog { font-size:24px; }
ul li a#nav-contact { font-size:28px; }


text:
Q: get velue from query PERFORM 1 into temp FROM master_balance where externalkey = 'jknfl12j3' and tenant_record_id = '2' for update;1 I have function, inside the function running postgresql this query :
PERFORM 1 into temp FROM master where externalkey = 'jknfl12j3' and tenant = '2' for update;

Table structure master :
id     externalkey       tenant     balance
1       jknfl12j3          1          100

I want to get the balance, can i do that ? possible with temp.balance ?

A: You need to use select not perform. You also need to declare the variable to hold the balance:
...
declare
  l_balance numeric;
begin
  select balance
      into l_balance
  from master
  where ...
  for update;

  ... more code
end;


text:
Q: Excel is corrupted when Attaching it to MailMessage C# I created application that generates excel file from DataTable using EPPlus library. Then I add MemoryStream instance to Attachment. Program works fine, i receive email, but when I open file, i get an error "Excel cannot open file because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file".
I tried a lot of variants that have found in web but no one helped. May some one know how to fix this or another way how to send mailmassage with attachments.
 public void SendMail(DataTable dt)
        {
            using (MemoryStream outputStream = new MemoryStream())
            using (ExcelPackage pck = new ExcelPackage(outputStream))
            {
                ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Sheet");
                ws.Cells.LoadFromDataTable(dt, true);
                pck.Save();
                SmtpClient client = new SmtpClient("host");
                client.UseDefaultCredentials = false;
                client.Credentials = new NetworkCredential("usarename", "password");

                MailMessage message = new MailMessage("sender@gmail.com", "to@gmail.com");
                message.Body = "File in attachments";

                Attachment at = new Attachment(outputStream, "FileOutput.xls", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                message.Attachments.Add(at);
                message.Subject = "Test";
                client.Send(message);

            }
        }

A: Try reset the stream to the beginning before creating the attachment
outputStream.Seek(0,SeekOrigin.Begin);


text:
Q: Python Script to build URL with target="blank" I am attempting to build a URL - using Python 2.7 and have the following code:
link.append("" + ticketNumber[i] + "")

For some reason the resulting link on the display UI has everything up to "target=" and then nothing else. I know in the past with other languages there are escapes a double quote with \ or I have done something similar as the above by using single quotes. I'm thinking I must have something fudged up with the quotes during the build of the URL. What I'd like is something like:
Visit W3Schools.com!

as the final output. What am I doing wrong here? Thanks so much!

A: You forgot a closing quote on href, try:
link.append("" + ticketNumber[i] + "")

I'd also recommend swapping your use of single and double quotes, double quotes are standard for HTML.

A: You forgot ' which ends url in href.
You can use format() to make it more readable.
link.append('{}'.format(tableLink, sysID[i], ticketNumber[i]))

A: When first looking at this, there appears to be an extra single quote in your link.append(), next to href=.
If you want to have the double quotes in your output, I would suggest wrapping your strings in single quotes.  This seems to produce something close to the output you desire:
link.append('' + ticketNumber[i] + '')


text:
Q: May the cname-string part of an AS-REQ contain the domain? In a network capture between a Windows client and an Active Directory server, I see that the field cname-string contains user@domain.com (to be precise, it is the field as-req -> req-body -> cname -> cname-string -> CNameString).
According to RFC 4130 in Section 5.2.2.  Realm and PrincipalName:

name-string:
        This field encodes a sequence of components that form a name, each
        component encoded as a KerberosString.  Taken together, a
        PrincipalName and a Realm form a principal identifier.  Most
        PrincipalNames will have only a few components (typically one or
        two).

Also in Section 5.3.  Tickets:

cname
        This field contains the name part of the client's principal
        identifier.

To me, that means cname should only contain the username without the domain. The domain is obtained via the realm and together they form the principal identifier (basically paraphrasing the RFC here).
Am I wrong? Have you come across setups where the domain was part of the cname? How did the target service handle that? I see that the realm is added again to the cname, resulting user@domain.com@domain.com, which obviously prevents a correct matching.

A: There is at least one case when this can happen: enterprise principals. You should see the NT-ENTERPRISE somehwere as well as CANONICALIZE bit set. The AD contains an upnSuffix for the supplied enterprise principal. See also RFC 6806 for this.


text:
Q: is app approved by apple which is xc adhoc * dist profile selected while submiting app on appstore? I have selected xc adhoc * distribution profile while submitting app on app store. I think I should have select app specific distribution profile.
but now it waiting for review state. my question is it approved by apple or not?
or I need to resubmit app on iTunes.
Appreciate for help

A: Yes it will be rejected. This is strange that the automatic checks did not raise an issue.
App for App Store should be signed using an App Store Mobile Provision and a Distribution Certificate
You can find more information on Apple Documentation


text:
Q: Property of matrix determinants So, recently my tutor showed through a couple of examples that if you take $2$ matrices say $A_{\;3 \times 2}$ and $B _{\;2 \times 3}$ then we will either have $\det. (AB) =0$ or $\det . (BA)=0$ and then challenged us to prove it. I have tried and even saw a couple of videos on linear algebra but I am nowhere closer to figuring it out. He said that the only thing that needs to be ensured was that both $AB$ and $BA$ exist.
Any advice would be appreciated.

A: Hint The rank of a matrix product satisfies $$\operatorname{rank} (PQ) \leq \max \{\operatorname{rank} P, \operatorname{rank} Q\} .$$ If $A$ has size $m \times n$, $m \neq n$, and $B$ has size $n \times m$, what are the possible ranks of $A, B$, and what are the sizes of $AB, BA$?


text:
Q: C++: can't get std::tr1::unordered_map to compile I have the following code:
#include <string>
#include <iostream>

#include <tr1/unordered_map>

typedef std::tr1::unordered_map<unsigned long int,std::string> eoh_map;

...
int main() {
    eoh_map m;

    bool found = m.find(10) != m.end();
}
...

And the following error:
In file included from src/DeDuplicator_addon.cpp:29:0:
/usr/include/c++/4.5/tr1/unordered_map.h:37:19: error: expected type-specifier before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:37:19: error: expected '>' before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:42:24: error: expected template-name before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:42:24: error: expected '{' before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:42:24: error: expected unqualified-id before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:86:19: error: expected type-specifier before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:86:19: error: expected '>' before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:91:24: error: expected template-name before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:91:24: error: expected '{' before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:91:24: error: expected unqualified-id before '<' token
/usr/include/c++/4.5/tr1/unordered_map.h:141:28: error: wrong number of template arguments (6, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:41:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h:143:28: error: wrong number of template arguments (6, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:41:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h: In function 'void std::tr1::swap(int&, int&)':
/usr/include/c++/4.5/tr1/unordered_map.h:144:11: error: request for member 'swap' in '__x', which is of non-class type 'int'
/usr/include/c++/4.5/tr1/unordered_map.h: At global scope:
/usr/include/c++/4.5/tr1/unordered_map.h:150:28: error: wrong number of template arguments (6, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:90:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:152:28: error: wrong number of template arguments (6, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:90:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:152:34: error: redefinition of 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, bool __cache_hash_code> void std::tr1::swap(int&, int&)'
/usr/include/c++/4.5/tr1/unordered_map.h:143:34: error: 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, bool __cache_hash_code> void std::tr1::swap(int&, int&)' previously declared here
/usr/include/c++/4.5/tr1/unordered_map.h: In function 'void std::tr1::swap(int&, int&)':
/usr/include/c++/4.5/tr1/unordered_map.h:153:11: error: request for member 'swap' in '__x', which is of non-class type 'int'
/usr/include/c++/4.5/tr1/unordered_map.h: At global scope:
/usr/include/c++/4.5/tr1/unordered_map.h:175:19: error: expected type-specifier before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:175:19: error: expected '>' before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:179:48: error: '_Pred' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:179:55: error: '_Alloc' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:179:61: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:41:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h:181:49: error: '_Pred' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:181:56: error: '_Alloc' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:181:62: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:41:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h:184:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:185:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:186:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:187:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:188:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h: In constructor 'std::tr1::unordered_map<_Key, _Tp, _Hash>::unordered_map(std::tr1::unordered_map::size_type, const std::tr1::unordered_map::hasher&, const std::tr1::unordered_map::key_equal&, const std::tr1::unordered_map::allocator_type&)':
/usr/include/c++/4.5/tr1/unordered_map.h:195:9: error: 'typedef int std::tr1::unordered_map<_Key, _Tp, _Hash>::_Base' is not a non-static data member of 'std::tr1::unordered_map<_Key, _Tp, _Hash>'
/usr/include/c++/4.5/tr1/unordered_map.h: In constructor 'std::tr1::unordered_map<_Key, _Tp, _Hash>::unordered_map(_InputIterator, _InputIterator, std::tr1::unordered_map::size_type, const std::tr1::unordered_map::hasher&, const std::tr1::unordered_map::key_equal&, const std::tr1::unordered_map::allocator_type&)':
/usr/include/c++/4.5/tr1/unordered_map.h:204:4: error: 'typedef int std::tr1::unordered_map<_Key, _Tp, _Hash>::_Base' is not a non-static data member of 'std::tr1::unordered_map<_Key, _Tp, _Hash>'
/usr/include/c++/4.5/tr1/unordered_map.h: At global scope:
/usr/include/c++/4.5/tr1/unordered_map.h:227:19: error: expected type-specifier before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:227:19: error: expected '>' before 'hash'
/usr/include/c++/4.5/tr1/unordered_map.h:231:53: error: '_Pred' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:231:60: error: '_Alloc' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:231:66: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:90:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:233:54: error: '_Pred' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:233:61: error: '_Alloc' was not declared in this scope
/usr/include/c++/4.5/tr1/unordered_map.h:233:67: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:90:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::__unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:236:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:237:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:238:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:239:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:240:24: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h:253:16: error: '_Base' is not a class or namespace
/usr/include/c++/4.5/tr1/unordered_map.h: In constructor 'std::tr1::unordered_multimap<_Key, _Tp, _Hash>::unordered_multimap(std::tr1::unordered_multimap::size_type, const std::tr1::unordered_multimap::hasher&, const std::tr1::unordered_multimap::key_equal&, const std::tr1::unordered_multimap::allocator_type&)':
/usr/include/c++/4.5/tr1/unordered_map.h:247:9: error: 'typedef int std::tr1::unordered_multimap<_Key, _Tp, _Hash>::_Base' is not a non-static data member of 'std::tr1::unordered_multimap<_Key, _Tp, _Hash>'
/usr/include/c++/4.5/tr1/unordered_map.h: In constructor 'std::tr1::unordered_multimap<_Key, _Tp, _Hash>::unordered_multimap(_InputIterator, _InputIterator, int, const std::tr1::unordered_multimap::hasher&, const std::tr1::unordered_multimap::key_equal&, const std::tr1::unordered_multimap::allocator_type&)':
/usr/include/c++/4.5/tr1/unordered_map.h:257:4: error: 'typedef int std::tr1::unordered_multimap<_Key, _Tp, _Hash>::_Base' is not a non-static data member of 'std::tr1::unordered_multimap<_Key, _Tp, _Hash>'
/usr/include/c++/4.5/tr1/unordered_map.h: At global scope:
/usr/include/c++/4.5/tr1/unordered_map.h:264:55: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:178:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h:265:48: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:178:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::unordered_map'
/usr/include/c++/4.5/tr1/unordered_map.h: In function 'void std::tr1::swap(int&, int&)':
/usr/include/c++/4.5/tr1/unordered_map.h:266:11: error: request for member 'swap' in '__x', which is of non-class type 'int'
/usr/include/c++/4.5/tr1/unordered_map.h: At global scope:
/usr/include/c++/4.5/tr1/unordered_map.h:270:60: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:230:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:271:53: error: wrong number of template arguments (5, should be 3)
/usr/include/c++/4.5/tr1/unordered_map.h:230:11: error: provided for 'template<class _Key, class _Tp, class _Hash> class std::tr1::unordered_multimap'
/usr/include/c++/4.5/tr1/unordered_map.h:271:59: error: redefinition of 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> void std::tr1::swap(int&, int&)'
/usr/include/c++/4.5/tr1/unordered_map.h:265:54: error: 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> void std::tr1::swap(int&, int&)' previously declared here
/usr/include/c++/4.5/tr1/unordered_map.h: In function 'void std::tr1::swap(int&, int&)':
/usr/include/c++/4.5/tr1/unordered_map.h:272:11: error: request for member 'swap' in '__x', which is of non-class type 'int'
src/DeDuplicator_addon.cpp: At global scope:
src/DeDuplicator_addon.cpp:48:57: error: template argument 3 is invalid
src/DeDuplicator_addon.cpp:48:66: error: invalid type in declaration before ';' token

I'm using g++ 4.5.2 on Ubuntu.
Can someone help with this error?
Many thanks in advance,

A: std::tr1::unordered_map<…>::find() returns an iterator and not a bool. If you want to check if the entry was found, do:
bool found = m.find(10) != m.end();

A: try
bool result=m.find(10) != m.end()


text:
Q: NSRangeException exception in NSFetchedResultsChangeUpdate event of NSFetchedResultsController I have a UITableView that uses an NSFetchedResultsController as data source.
The core data store is updated in multiple background threads running in parallel (each thread using it's own NSManagedObjectContext).
The main thread observes the NSManagedObjectContextDidSaveNotification
notification and updates it's context with mergeChangesFromContextDidSaveNotification:.
Sometimes it happens that the NSFetchedResultsController sends an
NSFetchedResultsChangeUpdate event with an indexPath that does not exist
anymore at that point.
For example: The result set of the fetched results controller contains
1 section with 4 objects. The first object is deleted in one thread.
The last object is updated in a different thread. Then sometimes the
following happens:

*

*controllerWillChangeContent: is called.

*controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: is called with
type = NSFetchedResultsChangeDelete, indexPath.row = 0.

*controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: is called with
type = NSFetchedResultsChangeUpdate, indexPath.row = 3.

But the fetched results controller contains only 3 objects now, and if call
MyManagedObject *obj = [controller objectAtIndexPath:indexPath]

to update the table view cell according to the NSFetchedResultsChangeUpdate
event, this crashes with a NSRangeException exception.
Thank you for any help or ideas!

A: This is actually quite common because of the bug in Apple's boiler plate code for NSFetchedResultsControllerDelegate, which you get when you create a new master/detail project with Core Data enabled:
- (void)controller:(NSFetchedResultsController *)controller
    didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath
    forChangeType:(NSFetchedResultsChangeType)type
    newIndexPath:(NSIndexPath *)newIndexPath
{
    UITableView *tableView = self.tableView;

    switch(type) {

        case NSFetchedResultsChangeInsert:
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath]
                       withRowAnimation:UITableViewRowAnimationFade];
            break;

        case NSFetchedResultsChangeDelete:
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                       withRowAnimation:UITableViewRowAnimationFade];
            break;

        case NSFetchedResultsChangeUpdate:
            [self configureCell:[tableView cellForRowAtIndexPath:indexPath]
                  atIndexPath:indexPath];
            break;

        case NSFetchedResultsChangeMove:
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                       withRowAnimation:UITableViewRowAnimationFade];
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath]
                       withRowAnimation:UITableViewRowAnimationFade];
            break;
    }
}

Solution #1: Use anObject
Why query the fetched results controller and risk using an incorrect index path when the object is already given to you? Martin R recommends this solution as well.
Simply change the helper method configureCell:atIndexPath: from taking an index path to take in the actual object that was modified:
- (void)configureCell:(UITableViewCell *)cell withObject:(NSManagedObject *)object {
    cell.textLabel.text = [[object valueForKey:@"timeStamp"] description];
}

In cell for row, use:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
    [self configureCell:cell withObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];
    return cell;
}

Finally, in the update use:
case NSFetchedResultsChangeUpdate:
    [self configureCell:[tableView cellForRowAtIndexPath:indexPath]
             withObject:anObject];
    break;

Solution #2: Use newIndexPath
As of iOS 7.1, both indexPath and newIndexPath are passed in when a NSFetchedResultsChangeUpdate happens.
Simply keep the default implementation's usage of indexPath when calling cellForRowAtIndexPath, but change the second index path that is sent in to newIndexPath:
case NSFetchedResultsChangeUpdate:
    [self configureCell:[tableView cellForRowAtIndexPath:indexPath]
            atIndexPath:newIndexPath];
    break;

Solution #3: Reload rows at index path
Ole Begemann's solution is to reload the index paths. Replace the call to configure cell with a call to reload rows:
case NSFetchedResultsChangeUpdate:
    [tableView reloadRowsAtIndexPaths:@[indexPath]
                     withRowAnimation:UITableViewRowAnimationAutomatic];
    break;

There are two disadvantages with this method:

*

*By calling reload rows, it will call cellForRow, which in turn calls dequeueReusableCellWithIdentifier, which will reuse an existing cell, possibly getting rid of important state (e.g. if the cell is in the middle of being dragged a la Mailbox style).

*It will incorrectly try and reload a cell that isn't visible. In Apple's original code, cellForRowAtIndexPath: will return "nil if the cell is not visible or indexPath is out of range." Therefore it would be more correct to check with indexPathsForVisibleRows before calling reload rows.

Reproducing the bug

*

*Create a new master/detail project with core data in Xcode 6.4.

*Add a title attribute to the core data event object.

*Populate the table with several records (e.g. in viewDidLoad run this code)
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
for (NSInteger i = 0; i < 5; i++) {
    NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context];
    [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];
    [newManagedObject setValue:[@(i) stringValue] forKey:@"title"];
}
[context save:nil];

*Change configure cell to show the title attribute:
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
    NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath];
    cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@", [object valueForKey:@"timeStamp"], [object valueForKey:@"title"]];
}

*In addition to adding a record when the new button is tapped, update the last item (Note: this can be done before or after the item is created, but make sure to do it before save is called!):
// update the last item
NSArray *objects = [self.fetchedResultsController fetchedObjects];
NSManagedObject *lastObject = [objects lastObject];
[lastObject setValue:@"updated" forKey:@"title"];

*Run the app. You should see five items.

*Tap the new button. You will see that a new item is added to the top, and that the last item does not have the text "updated," even though it should have had it. If you force the cell to reload (e.g. by scrolling the cell off the screen), it will have the text "updated."

*Now implement one of the three solutions outlined above and in addition to an item being added, the last item's text will change to "updated."

A: I have now found a solution for my problem. In the case of an update event, there is no need to call
[self.controller objectAtIndexPath:indexPath]

because the updated object is already supplied as the anObject parameter to the -controller:didChangedObject:... delegate.
I have therefore replaced -configureCell:atIndexPath: by a -configureCell:withObject: method that uses the updated object directly. This seems to work without problems.
The code looks now like this:
- (void)configureCell:(UITableViewCell *)cell withObject:(MyManagedObject *)myObj
{
    cell.textLabel.text = myObj.name;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCellIdentifier"];
    [self configureCell:cell withObject:[self.controller objectAtIndexPath:indexPath]];
    return cell;
}

- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath
     forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath
{
    UITableView *tableView = self.tableView;

    switch(type) {
    /* ... */
    case NSFetchedResultsChangeUpdate:
        [self configureCell:[tableView cellForRowAtIndexPath:indexPath] withObject:anObject];
        break;
    /* ... */
    }
}