text:
Q: WebRTC issue in chrome 59 After updating chrome to version 59 the getUserMedia for screen sharing is fail with "NavigatorUserMediaError TrackStartError". This error happen only if two monitors attached to my laptop, if i using laptop screen only, the WebRTC screen sharing works and getUserMedia returns stream as well (This is regrassion from chrome 58).
The mediaConstraints for getUserMedia is
{
audio: false,
video: {
  mandatory: {
    chromeMediaSource: 'desktop',
    chromeMediaSourceId: 'the id returned by chrome.desktopCapture (extension)',
    maxFrameRate: 5
    }
}}

You can reproduce this issue here.
Is anybody get this error after updating to chrome 59?
How can i fix it? Or need to wait for google team fix?


text:
Q: TCP connection reset by RST during connect() Does anyone have an idea why connect() would continue before the three-way handshake is finalized?
According to what I captured by tcpdump the client sends a [PSH,ACK] with data before sending the last ACK of the three-way handshake.
NO_DELAY option is used.
Connect code :
do {

    r1 = connect(socketfd, addr->ai_addr, addr->ai_addrlen);

  } while (r1 < 0 && errno == EINTR);

tcpdump sequence

redpajama_set_name: RedPajamaStackExchange


text:
Q: Perl: How to download a large zip file in a loop and provide feedback Using Perl, how do I download a large zip file from a web server, and while it's downloading, post status messages? I tried LWP::Simple's getstore() and turned on $ua->show_progress(1), but it hangs while it's downloading and I can't provide feedback over POSIX Named Pipes to another application.

A: After the comments on this answer specified the problems more precisely then your question you might try below. This forks a child with the download and in the master you will be able to read the progress information from a file descriptor.
Nevertheless, a much better interaction between the download and your program which handles the progress might be possible, because in my opinion forking a process just so that the download can somehow displayed is ugly. But this part of the download feedback depends mostly on the way you've designed your progress showing application, and this design is unknown too me.
use strict;
use warnings;
use LWP::UserAgent;

my $url = "http://...";
my $file = "outputfile";

pipe my $rfh, my $wfh;
defined( my $pid = fork() ) or die "fork failed: $!";
if ($pid == 0) {
    # download in child, redirect progress to pipe
    close($rfh);
    $wfh->autoflush(1);
    open(STDERR,">&",$wfh) || die $!;
    close($wfh);

    my $ua = LWP::UserAgent->new;
    $ua->show_progress(1);
    $ua->get($url, ':content_file' => $file );
    exit;
}

# read in master from pipe
close($wfh);
$SIG{CHLD} = 'IGNORE';
while (sysread($rfh, my $buf, 8192,0)) {
    print "progress... $buf\n";
}

A: #!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple qw($ua getstore);
use POSIX qw(WNOHANG);

my $sURL = "http://example.com/example.zip";
my $sSaveFile = "/tmp/download.zip";

# it's probably a good idea to first check the server with a HEAD request on the URL before wasting time on a download.
# But, besides that, here you go...

my $sMessage = "Downloading";
my $pid = fork();
if ($pid == 0) {
  getstore($sURL,$sSaveFile);
  exit;
}
do {
    # here, I print, but you could also provide feedback via Named Pipes or some other mechanism
    # you might also want to do a byte check to see if the file size is increasing, and if not, increase a flag counter, and if you hit like 5 flags, give up on the download with a "last" statement.
    # remember, byte checks can easily be done with: my $nBytes = (-s $sSaveFile);
    print "$sMessage\n";
    $sMessage .= '.';
    sleep(2);
} while (waitpid($pid, WNOHANG)==0);
print "\n\nDONE\n\n";

I found I had to do it this way instead of shelling out and running curl because on OSX Lion, it has a bug with Curl timing out after 30 seconds when used in a piped process, while versions of OSX after that no longer had this bug.


text:
Q: How to avoid stack trace with sys.error(message) In some custom tasks, I detect some error, and I'm using this way to signal an error and stop processing current task:
sys.error("Some error")

Internally it throws a RunTimeException.
SBT shows a stack trace, and I'd like to report an error without stack trace.  For expected errors, it is often verbose, not meaningful and confuses end users.
The stack trace is shown when running from the command line, not the shell, where the stack trace only is shown with the last command.
Is there a standard way of reporting errors with no stack trace?
UPDATE:
Asked to the SBT team for a better solution.

A:
Is there a standard way of reporting errors with no stack trace?

Not yet. But there's an undocumented, not-guaranteed-to-work-in-the-future way.
Edit: As Dale commented sbt.internal.util.MessageOnlyException is aliased to sbt.MessageOnlyException, so we can use the following:
lazy val doomed = taskKey[Unit]("doomed")

ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "2.12.7"
ThisBuild / version      := "0.1.0-SNAPSHOT"

lazy val root = (project in file("."))
  .settings(
    name := "msg-only",
    doomed := {
      throw new MessageOnlyException("boom!")
    }
  )

This is not guaranteed to work in the future because it's using sbt.internal, but basically MessageOnlyException does what you are asking I think.
sbt:msg-only> doomed
[error] boom!
[error] (doomed) boom!
[error] Total time: 0 s, completed Nov 28, 2018 12:42:47 PM

A: Something like this should work, but it might hide other type of (unintentional) errors in your task? Maybe you can add the error to an error-task and then call that task each time you want to raise the error? Then you can set the traceLevel only on the error-task.
lazy val myTask = taskKey[Unit]("doomed to err")

traceLevel in myTask:= -1

myTask := {
    error("Some error")
}


text:
Q: Swing Toolbar placement I want to display a JToolbar within right side of a split pane, which is also going to contain a JTabbedPane, how can we do that ? wrap TabbedPane and toolbar in some component? ps: user should not be able to minimize, etc in right side pane...

A: Put a JPanel on the right side of the split pane.
Give the JPanel a BorderLayout.
Add the JToolbar to the NORTH of the JPanel, and the JTabbedPane to the CENTER.


text:
Q: Fedora 35 web application with PHP and Apache server: "Failed to open stream: Permission denied" I am working on a web application and the Apache server is in the directory /var/www/html. So I created a new folder named "web" to this project. I also created a .ini file on the directory /agrotermos/conf/conf.ini to initialize the environment variables. So, in this folder "web" I have a file with a function to connect to the database, and the first command is:
$variaveisdeambiente = parse_ini_file('/agrotermos/conf/conf.ini', true);

But when I open the index.html file on the browser, it gives me the following error:

Warning: parse_ini_file(/agrotermos/conf/conf.ini): Failed to open stream: Permission denied in /var/www/html/web/conndb.php on line 5

I tried to give a+rx permission to the hole "agrotermos" folder, but it didn't work. Then I changed the owner group of this folder from root to apache, but it didn't work as well. Any ideas of what should I do to solve this?


text:
Q: ios: media player is mute why? I have a iOS project with media video, but when I run this app the video are mute, help me please this is the code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{
    static NSString *CellIdentifier = @"MediaCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

// Configure the cell...
    NSUInteger row = [indexPath row];
    MPMediaItem *item = [self.mediaItems objectAtIndex:row];
    cell.textLabel.text = [item valueForProperty:MPMediaItemPropertyTitle];
    cell.detailTextLabel.text = [item valueForProperty:MPMediaItemPropertyArtist];
    cell.tag = row;

    return cell;
}
- (void)loadMediaItemsForMediaType:(MPMediaType)mediaType

{

    MPMediaQuery *query = [[MPMediaQuery alloc] init];

    NSNumber *mediaTypeNumber= [NSNumber numberWithInt:mediaType];

    MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate
    predicateWithValue:mediaTypeNumber forProperty:MPMediaItemPropertyMediaType];

    [query addFilterPredicate:predicate];

    self.mediaItems = [query items];
}

A: Are you testing it on iPad? If yes, I have seen issues where app audio is muted if the side switch button is set to mute instead of "lock rotation" and you happen to click it. Check this wikihow to change it - http://www.wikihow.com/Set-Side-Switch-Function-On-an-iPad


text:
Q: 'int' object is not subscriptable error in 3d array I am trying to access individual values from a 3D matrix of shape (7,4,6) layer by layer.I want to access value from one (row X column) for all 7 layers and compare them but get an error in the accessing values part. Also I am able to print them properly in the order required. The code I have written is:
array = [[[-99, -99, -99, -99, -99, -99],
    [-99, -99, -99, -99, -99, -99],
    [-99, -99, -99, -99, -99,   1],
    [-99, -99, -99, -99, -99,   1]],

   [[  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1]],

   [[  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1]],

   [[  1,   1,   1,   1, -99, -99],
    [  1,   1,   1,   1, -99, -99],
    [  1,   1,   1,   1, -99, -99],
    [  1,   1,   1,   1,   1, -99]],

   [[  0,   1,   1,   1,   1,   1],
    [  0,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1],
    [  1,   1,   1,   1,   1,   1]],

   [[-99, -99, -99, -99, -99, -99],
    [-99, -99, -99, -99, -99, -99],
    [-99, -99, -99, -99, -99, -99],
    [-99, -99, -99, -99, -99, -99]],

   [[  0,   0,   0,   0,   0,   0],
    [  0,   0,   0,   0,   0,   1],
    [  0,   0,   1,   1,   1,   1],
    [  0,   1,   1,   1,   1,   1]]]
for i in range(0,4):
    for j in range(0,6):
        for k in range(0,7):
            a = array([k][i][j])
            if (a == 0 and b == 0):
                NN += 1
            elif (a == 0 and b == 1):
                RN += 1
            elif (a == 1 and b == 0):
                NR += 1
            elif (a == 1 and b == 1):
                RR += 1
            else:
                exit
            b = a

RR, NN, NR and RN and b are declared 0 a=in initial state
but I get

TypeError:'int' object is not subscriptable

in the last line. I saw it through in net and it said I have to convert it into string to operate with it. Can someone explain it to me why we have to do so and how?


text:
Q: Irregular Next Autoindex after INSERT SELECT query I have some tables that I'm trying to transfer data between.
When I execute the query to get the first 720 items from Table 1 and insert into Table 2, everthing works ok:
INSERT INTO `table_2` (`company_id`, `type_id`, `request`, `response`, `response_headers`, `datetime_added`, `timestamp_univ`)
SELECT `company_id`, `type_id`, `request`, `response`, `response_headers`, `datetime_added`, `timestamp_univ`
FROM `table_1`
WHERE id > '0' LIMIT 720;

However, the Next Autoindex value listed is 1024 instead of 721.
Any reason why this is happening?
NOTE I have two non-unique indexes on two columns of the table


text:
Q: vba Run-time error '91': Object variable or With block variable not set I'm trying to run a Solid-Works VBA macro, should be an easy fix, however I don't know what to change.
When I run the code the code error's with the

Run-time error '91'
Object variable or With block variable not set

When I click debug it shows me this line

Set Part = swApp.ActiveDoc

