text:
Q: VSTO Excel add-in: reliable count of UDF calls in a worksheet? Is there a reliable way in code to count calls to UDFs within a worksheet/workbook? Also, what are the alternatives to be notified if UDFs get added/removed/modified?

A: The only reliable way I know of is to parse all the formulas looking for functions.  A function signature is always funcname immediately followed by ( Then you would have to eliminate built-in function if you just want UDFs
You can either build a custom UDF-only parser or start from a more generic one.
Usually for performance reasons you use usedRange.SpecialCells(xlCellTypeFormulas).FormulaR1C1 and eliminate duplicates before parsing.


text:
Q: value type reference type object in javascript Are javascript objects value based or reference based?  For example:
obj1.list =new array();
// ------ populate list
obj2.list = obj1.list

Does the browser make different copy of the obj1.list for obj2.list, or is obj2.list just a reference to obj1.list?

A: Forget all the low-level nonsense about "references" (which do not exist in JavaScript) and consider the simple rules outlined below. The term "object" is used to represent a specific value, which is not necessarily an "Object"; this does not change the rules, but rather reinforces the consistency.
1) An object is itself. If an object is mutable and if that object is mutated then that object has been mutated.
2) An assignment does not create a copy/clone/duplicate of an object. This includes values "assigned" to the parameters in function calls. The object is the value.
3) A variable (or property) is not an object, rather it is a name for an object (a pretty way to say "the variable evaluates to a given object"). A single object can have many "names" and yet it is the same object.
Everything else is an implementation detail -- references are not talked about in the specifcation at all. While, it should be noted that the primitive values such as number and string cannot have additional properties assigned (the assignment is ignored) while the wrapper Objects Number and String are full-fledged objects. This is consistent with the above rules: there are no mutable non-Object values in JavaScript. For the sake of discussing the JavaScript language the primitives values can be thought of as objects although they are completely immutable and are not really Objects.
Happy coding.

A: Javascript is based on reference semantics:
var a = [1,2,3];
var b = a;
a[0] = 42;
alert(b[0]); // will show 42
var c = a.slice(); // explicitly makes a copy
a[1] = 6502;
alert(c[1]); // will show 2, not 6502

A: Assignment makes a copy of the value only if it's a primitive type (like Number, Boolean, etc...).  Otherwise, assignment just copies a reference to the same object (Object, Array, etc...).  A new object is not created with assignment.
So, in your example:
obj1.list =new array();
// ------ populate list
obj2.list = obj1.list

obj2.push("foo");
alert(obj1.pop);    // "foo" (they are both the same list)

obj1.list and obj2.list will be pointing to the same object (contain references to the same object)

A: JavaScript Objects (and by extension: arrays, regexes, dates, non-primitive strings/numbers/booleans etc.) equality and assignment are reference based:
{a:'a'} == {a:'a'} // false

But:
var myObject = {a:'a'};
var myObject2 = myObject;

myObject == myObject2 // true

Furthermore:
myObject.b = 'b';

console.log(myObject2.b); // Logs: "b"

redpajama_set_name: RedPajamaStackExchange


text:
Q: Story about curing poverty by injecting the poor with nanotechnology? This was probably an Analog short story. Plot involved infecting the dregs of society with nanotech that gave them motivation and valuable skills. There was an essential ethical component to this story: if someone is miserable, is it moral to give them a viable path to happiness?
The cure worked. I don't remember the decade, but how long has nanotech been around? My guess would be sometime in the last century.

A: Hail, Columbia! by Arlan Andrews. Printed in Analog Science Fiction and Fact, August 1993

In "Hail, Columbia!" (1993) homeless people in a future Washington, D.C. arc given money coated with therapeutic nanodevices. Once absorbed through the skin those devices cure the recipients of any psychiatric or major physical ailments they may have, as well as improve their mental health by eliminating the emotional content of painful past memories.
Using Medicine in Science Fiction: The SF Writer's Guide to Human Biology


text:
Q: Chopped .css file in production I getting lopped (chopped) application.css file in production mode (only in browser, both in Chrome and Firefox).
http://198.211.125.210/

But the direct link shows the full compiled application.css file.
http://198.211.125.210/assets/application-371482c69e94141a6e3eedd72a8a066f.css

Why browser doesn't show full applcation.css file?
I use Nginx(1.2.7)+Unicorn(4.6.2)+Rails(3.2.12)+Capistrano(2.14.2).
My configuration:
nginx.conf
unicorn.rb
deploy.rb
Gemfile
There's no errors in production.log
nginx.error.log
$> cap deploy
application.css (development)
Thanks for help!

A: Solved it by server reinstall.


text:
Q: How to check status of pipeline B from Pipeline A I'm solving one problem with Azure Data Factory. I have two data factoy pipelines (for example A, B). Pipeline A is running every 5 minutes. Pipeline B is running every 24 hours (night load). I need to block the run of pipeline A if pipeline B is currently running. Is it possible to check the status of B pipeline, for example directly in the "If Condition" activity, in the A pipeline? Something like:
@DataFactory.Pipeline("B").Status

A: Based on the System variables supported by Azure Data Factory, status is not included in pipeline.
My idea is using Azure Function activity in your Pipeline B.
step 1: use Azure Function activity and follow this thread Disable activity in Azure Data factory pipeline without removing it to disable pipeline A.
step 2: do pipeline B
step 3:use Azure Function activity and follow this sdk to start pipeline A.

Just for summary here:
Finally,@milos did the pipeline concurrence run checking inside database (in etl scheme) which is working.


text:
Q: Utility jobs in Gitlab CI independent of the main pipeline I am coming from the background of Jenkins and Teamcity CI tools. In my new job we are looking into moving to Gitlab CI, since we already use it for other things and we don't have too many builds set up in Jenkins, so the move should not be too painful.
Gitlab CI seems well suited to the 'traditional' pipeline of Check > Test > Stage > Deploy > Monitor. However, we have some "utility" scripts in Jenkins which are in reality outside of the natural lifecycle. Those are usually standalone scripts to update dependencies/something, and instead of having to run them locally, a dedicated CI job is created to make it easier.
Is this possible in Gitlab CI? To have "the" pipeline and some "misc"/"util" jobs independent of that pipeline, but which work with the same repository? Is this something inconsistent with the Gitlab CI "philosophy"?

A: This should be possible once this issue is resolved: https://gitlab.com/gitlab-org/gitlab-ce/issues/24935
Currently aimed at Gitlab 11.10.


