text:
Q: How do I get twilio to call the agent to connect them to callers in the queue? From the twilio documentation and tutorial an agent would have no idea that someone was in the queue, so this only works if there is always someone in the queue and agents just sit there and field calls all day.
Objective:
When someone calls I would like to connect the call to the agent. If the agent isn't available, add the caller to a queue. If a second or third person calls, keep adding them to the queue. When the agent finishes their first call and hangs up, let the next in line call and actually ring the agent's phone to speak with the agent.
I'm really new to twilio so this twiml is bad and I already know this doesn't work, but here's what I'm trying so far:
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Enqueue waitUrl="contactagent.php">myqueue</Enqueue>
</Response>

contactagent.php:
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('../callapp/Services/Twilio.php'); // Loads the library

$sid = "(MYID)";
$token = "(MyToken)";
$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create($_REQUEST['the caller that's in the queue'], "(the agent's phone number)", "connectagent.xml", array());
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<Response>
   <Say>Your are number ".$_REQUEST['QueuePosition']." in line for a representative.</Say>
   <Play>http://com.twilio.sounds.music.s3.amazonaws.com/MARKOVICHAMP-Borghestral.mp3</Play>
</Response>"
?>

connectAgent.xml
<?xml version='1.0' encoding='utf-8' ?>
<Response>
   <Dial>myqueue</Dial>
</Response>

A: I think you should put all of your client calls to the queue (no matter first client or not). Do it using Enqueue. That is good then.
Next, you need to initiate a call to an agent.
You can instruct Twilio to call agent's phone number. In that instruction define a callback url "dial_agent_callback" and a status callback url "dial_agent_status_callback".
Once the "dial_agent_callback" callback occurs (indicating that agent has picked up), you instruct Twilio to dial your queue:
<Response>
   <Dial>
      <Queue url="dial_queue_callback">
         myqueue
      </Queue>
   </Dial>
<Response>

You can know when an agent has finished talking to a client in a dial_queue_status_callback (or if agent has not picked up, or if any problems occurred). The callback Status will indicate what has happened.
Finally, you need to figure out when to trigger calls to the agent.
I suggest triggering an event when a client call occurs. Call your next available agent, if there is one. In case there are more clients than agents you can check the Queue Size using Twilio API. Then you can trigger a new call to an agent when a new agent joins, or when a busy agent finishes handling client call.
I hope that helps.


text:
Q: Share value between variables is not working in Angular I'm implementing a search box by Angular 5. I have a component for the search box and another component for search result. When I pass the value through input element to the variable 'v' in search.component.html, It updates the 'v' in search-result.component.ts, so {{v}} in html shows the value that I entered.
To filter the array, I am taking 'v' to 'term' and do the filter function. But, after loading the page, It is only showing the {{v}} value and Not showing the {{term}} and {{filterarray}}
What is the wrong here?
search.component.ts
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { error } from 'util';

@Component({
  selector: 'app-search',
  templateUrl: './search.component.html',
  styleUrls: ['./search.component.css']
})
export class SearchComponent implements OnInit {

  title = 'app';

  v: string;

  @Output() valueEvent = new EventEmitter<string>();

  constructor(){}

  sendValue(){
    this.valueEvent.emit(this.v)
  }

  ngOnInit()
  }
}

saerch.component.html:
<input type="text" [(ngModel)]="v"><button (click)="sendValue()">Search</button>

saerch-result.component.ts:
import { Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-search-result',
  templateUrl: './search-result.component.html',
  styleUrls: ['./search-result.component.css']
})
export class SearchResultComponent{

 v: string;

 term: string = this.v;

 array: any[]=[{'id':1,'name':'Jones'},{'id':2,'name':'Duke'},{'id':3,'name':'Frank'},{'id':4,'name':'Jonas'}];
  filterarray: any[];

  constructor(){

    this.filterarray=this.array.filter(f => f.name.includes(this.term)).map(searchname=>searchname.name);

  }

   receiveValue($event){
    this.v = $event
    }
}

search-result.component.html:
<app-search (valueEvent)="receiveValue($event)"></app-search>

{{v}}

{{term}}

{{filterarray}}

A: You need to move this line:
this.filterarray=this.array.filter(f => f.name.includes(this.term)).map(searchname=>searchname.name);
To inside:
receiveValue($event){
   this.v = $event
}

So something like this:
receiveValue($event){
       this.v = $event
       this.filterarray=this.array.filter(f => f.name.includes(this.term)).map(searchname=>searchname.name);
    }

That way every time the user hits search button the array will be updated.

A: You need to move filter and also assign value to inside receiveValue method
like this,
 v: string;

  term: string;

  array: any[] = [{ 'id': 1, 'name': 'Jones' }, { 'id': 2, 'name': 'Duke' }, { 'id': 3, 'name': 'Frank' }, { 'id': 4, 'name': 'Jonas' }];
  filterarray: any[];

  constructor() { }

  receiveValue(event) {
    this.v = event;
    this.term = this.v;
    this.filterarray = this.array.filter(f => f.name.includes(this.term)).map(searchname => searchname.name);

  }

here is Stackblitz demo

redpajama_set_name: RedPajamaStackExchange


text:
Q: Add spacing at the end of inline mathmode \(...\) The language I use for certain files look much better if there is a small space \, after each inline equation, like this:
\(...\)   % BAD  spacing
\(...\,\) % GOOD spacing

But it's not quite productive to add the \, to every inline math equation. So is there a way to make this a default setting, in the preamble maybe?

A: I'm not sure what benefit you get from adding space after each formula.
Anyway, the space should be indeed added after the formula, not before it ends.
\documentclass{article}
\usepackage{amsmath}

\makeatletter
\let\)\relax % undefine \)
\DeclareRobustCommand\){%
  \relax
  \ifmmode
    \ifinner
      $\thinspace % add a kern after the formula
    \else
      \@badmath
    \fi
  \else
    \@badmath
  \fi
}
\makeatother

\begin{document}

$a+b$ xyz % for comparison

\(a+b\) xyz

\bigskip

\setlength{\fboxsep}{0pt}% tight to the box

% for comparison
\fbox{\parbox{4.8cm}{This line ends with math $a+b\,$ and text follows}}

\medskip

\fbox{\parbox{4.8cm}{This line ends with math \(a+b\) and text follows}}

\end{document}

The first two lines show that the space is actually added when the \(...\) syntax is added. The two boxes show that if one adds it before closing the formula, the space is not removed at line breaks.

A: I cannot see the advantage of such setting. However, maybe this helps
\documentclass{scrartcl}
\renewcommand\){\,$}
\begin{document}

\noindent
$ y=f(x) $x \\
$ y=f(x) $ x \\
\( y=f(x) \)x

\end{document}


text:
Q: jQuery add class on click not working Probably a simple solution. I would like to expand an embedded video underneath the "Watch the video" when it is clicked. Pretty straight forward, however I can't get this code to add the "expanded" class on click to the video__player div for the life of me. Any help here is greatly appreciated, thanks.
Code:

$(".video").click(function() {
  $(".video__player").addClass("expanded");
});
.video__player {
  display: none;
  width: 80vw;
  max-width: 560px;
  max-height: 315px;
  height: 0;
  transition: 0.5s;
  margin: auto;
}

iframe {
  width: 100%;
  height: 100%;
}

.expanded {
  height: 45vw !important;
  display: block;
}

  Watch the video

A: One, as the comment says, you might not have wrapped it in a $(document).ready(function() {}); handler. Two, your allowFullScreen hasn't set a value. Unset, it's default is false. If you want to allow it fullscreen, set it to true.
Posting your full code through a JSFiddle or a repl.it would help as well, as it could be something else.
In the stackoverflow interpreter, your code seems to be working fine. Perhaps it's something with whatever interpreter you're using?


