text:
Q: How to invoke the same msbuild target twice with different parameters from within msbuild project file itself I have the following piece of msbuild code:
  <PropertyGroup>
    <DirA>C:\DirA\</DirA>
    <DirB>C:\DirB\</DirB>
  </PropertyGroup>

  <Target Name="CopyToDirA"
          Condition="Exists('$(DirA)') AND '@(FilesToCopy)' != ''"
          Inputs="@(FilesToCopy)"
          Outputs="@(FilesToCopy -> '$(DirA)%(Filename)%(Extension)')">
    <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(DirA)" />
  </Target>

  <Target Name="CopyToDirB"
          Condition="Exists('$(DirB)') AND '@(FilesToCopy)' != ''"
          Inputs="@(FilesToCopy)"
          Outputs="@(FilesToCopy -> '$(DirB)%(Filename)%(Extension)')">
    <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(DirB)" />
  </Target>

  <Target Name="CopyFiles" DependsOnTargets="CopyToDirA;CopyToDirB"/>

So invoking the target CopyFiles copies the relevant files to $(DirA) and $(DirB), provided they are not already there and up-to-date.
But the targets CopyToDirA and CopyToDirB look identical except one copies to $(DirA) and the other - to $(DirB). Is it possible to unify them into one target first invoked with $(DirA) and then with $(DirB)?
Thanks.

A: As someone already mentiond the answer is batching.
Here are some links:

*

*MSBuild Batching Part 1

*MSBuild Batching Part 2

*MSBuild Batching Part 3

*MSBuild RE: Enforcing the Build Agent in a Team Build

A: Yes, what you want is called batching in MSBuild.  The
;%(Dirs.Identity)

Defined in the Outputs will cause this task to be executed for each item in the Dirs ItemGroup.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="CopyFiles"
   xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
   ToolsVersion="3.5">

<ItemGroup>
    <Dirs Include="C:\DirA" />
    <Dirs Include="C:\DirB" />
</ItemGroup>

<Target Name="CopyFiles"
    Inputs="@(FilesToCopy);@(Dirs)"
    Outputs="@(FilesToCopy -> '%(Dirs.Identity)%(Filename)%(Extension)');%(Dirs.Identity)" >
    <Message Text="%(Dirs.Identity)" />
</Target>

</Project>

Outputs:
Build started 8/19/2009 10:11:57 PM.
Project "D:\temp\test.proj" on node 0 (default targets).
  C:\DirA
CopyFiles:
  C:\DirB
Done Building Project "D:\temp\test.proj" (default targets).

Change the Message task to Copy task with the following condition and you are done:
Condition="Exists('%(Dirs.Identity)') AND '@(FilesToCopy)' != ''"

A: You should be able to generate an ItemGroup containing the Dirs and then % on that.
<ItemGroup>
    <Dirs Include="C:\DirA\;C:\DirB\">
</ItemGroup>
<Target Name="CopyFiles"
    Condition="Exists('%(Dirs)') AND '@(FilesToCopy)' != ''"
    Inputs="@(FilesToCopy)"
    Outputs="@(FilesToCopy -> '%(Dirs)%(Filename)%(Extension)')">
    <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="%(Dirs)" />
</Target>

Or you can do 2 explicit calls:
<Target Name="CopyFiles">
    <MsBuild Projects="$(MSBuildProjectFullPath)" Targets="CopyASetOfFiles" Properties="FilesToCopy=@(FilesToCopy);DestDir=$(DirA)" />
    <MsBuild Projects="$(MSBuildProjectFullPath)" Targets="CopyASetOfFiles" Properties="FilesToCopy=@(FilesToCopy);DestDir=$(DirB)" />
</Target>

<Target Name="CopyASetOfFiles"
    Condition="Exists('$(DestDir)') AND '@(FilesToCopy)' != ''"
    Inputs="@(FilesToCopy)"
    Outputs="@(FilesToCopy -> '$(DestDir)%(Filename)%(Extension)')">
    <Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(DestDir)" />
</Target>

I haven't tested either syntax, but am relatively more confident of the second.
(The answer, if there is one, is in my Sayed Hashimi book on my desk - you'll have to wait until the first of:

*

*Get the book

*I get bored

*Sayed finds this post and comes up with a brilliant tested answer)


text:
Q: Getting Membership records from SimpleMembership with EF Code First I'm in the process of getting my head around how the new SimpleMembership provider works in MVC 4 with EF Code First. So far I've got everything working pretty well, but I'm running into something I just don't quite understand.
SimpleMembership auto-creates several tables as a result of this line of code:
WebSecurity.InitializeDatabaseConnection("DatabaseContext", "User", "Id", "Email", autoCreateTables: true);

I have a Code First entity called "User" to store all of my domain specific user data. So using the WebSecurity class, I can get the user id I need in various ways and then query my User entity to get to my domain specific data. However, since there are no POCO classes for the "webpages_xxxx" tables that SimpleMembership auto-creates, I can't easily access those via EF. Specifically I'm interested in getting at the webpages_Membership table so that when I have a user ID, I can get at fields like "IsConfirmed", "PasswordVerificationToken", etc.
Common sense says I'd just need to code some POCO classes to represent the table structures, but it feels like there should be something a little more out-of-the-box. Did Microsoft leave us to just code our own POCO classes to represent their table structure or am I missing something?

A: If i understood , Your scenario is:  Use SimpleMembership, yet access the data using code first where my tables reside in the same DB.
This is possible.
I use a nice tool from EF team, http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d    for such purposes.
With the  EF powertool, you can generate CodeFirst code for accessing an existing DB.
HOW:
Install the powertool.  (See link above)
Place mouse on the Project were the code should go.
Right click on project,
select Entity Framework, reverse engineer codefirst from Database.
Bingo.  POCO classes you can add to your model and to YOUR context.  And your can read and write to the standard the membership tables.

redpajama_set_name: RedPajamaStackExchange


text:
Q: AS3 timer is faster than php Im trying too load new messages every second, but new messages are doubled everytime they are loaded, I suppose because the timer is completed before the php is executed?
so I tried to add
  if (checker != "" + idstored + "done") {
checker =  "" + idstored + "done";

so that once the timer completes, it changes the checker so that when the timer restarts and finishes again it would not execute again... but it stopped checking for all new messages... any tips??
var count:Timer = new Timer(1000, 1);
count.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
count.start();

var checker;
function onTimerComplete(event:TimerEvent):void{
    if (checker != "" + idstored + "done") {
    checker =  "" + idstored + "done";

    var variables_cc:URLVariables = new URLVariables();
    var varSend_cc:URLRequest = new URLRequest("chat.php");
    varSend_cc.method = URLRequestMethod.POST;
    varSend_cc.data = variables_cc;
    var varLoader_cc:URLLoader = new URLLoader;
    varLoader_cc.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader_cc.addEventListener(Event.COMPLETE, completeHandler_cc);

    function completeHandler_cc(event:Event):void{
        if (event.target.data.statusline == "is_new") {
              stored_id_txt.text = "" + event.target.data.stored_id;
              status_txt.text = "" + event.target.data.statusline;
              returnline.text = "" + event.target.data.returnBody;
              checker.text = checker;
              splitByDelimiter(event.target.data.returnBody);
              idstored = event.target.data.stored_id;
              checker = "refresh";
        }
    }}
    // ready the last_refresh_time variable for sending to PHP
    variables_cc.requester = "chat_check";
    variables_cc.stored_id = idstored;
    varLoader_cc.load(varSend_cc);
    count.reset();
    count.start();
}

A: You get errors becouse you sometimes try to start new download when the previous is not finished. It's not wise to do something latency dependent every 1 second real time. You need to start something, wait for it to finish, and then start it again.
removeEventListener of the timer after it launches (inside onTimerComplete function) and stop the timer and reset it. qddEventListener to the timer and start it after the data is downloaded (inside completeHangler_cc function).


text:
Q: Php MySQL Order by date (custom) Here's my PHP/SQL Request
<?php $events = $wpdb->get_results(
    "
    SELECT *
    FROM  `wp_em_events`
    LIMIT 5
    // HERE'S MY ORDER BY DATE
    "
);

$dt = new DateTime($event->event_start_date);
$formattedDate = $dt->format('d M Y');

foreach ( $events as $event )
{

echo '
';
    echo $formattedDate;
    echo $event->event_name;
echo '
';

}

?>

According to a table containaing a column "event_start_date" where values looks like these :
2013-03-27
2013-04-03
2013-03-31

I want to order my events by those date (the closest to us first)
I tried a single
ORDER BY event_start_date DESC

But it "burn" my request
------- BONUS QUESTION --------
How could I increment my events in order to have :

...

Thank you very much !!

A: The ORDER BY comes before the LIMIT. You'll want:
SELECT
    *
FROM
    `wp_em_events`
ORDER BY
    event_start_date DESC
LIMIT 5

Also, you're fetching the date in the wrong place. It'll need to be within the iteration:
foreach ( $events as $event )
{

  $dt = new DateTime($event->event_start_date);

  $formattedDate = $dt->format('d M Y');

  // ...

As for the increments:
foreach ( $events as $key => $event )
{

    echo '
';
    echo $formattedDate;
    echo $event->event_name;
    echo '
';

}

Assuming $events is not an associate array, of course. If it is:
$i = 0;

foreach ( $events as $event )
{

    echo '
';
    echo $formattedDate;
    echo $event->event_name;
    echo '
';

}


text:
Q: I keep getting an error saying I have no allocated memory for my node I am freeing? SIGABRT? This is my deQueue method. I create a tempNode to point to the next node of *head. Then I free the *head and then assign the new *head to equal tempNode.
I could have sworn I had this working earlier. I thought I had fixed this error. Any advice or direction would greatly appreciated. Thanks.
void * deQueue(struct Node **head, struct Node **tail){
    struct Node* tempNode;

    char * nodeString = &((*head)->data);//value is set to the data of the head node
    if(*head != NULL){
        tempNode = (*head)->next;
        free(*head);
        *head = tempNode;

        return nodeString;
    }
    else{
        return NULL;
    }
};


text:
Q: No auth cookie set on response with signalr .net client I've been following the cookie authentication method from http://www.asp.net/signalr/overview/signalr-20/security/hub-authorization and with a asp.net mvc4 project running on localhost it works prefectly fine. I do get the authCookie back in the client.
However, when I publish my asp.net mvc4 project to my host and try to authenticate to that host it doesn't give my any cookies back.
Is this a cross domain cookie issue? Is this approach even possible?


text:
Q: Jquery Datepicker Issues with adding events I am trying to make a date picker with a bunch of events that I pull from an rss feed. To make the datepicker I pretty much copy this post: jQuery UI Datepicker : how to add clickable events on particular dates?
The issue I am having is that I keep getting the error event.Date is undefined. I think this may be because of how I am passing in the dates. The dates come from a collection of strings on page load, that are converted like this:
//Convert objects
currentEventInformationString = JsonConvert.SerializeObject(currentStoreEventInformation);
eventDatesString = JsonConvert.SerializeObject(storeEventDates);

Where currentEventInformationString is a collection of strings containing a title, description, and link and eventDateString is a collection of strings that are dates (I get it from a method that returns date.ToShortDateString();
I then add all of my dates to an event array like so (in js):
//Adds each event to the date picker
for (var x = 0; x < eventDates.length; x++) {
    //Adds event
    events[x] = [{ Title: currentEvents[x].title.toString(), Date: new Date(eventDates[x].toString()) }];
}

I have then tried running a console.debug(events[x].Title + " " + events[x].Date); but every time I undefined undefined
When I run a debug like this:
 console.debug(currentEvents[x].title.toString() + " " + eventDates[x].toString());
I get the correct values so I know that that is not the issue.
Any suggestions?
Also: I know that the question seems vague so I tried to include as much sample code as I thought was relevant. If you need more let me know. To see how the date picker is made look at the link.
Edit Here is how I declare events:
//Current event
var events = new Array(eventDates.length);

A: I think you have a stray set of brackets. This:
events[x] = [{
    Title: currentEvents[x].title.toString(),
    Date: new Date(eventDates[x].toString())
}];

Is assigning an array that contains one object literal to events[x] but I think you just want to assign an object to events[x]:
events[x] = {
    Title: currentEvents[x].title.toString(),
    Date: new Date(eventDates[x].toString())
};


text:
Q: Body and fixed div scrolling issues in Safari / Chrome / Firefox for iOS Here is a test web page:
https://codepen.io/zephyr103/pen/KOxgzL
includes code like:
body.no-scroll {
  overflow: hidden;
}

It works in my MacOSX browsers (including the iOS/Android simulators in Chrome) and usually works fine in Android. It has problems in Safari, Chrome and Firefox in iOS.
When you click "Short Quote" or "Long Quote" it has a variable height fixed position popup with a transparent grey overlay that you can click on to exit the popup.
When you scroll (using touch dragging or mouse wheel) the popup or overlay it is meant to either ignore it (when you scroll the grey overlay) or scroll the popup content - if some is hidden. If none of the popup is hidden then it also ignores drags.
This is how it works:
The #text-viewer popup uses overflow-y auto. When the popup is active it adds the "no-scroll" class to the body element. This class has the css of "hidden" for overflow. This is supposed to stop the body from scrolling whether you are dragging the popup or the grayed out overlay.
On iOS the transparent overlay can be scrolled and when you scroll the "Short Quote" popup it also scrolls the body. When dragging the short quote popup nothing is supposed to scroll.

A: I guess what you ought to do for Safari is to add
body.no-scroll {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

Also, when you open popup add to the body this code as well in JavaScript
body.ontouchstart = (e) => {
  e.preventDefault();
 };

If you want to remove scrollbar then you need to calculate its width
const documentWidth = document.documentElement.clientWidth;
const windowWidth = window.innerWidth;
const scrollBarWidth = windowWidth - documentWidth;

and then add padding right to body with the ${scrollBarWidth}px

A: I found a solution for iOS Safari, Chrome and Firefox
https://codepen.io/zephyr103/pen/mNzoGE
I removed the no-scroll class and styling for the body element.
When the popup is being shown:
var targetElement = document.querySelector("#text-viewer");
bodyScrollLock.disableBodyScroll(targetElement);

When the popup is being hidden:
bodyScrollLock.clearAllBodyScrollLocks();

The js file:
https://github.com/willmcpo/body-scroll-lock/tree/master/lib
Usage:
https://www.npmjs.com/package/body-scroll-lock
The only problem is that the long quote popup doesn't shrink to fit on the screen in iOS Safari and Chrome (sometimes is ok in iOS Firefox)

A: After close the dialog, do this for iphone
$('html').removeAttr('style');
$('body').removeAttr('style');


text:
Q: Alert message fails to appear I've been trying to get an alert message to pop up when a user touches "Start" to start a timer when any or all of the 3 required textfields are empty. No alert message pops up in the simulator.
@IBAction func start(_ sender: Any) {
//the following code produces an alert if any of the specified text fields are blank when the "start" button is pressed
if medName.text == nil || dose.text == nil || freq.text == nil {

    let alertController = UIAlertController(title: "Field(s) must be filled in!", message: "Please complete all fields.", preferredStyle: UIAlertControllerStyle.alert)

    alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action)
        in
        self.dismiss(animated: true, completion: nil)}))

    self.present(alertController, animated: true, completion: nil)

    } else {

        timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(SecondViewController.decreaseTimer), userInfo: nil, repeats: true)

    let itemsObject = UserDefaults.standard.object(forKey: "cellContent")

    var cellContent:[String]

    if let tempItems = itemsObject as? [String] {

        cellContent = tempItems

        cellContent.append(medName.text!)

    } else {

        cellContent = [medName.text!]

    }

    UserDefaults.standard.set(cellContent, forKey: "cellContent")
    //the following code clears the text within each of the specified text fields when start is pressed
    medName.text = ""
    dose.text = ""
    freq.text = ""
    }
}