text:
Q: (Ubuntu Server 16.04) Slow sending smtp with attachment
Hi! I have postfix + dovecot
How to speed up the upload attachment file from smtp?
Inbox mail very fast and send mail without attachment very fast. Send with attachment very slow :(
Upload 20Mb = up 1 minute...


text:
Q: When should we be enforcing the affiliation requirement? The FAQ for this states:

Post good, relevant answers, and if some (but not all) happen to be about your product or website, so be it. However, you must disclose your affiliation in your answers.

I'm having trouble thinking of examples where enforcing an affiliation disclosure would benefit the answer. It seems to me that most people looking for an answer to their question won't really care if the person posting owns the website or product. The person just wants an answer. Not specifying their affiliation would make it look like any other answer, and that seems fair.
Considering answers that are just links aren't real answers, where do we draw the line on what needs to have an affiliation disclosed? Thinking of this nice line:

Link-Only Answers (Delete Them)
  .
  .
  .
  .
  .
  .
  .
  Detailed and Informative Answers that appropriately use their link as a reference

Where exactly does the "this answer needs affiliation disclosure" part fall? Can someone provide an example of where affiliation actually improves the content? I'd be interested to hear why people think it's so important that someone disclose their affiliation. Seems like if they follow the general rules for writing a good answer and providing a link as reference, it shouldn't really matter. So why are people so obsessed with users disclosing their affiliation?

A: I believe the community wants to avoid the addition of biased answers to maintain Q&A credibility - other sites may have been troubled by attempts of "astroturfing" by posters that don't share their affiliation.
While it's true that an answer is an answer, revealing one's monetary affiliation with a product that one is touting is a key component of integrity. It's one way for readers have sufficient data to do a fair evaluation of the benefits of the proposed solution versus other potential unaffiliated solutions.

A: To answer your strict question here: always.
Even if the answer is a great, informative one, the user should disclose their affiliation, so that the reader understands that the information does not come from a disinterested, third party. That knowledge can make a big difference in how one sees an answer.
The idea of a post being spam and needing to be wiped out is separate, though related. Astroturfing is itself 'spammy' largely because it is dishonest and promotional, even if it is marginally 'useful'. On the other hand, a properly attributed answer's spamminess can be weighed more on the content itself.

A: The "this answer needs affiliation disclosure" line is right before "Detailed and Informative Answers that appropriately use their link as a reference". Anything else should either become a detailed and informative answer or be removed.
However you do have a point, this isn't really about enforcing the affiliation requirement, most answers that would be removed because they didn't disclose their affiliation would probably also qualify as "not an answer" as well. And most people who take the time to write detailed and informative answers, almost never fail to disclose their affiliation. I think with good answerers is more a point of pride that their product solves the OP's problem than self-promotion.
If all of the above is true, it might seem that the requirement is useless. It's not, it's our "we don't like spam" notice in the FAQ. Who in their right mind likes spam? Well, spammers. What do we do with spammers? We usually destroy their accounts. And what if they come back and complain their account was wrongfully deleted? We got documentation to point to and tell them "tough luck, but you clicked the 'I agree' checkbox when you signed up, sucker".

A: Not specifying an affiliation makes it look like a neutral answer, affiliation means it's not neutral.  It might still be the best answer, but at that point you need to disclose.
So I'd say the point where you need to disclose is the point where you name a web site, book, product, training course, or whatever that you have some promotional interest in.  You don't have to make a big deal about it; a simple "Disclosure: I work for $company" at the bottom, or a clear reference like "my book $title", is sufficient.
The benefit to the answer is that the reader is fully informed of that potential bias.  Yes, there are other possible biases that don't get disclosed; it's not a perfect system and you still need to do your own review of the content.  But this removes that first hurdle, is easy to do, and does not impose an undue burden on posters.


text:
Q: how to add an event to my slider code How can I add an event to this code such that if i drag the slider, the number is displayed. Please, let me know as I am new to Java..
import javax.swing.*;

public class Slider extends JFrame {

    JSlider pickNum = new JSlider(JSlider.HORIZONTAL, 0, 30, 5);

    public Slider() {
        super("Slider");
        this.pack();
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        pickNum.setMajorTickSpacing(10);
        pickNum.setMinorTickSpacing(1);
        pickNum.setPaintTicks(true);
        pickNum.setPaintLabels(true);
        getPointedValue();
        this.add(pickNum);
        this.setVisible(true);
    }

    public final int getPointedValue() {
        int value;
        value = pickNum.getValue();
        return value;
    }

    public static void main(String[] args) {
        Slider frame = new Slider();
        int i;
        i = frame.getPointedValue();
        System.out.println("current value is:" + i);
    }
}

A: See addChangeListener(ChangeListener), as well as How to Use Sliders & How to Write a Change Listener.

A: As a concrete example using ChangeListener, SpinSlider shows how to connect a JSlider and a JSpinner.


text:
Q: How to create a dictionary with 2 arrays inside? I want to create a dictionary with the next structure, for sending it via Alamofire as JSON to a server:
{
    "user": {
        "firstName": "fName",
         "lastName": null,
         "img": null,
         "books": [
             {
                 "id": 1
             }, {
                 "id": 2
             }
         ]
    },

    "locale": "en",
    "gender": "male"
}

For this structure of JSON, I've tried the next:
let parameters: [[String: [String: String]], [String: String]]

but there a lot closures, so I confused with it. Can you help me with creating this structure?

A: The collection types in the Swift standard library only support homogenous collections, i.e. all elements in a collection must have the same type. So you cannot declare an array whose first element is of type [String: [String: String]] and whose second element is of type [String: String] if that is what you wanted.
This works:
let parameters = [
    "user": [
        "firstName": "fName",
        "lastName": NSNull(),
        "img": NSNull(),
        "books": [
            [ "id": 1],
            [ "id": 2]
        ]
    ],
    "locale": "en",
    "gender": "male"
]

The type of parameters is [String: NSObject] where NSObject is the superclass of all the values in the dictionary. Note the use of NSNull to model null values, which is what NSJSONSerialization expects.


text:
Q: Marvel protagonists whose actual names and aliases are the same Almost every superhero (and super-villain) has an alias which they go by like Tony Stark as Iron Man, Steve Rogers as Captain America, Otto Octavius as Doctor Octopus etc. However, there a quite a few people whose actual name and the aliases (alter-egos) are the same. Some of them include:

*

*Doctor Strange

*Thor, Loki (Asgardians)

*Jessica Jones

*Luke Cage (also goes by Power-man but Luke Cage is more prominent)

*Doctor Doom etc.

Are there any other characters (protagonists only) in the Marvel multi-verse who match this criteria?

A: Given that I'm not sure of what exact criteria you're looking for (especially: if there has never, ever been a change in the superhero/villain's alias), here's my list:

*

*Elektra, born Elektra Nachios, martial arts expert, leader of the Hand (sometimes), girlfriend of Daredevil (again, sometimes), etc, etc;

*Jean Grey, when not in Phoenix Form though. Agreed, she's also gone by Marvel Girl, but I think I've seen her referenced as "Jean Grey" more than "Marvel Girl";

*While we're on the mutants, it's worth mentioning Emma Frost, even though she went with White Queen at some point;

*pretty much all of the Guardians of the Galaxy: Gamora, Groot, Adam Warlock (formerly known as Him though), Rocket Raccoon... but okay, that's cheating :p

*EDIT: you mentioned Doctor Doom (who's technically Victor von Doom), so I think it's pretty fair that Baron Zemo (technically Helmut Zemo, or any of his ancestors who've beared the name) gets a pass.

A: A few more characters to add to the list:

*

*Mar-vell

*Nick Fury

*Maria Hill

*Black Bolt, in a way. That is short for his real name, Blackagar Boltagon

*Black Panther is a title of nobility, so depending on how you stretch it, it might be considered his name.

*Venom (the symbiont, not Eddie under it)


text:
Q: How to change Carbon's diffForHumans Formatting I'm trying to implement a comment section in my project and want to show how long ago the comment was posted.
So i did:
 {{ $comment->created_at->diffForHumans() }}

And the output was
  3 hours from now

But the output that i want is
3 hours ago

Am i missing something ? I'm doing this in laravel

A: You can use, this $comment->created_at->diffForHumans(null, true) to remove the ago,from now, etc then you can append the ago by yourself . So you'll end up with:
$comment->created_at->diffForHumans(null, true).' ago'

(NB: you may need to check why this does not work by default)
Ref: https://carbon.nesbot.com/docs/#api-humandiff

A: diffForHumans("null",true, true);
You need to pass like this so you will end up with
1 hour ago = 1h
25 minutes ago = 25 m


text:
Q: Simple-navigation: undefined local variable or method `root' I installed and configured simple-navigation as decribed here (simple-navigation configuration).
I modified config/navigation.rb (contains only one menu item):
primary.item :key_1, 'Home', root

My config/routes.rb contains:
root 'static_pages#home'

rake routes contains string:
    Prefix Verb   URI Pattern  Controller#Action
    root    GET   /            static_pages#home

app/views/layouts/application.html.erb contains:
<%= render "layouts/header" %>

app/views/layouts/_header.html.erb contains:
<%= render "layouts/main_nav" %>

and app/views/layouts/_main_nav.html.erb contains one string:
<%= render_navigation %>

After that I got an error:
Showing <...>_main_nav.html.erb where line #1 raised:
undefined local variable or method `root'

Why restful route helpers and named route helpers are "invisible" in this case? I tried all of the prefixes from the routes table.

A: The 3rd argument should be an URL or path, so change root to root_path in config/navigation.rb. Your menu item should look like:
primary.item :key_1, 'Home', root_path


text:
Q: How to have two patterns in re Say a have a list of words, and would like to go through each word to see if it matches a pattern "a?e", where ? can be any alphanumeric character.  Also, I would like to ignore words that contain '-' (a dash).  How do I do this using regex?
Here's what I currently have:
for word in words:
    found = re.findall(r'([a]\w{1}[e])(^((?!(-)).)*$)', word)
    if found:
        print(word)

For example:  ['snake', 'take', 'want', 'sane','1', 'snakke', 's-ake']
I would like to filter out: snake, take, sane
edited: sorry there was a mismatch with my question/code

A: You may use
r'(?i)\b(?<!-)\w*a[a-z]e\w*\b(?!-)'

See the regex demo.
Details

*

*(?i) - same as re.I, ignores case

*\b  - word boundary

*(?<!-) - no hyphen before the word boundary is allowed

*\w* - zero or more word chars  (if you want to only match letters, replace with [^\W\d_]*)

*a - an a letter

*[a-z] - any ASCII letter

*e - an e letter

*\w* - 0+ word chars (or use [^\W\d_]* as hinted above)

*\b - a word boundary

*(?!-) - not followed with a -.

A: Use match instead of findall.  match will match the whole string, while findall will look for substrings that match your regex.
found = (w for w in words if re.match(r'g\wo', word))


text:
Q: Updated file will not commit Many revisions back, a good file in my SVN repository was overwritten.  Revision 10, let's say, contains the file samplefile.txt in its desired form; the current revision is 30.
I update my working copy with the revision 10 samplefile.txt:
$ svn update -r 10 samplefile.txt

I confirm that my working copy of the file has this old but desired content in it.  Now, I want to commit this file to the repo, forming version 31.
$ svn commit -m "reverting file to 10" samplefile.txt

This never commits, however.  Executing the command returns me to the terminal prompt without the usual SVN output that confirms the new revision, and the updated file does not appear in the repository.
How do I commit this content using SVN commands?

A: You should run the following command in your working copy:
svn merge ^/trunk . -c-10

And commit this change:
svn commit -m "Revert changes made in r10"

Read SVNBook | Undoing Changes.

A: How svn merge Works
The svn merge command is used in several different ways, but fundamentally it always does two things in sequence: 1) create a diff by comparing two sources, and 2) apply that diff to a target.
The two sources and the target are specified by command-line arguments, though in many cases one or more arguments can be omitted if merge can determine implicitly what they're supposed to be.
In general, then, the command-line invocation has the form
$ svn merge [create diff] [apply to target]

In more detail,
1) [create diff]
svn merge compares source A and source B to create a diff, which is the set of instructions required to transform source A into source B.
The sources can be any element of the fileset: a trunk or branch, a directory subtree, or an individual file.  A source can be either an element of the working copy (in which case it's identified by its filepath) or an element of the repository proper (in which case it's identified by its repo URL).  A source can refer to any revision of the repository; if a revision isn't specified, the most recent revision (HEAD) is typically assumed.
2) [apply to target]
Once the diff is created, merge will then apply that set of instructions to the target.  The target must be an element of a working copy; the merge command is usually assumed to be executed from within this working copy.
Obviously, if the target is completely unrelated to the two sources used to create the diff, then you'll just get nonsense when the diff instructions are applied to it.  The target must also be the same "type of thing" as the two sources; that is, if the diff compares two branches or branch/trunk, then the target should also be either a branch or trunk.  If the two sources are files, then the target should be a file, and so on.
This is why merge commands must be constructed carefully.  Don't sweat it too much, though: since the target must be an element of your working copy, merge can only affect the working copy, not the repo.  As long as you don't commit without checking the result of the merge, it's easy enough to fix if you merge incorrectly.
Reverse merges
A "reverse merge" to revert a file is a form of cherry-pick merge, which takes two different revisions of a single element as its two sources.  Thus, we specify only one source name on the command line, accompanied by -r or -c flags to say which two revisions will be the sources.
The -r flag and its argument specify a revision, either as an absolute number N or as a range N:M.
The -c flag specifies the change made by a revision.  This is useful in some cases, but not in this one because the difference between the current file (rev 30) and the desired file (rev 10) spans many changes over 20 different revisions - I don't want to revert a single change, but as many as twenty!
In terms of my hypothetical samplefile.txt,
[create diff] = -r 10:30 <URL of repository>/path/to/samplefile.txt

produces the set of instructions that transforms samplefile.txt@10 to samplefile.txt@30.  That's not what I want, though - I want the opposite, the set of instructions that takes the current samplefile.txt@30 back to samplefile.txt@10.  This can be specified by reversing the rev numbers, i.e.
[create diff] = -r 30:10 <URL of repository>/path/to/samplefile.txt

This is what makes it a "reverse merge". (Note that the -r flag has nothing to do with the word "reverse".)
My target is the file samplefile.txt within my working copy, or
[apply to target] = WC_root/filepath/to/samplefile.txt

Since the diff is constructed to take samplefile.txt@30 -> samplefile.txt@10, the copy in my working copy must be the latest version (rev 30).  This is important to check, because I'd previously updated the file to rev 10 in an intuitive but for some reason futile attempt to commit that content back to the repository as revision 31.  So always be sure to update before executing a merge command.
Reverting a file using a reverse merge
Putting [create diff] and [apply to target] together, the command to revert samplefile.txt from its rev 30 content to its rev 10 content using a reverse merge is
$ svn update
$ svn merge -r 30:10 <URL of repository>/path/to/samplefile.txt WC_root/filepath/to/samplefile.txt