I truly do not know where to look, what to do, that might be causing, so any help is much appreciated. The essential parts of the code can be seen below (where the ... indicates missing code, which is the same structure as the other functions). The full code can be see here: Macro_Source_File
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
Proc1
Proc2
Proc3
Proc4
Proc5
Proc6
Proc7
Proc8
Proc9
Proc10
Proc11
Proc12
Proc13
Proc14
Proc15
Proc16
Proc17
Proc18
Proc19
Proc20
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Curve1", "REFERENCECURVES", -0.00231262, -0.00182843, 0.020955, False, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve2", "REFERENCECURVES", -0.0021168, -0.00236411, 0.02720474, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve3", "REFERENCECURVES", -0.00223617, -0.0027144, 0.03345447, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve4", "REFERENCECURVES", -0.00249537, -0.00287881, 0.03970421, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve5", "REFERENCECURVES", -0.00282783, -0.00287835, 0.04595395, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve6", "REFERENCECURVES", -0.00351723, -0.00287119, 0.05220368, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve7", "REFERENCECURVES", -0.0055227, -0.0032572, 0.05845342, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve8", "REFERENCECURVES", -0.00756485, -0.0034921, 0.06470316, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve9", "REFERENCECURVES", -0.00948977, -0.00359409, 0.07095289, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve10", "REFERENCECURVES", -0.01123743, -0.00358632, 0.07720263, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve11", "REFERENCECURVES", -0.01275123, -0.00349398, 0.08345237, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve12", "REFERENCECURVES", -0.01289014, -0.00310294, 0.08970211, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve13", "REFERENCECURVES", -0.01208902, -0.00258381, 0.09595184, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve14", "REFERENCECURVES", -0.01103539, -0.00209482, 0.10220158, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve15", "REFERENCECURVES", -0.00978747, -0.00163788, 0.10845132, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve16", "REFERENCECURVES", -0.00828882, -0.00121351, 0.11470105, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve17", "REFERENCECURVES", -0.00686848, -0.00083556, 0.12095079, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve18", "REFERENCECURVES", -0.00678812, -0.00066149, 0.12720053, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve19", "REFERENCECURVES", -0.00585563, -0.00585251, 0.13245522, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Curve20", "REFERENCECURVES", -0.00522598, -0.01340759, 0.13263761, True, 1, Nothing, 0)
Part.FeatureManager.InsertProtrusionBlend False, True, False, 1, 6, 6, 1, 1, True, True, False, 0, 0, 0, True, True, True
End Sub

Sub Proc1()
Set Part = swApp.ActiveDoc
Part.InsertCurveFileBegin
boolstatus = Part.InsertCurveFilePoint(-0.00231262, -0.00182843, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00232201, -0.00179355, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.0023492, -0.00169261, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00193825, -0.00141403, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.001174, -0.00099736, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00022623, -0.00050828, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00087785, 0.00002491, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00210496, 0.00057278, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00341658, 0.00110609, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00477003, 0.00159708, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00612951, 0.00202043, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00745767, 0.00233337, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00869064, 0.00252003, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00977735, 0.0025858, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01067256, 0.00254594, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01134017, 0.00242162, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01175535, 0.00223452, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01190555, 0.00200133, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01190555, 0.00200133, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01178923, 0.00175006, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01141567, 0.00150298, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.01080407, 0.00126068, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00998055, 0.00102135, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00897647, 0.00077979, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00782706, 0.0005274, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00657067, 0.00025367, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00523448, -0.00004854, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00386212, -0.00035713, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.0025091, -0.00066457, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00122199, -0.00096449, 0.020955)
boolstatus = Part.InsertCurveFilePoint(0.00004512, -0.00124691, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00098083, -0.00149976, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00181994, -0.00171086, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00231106, -0.00183422, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00231224, -0.00182982, 0.020955)
boolstatus = Part.InsertCurveFilePoint(-0.00231262, -0.00182843, 0.020955)
boolstatus = Part.InsertCurveFileEnd()
boolstatus = Part.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "Curve1")
End Sub

Sub Proc2()
Set Part = swApp.ActiveDoc
Part.InsertCurveFileBegin
boolstatus = Part.InsertCurveFilePoint(-0.0021168, -0.00236411, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00213034, -0.00232574, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00216954, -0.00221468, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00223031, -0.00204246, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00167844, -0.00160452, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00065574, -0.00097391, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00053875, -0.00028036, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00187018, 0.00044021, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00329779, 0.0011517, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00477601, 0.00181922, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00626681, 0.00241128, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00773188, 0.00287663, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00910086, 0.00319197, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.0103159, 0.00335898, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01132489, 0.00339094, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01208546, 0.00330851, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01256786, 0.00313392, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01275656, 0.00288487, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01275656, 0.00288487, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01264744, 0.00259265, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.012249, 0.00228309, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01158277, 0.00195851, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.01067824, 0.00161909, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00957108, 0.00126169, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.0083016, 0.00087967, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00691378, 0.00046452, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00543877, 0.00001052, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00392367, -0.00045373, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.0024302, -0.00091504, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(0.00101012, -0.00136224, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00028764, -0.00178035, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00141839, -0.00215231, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00211132, -0.00237963, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00211455, -0.00237048, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.00211626, -0.00236563, 0.02720474)
boolstatus = Part.InsertCurveFilePoint(-0.0021168, -0.00236411, 0.02720474)
boolstatus = Part.InsertCurveFileEnd()
boolstatus = Part.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "Curve2")
End Sub

.
.
.

Sub Proc20()
Set Part = swApp.ActiveDoc
Part.InsertCurveFileBegin
boolstatus = Part.InsertCurveFilePoint(-0.00522598, -0.01340759, 0.13263761)
boolstatus = Part.InsertCurveFilePoint(-0.00522724, -0.01340759, 0.1326561)
boolstatus = Part.InsertCurveFilePoint(-0.00523089, -0.01340759, 0.13270962)
boolstatus = Part.InsertCurveFilePoint(-0.00523654, -0.01340759, 0.13279261)
boolstatus = Part.InsertCurveFilePoint(-0.00524364, -0.01340759, 0.13289681)
boolstatus = Part.InsertCurveFilePoint(-0.00525152, -0.01340759, 0.13301238)
boolstatus = Part.InsertCurveFilePoint(-0.00525946, -0.01340759, 0.13312893)
boolstatus = Part.InsertCurveFilePoint(-0.00465279, -0.01340759, 0.13327821)
boolstatus = Part.InsertCurveFilePoint(-0.00393952, -0.01340759, 0.13341622)
boolstatus = Part.InsertCurveFilePoint(-0.00320939, -0.01340759, 0.13352877)
boolstatus = Part.InsertCurveFilePoint(-0.00248296, -0.01340759, 0.13360667)
boolstatus = Part.InsertCurveFilePoint(-0.00178327, -0.01340759, 0.13363211)
boolstatus = Part.InsertCurveFilePoint(-0.00114406, -0.01340759, 0.13360345)
boolstatus = Part.InsertCurveFilePoint(-0.0005905, -0.01340759, 0.13352848)
boolstatus = Part.InsertCurveFilePoint(-0.00014384, -0.01340759, 0.13341938)
boolstatus = Part.InsertCurveFilePoint(0.00017986, -0.01340759, 0.1332904)
boolstatus = Part.InsertCurveFilePoint(0.00037024, -0.01340759, 0.13315493)
boolstatus = Part.InsertCurveFilePoint(0.00042266, -0.01340759, 0.13302262)
boolstatus = Part.InsertCurveFilePoint(0.00042266, -0.01340759, 0.13302262)
boolstatus = Part.InsertCurveFilePoint(0.00033912, -0.01340759, 0.1329077)
boolstatus = Part.InsertCurveFilePoint(0.0001265, -0.01340759, 0.13282048)
boolstatus = Part.InsertCurveFilePoint(-0.00020546, -0.01340759, 0.13275933)
boolstatus = Part.InsertCurveFilePoint(-0.0006438, -0.01340759, 0.13272076)
boolstatus = Part.InsertCurveFilePoint(-0.00117325, -0.01340759, 0.13269902)
boolstatus = Part.InsertCurveFilePoint(-0.00177694, -0.01340759, 0.13268629)
boolstatus = Part.InsertCurveFilePoint(-0.0024366, -0.01340759, 0.13267345)
boolstatus = Part.InsertCurveFilePoint(-0.00313926, -0.01340759, 0.13265421)
boolstatus = Part.InsertCurveFilePoint(-0.00386076, -0.01340759, 0.13263536)
boolstatus = Part.InsertCurveFilePoint(-0.00457242, -0.01340759, 0.13261517)
boolstatus = Part.InsertCurveFilePoint(-0.00522301, -0.01340759, 0.13259405)
boolstatus = Part.InsertCurveFilePoint(-0.00522417, -0.01340759, 0.13261114)
boolstatus = Part.InsertCurveFilePoint(-0.00522496, -0.01340759, 0.13262275)
boolstatus = Part.InsertCurveFilePoint(-0.00522547, -0.01340759, 0.13263013)
boolstatus = Part.InsertCurveFilePoint(-0.00522577, -0.01340759, 0.13263454)
boolstatus = Part.InsertCurveFilePoint(-0.00522593, -0.01340759, 0.13263688)
boolstatus = Part.InsertCurveFilePoint(-0.00522598, -0.01340759, 0.13263761)
boolstatus = Part.InsertCurveFileEnd()
boolstatus = Part.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "Curve20")
End Sub

Thank you so much !

A: it means that swApp is Nothing because you did not actually create it.
Heres how to do it :
 Set swApp = CreateObject("SldWorks.Application")

Source : Taken straight from the doc

A: You're setting a variable to a nothing.
Better do this way (with early binding):
Dim swApp as SldWorks.SldWorks
Set swApp = Application.SldWorks

This would allow you to utilize intellisense.


text:
Q: Can git clone benefit from http2 Can git clone benefit from http2?
I do always prefer ssh over http(s) because of various network errors but also ssh seems to be a bit faster than http(s). So my question is: Could git, especially clone, benefit from http2 s multiplexing functionality for example?

A: The smart protocol over HTTP uses a few long-running requests; HTTP/2 would not benefit dramatically here.
By contrast, the dumb protocol makes far more separate requests, and could benefit. However:

The dumb protocol is fairly rarely used these days. It's difficult to secure or make private, so most Git hosts (both cloud-based and on-premises) will refuse to use it.

In practice, without designing a new protocol to take advantage of HTTP/2, I would expect SSH to continue to give the best results.

A: This (http2 support) wasn't discussed much in the mailing list.
The only occurrence was about a GSoC 2015 project about git fetch:

Due to http limitations and stateless decision, a lot of data is sent
    back and forth during have/want negotiation for smart-http. I wonder
    if we could implement the "long polling" scheme in a CGI program. The
    program terminates HTTP requests and recreates a full duplex
    connection for upload-pack to talk to the client. upload-pack falls
    back to the normal mode, used by git:// and ssh://.
So basically Git-over-TCP-over-HTTP? :)

Yes. The hidden agenda was, if it works well, we might be able to deprecate smart-http one day. That day, if happens, would be in far future though. By that time hopefully we could just use http2 insteadof tcp-over-http1.

So yes, it could benefit Git, but its implementation is not yet actively pursued.


text:
Q: How to get an element centered while a floated element is next to it? I have an element that I want centered relative to the page, while having a floated element inline with it.
Html:

  I should be centered
  I'm on the right!

CSS:
.container{ text-align:center }
.centerMe{
  margin-left:auto;
  margin-right:auto;
}
.ontheright{float:right;}