A: A text field is not nil when it´s empty and has no text, that´s why you don´t enter the if-statement. Do this check instead where you check if your text is "":
if medName.text == "" || dose.text == "" || freq.text == ""


text:
Q: Calculate colordifference Is it possible to check if a certain hexadecimal color is closer to FFF or 000 based on a defined 'center-value'?
I want to check if a color lies closer to #FFF or #000 based on #888.
So if I check for #EFEFEF it should return #FFF and if I try #878787 it should return #000.
How can this be achieved? I'm not sure what to search for on Google...
Thanks in advance

A: You could convert the colours to numbers:
$color_num = hexdec(substr($color, 1)); // skip the initial #

Then compare them to either 0x0 or 0xffffff.
You could also break them down into R, G and B and make three comparisons; then average them? Not sure how precise you want this thing :)

A: The easiest way to solve your problem is to calculate the distance between colors using their greyscale values (there are other ways, but this is simple). So something like:
// returns a distance between two colors by comparing each component
// using average of the RGB components, eg. a grayscale value
function color_distance($a, $b)
{
    $decA = hexdec(substr($a, 1));
    $decB = hexdec(substr($a, 1));
    $avgA = (($decA & 0xFF) + (($decA >> 8) & 0xFF) + (($decA >> 16) & 0xFF)) / 3;
    $avgB = (($decB & 0xFF) + (($decB >> 8) & 0xFF) + (($decB >> 16) & 0xFF)) / 3;
    return abs($avgA - $avgB);
}

// I am going to leave the naming of the function to you ;)
// How this works is that it'll return $minColor if $color is closer to $refColorMin
// and $maxColor if $color is closer to $refColorMax
// all colors should be passed in format #RRGGBB
function foo($color, $refColorMin, $refColorMax, $minColor, $maxColor)
{
    $distMin = color_distance($color, $refColorMin);
    $distMax = color_distance($color, $refColorMax);
    return ($distMin < $distMax) ? $minColor : $maxColor;
}

// Example usage to answer your original question:
$colorA = foo('#EFEFEF', '#888888', '#FFFFFF', '#000000', '#FFFFFF');
$colorA = foo('#898989', '#888888', '#FFFFFF', '#000000', '#FFFFFF');
// Check the values
var_dump($colorA, $colorB);

The output is:
string(7) "#FFFFFF"
string(7) "#000000"

A: You could do something like the following:
function hex2rgb($hex) {
   $hex = str_replace("#", "", $hex);

   if(strlen($hex) == 3) {
      $r = hexdec(substr($hex,0,1).substr($hex,0,1));
      $g = hexdec(substr($hex,1,1).substr($hex,1,1));
      $b = hexdec(substr($hex,2,1).substr($hex,2,1));
   } else {
      $r = hexdec(substr($hex,0,2));
      $g = hexdec(substr($hex,2,2));
      $b = hexdec(substr($hex,4,2));
   }
   $rgb = array($r, $g, $b);
   //return implode(",", $rgb); // returns the rgb values separated by commas
   return $rgb; // returns an array with the rgb values
}

$rgb = hex2rgb("#cc0");

From that you could take the values of $rgb and see if their values, on average, area greater than or less than 122.5. If its greater than 122.5 you'd be closer to #FFFFFF, lower than 122.5 you'd be closer to #000000.

A: Thanks everybody for the help!
In my startpost I made a little typo as mentioned by oezi. For me the solution was a small modification to the accepted answer (by reko_t):
function color_distance($sColor1, $sColor2)
{
    $decA = hexdec(substr($sColor1, 1));
    $decB = hexdec(substr($sColor2, 1));
    $avgA = (($decA & 0xFF) + (($decA >> 8) & 0xFF) + (($decA >> 16) & 0xFF)) / 3;
    $avgB = (($decB & 0xFF) + (($decB >> 8) & 0xFF) + (($decB >> 16) & 0xFF)) / 3;
    return abs($avgA - $avgB);
}

function determine_color($sInputColor, $sRefColor, $sMinColor, $sMaxColor)
{
    $distRef    = color_distance($sInputColor, $sRefColor);
    $distMin    = color_distance($sInputColor, $sMinColor);
    $distMax    = color_distance($sInputColor, $sMaxColor);

    return $distMax - $distRef <  $distMin - $distRef ? $sMinColor : $sMaxColor;
}

I needed this function to determine text-color on a background-color which can be set by some setting. Thanks! :) Credits to reko_t!