text:
Q: Caching images using PHP Image Cache I am using this image caching library (http://nielse63.github.io/php-image-cache/) to cache images I am getting using the OMBD API (http://omdbapi.com/).
This is my setup:
    $imagecache  = new ImageCache();
    $imagecache->cached_image_directory = '/img/cache/';
    $imagecache->cached_image_url = '/img/cache';
    $cached_src_two = $imagecache->cache( 'http://image.tmdb.org/t/p/original/eYVZP9CibJg1fyZnZahfFIYqfPr.jpg' );
    echo 'Original file size: ' . filesize($imagecache->image_src) . ' bytes
';
    echo 'PHPImageCach-ified file size: ' . filesize($imagecache->cached_filename) . ' bytes
';
    echo 'Total image size reduction: ' . (((filesize($imagecache->image_src) - filesize($imagecache->cached_filename)) / filesize($imagecache->image_src))*100) . '%';
    echo '';

I am not getting any errors. But something weird is going on I can't understand. It is saving a local copy of the image in $imagecache->cached_image_directory - this is not compressed or cached. Then it is creating another file in the img directory.
I assume this is the cached file, but I am unable to open it to check. The cached filename looks like: eYVZP9CibJg1fyZnZahfFIYqfPr.jpg.jpeg
Note the jpg.jpeg. Even fixing the file extension does not work. I can't find anything useful in the documentation. What is going wrong here?


text:
Q: Looping through feed entries with rome I'm trying to loop through Atom feed entries, and get the title attribute lets say, I found this article, I tried this snipped of code  :
for (final Iterator iter = feeds.getEntries.iterator();
     iter.hasNext(); )
{
    element = (Element)iter.next();
    key = element.getAttributeValue("href");
    if ((key != null) &&
        (key.length() > 0))
    {
        marks.put(key, key);
    }

   //Don't have to put anything into map just syso title would be enough
}

But I get exception saying :

java.lang.ClassCastException:
  com.sun.syndication.feed.synd.SyndEntryImpl
  cannot be cast to org.jdom.Element    at
  com.emir.altantbh.FeedReader.main(FeedReader.java:47)

What did I do wrong? can anyone direct me towards better tutorial or show me where did I make mistake, I need to loop through entries and extract title tag value. thank you

A: SyndFeed.getEntries() returns a List of SyndEntryImpl. You can not cast from SyndEntryImpl to org.jdom.Element.
You can iterate through all SyndEntry as follows:
for (final Iterator iter = feed.getEntries().iterator();
     iter.hasNext(); )
{
    final SyndEntry entry = (SyndEntry) iter.next();
    String title = entry.getTitle();
    String uri = entry.getUri();
    //...
}

API links

*

*com.sun.syndication.feed.synd.SyndEntry

*com.sun.syndication.feed.synd.SyndFeed

*java.util.List

You can also try this if you're using Java 5.0 and above:
for (SyndEntry entry : (List<SyndEntry>) feed.getEntries()) {
    String title = entry.getTitle();
    String uri = entry.getUri();
    //...
}

There is unchecked cast here, but it should be safe based on the specification of getEntries().
See also

*

*Java language guide/for-each loop

*Java tutorials/generics


text:
Q: STM32 ADC over DMA Continuous Mode Too Greedy I am trying to read ADC data via DMA on an STM32F412. The reading itself works fine but the rest of the program is not executed anymore so it's killed by the watchdog soon.
I have an array of size 50 and have it filled by the ADC in one-channel continuous mode.
There is a small function calculating the average of those 50 values that I call from the "complete" interrupt. If I call this function from main, it works fine.
To slow down the ADC, I set the prescaler from /4 to /8 but that did not help.
What would be the preferred way of slowing down the ADC? Increasing the size of the array seems dirty and might not buy me much.
A timer interrupt maybe?


text:
Q: Teradata SQL - how to get everything before hyphen? The question is how to get all data before hyphen using SQL in Teradata?
The pattern is like this : 123ABC-456. I need only 123ABC.
This regex expression:
SELECT RegExp_Replace('123ABC-456',  '\w[^-]*$')

returns "123ABC-" with hyphen for some reason
and this "^[^-]*[^ -]" - returns "-456" instead of "123ABC"
Please any help?

A: You can try using REGEXP_SUBSTR()
select REGEXP_SUBSTR('123ABC-456',  '^[^-]*[^ -]')


text:
Q: How to create jQuery object from array of jQuery objects? Let's say I have an array of jQuery objects and wish to have one compound jQuery object instead.
What would be the solution other than manual traversing an array and appending the elements to the just created jquery object using .add()?
This doesn't do what I want:
var a = $('#a'),
    b = $('#b'),
    c = [a, b];

// the lines above is the set up, they cannot be changed
var d = $(c);
d.hide();

http://jsfiddle.net/zerkms/896eN/1/
The expected result is both divs are hidden.
Any ideas?

A: Try
var d = $($.map(c, function(el){return $.makeArray(el)}));

Or
var d = $($.map(c, function(el){return el.get();}));

The demo.

A: I came here looking for a cleaner answer than I already had, but didn't find one. For the sake of the next guy to come along I guess I'll post my solution instead:
var a = $('#a'),
    b = $('#b'),
    c = [a, b];

var d = c.reduce($.merge);
d.hide();

I'm sort of surprised there isn't some jQuery specific method that makes this cleaner, but Array.reduce is definitely the correct tool for this job if nothing more specific exists in jQuery.

A: Can you try
var a = $('#a'),
b = $('#b'),
c = [a, b];
d = [];
$.each(c, function(i, v){
    if(v.length>0){
        d.push(v[0]);
    }
});

e = $(d);
e.hide();

A: Try this:
var a = $('#a'),
    b = $('#b'),
    c = [a, b],
    d = $();
$.each(c, function(i, jqObj) {
    $.merge(d, jqObj);
});
d.hide();

or:
var a = $('#a'),
    b = $('#b'),
    c = [a, b],
    d = $();
$.each(c, function(i, jqObj) {
    d = d.add(jqObj);
});
d.hide();

A: var els = ['#a', '#b', '#c']
var $els = $(els.join(', '))

Edit: This will do, ugly tho:
var d = $(function(){
    var els = []
    for (var i = 0, l = c.length; i < l; i++)
        els.push(c[i][0])
    return els
}())

A: Assuming you know that you have an array of jQuery objects, you can use $.each to cycle through them (or just treat them as a normal array to cycle through them).  You can use this to create a combined selector if you like, or just do operations on them in the iterator.


text:
Q: How to solve Shape error in Human 3D fall detection using Computer Vision I'm following this Git-hub repository (Link: https://github.com/JJN123/Fall-Detection)
as per repository i run dstcae_c3d_main_train.py python file but got an error:
ValueError: Error when checking target: expected conv3d_7 to have shape (4, 64, 64, 1) but got array with shape (2, 64, 64, 1)

please helping me out, how to give an input to train model for 3D fall detection.


text:
Q: xslt - Using deep-equal on normalized text I'm trying to run the deep-equal function to compare 2 sequences of nodes.
For sequences that I expect to be matched, the only difference would be some carriage returns here and there and an additional ID element for one of the sequences.
So for example:

that's a paragraph

that's another paragraph

and :

that's a
 paragraph

that's another paragraph

For me, that's a match.
Now, deep-equal does not like the carriage return and the id. So I've been trying to modify it to make sure that it's still a match.
Using remove-attributes-deep, I've wrapped deep-equal:
 <xsl:function name="functx:deep-similar" as="xs:boolean">
   <xsl:param name="seq1" as="item()*"/>
   <xsl:param name="seq2" as="item()*"/>

   <xsl:variable name="seq1-noId" select="functx:remove-attributes-deep($seq1,'id')"/>
   <xsl:variable name="seq2-noId" select="functx:remove-attributes-deep($seq2,'id')"/>

   <xsl:sequence select="every $i in 1 to max((count($seq1-noId), count($seq2-noId)))
     satisfies deep-equal($seq1-noId[$i], $seq2-noId[$i])"/>
 </xsl:function>

This code is basically the code from sequence-deep-equal with remove-attributes-deep on top of it.
Now I would like to tweak it to also normalize the spaces.
How can I normalize the individual text() of each node of a sequence, while preserving the nodes so that I can run deep-equal on them once updated? I would need it to be inside the function itself.
I cannot strip my files, some spaces are crucial to me.

A: I would suggest to define a named mode that performs the transformation (i.e. text value normalization and id attribute removal) you want to perform before comparing with deep-equal:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xs"
    version="2.0">

    <xsl:variable name="t1">

that's a paragraph

that's another paragraph

    </xsl:variable>

    <xsl:variable name="t2">

that's a
                    paragraph

that's another paragraph

    </xsl:variable>

    <xsl:template name="main">
        <xsl:variable name="nt1">
            <xsl:apply-templates select="$t1" mode="normalize"/>
        </xsl:variable>
        <xsl:variable name="nt2">
            <xsl:apply-templates select="$t2" mode="normalize"/>
        </xsl:variable>

        <xsl:value-of select="'deep-equal($t1, $t2): ', deep-equal($t1, $t2), '; deep-equal($nt1, $nt2): ', deep-equal($nt1, $nt2)"/>
    </xsl:template>

    <xsl:template match="@* | node()" mode="#all">
        <xsl:copy>
            <xsl:apply-templates select="@* , node()" mode="#current"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="text()" mode="normalize">
        <xsl:value-of select="normalize-space()"/>
    </xsl:template>

    <xsl:template match="@id" mode="normalize"/>

</xsl:stylesheet>

If you don't want the identity transformation for all modes you can of course only define it for the named mode, that is replace
<xsl:template match="@* | node()" mode="#all">
    <xsl:copy>
        <xsl:apply-templates select="@* , node()" mode="#current"/>
    </xsl:copy>
</xsl:template>

by
<xsl:template match="@* | node()" mode="normalize">
    <xsl:copy>
        <xsl:apply-templates select="@* , node()" mode="normalize"/>
    </xsl:copy>
</xsl:template>


text:
Q: Carousel of cards each having text followed by an image in cortana skills How to show a carousel of cards in cortana skill, wherein each card should first have some text followed by an image. Hero card does the exact opposite of it (First image and text later). I tried using the markdown ![alt](imagelink) but it doesn't work in cortana. Is there any way to achieve this?

A: Hopefully soon cortana will support adaptive cards For the time being you have a few choices that may work for you.  The closest to what you want is probably a thumbnail card.  Below are some samples of different cards you can take a look at and see if one works for you.
C#
Rich Cards
Rich Cards - Carousel
Node
Rich Cards - Carousel
Rich Cards

A: Cortana doesn't render markdown in title or subtitle of hero card; but it does in text property of hero card. So one way is to put the text and image markdown in text property and it renders properly.


text:
Q: I'm having trouble with the structure/order of this script I'm new to Lua programming and i want to try a script where you make input from user when print("type your name:") appear, i got that to work, but im having trouble with the rest when checking the number for which category the age does fits in, for example if the user do input age a number between 0-4 it will return ("I'm baby") and "baby" will be replaced based on the number age input from user. If someone can change the script for me and explain a simplier way of doing this. Im trying my best to explain my issue, i will post a picture of my code script. Thanks for reading.
Best Regards. Viktor
Script:

A: Your code with some comments:
print "Type your name:"
inputName = io.read()

-- inputName == inputName is always true!
-- it is the same value checking this makes no sense
-- hence this if statement is pointless
-- you should rather check wether a name was entered
if inputName == inputName then
print("Hi! " ..inputName)
end

print "Type your age:"
inputAge = io.read()
-- here you index the table ageClass which has not been defined yet
-- this will cause an error. you cannot use tables that do not exist yet.
print("I'm " .. ageClass[age])

-- now you define a local table ageClass
local ageClass = {}
-- fill it with values
-- some for loops...
-- then you define a global function with the same name

function ageClass()
-- function body
end

-- now you can no longer use the table ageClass
-- this calls the function ageClass but you do not provide an age
-- this will cause an error for comparing a nil value with a number!
ageClass()

Correct order:

*

*define a table or a function that converts an integer age to a string. you do not need both.

*read the age, make sure you convert it to a number if you want to use it as a number table key or function argument (you cannot compare numbers with strings)

*convert the age to a string like "baby" using the function or the table, whatever you defined.


text:
Q: how to convert json response to List in c# RestSharp Currently I am working on asp .NET 5 console application with Restsharp, My Api Get request is working on postman, but I am struggling to convert this json object to a list .
This is my json object:
"data": {
        "domain": "intel.com",
        "disposable": false,
        "webmail": false,
        "accept_all": false,
        "pattern": "{first}.{last}",
        "organization": "Intel",
        "country": "US",
        "state": null,
        "emails": [
            {
                "value": "danielle.sikich@intel.com",
                "type": "personal",
                "confidence": 99,
                "sources": [
                    {
                        "domain": "github.com",
                        "uri": "http://github.com/hpc/mpifileutils",
                        "extracted_on": "2021-10-28",
                        "last_seen_on": "2021-10-28",
                        "still_on_page": true
                    }
                ],
                "first_name": "Danielle",
                "last_name": "Sikich",
                "position": null,
                "seniority": null,
                "department": null,
                "linkedin": null,
                "twitter": null,
                "phone_number": null,
                "verification": {
                    "date": "2021-11-05",
                    "status": "valid"
                }
            },

I tried this but its not working:
List<Job> JobList = JsonConvert.DeserializeObject<List<Job>>(jsonResponse["data"]["emails"]["value"].ToString());


text:
Q: Class methods redefining, 'self' argument problems I want to implement such case - i have a class, there i have some variable which contains external method, in some situations method can be redefined. It may looks like:
def my_print(self):
    print('my print is called')

class example():
    some_method = my_print

    def __init__(self):
        self.some_method()

    def test(self):
        self.some_method()

So, it works:
a = example()
a.test()

The result looks like:
my print is called (from init)
my print is called (from test)

But in case redefine some_method:
a = example()
a.some_method = my_print
a.test()

It returns a error, which says that i need to give self as argument in the line self.some_method():
TypeError: my_print() missing 1 required positional argument: 'self'

Why does it happen and maybe someone knows trick to solve this problem?

A: It's a subtlety of what . does in Python. It both looks up the method on the class, and binds the method to the instance. This binding is what provides the class instance implicitly as the first argument, self. Look at this:
>>> print(example.some_method)
<function my_print at 0x7f66c4129f30>
>>> print(a.some_method)
<bound method my_print of <test.example object at 0x7f66c41c2290>>

However, when the method is found on the instance (which shadows the one on the class), the binding does not happen:
>>> a = example()
my print is called
>>> a.some_method = my_print
>>> print(a.some_method)
<function my_print at 0x7f66c4129f30>

This is stated in the Python reference:

It is also important to note that user-defined functions which are attributes of a class instance are not converted to bound methods; this only happens when the function is an attribute of the class.

The solution, then, is to make sure that the method is always an attribute of the class instance, and call it accordingly:
class example():

    def __init__(self):
        self.some_method = my_print
        self.some_method(self)

    def test(self):
        self.some_method(self)

Looks weird, works great.
If you want the method to always be an attribute of the class instead, consider using inheritance.


text:
Q: Old School Was IE4 and Netscape... Now What? Each time i develop a website i got into the first dilemma: what browsers are most used (and what takes a lot of time of developing and not worth to touch), where people see the standards? I got some 300 hits a day sites, but i don't think i can measure it. Anyone has ideas or share the same dilemma with me? A

A: Are you asking which browsers are currently the most popular? The answer would be IE, Firefox, Chrome, Safari, and Opera; in that order.
http://marketshare.hitslink.com/report.aspx?qprid=0&qpcal=1&qptimeframe=M&qpsp=150&qpnp=1
http://www.w3counter.com/globalstats.php?year=2011&month=7
If you were asking something different I will remove this answer.

A: Check this out from W3C:
http://www.w3schools.com/browsers/browsers_stats.asp
And even more details on Wikipedia:
http://en.wikipedia.org/wiki/Usage_share_of_web_browsers
When I develop websites I make sure it validates with W3C standards and looks correct in Firefox, Safari, Chrome and IE7+. Others may think differently though.
Hope that helps!

A: You can generate some statistics about who going into your website. Then get from them how many users have Windows/Linux, what users have Trident/Gecko/WebKit.
IE6 support should be break. Nobody likes it, and mostly that's not true that 50% of users use it. 50% is true if we talking about companies where intranet software is written for IE6 and uses ActiveX. Home users now have Firefox, Chrome, Opera. If they use IE, it's probably 7, 8 or 9 now because of Windows Update.


text:
Q: Point to every other point as dataframe in R I understand there are several tools out there that can help me accomplish my goal, but I think I'm running into more of a conceptual roadblock. I've tried to implement a fully reproducible example in seeking assistance.
The situation: I have two point shapefiles, one with 5 points (fewpoints.shp) and the other with many points ~100 (manypoints.shp). For each of the many points, I'd like to find the distance to each of the 5 points, such that the final df looks like:
ID     DistPnt1    DistPnt2    DistPnt3    DistPnt4     DistPnt5
1
2
3
...
100

I've been able to generate a distance matrix and melt it into a dataframe, but I'm having trouble understanding how I'm supposed to retain the original ids such that I can merge them back onto manypoints.shp.
Reproducible example:
library(USAboundaries)
MN <- us_states(resolution="low", states = "MN")
library(sf)
MNspdf <- as_Spatial(MN)
smallpoints <-spsample(MNspdf , 5, type = "random")
manypoints <-spsample(MNspdf , 100, type = "random")
spDists(manypoints, smallpoints)
Is it safe to assume that each row corresponds to the original rows of the manypoints.shp? Am I missing something?

A: It doesn't seem to be explicitly stated that, if:
d = spDists(a,b)

then d[i,j] is the distance of a[i] to b[j]:
 'spDists' returns a full matrix of distances in the metric of the
 points if longlat=FALSE, or in kilometers if longlat=TRUE;

but any alternative ordering would be so bizarre as to be worth mentioning. I would safely assume the returned distance matrix is so ordered.
If it worries you, contact the author and ask for clarification and an explicit statement in the documentation for the next version.


text:
Q: Finding Max aggregate of list of Tuples Write a Python function maxaggregate(l) that takes a list of pairs of the form (name,score) as argument, where name is a string and score is an integer. Each pair is to be interpreted as the score of the named player. For instance, an input of the form [('Kohli',73),('Ashwin',33),('Kohli',7),('Pujara',122),('Ashwin',90)] represents two scores of 73 and 7 for Kohli, two scores of 33 and 90 for Ashwin and one score of 122 for Pujara. Your function should compute the players who have the highest aggregate score (aggegrate = total, so add up all scores for that name) and return the list of names of these players as a list, sorted in alphabetical order. If there is a single player, the list will contain a single name.
For instance:
maxaggregate([('Kohli',73),('Ashwin',33),('Kohli',7),('Pujara',122),('Ashwin',90)])

should return:
['Ashwin']

because the aggregate score of Kolhi is 80, of Ashwin is 123 and of Pujara is 122, of which 123 is the highest.
def maxaggregate(l):
  d = {}
  for i in l:
    if i[0] in d:
      d[i[0]] += i[1]
    else:
      d[i[0]] = i[1]
  m = max(list(d.values()))
  x = []
  for i in d:
    if d[i] == m:
      x.append(i)
  return sorted(x)

A: I would probably use a defaultdict:
from collections import defaultdict
def maxaggregate(lst):
    # If a key is not in the dict it will
    # default the value for that key to 0 (the default int).
    d = defaultdict(int)

    # Sum up the scores
    for name, score in lst:
        d[name] += score

    # Return the max score by iterating
    # over the defaultdict's items and finding
    # the max score (the 2nd element
    #     in the item is the score thus the x[1]).
    return max(d.items(), key=lambda x: x[1])

r = maxaggregate([('Kohli',73),('Ashwin',33),('Kohli',7),('Pujara',122),('Ashwin',90)])
print(r) # ('Ashwin', 123)

A: You can iterate over the list, create a dict to keep the scores and add up the scores by name. Then keeping note of the highest score you find with the associated name.
def maxaggregate(scores):
  agg_results = {}
  max_name = None
  max_val = None
  for name, score in scores:
    score += agg_results.get(name, 0)       # Add up the score
    agg_results[name] = score               # Save it in the dict
    if max_val is None or max_val < score:  # Compare scores
      max_val = score
      max_name = name
  return name

print(maxaggregate([('Kohli',73),('Ashwin',33),('Kohli',7),('Pujara',122),('Ashwin',90)]))

Returns: Ashwin
This solution only iterates over the list once.

A: You can do the following, using a collections.Counter and itertools.takewhile:
from collections import Counter
from itertools import takewhile

def maxaggregate(l):
    c = Counter()
    for k, v in l:
        c[k] += v
    mc = c.most_common()
    max_count = mc[0][1]
    return sorted(name for name, _ in takewhile(lambda i: i[1] == max_count, mc))


text:
Q: Modify my own HTML page to copy the code of another page with puppeteer I need to copy the code of an HTML page with puppeteer and copy that in my own HTML page because I need to modify lign to exploit that
When I do that say me the Document is not define
(async () => {
    const browser = await puppeteer.launch({ headless: true});
    const page = await browser.newPage();
    await page.goto(url, { waitUntil: "networkidle2" });

    //take code I need in the page
    let source = await page.evaluate(() => {
        return document.querySelector('.copyclass').innerHTML;
    });

    //paste in my own HTML page
    document.querySelector('.myclass').innerHTML = source;

    await browser.close();
})();


text:
Q: python does not run for loop I am working on a project which will extract all the ssids and passwords from a windows system
(Note:I am not using this script for malicious pourposes.I just want to apply my subprocess module skills)
But in this program,The for loop I wrote is not executed by python can anyone please help me with this? tnx.
import subprocess , sys , re
a = subprocess.check_output(['netsh' ,  'wlan' ,  'show' ,  'profiles'])
a = a.decode('utf-8')
a = a.replace('    All User Profile     :' , '')
a = a.replace('User profiles' , '')
a = a.replace('<None>' , '')
a = a.replace( 'Profiles on interface Wi-Fi:', '')
a = a.replace(':' , '')
a = a.replace('Group policy profiles (read only)' , '')
a = a.replace('---------------------------------' , '')
a = a.replace('-------------' , '')
print(a)
a = a.replace('  ' , '')
f = open('ssids.txt' , 'w')
f.write(a)
f.close()
f = open('ssids.txt' , 'r')
d = f.read()
l1 = []
print(str(f.read()))
for line in f.read():
    l = subprocess.run('netsh wlan show profiles "' + f.readline(line) + '"' , capture_output = True , text = True)
    print(l)
f.close()
print('follwed')
print(str(l1))

A: You are using f.read() several times and print its contents. Use with open to open and close it safely.
import subprocess
a = subprocess.check_output(['netsh' ,  'wlan' ,  'show' ,  'profiles'])
a = a.decode('utf-8')
a = a.replace('    All User Profile     :' , '')
a = a.replace('User profiles' , '')
a = a.replace('<None>' , '')
a = a.replace( 'Profiles on interface Wi-Fi:', '')
a = a.replace(':' , '')
a = a.replace('Group policy profiles (read only)' , '')
a = a.replace('---------------------------------' , '')
a = a.replace('-------------' , '')
print(a)
a = a.replace('  ' , '')

with open('ssids.txt' , 'w') as f:
    f.write(a)

with open('ssids.txt' , 'r') as f:
    for line in f:
        l = subprocess.run('netsh wlan show profiles "' + line + '"' , capture_output = True , text = True)
        print(l)
print('follwed')


text:
Q: GRUB error: no loaded kernel I'm quite new to Linux, so please bear with me. On my pc I had installed Windows 7 and Ubuntu 9.04, I then switched to Kubuntu 10.x, and yesterday I installed the new main update 11.x and I left the computer to finish installing, when I came back in a few hours I saw that my monitor was blank and looked as though it was unplugged, I  checked all the cables, tried moving the mouse, pressing keyboard, still nothing, but as I said the monitor looked as though it was unplugged. Thus I pressed the reset button on my computer, the monitor started working as normally, but I can't boot into windows or Kubuntu.
This is all I can see on the screen:
GNU GRUB version 1.97 beta 4
[Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device/file completions.]
I don't have live CD to repair it using CD. Is maybe there any other way? If not, how should I repair it using CD once I'll have it with me? Also is it possible to repair it or will I have to format the partition? If I should format, which partition, only the Linux one, and Windows 7 can remain the way they were?
Thank you for all your help and ideas.

A: I reinstalled with the live cd (Kubuntu 10.10) and the same problem occurred, again I repeated the whole thing and once again the same problem occurred. It seems that it freezes if you leave it unattended for too long, thus I tried once again, but this time I was not absent and it succeeded. But I lost all the data, well I didn't have anything really important on the Kubuntu partition, so it's no big deal.
So if anyone has the same problems, just try to install and be around all the time.


text:
Q: Extract array from a string return Can I extract an Array from a string variable:
HTTP/1.1 200 OK
Server: YYYYYYYYY
Content-Type: application/json
Content-Length: 163
X-OAPI-Request-Id: XXXXXXXXXXXXXX
{
  "token_type": "berber",
  "access_token": "XXXXXXXXYYYYYYY",
  "expires_in": "7776000"
}

I want to get the array with token_type, access_token, expires_in.

A: It's kind of a json, so you can just trim off the part that is not json and decode it with json_decode.
$arr = json_decode(substr($str,strpos($str,"{")), true);
Var_dump($arr);

Here I send from "{" to end of string to the json_decode, returns:
https://3v4l.org/r8VgO

A: You can write small string cutter and then convert it into a json

const str = `HTTP/1.1 200 OK
Server: YYYYYYYYY
Content-Type: application/json
Content-Length: 163
X-OAPI-Request-Id: XXXXXXXXXXXXXX
{
  "token_type": "berber",
  "access_token": "XXXXXXXXYYYYYYY",
  "expires_in": "7776000"
}`;

let result = str.substring(str.indexOf('{'), str.indexOf('}') + 1);
result = JSON.parse(result);

console.log(result);
console.log(result.token_type)

A: Here is an example IF you are loading the content from an external website:
<?php
    $page = file_get_contents( "http://urlyouused" );
    $array = json_decode( $page, true );
    print_r( $array);
?>

The file_get_contents will load that web page you showed the results from and put the contents. The json_decode will decode the JSON object into an object normally. But with the 'true' flag it will output an array instead of an object.
Both PHP and Javascript are tagged for this post so this would be a solution for PHP. I think someone posted an answer for Javascript.
EDIT
Either the post changed or I misread (most likely) about starting with a string. Here is a possible solution if you are starting with a string:
preg_match( "#(\{.*\})#is", $string, $results );
$array = json_decode( $results[0], true );
print_r( $array );

Using preg_match to get just the JSON object. The s flag is needed so that the line returns don't end the search. Basically it is trying to capture anything within the curly brackets and the brackets themselves which make the JSON object. The true flag in the json_decode again returns an array instead of an object.


text:
Q: Layer Load Order It seems like the layers are loading from ground up. Is there any way to change the layer load order ?
I have a foreground layer that I want to load up in the first place, I just don't know how.
Thanks!

A: You can try doing: yourLayer.setZIndex(zIndex); to change the zindex of a layer.
Regards


text:
Q: is it possible to auto logout user when app is in background for 10 mins in iphone? I have an app which needs to logout users who are idle for 10 mins, i.e. app is minimized or running in background, is it possible? I searched it a lot but couldn't get solution.Please help me if it is possible.
Thanks.

A: In you appdelegate add property that store the time when you app went into the background.
Like @property (nonatomic, strong) NSDate *backgroundedDate;
Then in the applicationDidEnterBackground: set the date to the current date:
- (void)applicationDidEnterBackground:(UIApplication *)application {
    self.backgroundedDate = [NSDate date];
}

Then when the app comes back to the foreground check the time difference:
- (void)applicationWillEnterForeground:(UIApplication *)application {
    if (self.backgroundedDate) {
        BOOL isTimedout =[self.backgroundedDate timeIntervalSinceNow] <= -(10 * 60);
        if (isTimedout) {
            [yourApiClass logou];
        }
    }
}

A: you can do something like this
static dispatch_once_t once;
dispatch_once(&once, ^ {
NSLog(@"Do it once");
self.backgroundedDate = [NSDate date];
});

call applicationWillEnterForeground
- (void)applicationWillEnterForeground:(UIApplication *)application {
if (self.backgroundedDate) {
NSLog(@"Forground %@",[NSDate date]);
BOOL isTimedout = [self.backgroundedDate timeIntervalSinceNow] <= -(5 * 60);
if (isTimedout) {
//Do your work
}
}
}


text:
Q: Why don't players drone scout in ZvZ? I know that in professional play, a lot of players don't scout with a Drone in ZvZ. As a gold league zerg player, I like to go hatch first, but I usually worker scout anyway because I'm worried that my opponent will do a <10 pool on me.
At high levels of play, I've seen players go hatch first without drone scouting in ZvZ. I'm wondering if it's possible to hold, for example, a 6 pool, with a hatchery first build. Is it okay to use one of my drones for scouting at low levels of play, or is it really that important? How can pro players go for economic builds without knowing if their opponent is cheesing or not?

A: There's no reason to scout because even with a hatch first build your drone scout won't get to the enemy in time for you to change anything about your build. You're not going to cancel the hatch, because your pool will already be started or just about to be. Yes, you can hold a 6 pool with hatch first- it's gotten easier as maps have gotten larger but it takes a lot of tough drone micro to stall for your pool to complete without losing anything.


text:
Q: ExceptionInInitializerError in Stitcher with JavaCV for Android I am using this code for image stitching with JavaCV on Android:
public void ImageStitching() {
    Stitcher stitcher = Stitcher.createDefault(false);
    MatVector images = new MatVector(2);
    images.put(0,cvLoadImage("sample1.png"));
    images.put(1,cvLoadImage("sample2.png"));

    IplImage result = new IplImage(null);
    int status = stitcher.stitch(images,result);

    if( status == Stitcher.OK )
    {
        cvSaveImage("result.png", result);
    }
}

But when I execute it, the app crashes and the log shows the following error:
java.lang.ExceptionInInitializerError at ...

and the error points to the Stitcher initilization, the first line of my code. If I try to do Stitcher stitcher; it doesn't break, but I cannot do anything else since the stitcher is not initialized. If I try to initialize it to null it crashes with the same error.
Any idea about the problem? I have been searching for a while and all the people use that and it seems to work.

A: ExceptionInInitializerError
Signals that an unexpected exception has occurred in a static initializer. An ExceptionInInitializerError is thrown to indicate that an exception occurred during evaluation of a static initializer or the initializer for a static variable.
I would do something like
Stitcher stitcher;
{
    try {
        stitcher = Stitcher.createDefault(false);
    } catch (Throwable t) {
        t.printStackTrace();
        throw t;
    }
}

and see what really happens -- unless you anready have that info in the caused by clause of the exception trace.
PS sometimes errors happen when a class is initialized on the wrong thread (for example, in early versions of Android the AsyncTask class required explicit initialization on the main thread in an application that would otherwise load this class on a worker thread).

A: Ok, I got it.
The problem was that the library opencv_stitching.so was only in the folder armeabi and I needed in the armeabi-v7a one. Not I can declare the stitcher and initialize it.


text:
Q: How to make dropdownlist item's unselectable,once it has been selected

                    <asp:ListItem>1</asp:ListItem>

                    <asp:ListItem>2</asp:ListItem>

                    <asp:ListItem>3</asp:ListItem>

I have one dropdownlist in my form in .aspx File.
Once I select "1", then next time if I redirect to same page then "1" should be
unselectable or Hidden for making sense that I have selected "1"  previously because I have large items in my example.

A: Disabling any particular item in a dropdownlist is not possible.
Alternate:
You can use a BulletedList Server Control and use its Enable = False property to disable any particular item and all user can see that item as disabled.. here is a design time example..
<asp:BulletedList ID="BulletedList1" runat="server">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
            <asp:ListItem Enabled="False">3</asp:ListItem>
            <asp:ListItem>4</asp:ListItem>
</asp:BulletedList>

Took from here

A: You can use a hidden field to store which item was selected in code behind and disable that item using the following code.
//Code Starts
$(document).ready(function() {
   $('#ddlList option:contains("HTML")').attr("disabled","disabled");
});
//Code Ends

A: You can track your selection using Cookies,
on the "onChange" event of your dropdown list, create a cookie with the selected value,
then on body "onLoad" u can check and disable the items that are there in Cookie.
Or you can hold your selected values in a hidden field

A: To remove the last selected item in your dropdownlist (DDL), considering the following code for your DDL form, you can use the onselectedindexchanged event of your DDL (that is raised when you click on one of your DDL items):
<asp:DropDownList ID="_DDL" runat="server"
        onselectedindexchanged="_DDL_SelectedIndexChanged" AutoPostBack="true">
        <asp:ListItem>1</asp:ListItem>
        <asp:ListItem>2</asp:ListItem>
        <asp:ListItem>3</asp:ListItem>
</asp:DropDownList>

And put on the code behind the RemoveAt() method to remove the selected Item from your DDL:
        protected void _DDL_SelectedIndexChanged(object sender, EventArgs e)
    {
        int ItemToRemove = _DDL.SelectedIndex;
        _DDL.Items.RemoveAt(ItemToRemove);
    }

Hope this will be helpful :)


text:
Q: Saving csv files dynamically with python I have 3 datasets which need to be read and then do some calculation on some columns and makes a new columns, finally I have to save new columns in a new csv file. I do not know how to do it dynamically as in each iteration I need to save with different name. For example the following code does not work.
df.to_csv("./dataset/file'+i+'.csv',index=False)

and i is the iteration number in my loop.

A: Referring to my answer to a similar problem,
Here is a solution with pandas. Assume the content of csv as follows:
Name, Age, Gender
John, 20, Male
Jack, 22, Male
Jill, 18, Female

And my code is as follows:
import pandas as pd
df = pd.read_csv("mock_data.csv")

for index, row in df.iterrows():
    file_name = row['Name']+".csv"  #Change the column name accordingly
    pd.DataFrame(row).T.to_csv(file_name, index=None)

This will create filenames based on the values of the column "Name" (i.e. Jack, John and Jill) to produce three files John.csv, Jack.csv and Jill.csv. Content of John.csv is as follows:
Name    | Age   |  Gender |
---------------------------
John    | 20    |  Male   |

Content of Jack.csv is as follows:
Name    | Age   |  Gender |
---------------------------
Jack    | 22    |  Male   |

Content of Jill.csv is as follows:
Name    | Age   |  Gender |
---------------------------
Jill    | 20    |  Female   |

P.S: If you don't want the header, just add header = None when calling .to_csv() function. For example:
pd.DataFrame(row).T.to_csv(file_name, index=None, Header=None)

The hint is to use file_name as a variable generated from any of your columns or input before (or while) passing to the to_csv() function.


text:
Q: Binding List View and show the clicked item on the same page, but item value not showing I got a problem with list view binding item source in Xamarin Forms
I have  a list view on screen one and item view on screen two. I am doing item source binding for
list view. Once an item has been clicked, if it is landscape mode I will attach item view to the
Frame not jumping to the second screen, but if it is portrait mode app will direct users to the screen
two-item view.
<ListView
    x:Name="Items_ListView"

    ItemTapped="ListView_ItemTapped"
    ItemsSource="{Binding Items_List}">

As showing below is the item view screen and I am doing text binding as well. However, the problem is the tile value is not showing when I attach this view to Frame. While if I do list view item source = list instead of binding context, the code will work fine.
    <Entry
    x:Name="Title"
    BackgroundColor="White"
    HorizontalOptions="FillAndExpand"
    Text="{Binding Item_Title, Mode=TwoWay}" />

Does anyone have any idea about this ? Any help will be much appreciated.


text:
Q: How can I access the class from the other javascript file? I'm developing the web application with webpack. I have two javascript files.
app.js
class User {
  constructor(name) {
    this._name = name;
  }

  say() {
    return 'My name is ' + this._name;
  }
}

main.js
import app from './app.js';
let user = new app.User('Alice');
console.log(user.say());

I'd like to print "My name is Alice" on the console, but it doesn't work. How can I resolve this problem?

A: add export default User as the last line. This will export the class user as default. which means you can access it in main.js with a name of your choice as you have done above. If you export it as export User, when you import it in the main.js file you will have to import it as User itself.
Or you can export it in the first line itself like export default class User {

A: You need to export the class from app.js and then import it in main.js:
// app.js
export default class User {
   constructor(name) {
      this._name = name;
   }

   say() {
      return 'My name is ' + this._name;
   }
}

Import User class from app.js:
// main.js
import User from './app';

let user = new User('Alice');
console.log(user.say());


text:
Q: scrolling down in browser C# I have this browsercontroller and wonder how can I scroll down to the bottom of the page? I don't know the right command for this one
Here is my part of my code
Browser browserController = new Browser(); //call browser controlle
Searcher searchKey = new Searcher();
browserController.browserCloser("iexplore"); //close all recent open IE to avoid issues
using (IE browser = new IE(browserController.URLData())) //original code but with time out exception
{
    browser.AutoClose = false;
    browser.WaitForComplete(40);

    Thread.Sleep(20000);
}

I need to scroll down to the IE  and wait for the item to load
this is the website I'm checking https://hpe.wd5.myworkdayjobs.com/Jobsathpe/
I need to load all the results in the page

A: Do not use Thread.Sleep() in UI thread. It usualy blocks any UI actions even these which was invoked just before this call. Use Timer instead.

A: Codebehind:

*

*scrollTo method

*create a control at the bottom of the page... and Focus
Client side:

*

*scrollTo, scrollBy


text:
Q: error: Error: No resource found that matches the given name (at 'label' with value '@string/title_gizmos') I am following this tutorial:
https://developer.android.com/training/app-links/deep-linking
And I can't get it to work. This is the declared manifest:
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="28" android:compileSdkVersionCodename="9" android:installLocation="auto" package="io.kodular.ontstudios.Deeplinks_Test" platformBuildVersionCode="28" platformBuildVersionName="9">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <application android:debuggable="false" android:icon="@mipmap/ic_launcher" android:label="Deeplinks_Test" android:name="com.google.appinventor.components.runtime.multidex.MultiDexApplication" android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
        <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize" android:name="io.kodular.ontstudios.Deeplinks_Test.Screen1" android:theme="@style/AppTheme.NoActionBar" android:windowSoftInputMode="stateHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            android:name="com.example.android.GizmosActivity"
        </activity>
        <activity
            android:name="com.example.android.GizmosActivity"
            android:label="@string/title_gizmos" >
            <intent-filter android:label="@string/filter_view_http_gizmos">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with "http://www.example.com/gizmos" -->
                <data android:scheme="http"
                      android:host="www.example.com"
                      android:pathPrefix="/gizmos" />
                <!-- note that the leading "/" is required for pathPrefix-->
            </intent-filter>
            <intent-filter android:label="@string/filter_view_example_gizmos">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with "example://gizmos" -->
                <data android:scheme="example"
                      android:host="gizmos" />
            </intent-filter>
        </activity>
        <meta-data android:name="io.kodular.app.VERSION" android:value="1.4C.4-Eagle"/>
        <provider android:authorities="io.kodular.ontstudios.Deeplinks_Test.provider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
        </provider>
        <uses-library android:name="org.apache.http.legacy" android:required="false"/>
        <meta-data android:name="Kodular_RCWTFYP-BYDNKHMWRIT-DNLATT" android:value="_d4705d7c44acc5bd4f7b41c83f38a3b7.d4705d7c44acc5bd4f7b41c83f38a3b7-1591708822~IHyiEtMYRvDgxXbt4rhOSnOCkopeFofjrENFozlMYAzosQQBVH5WqkA1OStZfxta_"/>
    </application>
</manifest>

And, the compiler shows:
I: Using Apktool 2.4.1
I: Copying C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763} classes.dex file...
I: Copying C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763} classes2.dex file...
I: Building resources...
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_stats) failed
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_stats) failed
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_stats) failed
W: C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763}\AndroidManifest.xml:13: error: Error: No resource found that matches the given name (at 'label' with value '@string/title_gizmos').
W:
W: C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763}\AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at 'label' with value '@string/filter_view_http_gizmos').
W:
W: C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763}\AndroidManifest.xml:26: error: Error: No resource found that matches the given name (at 'label' with value '@string/filter_view_example_gizmos').
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ONTSTU~1\AppData\Local\Temp\brut_util_Jar_6559922005293012339.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, C:\Users\ONTSTU~1\AppData\Local\Temp\APKTOOL4214939072774050782.tmp, -e, C:\Users\ONTSTU~1\AppData\Local\Temp\APKTOOL4459946816309254913.tmp, -0, arsc, -I, C:\Users\ONT Studios\AppData\Local\apk-editor-studio\frameworks\1.apk, -S, C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763}\res, -M, C:\Users\ONT Studios\AppData\Local\Temp\apk-editor-studio\apk\{73264eb7-54f0-4471-a5b1-8e1585e25763}\AndroidManifest.xml]
Picked up _JAVA_OPTIONS: -Xmx1024m