The problem is that the centered element is centered relative to the space left over, after the floated element uses it up. I want it to center relative to the full width of the container. I have tried using position:absolute instead of float, but then it collides when the screen is too small.
http://jsfiddle.net/j5Mff/

A: You could put a left margin on the right-floated element of -100%.
Here's my answer in a forked version of that fiddle:
http://jsfiddle.net/frKET/1/
.container {
    position:relative;
    text-align:center
}
.centerMe {
    margin-left:auto;
    margin-right:auto;
}
.ontheright {
    float: right;
    margin-left: -100%;
}

A: You could also set relative positioning to the center-me div so that you could define a left property:
.centerMe {
margin-left:auto;
margin-right:auto;
position: relative;
left: 70px;
}

For your problem with colliding on small screen widths, you could use a media query:
@media screen and (max-width: 320px) {
.ontheright {
    float: none;
    top: 20px;
}
}

Be sure to include the meta viewport tag in your HTML for media queries.
Here is a fiddle

A: You could always change the float element to absolute positioning if it's always going to be at the top.
http://jsfiddle.net/j5Mff/1/
.container {
    position:relative;
    text-align:center
}
.centerMe {
    margin-left:auto;
    margin-right:auto;
}
.ontheright {
    position:absolute;
    top:0;
    right:0;
}


text:
Q: How to create a edit profile page for users on frontend with custom fields on wordpress? How to create a edit profile page for users on frontend with custom fields on wordpress? I tried using profile builder plugin but cannot insert custom fields like gender radio box etc.

A: You can do that by copy your theme's page.php to a new file named something like user-profile.php  and add to the very top of it this code:
<?php
/**
 * Template Name: User Profile
 *
 * Allow users to update their profiles from Frontend.
 *
 */

/* Get user info. */
global $current_user, $wp_roles;
//get_currentuserinfo(); //deprecated since 3.1

/* Load the registration file. */
//require_once( ABSPATH . WPINC . '/registration.php' ); //deprecated since 3.1
$error = array();
/* If profile was saved, update profile. */
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) {

    /* Update user password. */
    if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
        if ( $_POST['pass1'] == $_POST['pass2'] )
            wp_update_user( array( 'ID' => $current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
        else
            $error[] = __('The passwords you entered do not match.  Your password was not updated.', 'profile');
    }

    /* Update user information. */
    if ( !empty( $_POST['url'] ) )
        wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => esc_url( $_POST['url'] ) ) );
    if ( !empty( $_POST['email'] ) ){
        if (!is_email(esc_attr( $_POST['email'] )))
            $error[] = __('The Email you entered is not valid.  please try again.', 'profile');
        elseif(email_exists(esc_attr( $_POST['email'] )) != $current_user->id )
            $error[] = __('This email is already used by another user.  try a different one.', 'profile');
        else{
            wp_update_user( array ('ID' => $current_user->ID, 'user_email' => esc_attr( $_POST['email'] )));
        }
    }

    if ( !empty( $_POST['first-name'] ) )
        update_user_meta( $current_user->ID, 'first_name', esc_attr( $_POST['first-name'] ) );
    if ( !empty( $_POST['last-name'] ) )
        update_user_meta($current_user->ID, 'last_name', esc_attr( $_POST['last-name'] ) );
    if ( !empty( $_POST['description'] ) )
        update_user_meta( $current_user->ID, 'description', esc_attr( $_POST['description'] ) );

    /* Redirect so the page will show updated info.*/
  /*I am not Author of this Code- i dont know why but it worked for me after changing below line to if ( count($error) == 0 ){ */
    if ( count($error) == 0 ) {
        //action hook for plugins and extra fields saving
        do_action('edit_user_profile_update', $current_user->ID);
        wp_redirect( get_permalink() );
        exit;
    }
}
?>

then replace the loop of that page with this one:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div id="post-<?php the_ID(); ?>">

            <?php the_content(); ?>
            <?php if ( !is_user_logged_in() ) : ?>

                        <?php _e('You must be logged in to edit your profile.', 'profile'); ?>

            <?php else : ?>
                <?php if ( count($error) > 0 ) echo '
' . implode("
", $error) . '
'; ?>
                <form method="post" id="adduser" action="<?php the_permalink(); ?>">

                        <?php _e('First Name', 'profile'); ?>
                        <input class="text-input" name="first-name" type="text" id="first-name" value="<?php the_author_meta( 'first_name', $current_user->ID ); ?>" />

                        <?php _e('Last Name', 'profile'); ?>
                        <input class="text-input" name="last-name" type="text" id="last-name" value="<?php the_author_meta( 'last_name', $current_user->ID ); ?>" />

                        <?php _e('E-mail *', 'profile'); ?>
                        <input class="text-input" name="email" type="text" id="email" value="<?php the_author_meta( 'user_email', $current_user->ID ); ?>" />

                        <?php _e('Website', 'profile'); ?>
                        <input class="text-input" name="url" type="text" id="url" value="<?php the_author_meta( 'user_url', $current_user->ID ); ?>" />

                        <?php _e('Password *', 'profile'); ?>
                        <input class="text-input" name="pass1" type="password" id="pass1" />

                        <?php _e('Repeat Password *', 'profile'); ?>
                        <input class="text-input" name="pass2" type="password" id="pass2" />

                        <?php _e('Biographical Information', 'profile') ?>
                        <textarea name="description" id="description" rows="3" cols="50"><?php the_author_meta( 'description', $current_user->ID ); ?></textarea>

                    <?php
                        //action hook for plugin and extra fields
                        do_action('edit_user_profile',$current_user);
                    ?>

                        <?php echo $referer; ?>
                        <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profile'); ?>" />
                        <?php wp_nonce_field( 'update-user' ) ?>
                        <input name="action" type="hidden" id="action" value="update-user" />

                </form>
            <?php endif; ?>

    <?php endwhile; ?>
<?php else: ?>

        <?php _e('Sorry, no page matched your criteria.', 'profile'); ?>

<?php endif; ?>

and all that is left for you to do is create a new page and select the "user profile" as the page template.
now if all of this is too much you can use some plugins that do the hard work for you like:

*

*Frontend Edit Profile

*WP User Frontend

*Theme My Login

A: You can add extra user fields in wp-admin, for the users.
Use this in your functions.php, or in your plugin folder:
//extra user info in wp-admin
add_action( 'show_user_profile', 'yoursite_extra_user_profile_fields' );
add_action( 'edit_user_profile', 'yoursite_extra_user_profile_fields' );
function yoursite_extra_user_profile_fields( $user ) {
?>

<?php _e("Extra profile information", "blank"); ?>

      <?php _e("Company"); ?>

        <input type="text" name="company" id="company" class="regular-text"
            value="<?php echo esc_attr( get_the_author_meta( 'company', $user->ID ) ); ?>" />

      <?php _e("Job"); ?>

        <input type="text" name="job" id="job" class="regular-text"
            value="<?php echo esc_attr( get_the_author_meta( 'job', $user->ID ) ); ?>" />

      <?php _e("Country"); ?>

        <input type="text" name="country" id="country" class="regular-text"
            value="<?php echo esc_attr( get_the_author_meta( 'country', $user->ID ) ); ?>" />

      <?php _e("City"); ?>

        <input type="text" name="city" id="city" class="regular-text"
            value="<?php echo esc_attr( get_the_author_meta( 'city', $user->ID ) ); ?>" />

      <?php _e("Phone"); ?>

        <input type="text" name="phone" id="phone" class="regular-text"
            value="<?php echo esc_attr( get_the_author_meta( 'phone', $user->ID ) ); ?>" />

<?php
}

After that you must save your fields when editing in wp-admin
//Save our extra registration user meta.
add_action('user_register', 'myplugin_user_register');
function myplugin_user_register ($user_id) {
    if ( isset( $_POST['phone'] ) )
        update_user_meta($user_id, 'phone', $_POST['phone']);

    if ( isset( $_POST['company'] ) )
        update_user_meta($user_id, 'company', $_POST['company']);

    if ( isset( $_POST['job'] ) )
        update_user_meta($user_id, 'job', $_POST['job']);

    if ( isset( $_POST['country'] ) )
        update_user_meta($user_id, 'country', $_POST['country']);

    if ( isset( $_POST['city'] ) )
        update_user_meta($user_id, 'city', $_POST['city']);

    if ( isset( $_POST['user_interest'] ) )
        update_user_meta($user_id, 'user_interest', $_POST['user_interest']);

}

This functions will add custom fields to your users.
After that, in the frontend, of course you can use wp_insert_user(); function and wp_update_user(); to register and edit a user with all custom fields you created.


text:
Q: Can someone explain what they mean by Github Pages being static I understand Github Pages and what they are but don't understand what they mean by them saying they are static. Does it mean you cant get any animations on it?

A: The term 'static' refers to how the website is delivered. So for GitHub pages, (in general) you create HTML files that are served 'statically', which means as they are. They can still include CSS files with animations, or JavaScript files that manipulate the page.
This is different compared to a system that serves dynamic webpages, which can create and serve pieces of the website page as required from the server end.
For a more thorough explanation, see here:

*

*Wikipedia

*Wix.com


text:
Q: Why can't I set the attributes of client.intents? I try to write a discord bot and had some issues getting the list of users connected to a voice channel. I was told to set the intents. So I read the documentation and wrote this bit of code:
client = discord.Client()
client.intents.members = True
client.intents.presences = True
print_intents()

The print_intents method is one I made myself and it does what the name suggests, it prints the values of all attributes of the client.intents object. This outputs the following:
bans: True
dm_messages: True
dm_reactions: True
dm_typing: True
emojis: True
guild_messages: True
guild_reactions: True
guild_typing: True
guilds: True
integrations: True
invites: True
members: False
messages: True
presences: False
reactions: True
typing: True
value: 32509
voice_states: True
webhooks: True

This matches the default settings of Intents as returned by its default method. The two values I wanted changed still have their default values. I don't understand why that's the case. In the documentation it says:

Similar to Permissions, the properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools.

A: The attribute client.intents must be of the discord.Intents class. They cannot be assigned the way you have done it. (According to documents, it must be of type discord.Intents).
See discord.Intents docs.
You should use discord.Intents.all() as it will define all intents as True. The .default() removes only the ones you want. .all() won't.
The best way to do this is during initialization.
intents = discord.Intents.all() # You can use this
# OR create Intents and manually change the values
intents = discord.Intents.default()
intents.members = True
intents.presences = True
client = discord.Client(intents=intents)


text:
Q: Set table row position with jquery I am trying to set the position of a table row with jquery and this is how I am doing it
top_position = $("#table_id").offset().top;
$("#table_id tr:nth-child(1)").offset().top = top_position;

This does not change the table row I am trying to change. But when I try this:
alert(top_position);
table_row_position = $("#table_id tr:nth-child(1)").offset().top;
alert(table_row_position);

I get both positions correctly alerted, so why doesn't resetting the position work?

A: You can use the Core/index function in a given context, for example you can check the index of the TD in it's parent TR to get the column number, and you can check the TR index on the Table, to get the row number:
You can try something like :
$('#table_id tr td').click(function(){
  var col = $(this).parent().children().index($(this));
  var row = $(this).parent().parent().children().index($(this).parent());
  alert('Row: ' + row + ', Column: ' + col);
});