text:
Q: Where is the error in this stored procedure DELIMITER //
CREATE PROC InserimentoValori()
BEGIN
  DECLARE @caratteri varchar(30);
  set @caratteri = 'abcdefghijklmnopqrstuvwxyz',
  DECLARE x INT DEFAULT 1;
  WHILE x <=100 DO
  INSERT INTO Persona(nome,cognome,eta) VALUES((SELECT @caratteri = substring(@caratteri +1),(SELECT @caratteri = sebstring(@caratteri +1),(SELECT floor(rand() * 99) AS randNum));
  SET x = x+1;
END WHILE
END //
DELIMITER ;

I want to create a stored procedure that insert random values into the table.
Thanks

A: There are a couple of errors.
We don't "declare" user defined variables in MySQL. Just SET them.
If you want to DECLARE a variable within a procedure, that needs to be a procedure variable.
A user defined variable has a name that starts with the @ character. A procedure variable cannot start with a @ character.
So, a line like this is an error:
DECLARE @foo ...

If you want to use a user defined variable, remove that line. If you want to use a procedure variable, remove the @ from the beginning of the variable name (and make that same change everywhere you want to reference the procedure variable foo.)
And SEBSTRING is not the name of a MySQL provided function.
Also, a boolean expression in a SELECT list of a query will return 0, 1 or NULL.
For example:
SELECT @caratteri = substring(@caratteri +1)

That expression is comparing the value on the left side of the = with the value on the right, and is going to return 1 if they are equal, or 0 if the aren't, or NULL if either of the values is NULL.
To perform an assignment to a user defined variable in a SELECT statement, use the Pascal-style := operator.
(If you meant to do an assignment, the design makes it look like you are gogin to lop off the first character each time through the loop; that's eventually going to be an empty string, if we loop enough times. You may want to think about leaving the string static. Consider incrementing integer values, and use those as arguments in SUBSTRING function. And you can use the MOD operator to get the integer value to "wrap".)


text:
Q: Azure DevOps and Azure Function Deployment: where are my app settings I'm trying to upload a Dotnet core Azure Function to an app service hosted on Windows and I'm struggling to prove that it works or ensure the settings are correct.
I also have the aspiration that the deployment should be fully automated without having to go via the Azure Portal and tweak settings etc.
Build process: currently it looks like this...

*

*The c# function compiles and all unit tests pass locally and on the Azure DevOps build agents

*Build completes and generates the zip file

*I wrap the zip file within a versioned Nuget package

*Nuget package is hosted in Azure DevOps Artifacts repo

So all looks good at this point.
Release Process

*

*I restore and unpack the nuget package on the Azure DevOps build agent.

*I confirm the zip file exists with a Powershell task - all good.

*I then use the Azure DevOps Release pipeline task; "Azure Functions"

*

*https://github.com/Microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureFunctionAppV1/README.md

*I think I've configured this task correctly

*

*Package or Folder: "The path I validated in step 2 above"

*Deployment Method: Zip Deploy (I've alternated between this and Package deployment in different releases)

App Settings (see screenshot below)

*

*name value pairs like -Name "value" -Name2 "value2" etc

*I've also included -WEBSITE_RUN_FROM_PACKAGE "1" in the list of app settings (I've tried releases with and without this setting present)

The Results
The release passes, it says in the logs that its uploaded the package and the app settings.
However, when I go to the Azure Portal:

*

*I don't see my app settings that I thought I'd uploaded in the release.

*It retains dummy app settings that I added via the Azure Portal directly

Questions

*

*Should I create an empty Azure Function within the AppServive using the Azure Portal before I start the Release with this task?

*

*The very first time I ran the release it failed because it said it couldn't find the slot I'd specified. I was under the impression that the Azure Function pipeline task would create everything but it appears that it expects there to be an empty function with slots predefined and maybe app settings predefined. Any thoughts please?

*Do I have to create app settings in the Portal before the release? In other words does the Pipeline task only allow updates to existing Portal created app settings.

*Is there a better Pipeline task to use - that can create an new Azure Function if it doesn't exist already?

As is often the case with help documentation, the info I've seen follows a happy path, or sometimes too much with lots of ifs, buts and maybe advice.
Any guidance would be truly appreciated as I feel I'm going round in circles here and it should be simple.
Thankyou.

A: You can deploy the Azure Function via Azure-Resource-Manager Templates. You can find samples on GitHub. With this step you create the required infrastructure on Azure before your deployment. In your case the Azure Function and a Consumption Plan. In your deployment, the infrastructure is therefore provided in step one and then the actual deployment of the package to your function.
For the infrastructure look at the Azure DevOps Step for Create or Update Resource Groups.
YAML sample for both steps:
- task: AzureResourceGroupDeployment@2
  displayName: 'Create Or Update Resource Group'
  inputs:
    deploymentMode: 'Incremental'
    azureSubscription: 'Your-Subscription'
    resourceGroupName: '${{ parameters.resourceGroupName }}'
    location: '${{ parameters.location }}'
    csmFile: '${{ parameters.csmFile }}'
    csmParametersFile: '${{ parameters.csmParametersFile }}'

- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy'
  inputs:
    azureSubscription: 'Your-Subscription'
    appType: functionApp
    WebAppName: '${{ parameters.function }}'
    packageForLinux: '$(Agent.BuildDirectory)/${{ parameters.dropfolder }}/$(Build.Repository.Name)-$(version)-$(Build.SourceBranchName)-$(Build.BuildNumber).zip'

A: After you've done a build in your Azure Devops pipeline you will create a package to make a release from. You have to make sure that the contents in that package matches to correct folder structure. The contents of your app should have the following structure according to Requirements for continuous deployment.
FunctionApp
 | - host.json
 | - MyFirstFunction
 | | - function.json
 | | - ...
 | - MySecondFunction
 | | - function.json
 | | - ...
 | - SharedCode
 | - bin

After the build you can check the contents of the generated package by going to the summary for that particular build and clicking on the published artifact. There you can download the contents and make sure that it has the following structure and content:
 | - host.json
 | - MyFirstFunction
 | | - function.json
 | | - ...
 | - MySecondFunction
 | | - function.json
 | | - ...
 | - SharedCode (might not be there)
 | - bin

Once deployed you can browser your deployed files through Kudu by using the CMD or Powershell Debug Console. If you have chosen to run from package you can see the package used at /data/SitePackages/. The packagename.txt points to the latest package used. The contents of the package are extracted to /site/wwwroot/. There you should see at least a host.json, a bin folder, and the folders containing your functions. Nothing else. The function app content should not be deployed to a sub folder of /site/wwwroot/, like for example /site/wwwroot/FunctionApp/.
If the content and folder structure in wwwroot isn't correct, you might still see a successful deployment, you Function App shows up but there are no functions showing up.


text:
Q: Reading a variable, comparing to CSV data and outputting a row I'm having a complete meltdown today in getting some CSV stuff to work. The complete code as it stands is below along with a cut and paste of the csv file.
What I'm attempting to do is enter a number in the shop order field that matches a number in the first column of the CSV. When this match is made that entire row prints to the large output box, part two of this will be splitting the csv fields up so data is input into the quantity and description fields, but I should probably learn to crawl first.
I cant get the csv to display in the output box and I'm not able to ascertain what is wrong or if I'm missing code.
If I remove the csv code, numbers entered into the shop order box prints to the large output box and any letters entered brings up an error box which is working well, its just this next bit thats thrown me.
from tkinter import *
from tkinter import ttk
import sys
import csv
from csv import DictReader

class GUI:
def __init__(self, rootWindow):

    #variable
    sonumber = StringVar()
    result = int()

    #item1
    self.label = ttk.Label(rootWindow, text="Shop Order:")
    self.label.grid(row=1, column=1, sticky=(E), padx=3, pady=3)

    self.SOentry = ttk.Entry(rootWindow, width=5, background="white", textvariable = sonumber)
    self.SOentry.grid(row=1, column=2, sticky=(W, E), padx=3, pady=3)
    #item2
    self.label2 = ttk.Label(rootWindow, text="Quantity:")
    self.label2.grid(row=1, column=3, sticky=(E), padx=3, pady=3)

    self.outputQty = Text(rootWindow, width=5, height=1, background="white")
    self.outputQty.grid(row=1, column=4, sticky=(W, E), padx=3, pady=3)

    #item3
    self.label3 = ttk.Label(rootWindow, text="Description:")
    self.label3.grid(row=2, column=1, sticky=(E), padx=3, pady=3)

    self.outputDesc = Text(rootWindow, width=5, height=1, background="white")
    self.outputDesc.grid(row=2, column=2, columnspan=5, sticky=(W, E), padx=3, pady=3)

    #output
    self.label4 = ttk.Label(rootWindow, text="Drawings:")
    self.label4.grid(row=3, column=1, sticky=(N,E), padx=3, pady=3)

    self.dwgoutputbox = Text(rootWindow, width=50, height=15, background="white")
    self.dwgoutputbox.grid(row=3, column=2, columnspan=5, padx=3, pady=3)
    sys.stdout = TextRedirector(self.dwgoutputbox, "printdwgoutputbox") #redirects from shell to screen

    #buttons
    def DoASearch():
        try:
            print(int(sonumber.get()))
        except ValueError:
            messagebox.showwarning("Fail !!", "Please enter a valid Shop Order number.")

        with open("lesspreadsheettest.csv") as csvfile:
            reader = csv.DictReader(csvfile)
            for row in reader:
                result=(row['Shop Order'])
                if sonumber == result:
                    print(row['Shop Order'], row['Part Number'], row['Description'])

    self.searchbutton = ttk.Button(rootWindow, text="Search", command=DoASearch)
    self.searchbutton.grid(row=1, column=7, sticky=W, padx=3, pady=3)

    def clear_text():
        self.SOentry.delete(0, 'end')

    self.clrsearchbutton = ttk.Button(rootWindow, text="Reset", command=clear_text)
    self.clrsearchbutton.grid(row=2, column=7, sticky=W, padx=3, pady=3)
    #

    self.exitbutton = ttk.Button(rootWindow, text="Exit", command=rootWindow.destroy)
    self.exitbutton.grid(row=3, column=7, sticky=(N,W), padx=3, pady=3)

class TextRedirector(object):
def __init__(self, widget, tag="printdwgoutputbox"):
    self.widget = widget
    self.tag = tag

def write(self, str):
    self.widget.configure(state="normal")
    self.widget.insert("end", str, (self.tag,))
    self.widget.configure(state="disabled")

def main():
global label
rootWindow = Tk()
rootWindow.title("Production Drawings")
rootWindow.geometry("575x325+600+300")
gui = GUI(rootWindow)
rootWindow.mainloop()

main()

My test csv code is
Shop Order  Part Number Description Quantity
12345   5-1841111-1 Ferrari California  1
12346   5-1841222-2 Porsche 911 2
12347   5-1841333-3 Lamborghini Aventador   3
12348   5-1841444-4 Jaguar F-Type   4
12349   5-1841555-5 Bugatti Veyron  5

A: Your sonumber variable is a Tkinter StringVar, not a normal Python string. When you do your comparison:
if sonumber == result:
    print(row['Shop Order'], row['Part Number'], row['Description'])

you are comparing a Tkinter StringVar with a string, so it is always evaluating as False. If you use sonumber.get() instead, you get the actual value and you should have no problem.


text:
Q: Toggle between divs I need to hide these divs on click of the button in another div as shown below. When I click on a button in another div, it hides the other div and the opposite.
<!DOCTYPE html>

    <title>
        tesing hide
    </title>

 this is the content of my ticket div

            <button>Show usernamepassword</button>

 this is the content of username and password div

            <button>Show ticket</button>

A: $( ".target" ).hide();

This will hide an element and similarly
$( ".target" ).show();

will show it.
Using these two in a couple of functions and then calling them from click events on the buttons, should give you what you're looking for.
I am not providing the full code solution as this is trivial and you should be able to follow the docs yourself.
Here is a link to the documentation so you can read about it:
http://api.jquery.com/show/
http://api.jquery.com/hide/

A: Like this?

$('#usernamepassword').hide();

$('#ticket button').on('click', function(){
  $('#usernamepassword').toggle();
  $('#ticket').toggle();
});

$('#usernamepassword button').on('click', function(){
  $('#ticket').toggle();
  $('#usernamepassword').toggle();
});

<!DOCTYPE html>

    <title>
        tesing hide
    </title>

 this is the content of my ticket div

            <button>Show usernamepassword</button>

 this is the content of username and password div

            <button>Show ticket</button>

A: Just add an id to both of the buttons and assign an event to them to toggle the divs.

<!DOCTYPE html>

    <title>
        tesing hide
    </title>

 this is the content of my ticket div

            <button id="showUsr">Show usernamepassword</button>

 this is the content of username and password div

            <button id="showTicket">Show ticket</button>


text:
Q: If $X$ is a locally compact $T_2$ space then the Alexandroff compactification is the smallest compactification of $X$
Definition (0)
Let be $X$ a topological space. So a pair $(h,K)$ is a compactification of $X$ if $K$ is a compact space and if $h:X\rightarrow K$ is an embedding of $X$ in $K$ such that $h[X]$ is dense in $K$. Moreover a compactification $(h,K)$ of $X$ is a $T_2$ compactification if $K$ is a Hausdorf -compact- space.
Definition (1)
If $(h_1,K_1)$ and $(h_2,K_2)$ are two compactification of some topological space $X$ we say that $(h_1,K_1)\preccurlyeq(h_2,K_2)$ if there exist a continuous function $p$ such that $p\circ h_2=h_1$.
Lemma (2)
If $X$ a locally compact space and $f:X\rightarrow Y$ a surjective continuous function onto the topological space $Y$ then too $Y$ is locally compact.
Lemma (3)
If X is an Hausdorff space locally compact, then any dense locally compact subspace $Y$ is open.
Lemma (4)
Let be $(X,\mathcal{T})$ a not compact topological space and let be $\infty\notin X$; thus on $X^\infty=X\cup\{\infty\}$ we consider the topology
  $$
\mathcal{T}^\infty:= \{U \subseteq X^\infty\mid U \cap X \in \mathcal{T} \land (\infty \in U \implies X \setminus U \mathrm{\ compact)}\}
$$
  and the function $i:X\rightarrow X^\infty$ defined as
  $$
i(x)=x
$$
  So the pair $(i,X^\infty)$ is a compactification of the space $X$, that we name Alexandroff compactification of the space $X$.
Lemma (5)
Let be $X$ a not compact Hausdorff space: so the Alexandroff compactification $(i,X^\infty)$ of $X$ is a Hausdorff space iff $X$ is locally compact.
Statement (6)
The Alexandroff compactification $(i,X^\infty)$ is the smallest compactification of any locally compact $T_2$ space $X$.
Proof. Well let be $X$ a locally compact $T_2$ space and $(h,K)$ an its compactification. So we consider the function $p:K\rightarrow X^\infty$ defined as
  $$
p(k)=\begin{cases}i(x),\text{if } k=h(x)\text{ for some }x\in X\\\infty,\text{ if }x\in K\setminus h[X]\end{cases}
$$
  and we observe that $p\circ h=i$ so if we will prove that $p$ is continuous we will have proved the statement. So let be $U\in\mathcal{T^\infty}$ and we prove that $p^{-1}(U)$ is open in $K$. Previously we observe that $h[X]$ is open in $K$ since $h[X]$ is locally compact and dense in $K$. So  if $\infty\notin U$ and so if $U\subseteq X$ it results that $U$ is open in $X$ and by the definition of $p$ we have $p^{-1}(U)=h[U]$ that is open in $h[X]$ and so in $K$. Then if $\infty\in U$ then $X\setminus U$ is compact in $X$...

Unfortunately I can't prove the continuity of $p$ so I ask for your assistance. Then I used the lemma $4$ on $h[X]$ but I don't know if $K$ is $T_2$. Could someone help me, please?

A: If $\infty\in U$, then $X\setminus U$ is compact, so $p^{-1}[X\setminus U]=h[X\setminus U]$ is compact. If $K$ is Hausdorff, $p^{-1}[X\setminus U]$ is closed in $K$, and therefore $p^{-1}[U]$ is open in $K$, as desired.
Let $S=\{2^{-n}:n\in\Bbb Z^+\}$, and let $X=\Bbb N\cup S$ with the topology that it inherits from the real line, where $\Bbb N$ is the set of non-negative integers; clearly $X$ is locally compact and Hausdorff. Let $X_0=X\setminus\{0\}$, the set of isolated points of $X$. Let $K=\{q\}\cup X$, where $q$ is any point not in $X$, and topologize $K$ as follows: $X$ is an open subspace of $K$, and the sets of the form $\{q\}\cup(X_0\setminus F)$ for $F$ a finite subset of $X_0$ form a local base at $q$. Clearly $K$ is compact, and $X$ is dense in $K$, so $\langle h,K\rangle$ is a compactification of $X$, where $h:X\to K:x\mapsto x$.
Now $\{0\}\cup S$ is a compact subset of $X$, so $\{\infty\}\cup\Bbb Z^+$ is open in $X^\infty$. However,
$$p^{-1}[\{\infty\}\cup\Bbb Z^+]=\{q\}\cup\Bbb Z^+\;,$$
which is not open in $K$, so $p$ is not continuous.


text:
Q: How to implement successive jquery functions- select followed by keypress/keydown I'm trying to simulate keypress by buttons using jquery. But cannot figure out how buttons can trigger a select/click followed by a keypress/keydown event. Can someone please help?
Requirement: Whenever I press the + or - button, it should slide the dot right or left and it should update the year

My code is

$("#range").on("change", function() {
  $("#year").html($(this).val());
});

$("#down-year").on("click", function() {
  $("#range").trigger("select").trigger("keypress", function(e) {
    e.which = 37; //Left arrow
  })
});

$("#up-year").on("click", function() {
  $("#range").trigger("select").trigger("keypress", function(e) {
    e.which = 39; //Right arrow
  })
});
.slidecontainer {
  width: 100%;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #28A745;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #28A745;
  cursor: pointer;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

  <input type="range" min="1966" max="2015" value="2015" class="slider" id="range">

      <button id="down-year">

                </button>

      Year: 2015

      <button id="up-year">

                </button>

And how I'm trying with jQuery [Even tried swapping keypress with keydown]:

A: You don't really have to call the keyup/keydown/keypress events. The way you've got it setup right now you can just increment the range value by 1, up or down. Also it would probably be better to create an "updateLabel()" function instead of triggering another event.
JQuery:
$("#down-year").on("click", function() {
    var newVal = parseInt($("#range").val()) - 1;
    $("#range").val(newVal);
    updateLabel(newVal);
});

$("#up-year").on("click", function() {
    var newVal = parseInt($("#range").val()) + 1;
    $("#range").val(newVal);
    updateLabel(newVal);
});

function updateLabel(num){
    $("#year").html(num);
}

Just make sure you parseInt on the value otherwise it will read a string and you'll concatenate a 1 on the end of the value (e.g. range at 2001 when you click, $("#range").val() + 1 will equal 20011, which will shoot your slider to the max value of 2015).


text:
Q: How can I map the "Print Screen" button to start a "crosshair" screenshot via Skitch app on Mac? CmdShift5 is supposedly the shortcut / hotkey to start a crosshair screenshot, but:
A) That hotkey doesn't work very well.
(What I want to replicate is the type of crosshair screenshot I can take by clicking the Skitch icon in the top of my screen and then clicking Crosshair Screenshot.)
B) I much prefer Print Screen
P.S. I'm using a Logitech USB wireless Windows-style keyboard, so I do have a Print Screen key (among many others).

A: I'm do not think MacOS provides a way to remap Print Screen natively.
That said, you can turn off the shortcut for CMD+SHIFT+5 which might be causing your sporadic behaviour and let Skitch's shortcut through.
Select System Preferences and the Keyboard option.  Then deselect the shortcut sequence like this:

Hopefully that will at least improve the stability of the shortcut.


text:
Q: C# - splitting string of each value in an array foreach (set.row officeJoin in officeJoinMeta)
{
    foreach (set.somethingRow confRow in myData.something.Rows)
    {
        string dep = confRow["columnName"].ToString();
        depts.Add(dep);
    }
}

I've got this for-loop going through a column, adding each value in a column to dep, and later storing all these in a List < String > depts which i defined at the top of this method.
Some of the values in the dep are single strings like "R" but some are need to be separated after the comma "R,GL,BD".
I understand using .Split(","), but how do i split strings--how do i get each value in the array, split them with the comma, then store them in another array?

A: Written based on what you've explained:
        foreach (set.row officeJoin in officeJoinMeta)
        {
            foreach (set.somethingRow confRow in myData.something.Rows)
            {
                string dep = confRow["columnName"].ToString();
                depts.AddRange(dep.Split(','));
            }
        }

A: declare as
List<string[]> depts =  new List<string[]>()

and add as
depts.Add(dep.Split(','));

A: List<string> depts=new List<dept>();

    var values=dept].Split(',');

    for(int index=0;index<values.length;index++)
    {
    depts.Add(values[index].ToString());

    }


text:
Q: Group by variable integer range using Linq I'm trying to group a set of data based on the range of an integer, by the range does not increase at a fixed interval.
e.g. I have
Item ID     Price
1                    10
2                   30
3                   50
4                  120
I would like to group the items with price 0 - 10, 11 - 100, and 100-500. So that item 1 is in group A, item 2,3, in group B, item 4 in group C.
The closest I can come up is
from items
group items by (items.price / 10 )
then join the groups together to get the different ranges.
Any ideas?

A: How about something like this?
var data = new[] {
    new { Id = 1, Price = 2 },
    new { Id = 1, Price = 10 },
    new { Id = 2, Price = 30 },
    new { Id = 3, Price = 50 },
    new { Id = 4, Price = 120 },
    new { Id = 5, Price = 200 },
    new { Id = 6, Price = 1024 },
};

var ranges = new[] { 10, 50, 100, 500 };

var grouped = data.GroupBy( x => ranges.FirstOrDefault( r => r > x.Price ) );

A: Parameterizing the list of range ceilings...
var ceilings = new[] { 10, 100, 500 };
var groupings = items.GroupBy(item => ceilings.First(ceiling => ceiling >= item));

A: Perhaps something like (untested):
item.Price <= 10 ? "A" :
     (item.Price <= 100 ? "B" : (item.Price <= 500 ? "C" : "X"))

(and group by this)
If this is LINQ-to-Objects, you could also do this in a static utility function (GetBand(i) or similar); or with LINQ-to-SQL you could do the same with a scalar-UDF mapped to the data-context.

A: You could select the ints in different sets with Linq.
Something like:
 var newList = theList.Where(i => i < 30 && i >10);

This would get you all of th eints from a certain interval.


text:
Q: Deep copy of tree data structure in C++ without boilerplate copy code? Suppose I have a tree data structure implemented with node class:
class Node
{
  Node * parent;
  std::vector<Node*> children;
  int data_1;
  std::string data_2;
  double data_3;
  ...
  float data_n;
};

To do a deep copy, is there any way to get around writing all of the boilerplate copying for the non-pointer properties? All of the
that.data_1 = this->data_1;
that.data_2 = this->data_2;
...
that.data_n = this->data_n;

I know in advance that the number of pointer properties is small and will not change. However, the non-pointer properties is larger and fluctuates as I develop my program. Thus, I'd rather avoid needing to remember to add this boilerplate code every time I add a new property.
(I'm willing to use C++11 and less enthusiastically boost)

A: As hinted in comments you can wrap data in a struct, then just copy a structure and handle the rest of the copying process in copy constructor body:
class Node
{
  Node * parent;
  std::vector<Node*> children;
  //... maybe more

  struct Data {
      int data_1;
      std::string data_2;
      double data_3;
      ...
      float data_n;
  }
  Data data;
  Node( Node const& other) : data( other.data) {
      //... do the rest
  }
};

A: You can put the payload in a base class:
struct i {
        i(int a, float b) : a(a), b(b) {}
        int a;
        float b;
};

struct n : i {
        using i::i;
        n(const n&r) : i(r) {}
};

n N {1,1.0};

int main()
{
        n M {0,1.0};
        M=N;
        return M.a;
}

which has other advantages too, I've gotten fond of separating content from structure.

A: If you only need a recursive container you could use Boost.Container. It is designed with these use cases in mind. The problem I see with you code is the pointer to parent. I think this can not be simply implemented. But you will get memory management for free.


text:
Q: ng-click not working when button is pushed I am trying to get a function to execute when a button is clicked...
Here is my button:

    <button class="button button-block button-balanced" ng-click="convert()">
        Convert
    </button>

Here is my function:
var myApp = angular.module('starter',['ionic']);
myApp.controller('convertController', ['$scope', function($scope) {
    $scope.convert = function(){
       alert("convert");
    }
}]);

Why is the function not being called when I click the button?

A: That code is fine, it should work as you can see in the snippet below that is a copy paste of your code (except for the ionic dependency).
The problem probably comes from elsewhere. Please check your console for any error, Angular probably couldn't initiate for another reason (for instance cannot resolve the ionic dependency?).
How to see errors using Chrome
How to see errors using Firefox

var myApp = angular.module('starter',[]);
myApp.controller('convertController', ['$scope', function($scope) {
    $scope.convert = function(){
       alert("convert");
    }
}]);

    <button class="button button-block button-balanced" ng-click="convert()">
        Convert
    </button>


text:
Q: Is the Laplacian $-\Delta$ on a compact manifold an isomorphism? We know that for (a normal) domain $-\Delta:H^1_0(\Omega) \to H^{-1}(\Omega)$ is an isomorphism.
What is the corresponding result for the Laplace-Bulltrami operator or more generally a Laplacian operator on a manifold which has no boundary? What properties does it satisfy?

A: It holds also on sufficiently smooth Riemannian manifolds, and in fact for more general partial differential operators (even pseudo-differential operators.)
See for example Hebey, Nonlinear Analysis on Manifolds: Sobolev Spaces and Inequalities.

A: Once I had similar question. If you are given function $g$ on manifold $M$ which integral onver $M$ is nonzero. Than there is no solution of $\delta d f = g$. You can do this by contradiction. Assume that you have such a solution than:
$$
0\neq \int_M \star g = \int_M  d{\star}df = \int_{\partial M} \star df = 0
$$
because $\partial M = 0$.
This answer is from Ted Shifrin.
Actually there is nice physical interpretation for this result.
If you have heat equation with sources $\frac{d u}{dt}= \delta d u - g$ then its solution in infinite time tends to solution of $\delta d u = g$. But if integral  of $g$ over $M$ is positive, than you pump energy to the system. So in infinite time you would pump infinite amount of energy to the system and there is "not enough space" on compact manifold to store that much energy or you do not have any boundary to consume that energy.


text:
Q: How does Firefox implement HSTS in detail? I was doing some research on how Firefox and Chrome are implementing HSTS (HTTP Strict Transport Security) in detail.
Turns out that they have a predefined list with some sites that already implement HSTS. This can be seen here here and/or here.
And these list seems to be somehow linked to the sourcecode itself which makes somehow sense...but how do Firefox and Chrome handle my own HSTS headers? How and where do they store my URL, my max-age and whether I includeSubDomains or not?
I wasn't able to find this in about:config or likewise....
So maybe somebody knows more about this issue than me, I'm just curious (:
Thx!

A: See http://hg.mozilla.org/mozilla-central/file/20bbf73921f4/netwerk/protocol/http/nsHttpChannel.cpp#l1072 and then http://hg.mozilla.org/mozilla-central/file/20bbf73921f4/security/manager/boot/src/nsStrictTransportSecurityService.cpp#l249 which calls http://hg.mozilla.org/mozilla-central/file/20bbf73921f4/security/manager/boot/src/nsStrictTransportSecurityService.cpp#l147
So the data ends up stored in the permission manager, which is the normal place per-host information gets stored in Firefox.  The permission manager stores its state in permissions.sqlite, I think.

A: Sites that want HTTP Strict Transport Security (HSTS) enforced send a header in response  - Strict-Transport-Security: max-age=31536000
max age being time for it to expire. It is sent on each request so that it gets updated to that much more time every time it is requested.
Browser (I have tried only Firefox) stores this data with it and will use it every time the site is accessed. This is true even for incognito mode. If you have ever accessed the site before in non incognito mode then the details of that site is saved and used even if you try to open it now in incognito mode.
For firefox this data is stored in a file called SiteSecurityServiceState.txt which is in your firefox profile folder. You can enter about:support in browser and then select "Show in folder" to open your profile folder where you can locate this file.
I am not sure about predefined sites but above is the file where normal site HSTS details are updated for firefox.
More details - Understanding HTTP Strict Transport Security (HSTS)
PS: Above link goes to my personal blog that has more details on HSTS.


text:
Q: How to add multiple streambuilder that has dropdown value from firebase in flutter? I have 3 dropdown that has lists from firebase. The flowchart of my program is when I choose the address, so the username and password are automatically selected according to the address that has been selected. This is my code:
StreamBuilder 1
StreamBuilder<QuerySnapshot>(
   stream: FirebaseFirestore.instance.collection('servers').snapshots(includeMetadataChanges: true),
   builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
      if (snapshot.hasError) {
         return Text('Something went wrong');
      }
      if (snapshot.connectionState == ConnectionState.waiting) {
         return Text("Loading");
      }
      return Container(
         child: DropdownSearch<String>(
            items: snapshot.data!.docs.map((DocumentSnapshot document) {
               Map<String, dynamic> data = document.data()! as Map<String, dynamic>;
               return data["address"];
            })
            .toList()
            .cast<String>(),
         onChanged: print,
         ),
      );
   },
),

StreamBuilder 2
StreamBuilder<QuerySnapshot>(
   stream: FirebaseFirestore.instance.collection('servers').snapshots(includeMetadataChanges: true),
   builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
      if (snapshot.hasError) {
         return Text('Something went wrong');
      }
      if (snapshot.connectionState == ConnectionState.waiting) {
         return Text("Loading");
      }
      return Container(
         child: DropdownSearch<String>(
            items: snapshot.data!.docs.map((DocumentSnapshot document) {
               Map<String, dynamic> data = document.data()! as Map<String, dynamic>;
               return data["username"];
            })
            .toList()
            .cast<String>(),
         onChanged: print,
         ),
      );
   },
),