Sorry if this is a stupid question, this is my first time editing the manifest.
How can I correctly add deeplinks?
Thanks!

A: In your strings.xml file, have you added the string with key title_gizmos? If not you'll have to add it like this:
<string name="title_gizmos">Gizmos</string>

Updated answer:
You can find the strings.xml file in either /res/values/strings.xml or use double shift keyboard shortcut to open the finder and search for strings.xml.
More information about resource files here.


text:
Q: Finding missing emails in SQL Server I am trying to do something I've done a million times and it's not working, can anyone tell me why?
I have a table for people who sent in resumes, and it has their email address in it...
I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE signed up on the web site.
There are 9472 job seekers, with unique email addresses.
This query produces 1793 results:
select j.email from jobseeker j
join aspnet_Membership m on j.email = m.email

This suggests that there should be 7679 (9472-1793) emails of people who are not signed up on the web site. Since 1793 of them DID match, I would expect the rest of them DON'T match... but when I do the query for that, I get nothing!
Why is this query giving me nothing???
select j.email
from jobseeker j
where j.email not in (select email from aspnet_Membership)

I don't know how that could be not working - it basically says "show me all the emails which are IN the jobseeker table, but NOT IN the aspnet_Membership table...

A: We had a very similar problem recently where the subquery was returning null values sometimes.  Then, the in statement treats null in a weird way, I think always matching the value, so if you change your query to:
select j.email
from jobseeker j
where j.email not in (select email from aspnet_Membership
                      where email is not null)