Check a running example here.

A: .offset().top will tell you where something is but you should be using css to move the object so try something like this.
$("#table_id tr:nth-child(1)").css("margin-top", top_position);

see this for more information
http://api.jquery.com/offset/


text:
Q: apscheduler - multiple instances I have apscheduler running in django and it appears to work ... okay.  In my project init.py, I initialize the scheduler:
scheduler = Scheduler(daemon=True)

print("\n\n\n\n\n\n\n\nstarting scheduler")

scheduler.configure({'apscheduler.jobstores.file.class': settings.APSCHEDULER['jobstores.file.class']})
scheduler.start()

atexit.register(lambda: scheduler.shutdown(wait=False))

The first problem with this is that the print shows this code is executed twice.  Secondly, in other applications, I'd like to reference the scheduler, but haven't a clue how to do that.  If I get another instance of a scheduler, I believe it is a separate threadpool and not the one created here.

*

*how do I get one and only one instance of apscheduler running?

*how do I reference that instance in other apps?

A: *

*That depends on how you ended up with two scheduler instances in the first place. Are you starting apscheduler in a worker thread/process? If you have more than one such worker, you're going to get multiple instances of the scheduler. So, you have to find a way to prevent the scheduler from being started more than once by either running it in a different process if possible, or adding some condition to the scheduler startup.

*You don't. Variables are local to each process. The best you can do is to build some kind of remote execution system, either using some kind of a ReST service or some remote control system like execnet or rpyc.


text:
Q: openpyxl: TypeError: load_workbook() got an unexpected keyword argument 'guess_types' when i'm try to use
load_workbook(filename=self.file_name, guess_types=True)
When i'm appending new data to existing sheet all the cells are formatted as 'General'
I want to use the .append() method and to keep the originals cells types from the loaded workbook
I'm getting this Error:
in __init__
    self.wb = load_workbook(filename=self.file_name,guess_types=True)
TypeError: load_workbook() got an unexpected keyword argument 'guess_types'

(python 3.7)
Openpyxl last ver


text:
Q: ArrayBuffer and Float64Array in Swift I'm trying to convert one of the javascript functions into Swift 5 function. But even after so much of extensive search I couldn't find anything on it.
function toArrayBuffer(type, ts, x, y, z, sc) {
  let userId = userID.getUserId();
  //console.log("Found GPS UserID: " + userId);
  if (userId == "Unauthor") {
    //console.log("GPS did not find the userID")
    return null;
  }

  let buffer = new ArrayBuffer(8 * 4);

  // Offset: 0
  let float64Bytes = new Float64Array(buffer);
  float64Bytes[0] = ts;

  // Offset: 8
  let bytes = new Float32Array(buffer);
  bytes[2] = x;
  bytes[3] = y;
  bytes[4] = z;
  bytes[5] = sc;

  // Offset: 24
  let uint8Bytes = new Uint8Array(buffer);
  uint8Bytes[24] = type;

  for (let i = 0; i < 8; i++) {
    if (userId.charCodeAt(i)) {
      uint8Bytes[i + 25] = userId.charCodeAt(i);
    }
  }

  return buffer;
}

Basically I tried to build the same function with var byteArray = [UInt8](stringVal.utf8) but UInt8 can store only upto 256, but I had to store epoch time stamp. So, it doesn't work too. Any help would be appreciated.


text:
Q: Who started the "-oid" suffix fashion in math? There are lots of structures which have name suffixed by "oid".  Off the top of my head, matroid, greedoid, perfectoid, causaloid...
Who started this? AFAIK, "matroid", by Whitney, was a start, and led the way to several combinatorial oids.  However, the Cardioid has had its name for some centuries now, so the use of the suffix is old.
Still, it seems a bit different to name a family of specific objects, and to name some sort of abstract structure.

A: The suffix "-oid" means the same as "quasi", so "resembling", "like". A groupoid is a quasi-group, like a group. There are hundreds of words in that category, covering many scientific disciplines.
In the "early use of mathematical words" database I find:
250 BC: conchoid
200 BC: cissoid
400: trapezoid
1650: trochoid
1672: ellipsoid
1685: cochleoid
1830: epicycloid
1836: paraboloid
1837: strophoid
1844: centroid
1872: geoid, gyroid
1878: nephroid
1879: deltoid
1881: prismatoid
1891: cuboid
1935: matroid
The Woid on-Oid by William Safire comments on the proliferation of -oids:

We all know that the use of -oid to create a noun has been growing by
leapoids and bounds. Among the earliest were android, or "automaton
in human form," created in 1727, and asteroid, "small body like a
star," in 1802. Scientists and mathematicians were especially
attracted to the ending, juggling their cylindroids, globoids and
spheroids.

A: Though this might not be what you are expecting, I will explain you "oidification" or horizontal categorification as I understood (Experts are fell free to add or edit as necessary). This is the process that generalizes a "certain type of category with a single object" to "such type of categories with multiple objects". This is done mostly via "enriching" the initial category $\mathcal{C}$ over another monoidal category $\mathcal{K},$ which roughly says homsets (set of arrows two objects) of $\mathcal{C}$ are replaced by objects of $\mathcal{K}.$
Examples include

X
X-oid
Enrichment

monoid
Category
categories enriched over Set

Category
2-Category
categories enriched over Cat

Group
Groupoid

Ring
Ringoid
category enriched in tensor category Ab

Quantale
Quantaloid
category enriched in suplattices

Algebr
Algebroid
category enriched in Vect or RMod

C*-algebra
C*-category
*-category enriched in Ban

You can find more details ringoid, and algebroid here. But as far as I know Hopf algebroids and Lie algebroids does not fit into this general definition of algebroids, but still multi-object generalizations of their counterparts.
Also, it should worth remind that not every enrichment of a categories consider as an "odification". For example (Lawvere) generalized metric spaces is a  category enriched in the monoidal poset category $([0,\infty],\ge),$ where the monoidal product is taken to be addition.


text:
Q: how to move multiple blobs in one transaction? How can we move multiple blobs in one transaction?
I'm currently moving 1 blob at a time like so:
    public static async Task MoveBlobInSameStorageAccount(string name, string from, string to, string connection)
    {
        CloudStorageAccount.TryParse(connection, out CloudStorageAccount storageAccount);
        var blobClient = storageAccount.CreateCloudBlobClient();
        var sourceContainer = blobClient.GetContainerReference(from);
        var sourceBlob = sourceContainer.GetBlockBlobReference(name);
        var destinationContainer = blobClient.GetContainerReference(to);
        var destinationBlob = destinationContainer.GetBlockBlobReference(name);
        await destinationBlob.StartCopyAsync(sourceBlob);
        await sourceBlob.DeleteAsync();
    }

However, I need to be able to move 5 - 10 blobs at a time.
How do we move multiple blobs in one transaction from a source container to a destination container?

A: You can use the Microsoft Azure Storage Data Movement Library. I recently used it on a project, worked well.
Specifically, you want to use:

CopyDirectoryAsync

There is a samples folder in the GitHub repo that you can reference. I didn't need most of the code in the samples, so I modified:

BlobDirectoryCopySample

I also used the Utils class in the sample folder. You can set ParallelOperations as well, which "gets or sets a value indicating how many work items to process concurrently".
namespace DataMovementSamples
{
    using System;
#if !DOTNET5_4
#endif
    using System.Threading.Tasks;
    using Microsoft.Azure.Storage.DataMovement;

    public class Program
    {
        public static async Task Main(string[] args)
        {
            try
            {
                Console.WriteLine();
                Console.WriteLine("Data movement directory copy sample.");
                await BlobDirectoryCopySample();
            }
            finally
            {
                Console.WriteLine();
                Console.WriteLine("Cleanup generated data.");
            }
        }

        private static async Task BlobDirectoryCopySample()
        {
            var sourceBlobDir = await Util.GetCloudBlobDirectoryAsync("sourcecontainer", "dir1");
            var destBlobDir = await Util.GetCloudBlobDirectoryAsync("targetcontainer", "dir2");

            var options = new CopyDirectoryOptions()
            {
                Recursive = true,
            };

            var context = new DirectoryTransferContext();
            context.FileTransferred += FileTransferredCallback;
            context.FileFailed += FileFailedCallback;
            context.FileSkipped += FileSkippedCallback;

            TransferManager.Configurations.ParallelOperations = 50;
            Console.WriteLine("Transfer started");

            try
            {
                Task task = TransferManager.CopyDirectoryAsync(sourceBlobDir, destBlobDir, false, options, context);
                await task;
            }
            catch (Exception e)
            {
                Console.WriteLine("The transfer is cancelled: {0}", e.Message);
            }

            Console.WriteLine("The transfer is completed.");
        }

        private static void FileTransferredCallback(object sender, TransferEventArgs e)
        {
            Console.WriteLine("Transfer Succeeds. {0} -> {1}.", e.Source, e.Destination);
        }

        private static void FileFailedCallback(object sender, TransferEventArgs e)
        {
            Console.WriteLine("Transfer fails. {0} -> {1}. Error message:{2}", e.Source, e.Destination, e.Exception.Message);
        }

        private static void FileSkippedCallback(object sender, TransferEventArgs e)
        {
            Console.WriteLine("Transfer skips. {0} -> {1}.", e.Source, e.Destination);
        }
    }
}


text:
Q: HAProxy health check in tcp mode on https 404 status code I have two servers each running one Wildfly application server with one service available via https. The service is taking care of the https encryption. In front of the two servers I have an HAProxy as a load balancer in tcp mode to pass the ssl traffic through to the two services.
The HAProxy health check only checks if the server is online, not the service. If the service is not running Wildfly returns:
<title>Error</title>404 - Not Found

which HAProxy interprets as healthy.
HAProxy config:
global
    maxconn 2000

defaults
    log     global
    mode    http
    option  dontlognull
    retries 3
    option redispatch
    timeout connect  5000
    timeout client  10000
    timeout server  10000

listen backend
    bind *:8443
    mode tcp
    balance roundrobin
    option httpclose
    server backend1 wildfly:8443 check
    server backend2 xxx.xxx.xxx.xxx:8443 check

How can I make HAProxy understand that 404 - Not Found is not healthy.

A: Two lines did the trick:

*

*option httpchk /server

*

*httpchk tells HAProxy to send an http request  and check the response status

*/server specifies the URI / Subdomain of my service

*server backend1 wildfly:8443 check check-ssl verify none

*

*check-ssl tells HAProxy to check via https instead of http

*verify none tells HAProxy to trust the ssl certificate of the service (alternativly you can specify a .pem file)

Full HAProxy config:
global
    maxconn 2000

defaults
    log     global
    mode    http
    option  dontlognull
    retries 3
    option redispatch
    timeout connect  5000
    timeout client  10000
    timeout server  10000

listen backend
    bind *:8443
    mode tcp
    balance roundrobin
    option httpchk /server
    server backend1 xxx.xxx.xxx.xxx:8443 check check-ssl verify none
    server backend2 xxx.xxx.xxx.xxx:8443 check check-ssl verify none


text:
Q: Microsoft access: Search three tables and show unmatched item Currently working on a school project and would like some help. I have 3 different tables:

*

*Fund data

*Email tracking

*Meetings