StreamBuilder 3
StreamBuilder<QuerySnapshot>(
   stream: FirebaseFirestore.instance.collection('servers').snapshots(includeMetadataChanges: true),
   builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
      if (snapshot.hasError) {
         return Text('Something went wrong');
      }
      if (snapshot.connectionState == ConnectionState.waiting) {
         return Text("Loading");
      }
      return Container(
         child: DropdownSearch<String>(
            items: snapshot.data!.docs.map((DocumentSnapshot document) {
               Map<String, dynamic> data = document.data()! as Map<String, dynamic>;
               return data["password"];
            })
            .toList()
            .cast<String>(),
         onChanged: print,
         ),
      );
   },
),

And this is my firebase database:

I've tried to write those code inside children: <Widget>[] but the data can't showed in my app.
Thank you in advance for any help.

A: Dropdowns are usually used as static data so if you are keeping that data in firebase. It would be better to fetch this data in a list in initState method and then use in the StreamBuilder instead of fetching it in StreamBuilder


text:
Q: When using the Toolbox in Visual Studio 2010 to pull data from a MySQL server, keeps giving errors In my table called "test01" I keep getting an error when I run the site.

You have an error in your SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near '[test01]' at line 1
Description: An unhandled exception occurred during the execution of
  the current web request. Please review the stack trace for more
  information about the error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: You have an
  error in your SQL syntax; check the manual that corresponds to your
  MySQL server version for the right syntax to use near '[test01]' at
  line 1