If everything checks out, and the current content of samplefile.txt is indeed that of revision 10, then I now commit to the repo:
$ svn commit -m "reverting file to rev 10" WC_root/filepath/to/samplefile.txt

to lock in the file reversion for the benefit of the other developers.
References:
The best general documentation I could find about how the merge command is defined is given in the SVN Book here:
Merge Syntax
The manual sections linked by @bahrep give several examples of how you might use merge to accomplish different tasks. (I can't repeat the links here because that puts me over the 2-link limit.)
And of course there's svn help merge, which will be much clearer after reading those links (and, hopefully, this answer).
Many thanks to @alroc and @bahrep for helping me sort this out!

A: Try this:
svn update samplefile.txt
svn cat -r 10 samplefile.txt > samplefile.txt
svn commit -m "reverting file to 10" samplefile.txt


text:
Q: Distribution of eigenvalue spacings I have been doing some experiments on classes of random matrices, and it seems (visually) that the distribution of eigenvalue spacings is consistent with GOE or GUE or GSE. Unfortunately, to test this, I would like to (a) be able to generate GOE/GUE/GSE spacing variates (I suppose I COULD generate very large Gaussian matrices and compute their eigenvalues, but this seems not very fast...), or even have some formula for the distribution function (there is the Wigner surmise, but it is not quite accurate). There are horrible-looking formulas in Mehta's book, but they don't seem usable, somehow. Algorithms/code must exist somewhere -- any pointers would be appreciated.

A: I suggest you to take a look at the paper "How to Generate Random Matrices from the Classical
Compact Groups" by F. Mezzadri, Notices AMS 54 (5), 592-604 (2007). Can be downloaded freely from here:
http://www.google.es/url?sa=t&source=web&cd=1&ved=0CBcQFjAA&url=http%3A%2F%2Fwww.ams.org%2Fnotices%2F200705%2Ffea-mezzadri-web.pdf&rct=j&q=How%20to%20Generate%20Random%20Matrices%20from%20the%20Classical%20Compact%20Groups&ei=W-BNTb6nFZaShAfS2bWTDw&usg=AFQjCNESHv00uIyATuY1NETwTfH5IO1fhQ&cad=rja

A: If 2% accuracy is sufficient, then you can just use Wigner's surmise. It is unlikely you will be able to beat that accuracy by generating random matrices and sampling the eigenvalue spacing. If higher accuracy is needed, you can find the spacing distribution by numerical integration of a Painleve differential equation, see Forrester & Witte arXiv:math-ph/0009023
A tabulated solution is in Haake's book "Quantum Signatures of Chaos", that is probably the easiest way to go.


text:
Q: Error "Cannot use object of type stdClass as array" when accessing a clearly existing, integer type data from Laravel Database query result I got my data from Laravel database query command:
$group = DB::table('groups')->where("id", $group_id)->first();

When I var dump my data, I get:
object(stdClass)#200 (7) {
  ["id"]=>
  int(1)
  ["levels_id"]=>
  int(1)
  ["title"]=>
  string(8) "Novice 1"
  ["description"]=>
  string(11) "Lorem Ipsum"
  ["max_question_display"]=>
  int(5)
  ["created_at"]=>
  NULL
  ["updated_at"]=>
  NULL
}

I want to access the max_question_display. But when I do:
var_dump($group["max_question_display"]);

PHP returns error Cannot use object of type stdClass as array.
When I do:
var_dump($group->max_question_display);

I get:
int(5)

But I don't want the int. I only want the 5. In integer form.
If I foreach loop the $group:
foreach ($group as $t) {
    echo "<pre>";
    var_dump($t);
    echo "</pre>";
}

I get each of the data as a single data each loop.
int(1)
int(1)
string(8) "Novice 1"
string(11) "Lorem Ipsum"
int(5)
NULL
NULL

This is obviously also not the way the result accessed that I'm looking for.
I also tried to get the first element of array, thinking that this might be an array with 1 element, but that also raise the same error.
I get it that the general answer in this site about this error is that "stdClass is not array". I have browsed several question with similar title like mine, but nothing address object that came from Laravel DB. When I read the manual on Laravel DB, I was assured that I can access the data returned like a simple dictionary / hashmap.
EDIT: Sorry, I understand my very, very newbie mistakes. No need to answer this. Thanks.

A: Notice the first line of your first var_dump:
object(stdClass)#200

Because you're dealing with an object, you access its properties with ->.  When you do:
var_dump($group->max_question_display);

The reason you see (int) in the output is that the var_dump function shows the value type, next to the value. To access the value, do
$group->max_question_display;

If you want to see it on screen without the type, use echo
echo $group->max_question_display; // 5

A: stdClass is an object. You cannot use an object with array syntax to access its properties, if the class does not implement ArrayAccess interface.
As pointed out by @IbrahimLawal , var_dump outputs both the type and value. Just echoing $group->max_question_display will provide just the value
echo $group->max_question_display; // 5

In Summary: You must  use arrow syntax when interacting with stdClass.


text:
Q: Pandas DataFrame contains NaNs after write operation Here is a minimum working example of my problem:
import pandas as pd

columns = pd.MultiIndex.from_product([['a', 'b', 'c'], range(2)])
a = pd.DataFrame(0.0, index=range(3),columns=columns, dtype='float')
b = pd.Series([13.0, 15.0])

a.loc[1,'b'] = b  # this line results in NaNs
a.loc[1,'b'] = b.values  # this yields correct behavior

Why is the first assignment incorrect? Both Series seem to have the same index, so I assume it should produce the correct result.
I am using pandas 0.17.0.

A: When you write
a.loc[1,'b'] = b

and b is a Series, the index of b has to exactly match the indexer generated by a.loc[1,'b'] in order for the values in b to be copied into a. It turns out, however, that when a.columns is a MultiIndex, the indexer for a.loc[1,'b'] is:
(Pdb) p new_ix
Index([(u'b', 0), (u'b', 1)], dtype='object')

whereas the index for b is
(Pdb) p ser.index
Int64Index([0, 1], dtype='int64')

They don't match, and therefore
(Pdb) p ser.index.equals(new_ix)
False

Since the values aren't aligned, the code branch you fall into assigns
(Pdb) p ser.reindex(new_ix).values
array([ nan,  nan])

I found this by adding pdb.set_trace() to your code:
import pandas as pd

columns = pd.MultiIndex.from_product([['a', 'b', 'c'], range(2)])
a = pd.DataFrame(0.0, index=range(3),columns=columns, dtype='float')
b = pd.Series([13.0, 15.0])
import pdb
pdb.set_trace()
a.loc[1,'b'] = b  # this line results in NaNs
a.loc[1,'b'] = b.values  # this yields correct behavior

and simply stepping through it at a "high level" and finding the problem occurs in
        if isinstance(value, ABCSeries):
            value = self._align_series(indexer, value)

and then stepping through it again (with a finer-toothed comb) with a break point starting at the line calling self._align_series(indexer, value).

Notice that if you change the index of b to also be a MultiIndex:
b = pd.Series([13.0, 15.0], index=pd.MultiIndex.from_product([['b'], [0,1]]))

then
import pandas as pd

columns = pd.MultiIndex.from_product([['a', 'b', 'c'], range(2)])
a = pd.DataFrame(0.0, index=range(3),columns=columns, dtype='float')
b = pd.Series([13.0, 15.0], index=pd.MultiIndex.from_product([['b'], [0,1]]))
a.loc[1,'b'] = b
print(a)

yields
   a      b      c
   0  1   0   1  0  1
0  0  0   0   0  0  0
1  0  0  13  15  0  0
2  0  0   0   0  0  0

A: You can directly assign b to a column in a, because b is not a multiindex Series. Changing b will make it work:
columns = pd.MultiIndex.from_product([['a', 'b', 'c'], range(2)])
a = pd.DataFrame(0.0, index=range(3),columns=columns, dtype='float')
index = pd.MultiIndex.from_product([['b'], range(2)])
b = pd.Series([13.0, 15.0], index=index)

a.loc[1,'b'] = b
print(a)

yields
   a      b      c
   0  1   0   1  0  1
0  0  0   0   0  0  0
1  0  0  13  15  0  0
2  0  0   0   0  0  0

The other case, where you use b.values, likely works because Pandas takes the values in b at face value, and tries to do the most logical assignment for the supplied values.


text:
Q: Excluding a particular IIS website from the web farm environment We have developed a website that uses In-Proc sessions, stores images uploaded from it on a folder inside its own virtual directory, and uses a third party tool that uses server side caching. This setup works just fine in a single server instance.
But the client has a web farm environment. When we deployed this site on client's web farm. Things started failing. Till now -

*

*we have enabled out-proc session, using SQL state management server

*we specified a machine key in the web.config of the server

But the other two, specially the third party tool, is proving difficult to crack.
Will it be possible to remove this one website from the web farm? excuse me if the question sounds naive but I am not a server administrator and not aware of its nitty-gritties

*

*Will it work if we just deactivate one of the websites?

*Can we deploy this website on one of the servers in the farm, but keep it outside the web farm's load balancing?

Is there any alternative, other than deploying the website on a completely different server?

A: Not sure on what vendor the balanacers are but the network admin should be able to setup a VIP (Virtual IP) that translates only to the once server in question.
That is a simple answer but there are many other variables in the network architecture that would have to be answered to accomplish this.  I suggest you contact the administrator of the load balancers and ask them if you can isolate traffic for the website to the specified server.


text:
Q: Stirling number of the second kind solution from another recurrence I have been trying to work out this strling number problem using some other recurrence which I had worked on before
$P_{n,k}=1 + P_{n-1,k-1}+ P_{n-1,k}$.
One solution was...
$$P_{n, k}=\sum_{j=1}^{k}{n \choose j} -->(1)$$
Now I'm trying to apply this solution to find a solution to Stirling number of the second kind recurrence( which I already found in Wiki)
$$S_{n,k}=S_{n-1,k-1} + kS_{n-1,k}->(2)$$
 like this.
$$P_{n,k}=1 + P_{n-1,k-1}+ P_{n-1,k}$$
$$=>kP_{n,k}=k + kP_{n-1,k-1}+ kP_{n-1,k}$$
$$=>kP_{n,k} - k= P_{n-1,k-1}+ (k-1)P_{n-1,k-1} + kP_{n-1,k}$$
$$=>kP_{n,k} - k - (k-1)P_{n-1,k-1}= P_{n-1,k-1} + kP_{n-1,k}$$
Now, the right hand side is exactly the right hand side of the Stirling recurrence from (1). But, substituting from (1) doesn't match the solution for
(2) which is
$$\frac{1}{k!}\sum_{j=0}^{k}(-1)^{k-j}{k \choose j}{j^n}$$
$$\ne{k}{\sum_{j=1}^{k}{n \choose j}} - (k-1)\sum_{j=1}^{k-1}{{n-1} \choose j}-k$$
So what's wrong? Thanks!