I am trying to locate all Funds (from Fund data table) that we have not emailed or met before (these come from the Email tracking and Meetings tab respectively).
As I am a novice, I tried solving it using query criteria such as this but to no avail:
<>[Email tracking].[Fund name] Or <>[Meetings].[Fund name]

Attached is the screenshot of my query as well as my relationship view.
Thank you for your time.
Query

Relationship

A: Are you for looking something like
select * from fundtable where fundName not in  (select fundName from EmailTable)
or fundName not in (Select fundName from emailTable)


text:
Q: How to show data from a db on a page in a web app? I've setup a database, populated it with data manually for the sake of simplicity, created and set up a jinja template, so my Clojure in Lumminus is working. But how can I actually select data from my db and pass into the template? I have no idea and here http://www.luminusweb.net/docs/guestbook.md#accessing_the_database it's not explained clearly, it just says what I'm able to and not to do.
So how can I actually retrieve data from the db and display it on an html page? Could anyone help me?
On  my html page I have this:
  {% for article in articles %}
    Title is: {{article.title}}
  {% endfor %}


text:
Q: What is RangeFinder("CTBookmark", "CTMarkupRange") in docx4j? In the BookmarksReplaceWithText.java sample for docx4j, I see the following line.  What does RangeFinder do exactly?  I could not find a clear description.
RangeFinder rt = new RangeFinder("CTBookmark", "CTMarkupRange");

A: From what I understand, the RangeFinder gathers all of the bookmark start and end points in the xml file. The RangeFinder needs to be put into a TraversalUtil along with the object you are searching in (can be the whole document or a paragraph or whatever):
RangeFinder rt = new RangeFinder("CTBookmark", "CTMarkupRange");
new TraversalUtil(paragraphs, rt);

Once this is done, you can call rt.getStarts() or rt.getEnds() to get a list of the start and end bookmark locations. What I mean by this is if you look at the XML file of a document you will find bookmark starts and bookmark ends for example:
<w:bookmarkStart w:id="1" w:name="BookmarkName"/>
    <w:r>
        <w:t>bookmark</w:t>
    </w:r>
<w:bookmarkEnd w:id="1"/>

With this you can replace the content as described in BookmarksReplaceWithText.java or any number of other things.

A: See RangeFinder.java
It gives you a list of the bookmark start and end objects.


text:
Q: Magento 2: How to add rating filter in magento ver 2.3 I want to add a rating filter in layer navigation. For that, I have copy module-catalog from vendor/magento to app/design/frontend/Magento. So in which file we need to add rating code? I have tried many blogs but did not get success.

A: create one file Called Rating.php as of now i did in core module only which can be implemented in your custom module vendor\magento\module-catalog\Model\Layer\Filter\Rating.php
<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Catalog\Model\Layer\Filter;

use Magento\Catalog\Model\Category as CategoryModel;
use Magento\Catalog\Model\CategoryFactory as CategoryModelFactory;
use Magento\Catalog\Model\Layer;
use Magento\Framework\Registry;
/**
 * Layer category filter
 *
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Rating extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
{
    /**
     * Active Category Id
     *
     * @var int
     */
    protected $_categoryId;

    /**
     * Applied Category
     *
     * @var \Magento\Catalog\Model\Category
     */
    protected $_appliedCategory;

    /**
     * Core data
     *
     * @var \Magento\Framework\Escaper
     */
    protected $_escaper;

    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry;

    /**
     * @var CategoryDataProvider
     */
    private $dataProvider;

    /**
     * Construct
     *
     * @param \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\Catalog\Model\Layer $layer
     * @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder
     * @param \Magento\Framework\Escaper $escaper
     * @param CategoryFactory $categoryDataProviderFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Catalog\Model\Layer $layer,
        \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder,
        \Magento\Framework\Escaper $escaper,
        array $data = []
    ) {
        parent::__construct($filterItemFactory, $storeManager, $layer, $itemDataBuilder, $data);
        $this->_escaper = $escaper;
        $this->_requestVar = 'rat';
    }

    /**
     * Get filter value for reset current filter state
     *
     * @return mixed|null
     */
    public function getResetValue()
    {
        return $this->dataProvider->getResetValue();
    }

    /**
     * Apply category filter to layer
     *
     * @param   \Magento\Framework\App\RequestInterface $request
     * @return  $this
     */
    public function apply(\Magento\Framework\App\RequestInterface $request)
    {
        /**
         * Filter must be string: $fromPrice-$toPrice
         */
        $filter = $request->getParam($this->getRequestVar());
        if (!$filter) {
            return $this;
        }
        $filter = explode('-', $filter);
        list($from, $to) = $filter;
         $collection = $this->getLayer()->getProductCollection();

        $collection->getSelect()->joinLeft(array('rova'=> 'rating_option_vote_aggregated'),'e.entity_id =rova.entity_pk_value',array("percent"))
        ->where("rova.percent between ".$from." and ".$to)
        ->group('e.entity_id');
        //$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
        //$collection->printlogquery(true);
        return $this;
    }

    /**
     * Get filter name
     *
     * @return \Magento\Framework\Phrase
     */
    public function getName()
    {
        return __('Rating');
    }

       /**
     * Get data array for building attribute filter items
     *
     * @throws \Magento\Framework\Exception\LocalizedException
     * @return array
     */
    protected function _getItemsData()
    {

        $facets = array(
            '0-20'=>'1 Start',
            '21-40'=>'2 Start',
            '41-60'=>'3 Start',
            '61-80'=>'4 Start',
            '81-100'=>'5 Start'
            );
     $collection = $this->getLayer()->getProductCollection();
        $data = [];
        if (count($facets) > 1) { // two range minimum
            $i=1;
            foreach ($facets as $key => $label) {
               $count=$this->prepareData($key,$collection,$i);
               $i++;
               $this->itemDataBuilder->addItemData(
                    $this->_escaper->escapeHtml($label),
                    $key,
                    $count
                );
            }
        }

        return $this->itemDataBuilder->build();

        /* $this->itemDataBuilder->addItemData(
            $this->tagFilter->filter('5 star'),
            '80-100',
            1
        );
        return $this->itemDataBuilder->build(); */
    }
    /**
     * @param string $key
     * @param int $count
     * @return array
     */
    private function prepareData($filter,$collection,$i)
    {
       $filter = explode('-', $filter);
        list($from, $to) = $filter;
          /** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */

        $collection->getSelect()->joinLeft(array('rova'.$i=> 'rating_option_vote_aggregated'),'e.entity_id =rova'.$i.'.entity_pk_value',array("percent"))
        ->where("rova".$i.".percent between ".$from." and ".$to)
        ->group('e.entity_id');
        //$collection->printlogquery(true); echo '
............................
';
        return $collection->getSize();
    }
}

and in vendor\magento\module-catalog\Model\Layer\FilterList.php add rating filter option if you wrote custom module add this option by plugin
public function getFilters(\Magento\Catalog\Model\Layer $layer)
    {
        if (!count($this->filters)) {
            $this->filters = [
                $this->objectManager->create($this->filterTypes[self::CATEGORY_FILTER], ['layer' => $layer]),
                 $this->objectManager->create($this->filterTypes['Magento\Catalog\Model\Layer\Filter\Rating'], ['layer' => $layer]),
            ];
            foreach ($this->filterableAttributes->getList() as $attribute) {
                $this->filters[] = $this->createAttributeFilter($attribute, $layer);
            }
        }
        return $this->filters;
    }

it will bring rating filter and do filter with product collection


text:
Q: How to keep track with std::forward_list 's first element? I want to save an iterator of the first elements in a forward list as it and do some insert on the list. Then I want to erase the element at it.
For example, in {20,30,40,50} and insert 10 at front. We get {10,20,30,40,50}. Then I want to erase 20, which means I want {10,30,40,50}.
I tried to use before_begin() but it seems that it always point to the before of begin() of the list even after inserting.
#include <bits/stdc++.h>
using namespace std;
int main()
{
    forward_list<int> fl = { 20, 30, 40, 50 };
    auto it = fl.before_begin();
    fl.emplace_front(10);
    fl.erase_after(it);
    cout << "Element of the list are:" << endl;
    for (auto it = fl.begin(); it != fl.end(); ++it)
        cout << *it << " ";
    return 0;
}

Have 20,30,40,50 rather than 10,30,40,50.
Is there any way to store a inerator that after ++, it will point to the begin element.

A: I solve this problem by adding an count, counting the number inserted at front and then move iterators from begin().


text:
Q: Why is a trait not implemented for a type that clearly has it implemented? I'm trying to use Diesel to query a MySQL database and display the results with a Handlebars template with Rocket.
I have this in models.rs
#[derive(Queryable, Serialize)]
pub struct Post {
    pub id: i32,
    pub title: String,
    pub text: String,
    pub published: bool,
}

cargo run outputs this:
  --> src/main.rs:69:5
   |
69 |     Template::render("index", &results)
   |     ^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `tasty::models::Post`
   |
   = note: required because of the requirements on the impl of `serde::ser::Serialize` for `std::vec::Vec<tasty::models::Post>`
   = note: required by `rocket_contrib::Template::render`

In my Cargo.toml, I have this:
[dependencies]
chrono = "0.3.0"
rocket = "0.2.8"
rocket_codegen = "0.2.8"
serde = "1.0.8"
serde_derive = "1.0.8"
serde_json = "1.0.2"
mysql = "11.1.2"
diesel = { version = "0.13.0", features = ["mysql","chrono"] }
diesel_codegen = { version = "0.13.0", features = ["mysql"] }
dotenv = "0.10.0"

[dependencies.rocket_contrib]
version = "*"
default-features = false
features = ["handlebars_templates"]

I have read that Diesel does not support Serialize at the moment, but I am not sure.

A: The general problem is that the code has multiple versions of the crate, each providing a different version of the traits. The fact that Rust allows this is a good thing, but the error messages around it are confusing.
Your crate implements Serialize from version A but the library is using version B in a public interface. These traits are not compatible, so when you pass your type implementing Serialize@A to the function requiring Serialize@B, the compiler stops you.
While your example is about different traits, it's also possible for this to occur for types which have been re-exported from a crate.
cargo tree, available starting in Rust 1.44 is highly useful to verify this is your problem. It shows all of your dependencies and their versions. It even has a -d flag to show duplicate dependencies! That mode isn't shown here, but is highly useful.
The general solution is to manually restrict your version of Serde in your Cargo.toml to match the rest of the dependencies:
serde = "0.9"
serde_derive = "0.9"
serde_json = "0.9"

This may not always be possible, in which case you may need to hound the crate owners to upgrade their dependencies.

Worked examples
Rocket
[dependencies]
chrono = "0.3.0"
rocket = "0.2.8"
rocket_codegen = "0.2.8"
serde = "1.0.8"
serde_derive = "1.0.8"
serde_json = "1.0.2"
mysql = "11.1.2"
diesel = { version = "0.13.0", features = ["mysql","chrono"] }
diesel_codegen = { version = "0.13.0", features = ["mysql"] }
dotenv = "0.10.0"

[dependencies.rocket_contrib]
version = "*"
default-features = false
features = ["handlebars_templates"]