From what I can see it is because the code that it is generating when I bring toolbox items and drop them in design view is this:
SelectCommand="SELECT * FROM [test01]"
        DeleteCommand="DELETE FROM [test01] WHERE [test_id] = ?"
        InsertCommand="INSERT INTO [test01] ([test_id], [TestName], [TestDescription]) VALUES (?, ?, ?)"
        UpdateCommand="UPDATE [test01] SET [TestName] = ?, [TestDescription] = ? WHERE [test_id] = ?">

When I remove the [ ] brackets it works fine. Is there something I can do to change the functionality of this?
I hope this question makes sense!

A: Brackets are a MSSQL way of qualifying stuff. You want backticks for MySQL.
SELECT * FROM `test01`


text:
Q: Mean structure for highly dependent covariates in migration data? A group of subjects (animals) travel from position A to position B over a period of 4 months. Every day in these months, a response $y$ has been measured on each subject.
The two main covariates are Date and Position (longitude and latitude).
From Date, we can infer what month it is, what day it is, what week it is, etc.
Since the movement of the animals is of a migratory nature, position is going to be highly dependent on date (in particular "month", since the animals are not constantly moving, but settle at particular positions where they stay for a while, until they move somewhere else, and stay there for a while, etc).
My question is, how should the mean structure in a linear normal regression be modelled for the response $y$, if the interest lies in the influence of date and position on the response $y$? I was thinking something like:
$$y \sim f(day) + month + f(lon,lat)$$
So, we use smooth additive terms to model the influence of day and position, while month enters as a factor.
I would then try to reduce this model using AIC and see whether the dependency of some of the covariates results in us not needing e.g. "day" but only month, or maybe position is unnecessary, since "day" and "month" alone suffice.


text:
Q: How to combine 3 or 4 arrays into one I have three following arrays.
Array ( [0] => 395 [1] => 295 )
Array ( [0] => 5a3a13f237715637629.jpeg [1] => 5a3b602654cfd527057.jpg )
Array ( [0] => Seller Test Product [1] => Offline Product for Test )

The first array is the quantity, the second array is for the images, the third array is for the name of the products.
I want to combine all these three array into one and display it using foreach loop in PHP.
if I use array_merge(), I am getting the output:

Array ( [0] => 395 [1] => 295 ) Array ( [0] => 5a3a13f237715637629.jpeg [1] => 5a3b602654cfd527057.jpg ) Array ( [0] => Seller Test Product [1] => Offline Product for Test ) Array ( [0] => 5a3a13f237715637629.jpeg [1] => 5a3b602654cfd527057.jpg [2] => Seller Test Product [3] => Offline Product for Test [4] => 395 [5] => 295 )

Now, how can I display it using foreach loop in the view.
in the view the code is :
<?php foreach($c as $key => $strs)
    {  ?>

    <img style="width:150px;" src="<?php echo @getimagesize(base_url("assets/upload/product/".$key)) ? base_url("assets/upload/product/".$key):'http://placehold.it/350x200';?>" class="img-responsive">
    <input type="text" name="vala" value="<?php echo $strs; ?>">
    <input type="text" name="valas" value="<?php echo $strss; ?>">

    <?php } ?>

Any help is welcome.

A: So what you really want is to group all fields of all arrays together. Values with the same index shall be merged into a single object. array_map() can be used for this.
$final = array_map(function($quantity, $image, $name) {
        return (object)['quantity' => $quantity, 'image' => $image, 'name' => $name];
    }, $quantityArray, $imageArray, $nameArray);

The result will be:
[
    {
        'qunatity' => 395,
        'image' => '5a3a13f237715637629.jpeg',
        'name' => 'Seller Test Product'
    },
    {
        'qunatity' => 295,
        'image' => '5a3b602654cfd527057.jpeg',
        'name' => 'Offline Product for Test'
    }
]

You can then address them in your foreach like this:
foreach($final as $product) {
    echo $product->name;
    echo $product->image;
    echo $product->quantity;
}

For those of you who are in a real hurry, the following call to array_map() will do the same trick, but without mapping the array fields to a specific key in the new multidimensional array:
$final = array_map(NULL, $quantityArray, $imageArray, $nameArray);

The result will be:
[
    [
        0 => 395,
        1 => '5a3a13f237715637629.jpeg',
        2 => 'Seller Test Product'
    ],
    [
        0 => 295,
        1 => '5a3b602654cfd527057.jpeg',
        2 => 'Offline Product for Test'
    ],
]