text:
Q: How can I solve Error with opening Studio App in Odoo? I have the following Problem, when beeing logged in as admin:

*

*I can access the Contacts Module and the records in it.

*When I try to open the Studio App in Contacts Modul nothing happens. It does not open.

*When I try to open a record after trying to open the Studio App I get the following Error:

Traceback (most recent call last):
  File "/home/secusmart/odoo15-prod/odoo/odoo/http.py", line 644, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/secusmart/odoo15-prod/odoo/odoo/http.py", line 302, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Element '<xpath expr="//field[@name='id']">' cannot be located in parent view

So the error only appears, when I first try to open the Studio App. Other wise I can open the records! And it only happens in this specific module.
I looked up which field is mentioned in the xpath expression and its technical name is "translate". But I can`t find the xpath expression in any view from res.partner model.
Has anyone a tip how I can find the mentioned xpath ?
Thanks

A: Error loaded Odoo Studio custom views don't lead to errors for normal users (anymore), because Odoo will just ignore them in this case. But opening studio itself on models views customized by studio, will always try to load those error loaded views. Unfortunately studio doesn't show any errors to the studio user.
What can you do? If you don't know the error, search for every studio view on the related model and archive them or try to look into them to find the error. You could also try the trial-and-error approach by commenting things out from the end of the view arch one after the other.
If you know the error, you have the possibility to search for views having the element named in the error message. But don't forget to replace HTML codes with real characters. Your example should be replaced by:
expr="//field[@name='id']"

Just search on the arch field in the search bar of the views. It's the last field and is labeled "View Architecture". In the end fix the error.


text:
Q: How to change web application settings via Powershell or SQL? Third-party tools like SharePoint Manager allow you to change settings on your web application. I need to toggle the LookupDropDownUseStandardControl from TRUE to FALSE, but SharePoint Manager is not working for some reason. I posted this to the SPM site back in  December, then reported it as an issue  in January. I haven't gotten a response yet, and the business unit needs me to find an alternate way of fixing this issue. The setting was flagged TRUE after an update and broke all of our complex lookup dropdowns.
Is there a way to apply this change via Powershell, or even in the database directly via SQL?
I also have access to Visual Studio, although I'm only an amateur developer at best.

A: Via PowerShell, this is simple.
$wa = Get-SPWebApplication https://webAppUrl
$wa.LookupDropDownUseStandardControl = $true | $false
$wa.Update()

Direct updates to SQL are wholly unsupported.
You'll use the SharePoint Management Shell on one of the SharePoint servers which is a member of the farm.
EDIT: Disregard the above. It can't be set!
public bool LookupDropDownUseStandardControl
{
    get =>
        true;
    set
    {
    }
}


text:
Q: Facebook-scraper UnexpectedResponse I want to scrape fanpage comment content so use this python package,but got something wrong
Here is my code
I think maybe proxy problem?so I take a free proxy,but it doesn't work
import requests
from http import cookiejar
import facebook_scraper as fb
file ='facebook.com_cookies.txt'
cookie = cookiejar.MozillaCookieJar()
cookie.load(file)
cookies =requests.utils.dict_from_cookiejar(cookie)
print(cookies)
fb.set_proxy('http://133.18.173.186:8080')
fb.set_cookies(cookies)

#post_url = ['https://www.facebook.com/animestory.animehk/photos/pcb.1035748480436588/1035747450436691/']
#for post in fb.get_posts('nintendo',options={'comments':True}):
#    print(post['text'][:50])

if I don't use facebook-scraper,how can i do?
I used to try selenium,but tag is so hard to catch.


text:
Q: Transforming equations How does $\;y = 2e^{3x} - 2e^{-3x} - 5e^{-3x}\;$ turn into $\quad y = 4\left(\dfrac{e^{3x} - e^{-3x}}{2}\right) - 5e^{-3x}\;$?
Specifically how does $$2e^{3x} - 2e^{-3x} = 4\left(\frac{e^{3x} - e^{-3x}}{2}\right)\quad ?$$
Thank you.

A: I think you might be making the problem more complicated than it really is. For example, if you "work backwards":
$$4\left(\frac{e^{3x} - e^{-3x}}{2}\right) = 2\left(e^{3x} -e^{-3x}\right) = 2e^{3x} - 2e^{-3x} $$
We simply simplified the fraction $4/2  = 2$ and multiplied through by $2$ (distributive rule).
So if we reverse directions and start from $\;\displaystyle (2e^{3x} - 2e^{-3x}) ,\;$ we essentially factor out $4$ from each term:
$$2e^{3x} - 2e^{-3x} = 2\left(e^{3x} - e^{-3x}\right) = \left(\frac{4\cdot \left(e^{3x} - e^{-3x}\right)}{2}\right) = 4\left(\frac{e^{3x} - e^{-3x}}{2}\right)$$


text:
Q: Zend Framework: Using Models and Views, best practices I'm relatively new to Object Oriented Programming. I pretty much understand the concepts, but practically speaking, I am having a really hard time finding information about how to best use Models in my Zend Framework applications.
Specifically, I have a Model (that doesn't extend anything) that doesn't use a Database Table. It uses getters and setters to access its protected members. I find myself struggling with how to best display this model in the view. I don't want logic in my view templates, but I find myself in the following situation:
In my controller:
$object = new Object();
$object->setName('Foo Bar');
$this->view->object = $object;

In my view template:

<?= $this->object->getName() ?>

I don't really like calling functions in my view templates but I don't know a better way to do this. I don't want my Model's members to be public, but I basically want to achieve the same results:

<?= $this->object->name ?>

I don't want my controller to do all the work of having to know everything about the model:
$object = new Object();
$object->setName('Foo Bar');
$this->view->object = $object;
$this->view->object->name = $object->getName();

What is the best practice of using models in the Zend Framework? Can anyone recommend any tutorial that would help me understand this Model/View dilemma in Zend Framework?

A: One possibility is to use the magic __set and __get methods in PHP. I use them like so within my abstract Model class:
abstract class Model_Abstract
{
    protected $_data;

    // Private Data Members assigned to protected $_data
    public function __construct($data = null)
    {
        // Makes it so that I can pass in an associative array as well as
        // an StdObject.
        if(!is_object($data)) {
            $data = (object) $data;
        }

        $this->_data = $data;

    }

    public function __get($key)
    {
        if (method_exists($this, '_get' . ucfirst($key))) {
            $method = '_get' . ucfirst($key);
            return $this->$method();
        }
        else {
            return $this->_data->$key;
        }
    }

    public function __set($key, $val)
    {
        if ( method_exists( $this, '_set' . ucfirst($key) ) ) {
            $method = '_set' . ucfirst($key);
            return $this->$method($val);
        }
        else {
            $this->_data->$key = $val;
            return $this->_data->$key;
        }
    }
}

class Model_User extends Model_Abstract
{
    //Example overriding method for the property firstName in the $_data collection.
    protected function _getFirstName()
    {
        // Do some special processing and then output the first name.
    }
}

This makes it so that you can specify getters and setters for properties as necessary but makes it so that you don't have to define boilerplate functions for every property, just the ones where you want to do some sort of processing on it before returning the value. For example I use the functionality in a number of places to change ISO compliant dates (as stored in MySQL) into a more compact and readable format for users.
As far as what to place in your controller, I would recommend looking at this post for some specific feedback on what handling to place within your controller.
Some feel that they would rather have a helper that automatically loads models into the view and skirts the controller altogether. Personally I would say that within the context of Zend Framework and PHP it makes plenty of sense to pass models into the view from the controller because the state of the models in the view frequently depends on what came from the request (which should definitely be handled in the controller).
Update: As per criticisms in the comments, one thing that I would point out is that your database access layer and domain (or model) layer are really two different things, though with the Active Record they are blended together. I asked this question a while back and received some useful feedback on this matter. Whatever you decide to do with the model, you'll want to provide a consistent API for all domain objects regardless of where the data for the model comes from.
I suppose that one benefit offered by Saem's answer is that it offers the ability to directly map properties / function return values from one or more domain objects to the view object. Theoretically the usage within the view then looks like this:
// Mapped from Model_User::_data->last_name and Model_User::_data->first_name
$this->name

A: If only other developers are going to be working with the templates, I would recommend just passing in the models. Here is a link to a Jeff Atwood post on MVC Understanding Model-View-Controller

A: This isn't particularly geared towards zend framework, but the problem is rather general, in my mind.
It seems you're on the right path, instead of hard wiring the model to the view, inside the controller. You'd rather have that abstract, especially important if you're mapping a tonne of models, or mapping the same model over and over again.
Something simple would be to write a bunch of mapping functions, which would be fine if all you were avoiding is mapping the same thing over and over.
If you wanted a more general solution, that also addressed avoid writing that boiler plate code, and keeping things more DRY, I suggest creating a mapper class.
You could create a ViewModelMapper, which would take a model, or a few models and map them to the view.
class ViewModelMapper
{
    public function __construct($view)
    {
        //set the properties
    }

    public function addModel($model, $overrideViewProperty = null)
    {
        //add the model to the list of models to map, use the view's property
        // name to figure out what to map it to? Allow for an override just in case.
    }

    public function getMappedView()
    {
        //take the view, map all the models
    }
}

You could then instance this on your controller, and setup the mappings, so the controller controls the mapping still, but all the boiler plate and coding logic is centralized, for all controller maps, except for the rare exceptions.

A: For a good read on model architecture, read this post. It doesn't specifically talk about the view, but it's definitely worth reading.
I ended up adding a getViewClass() function to my models. The controller calls this function to get the protected variables it wouldn't otherwise have access to, and the view doesn't have to worry about calling any getters.
//controller
$object = new Object();
$object->setName('Foo Bar');
$this->view->object = $object->getViewClass();

//view template

<?= $this->object->name ?>

I don't know if there is a better way to get the job done in the Zend Framework, but this is one solution.


text:
Q: Why was Vader surprised that Obi-Wan's body disappeared? OK, I understand that Obi-Wan turned into a force ghost when Vader struck him down, but why was Vader surprised by the lack of a body? It's not the transition into a force ghost but Vader's reaction that bugs me.

A: At the end of Revenge of the Sith (2005), Yoda talks to Obi-Wan Kenobi about meeting an old friend, his old master, Qui-Gon Jinn, who we know became a force ghost.

02:04:50 - Yoda: One who has returned from the netherworld of the Force.
02:04:53 - Yoda: Your old master.
02:04:56 - Obi-Wan: Qui-Gon?
02:05:00 - Yoda: How to commune with him I will teach you.

This is the first time, chronologically in the films, that the audience and any of the relevant main characters are introduced to the concept of force ghosts. Indeed Obi-Wan is surprised to hear about Qui-Gon in this scene.
Presumably, Anakin had also never heard of this concept of force ghosts before, or even if he did, at the very least could not fathom that Obi Wan could achieve such a feat. We can see from his reaction that he is unable to comprehend what just happened, he probably assumes that he defeated him, confused about the phenomena of the body disappearing, and later concludes that he died.
The following dialogue is from their lightsaber duel scene in Star Wars (1977).

01:27:08 - Ben: You can't win, Darth. If you strike me down...
01:27:12 - Ben: I shall become more powerful than you can possibly imagine.
01:27:22 - Vader: You should not have come back.

From Anakin's line (and his physical reaction, poking around the robes with his feet) there is evidence to suggest that he was, at least at the time, oblivious to the possibility of Obi-Wan becoming one with the force (turning into a force ghost).

A: He didn't understand what had happened
The knowledge of how to become a Force ghost was known to very few. Anakin certainly did not know it back during the Clone Wars era:

ANAKIN: Everything that we know about the Force tells us that an individual
  retaining their identity after death is impossible.
YODA: Everything that we know, yes.
  But what about what we know not? Hmm?
The Clone Wars: "Voices"

Qui-Gon learned it from the Force Priestesses, who had preserved this ancient art. Yoda learned it from Qui-Gon, with some help from the priestesses.

YODA: Now does my training begin?
PRIESTESS: The one you know as Qui-Gon Jinn will commune with you and
  guide your training. Like us, you shall learn to maintain your
  consciousness after death.
The Clone Wars : "Sacrifice"

If  even Yoda, Grand Master of the Jedi Order, was unaware of the possibility of becoming a Force ghost, surely Anakin, later Vader, also was. One might imagine that Palpatine might have told him, but Palpatine almost certainly was also unaware. Palpatine sought to cheat death, in the tradition of Darth Plagueis, but not by becoming a Force ghost: he wanted to make himself physically immortal and rule the temporal world. He wanted to control the midi-chlorians of life, not survive as a disembodied spirit and ultimately merge with the Cosmic Force. As Yoda says, after acquiring the knowledge of the Force Priestesses:

YODA: Yet, open to us, a path remains that unknown to the Sith is.
  Through this path, victory we may yet find. Not victory in the Clone
  Wars but victory for all time.
The Clone Wars: "Sacrifice"

Vader's behavior and words bear this out. He appears to be entirely unaware that Obi-Wan exists as a Force ghost, even as of The Empire Strikes Back. He believes that Obi-Wan can no longer help Luke, for example:

"He could destroy us," the Emperor croaks.
For a moment, Vader does not speak. When he does, his rich voice is
  slow and deliberate. "He is just a boy. Obi-Wan can no longer help
  him."
The Empire Strikes Back: So You Want to Be a Jedi?

He also claims that Obi-Wan was "destroyed" and that there is no life after death:

"Don't let yourself be destroyed, as Obi-Wan did."
Vader's black helm shimmers in the dim light of the reactor core. His
  cape sways softly, like silk, with each step he takes. "Do not believe
  the Jedi lies. There is no life after death. There is only death."
  Behind his mask, he is smiling. He must be.
The Empire Strikes Back: So You Want to Be a Jedi?

In particular, as Sith, both Vader and Palpatine believed that the Jedi belief in life after death (even as part of the Force) was mistaken. They didn't even believe that one could become one with the Force, let alone retain one's identity.

SITH: We are the Sith.
YODA: Afraid of you I am not.
SITH: We shall
  see. There is no life after death. Only nothingness awaits you, Jedi.
  Your fear feeds
  our hunger for power.
  They will know you are here.
  We will tell them.
  You will die
  and be nothing.
The Clone Wars: "Sacrifice"

Now, what did he think had happened? It's not clear. Probably he could sense through the Force that Obi-Wan was no longer there, so he did not believe that he had, for example, turned invisible. He was surely too arrogant to believe that Obi-Wan had, as he suggested, become "more powerful than [he] could possibly imagine" (nor would he have understood what that meant, even if he credited it). Perhaps he believed that Obi-Wan had used some trick to destroy himself, committing suicide rather than let Darth Vader kill him.

One might recall that Qui-Gon Jinn appeared to Anakin in the Mortis arc of The Clone Wars, and wonder why this hadn't convinced him of the possibility of survival as a Force spirit. In that same arc, though, the Son, a powerful entity of the Dark Side, had appeared to him in the form of his deceased mother, Shmi Skywalker! He (and even Ahsoka and Obi-Wan) would have had ample reason to suspect that the vision of Qui-Gon was simply the Son, Daughter, or Father appearing in a different form for their own goals. Even without this sort of thing going on, many Jedi suspected that Qui-Gon was a trick of the Sith when Yoda heard him.


text:
Q: How to describe or visualize a multiple linear regression model I'm trying to fit a multiple linear regression model to my data with couple of input parameters, say 3.
\begin{align}
F(x) &= Ax_1 + Bx_2 + Cx_3 + d  \tag{i}  \\
&\text{or}  \\
F(x) &= (A\ B\ C)^T (x_1\ x_2\ x_3) + d  \tag{ii}
\end{align}
How do I explain and visualize this model?  I could think of the following options:

*

*Mention the regression equation as described in $(i)$ (coefficients, constant) along with standard deviation and then a residual error plot to show the accuracy of this model.

*Pairwise plots of independent and dependent variables, like this:

*Once the coefficients are known, can the data points used to obtain equation $(i)$ be condensed to their real values. That is, the training data have new values, in the form $x$ instead of $x_1$, $x_2$, $x_3$, $\ldots$ where each of independent variable is multiplied by its respective coefficient.  Then this simplified version can be visually shown as a simple regression as this:

I'm confused on this in spite of going through appropriate material on this topic. Can someone please explain to me how to "explain" a multiple linear regression model and how to visually show it.

A: My favorite way of showing the results of a basic multiple linear regression is to first fit the model to normalized (continuous) variables. That is, z-transform the $X$s by subtracting the mean and dividing by the standard deviation, then fit the model and estimate the parameters. When the variables are transformed in this way, the estimated coefficients are 'standardized' to have unit $\Delta Y/\Delta sd(X)$. In this way, the distance the coefficients are from zero ranks their relative 'importance' and their CI gives the precision. I think it sums up the relationships rather well and offers a lot more information than the coefficients and p.values on their natural and often disparate numerical scales. An example is below:

EDIT: Another possibility is to use an 'added variable plot' (i.e. plot the partial regressions). This gives another perspective in that it shows the bivariate relations between $Y$ and $X_i$ AFTER THE OTHER VARIABLES ARE ACCOUNTED FOR. For example, the partial regressions of $Y \sim X_1 + X_2 + X_3$ would give bivariate relations between $X_i$ against the residuals of $Y$ after regressing against the other two terms. You would go on to do this for each variable. Function avPlots() from library car gives these plots from a fitted lm object. An example is below:

A: Since they all have to do with explaining the contributors for cirrhosis, have you tried doing a bubble/circle chart and use color to indicate the different regressors and circle radius to indicate relative impact upon cirrhosis?
I'm referring here to a Google chart type that looks like this:
And on an unrelated note, unless I'm reading your plots wrong, I think you have some redundant regressors in there. Wine is already a liquor so if those two are separate regressors it doesn't make sense to keep both of them, if your goal is to explain the incidence of cirrhosis.

A: The visualization you show in 3 (scatter diagram of actual value against predicted value) is a good one. It can be used for any regressor. In this case, the example you show helps confirm the assumption of linearity, since the points are scattered above and below the line throughout the range.
Another assumption you have made is a lack of interaction among the factors. If you want to test that, then a good visualization is a scatter diagram of x_i against x_j, where the points are coloured by the size of the error in the prediction. Pairwise interactions among the xs will be revealed by patterns in the colours.

A: @gregory_britten 's answer was exactly what I was looking for.  I figured I would share my implementation in python using pandas, matplotlib, and statsmodels.
X_norm = X4.copy() # This is a pd.Dataframe of the independent variables
X_norm = (X_norm - X_norm.mean()) / X_norm.std()
res_norm = sm.OLS(y_log, sm.add_constant(X_norm)).fit()

to_include = res_norm.params[res_norm.pvalues < 0.05][1:].sort_values() # get only those with significant pvalues
fig, ax = plt.subplots(figsize=(5,6), dpi=100)
ax.scatter(to_include, range(len(to_include)), color="#1a9988", zorder=2)
ax.set_yticks(range(len(to_include)), to_include.index) # label the y axis with the ind. variable names
ax.set_xlabel("Proportional Effect")
ax.set_title("Strength of Relationships")

# add the confidence interval error bars
for idx, ci in enumerate(res_norm.conf_int().loc[to_include.index].iterrows()):
    ax.hlines(idx, ci[1][0], ci[1][1], color="#eb5600", zorder=1, linewidth=3)

plt.axline((0,0), (0,1), color="#eb5600", linestyle="--") # add a dashed line at 0.0


text:
Q: Dynamically Insert Links In Span Tag Using Javascript (around anchor text) On a html page I have:
See More

And I should process it using javascript to get this (create link out of text):
See More

Never mind 0 I figure out that it works well. My bad, sorry.
function changespan() {
var spans = document.querySelectorAll('span.image');
for (var i = spans.length; i--; ) {
    var a = document.createElement('a');
    a.href = "http://domain.com";
    spans[i].appendChild(a).appendChild(a.previousSibling);
}
}

Let me know what is appendChild(a) and .appendChild(a.previousSibling)?
Here is the demo: http://jsfiddle.net/8eK7z/1/


text:
Q: Nvidia GeForce Experience possible on Ubuntu? (13.10) New to Ubuntu and wondering if anyone else has been able to install Nvidia GeForce Experience on their ubuntu. (Preferably without WINE).
http://www.geforce.com/geforce-experience
I haven't been able to find any documentation on the internet about it, and haven't yet acquired the technical skills to figure it out by myself unfortunately.
Any help would be appreciated.
I have a GTX 660 if that information is at all relevant.

A: One of the best features about geforce experience is that it makes updating the drivers easy (as well as detecting the video card). I would be happy to see something in Ubuntu that when run, detected any Nvidia cards, worked out what drivers were needed, downloaded them and installed them. At the moment the Nvidia drivers are a pain in Ubuntu, if they could get this all working and stable, that would rock!

A: All the features offered by Geforce Experience are designed exclusively for Windows.
Since it deals with hardware drivers and settings for Windows-only games, there also is no need for it on Ubuntu.

A: It is now possible to compile a version of OBS with NVENC to use your graphic card to encode what OBS record : just download this script script link and run the following command ./install_ffmpeg-nvenc_obs.shin your download folder and that will install you OBS with NVENC support OBS-NVENC.png called OBS-PORTABLE


text:
Q: Auto Line Break Math Equations Preface
First, I would like to say that this question is not the same as this question. This question has some additional constrainsts.
The question
I am writing some long equations in my LaTeX document, and I want to have some line breaks in them. And I want them to be added automatically because I have a lot of equations already. For example, look at this equation:

It practically goes out of the page! I would like the effect to be like this:

Constraints

*

*I don't want the breqn package to be involved. The package messes around with LaTeX math too much. For example, it makes the equal signs shorter. Plus it is known to have many compatibility issues.

*The equation number (or "the tag") should be in the bottom line (there can be a line break before it).

*It must be compatible the the mtpro2 package.

*(This isn't a must.) All the code should be only added to the preamble. (Because as mentioned before, there are a lot of equations in my document already.)

MWE
Here is the code that is used to produce the equation in the first picture.
\documentclass[fleqn]{article}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
    \lipsum[1-1]
    \begin{align}
        \nonumber T(n) &= c_1n + c_2(n-1) + c_4(n-1) + c_5\left(\frac{n(n-1)}{2} - 1\right) + c_6\left(\frac{n(n-1)}{2}\right) + c_7\left(\frac{n (n-1)}{2}\right) + c_8(n-1) \\
        &= \left(\frac{c_5}{2} + \frac{c_6}{2} + \frac{c_7}{2}\right)n^2 + \left(c_1 + c_2 + c_4 + \frac{c_5}{2} - \frac{c_6}{2} - \frac{c_7}{2} + c_8\right)n - (c_2 + c_4 + c_5 + c_8)\;\text{.}
    \end{align}
    \lipsum[1-1]
\end{document}


text:
Q: No keyboard entries possible in gitpod.io terminal I want to use gitpod.io as IDE. This works great with Firefox on Linux. But on my Android Tablet (Android 4.2.2) I am not able to write in the terminal window (tried Firefox and Chrome). Only the Enter-key is accepted. Writing into files is no problem.
Has anyone an idea what may lock the keyboard?

A: This sounds like a bug in Theia IDE or Gitpod.
Gitpod has a public bug tracker. I have reported it there.


text:
Q: How to update phone number in DocuSign programmatically I am working on a site using Docusign for signing contracts, the problem is if the user changed his phone number in his personal information in the site, the phone number does not change in Docusign when the user get sms verification it remains the old phone number:
The result should be if the user changed the phone number in his personal information and then he or she want to sign his contract his new phone number should be there in the sms verification (DoscuSign)
I wrote the following code but I am getting the following problem :'Person' object is not iterable.
I have a file called DocuSign service:
    def get_recipients(self, signers: List[Dict]) -> Recipients:
    recipients = []
    for signer in signers:
        recipient = Signer(
            email=signer["email"],
            name=signer["name"],
            recipient_id=signer["recipient_id"],
            client_user_id=signer["client_user_id"],
            routing_order=signer["routing_order"],
            id_check_configuration_name="SMS Auth $",
            sms_authentication={"senderProvidedNumbers": [signer["phone_number"]]},
        )
        sign_here = SignHere(
            anchor_string=f"Please Sign {signer['anchor_string']}",
            anchor_units="pixels",
            anchor_y_offset="10",
            anchor_x_offset="20",
            recipient_id=signer["recipient_id"],
        )
        place_signed = Text(
            anchor_string=f"PlaceSigned{signer['anchor_string']}",
            required=True,
            tab_label=f"PlaceSigned{signer['anchor_string']}",
        )
        date_signed = DateSigned(
            anchor_string=f"DateSigned{signer['anchor_string']}",
        )
        full_name = FullName(
            anchor_string=f"FullName{signer['anchor_string']}",
        )
        recipient.tabs = Tabs(
            sign_here_tabs=[sign_here],
            text_tabs=[place_signed],
            date_signed_tabs=[date_signed],
            full_name_tabs=[full_name],
        )
        recipients.append(recipient)
    return Recipients(signers=recipients)

def update_recipients(self, contract, signers: List[Dict]):
    """
    Update the information of the signers for the contract.
    """
    api_client = self._create_api_client()
    envelope_api = EnvelopesApi(api_client)
    recipients = self.get_recipients(signers=signers)
    return envelope_api.update_recipients(
        account_id=self._ACCOUNT_ID,
        envelope_id=str(contract.envelope_id),
        recipients=recipients,
    )

in the views of the contract I have this code:
@action(methods=["GET"], detail=True, url_path="sign", permission_classes=[IsEmployerOrLandlord])
def sign_contract(self, request, pk):
    contract = self.get_object()
    signing_person = request.user.person
    ds = DocuSignService()
    ds.update_recipients(contract=contract, signers=signing_person)

    if contract.envelope_id:
        status = ContractStatusUtil().get_and_set_employer_rental_contract_status(contract)

        if signing_person.employer_id:
            if status is ContractStatusChoices.TO_BE_SIGNED_SECOND_PARTY or status is ContractStatusChoices.SIGNED:
                return Response(data={'detail': 'Contract already signed.'}, status=httpstatus.HTTP_226_IM_USED)
        elif signing_person.lessor:
            if status is ContractStatusChoices.SIGNED:
                return Response(data={'detail': 'Contract already signed.'}, status=httpstatus.HTTP_226_IM_USED)
    else:
        envelope = ds.create_envelope(contract=contract, signing_person=signing_person)
        contract.envelope_id = envelope.envelope_id
        contract.signer = signing_person
        contract.save()

        logger.info("SigningContract - envelop " + str(envelope) + " created for signing_person" + str(signing_person))

    signer_index = 0 if request.user.person.employer_id else 1
    util = RecipientViewUtil()
    logger.info("SigningContract - returning response for docusign service for " + str(contract) +
                ", signing_person " + str(signing_person))
    return Response(
        data={"signing_url": util.get_signing_url(contract=contract, signer_index=signer_index,
                                                               signing_person=signing_person)},
        status=httpstatus.HTTP_200_OK)

Can someone help me please and check my code. Thanks in advance.

A: This code is using the older method to obtain phone authentication and may not allow you to update the phone number as you need to have it in the code.
The newer method is like this (in Python):
    signerPhoneNumber = RecipientPhoneNumber(
        country_code=args["country_code"],
        number=args["phone_number"]
    )

    # Create the signer recipient model
    signer1 = Signer(
        name=args["signer_name"],
        recipient_id="1",
        routing_order="1",
        phone_number=signerPhoneNumber
    )

You can update the phone number by calling this endpoint to modify the recipients of the envelope and send a new phone number.


text:
Q: link helpers, current_pages and navigation I'm trying keep a tab on a page to be selected by checking the controller.
I.e., any page that displays the Products controller should keep the Product tab selected.
I can't seem to find the right approach.
I was considering of making a helper method, but it seems a bit tricky to put the helper into my link_to helper. Here is my guess of how I can make it work:
<%= link_to "Products", products_path, current_controller?('products') ? :class => 'selected' %>

Anyone has a better idea?

A: And the problem wont just be in one place, you'll have many tabs and each tabs will have rules on which controllers+action combinations it would be active/selected for.
It's a common problems and some people have written "plugins" for the same too.
I suggest you write helpers. Make your own mini DSL. Decide for yourself what is easy and nice to look at:
<%= link_to_tab_for("Products", products_path, :controller => "sss", :action => "", :other_html_options => {})

Next step, implement this method in helpers/application.rb
def link_to_tab_for(name, path, options)
  controller = options.delete(:controller)
  action = options.delete(:controller)
  klass = [].push(options[:class]).compact
  if current_controller?(controller) && (action ? current_action?(action) : true)
    klass.push("selected")
  end
  options[:class] = klass.empty ? "" : klass.join(" ")
  link_to(name, path, options)
end

Have a gander at attempting the above method to your liking of course.


text:
Q: How to retrieve all post and its corrensponding comments How to select all post and its corrensponding comments and commentor. Here's my database example:
Person:  ID (primary key), Name
Post:    PID (primary key), Pcontent, ID (foreign key to Person)
Comment: CID (primary key), Ccontent, PID (foreign key to Post)

And the user's ID is 1. How to get the post, commentor of the post and its comment with an ID 1?

A: Here is a generic SQL statement (we do not know which database product you're working with, so any specifics would be lost here) -
SELECT `Post`.`Pcontent`, `Person`.`Name`, `Comment`.`Ccontent`
FROM `Post`
LEFT JOIN `Person`
ON `Post`.`ID` = `Person`.`ID`
LEFT JOIN `Comment`
ON `Post`.`PID` = `Comment`.`PID`
WHERE `Person`.`ID` = 1

This will get all posts by where user ID is '1' and will get all comments associated with each post.


text:
Q: Multiplex scp copies Using scp only is there a way to copy multiple files at the same time? I have two 40G folders on a RHEL box that I want to copy over to my ESXi box. Rsync is out of option and scp is the only thing available.
If I use:
scp /files root@esx:/vmfs/volumes/storage

It will copy File_1 40G first and then once this finishes, it will start to copy File_2
I want to initiate both the 40G copy at the same time. I tried:
scp /file1 root@esx:/vmfs/volumes/storage && scp /file2 root@esxi:/vmfs/volume/storage

Still no go. One way I am using now is tar.zip the two folders and then moving them over. And then untar on the destination. Not efficient though.
Any thoughts? Thanks much

A: Execute both process parallel in the background and wait for both to finish:
($(scp /file1 root@esx:/vmfs/volumes/storage) &); ($(scp /file2 root@esxi:/vmfs/volume/storage) &);


text:
Q: Vue v-html directive does not run
A: You won't be able to use v-html for this because the directive simply sets an element's innerHTML, which does not execute <script> tags.
AFAIK, the only other option is to append to the document a <script> with the intended source, so perhaps you could create an API to fetch the scripts separate from the markup, then inject them into the document:
export default {
  mounted() {
    fetch('http://localhost:8090/api/js/response')
        .then(response => {
          return response.json();
        })
        .then(scriptUrls => {
          for (const url of scriptUrls) {
            const scriptEl = document.createElement('script');
            scriptEl.src = url;
            document.body.appendChild(scriptEl);
          }
        })
}


text:
Q: From a list of dicts, return the list of dicts but only with specific key/value pairs For example, I would originally have a list of dicts like so:
[
  {
    "userId": 1,
    "id": 1,
    "title": "sunt aut facere rep",
    "body": "quia et suscipit"
  },
  {
    "userId": 1,
    "id": 2,
    "title": "qui est esse",
    "body": "est rerum tempore vita"
  },
  {
    "userId": 1,
    "id": 3,
    "title": "ea molestias quasi"
  }
]

If i had a list for example like ['id', 'body'], I would want my new list of dicts to be:
[
  {
    "id": 1,
    "body": "quia et suscipit"
  },
  {
    "id": 2,
    "body": "est rerum tempore vita"
  },
  {
    "id": 3
  }
]

A: dict_list = [
  {
    "userId": 1,
    "id": 1,
    "title": "sunt aut facere rep",
    "body": "quia et suscipit"
  },
  {
    "userId": 1,
    "id": 2,
    "title": "qui est esse",
    "body": "est rerum tempore vita"
  },
  {
    "userId": 1,
    "id": 3,
    "title": "ea molestias quasi"
  }
]

keys = ['id', 'body']

result = [{k: d[k] for k in keys if k in d} for d in dict_list]

print(result)
>>> [{'body': 'quia et suscipit', 'id': 1},
     {'body': 'est rerum tempore vita', 'id': 2},
     {'id': 3}]

The line that does the trick is result = [{k: d[k] for k in keys if k in d} for d in dict_list]. This is a list comprehension that creates a dict for every dict in dict_list, keeping only the keys in the keys list.

A: just rebuild the dicts in the list using dict comprehension and filtering of keys:
result = [{k:v for k,v in d.items() if k in ["id","body"]} for d in dlist]

print(result)

outputs:
[{'body': 'quia et suscipit', 'id': 1}, {'body': 'est rerum tempore vita', 'id': 2}, {'id': 3}]

A: list_of_dicts = [
  {
    "userId": 1,
    "id": 1,
    "title": "sunt aut facere rep",
    "body": "quia et suscipit"
  },
  {
    "userId": 1,
    "id": 2,
    "title": "qui est esse",
    "body": "est rerum tempore vita"
  },
  {
    "userId": 1,
    "id": 3,
    "title": "ea molestias quasi"
  }
]
item = "body"  # Item to be searched for
for i in list_of_dicts:
    print(i)
    if item in i:
        print("yes")
    else:
        print("no")

you can replace print with any action, and add/change to 'item'

A: Use list comprehension to rebuild the dict:
new_dict= [{"id":i["id"], "body":i["body"]} for i in d]


text:
Q: How to use window.location.replace in jquery or javascript I have a website for which I have implemented livechat, when user clicks on livechat link it opens a new window that is fine. I want to do is when no operator is online then it should not open a new window when livechat link clicked instead it should redirect to the contact us page of the website in the same window in the currently opened tab, Is it possible?
I do not know how is it possible, what I have tried is this , it redirects to this page but opens in a new window.
window.location.replace('http://mywebsite.com/index.php?route=information/contact');

A: The problem is somewhere in the code around that. You need to call that code in the old window.
If you want to call it in the chat window, try:
window.opener.location.replace('http://mywebsite.com/index.php?route=information/contact');
window.close()

A: Use the href property instead:
window.location.href = 'http://mywebsite.com/index.php?route=information/contact';

A: You can use simple javascript code like this: window.location.href = "SOME URL"
it will do the same think.            .


text: Q: Как обновить (пересчитать значение) скроллбар в SPA-приложении Имеется SPA-приложение на Backbone+Marionette. При рендере в регион CollectionView с большим количеством элементов на странице появляется скроллбар. После того, как количество элементов коллекции меняется в меньшую сторону, то высота страницы уменьшается, но скроллбар остается таким же, образуя под страницей лишнее пустое место. Подскажите, как можно средствами нативного JS или JQuery заставить страницу пересчитать высоту и изменить скроллбар?


text:
Q: Xcode debugger can't catch exception if finally block returns I discovered weird behavior of Xcode.
Xcode debugger doesn't break for uncaught exception in this code.
@try            { @throw @"AA"; }
@catch (...)    { @throw;       }
@finally        { return;       }

But exception in this code caught and trigger Xcode break execution for debugging.
@try            { @throw @"AA"; }
@catch (...)    { @throw;       }
@finally        {               }

If @finally block returns debugger can't catch the exception. Have you ever seen this problem? I'm not sure this is really an issue. By the perspective it looks like designed behavior. I don't know why. Shouldn't I return in @finally block? My problem is it swallows exception silently, so I can't detect it.
Shame on me, I don't know well try...catch...finally behaviors. I almost haven't used exception catching code. Is this designed behavior or buggy behavior? Is this any known issue?
Here's my environment.

*

*Xcode Version 4.4 (4F250)

*OS X 10.7.4

Edit
I attach full test source code.
#import <Foundation/Foundation.h>

int main (int a, char** b)
{
    @try
    {
        NSLog(@"trying something...");

        @try            { @throw @"AA"; }
        @catch (...)    { @throw;       }
        @finally        { return 0;     }
    }
    @catch (...)
    {
        NSLog(@"something catched.");
    }
    @finally
    {
        NSLog(@"finally...");
    }
}

A: Putting a return in a @finally block seems like a bad idea. The exception handling mechanism is going to try to unwind the call stack as it deals with the exception you're throwing. If a @finally block changes what's on the stack, you undermine the exception handler. It doesn't seem at all surprising that this crashes.
Also, as bbum pointed out, exceptions aren't used for flow control in Cocoa and Cocoa Touch. Throwing an exception through a Cocoa method usually fails. Even if what you're doing is supposed to work in generic Objective-C, it would probably still cause problems in real code.
Short answer: Don't do that.


text:
Q: How to detect whether a file is modified in iOS? How to detect whether a file is modified in iOS?
I don't mean the real-time monitoring, because while the application is gone, it won't detect anymore.
I've checked the attributes of the file, and couldn't find the satisfied one.(Did I miss something?)
There maybe some check-sum generating solutions, but they will require much time.
(Is there any cheap check-sum generating algorithm?)

A: You can use stat (reference), to get the modification time of the file.  You could then compare it against your stored value:
struct stat sb;
if (stat("/path/to/file", &sb) == 0)
{
    ... compare sb.st_mtimespec with stored value

}
else
{
    ... report error
}

This question is pretty close to yours.

A: Which attributes did you check? With fstat(), you should be able to compare the st_mtime attribute of a file with a previously stored value.


text:
Q: Multi-Statement Table Valued Function with Table Variables I might just need assistance with the best type of procedure to use to get what i want but here is what i am trying to do.
I need to return a table which is derived from multiple table variables the catch is that i need to call this table from outside of SQL so cannot use the Table Variables directly. So I have tried using table-valued functions. If there is a way to do all this in a view without using table variables to start with then even better but I cannot figure out a way to do that.
So ideally i would like a single SELECT statement that is called from outside SQL that pulls the results back from the following statement.
SELECT        Master.id, Master.SPName, DashCopyName, SRECopyName, TapeCopyName, DRCopyName

FROM            @Master AS Master LEFT OUTER JOIN
                     @TapeCopy AS TapeCopy ON Master.SPName = TapeCopy.SPName AND Master.id = TapeCopy.id LEFT OUTER JOIN
                     @DRCopy AS DRCopy ON Master.SPName = DRCopy.SPName AND Master.id = DRCopy.id LEFT OUTER JOIN
                     @SRECopy AS SRECopy ON Master.SPName = SRECopy.SPName AND Master.id = SRECopy.id LEFT OUTER JOIN
                     @DashCopy AS DashCopy ON Master.SPName = DashCopy.SPName AND Master.id = DashCopy.id
                     WHERE Master.id = @sp

So here is the entire table-valued function i have so far:
ALTER FUNCTION StoragePolicyCopies(@sp int)
RETURNS @ReturnTable TABLE (
id int,
SPName char(30),
DashCopyName char(50),
SRECopyName char(50),
TapeCopyName char(50),
DRCopyName char(50)
)
AS
BEGIN
DECLARE @DashCopy TABLE (
SPName char(30),
DashCopyName char(50),
id int)
INSERT INTO @DashCopy (SPName, DashCopyName, id)
SELECT        archGroup.name AS SPName, archGroupCopy_Dash.name AS DashCopyName, archGroup.id
FROM            commserv.dbo.archGroup AS archGroup LEFT OUTER JOIN
                     commserv.dbo.archGroupCopy AS archGroupCopy_Dash ON archGroup.id = archGroupCopy_Dash.archGroupId
WHERE        (archGroupCopy_Dash.name LIKE '%_Dash_Copy%') AND (archGroup.name NOT LIKE '%Global%')

DECLARE @DRCopy TABLE (
SPName char(30),
DRCopyName char(50),
id int)
INSERT INTO @DRCopy (SPName, DRCopyName, id)
SELECT        archGroup.name AS SPName, archGroupCopy_Dash.name AS DRCopyName, archGroup.id
FROM            commserv.dbo.archGroup AS archGroup LEFT OUTER JOIN
                     commserv.dbo.archGroupCopy AS archGroupCopy_Dash ON archGroup.id = archGroupCopy_Dash.archGroupId
WHERE        (archGroupCopy_Dash.name LIKE '%_DR%') AND (archGroup.name NOT LIKE '%Global%')

DECLARE @SRECopy TABLE (
SPName char(30),
SRECopyName char(50),
id int)
INSERT INTO @SRECopy (SPName, SRECopyName, id)
SELECT        archGroup.name AS SPName, archGroupCopy_Dash.name AS SRECopyName, archGroup.id
FROM            commserv.dbo.archGroup AS archGroup LEFT OUTER JOIN
            commserv.dbo.archGroupCopy AS archGroupCopy_Dash ON archGroup.id = archGroupCopy_Dash.archGroupId
WHERE        (archGroupCopy_Dash.name LIKE '%_Recover%') AND (archGroup.name NOT LIKE '%Global%')

DECLARE @TapeCopy TABLE (
SPName char(30),
TapeCopyName char(50),
id int)
INSERT INTO @TapeCopy (SPName, TapeCopyName, id)
SELECT        archGroup.name AS SPName, archGroupCopy_Dash.name AS TapeCopyName, archGroup.id
FROM            commserv.dbo.archGroup AS archGroup LEFT OUTER JOIN
            commserv.dbo.archGroupCopy AS archGroupCopy_Dash ON archGroup.id = archGroupCopy_Dash.archGroupId
WHERE        (archGroupCopy_Dash.name LIKE '%_Monthly_Tape%') AND (archGroup.name NOT LIKE '%Global%')

DECLARE @Master TABLE (
SPName char(30),
id int)
INSERT INTO @Master (SPName, id)
SELECT        name AS SPName, id
FROM            commserv.dbo.archGroup AS archGroup
WHERE        flags = 36 AND name NOT LIKE '%SEED%' AND name NOT LIKE '%ICO%'

INSERT INTO @ReturnTable
SELECT        Master.id, Master.SPName, DashCopyName, SRECopyName, TapeCopyName, DRCopyName
FROM            @Master AS Master LEFT OUTER JOIN
                     @TapeCopy AS TapeCopy ON Master.SPName = TapeCopy.SPName AND Master.id = TapeCopy.id LEFT OUTER JOIN
                     @DRCopy AS DRCopy ON Master.SPName = DRCopy.SPName AND Master.id = DRCopy.id LEFT OUTER JOIN
                     @SRECopy AS SRECopy ON Master.SPName = SRECopy.SPName AND Master.id = SRECopy.id LEFT OUTER JOIN
                     @DashCopy AS DashCopy ON Master.SPName = DashCopy.SPName AND Master.id = DashCopy.id
                     WHERE Master.id = @sp
RETURN
END
GO

The call i make is:
USE [CommServ]
GO
SELECT * FROM [dbo].[StoragePolicyCopies] (5)
GO

A: Just as a quick shot. You can replace the complete function to one single SELECT using a CTE.
;WITH DashCopy AS(
    SELECT archGroup.name AS SPName, archGroupCopy_Dash.name AS DashCopyName, archGroup.id
    FROM commserv.dbo.archGroup AS archGroup
    LEFT OUTER JOIN commserv.dbo.archGroupCopy AS archGroupCopy_Dash
        ON archGroup.id = archGroupCopy_Dash.archGroupId
    WHERE (archGroupCopy_Dash.name LIKE '%_Dash_Copy%') AND (archGroup.name NOT LIKE '%Global%')
), DRCopy AS(
    SELECT archGroup.name AS SPName, archGroupCopy_Dash.name AS DRCopyName, archGroup.id
    FROM commserv.dbo.archGroup AS archGroup
    LEFT OUTER JOIN commserv.dbo.archGroupCopy AS archGroupCopy_Dash
        ON archGroup.id = archGroupCopy_Dash.archGroupId
    WHERE (archGroupCopy_Dash.name LIKE '%_DR%') AND (archGroup.name NOT LIKE '%Global%')
), SRECopy AS(
    SELECT archGroup.name AS SPName, archGroupCopy_Dash.name AS SRECopyName, archGroup.id
    FROM commserv.dbo.archGroup AS archGroup
    LEFT OUTER JOIN commserv.dbo.archGroupCopy AS archGroupCopy_Dash
        ON archGroup.id = archGroupCopy_Dash.archGroupId
    WHERE (archGroupCopy_Dash.name LIKE '%_Recover%') AND (archGroup.name NOT LIKE '%Global%')
), TapeCopy AS(
    SELECT archGroup.name AS SPName, archGroupCopy_Dash.name AS TapeCopyName, archGroup.id
    FROM commserv.dbo.archGroup AS archGroup
    LEFT OUTER JOIN commserv.dbo.archGroupCopy AS archGroupCopy_Dash
        ON archGroup.id = archGroupCopy_Dash.archGroupId
    WHERE (archGroupCopy_Dash.name LIKE '%_Monthly_Tape%') AND (archGroup.name NOT LIKE '%Global%')
), Master AS(
    SELECT name AS SPName, id
    FROM commserv.dbo.archGroup AS archGroup
    WHERE flags = 36 AND name NOT LIKE '%SEED%' AND name NOT LIKE '%ICO%'
)
SELECT        Master.id, Master.SPName, DashCopyName, SRECopyName, TapeCopyName, DRCopyName
FROM            Master
LEFT OUTER JOIN TapeCopy
    ON Master.SPName = TapeCopy.SPName AND Master.id = TapeCopy.id
LEFT OUTER JOIN DRCopy
    ON Master.SPName = DRCopy.SPName AND Master.id = DRCopy.id
LEFT OUTER JOIN SRECopy
    ON Master.SPName = SRECopy.SPName AND Master.id = SRECopy.id
LEFT OUTER JOIN DashCopy
    ON Master.SPName = DashCopy.SPName AND Master.id = DashCopy.id
WHERE Master.id = 5

It should do exactly the same.
But by the way, if it's possible for you and if your tables are a bit bigger. I would suggest to convert it in a procedure with multiple steps.
I hope this will help you.


text:
Q: Chrome Browser extensions development I have been creating a google chrome browser extension I have been trying to find out how to get the URL of the current tab. after doing a bunch of research I came up with this small code that should print the current URL in the console here is the code.
chrome.tabs.getCurrent()
{
 console.log(tab.url);
}
But it does not work
by the way, this code should run when the user clicks on the extension icon


text:
Q: CRASH gmscore::vector::GMSMarkupPolygonInstance::CreateEntities I have not been able to reproduce this crash myself ever but occasionally I see (on crashlytics) user getting this. I feel the frequency of crashing has increased with GoogleMaps version 3.3.0. I am getting this crash for iOS 12 and above.
Crashed: com.apple.main-thread
0  Someapp                        0x101027058 gmscore::vector::GMSMarkupPolygonInstance::CreateEntities(gmscore::base::reffed_ptr<gmscore::vector::Camera> const&, gmscore::renderer::EntityRenderer*, id<GMSEntityResources>, gmscore::renderer::ProxySortedRenderBin<std::__1::tuple<unsigned int, unsigned long, unsigned int, gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> >, gmscore::renderer::ProxySortedRenderBin::less<gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> > >*, gmscore::renderer::Behavior*, char const* const&) + 311748
1  Someapp                        0x101027044 gmscore::vector::GMSMarkupPolygonInstance::CreateEntities(gmscore::base::reffed_ptr<gmscore::vector::Camera> const&, gmscore::renderer::EntityRenderer*, id<GMSEntityResources>, gmscore::renderer::ProxySortedRenderBin<std::__1::tuple<unsigned int, unsigned long, unsigned int, gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> >, gmscore::renderer::ProxySortedRenderBin::less<gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> > >*, gmscore::renderer::Behavior*, char const* const&) + 311728
2  Someapp                        0x101021c90 gmscore::vector::GMSMarkupMultiZoomLinesInstance::UpdateEntities(float, gmscore::base::reffed_ptr<gmscore::vector::Camera>, gmscore::renderer::EntityRenderer*, id<GMSEntityResources>, gmscore::renderer::ProxySortedRenderBin<std::__1::tuple<unsigned int, unsigned long, unsigned int, gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> >, gmscore::renderer::ProxySortedRenderBin::less<gmscore::base::reffed_ptr<gmscore::renderer::BaseEntity> > >*, gmscore::renderer::Behavior*, char const* const&) + 290300
3  Someapp                        0x10101bb94 gmscore::vector::GMSMarkupBehavior::UpdateInstanceMap(std::__1::map<unsigned long, gmscore::base::reffed_ptr<gmscore::vector::GMSMarkupInstance>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, gmscore::base::reffed_ptr<gmscore::vector::GMSMarkupInstance> > > > const&, gmscore::renderer::EntityRenderer*, bool) + 265472
4  Someapp                        0x10101b428 gmscore::vector::GMSMarkupBehavior::Commit(gmscore::renderer::EntityRenderer*) + 263572
5  Someapp                        0x100efa9e8 gmscore::renderer::EntityRenderer::Draw(bool) + 400
6  Someapp                        0x100f9ded4 -[GMSPhoenixRenderer drawForced:] + 6452
7  Someapp                        0x100f80bc8 -[GMSEntityRendererView draw] + 518060
8  Someapp                        0x100f7f224 -[GMSEntityRendererView displayLinkFired:] + 511496
9  Someapp                        0x100f7de10 -[GMSDisplayLink displayLinkFired:] + 506356
10 QuartzCore                     0x1f9308f90 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 636
11 QuartzCore                     0x1f93d2b10 display_timer_callback(__CFMachPort*, void*, long, void*) + 272
12 CoreFoundation                 0x1f4eeca8c __CFMachPortPerform + 188
13 CoreFoundation                 0x1f4f13690 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
14 CoreFoundation                 0x1f4f12ddc __CFRunLoopDoSource1 + 440
15 CoreFoundation                 0x1f4f0dc00 __CFRunLoopRun + 2096
16 CoreFoundation                 0x1f4f0d0b0 CFRunLoopRunSpecific + 436
17 GraphicsServices               0x1f710d79c GSEventRunModal + 104
18 UIKitCore                      0x221887978 UIApplicationMain + 212
19 Someapp                        0x100511850 main + 16 (TripResultViewController+Validation.swift:16)
20 libdyld.dylib                  0x1f49d28e0 start + 4

A: I am facing the same issue but in iOS 13 devices with GoogleMaps 3.7.0 pod.
The error only appears the first time I open the app (after installing it), but the rest of the executions are working well, maybe this give u some clues about the crash.
There is an open issue for de maps-sdk-for-ios that it's worth to keep an eye on it, because it seems to be related to a bug in the SDK:
issue tracker link
I hope this information helps to solve the problem or at least to throw some light on it ...

A: The issue was originally reported here: https://github.com/googlemaps/google-maps-ios-utils/issues/236
In our app we use Google Map SDK and I can reproduce this issue by zooming in on the map to the max (starting with version 3.3.0)
I reported it here: https://issuetracker.google.com/issues/148238890


text:
Q: lvalue required as unary '&' operand -- passing function result as pointer
I have some problem with my code.
There are the following functions:
static Poly PolyFromCoeff(int coeff);
static Mono MonoFromPoly(const Poly *p, int exp);

And in another function I have this line:
Mono m = MonoFromPoly(&PolyFromCoeff(10),4);

But I receive this error message:

lvalue required as unary '&' operand

If I save the first result to a variable, there is no error:
Poly p = PolyFromCoeff(10);
Mono m = MonoFromPoly(&p,4);

Why is the first solution wrong?

A: As it says, operator & requires a lvalue as its argument, i.e. it cannot be applied to temporary values. Addresses are not associated with values, with objects only.
In the second form you instantiate an object that holds this value and you can easily take the address of that object.

A: The C language expressly prohibits you from taking the address of a rvalue (which is what a function returns).  This clause from the C11 standard (committee draft) sums it up:

6.5.3.2 Address and indirection operators
Constraints

*

*The operand of the unary & operator shall be either a function designator, the result of a
  [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is
  not declared with the register storage-class specifier.

If you are confused about lvalue and rvalue, think of it like this:

*

*lvalue is something that has an identifier and storage

*rvalue is a temporary result or literal value

If you have a C++ background, you might have been confused because the behavior of references is different.  In C++, it's okay to have this:
static Poly PolyFromCoeff(int coeff);
static Mono MonoFromPoly(const Poly &p, int exp);

Mono m = MonoFromPoly( PolyFromCoeff(10), 4 );