rocket_contrib 0.2.8 depends on Serde 0.9, but you have pulled in Serde 1.0. This abridged snippet from cargo tree shows the problem:
reproduction v0.1.0 (file:///private/tmp/reproduction)
├── rocket_contrib v0.2.8
│   ├── handlebars v0.25.3
│   │   └── serde_json v0.9.10
│   │       └── serde v0.9.15
│   ├── serde v0.9.15 (*)
│   └── serde_json v0.9.10 (*)
├── serde v1.0.8 (*)
├── serde_derive v1.0.8
│   ├── serde_derive_internals v0.15.1
└── serde_json v1.0.2 (*)

The upcoming version 0.3 of Rocket should allow using Serde 1.0.
Iron / Bson / MongoDB
[dependencies]
bodyparser = "0.5"
bson = "0.8"
iron = "0.5"
jwt = "0.4"
mongodb = "0.3"
router = "0.5"
rust-crypto = "0.2"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
time = "0.1"

bodyparser 0.5 depends on Serde 0.8, MongoDB has pulled in 0.9, but the crate and BSON have pulled in Serde 1.0. This abridged snippet from cargo tree shows the problem:
reproduction v0.1.0 (file:///private/tmp/reproduction)
├── bodyparser v0.5.0
│   ├── serde v0.8.23
│   └── serde_json v0.8.6
│       └── serde v0.8.23 (*)
├── bson v0.8.0
│   ├── serde v1.0.8
│   ├── serde_json v1.0.2
│   │   └── serde v1.0.8 (*)
├── mongodb v0.3.0
│   ├── textnonce v0.6.0
│   │   ├── serde v0.9.15
│   │   └── serde_derive v0.9.15
├── serde v1.0.8 (*)
├── serde_derive v1.0.8
├── serde_json v1.0.2 (*)

Bodyparser 0.7.0 should support Serde 1.0. The state of textnonce is less clear, but that dependency might be a private one, so it might not matter in this case.
Diesel / Chrono
chrono = "0.4.0"
diesel = { version = "0.13.0", features = [ "chrono", "sqlite" ] }
diesel_codegen = { version = "0.13.0", features = [ "sqlite" ] }
dotenv = "0.9.0"

The current version of Chrono is 0.4.0, but Diesel only knows how to serialize Chrono 0.3.0.
reproduction v0.1.0 (file:///private/tmp/reproduction)
├── chrono v0.4.0
├── diesel v0.13.0
│   ├── chrono v0.3.0

blowfish / block-cipher-trait
[dependencies]
blowfish = "0.2.1"
block-cipher-trait = "0.3.0"

reproduction v0.1.0 (file:///private/tmp/reproduction)
├── block-cipher-trait v0.3.0
│── blowfish v0.2.1
    ├── block-cipher-trait v0.2.0

conrod / piston2d-graphics
[dependencies]
piston_window = "0.74.0"
conrod = { version = "0.56.0", features = ["piston"] }

repro v0.1.0 (file:///private/tmp/repro)
├── conrod v0.56.0
│   ├── piston2d-graphics v0.23.0
└── piston_window v0.74.0
    ├── piston2d-graphics v0.24.0 (*)

actix / futures
[dependencies]
actix-web = "0.6.10"
futures = "0.2.1"

repro v0.1.0 (file:///private/tmp/repro)
├── actix-web v0.6.12
│   ├── actix v0.5.8
│   │   ├── futures v0.1.21
└── futures v0.2.1

A bright future?
RFC 1977 proposes to introduce the notion of public and private dependencies to Cargo. If you use a crate that in turn publicly exposes another crate's types, Cargo would ensure that you use a single unified version for the crate with the common types.


text:
Q: Setting _id by parsing a field in the _source document Say I have documents that look like this:
{
  "url": "http://example.com/blog/title-of-some-blog-post",
  "author": "John Smith"
}

Say I have an ElasticSearch index named blog which has a type named post in it. This type holds documents like the one above. I want the _id of the above document to be title-of-some-blog-post. What should my type mapping look like?
So far, I've been able to make the _id the same as the url field but that means the _id also contains "http://example.com/blog/", which I wish to omit. The mapping I'm using to make this happen is:
"post": {
  "_id": {
    "type": "string",
    "path": "url"
  }

Is there some way to apply a regex to the url field so I can extract everything after the rightmost slash into the _id?

A: There is no out-of-the-box way to generate fields on the fly based on your actual fields. Although a similar feature might come in the feature, for now you just need to add a field that contains what you need, or even better provide the id outside of your documents. The latter would be better since the _id field is used to decide where to route your documents, and if it's part of your documents, the documents need to be parsed in order to know where they are supposed to go.


text:
Q: How can I apply a new Emacs C style to reformat all my source files? I'd like to re-format all my source files using the Google formatting function for emacs: google-c-style.el (see here).
How can I apply this function to all my source files at once, so that they are all formatted and indented correctly according to the Google style?

A: There are several pieces to this:

*

*you need to come up with EMACS functions to do all the reformatting you want.  indent-region is a start, but you might also want to untabify or some other things.

*you need to invoke them on each file, and since the indent functions work on ranges, you need a function that sets mark to cover the whole file: mark-whole-buffer.

*you need to invoke EMACS on each file: this means invoking emacs with the --batch file.

There's a couple of nice blog posts on doing this here and here.

A: I have done this before by using a keyboard defined macro.   I would load all of the files into emacs (something like find . -name "*.cpp" | xargs emacs) and then type the following keys.  I've annotated each key combination with what it does.
C-x-(                  'Begin recording macro
M-<                    'Go to start of file
C-space                'Mark current location (now start of file)
M->                    'Go to end of file
M-x indent-region      'Indent entire file according to coding style
C-x C-s                'Save the current buffer
C-x C-k                'Close the current buffer
C-x-)                  'End recording macro

Now you can run this on a buffer by typing C-x e.   If you have loaded several files you can run something like C-u 100 C-x e to run this on 100 files.   If this is more than the number of files, that is ok, you'll just get some "bell ring" or other error you can ignore once all the processing is complete.

A: I believe that this script does not do reformatting. Instead it's an example of how to build a custom "style" as described in: CC mode manual - Styles
CC-mode manual also says:

If you want to reformat old code, you're probably better off using some other tool instead, e.g. GNU indent, which has more powerful reformatting capabilities than CC Mode.

CC mode manual - Limitations-and-Known-Bugs

A: If you want to mark the source files in a dired buffer and then run a function to format each you can do something like this:
(defun clean-file(filename)
  (your-function-goes-here))

(defun clean-each-dired-marked-file()
  (interactive)
  (for-each-dired-marked-file 'clean-file))

(defun for-each-dired-marked-file(fn)
 "Do stuff for each marked file, only works in dired window"
 (interactive)
 (if (eq major-mode 'dired-mode)
     (let ((filenames (dired-get-marked-files)))
       (mapcar fn filenames))
   (error (format "Not a Dired buffer \(%s\)" major-mode))))


text:
Q: Range-based for loop with decltype(auto) Is there a situation when decltype(auto) would be a better choice than auto (possibly with &, &&, or cv qualifiers) when using range-based for loops? In other words, would you ever write the following code?
for (decltype(auto) item : range) {
    // ...
}

A: As mentioned here:

decltype(auto) is primarily useful for deducing the return type of forwarding functions and similar wrappers
[...]
although it can be used to declare local variables, doing that is probably just an antipattern since a local variable's reference-ness should not depend on the initialization expression

That said, using a forwarding reference in a range-based for loop is the way to go.
As mentioned here:

It is safe, and in fact, preferable in generic code, to use deduction to forwarding reference

I'd suggest this question on SO for further details about using an universal reference in a range-based for loop.

A: decltype(auto) generates a different type when the input iterator returns by value.  auto&& creates an rvalue reference to the temporary, while decltype(auto) creates a local copy (in C++17 it just names the temporary because of the guaranteed elision change).
This has little difference.  In C++11/14, it requires a move ctor (that is not called in practice, but required) in the decltype(auto) case, but not in C++17.  In the auto&& the move ctor is not called and not required.
Another difference is the type of decltype(item), which is a reference always with auto&&, but in the case of the temporary returning input iteraror decltype(item) is a value type.
That is about it.  In practice, I see no reason to decltype(auto) over auto&&.
As an aside, auto& forces non-rvalue, const auto& forces non-mutable, and auto forces a copy.  There are reasons to use auto&& instead of those, but that is outside the scope of this question.  decltype(auto) is closest to auto&&, so I compared those two.


text:
Q: near linearly dependent I'm considering a situation where vectors are nearly linearly dependent.
Suppose that $A$ is $2 \times 2$ matrix
$A= \left[
\begin{array}{cc}
1 & a \\
a & 1
\end{array}
\right] $
If $a=1$, $A$ is of course singular and linearly dependent. But if $a=0$ and $a=0.999$, $A$ is non-singular for both cases. But, apparently $a=0.999$ is more close to being singular or linearly dependent than $a=0$. In this $2 \times 2$ case, the determinant can be used to measure the closeness to being singular or linearly dependent.
Now consider $3 \times 2$ matrices $B_1$ and $B_2$
$B_1 = \left[
\begin{array}{cc}
1 & 0 \\
1 & 1 \\
1 & 2
\end{array}
\right] $
$B_1 = \left[
\begin{array}{cc}
1 & 0.999 \\
1 & 1 \\
1 & 1.001
\end{array}
\right] $
Mathematically, both $B_1$ and $B_2$ are linearly dependent. But, $B_2$ is more close to being linearly dependent than $B_1$.
My question is are there any ways to measure the closeness to being linearly dependent for such non-square matrix. In other words, how can I demonstrate that $B_2$ is close to being linearly dependent than $B_1$.

A: A square matrix of rank $r$ has $r$ non-zero eigenvalues (may be multiple). So it is singular iff one of its eigenvalues is zero. The determinant (i.e. the product of all eigenvalues) is not a good quantitative measure for singularity. For example the matrix
$\left[
\begin{array}{cc}
10^{10} & 0 \\
0 & 10^{-10}
\end{array}
\right] $
has determinant $1$ but clearly (for me) is more singular than the identity matrix.
The smallest eigenvalue by magnitude is a better measure for that (possibly normalized by the largest eigenvalue).
The generalization for non-square matrices you are looking for are singular values. The smallest singular value is zero for singular matrices and close to zero for almost singular matrices. In your example matrices they are 0.915272 and 0.001, respectively.

A: Definitely. For square matrices, just calculate the determinant: if the result is close to zero, then the columns of your matrix are close to be linearly dependent (though, strictly speaking, they are not exactly linearly dependent). For a non-square matrix $B$, the columns are nearly dependent if the determinant of $B^TB$ is nearly zero.


text:
Q: Electron - fs.js:114 Uncaught Error: ENOENT: no such file or directory, open I have a simple application with an export button. When this button is clicked, open a popup to add more data and create a pdf with JsPDF.
When I click on the export button the popup appears correctly but clicking on thefinish button (to close it), this error appears on the console:
fs.js:114 Uncaught Error: ENOENT: no such file or directory, open
at Object.openSync (fs.js:436)
at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:160:31)
at Object.readFileSync (fs.js:341)
at Object.fs.readFileSync (ELECTRON_ASAR.js:580)
at Object.exports.base64Sync (/Users/th3g3ntl3man/Repository/thermowell-design/node_modules/base64-img/base64-img.js:60)
at HTMLButtonElement.$.on (export.min.js:1)
at HTMLDocument.dispatch (jquery-3.3.1.min.js:2)
at HTMLDocument.y.handle (jquery-3.3.1.min.js:2)

This is a small code linked with the export button:
const JsPDF   = require('jspdf');

let customer, project, tag;
var pdf = new JsPDF();

$(document).ready( () => {

    $(document).on("click","#additionalData", () => {

        customer = $('#customer').val().trim();
        tag = $('#tag').val().trim();
        pN = $('#pN').val().trim();

        pdf.text(50, 50, 'this is a test');

        pdf.save(customer + '_' + tag + '.pdf');
        $("#custom-modal").modal("hide");
    });

    $('#esporta').click( () => {
        $("#custom-modal").modal("show");
    });

});

additionalData is the form for insert the new data and custom-modal is the popup.


text:
Q: display star rating using laravel I am displaying star rating on html from database. when rating=3 then first 3 star in orange color rest in grey color. I am doing following code. It will give all star in orange color.
 <?php
                        $stars_count=$re->rating;
                        $count=1;
                        for($i=1;$i<=5;$i++)
                        {
                        if($stars_count >= $count)
                        {
                        ?>

                       <?php
                         }
                         else
                         {
                        ?>

                        <?php
                         }
                        }
                        ?>

A: Actually you don't need the $count variable at all, because you have one count variable ($i) in your loop, and you should compare the $star_count with that.
<?php
    $stars_count = $re->rating;

    for($i=1; $i<=5; $i++)
    {
        if($stars_count >= $i)
        {
            ?>
                Orange
            <?php
        }
        else
        {
            ?>
                Gray
            <?php

        }
    }
?>


text:
Q: Live server Issue - PHP CURL returns 403 forbidden response on "setu" token generate I'm working on a laravel project, in which I have integrated SETU(setu) deeplink creation feature. I have added it correctly with curl and that is working fine with my localhost. After the completion I just moved my files to my working live server(shared hosting) that also working properly yesterday. But the same code is not working and leads me to "403 Forbidden" error after a new web route update in my project for another page. I haven't touched the same code again, just uploaded my updated project to same server.
I already tried, clearing my web browser cache, cookie and laravel - php artisan optimize:clear as well and I surfed for around 6 hours in net, but nothing helps me to overcome from this
<?php

    public function getSetuBridgeToken()
    {

      $curl = curl_init();

      curl_setopt_array($curl, array(
          CURLOPT_URL => 'https://uat.setu.co/api/v2/auth/token',
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_ENCODING => '',
          CURLOPT_MAXREDIRS => 10,
          CURLOPT_TIMEOUT => 0,
          CURLOPT_FOLLOWLOCATION => true,
          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
          CURLOPT_CUSTOMREQUEST => 'POST',
          CURLOPT_POSTFIELDS =>'{
              "clientID" : "dfa63f7e-cfbe-415c-xxxx-xxxxxxxxxxxx",
              "secret" : "2ecb9d2c-4983-4717-xxxx-xxxxxxxxxxxx"
          }',
          CURLOPT_HTTPHEADER => array(
              'Content-Type: application/json'
          ),
      ));

      $response = curl_exec($curl);

      curl_close($curl);
      // return $response;
      echo $response;

    }

?>

Note: My server's PHP version is 8.0 and I have already enabled the curl extension as well.
The above curl function only returns me the 403 error, rest of other curl methods which I'm already using for other concepts were working fine only.


text:
Q: Formik Resetting the Initial Values using Yup validation with it I have a piece of code where Formik is used in the #React app with #Typescript and Yup validation. The problem I am facing is that on setting the values in a Select element it does not change the value at all or perhaps it immediately resets the value to the initial value as given in the Formik initial value object. What should I do about it? (No code is available here. But hopefully)

A: This issue is resolved.
In my case enableReinitialize is the culprit.
It was just the enableReinitialize property in the initial Values object set to true. You just need to remove this and you are good to go. I tried dozens of patches to cope with the problem and due to this property, each and every property was not working according to the logic. I also used #MUI #DatePicker #MUIDatePicker which was having issues because of this one property.
Hope it helps many others.
#Coding


text:
Q: Vue custom import css (sass) file In Vue I have a component something to below:
<template>

</template>

I have an options.json file that can be used to set a custom CSS URL. So I can set the CSS URL to anything. How do I implement that?
Dreamcode

I know my way around variables in Vue. The tricky part for me is that the are used inside <template> or

As far as I know, you can't use cross variables (script > style) in Vue.
If you need to have a style sheet from URL, I suggest using environment variables which might work.


text:
Q: Debugging Missing Elements in Taxonomy I'm trying to debug an issue and I was hoping I could get some direction. With the same exact taxonomy page template, one of the pages is missing the sidebar and the WP admin bar (logged in), while the others all work as expected. Take a look at the following pages:
Not Working: http://banneroftruth.org/us/store/product-tag/eBooks/
Working: http://banneroftruth.org/us/store/product-tag/new-releases/
http://banneroftruth.org/us/store/product-tag/banner-classics/
Any idea what could cause this, and where should I start looking for answers?
Thanks for any help. :)
UPDATE: Footer is also missing, and this was working fine until yesterday


text:
Q: Using rangeOfString for different links, URL's etc Thanks to rmaddy for getting me in the right direction by answering THIS question, this leads me into some other issues using that acepted answer. For my original question on that thread, it did solve what I was trying to do. But now I am having issues with the use on some other sites.
I have a webview in which I have a few links to different sites like Media Fire, Copy, Box, etc. Even a direct download link. The media fire link for example starts the download without even going to the site, almost like its just downloading the text. The direct download wont even fire my downloader at all.
Using the accepted answer, what would be the cleanest way to distinguish these?
Here is the code that works for most sites.
- (BOOL)webView:(UIWebView *)awebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
    if (navigationType == UIWebViewNavigationTypeLinkClicked){
    //External file links
    NSURL* externalURL = [request URL];
    NSString *urlString = [externalURL absoluteString];

    NSSet *supportedFileExtensions = [NSSet setWithObjects:@"mpeg", @"mpg", @"m1s", @"mpa", @"mp2", @"m2a", @"mp2v", @"mv2", @"m2s", @"avi", @"mov", @"qt", @"asf", @"asx", @"wmv", @"wma", @"wmx", @"rm", @"ra", @"ram", @"rmvb", @"mp4", @"3gp", @"3gpp", @"ogm", @"mkv", @"flv", @"mv4", @"srt", @"swf", @"vob", @"aif", @"iff", @"m3u", @"m4a", @"mid", @"mp3", @"mpa", @"wav", @"aac", @"7z", @"cbr", @"deb", @"gz", @"pkg", @"rar", @"rpm", @"sitx", @"tar.gz", @"zip", @"zipx", @"ipsw", @"bin", @"cue", @"dmg", @"iso", @"mdf", @"toast", @"vcd", @"torrent", @"nes", @"rom", @"doc", @"docs", @"msg", @"odt", @"rtf", @"txt", @"wpd", @"wps", nil];

    for (NSString *extension in supportedFileExtensions) {
        if ([urlString rangeOfString:extension].location != NSNotFound) {
            // Found extension somewhere in the URL - process it as needed
            break; // stop looking for more
        }
    }
}

Example Links: https://www.dropbox.com/s/57jcgnbnfhcpw9y/Test.zip?dl=0
http://www.mediafire.com/download/wt77jvm3szwjehm/Test.zip
https://copy.com/QFvw3fw4FF2k4foX
https://app.box.com/s/fixnvrym13eylcr73njv
Direct download link: http://download.thinkbroadband.com/5MB.zip

A: Use regular expressions to search for a match like this:
    NSString *urlString = @"http://www.youtube.co.uk/someVideo.mp2";

    NSSet *supportedFileExtensions = [NSSet setWithObjects:@"mpeg", @"mpg", @"m1s", @"mpa", @"mp2", @"m2a", @"mp2v", @"mv2", @"m2s", @"avi", @"mov", @"qt", @"asf", @"asx", @"wmv", @"wma", @"wmx", @"rm", @"ra", @"ram", @"rmvb", @"mp4", @"3gp", @"3gpp", @"ogm", @"mkv", @"flv", @"mv4", @"srt", @"swf", @"vob", @"aif", @"iff", @"m3u", @"m4a", @"mid", @"mp3", @"mpa", @"wav", @"aac", @"7z", @"cbr", @"deb", @"gz", @"pkg", @"rar", @"rpm", @"sitx", @"tar.gz", @"zip", @"zipx", @"ipsw", @"bin", @"cue", @"dmg", @"iso", @"mdf", @"toast", @"vcd", @"torrent", @"nes", @"rom", @"doc", @"docs", @"msg", @"odt", @"rtf", @"txt", @"wpd", @"wps", nil];

    // Expression to match any your mime types
    NSString *pattern = [NSString stringWithFormat:@"(\\W|^)(%@)(\\W|$)", [supportedFileExtensions.allObjects componentsJoinedByString:@"|"]];

    NSRegularExpression *regx = [NSRegularExpression regularExpressionWithPattern:pattern
                                                                          options:NSRegularExpressionCaseInsensitive
                                                                            error:nil];

    // returns first match in the string
    NSTextCheckingResult *match = [regx firstMatchInString:urlString options:NSMatchingReportProgress range:NSMakeRange(0, urlString.length)];
    NSLog(@"matched type: %@", [urlString substringWithRange:match.range]);

You then need to implement a custom HTTP URL protocol that inspects all HTTP responses. copy.com link sends a Content-Disposition: attachment; for it files and shouldStartLoadWithRequest won't no about it until it execute the request.
once you have created your protocol use this method to register it for all your web communications:
[MyURLProtocol registerClass:[MyURLProtocol class]];

see this tutorial for creating custom protocol


text:
Q: How can I assign a certain rank to a variable if certain conditions are met in R I have a variable (RANK) that I am trying to assign certain values to based on certain conditions. There are 13 possible ranks (1 being the most serious type of crime to  10 being the least serious, and 13 which is basically 'missing' and what I am trying to replace based on the crime committed)
I have made a set of rules using str_detect to indicate (True or False) if a certain string of text is included in the observation. I currently have 22 rules, but will be including more as I build out the code.
I have tried both case_when and If_else. However, I know that with case_when, it will take the first condition that matches meaning things need to be in a very particular order, which unfortunately I don't think will work for me. Example code below.
    cleaned_data<-dataset_toclean2 %>% mutate(
RANK=case_when(
  Murder==FALSE & sexoffense==FALSE & felony==TRUE & commonlaw==FALSE & kidnap==TRUE|FALSE  & robbery==TRUE|FALSE & rwdw==TRUE|FALSE & awdw==TRUE|FALSE & abuse==TRUE|FALSE & discharge==TRUE|FALSE|burglary==TRUE & second==FALSE~"5",
  secondmurder==TRUE~"3",
  Murder==TRUE & FirstDegree==TRUE|FALSE & conspir==TRUE|FALSE & attempt==TRUE|FALSE & access==TRUE|FALSE & aid==TRUE|FALSE & solic==TRUE|FALSE | mansla== TRUE|FALSE| Murder==TRUE~"2",
  sexoffense==TRUE~"4",
  TRUE ~ "13"
) )

However, when I view the cleaned_data, all of the 2's, 3's, and 4's are correct but the 5's only have a handful that are accurately changed. The rest of the observations that should be 5's remain as 13 (unranked) even though they fit my rules.
any suggestions would be really appreciated as I know it will get pretty unruly as I make more rules for the remaining ranks.


text:
Q: How are clean_() methods defined/generated in django Forms? I'm currently trying to understand how forms validation works in Django (version 3.2.4). In order to achieve that I'm reading the framework's source code.
But despite searching for it I didn't find where (nor how) are the clean_<fieldname>() methods generated/defined.
The only thing I found is where it's used (django/forms/forms.py::BaseFormL392).
Where are these methods defined?


text:
Q: Matching variables with Subscripts yielding True and False I am trying match variables with subscripts just returning true or false depending if pattern is matched. My try is to use Cases. However the following does not return a match
Cases[Subscript[x, 2], Subscript[x, l_] /; l > 1]

Moreover, if this would work there must something nicer than
Length[    Cases[Subscript[x, 2], Subscript[x, l_] /; l > 1]]>=1

A: As mentioned in the comments, you can use either MatchQ:
MatchQ[Subscript[x, 2], Subscript[x, _?(# > 1 &)]]

or FreeQ with Not:
!FreeQ[Subscript[x, 2], Subscript[x, _?(# > 1 &)]]


text:
Q: Paypal adaptive payment method for Paypal account verification Any one can help for Paypal adaptive payment method for Paypal account verification. When we go to live mode and generate Live APP Id it is showing error:
{
    "responseEnvelope": {
        "timestamp": "2015-09-18T02:23:23.202-07:00",
        "ack": "Failure",
        "correlationId": "4321940d358d5",
        "build": "18018453"
    },
    "error": [
        {
            "errorId": "560022",
            "domain": "PLATFORM",
            "subdomain": "Application",
            "severity": "Error",
            "category": "Application",
            "message": "The X-PAYPAL-APPLICATION-ID header contains an invalid value",
            "parameter": [
                "X-PAYPAL-APPLICATION-ID"
            ]
        }
    ]
}

A: I have found answer of Paypal adaptive payment and check paypal valid email or not.
When create an App, need to fill complete information of APP and if you want to check only Paypal email exist or not. Deselect 'Chained Payments' within your App Submission.
Paypal can allow you to use GrtVerifiedStatus. However, please ensure to set the 'matchCriteria' parameter to 'NAME' as the permission to use 'NONE' is highly restricted.


text:
Q: XQuery : in need of a filtering tip Given XML file-record like this
<ADR-NSBG>
    <timeline timestamp="2011-06-09T00:15:00">
        <datum datum="SGC_at_bsNo-14___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2">
            <sbgSipTotalIncSipRequests>4314320</sbgSipTotalIncSipRequests>
            <sbgSipTotalIncSipResponses>9040481</sbgSipTotalIncSipResponses>
            <sbgSipTotalIncFailureResponses>2321242</sbgSipTotalIncFailureResponses>
            <sbgSipTotalOutSipRequests>9136608</sbgSipTotalOutSipRequests>
            <sbgSipTotalOutSipResponses>4643002</sbgSipTotalOutSipResponses>
            <sbgSipTotalOutFailureResponses>1027420</sbgSipTotalOutFailureResponses>
            <sbgSipIncommingProvisionalResponses>3433875</sbgSipIncommingProvisionalResponses>
            <sbgSipOutgoingProvisionalResponses>1845750</sbgSipOutgoingProvisionalResponses>
        </datum>
        <datum datum="SGC_at_bsNo-13___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2">
            <sbgSipTotalIncSipRequests>4799739</sbgSipTotalIncSipRequests>
            <sbgSipTotalIncSipResponses>9335965</sbgSipTotalIncSipResponses>
            <sbgSipTotalIncFailureResponses>2415690</sbgSipTotalIncFailureResponses>
            <sbgSipTotalOutSipRequests>9474295</sbgSipTotalOutSipRequests>
            <sbgSipTotalOutSipResponses>5291708</sbgSipTotalOutSipResponses>
            <sbgSipTotalOutFailureResponses>1149950</sbgSipTotalOutFailureResponses>
            <sbgSipIncommingProvisionalResponses>3516298</sbgSipIncommingProvisionalResponses>
            <sbgSipOutgoingProvisionalResponses>2190601</sbgSipOutgoingProvisionalResponses>
        </datum>
    </timeline>
</ADR-NSBG>

What I would like to do is to get the values of the children of the datum element.
so, I have written the following query:
for         $i in collection("/db/_DEMO/ADR-NSBG/sipTransactTM/2011/06/09")
let         $TIME_FROM := "2011-06-09T00:15:00"
let         $TIME_TO := "2011-06-09T00:45:00"
let         $DATUM := "SGC_at_bsNo-13___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2"
where       ( $i/ADR-NSBG/timeline/@timestamp/string(.) >= $TIME_FROM and
            $i/ADR-NSBG/timeline/@timestamp/string(.) <= $TIME_TO) and
            ( $i/ADR-NSBG/timeline/datum/@datum/string(.) = $DATUM )
order by    $i/ADR-NSBG/timeline/@timestamp/string(.)
return      $i/ADR-NSBG/timeline/datum

But, the problem is that I cannot choose between the two "datum" nodes.
the result of the query is:
<datum datum="SGC_at_bsNo-14___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2">
    <sbgSipTotalIncSipRequests>4314320</sbgSipTotalIncSipRequests>
    <sbgSipTotalIncSipResponses>9040481</sbgSipTotalIncSipResponses>
    <sbgSipTotalIncFailureResponses>2321242</sbgSipTotalIncFailureResponses>
    <sbgSipTotalOutSipRequests>9136608</sbgSipTotalOutSipRequests>
    <sbgSipTotalOutSipResponses>4643002</sbgSipTotalOutSipResponses>
    <sbgSipTotalOutFailureResponses>1027420</sbgSipTotalOutFailureResponses>
    <sbgSipIncommingProvisionalResponses>3433875</sbgSipIncommingProvisionalResponses>
    <sbgSipOutgoingProvisionalResponses>1845750</sbgSipOutgoingProvisionalResponses>
</datum>
<datum datum="SGC_at_bsNo-13___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2">
    <sbgSipTotalIncSipRequests>4799739</sbgSipTotalIncSipRequests>
    <sbgSipTotalIncSipResponses>9335965</sbgSipTotalIncSipResponses>
    <sbgSipTotalIncFailureResponses>2415690</sbgSipTotalIncFailureResponses>
    <sbgSipTotalOutSipRequests>9474295</sbgSipTotalOutSipRequests>
    <sbgSipTotalOutSipResponses>5291708</sbgSipTotalOutSipResponses>
    <sbgSipTotalOutFailureResponses>1149950</sbgSipTotalOutFailureResponses>
    <sbgSipIncommingProvisionalResponses>3516298</sbgSipIncommingProvisionalResponses>
    <sbgSipOutgoingProvisionalResponses>2190601</sbgSipOutgoingProvisionalResponses>
</datum>

What I would like to ask you is : Why the statement ( $i/ADR-NSBG/timeline/datum/@datum/string(.) = $DATUM ) does not work ?

A: Whithin the where clause you are filtering the $i elements of the for clause by using the datum element. You are not filtering the datum elements.
This expression:
( $i/ADR-NSBG/timeline/datum/@datum/string(.) = $DATUM )

is resolved to:
(
 "SGC_at_bsNo-14___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2",
 "SGC_at_bsNo-13___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2"
) =
 "SGC_at_bsNo-13___SignalingNetworkConnection_at_netId-4___Sip_at_networkRole-2"

which is true. Therefore, the $i element is selected. After that, the expression in the return clause selects both child elements of the contained timeline element:
$i/ADR-NSBG/timeline/datum

How to filter the datum elements
If you want to select only the datum with a specific string, you need to filter in the return clause:
$i/ADR-NSBG/timeline/datum[@datum eq $DATUM]


text:
Q: "Get dependencies" popup not showing android studio for flutter Normally when you change something in the "pubspec.yaml" it prompts you with a bar (Image) => 1
but it wouldnt go away so I pressed "Ignore" and now it refuses to show the popup making it very difficult as I cant get dependencies.

A: Whenever you add a new dependency in your pubspec.yaml file, make sure to install them by running flutter pub get in your terminal. To upgrade your dependencies you could simply run flutter pub upgrade in your terminal.


text:
Q: Preparing a MySQL query in a certain way leads to an error, even though the parameters are correct? I'm writing a query which updates stock of a product when a customer adds it to their cart.
As there are many different sizes I thought the best way to go about it would be to bind the selected size as a parameter from a variable, however this gives the error:

Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in ... Stack trace: #0 ... include() #1 {main} thrown in..."

Here's a simplified version of my table 'stock':
Product ID | S_stock | M_stock | L_stock
    1            3        1          1

I've tried this:
if (isset($_POST['addtocart'])){
    $stockupdate = $_POST['size'];

    $sql = "UPDATE stock SET ?_stock = ?_stock - 1 WHERE productID = ?";
    $stmt = $link->prepare($sql);
    $stmt->bind_param("sss", $stockupdate, $stockupdate, $productid);
    $stmt->execute();

and this (adding  "_stock" to the variable first):
if (isset($_POST['addtocart'])){
    $stockupdate = $_POST['size'].'_stock';

    $sql = "UPDATE stock SET ? = ? - 1 WHERE productID = ?";
    $stmt = $link->prepare($sql);
    $stmt->bind_param("sss", $stockupdate, $stockupdate, $productid);
    $stmt->execute();

Performing a var_dump on the prepared statement above returns bool(false) leading to the error.
The query works succesfully if I type in the size values contained in the variables:
$sql = "UPDATE stock SET M_stock = M_stock - 1 WHERE productID = ?";

Can someone explain why it behaves this way?
And is there a way I can get it to work? (Without writing out a load of if statements for every clothes and shoe size!)
Thanks in advance.


text:
Q: After updating to QGIS 3.20.2 vector processing tools are missing In my QGIS 3.20.2 I can't use tools from the Vector menu as I used in the previous QGIS version. See the print screens. Can somebody tell me why as well as how to resolve this issue?

A: Try to tick the Processing (it is a core QGIS plugin) from the Plugins > Manage and Install Plugins

A: I found out the problem - it was Settings - User profile.


text:
Q: Salt and jinja variables I want use variable as parameter in my state:
I have value in map.jinja:
'package_9.6': '3.7.5-1',

I declared variable in my state:
{% set package_version = '9.6' %}

Then I added string to it:
{% set something = "my_package.package_" ~ package_version %}

And want to use all this in my state
{% from "somewhere/map.jinja" import my_package with context %}
      pkg.installed:
        - pkgs:
          - my_package: {{ something }}

In perfect universe I would like to resolve value of my variable to value from map.jinja (3.7.5-1). But I am getting my_package.package_9.6 string.
Maybe it is totally wrong way of meeting my needs, but after some experiments I got to this option.

A: You need to import map.jinja file in your state file to make use of the variable before using them.
{% from "path-to-map" import map with context %}

In your map.jinja file, variable should be declared as
{% set package_9.6 = '3.7.5-1' %}

You can then access it in a state file using,
{% set something = "my_package.package_" + map.package_9.6 %}