The inner arrays of the newly created mltidimensinal array will be filled in the order of which the arrays were provided to array_map().

A: You can loop one array and use key to get the corresponding value from the other arrays.
$a=array ( 0 => 395,1 => 295 );
$b=array ( 0 =>" 5a3a13f237715637629.jpeg" ,1 => "5a3b602654cfd527057.jpg" ) ;
$c=array ( 0 => "Seller Test Product",1 => "Offline Product for Test" );

Foreach($a as $key => $val){
    $res[$key]['qty'] = $val;
    $res[$key]['img'] = $b[$key];
    $res[$key]['desc'] = $c[$key];
}
Var_dump($res);

Output:
array(2) {
  [0]=>
  array(3) {
    ["qty"]=> int(395)
    ["img"]=> string(25) " 5a3a13f237715637629.jpeg"
    ["desc"]=> string(19) "Seller Test Product"
  }
  [1]=>
  array(3) {
    ["qty"]=> int(295)
    ["img"]=> string(23) "5a3b602654cfd527057.jpg"
    ["desc"]=> string(24) "Offline Product for Test"
  }
}

https://3v4l.org/h8B0u

A: Example Code
<?php
$array1=array ( 0 => 395,1 => 295 );
$array2=array ( 0 =>" 5a3a13f237715637629.jpeg" ,1 => "5a3b602654cfd527057.jpg" ) ;
$array3=array ( 0 => "Seller Test Product",1 => "Offline Product for Test" );
echo "<pre>";
print_r($array1);print_r($array2);print_r($array3);
$result=array_merge($array1,$array2,$array3);
print_r($result);
?>


text:
Q: Which material is considered non linear communication channel? Communication channels as far I have seen(Air and conductors) are modeled as Linear systems. Was wondering if there are mediums/materials that make the channel nonlinear? For example, if channel is through human body, how do I know if it's linear or not?

A: Linearity in the medium is usually limited by the variation of the dielectric constant Dk.  For cables with Dk reducing somewhat above 1Ghz and for optical fibre the same is true for single and multi mode glass fibres which causes diffraction due to the Dk value. So variations in Dk cause group delay skew variable and optical diffraction  variances.
I have tested my body up to 6GHz with an Anritsu VNA and and HP spectrum analyzers and  found no such cutaneous or subcutaneous external harmonic distortion or peculiar resonances other than natural inductive leads with variable capacitance.  However there must be some dielectric variation effects found in Nuclear Imaging but this is beyond my bandwidth to explain or professional experience although I have collected and created many such datasets in both CAT and MRI for my amusement in 3D analysis.  (most diagnostics are done in 2D)


text:
Q: The bean 'exampleService.FeignClientSpecification' could not be registered. Bean already defined and overriding is disabled My feign client class is as below along with the Application class.
@FeignClient(name = "ExampleService", configuration = FeignClientConfig.class, url = "http://localhost:8091")
public interface ExampleClient {
  @GetMapping(value = "exampleService/exampleDetails/{id}")
  public List<ExampleDTO> getExampleDetails(@PathVariable(name = "id") final Long id);
}

@EnableAutoConfiguration
@EnableScheduling
@SpringBootApplication
@EnableFeignClients(basePackages = {"com.package.example"})
@ComponentScan(basePackages = {"com.package"})
public class ExampleApplication extends SpringBootServletInitializer {
  public static void main(String[] args) {
    SpringApplication.run(ExampleApplication.class, args);
  }
}

In the above code I'm getting the error as given below
APPLICATION FAILED TO START

Description:
The bean 'ExampleService.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled.

Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding = true

First of all, there's only 1 feign client by that name being defined in the project.
Second I tried giving it a context ID just in case there was a bean with the same name being defined somewhere I must've missed.
@FeignClient(contextId = "myExampleService", name="ExampleService", configuration = FeignClientConfig.class, url = "http://localhost:8091")

but again it gave me the same error
The bean 'myExampleService.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled.

Third, I also tried by giving the property in application.properties file for overriding the bean
spring.main.allow-bean-definition-overriding = true

but still I'm getting the same error.
Any reason why I'm getting this issue even though there is only 1 bean with the name available for Spring's app context?

A: It might not be the OP's problem since he has only one feign client, but to anyone that got here by googling the same error:
The name attribute of the @FeignClient annotation works as a unique identifier to the client.
If you want to have multiple feign clients within the same Spring context, each needs to have a unique name (or value, as these two attributes are aliases to each other)
For instance:
@RequestMapping(value="/endpoint/path")
@FeignClient(name = "MUST-BE-UNIQUE")
public interface MyClient {
}

A: I had this same problem.
For me it was a maven issue, it seemed like 2 copies of the same library were being used (not because of a real problem but because maven had "got confused". I had been maven installing local builds of a library).
I resolved the problem by deleting my C:\Users{user}.m2\repository and then reimporting the project

A: This can also happen if you have more than 1 @FeignClients defined with the same name:
Link
Giving unique names in my clients fixed it for me

A: Try deleting FeignClient interface(ExampleClient) from your test package and run the test case and I hope it should work now.

A: I had this issue even though my two FeignClients were completely different. The problem went away once I added @Component to both of my FeignClient classes

A: I hab this problem because i had the same contextId in two FeignClients. I made them unique and it worked

A: That might happen if you have two
@EnableFeignClients

annotations, with properties that cover one or more feign clients multiple times, for example
@EnableFeignClients(basePackages = {"com.example.feign.api"})
public class FeignConfigs {
...
}
@EnableFeignClients(basePackages = {"com.example"})
public class Application {
...
}

That was my case. Hope that helps.

A: In my case, it was the simplest typo in the application.properties:
examples.api.service.name=example-api
spring.security.oauth2.client.registration.examples-api.provider=examples-api

As you can see, it's in plural everywhere except for the service.name.
After fixing it to be in plural as well, it started working.


text:
Q: Spring Application loads twice I'm new to Spring and trying to get a example to work. But my application loads twice each time it starts. I think it could be a context problem because of my internet research and I have just one context.xml.
    <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

     <context:annotation-config/>

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:environment.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="false"/>
    </bean>

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:environment.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="false"/>
    </bean>

    <bean name="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper" />

   <bean name="restTemplate" class="org.springframework.web.client.RestTemplate">
      <property name="requestFactory" ref="requestFactory" />
   </bean>

   <bean name="requestFactory" class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory">
      <property name="connectTimeout" value="10000" />
      <property name="readTimeout" value="10000" />
   </bean>

   <bean name="httpClient" class="org.apache.http.client.HttpClient" factory-bean="requestFactory" factory-method="getHttpClient"/>

    <bean name="TraderApplication" class="net.mrmoor.TraderApplication"/>

    <bean name="API" class="com.iggroup.api.API"/>
    <bean name="LightStreamerComponent" class="com.iggroup.api.streaming.LightStreamerComponent"/>

</beans>

My code of the TraderApplication Class is:
... skipped imports ....

@SpringBootApplication
public class TraderApplication implements CommandLineRunner{

private static final Logger log = LoggerFactory.getLogger(TraderApplication.class);

@Autowired
protected ObjectMapper objectMapper;

@Autowired
private API api;

@Autowired
private LightStreamerComponent lightStreamerComponent = new LightStreamerComponent();

private AuthenticationResponseAndConversationContext authenticationContext = null;
private ArrayList<HandyTableListenerAdapter> listeners = new ArrayList<HandyTableListenerAdapter>();

public static void main(String args[]) {
    SpringApplication.run(TraderApplication.class, args);
}

@Override
public void run(String... args) throws Exception {
    try {
        if (args.length < 2) {
            log.error("Usage:- Application identifier password apikey");
            System.exit(-1);
        }

        String identifier = args[0];
        String password = args[1];
        String apiKey = args[2];
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("/public-api-client-spring-context.xml");
        TraderApplication app = (TraderApplication) applicationContext.getBean("TraderApplication");
        app.run(identifier, password, apiKey);
    } catch (Exception e) {
        log.error("Unexpected error:", e);
    }
}

A: You mention in your comments above you got this working by removing SpringApplication.run(TraderApplication.class, args); but this would be removing spring-boot from your application so I'm going to assume since your question has a tag of [spring-boot] that this is not what you wanted. So here is an alternative way that you can configure beans using your xml.
@ImportResource({"classpath*:public-api-client-spring-context.xml"}) //Proper way to import xml in Spring Boot
@SpringBootApplication
public class TraderApplication implements CommandLineRunner {

    ...code you had before goes here

    @Autowired
    TraderApplication app;

    @Override
    public void run(String... args) throws Exception {
        .. your parsing logic here

        app.run(identifier, password, apiKey); //Now uses the autowired instance

    }
}

You didn't list your pom.xml or build.gradle but it's important to remember that components you have registered in your context xml may be automatically configured in Spring Boot and you may not need to register them yourself in your xml.(Depending on which items you have starters for in your build file)


text:
Q: How do I translate my SQL server code to produce a distinct counts query in Access 2010? Related to the following:
What SQL can I use to retrieve counts from my payments data?
SQL : how can i count distinct record in MS ACCESS
Sample data:
Student ID |  School  | School Service Type | PaymentStartDate | PaymentEndDate | FiscalYear
   001          ABC              ED             2014-01-02         2014-08-02       2014
   001          ABC              ED             2014-06-02         2014-06-05       2014
   002          ABC              ED             2014-04-02         2014-08-05       2014
   002          DEF              ED             2014-06-01         2014-06-05       2014
   002          DEF              ED             2014-02-01         2014-06-15       2014
   002          ABC              EZ             2014-03-01         2014-07-01       2014
   003          ABC              EZ             2014-01-30         2014-07-15       2014
   003          ABC              EZ             2014-03-01         2014-07-01       2014

What I want my count to look like:
  Month  |  FiscalYear  | School | School Service Type | Count

    May         2014        ABC            ED              2
    May         2014        ABC            EZ              2
    May         2014        DEF            ED              1
   June         2014        ABC            ED              2
   June         2014        ABC            EZ              2
   June         2014        DEF            ED              1
   June         2014        DEF            EZ              0

What my current SQL Server code looks like:
SELECT FiscalYear
      ,'11 May'              AS PAYMENT_MONTH
      ,School
      ,School Service Type
      ,COUNT(DISTINCT Student ID) AS UNIQUE_STUDENT_COUNT
  FROM [dbo].[MYODBCTABLE]
 WHERE FiscalYear = '2014'
   AND School Service Type IN ('ED', 'EZ')
   AND MONTH(PaymentStartDate) = 05
 GROUP BY
       FiscalYear
      ,School
      ,School Service Type
 ORDER BY 1,2,3
UNION
 SELECT FiscalYear
      ,'12 JUNE'              AS PAYMENT_MONTH
      ,School
      ,School Service Type
      ,COUNT(DISTINCT Student ID) AS UNIQUE_STUDENT_COUNT
  FROM [dbo].[MYODBCTABLE]
 WHERE FiscalYear = '2014'
   AND School Service Type IN ('ED', 'EZ')
   AND MONTH(PaymentStartDate) = 06
 GROUP BY
       FiscalYear
      ,School
      ,School Service Type
 ORDER BY 1,2,3

Desire: To create analogous SQL code that will allow me to perform this process in the Access 2010 environment.
Challenge:
1) Microsoft Access lacks the Count Distinct function.
I have been trying to follow the instructions laid out here, but I've had no luck in getting the SQL statements I derive to work properly.
As always, thank you for your time.