it may work....

A: You could have a lot of duplicates out there.  I'm not seeing the query error off the top of my head, but you might try writing it this way:
SELECT j.email
FROM jobseeker j
LEFT JOIN aspnet_Membership m ON m.email = j.email
WHERE m.email IS NULL

You might also throw a GROUP BY or DISTINCT in there to get rid of duplicates.

A: Also see Five ways to return all rows from one table which are not in another table

A: You could use exists instead of in like this:
Select J.Email
From Jobseeker j
Where not exists (Select * From aspnetMembership a where j.email = a.email)

You should get better performance and avoid the 'weird' behaviour (which I suspect is to do with null values/results) when using in.


text:
Q: Django Postgres JSONB and using a JSONB index So we have a value stored in a JSONB column which I need to query on. I created an index for it like so
create index user_notification_policy_id on user_notification using btree (((extra->'policy_id')::int8));

The explain plan is using the index if the query is formatted as so
("user_notification"."extra" -> 'policy_id')::text = '12345678');

How can I get Django to create a where clause like that? I've been trying to use extra but without luck
return self.extra(
            where='("extra"->"policy_id")::int8 = %s',
            params=[policy_id]
        )

results in
E       ValueError: unsupported format character ')' (0x29) at index 1061

Django 2.2.16

A: I had the extra formatted wrong. It should be an array
return self.extra(
            where=['("extra"->\'policy_id\')::int8 = %s'],
            params=[policy_id]
        )