A: For what it's worth, this also works as a pass-through query in Access:
SELECT
     MONTH(PaymentStartDate) AS PAYMENT_MONTH
    ,FiscalYear
    ,School
    ,[School Service Type]
    ,COUNT(DISTINCT [Student ID]) AS UNIQUE_STUDENT_COUNT
FROM [dbo].[MYODBCTABLE]
WHERE FiscalYear = '2014'
    AND [School Service Type] IN ('ED', 'EZ')
GROUP BY
     MONTH(PaymentStartDate)
    ,FiscalYear
    ,School
    ,[School Service Type]
ORDER BY 1,2,3

That is, this:

produces this

A: You have to get the distinct values first, and then count them.  So you'll need some sort of sub-query to get the distinct set of student ids.  I think you can get what you want this way:
(psuedo-code)
This will be your inner query, getting your set of distinct students.
select
,'11 May'              AS PAYMENT_MONTH
,School
,School Service Type
,Student id
from
dbo_ODBCTable
...
group by
School,
School Service Type,
Student id

Then you'll use that as a subquery to get your result:
select
payment_month,
school,
school service type,
count (student id)
from
( select
    ,'11 May'              AS PAYMENT_MONTH
    ,School
    ,School Service Type
    ,Student id
    from
dbo_ODBCTable
...
    group by
    School,
    School Service Type,
    Student id)  t1
group by
payment_month,
school,
school service type


text:
Q: MongoDB copying key and value from one key and value to another I am trying to copy key and value to field of each document.
Document example "db.ruj_users.find()":
{

    "_id" : ObjectId("52fd5f7ae1ab21223018121d"),
    "email_notification" : "on",
    "email_notification_interval" : "immediately",
    "news_notification" : "on",
    "notifs" : [
        {}
    ],

}