text:
Q: Gremlin graph traversal that uses previous edge property to decide next edge, and the property is a Complex object Please look at this photo first
I am using gremlin to traverse the graph, first from vertex v1 to edge e1 to v2, and then from v2 to all outE(). Taking e2 as an example, I need to determine the relationship between e2's property and e1.
The specific rules are:For example, if the property of e1 is [0,1], the property array index-0 and index-1 of e2' property corresponding value cannot be both -1. So the property of e2 is [0,1], and therefore meets the requirement, and the property of e3 is [0,-1], because index-0 is 0, not -1. However, the property of e4 is [-1,-1], and the corresponding values of its index-0 and index-1 are both -1, so it does not meet the requirements. Therefore, the final path I want to get is v1-e1-v2-e2-v3 and v1-e1-v2-e3-v4.
The gremlin traversal that I want to represent looks something like this(this is my pseudocode):
List<Path> paths = graphTraversalSource.V("v1")
        .outE().as("e1")
        .inV().outE().as("e2").where((e1, e2) -> {
            boolean pass = false;
            for (each property: e1.property) {
                if (e2.property[property] != -1) {
                    pass = true;
                }
            }
            return pass;
        }).path()

Of course, the property here should be iterated for judgment. Does gremlin support such complex property judgment?It is possible?


text:
Q: Qual a melhor forma de fazer uma análise descritiva de datas de nascimento no R? Tenho em meu quadro de dados uma coluna de datas de nascimentos que estão no modelo inglês, mas não sei como analisar isso descritivamente nem que recursos usar do R.
Eu deveria usar um gráfico de barras ou um histograma? Como faria para o R entender que são datas?
Eu tentei me arriscar fazendo isso:
x = as.Date(rehab.1$Data.Nascimento)

hist(x, main = "Data de Nascimento", breaks = "years",axes = TRUE, xlab = "data", ylab = "Frequência Absoluta", col = "green")

Mas o que saiu não ficou legal:

A: O seu código tem alguns problemas:

*

*A função as.Date assume que a data está no formato Y/m/d, e a sua data está no formato m/d/Y. Troque a primeira chamada para x <- as.Date(rehab.1$Data.Nascimento, "%m/%d/%Y")

*Qual a informação que você quer mostrar no seu histograma? Quantas pessoas nasceram em cada ano? Em cada mês? Dependendo do que você quiser, você irá usar métodos diferentes.

Por exemplo, para mostrar o número de nascimentos por ano, você pode usar o método que você usou (hist, com breaks = "years"), como no código abaixo.
randomDates <- function(N, st = "1/1/1920", et = "12/31/2015") {
    st <- as.POSIXlt(as.Date(st, "%m/%d/%Y"))
    et <- as.POSIXlt(as.Date(et, "%m/%d/%Y"))
    dt <- as.numeric(difftime(et, st, unit = "sec"))
    ev <- runif(N, 0, dt)
    st + ev
}
x <- randomDates(1000)
hist(x, freq = TRUE,
     breaks = "years", col = "green",
     xlab = "ano", "ylab" = "Frequencia",
     main = "Ano de nascimento")


text:
Q: function pointer equal to another pointer within the function, why need to add * please take look at Node *newNode(), i dont understand why i must add * for p=x
i made an Node named x(with data & next), and created a new memory space *p by using malloc,
then let p = x, but by i must add * for p=x?
#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    Node *next;
};

Node *newNode(int data, Node *next){
    Node x = {data, next};
    Node *p = (Node *)malloc(sizeof(Node));
    *p = x; //i dont understand why an * need to be added here
    return p;
}

showNode(const struct Node *p){
    printf("%d\n", p->data);
}

int main(){
    Node *pHead = NULL;
    for(int i=4; i>=0; i--) {
        pHead = newNode(i,pHead);
    }
    printf("%d\n", pHead->next->next->next->data);

    Node* p = pHead;
    while(p != NULL){
        showNode(p);
        p = p-> next;
    }

    p = pHead;
    while(p != NULL){
        Node *pTemp = p;
        p = p->next;
        free(pTemp);
    }
}

A: Because it is a pointer. That's just the syntax in c/c++.
If you are using a pointer without the *, you are saying that you want the memory address. When you use the * you instead want the content on that address.

A: If you just look at the line above the assignment, it says
Node *p = ...;

So *p is a Node. And so is x from the declaration Node x = ...;
If you want to assign one Node to another, you use their names x and *p.

A: *p has two meanings. 1) at the time declaration... Like you write int *p. It means you have declared a pointer to an integer. 2) Not at the time of declaration. *p will now simply mean the data stored in the memory address that p is pointing to.


text:
Q: extracting region codes out of filenames and joining to a region dataframe in R This is my first question, so sorry if it doesn't follow the correct etiquette etc. I am trying to join a dataframe with filenames, to a dataframe with region codes. Most of the filenames contain the correct region code. However, the filenames are messy and contain the region code in random places, along with other random text. But in general, the region itself should either be in the filename just once, or not at all.

regions <- data.frame("region_names" = c("Alaska", "Alabama", "Arkansas", "Arizona", "California"),
                      "region_codes" = c("AK", "AL", "AR", "AZ", "CA"))

files <- data.frame("filenames" =  c("202101 US AK- Report1", "202101 - PV Report2 AL", "202101 AR - Report3", "202101 - AZ - Report4", "202101 - NY - Report5"))

library(stringr)
library(dplyr)

#expected output

#filenames                 region codes    region names
#1 202101 US AK- Report1      AK              Alaska
#2 202101 -PV Report2 AL      AL              Alabama
#3 202101  AR - Report3       AR              Arkansas
#4 202101 - AZ - Report4      AZ              Arizona
#5 202101 - NY - Report5      N/A             N/A

A: We could use str_extract to extract the code and then do a matching with the other data
library(stringr)
library(tibble)
library(dplyr)
files %>%
     mutate(region_codes = str_extract(filenames,
              str_c("\\b(", str_c(state.abb, collapse="|"), ")\\b")),
       region_names = deframe(regions[2:1])[region_codes])
               filenames region_codes region_names
1  202101 US AK- Report1           AK       Alaska
2 202101 - PV Report2 AL           AL      Alabama
3    202101 AR - Report3           AR     Arkansas
4  202101 - AZ - Report4           AZ      Arizona
5  202101 - NY - Report5           NY         <NA>

A: Very similar to akrun's solution: instead of deframing and matching we could use a left_join:
library(stringr)
library(dplyr)

files %>%
  mutate(region_codes = str_extract(filenames, paste0("\\b", paste(regions$region_codes, collapse = "|"), "\\b"))) %>%
  left_join(regions, by = "region_codes")

This returns
               filenames region_codes region_names
1  202101 US AK- Report1           AK       Alaska
2 202101 - PV Report2 AL           AL      Alabama
3    202101 AR - Report3           AR     Arkansas
4  202101 - AZ - Report4           AZ      Arizona
5  202101 - NY - Report5         <NA>         <NA>