Code that I have tried:
db.ruj_users.find().snapshot().forEach(function(elemt) {
    elemt.notifs.emailNotif = elemt.email_notification;
    elemt.notifs.emailNotifIntrval = elemt.email_notification_interval;
    elemt.notifs.newsNotif = elemt.news_notification;

db.ruj_users.notifs.update(
{$set:[
    elemt
    ]
})

error received: uncaught exception: assert failed : need an object
Basically, I want to organize my documents so I want to copy "email_notifcations, email_notifications_interval, and news_notification" into "notifs" then delete the old entries.

A: Following query set notifs field and delete all another ("email_notifcations", "email_notifications_interval" and "news_notification"), because of used update command without $set operator.
db.ruj_users.find().forEach(function (elem) {
    var obj = {
        emailNotif: elem.email_notification,
        emailNotifIntrval: elem.email_notification_interval,
        newsNotif: elem.news_notification,
    };
    db.ruj_users.update({_id: elem._id}, { notifs: obj });
})

Be sure that your documents haven't any another fields (except _id), because this fields will be removed too. In this case you should rewrite query with $set operator.


text:
Q: How to total a column in a table based on filter criteria from two other columns in excel I have the following Table as an example:
Name     Task     Amount
Jennifer Sing     10
Tom      Dance    15
Joe      Jump     72
Mandy    Scream   10

And supporting lists:
Names       Tasks
Jennifer    Dance
Joe         Sing
            Jump

I need to find the total of the sum of amounts where Name is in the Names list AND Task is in the Tasks list.  In other words, if the person AND the task are in the list of relevant people and tasks, total their amount.
So, for example, the total would be 10+72=82.
I have tried to name the ranges of the criteria lists as RelevantNamesList and RelevantTasksLists, and the input table columns as Names and Tasks and Hours, and then using sumif, however I am not even able to get it to work with a single condition.
=SUMIF( Names, ( -- ( ISTEXT(VLOOKUP( Names, RelevantNamesList, 1, FALSE))) ), Amounts)

The actual result I get using the above code is a 0, which is obviously not correct.  I have also tried to use sumproduct, with no success.  I am beginning to think that I wont be able to use this without helper columns.
Is there a way to do this without helper columns?
Thanks in advance!
Jacqueline

A: Give this a try:
=SUMPRODUCT((COUNTIF(<Names To Lookup>,<All Names List>)>0)*(COUNTIF(<Tasks To Lookup>,<All Tasks List>)>0)*<All Amounts List>)

So if you had a data setup like this:

Then the formula would be:
=SUMPRODUCT((COUNTIF($E$2:$E$3,$A$2:$A$5)>0)*(COUNTIF($F$2:$F$4,$B$2:$B$5)>0)*$C$2:$C$5)

EDIT:
Per comment, the lookup criteria could be partial matches.  For example, the name in the list is Ms Jennifer Keim and what's being looked up would be Jennifer.  In order to accomodate this, you'd need to switch tactics to the DSUM function.  This means that you'll need to alter how you setup the criteria.
There are two ways to do this, the first is to create a row for each set of criteria you want, and the second is to have the limited list like you originally have and then setup criteria formulas you then feed into the DSUM.  Here's the data setup for the first scenario (note that the lookup headers must exactly match the table headers and that you're putting the wildcards for partial match directly in the criteria):

The DSUM formula in this scenario is:
=DSUM($A$1:$C$5,"Amount",$E$1:$F$7)

For the second scenario, we setup the limited criteria like you originally had it, but now we need helper formulas to feed into the DSUM.  Note that the helper formula headers must not be in your original datatable (here i've added "Check" to the end of the header names as an example):

The formulas need to reference the first cell in your datatable and perform the check against your criteria.  The DSUM formula will expand that formula's check against every row, so we only need this for the first row to establish the logic that DSUM will use.  Here are the two formulas for NameCheck (cell H2 in this example) and TaskCheck (I2).  We are using these formulas to allow for partial matches when looking up the criteria against the datatable:

*

*NameCheck: =SUMPRODUCT(--(LEN(SUBSTITUTE(A2,$E$2:$E$3,""))<LEN(A2)))

*TaskCheck: =SUMPRODUCT(--(LEN(SUBSTITUTE(B2,$F$2:$F$4,""))<LEN(B2)))
Now the DSUM criteria argument references those formula cells and becomes:
=DSUM($A$1:$C$5,"Amount",$H$1:$I$2)

For further reading and information regarding the DSUM formula, Contextures has a great explanatory article with an example workbook you can download and experiment with: https://contexturesblog.com/archives/2012/11/15/dsum-and-excel-tables-sum-with-multiple-criteria/


text:
Q: USB lag when mouse cursor changes Please, do not consider this question as a duplicate of this one -- it's not an Intel graphics problem in my case and the issue is a bit different.

I've got a new PC with Windows 10 and experiencing a weird issue with USB devices.
Issue
When mouse cursor icon changes (like when hovering a browser URL link or a text field) a USB lag between 500ms to 2seconds occurs. By USB lag I mean that any device connected to any USB port stops responding: mouse stops moving, keyboard not responding, audio drops out (I use an external USB audio interface). It's not happening at each transition, but somewhat randomly, though quite persistently.
Imagine moving mouse cursor over a Google search results page: the cursor state will change to hand when hovering a URL link, to text selection when hovering description text below the links and to pointer when in the "free" areas. In my case mouse will constantly lag and the sound drop-out if I would just move the cursor over such page.
System info

*

*OS: Windows 10 Pro

*CPU: Intel Core i7 6900K

*Motherboard: ASUS X99-A

*GPU: ASUS STRIX GTX1080-O8G-GAMING

*DDR: 8x8GB, DDR4, Crucial Ballistix Elite, 2666 Mhz

*SSD: 2 TB, Samsung 850 PRO

*HDD: 3Tb SATA-III Western Digital Red (WD30EFRX)

*External USB devices: wireless mouse (Logitech G900), wireless keyboard (Logitech K800), USB 2.0 Audio Interface (Roland QUAD-CAPTURE)

What I've tried

*

*Using Windows Clean Boot – the issue persisted;

*Installing fresh Windows 10 – issue occurs right from the start;

*Trying different drivers for the USB devices/controllers and the MB chipset – no changes;

*Trying different NVidia drivers – no changes;

*Updating motherboard BIOS to the latest version – no changes;

*Switching HCI mode in BIOS – there was definitely some effect here. In EHCI mode (USB 2) the mouse lags were much more noticeable, while the audio drop-outs were at minimum, and in xHCI (USB 3) it was vice-versa: more audio lags and less mouse;

*Using different USB ports – there was some subtle difference depending on what USB ports I've used. When a device is connected to an Intel USB controller port the lags are more frequent, while ASMedia's ports had less issues;

*Disabling any power saving features in BIOS, Windows power management and in the device manager for each of the USB devices and USB controllers – no difference;

*Unplugging all the USB devices except the mouse – no changes;

*Using different mouses (both wired and wireless) – no changes;

*Trying another GPU – no changes;

*Trying another Motherboard (ROG STRIX X99) – completely solved mouse lag issue, but audio drop-outs persisted in xHCI mode;

*Disabling all the mouse features in Windows mouse settings (enhance pointer precision, pointer trails, pointer hiding when typing, pointer shadow) – no changes, except for trails (more on that below).

The weird
Now, the weirdest thing about this: enabling the "display pointer trails" option in the Windows mouse settings completely solves the issue! I can't really comprehend why this happening, how could such "cosmetic" option affect all the USB devices in the system? I've set the trail distance to be as short, as possible, but it's still noticeable and quite distracting, so I'm looking for a way to fix the issue without enabling the trails.

A: I was able to avoid the same reproducible problem with my Universal Audio Apollo Twin USB 3.0 audio interface by using their latest driver 9.2 in which they have added the new option "USB Safety Buffer", which is part of the "USB Audio Transfer protocol 2.0" which has been added to Windows 10 with the Creators Update.
You might need a new audio driver from Roland which supports the "USB Audio Transfer protocol 2.0" for Windows 10 incl. Creators Update.
In my case LatencyMon reported dxgkrnl.sys with highest execution of 1.6 ms which is too high (max 1.0 ms allowed). I think in my case its the Intel Display Driver 630 which doesn't return fast enough to dxgkrnl.sys (as far as I understand). I would have to report this to Intel.
In the audio driver I had to increase the USB Safety Buffer from "Minimal" to "Small" and until today I had no audio drop outs anymore. As far I understand, "Small" adds 1 ms to standard 1 ms - in total 2 ms time before audio drop outs could occur.
Please read my Intel report:
https://communities.intel.com/message/483201
If your are not able to get a new audio driver - try to use LatencyMon and contact the driver providers.


text:
Q: $ f'(x)+g'(y)=h(x)+t(y)$ $f$ and $h$ are two functions of $x$
$g$ and $t$ are two functions of $y$
And $f'$ derivative of $f$ ,$g'$ derivative of $g$
Is it correct to say that by identification $f'(x)=h(x)$ and $g'(y)=t(y)$ ?

A: No, there may be a constant. For example :
$$f'(x)=x^2+1$$
$$g'(y)=y^2+3$$
$$h(x)=x^2$$
$$t(y)=y^2+4$$
:)

A: Not quite. Since we have
$$
f'(x) - h(x) = t(y) - g'(y),
$$
we know that each side must be a constant. If you're not convinced, consider what happens if we change $y$ but not $x$. However, this constant need not be zero. The best we can conclude is
$$
f'(x) = h(x) + C\;\;\;\;;\;\;\;\; g'(y) = t(y) - C
$$
for some constant $C$.
This constant $C$ is very important and definitely can't be neglected. For example, in the hydrogen atom problem in quantum mechanics, these constants appear as the quantum numbers of electron states.

A: Not quite. If you isolate the x-terms on one side and the y-terms on the other, you get
$$f'(x)-h(x)=t(y)-g'(y)$$
Since the LHS depends only on $x$ and the RHS depends only on $y$, you may conclude that both sides are equal to some constant $C$.
So you have $$f'(x)=h(x) + C$$ and $$g'(y) = t(y)-C$$
where the $C$ is the same in both equations.
Note there may be many values of $C$ for which this is true, or there may be none. Not every value of $C$ necessarily produces equations which have solutions (but they may).


text:
Q: Verificar se conexão de internet ativa Existe alguma função que retorne se existe uma conexão de internet ativa?
Digo, não somente a placa de rede conectada, mas sim, uma conexão ativa efetivamente.
Vlw.

A: Private Declare Function Ping Lib "iphlpapi" _
Alias "#65" (ByVal pInternetProtocol As Long, pNumberOfCalls As Long, _
ByVal pMaxNumberOfCalls As Long, lTime As Long) As Long
Private Declare Function ConvertStringToIP Lib "wsock32" _
Alias "#10" (ByVal stoip As String) As Long

Function MyPing(sIPAddr As String) As Boolean
Dim IP As Long, pNumCalls As Long, lTime As Long
IP = ConvertStringToIP(sIPAddr)
MyPing = (Ping(IP, pNumCalls, 15, lTime) = 1): End Function

'Chamando a Função'
Private Sub Form_Load()
Dim Result As Boolean: Result = MyPing("200.158.24.129")
If Result = True Then
MsgBox "OK"
Else
MsgBox "Não Respondeu": End If
End Sub

A: É que essa solução é com chamada de API e depende de DLLs específicas. Uma outra solução é usar o componente INET e codificar assim:
Wresposta = Inet1.OpenURL("http://www.brasil.gov.br/")
if Wresposta = "" then
   msgbox("Fora da NET")
endif


text:
Q: ERROR while working with Bunsen for FHIR data transformation to spark: py4j.protocol.Py4JJavaError: An error occurred while calling o37.extractEntry
*

*I am learning Bunsen https://engineering.cerner.com/bunsen/0.5.10-SNAPSHOT/index.html for handling FHIR data with Pyspark

*the folder bundles contain a fhir bundle which is a collection of resources as json objects

*I downloaded all the requirements needed such as the bunsen module and the jar file for pyspark and I run these commands:
>>> import pyspark
>>> from bunsen.r4.bundles import load_from_directory, extract_entry
>>> bundles = load_from_directory(spark, "C:\\Users\MoemenEbdelli\Desktop\oumaima\bundles")
>>> observations = extract_entry(spark, bundles, 'Patient').cache()

the last command invoked an ERROR:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\bunsen\python\bunsen\r4\bundles.py", line 101, in extract_entry
    bundles.extractEntry(sparkSession._jsparkSession, javaRDD, resourceName, jArray),
  File "C:\spark\spark-3.2.0-bin-hadoop3.2\python\lib\py4j-0.10.9.2-src.zip\py4j\java_gateway.py", line 1309, in __call__
  File "C:\spark\spark-3.2.0-bin-hadoop3.2\python\pyspark\sql\utils.py", line 111, in deco
    return f(*a, **kw)
  File "C:\spark\spark-3.2.0-bin-hadoop3.2\python\lib\py4j-0.10.9.2-src.zip\py4j\protocol.py", line 326, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o37.extractEntry.
: java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.expressions.objects.Invoke$.apply$default$5()Z
        at com.cerner.bunsen.EncoderBuilder.com$cerner$bunsen$EncoderBuilder$$childToExpr(EncoderBuilder.scala:259)
        at com.cerner.bunsen.EncoderBuilder$$anonfun$6.apply(EncoderBuilder.scala:307)
        at com.cerner.bunsen.EncoderBuilder$$anonfun$6.apply(EncoderBuilder.scala:307)
        at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
        at scala.collection.Iterator.foreach(Iterator.scala:943)
        at scala.collection.Iterator.foreach$(Iterator.scala:943)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
        at scala.collection.IterableLike.foreach(IterableLike.scala:74)
        at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
        at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
        at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
        at com.cerner.bunsen.EncoderBuilder.com$cerner$bunsen$EncoderBuilder$$serializer(EncoderBuilder.scala:307)
        at com.cerner.bunsen.EncoderBuilder$.of(EncoderBuilder.scala:53)
        at com.cerner.bunsen.EncoderBuilder.of(EncoderBuilder.scala)
        at com.cerner.bunsen.FhirEncoders.of(FhirEncoders.java:213)
        at com.cerner.bunsen.FhirEncoders.of(FhirEncoders.java:262)
        at com.cerner.bunsen.Bundles.extractEntry(Bundles.java:291)
        at com.cerner.bunsen.Bundles.extractEntry(Bundles.java:235)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
        at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
        at py4j.Gateway.invoke(Gateway.java:282)
        at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
        at py4j.commands.CallCommand.execute(CallCommand.java:79)
        at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
        at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
        at java.lang.Thread.run(Thread.java:748)


text:
Q: Select2 search highlights results based on option value I'm using Select2 to let the user select among a list of email addresses. The option value is the actual email address, while the option html display the full name (and again the email address).
<select>
       <option value="test@mail.com">Test Mail [test@mail.com]</option>
       ...
<select>

What happens is that the user types the email address (eg. test@email.it) and Select2 finds a possible match, but since it's not exactly the same as the html, it doesn't automatically highlight the first match.
Therefore I would like Select2 to highlight (preselect) the search results based on the value or, as an alternative, to always highlight the first result of a search if present.
Does anybody know how to do that? Thanks!


text:
Q: How do i install apt-get on Redhat AWS linux machine I have spun a Redhat linux machine in aws,but struggling to install apt-get ,here is uname -a
Linux ip-172-31-69-100.ec2.internal 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4 20:48:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Could you provide help just to let me know how to get apt-get working in Redhat linux aws machine

A: actually my search was how to make sudo snap conjure-up --classic working in Amazon aws Linux machine,I was trying to run
sudo snap conjure-up --classic working in Amazon  aws Linux machine,but i was getting message as snap not found sometimes apt-get not found,my quest was then how do i get snap in amazon linux machine?
Resolution:-one of my colleague explained"Unfortunately, conjure-up has been developed by Canonical, the creator of Ubuntu and is only tested on Ubuntu Linux machines. It most likely won't work on other OS'es. You'll need to spin up an Ubuntu machine to use conjure-up."


text:
Q: Is it possible to save an html element with child elements as JS variable which you can dynamically append to the DOM? I have this form snippet

       <select style="width:250px;" name="drug_pack_size" id="drug_pack_size" class="form-control">
         <option value="">Selling Unit</option>
         <option value="Ampoule">Ampoule</option>
       </select>

contains

         <input type="text" class="form-control">

for

         <input type="text" class="form-control">

GHC

Is it possible to do something like this
const form = document.querySelector('#form-element').content

Such that you can append it repeatedly and dynamically with JS code, without writing everything from the JS Backend

A: Yes, it is possible. Please try
 var x = document.getElementById("form-container").outerHTML;
 window.alert(x);

After this capture, if you want to repeatedly add same parent Element, then include variable(s) to increment the id and/or name of the parent and child elements to prevent duplication. For example, id="form-container1", id="form-container2", id="form-container3", and so on.


text:
Q: Lower bound example on the Greedy coloration of a planar graph Context
A coloring of a graph $G=(V,E)$ is an assignation of a color for each vertex $c:V\rightarrow \{1,\dots, s\}$ such that two adjacent vertices have distinct colors: $uv\in E \Rightarrow c(u)\neq c(v)$.
Consider the following recursive algorithm that computes a greedy coloring of a graph $G$.

*

*find a vertex $v$ with minimum degree,

*recursively compute a coloring of $G\setminus v$,

*complete this coloring by assigning to $v$ the smallest color available.

When the graph is planar, by a simple manipulation of the Euler Characteristic one can show that there is always a vertex $v$ of degree $d(v)\le 5$. Since the class of planar graphs is stable by vertex deletion, this algorithm produces a coloration of a planar graph with $c\le 6$ colors.
(the four color theorem tells us that any planar graph has a coloring with $4$ colors, and some planar graphs like $K_4$ need exactly four colors.)
Questions

*

*Is $6$ the best upper bound known for this greedy algorithm on planar graphs ?

*Is there an example of a planar graph on which the algorithm above returns a coloring with $5$ (or $6$) colors ?

Remark. Planar graphs are graphs that can be embedded on the sphere. For graphs that can be drawn on more general surfaces with Euler Characteristic $\chi$ (except for the Klein Bottle), this greedy algorithm returns a coloring with $\gamma(\chi)$ colors where $\gamma(\chi)$ is the size of the maximum clique that can be embedded on a surface of characteristic $\chi$, thus suggesting that the greedy coloring is somehow optimal for higher genus graphs (see Heawood Conjecture).

A: This algorithm is known as "smallest-last coloring"; see, for example, Matula and Beck, Smallest-Last Ordering and Clustering and Graph Coloring Algorithms.
It is not always optimal for planar graphs. The first "slighty-hard" case is the triangular prism, which is 3-colorable, but for which some choices of minimum-degree vertex lead to a 4-coloring. The first hard example is the antiprism graph shown below: it can be verified that although its chromatic number is 4, any way of executing the smallest-last coloring algorithm leads to a 5-coloring. (Kosowski and Manuszewski, Classical coloring of graphs)

I don't know if there are any cases where the smallest-last coloring algorithm will always use 6 colors on a planar graph. I haven't even found any "slightly-hard" cases of this type, though everyone seems to assume that they exist.
However, there are examples where this algorithm will (given unfortunate choices of minimum degree vertex, not for all possible choices) use arbitrarily many colors on a non-planar but bipartite graph (which is 2-colorable). Coleman and Moré, Estimation of sparse Jacobian matrices and coloring problems give the example of a graph on vertex set $\{u_i, v_i, p_i, q_i, r_i, s_i : 1 \le i \le n\}$, with the following edges:

*

*A complete bipartite graph between $\{p_1, \dots, p_n\}$ and $\{r_1, \dots, r_n\}$;

*A complete bipartite graph between $\{q_1, \dots, q_n\}$ and $\{s_1, \dots, s_n\}$;

*A complete bipartite graph between $\{u_1, \dots, u_n\}$ and $\{v_1, \dots, v_n\}$, with the perfect matching $\{u_1v_1, \dots, u_nv_n\}$ deleted;

*Edges $u_i p_j$ and $v_i q_j$ for all $1 \le i \le j \le n$.

This is shown below for $n=4$:

The bad coloring uses $n+1$ colors and is obtained when coloring vertices in the order $$q_1, s_1, \dots, q_n, s_n,\;p_1, r_1, \dots, p_n, r_n,\;u_1, v_1, \dots, u_n, v_n$$ (that is, deleting vertices in the reverse of that order).