text:
Q: Not able to upload more than one image using Spring 4.1.1 and camel 2.14.0 I have an existing code like below one that uploads a single image.
public class ImageRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        getContext().setTracing(true);
        getContext().setStreamCaching(true);

        from("servlet:///PushImage?servletName=CamelServlet")
        .to("direct:doImageUploadJob")
                .marshal().json(JsonLibrary.Jackson);

        from("direct:doImageUploadJob")
        .process(new Processor() {

            @Override
            public void process(Exchange exchange) throws Exception {

                Message in = exchange.getIn();
                Set<String> names = in.getAttachmentNames();
                Object[] arrayNames = names.toArray();
                System.out.println("image array size::"+ arrayNames.length);

                Map<String, DataHandler> attchmentMaps = in.getAttachments();
                System.out.println("image map size::"+ attchmentMaps.size());
            }
        });
    }
}

and in web.xml following configuration is there.
    <!-- Camel servlet -->
    <servlet>
        <servlet-name>CamelServlet</servlet-name>
        <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Camel servlet mapping -->
    <servlet-mapping>
        <servlet-name>CamelServlet</servlet-name>
        <url-pattern>/exmpattrn/*</url-pattern>
    </servlet-mapping>
    <filter>
        <filter-name>MultipartFilter</filter-name>
        <filter-class>org.eclipse.jetty.servlets.MultiPartFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>MultipartFilter</filter-name>
        <servlet-name>CamelServlet</servlet-name>
    </filter-mapping>

But if I try to upload more than one image by calling this API through Postman, it is uploading only the last image selected.
I tried to print the attachment size, but it is always printing as 1.
I don't know why.
Can anybody help me?
I am using Spring 4.1.1 with Java 7.
I am using camel Apache Camel 2.14.0 restlet to form APIs.


text:
Q: What is the way to update /lib/modules after copying disk to a different system? I have transferred the disk of a a Hardyvirtual machine to another virtual machine with a different kernel but there is no equivalent of /lib/modules// on disk. How can the /lib/modules of the new kernel be added to the image to let it boot without error messages?
Is there apt-get command to download the kernel modules of the new kernel from the repository?

A: Kernel modules are in the kernel package:
motiejus@skveez> dpkg -S /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko
linux-image-2.6.32-5-amd64: /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko

You will have to apt-get install the kernel that's in the new server to reinstall the mdoules.
You didn't mention the target (new) system distribution. If kernel was compiled from source, you'll have to do sudo make modules_install from the kernel tree. If it's debian/ubuntu and kernel was from the repository, run:
apt-get install linux-image-2.6-<arch>-<flavour> --reinstall

You can get installed kernels in this way:
uname -a
dpkg -l 'linux-image-*'


text:
Q: NSPredicate against NSArray in iphone How can I use NSPredicate to filter the values from array ivar against search query ? I manage to use NSPredicate against string ivar. I have one user defined class named as "User" which is used to create User from AddressBook. Here is my code
  // User Defined Class named as "User"

// In User.h

@interface User : NSObject {

    NSString *firstName;
    NSString *lastName;
    NSString *company;
    UIImage *userImage;

    NSArray *phoneNumberArray;
    NSArray *emailArray;
    NSArray *urlArray;
    NSArray *addressArray;

    NSString *notes;
    NSString *dateOfBirth;
}

// In SearchViewController.m

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{

    //  contactsArray is NSMutableArray
    contactsArray = [Search searchContactsWithQuery:searchText];
    NSLog(@"contactsArray count => %d",[contactsArray count]);
    [contactsTableView reloadData];
}

// In Search.m

+(NSMutableArray*)searchContactsWithQuery:(NSString*)query {

    NSLog(@"Query => %@",query);

    NSMutableArray*  predicates=[[NSMutableArray alloc] init];

    // Create all predicates
    NSPredicate * firstNamePredicate = [NSPredicate predicateWithFormat:@"firstName contains %@",query];
    [predicates addObject:firstNamePredicate];
    NSPredicate * lastNamePredicate = [NSPredicate predicateWithFormat:@"lastName contains %@",query];
    [predicates addObject:lastNamePredicate];
    NSPredicate * companyPredicate = [NSPredicate predicateWithFormat:@"company contains %@",query];
    [predicates addObject:companyPredicate];

    // Don't know how to use on array
    // === START of ARRAY Predicate ====

NSPredicate *phoneNoPredicate = [NSPredicate predicateWithFormat:@"phoneNumberArray IN %@",query];
    [predicates addObject:phoneNoPredicate];

    NSPredicate *emailPredicate = [NSPredicate predicateWithFormat:@"emailArray contains %@",query];
    [predicates addObject:emailPredicate];
    NSPredicate *urlPredicate = [NSPredicate predicateWithFormat:@"urlArray contains %@",query];
    [predicates addObject:urlPredicate];

    NSPredicate *addressPredicate = [NSPredicate predicateWithFormat:@"addressArray contains %@",query];

    // === END of ARRAY Predicate ====

    NSPredicate *notesPredicate = [NSPredicate predicateWithFormat:@"notes contains %@",query];
    [predicates addObject:notesPredicate];
    NSPredicate *dobPredicate = [NSPredicate predicateWithFormat:@"dateOfBirth contains %@",query];
    [predicates addObject:dobPredicate];

    // Add predicates to array
    NSPredicate *compoundPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:predicates];

    NSArray * filteredArray = [APP_DELEGATE.allUsersArray filteredArrayUsingPredicate:compoundPredicate];

    return [NSMutableArray arrayWithArray:filteredArray];

}

phoneNumberArray,emailArray,urlArray & addressArray are used because user may have multiple entries for phone no , email, address , url like HOME , WORK, iPhone, Other etc.
How can I use predicates on array? Any kind of help is appreciated. Thanks

A: You are doing the correct way, but you need to create your Predicates with String values instead of passing the Objects directly.
You need to use %k instead of %@ like
[NSPredicate predicateWithFormat:@"firstName contains %k",query];
Please let me know if this helps.


text:
Q: Which are the deterministic sorting algorithms with O(nlogn)?
Which are the deterministic sorting algorithms with O(nlogn)...? Only
  name few algorithms...

A: Merge sort and heap sort are the archetypal O(nlogn) examples and are deterministic. Quicksort is O(nlogn) in the average case but not usually in the worst case (which is O(n^2)). Quicksort is very often implemented with a randomized pivot, so it's not always deterministic.


text:
Q: Table goes to the next page \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{caption}

\title{Table Test}

\begin{document}

\maketitle

\begin{center}
\hskip 0.5 cm \begin{tabularx}{100pt}{c|c|c|}
\multicolumn{1}{c}{ } &\multicolumn{1}{c}{$D$} &\multicolumn{1}{c}{$R$} \\ \cline{2-3}
$D$ & $\frac{6}{15}$ & $\frac{4}{15}$  \\ \cline{2-3}
$R$ & $\frac{4}{15}$ & $\frac{1}{15}$   \\ \cline{2-3}
\end{tabularx}
\begin{tabularx}{100pt}{c|c|c|}
\multicolumn{1}{c}{ } &\multicolumn{1}{c}{$D$} &\multicolumn{1}{c}{$R$} \\ \cline{2-3}
$D$ & $\frac{1}{15}$ & $\frac{4}{15}$  \\ \cline{2-3}
$R$ & $\frac{4}{15}$ & $\frac{6}{15}$   \\ \cline{2-3}
\end{tabularx}\vskip 0.5cm

$\omega_1$ \hskip 3cm $\omega_2$
\vskip .7cm
\captionof{table}{Blabla}
\end{center}

\end{document}

I have an impression that float can solve this problem. But I thought it is used with table environment which I am not using. Thank you for your help!

A: Your table in center environment stay on page where are inserted if there is sufficient space for it. If it is not, than it is pushed to the next page but left empty space on page before.
This space, as explained @David Carlisle in his comments, can be filled by text after table inserting point, if you use table float environment:
\documentclass{article}
\usepackage{tabularray}
\usepackage{caption}

\title{Table Test}
\author{Me}

\begin{document}

\maketitle

\begin{table}[ht]
\centering
    \begin{tblr}{hline{2-Z} = {2-Z}{solid},
                 vline{2-Z} = {2-Z}{solid},
                    colspec = {*{3}{Q[c, mode=math]}}
                }
    & D   &   R                     \\
D & \frac{6}{15} & \frac{4}{15}    \\
R & \frac{4}{15} & \frac{1}{15}     \\
    \end{tblr}

\medskip
    \begin{tblr}{hline{2-Z} = {2-Z}{solid},
                 vline{2-Z} = {2-Z}{solid},
                    colspec = {*{3}{Q[c, mode=math]}}
                }
    & D   &   R                     \\
D & \frac{6}{15} & \frac{4}{15}    \\
R & \frac{4}{15} & \frac{1}{15}     \\
    \end{tblr}

$\omega_1$ \hspace{3cm} $\omega_2$
\caption{Blabla}
\end{table}

\end{document}

For your table I suggest to use tabularray package. Using it, table is nicer (cells contents doesn't touch horizontal lines) and code is a bit shorter and clearer.


text:
Q: How can I create a dynamically interpolated string in javascript? I'm working on creating a reusable UI component and am trying to figure out how to allow the consumer of the component to provide their own template for a particular area of the component.
I'm using typescript and am trying to utilize string interpolation to accomplish this as it seemed the most appropriate course of action.
Here is what I have so far:
export class Pager {
    pageNumber: number = 1;

    getButtonHtml(buttonContentTemplate?: string, isDisabled?: boolean): string {
        buttonContentTemlpate = buttonContentTemplate || '${this.pageNumber}';
        isDisabled = isDisabled || false;
        return `<button id="button-id" type="button"  ${!isDisabled ? '' : disabledAttribute}>
                    ${buttonContentTemplate}
                </button>`;
    }
}

I have some other methods that will update the page number based off user input/interaction, but I want it to work that when getButtonHtml gets called, the return value would be <button id="button-id" type="button">1</button>, but instead I'm getting <button id="button-id" type="button">${this.pageNumber}</button>.
Is there a way to get javascript to evaluate the string again, and interpolate the remaining place holders?
I've looked at the MDN article on this topic and think that the String.raw method might possibly be what I need to use, but I wasn't sure and no matter what I try, I haven't gotten it to work.
Any help would be greatly appreciated.

A: The problem is that Template literals are interpreted immediately.
What you want to do is lazy load the template. So it would be best to pass in a function that returns a string.
export class Pager {
    pageNumber: number = 1;

    getButtonHtml(template?: () => string, isDisabled=false): string {
        template = template || function() { return this.pageNumber.toString() };
        return `<button id="button-id" type="button"  ${!isDisabled ? '' : disabledAttribute}>
                    ${template()}
                </button>`;
    }
}

Additionally, you can take advantage of default parameters to avoid the || trick.


text:
Q: latest typescript breaking changes in lib.dom.ts file In spec.ts For Example: Dom.spec.ts
  describe('matchesSelector', () => {
    let result: boolean;
    let matchelement: HTMLElement;
it('Matches for the opera browser', () => {
        matchelement.matches = matchelement.msMatchesSelector = null;
        result = Dom.matches(matchelement, '#match');
        expect(result).toBe(true);
    });

when calling msmatchesSelector in matchelement.msMatchesSelector in above code it fetch the specfic type in  lib.dom.ts .
It reproduce the below error when I uprade the typescript version to 3.0
spec\dom.spec.ts(304,49): error TS2339: Property 'msMatchesSelector' does not exist on type 'HTMLElement'.

But It works fine in my previous typescript version 2.6.2

A: This is a breaking change between 3.0 and 3.1:

TypeScript's built-in .d.ts library (lib.d.ts and family) is now partially generated from Web IDL files from the DOM specification. As a result some vendor-specific types have been removed.

The recommendation is to extend the built-in definitions as needed:

If your run-time guarantees that some of these names are available at run-time (e.g. for an IE-only app), add the declarations locally in your project, e.g.:
  For Element.msMatchesSelector, add the following to a local dom.ie.d.ts

interface Element {
    msMatchesSelector(selectors: string): boolean;
}

A: You can also use these easy codes at top of file
interface Element {
   msMatchesSelector: any;
}


text:
Q: How to fix Error: laravel.log could not be opened Permission denied? I'm pretty new at laravel,Actually when i create this command php artisan migration so i face this error how can i resolve this issue thanks.
Error

UnexpectedValueException  : The stream or file
      "/home/zubair/htdocs/project/storage/logs/laravel.log" could not be opened: failed to open
      stream: Permission denied

A: If you run the command with sudo or chmod -R 755 some of the project's folders, you'll have it working.
sudo chmod -R 755 storage bootstrap/cache
Changing entire project folder's permission is probably not a good idea as your project becomes accessible to any user/script which kind of defeats the purpose of securing it behind root.

A: change a permission of storage folder
sudo chmod -R 775 /var/www/html/your-project/storage

for more info check this link install laravel in apache


text:
Q: "Equals" cannot be called in the overload operator function? I found an interesting thing, take this as a C# program:
namespace ConsoleApplication1
{
    using System;

    public class Student
    {
        public int ID { get; set; }
        public string Name { get; set; }

        public override bool Equals(object comparedStudent)
        {
            Student stu = comparedStudent as Student;

            if (stu == null)
            {
                return false;
            }
            return ID.Equals(stu.ID) && Name.Equals(stu.Name);
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode() ^ Name.GetHashCode();
        }
        /// <summary>
        /// Notice that this will cause NullPointException……Why?
        /// If I use "return s1.ID==s2.ID && s1.Name==s2.Name", that'd be OK.
        /// </summary>
        public static bool operator ==(Student s1, Student s2)
        {
            return s1.Equals(s2);
        }

        public static bool operator !=(Student s1, Student s2)
        {
            return !s1.Equals(s2);
        }
    }

    public class Program
    {
        static void Main(string[] args)
        {
            Student s1 = new Student();
            s1.ID = 1;
            s1.Name = "YourName";
            Student s2 = new Student();
            s2.ID = 1;
            s2.Name = "YourName";

            //Why there's an exception here (NullPoint exception)
            bool isSame = (s1 == s2);
            Console.WriteLine(isSame);
        }
    }
}

If you copy my codes and run, a NullPointer exception will be thrown out. Why?
PS:If I use "return s1.ID==s2.ID && s1.Name==s2.Name" in the overload operator +, that'd be OK.
Why? I'm using net4.0 VS2015.
And if you debug by dropping the debug point at "bool isSame = (s1 == s2);" You'll soon find it enters into the "==" overload function 3 times, and in the end, s1 and s2 are null!

A: Although Ians comment will fix the above issue it will not finally fix the problem in general.
The origin of the problem is in the overload of the comparison operators.
A programmer expects null == myobject as well as myobject == null to be a valid expression (as you did as well in implementation of .Equals). This does not work for the above class because of the invocation of the member function s1.Equals in operator ==.
So any reasonable overload of a comparison operator should be able to handle really any input without throwing an exception. In doubt simply return false.
This includes null values as well as class instances that do not yet have all properties assigned.
public static bool operator ==(Student s1, Student s2) =>
  ReferenceEquals(s1, s2) || (!ReferenceEquals(s1, null) && s1.Equals(s2));

Rationale:

*

*ReferenceEquals(s1, s2) handles null == null as well as x == x. The latter does not require to compare the content.

*s1 != null handles null == x.

*x == null is already handled by the .Equals implementation.

By the way: it is recommended to provide a strongly typed .Equals implementation when overloading equality operators by implementing IEquatable<Student>.
Furthermore you should not use .Equals to compare components, because this will sadly fail for a similar reason if Name has not been assigned so far.
public override bool Equals(object obj) =>
  Equals(obj as Student);

public bool Equals(Student stu) =>
  !ReferenceEquals(stu, null) && ID == stu.ID && Name == stu.Name;

See also the reply of Yuval Itzchakov to question Operator overloading ==, !=, Equals


text:
Q: How do I decode html coded characters in an NSString? I am writing an app with both english and french support. The app requests information from a server and the server response uses JSON. I am using the JSONKit library to parse the response but the strings its parsing from the french responses look like this:
Membres –Économisez 5% sur les services et jusqu'à 15% sur d'autres produits
How do I decode the special characters? so that I get this:
Membres –Économisez 5% sur les services et jusqu'à 15% sur d'autres produits
I looked at the API for NSString and tried some of the instance methods but I don't know much about character encodings and I ended up getting some weird results. So if you can also provide a brief explanation on character encodings I'd really appreciate it.
Thanks in advance

A: This solution worked well for me if you're still using Objective C code.
- (NSString *)decodeHtmlStringValue
{
  NSData *encodedString = [self dataUsingEncoding:NSUTF8StringEncoding];
  NSAttributedString *htmlString = [[NSAttributedString alloc] initWithData:encodedString
                                                                    options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: [NSNumber numberWithInt:NSUTF8StringEncoding]} documentAttributes:nil error:nil];
  return [htmlString string];
}

If your using swift
https://stackoverflow.com/questions/25607247/how-do-i-decode-html-entities-in-swift

A: Check out these NSString categories

A: NSString stringByReplacingPercentEscapesUsingEncoding with the correct string encoding should do the magic.
[yourString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

might be a good candidate.


text:
Q: How to enter a formula in a cell using vba I have a formula and I want to enter that formula in all the cells in column B, how can I do that , I have tried various tricks but nothing seems to work.
This is the formula,
=MID(A1,SEARCH(":",A1,SEARCH("Assignee Group:",A1))+2,IFERROR(FIND(CHAR(10),A1,SEARCH("Assignee Group:",A1)),LEN(A1))-SEARCH(":",A1,SEARCH("Assignee Group:",A1))-1)

It gives me a syntax error every time.

A: You need to double up quotes within a quoted string.
Option Explicit

Sub wqewre()
    With Worksheets("sheet1")
        With .Range(.Cells(1, "B"), .Cells(.Rows.Count, "A").End(xlUp).Offset(0, 1))
            .Formula = "=MID(A1, SEARCH("":"", A1, SEARCH(""Assignee Group:"", A1))+2, " & _
                         "IFERROR(FIND(CHAR(10), A1, SEARCH(""Assignee Group:"", A1)), " & _
                         "LEN(A1))-SEARCH("":"", A1, SEARCH(""Assignee Group:"", A1))-1)"
        End With
    End With
End Sub


text:
Q: Can a vortex vector field be conservative? For the following vortex vector field
$$F(x,y)=\left(\frac{2xy}{(x^2+y^2)^2},\frac{y^2-x^2}{(x^2+y^2)^2}\right)$$
If we apply the extended Green's Theorem for an arbitrary simple closed curve $C$ that doesn't pass through the origin and with a circular "hole" $C'$ with radius $a$ centered at the origin, we will get
$$\iint_R\left(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\right)dA=\int_C\vec{F}\cdot d\vec{r}-\int_{C'}\vec{F}\cdot d\vec{r}$$
Since
$$\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}=0, \int_{C'}\vec{F}\cdot d\vec{r}=0$$
We will get
$$\int_C\vec{F}\cdot d\vec{r}=0$$
Does this means that this vortex vector field is conservative?

A: Notice that $(x^2+y^2)^2$ is in the denominator of both components, so by quotient rule a good guess for a potential function would be to assume that it takes the form of
$$\frac{f(x,y)}{x^2+y^2}$$
which sets up the following system of equations:
$$\begin{cases}(x^2+y^2)f_x - 2xf = 2xy \\ (x^2+y^2)f_y - 2yf = y^2-x^2 \end{cases}$$
And as a guess, $f(x,y) = -y$ satisfies both equations (though by no means is it the only $f$ to do so). Which means the potential function is given by
$$\frac{-y}{x^2+y^2}$$
which has an isolated singularity as opposed to a branch cut, so its gradient will be conservative everywhere on its domain.