text:
Q: Converting std::string of hexadecimal to std::array A 12 byte string which represents 6 hexadecimal values, needs to be converted to an std:array<uint8_t,6>. I am getting erroneous results from the hexadecimal conversions. I re-purposed some of the code over here for the Hex conversions from a string. Thank you for your time
Code
std::vector<std::array<uint8_t,6> > tracker =
  {
    { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 },
    { 0x99, 0x99, 0x99, 0x99, 0x99, 0x99 }
  };

std::array<uint8_t, 6> singular= { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 };

void setMac() {
  Serial.println("MAC TEST 1");
  std::string macInput = "121212121212";
  macTrans(macInput);

  tracker.push_back(singular);
  for (const auto& target : tracker)
  {
    printf("%02x:%02x:%02x:%02x:%02x:%02x\n", target[0], target[1], target[2], target[3], target[4], target[5]);
  }
}

void macTrans(std::string mac){
    singular = HexToBytes(mac);
}

std::array<uint8_t,6> HexToBytes(const std::string& hex) {
  std::array<uint8_t,6> bytes;

  for (unsigned int i = 0; i < hex.length() && i < 12; i += 2) {
    std::string byteString = hex.substr(i, 2);
    uint8_t byte = (unsigned char) strtol(byteString.c_str(), NULL, 16);
    if (i==0)
      bytes[0] = byte;
    else
      bytes[i-1] = byte;
  }

  return bytes;
}

Current Output:
MAC TEST 1

66:66:66:66:66:66
99:99:99:99:99:99
12:12:30:12:fe:12

Expected Output:
MAC TEST 1

66:66:66:66:66:66
99:99:99:99:99:99
12:12:12:12:12:12

A: In HexToBytes, you're writing outside the array, and that has undefined behaviour.
(You are writing to positions 0, 1, 3, 5, 7, and 9.)
When you "repurposed" the code you found, you should have used division by two instead of subtraction by one.
Replace
if (i==0)
  bytes[0] = byte;
else
  bytes[i-1] = byte;

with
  bytes[i/2] = byte;


text:
Q: Mono: Compile MV5 project in Linux We are trying to compile a project using Mono and we have some trouble. We are quite new to Mono.
We are creating a csproj file with Xamarin, then we copy all the sources to a Linux box and we run the following command:
xbuild /path/to/csprojfile.csproj /t:Build /p:OutputPath="/var/pubsite/myproject" /p:Configuration="Release"

The project is built and successfully and copied to /var/pubsite/myproject correctly. However, when we run the project using fastcgi-mono-server4 the project is not working. We have an
System.ArgumentException
Directory does not exist
Parameter name: value

Description: HTTP 400.Error processing request.

We believe that we did not publish successfully. We realized that we were able to publish in older versions, where there was a folder called /var/pubsite/myproject/_PublishedWebsites that was built, but this folder is not created any more.

*

*How can we successfully build the mono application ?

*If the problem is that "/var/pubsite/myproject/_PublishedWebsites" is not created, how can we investigate what the problem is ? The output from the build does not show anything.

xbuild output
XBuild Engine Version 14.0
Mono, Version 4.4.2.0
Copyright (C) 2005-2013 Various Mono authors

Build started 9/27/2016 12:06:24 PM.
__________________________________________________
Project "/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj" (Build target(s)):
        Target PrepareForBuild:
                Configuration: Release Platform: AnyCPU
                Created directory "/var/pubsite/MyProject.Core.api/"
        Target ResolveProjectReferences:
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Common/MyProject.Core.Common.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.20/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Common/MyProject.Core.Common.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target ResolveAssemblyReferences:
/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved
                                For searchpath {CandidateAssemblyFiles}
                                Warning: {CandidateAssemblyFiles} not supported currently
                                For searchpath {HintPathFromItem}
                                Considered ../../packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll, but it does not exist.
                                For searchpath {TargetFrameworkDirectory}
                                Considered target framework dir /usr/lib/mono/4.5-api, assembly named 'Newtonsoft.Json' not found.
                                Considered target framework dir /usr/lib/mono/4.5-api/Facades/, assembly named 'Newtonsoft.Json' not found.
                                For searchpath {PkgConfig}
                                Considered Newtonsoft.Json, but could not find in any pkg-config files.
                                For searchpath {GAC}
                                Considered Newtonsoft.Json, but could not find in the GAC.
                                For searchpath {RawFileName}
                                Considered 'Newtonsoft.Json' as a file, but the file does not exist
                                For searchpath /var/pubsite/MyProject.Core.api/
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.exe' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll' as a file, but the file does not exist
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/PetaPoco.Core.Compiled.5.1.228/lib/net45/PetaPoco.dll' to '/var/pubsite/MyProject.Core.api/PetaPoco.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Interfaces.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Interfaces.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target ResolveProjectReferences:
                                Project "/var/source/MyProject.Core/Core/MyProject.Core.Data/MyProject.Core.Data.csproj" (default target(s)):
                                        Target PrepareForBuild:
                                                Configuration: Release Platform: AnyCPU
                                        Target CopyFilesMarkedCopyLocal:
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Common.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Common.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.OrmLite.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.OrmLite.PostgreSQL.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.PostgreSQL.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Text.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Text.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/Npgsql.3.1.7/lib/net45/Npgsql.dll' to '/var/pubsite/MyProject.Core.api/Npgsql.dll'
                                        Target GenerateSatelliteAssemblies:
                                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                                        Target GenerateTargetFrameworkMonikerAttribute:
                                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                                        Target CoreCompile:
                                        Skipping target "CoreCompile" because its outputs are up-to-date.
                                        Target _CopyAppConfigFile:
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/app.config' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll.config'
                                        Target DeployOutputFiles:
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll.mdb'
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.pdb'
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll'
                                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Data/MyProject.Core.Data.csproj".
                        Target ResolveAssemblyReferences:
/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved
                                For searchpath {CandidateAssemblyFiles}
                                Warning: {CandidateAssemblyFiles} not supported currently
                                For searchpath {HintPathFromItem}
                                Considered ../../packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll, but it does not exist.
                                For searchpath {TargetFrameworkDirectory}
                                Considered target framework dir /usr/lib/mono/4.5-api, assembly named 'Newtonsoft.Json' not found.
                                Considered target framework dir /usr/lib/mono/4.5-api/Facades/, assembly named 'Newtonsoft.Json' not found.
                                For searchpath {PkgConfig}
                                Considered Newtonsoft.Json, but could not find in any pkg-config files.
                                For searchpath {GAC}
                                Considered Newtonsoft.Json, but could not find in the GAC.
                                For searchpath {RawFileName}
                                Considered 'Newtonsoft.Json' as a file, but the file does not exist
                                For searchpath /var/pubsite/MyProject.Core.api/
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.exe' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll' as a file, but the file does not exist
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.18/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Ioc/MyProject.Core.Ioc.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.Web.Infrastructure.1.0.0.0/lib/net40/Microsoft.Web.Infrastructure.dll' to '/var/pubsite/MyProject.Core.api/Microsoft.Web.Infrastructure.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Interfaces.4.0.62/lib/portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10/ServiceStack.Interfaces.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Interfaces.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Text.4.0.62/lib/net40/ServiceStack.Text.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Text.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Common.4.0.62/lib/net40/ServiceStack.Common.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Common.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite.4.0.62/lib/net45/ServiceStack.OrmLite.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll' to '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.Client.5.2.3/lib/net45/System.Net.Http.Formatting.dll' to '/var/pubsite/MyProject.Core.api/System.Net.Http.Formatting.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.Core.5.2.3/lib/net45/System.Web.Http.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Http.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.WebHost.5.2.3/lib/net45/System.Web.Http.WebHost.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Http.WebHost.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.Razor.3.2.3/lib/net45/System.Web.Razor.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Razor.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.Helpers.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Helpers.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Deployment.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.Deployment.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Razor.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.Razor.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Mvc.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Autofac.3.5.2/lib/net40/Autofac.dll' to '/var/pubsite/MyProject.Core.api/Autofac.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Autofac.WebApi2.4.0.0/lib/net45/Autofac.Integration.WebApi.dll' to '/var/pubsite/MyProject.Core.api/Autofac.Integration.WebApi.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target _CopyAppConfigFile:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/app.config' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll.config'
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Ioc/MyProject.Core.Ioc.csproj".
        Target CopyFilesMarkedCopyLocal:
                Copying file from '/var/source/MyProject.Core/packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll' to '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll'
                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.20/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
        Target GenerateSatelliteAssemblies:
        No input files were specified for target GenerateSatelliteAssemblies, skipping.
        Target GenerateTargetFrameworkMonikerAttribute:
        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
        Target CoreCompile:
        Skipping target "CoreCompile" because its outputs are up-to-date.
        Target DeployOutputFiles:
                Copying file from '/var/source/MyProject.Core/Core/API/MyProject.Core.Api/obj/Release/MyProject.Core.Api.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Api.dll'
Done building project "/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj".

Build succeeded.

Warnings:

/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj (Build) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveProjectReferences target) ->
/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved

/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj (Build) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveProjectReferences target) ->
/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved

         2 Warning(s)
         0 Error(s)

redpajama_set_name: RedPajamaStackExchange


text:
Q: What is the best method for parsing XML in ASP.NET 3.5/C#? What is the best method for parsing XML in ASP.NET 3.5/C#?

A: See Reading XML documents using LINQ to XML and XML Made Easy with LINQ to XML

A: With Linq to XML, I can do in one line what would have taken 10 in with System.XML. Granted it is a longer line.


text:
Q: Uploading an image from an html form input to database blob column I want to upload data from a html form to a database, here's my html code:
<form method="post" action="events.php" id="formhh" enctype="multipart/form-data">
    <input type="text" name="Titre" required>
    <input type="file" accept="image/jpeg" name="Image" required>
    <textarea name="Description" form="formhh" required></textarea>
    <div>
        <input type="radio" name="style" value="1" required>
        <input type="radio" name="style" value="2" required>
        <input type="radio" name="style" value="3" required>
        <input type="radio" name="style" value="4" required>
        <input type="radio" name="style" value="5" required>
    </div>
    <input type="submit" class="btn btn-outline-primary me-5">
</form>

and the "events.php" that connects and sends data to the database (named "isticg"):
<?php

$conn = new mysqli("localhost", "root", "", "isticg");

$Titre = $_POST['Titre'];
$Img = mysqli_real_escape_string($conn ,file_get_contents($_FILES['Image']['tmp_name']));
$Desc = $_POST['Description'];
$Style = $_POST['style'];

$stmt = $conn->prepare("insert into evenements(Titre, Image, Description,style) values(?,?,?,?)");

$stmt->bind_param("sbsi",$Titre,$Img,$Desc,$Style);

$stmt->execute();

$stmt->close();
$conn->close();

?>

everything works fine except of the image, here's how it looks in phpmyadmin after i do a test
I am a beginner and just started learning php for this project, so please if you could provide an explanation with your answers.

A: Fixed it!
I changed the php code to this:
<?php

$dbh = new PDO("mysql:host=localhost;dbname=isticg", "root", "");

$Titre = $_POST['Titre'];
$Img = file_get_contents($_FILES['Image']['tmp_name']);
$Desc = $_POST['Description'];
$Style = $_POST['style'];

$stmt = $dbh->prepare("insert into evenements values('',?,?,?,?)");

$stmt->bindParam(1,$Titre);
$stmt->bindParam(2,$Img);
$stmt->bindParam(3,$Desc);
$stmt->bindParam(4,$Style);

$stmt->execute();

?>


text:
Q: Azure Site Recovery Planner - Bandwidth check error I am running the Azure Site Recovery planner tool to provide us with some information for our local VMware environment, so we can later setup Azure Site Recovery.
I'm having problems with the Bandwidth checker command which is failing to give me the bandwidth we would require to Azure
Here is the command I run:
ASRDeploymentPlanner.exe -Operation GetThroughput -Directory "C:\AzureSiteRecovery\PlannerTool\ProfileData" -Virtualization VMware -VMListFile "C:\AzureSiteRecovery\PlannerTool\ProfileVMList.txt" -StorageAccountName MyStorage -StorageAccountKey XXXXXXXXXXXX

Here's the error I get:
VMWARE TO AZURE ASR DEPLOYMENT PLANNER

Finding achievable throughput from server 'MyServer' to Azure storage account 'MyStorage'. It might take from few minutes to hours based upon bandwidth availability and number of VMs in the given filename. Please wait...

Creating VHDs
Uploading VHD files to storage account: MyStorage...
Error in uploading files. Failed to calculate achievable throughput.

Possible reasons:

STORAGE_COMMUNICATION_ERROR. Unable to communicate to Azure Storage blob. Check network connectivity to Azure and if bandwidth from on-premises to Azure is very low.
Deleting 'asrvhdfile*' files from storage account...
Successfully deleted files.
Deleting 'asrvhdfile*' files from local machine...
Successfully deleted the files.
Get throughput operation failed.

I can see its placing the VHD files in the Blob storage so there is a connection there.
It seems the same issue as this post:
https://learn.microsoft.com/en-us/answers/questions/529111/storage-communication-error-unable-to-communicate.html
However I have no idea where to enter the code they mentioned in the Azure site recovery planner tool.
I have excluded this vm from any proxies and checked the firewall url and ports required are allowed.
A speed test shows 80MB up and down
Running an AZ speed test PowerShell test shows I'm getting about 24 MS response times from my Azure region
I can upload files to the blob storage manually using Azure Storage Explorer, and see an upload of 80mbps
I have also tested this tool in a hyper v environment (home lab) and have the same error
Has anyone had any experience with this issue or have any suggestions I can try, thanks in advance.


text:
Q: WP7 How do I add Context menu for each Listbox Selected item? ******UPDATE****
I managed to get it to only come up when an Item has been clicked but for where it says "867" how can I bind this to all the filenames in a directory?
this is my XML
 <ListBox toolkit:TiltEffect.IsTiltEnabled="True"  x:Name="ListBox1" FontSize="42.667" FontFamily="Segoe WP SemiLight" IsSynchronizedWithCurrentItem="False">
<ListBox.ItemTemplate>
    <DataTemplate>
        <StackPanel x:Name="sp">
            <toolkit:ContextMenuService.ContextMenu>
                <toolkit:ContextMenu>
                                        <toolkit:MenuItem Header="Delete" Click="Delete_Click" Name="MenuItem1" />
                                        <toolkit:MenuItem Header="Edit" Click="Edit_Click"/>
                                        <toolkit:MenuItem Header="View" Click="View_Click"/>
                                        <toolkit:MenuItem Header="Share.." Click="Share_Click"/>
                                    </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
            <TextBlock Text="867" />
        </StackPanel>
    </DataTemplate>
</ListBox.ItemTemplate>

This is what loads the files into the listbox:
Dim myIsolatedStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()
    myIsolatedStorage.CreateDirectory("myNote")
    Dim directory As String = "./myNote/*.*"
    Dim filenames As String() = myIsolatedStorage.GetFileNames(directory)

    ListBox1.ItemsSource = filenames


text:
Q: What is the better approach to find if a given set is a perfect subset of a set - If given subset is not sorted? What is the best approach to find if a given set(unsorted) is a perfect subset of a main set. I got to do some validation in my program where I got to compare the clients request set with the registered internal capability set.
I thought of doing by having internal capability set sorted(will not change once registered) and do Binary search for each element in the client's request set. Is it the best I could get? I suspected that there might be better approach.
Any idea?
Regards,
Microkernel

A: Assuming that your language of choice doesn't implement a set class with "contains in a set" method already like Java does with HashSet...
A good approach is to use hashmaps (aka hashes aka associative arrays)
If your superset is not too big, generate a hashmap mapping each object in the larger set to a true value.
Then, loop over each element in a subset. Try to find the element in the generated hashmap.
if you fail, your small set is NOT a peoper subset. If you finish the loop without failing, it is.

A: it depends on how many elements are in your sets.
for bigger sets, usually use a Hashset for the mainset turns out best performance.

A: Since you know the internal capability set you can use a perfect hash function to test the elements of the client request set.


text:
Q: ¿Cómo aplicar efecto hover a un poligono (triangulo) y a un icono formado por paths en svg para que muestre texto "Apartado 1" fuera de la imagen?

.apartados{

}
.apartados:hover{
fill:#ffcd00;
}
.apartados:hover + text{
fill-opacity:1;
pointer-events:none;
text-align: center;
}

text{
fill-opacity:0;
font-family:OpenSans-ExtraboldItalic;
 font-size:6.5px;
 text-align: center;
}
<svg version="1.0" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  viewBox="0 0 1366 768" enable-background="new 0 0 1366 768" xml:space="preserve">
<g id="Apartado_5">
 <defs>
  <polygon  id="SVGID_1_" points="219,54 1103,54 661.003,627   "/>
 </defs>
 <clipPath id="SVGID_2_">
  <use xlink:href="#SVGID_1_"  overflow="visible"/>
 </clipPath>
 <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="219" y1="340.5" x2="1103" y2="340.5">
  <stop  offset="0" style="stop-color:#8F9493"/>
  <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
  <stop  offset="1" style="stop-color:#8E9392"/>
 </linearGradient>
 <polygon class="apartados" clip-path="url(#SVGID_2_)" fill="url(#SVGID_3_)" stroke="#FFFFFF" stroke-miterlimit="10" points="219,54 1103,54
  661.003,627  "/>
 <g id="icono_5_1_" clip-path="url(#SVGID_2_)">
  <g>
   <g>
    <g>
     <path fill="#143B74" d="M790.094,147.851L672.824,90.783c-5.12-2.501-10.395-2.724-14.965-1.062v-0.005l-11.16,3.286h8.515
      c-1.638,2.21-2.931,4.848-3.74,7.881l-62.014,230.405c-3.512,13.058,3.056,28.226,14.664,33.878l117.283,57.068
      c1.25,0.605,2.499,1.072,3.74,1.41l-4.628,5.724l9.83-2.772h-0.008c5.767-2.091,10.455-7.171,12.416-14.458l62.014-230.419
      C808.284,168.671,801.716,153.499,790.094,147.851z"/>
     <path fill="#D0E6F6" d="M704.967,428.526l-117.262-57.074c-11.63-5.643-18.198-20.811-14.679-33.864l62.007-230.41
      c3.519-13.057,15.774-19.058,27.389-13.41l117.277,57.074c11.615,5.658,18.183,20.824,14.664,33.877l-61.999,230.405
      C728.851,428.187,716.582,434.182,704.967,428.526z"/>
     <path fill="#FFFFFF" d="M705.172,421.968l-114.513-55.731c-9.029-4.395-14.128-16.186-11.41-26.334l61.668-229.148
      c2.733-10.153,12.269-14.814,21.306-10.424l114.507,55.735c9.028,4.396,14.149,16.187,11.402,26.334l-61.654,229.143
      C723.738,421.697,714.209,426.364,705.172,421.968z"/>
    </g>
    <g>
     <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="588.5148" y1="259.0109" x2="805.7188" y2="259.0109">
      <stop  offset="0" style="stop-color:#5D676B"/>
      <stop  offset="0.4845" style="stop-color:#808B90"/>
      <stop  offset="1" style="stop-color:#5D676B"/>
     </linearGradient>
     <path fill="url(#SVGID_4_)" d="M790.094,147.851L672.824,90.783c-5.12-2.501-10.395-2.724-14.965-1.062v-0.005l-11.16,3.286
      h8.515c-1.638,2.21-2.931,4.848-3.74,7.881l-62.014,230.405c-3.512,13.058,3.056,28.226,14.664,33.878l117.283,57.068
      c1.25,0.605,2.499,1.072,3.74,1.41l-4.628,5.724l9.83-2.772h-0.008c5.767-2.091,10.455-7.171,12.416-14.458l62.014-230.419
      C808.284,168.671,801.716,153.499,790.094,147.851z"/>
     <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="572.0767" y1="261.1499" x2="795.3118" y2="261.1499">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_5_)" d="M704.967,428.526l-117.262-57.074c-11.63-5.643-18.198-20.811-14.679-33.864l62.007-230.41
      c3.519-13.057,15.774-19.058,27.389-13.41l117.277,57.074c11.615,5.658,18.183,20.824,14.664,33.877l-61.999,230.405
      C728.851,428.187,716.582,434.182,704.967,428.526z"/>
     <path fill="#FFFFFF" d="M705.172,421.968l-114.513-55.731c-9.029-4.395-14.128-16.186-11.41-26.334l61.668-229.148
      c2.733-10.153,12.269-14.814,21.306-10.424l114.507,55.735c9.028,4.396,14.149,16.187,11.402,26.334l-61.654,229.143
      C723.738,421.697,714.209,426.364,705.172,421.968z"/>
    </g>
    <g opacity="0.4">
     <path fill="#0A080A" d="M695.673,148.052l-13.062-6.11c-1.198-0.562-1.918-1.972-1.587-3.129l0,0
      c0.323-1.166,1.579-1.652,2.799-1.085l13.056,6.109c1.212,0.572,1.932,1.972,1.602,3.134l0,0
      C698.142,148.142,696.885,148.619,695.673,148.052z"/>
     <path fill="#0A080A" d="M726.801,162.609l-19.255-9.005c-1.219-0.576-1.939-1.976-1.602-3.138l0,0
      c0.33-1.166,1.594-1.647,2.792-1.081l19.263,9.005c1.22,0.572,1.933,1.981,1.594,3.138l0,0
      C729.27,162.69,728.014,163.171,726.801,162.609z"/>
     <path fill="#0A080A" d="M672.898,197.464l-13.056-6.11c-1.204-0.572-1.924-1.981-1.594-3.138l0,0
      c0.323-1.162,1.58-1.647,2.799-1.081l13.056,6.105c1.22,0.571,1.924,1.981,1.594,3.137l0,0
      C675.374,197.545,674.11,198.03,672.898,197.464z"/>
     <path fill="#0A080A" d="M700.654,210.435l-19.263-9.01c-1.22-0.567-1.939-1.971-1.609-3.138l0,0
      c0.345-1.157,1.594-1.637,2.807-1.076l19.256,9.005c1.219,0.567,1.932,1.972,1.608,3.134l0,0
      C703.108,210.521,701.859,211.001,700.654,210.435z"/>
     <path fill="#0A080A" d="M657.14,140.032l-8.163-3.814c-1.205-0.567-1.925-1.967-1.587-3.134l0,0
      c0.338-1.163,1.572-1.648,2.792-1.077l8.162,3.81c1.213,0.572,1.925,1.976,1.594,3.137l0,0
      C659.6,140.118,658.359,140.599,657.14,140.032z"/>
     <path fill="#0A080A" d="M682.302,161.819l-24.942-11.667c-1.213-0.572-1.925-1.976-1.594-3.134l0,0
      c0.33-1.171,1.579-1.643,2.791-1.085l24.943,11.662c1.212,0.567,1.918,1.976,1.587,3.134l0,0
      C684.763,161.895,683.507,162.381,682.302,161.819z"/>
     <path fill="#0A080A" d="M660.482,171.628l-8.163-3.814c-1.197-0.572-1.91-1.966-1.594-3.138l0,0
      c0.339-1.162,1.587-1.642,2.799-1.076l8.155,3.814c1.212,0.567,1.939,1.972,1.609,3.138l0,0
      C662.95,171.714,661.694,172.195,660.482,171.628z"/>
     <path fill="#0A080A" d="M704.849,232.417l-21.791-10.191c-1.213-0.567-1.939-1.971-1.602-3.134l0,0
      c0.33-1.171,1.594-1.652,2.799-1.085l21.797,10.196c1.205,0.572,1.925,1.962,1.602,3.138l0,0
      C707.31,232.502,706.069,232.984,704.849,232.417z"/>
     <path fill="#0A080A" d="M652.533,187.924l-5.246-2.447c-1.212-0.567-1.918-1.967-1.587-3.134l0,0
      c0.33-1.163,1.587-1.648,2.799-1.082l5.238,2.448c1.198,0.572,1.918,1.972,1.594,3.138l0,0
      C655.001,188.015,653.745,188.491,652.533,187.924z"/>
     <path fill="#0A080A" d="M648.764,206.192l-6.502-3.048c-1.219-0.572-1.932-1.967-1.594-3.138l0,0
      c0.331-1.162,1.58-1.643,2.799-1.076l6.501,3.043c1.213,0.567,1.925,1.971,1.587,3.134l0,0
      C651.218,206.268,649.984,206.754,648.764,206.192z"/>
     <path fill="#0A080A" d="M674.073,218.026l-17.154-8.029c-1.22-0.567-1.918-1.966-1.587-3.134l0,0
      c0.323-1.157,1.58-1.642,2.792-1.076l17.147,8.019c1.219,0.576,1.925,1.977,1.602,3.134l0,0
      C676.542,218.107,675.294,218.593,674.073,218.026z"/>
     <path fill="#0A080A" d="M652.077,217.741l-12.328-5.758c-1.219-0.572-1.924-1.986-1.601-3.142l0,0
      c0.33-1.167,1.587-1.648,2.799-1.082l12.321,5.767c1.213,0.572,1.939,1.972,1.609,3.138l0,0
      C654.539,217.822,653.282,218.307,652.077,217.741z"/>
     <path fill="#0A080A" d="M723.554,241.213l-7.92-3.705c-1.219-0.572-1.933-1.971-1.595-3.134l0,0
      c0.323-1.166,1.58-1.652,2.785-1.081l7.935,3.7c1.204,0.567,1.917,1.971,1.587,3.134l0,0
      C726.022,241.294,724.766,241.77,723.554,241.213z"/>
     <path fill="#0A080A" d="M690.854,185.825l-21.805-10.191c-1.205-0.567-1.918-1.967-1.594-3.134l0,0
      c0.33-1.162,1.587-1.648,2.792-1.081l21.805,10.191c1.205,0.572,1.932,1.981,1.594,3.138l0,0
      C693.315,185.91,692.065,186.391,690.854,185.825z"/>
     <path fill="#0A080A" d="M692.83,176.753l-37.983-17.772c-1.219-0.563-1.933-1.972-1.602-3.129l0,0
      c0.338-1.172,1.587-1.658,2.799-1.086l37.983,17.773c1.22,0.572,1.932,1.962,1.602,3.134l0,0
      C695.291,176.838,694.042,177.319,692.83,176.753z"/>
     <path fill="#0A080A" d="M671.605,186.844l-21.797-10.2c-1.213-0.572-1.918-1.967-1.595-3.134l0,0
      c0.331-1.162,1.587-1.647,2.799-1.081l21.798,10.2c1.219,0.562,1.924,1.966,1.587,3.134l0,0
      C674.073,186.925,672.824,187.406,671.605,186.844z"/>
     <path fill="#0A080A" d="M707.384,193.563l-7.927-3.705c-1.213-0.567-1.925-1.972-1.587-3.129l0,0
      c0.331-1.171,1.572-1.653,2.792-1.086l7.927,3.7c1.213,0.572,1.925,1.982,1.587,3.138l0,0
      C709.845,193.648,708.596,194.13,707.384,193.563z"/>
     <path fill="#0A080A" d="M766.511,180.02l-7.913-3.7c-1.22-0.567-1.932-1.972-1.602-3.134l0,0
      c0.338-1.166,1.594-1.647,2.799-1.085l7.927,3.705c1.198,0.572,1.918,1.981,1.587,3.137l0,0
      C768.994,180.106,767.73,180.586,766.511,180.02z"/>
     <path fill="#0A080A" d="M670.981,206.569l-26.206-12.258c-1.22-0.562-1.918-1.966-1.587-3.129l0,0
      c0.33-1.176,1.579-1.657,2.792-1.09l26.206,12.257c1.212,0.567,1.918,1.972,1.594,3.134l0,0
      C673.442,206.654,672.2,207.135,670.981,206.569z"/>
     <path fill="#0A080A" d="M670.76,136.394l-19.263-9c-1.22-0.576-1.925-1.981-1.602-3.134l0,0
      c0.338-1.176,1.594-1.652,2.799-1.09l19.264,9.015c1.212,0.567,1.939,1.962,1.602,3.134l0,0
      C673.222,136.479,671.965,136.965,670.76,136.394z"/>
     <path fill="#0A080A" d="M648.639,226.155l-22.312-10.443c-1.205-0.572-1.925-1.967-1.587-3.138l0,0
      c0.331-1.158,1.58-1.643,2.799-1.077l22.304,10.435c1.213,0.571,1.918,1.971,1.595,3.137l0,0
      C651.1,226.236,649.859,226.717,648.639,226.155z"/>
    </g>
    <g opacity="0.4">
     <path fill="#0A080A" d="M662.025,283.795l-13.07-6.114c-1.205-0.567-1.925-1.972-1.587-3.134l0,0
      c0.323-1.167,1.572-1.653,2.792-1.077l13.063,6.105c1.212,0.567,1.924,1.971,1.594,3.134l0,0
      C664.479,283.876,663.229,284.357,662.025,283.795z"/>
     <path fill="#0A080A" d="M693.138,298.348l-19.263-9.014c-1.213-0.562-1.925-1.967-1.587-3.129l0,0
      c0.331-1.166,1.58-1.653,2.792-1.085l19.264,9.014c1.22,0.562,1.924,1.966,1.594,3.129l0,0
      C695.607,298.434,694.351,298.915,693.138,298.348z"/>
     <path fill="#0A080A" d="M639.243,333.193l-13.063-6.105c-1.204-0.562-1.924-1.972-1.587-3.134l0,0
      c0.323-1.166,1.58-1.648,2.784-1.085l13.062,6.109c1.227,0.572,1.94,1.977,1.602,3.134l0,0
      C641.711,333.278,640.455,333.76,639.243,333.193z"/>
     <path fill="#0A080A" d="M666.984,346.179l-19.256-9.014c-1.22-0.567-1.932-1.972-1.602-3.138l0,0
      c0.338-1.162,1.594-1.652,2.799-1.081l19.263,9.01c1.22,0.567,1.918,1.976,1.594,3.134l0,0
      C669.453,346.26,668.196,346.741,666.984,346.179z"/>
     <path fill="#0A080A" d="M623.483,275.776l-8.162-3.819c-1.205-0.567-1.925-1.971-1.587-3.133l0,0
      c0.316-1.167,1.572-1.648,2.792-1.086l8.155,3.824c1.219,0.567,1.933,1.967,1.594,3.129l0,0
      C625.945,275.861,624.696,276.343,623.483,275.776z"/>
     <path fill="#0A080A" d="M648.639,297.544l-24.942-11.653c-1.205-0.572-1.933-1.977-1.595-3.138l0,0
      c0.331-1.167,1.587-1.653,2.799-1.082l24.935,11.662c1.212,0.567,1.924,1.972,1.594,3.134l0,0
      C651.093,297.63,649.851,298.115,648.639,297.544z"/>
     <path fill="#0A080A" d="M626.833,307.368l-8.177-3.819c-1.212-0.562-1.917-1.967-1.579-3.134l0,0
      c0.316-1.157,1.572-1.647,2.784-1.081l8.163,3.819c1.212,0.562,1.939,1.966,1.601,3.129l0,0
      C629.295,307.454,628.031,307.939,626.833,307.368z"/>
     <path fill="#0A080A" d="M671.187,368.156l-21.791-10.191c-1.219-0.567-1.933-1.981-1.602-3.138l0,0
      c0.338-1.166,1.594-1.647,2.799-1.081l21.805,10.2c1.204,0.562,1.918,1.961,1.58,3.129l0,0
      C673.655,368.237,672.406,368.723,671.187,368.156z"/>
     <path fill="#0A080A" d="M618.877,323.669l-5.238-2.453c-1.219-0.567-1.932-1.966-1.594-3.138l0,0
      c0.331-1.166,1.58-1.642,2.792-1.076l5.246,2.453c1.204,0.557,1.918,1.961,1.572,3.134l0,0
      C621.346,323.754,620.09,324.235,618.877,323.669z"/>
     <path fill="#0A080A" d="M615.101,341.927l-6.502-3.044c-1.212-0.567-1.924-1.971-1.587-3.137l0,0
      c0.33-1.163,1.579-1.643,2.784-1.082l6.516,3.043c1.205,0.567,1.918,1.967,1.58,3.138l0,0
      C617.562,342.013,616.321,342.493,615.101,341.927z"/>
     <path fill="#0A080A" d="M640.425,353.765l-17.162-8.029c-1.22-0.567-1.917-1.962-1.587-3.138l0,0
      c0.323-1.157,1.58-1.642,2.784-1.072l17.155,8.025c1.212,0.567,1.925,1.971,1.602,3.129l0,0
      C642.88,353.846,641.623,354.331,640.425,353.765z"/>
     <path fill="#0A080A" d="M618.422,353.484l-12.342-5.777c-1.205-0.562-1.918-1.966-1.602-3.124l0,0
      c0.338-1.166,1.602-1.652,2.799-1.085l12.336,5.772c1.212,0.562,1.939,1.967,1.602,3.134l0,0
      C620.876,353.565,619.62,354.046,618.422,353.484z"/>
     <path fill="#0A080A" d="M689.899,376.952l-7.927-3.71c-1.22-0.567-1.925-1.967-1.595-3.134l0,0
      c0.331-1.162,1.587-1.642,2.792-1.081l7.927,3.7c1.205,0.572,1.925,1.981,1.602,3.142l0,0
      C692.352,377.033,691.111,377.519,689.899,376.952z"/>
     <path fill="#0A080A" d="M657.191,321.569l-21.798-10.192c-1.212-0.575-1.924-1.976-1.601-3.137l0,0
      c0.33-1.167,1.594-1.653,2.791-1.082l21.813,10.196c1.204,0.562,1.917,1.967,1.594,3.129l0,0
      C659.659,321.654,658.403,322.135,657.191,321.569z"/>
     <path fill="#0A080A" d="M659.174,312.492l-37.998-17.773c-1.212-0.572-1.925-1.971-1.594-3.137l0,0
      c0.338-1.163,1.587-1.643,2.806-1.082l37.983,17.772c1.219,0.567,1.924,1.971,1.601,3.134l0,0
      C661.635,312.573,660.379,313.054,659.174,312.492z"/>
     <path fill="#0A080A" d="M637.942,322.583l-21.797-10.2c-1.213-0.567-1.918-1.967-1.58-3.134l0,0
      c0.316-1.167,1.572-1.653,2.792-1.082l21.797,10.192c1.213,0.572,1.918,1.976,1.595,3.137l0,0
      C640.418,322.669,639.162,323.15,637.942,322.583z"/>
     <path fill="#0A080A" d="M673.728,329.302l-7.934-3.705c-1.205-0.567-1.918-1.966-1.587-3.133l0,0
      c0.338-1.163,1.58-1.648,2.799-1.077l7.913,3.7c1.22,0.567,1.939,1.967,1.608,3.134l0,0
      C676.182,329.388,674.941,329.873,673.728,329.302z"/>
     <path fill="#0A080A" d="M637.31,342.307l-26.191-12.257c-1.219-0.572-1.925-1.972-1.594-3.138l0,0
      c0.33-1.162,1.579-1.642,2.784-1.076l26.213,12.248c1.212,0.572,1.917,1.981,1.602,3.138l0,0
      C639.786,342.388,638.53,342.869,637.31,342.307z"/>
     <path fill="#0A080A" d="M637.105,272.138l-19.27-9.014c-1.22-0.567-1.933-1.967-1.595-3.134l0,0
      c0.331-1.166,1.587-1.648,2.799-1.077l19.256,9.006c1.212,0.567,1.932,1.971,1.609,3.138l0,0
      C639.566,272.219,638.309,272.704,637.105,272.138z"/>
     <path fill="#0A080A" d="M614.984,361.884l-22.32-10.438c-1.205-0.562-1.918-1.966-1.587-3.134l0,0
      c0.323-1.157,1.58-1.642,2.799-1.076l22.304,10.434c1.213,0.567,1.925,1.967,1.602,3.134l0,0
      C617.445,361.965,616.196,362.452,614.984,361.884z"/>
    </g>
    <g>
     <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="576.5303" y1="216.0653" x2="728.6089" y2="216.0653">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_6_)" d="M692.867,167.272c-18.029-10.491-36.763-19.254-55.873-26.135l-37.85-13.634l-12.122,3.829
      c0,0,5.311,2.305,9.742,4.229l-17.97,60.932c0,0-16.935,49.616,41.847,107.899c11.27,0.624,21.137-0.019,29.769-1.557
      c-0.183,0.572-0.308,0.962-0.308,0.962l10.917-3.457c1.014-0.304,2.02-0.614,2.99-0.943l0.227-0.076h-0.014
      c36.565-12.41,44.051-42.273,44.051-42.273l20.336-68.988L692.867,167.272z"/>
     <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="587.0221" y1="160.3566" x2="728.6089" y2="160.3566">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_7_)" d="M636.994,141.137l-37.85-13.634l-12.122,3.829c0,0,5.311,2.305,9.742,4.229l-6.517,22.106
      l67.472,35.544l58.767-1.319l12.123-3.834l-35.742-20.786C674.838,156.781,656.104,148.018,636.994,141.137z"/>
     <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="587.0221" y1="142.4773" x2="667.0354" y2="142.4773">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_8_)" d="M654.832,157.452l12.203-3.781c-9.882-4.69-19.895-8.881-30.041-12.533l-37.85-13.634
      l-12.122,3.829c0,0,5.311,2.305,9.742,4.229l-0.382,1.305C619.979,145.247,654.832,157.452,654.832,157.452z"/>
     <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="634.7019" y1="157.1802" x2="676.285" y2="157.1802">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path display="none" fill="url(#SVGID_9_)" d="M657.426,149.28l-22.724,6.901l19.028,8.899l22.555-6.847
      C670.055,155.056,663.773,152.061,657.426,149.28z"/>
     <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="564.4077" y1="219.8938" x2="716.4862" y2="219.8938">
      <stop  offset="0" style="stop-color:#004D69"/>
      <stop  offset="0.4845" style="stop-color:#096A90"/>
      <stop  offset="1" style="stop-color:#00516E"/>
     </linearGradient>
     <path fill="url(#SVGID_10_)" stroke="#FFFFFF" stroke-miterlimit="10" d="M696.151,260.87l20.336-68.979L680.737,171.1
      c-18.029-10.49-36.771-19.253-55.872-26.135l-37.843-13.633l-20.351,68.98c0,0-16.934,49.63,41.832,107.904
      C683.25,312.388,696.151,260.87,696.151,260.87z"/>
     <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="573.902" y1="221.445" x2="705.7823" y2="221.445">
      <stop  offset="0.0298" style="stop-color:#D6AF3E"/>
      <stop  offset="0.1466" style="stop-color:#D7B03C"/>
      <stop  offset="0.1887" style="stop-color:#D9B335"/>
      <stop  offset="0.2187" style="stop-color:#DEB82A"/>
      <stop  offset="0.2428" style="stop-color:#E4BF19"/>
      <stop  offset="0.2633" style="stop-color:#EDC903"/>
      <stop  offset="0.2658" style="stop-color:#EECA00"/>
      <stop  offset="0.5359" style="stop-color:#B8983E"/>
      <stop  offset="0.8869" style="stop-color:#E5B83B"/>
      <stop  offset="0.9992" style="stop-color:#B48D3D"/>
     </linearGradient>
     <linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="573.402" y1="221.3699" x2="706.3729" y2="221.3699">
      <stop  offset="0.0298" style="stop-color:#D6AF3E"/>
      <stop  offset="0.1466" style="stop-color:#D7B03C"/>
      <stop  offset="0.1887" style="stop-color:#D9B335"/>
      <stop  offset="0.2187" style="stop-color:#DEB82A"/>
      <stop  offset="0.2428" style="stop-color:#E4BF19"/>
      <stop  offset="0.2633" style="stop-color:#EDC903"/>
      <stop  offset="0.2658" style="stop-color:#EECA00"/>
      <stop  offset="0.5359" style="stop-color:#B8983E"/>
      <stop  offset="0.8869" style="stop-color:#E5B83B"/>
      <stop  offset="0.9992" style="stop-color:#B48D3D"/>
     </linearGradient>
     <path fill="url(#SVGID_11_)" stroke="url(#SVGID_12_)" stroke-miterlimit="10" d="M613.242,300.725
      c-26.559-27.325-35.419-52.193-38.144-68.446c-3.049-18.163,0.691-29.845,0.72-29.925l17.772-60.24l27.418,9.882
      c18.485,6.652,36.719,15.181,54.212,25.357l30.563,17.777l-18.874,63.96l-0.066,0.248c-0.029,0.119-3.056,11.296-13.819,21.886
      C659.138,294.881,639.022,301.429,613.242,300.725z"/>
    </g>
    <g>
     <linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="622.3227" y1="173.6688" x2="628.4402" y2="173.6688">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_13_)" d="M622.521,172.329c-0.595,1.477,0.191,3.277,1.771,4.019c1.594,0.738,3.357,0.148,3.952-1.343
      c0.596-1.476-0.213-3.271-1.785-4.019C624.872,170.252,623.109,170.848,622.521,172.329z"/>
     <linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="613.1047" y1="169.3577" x2="619.2191" y2="169.3577">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_14_)" d="M613.308,168.014c-0.61,1.486,0.199,3.277,1.778,4.019c1.587,0.748,3.35,0.143,3.938-1.333
      c0.588-1.48-0.199-3.286-1.778-4.019C615.652,165.938,613.896,166.534,613.308,168.014z"/>
     <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="603.884" y1="165.0452" x2="610.0045" y2="165.0452">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_15_)" d="M604.081,163.709c-0.595,1.481,0.206,3.281,1.785,4.014c1.58,0.743,3.358,0.138,3.946-1.338
      c0.587-1.476-0.214-3.276-1.786-4.019C606.447,161.624,604.669,162.229,604.081,163.709z"/>
    </g>
   </g>
  </g>
 </g>
</g>
</svg>

Lo que busco es que al pasar el cursor el icono (imagen) este desaparezca y aparezca el texto "Apartado 1" sobre la zona gris del triángulo. Intenté hacerlo pero solo conseguí aplicar el efecto hover al triángulo. ¿Puede lograrse mediante JavaScript?

A: Aquí te dejo un ejemplo de cómo se podría hacerse teniendo el texto dentro de la propia imagen SVG:

*

*Añade el texto en un <text>. Lo he colocado al final de todos los elementos para que al quede encima de todo, y además lo he posicionado en el centro de la imagen, aunque puedes ponerlo donde quieras.

*Usando el selector de hermano no adyacente (~) aplico los estilos que ya tenías para que se muestre (le he puesto un tamaño más grande para que se vea).

*Opcional: le he quitado los eventos del ratón al grupo del icono para que no se vaya el texto cuando pases por encima.

Con esos tres cambios, el código queda así:

.apartados {}

.apartados:hover {
  fill: #ffcd00;
}

.apartados:hover ~ text,
.apartados:hover + g {
  fill-opacity: 1;
  pointer-events: none;
}

text {
  fill-opacity: 0;
  font-family: OpenSans-ExtraboldItalic;
  font-size: 65px;
}
<svg version="1.0" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1366 768" enable-background="new 0 0 1366 768" xml:space="preserve">
<g id="Apartado_5">
 <defs>
  <polygon  id="SVGID_1_" points="219,54 1103,54 661.003,627   "/>
 </defs>
 <clipPath id="SVGID_2_">
  <use xlink:href="#SVGID_1_"  overflow="visible"/>
 </clipPath>
 <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="219" y1="340.5" x2="1103" y2="340.5">
  <stop  offset="0" style="stop-color:#8F9493"/>
  <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
  <stop  offset="1" style="stop-color:#8E9392"/>
 </linearGradient>
 <polygon class="apartados" clip-path="url(#SVGID_2_)" fill="url(#SVGID_3_)" stroke="#FFFFFF" stroke-miterlimit="10" points="219,54 1103,54
  661.003,627  "/>

 <g id="icono_5_1_" clip-path="url(#SVGID_2_)">
  <g>
   <g>
    <g>
     <path fill="#143B74" d="M790.094,147.851L672.824,90.783c-5.12-2.501-10.395-2.724-14.965-1.062v-0.005l-11.16,3.286h8.515
      c-1.638,2.21-2.931,4.848-3.74,7.881l-62.014,230.405c-3.512,13.058,3.056,28.226,14.664,33.878l117.283,57.068
      c1.25,0.605,2.499,1.072,3.74,1.41l-4.628,5.724l9.83-2.772h-0.008c5.767-2.091,10.455-7.171,12.416-14.458l62.014-230.419
      C808.284,168.671,801.716,153.499,790.094,147.851z"/>
     <path fill="#D0E6F6" d="M704.967,428.526l-117.262-57.074c-11.63-5.643-18.198-20.811-14.679-33.864l62.007-230.41
      c3.519-13.057,15.774-19.058,27.389-13.41l117.277,57.074c11.615,5.658,18.183,20.824,14.664,33.877l-61.999,230.405
      C728.851,428.187,716.582,434.182,704.967,428.526z"/>
     <path fill="#FFFFFF" d="M705.172,421.968l-114.513-55.731c-9.029-4.395-14.128-16.186-11.41-26.334l61.668-229.148
      c2.733-10.153,12.269-14.814,21.306-10.424l114.507,55.735c9.028,4.396,14.149,16.187,11.402,26.334l-61.654,229.143
      C723.738,421.697,714.209,426.364,705.172,421.968z"/>
    </g>
    <g>
     <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="588.5148" y1="259.0109" x2="805.7188" y2="259.0109">
      <stop  offset="0" style="stop-color:#5D676B"/>
      <stop  offset="0.4845" style="stop-color:#808B90"/>
      <stop  offset="1" style="stop-color:#5D676B"/>
     </linearGradient>
     <path fill="url(#SVGID_4_)" d="M790.094,147.851L672.824,90.783c-5.12-2.501-10.395-2.724-14.965-1.062v-0.005l-11.16,3.286
      h8.515c-1.638,2.21-2.931,4.848-3.74,7.881l-62.014,230.405c-3.512,13.058,3.056,28.226,14.664,33.878l117.283,57.068
      c1.25,0.605,2.499,1.072,3.74,1.41l-4.628,5.724l9.83-2.772h-0.008c5.767-2.091,10.455-7.171,12.416-14.458l62.014-230.419
      C808.284,168.671,801.716,153.499,790.094,147.851z"/>
     <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="572.0767" y1="261.1499" x2="795.3118" y2="261.1499">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_5_)" d="M704.967,428.526l-117.262-57.074c-11.63-5.643-18.198-20.811-14.679-33.864l62.007-230.41
      c3.519-13.057,15.774-19.058,27.389-13.41l117.277,57.074c11.615,5.658,18.183,20.824,14.664,33.877l-61.999,230.405
      C728.851,428.187,716.582,434.182,704.967,428.526z"/>
     <path fill="#FFFFFF" d="M705.172,421.968l-114.513-55.731c-9.029-4.395-14.128-16.186-11.41-26.334l61.668-229.148
      c2.733-10.153,12.269-14.814,21.306-10.424l114.507,55.735c9.028,4.396,14.149,16.187,11.402,26.334l-61.654,229.143
      C723.738,421.697,714.209,426.364,705.172,421.968z"/>
    </g>
    <g opacity="0.4">
     <path fill="#0A080A" d="M695.673,148.052l-13.062-6.11c-1.198-0.562-1.918-1.972-1.587-3.129l0,0
      c0.323-1.166,1.579-1.652,2.799-1.085l13.056,6.109c1.212,0.572,1.932,1.972,1.602,3.134l0,0
      C698.142,148.142,696.885,148.619,695.673,148.052z"/>
     <path fill="#0A080A" d="M726.801,162.609l-19.255-9.005c-1.219-0.576-1.939-1.976-1.602-3.138l0,0
      c0.33-1.166,1.594-1.647,2.792-1.081l19.263,9.005c1.22,0.572,1.933,1.981,1.594,3.138l0,0
      C729.27,162.69,728.014,163.171,726.801,162.609z"/>
     <path fill="#0A080A" d="M672.898,197.464l-13.056-6.11c-1.204-0.572-1.924-1.981-1.594-3.138l0,0
      c0.323-1.162,1.58-1.647,2.799-1.081l13.056,6.105c1.22,0.571,1.924,1.981,1.594,3.137l0,0
      C675.374,197.545,674.11,198.03,672.898,197.464z"/>
     <path fill="#0A080A" d="M700.654,210.435l-19.263-9.01c-1.22-0.567-1.939-1.971-1.609-3.138l0,0
      c0.345-1.157,1.594-1.637,2.807-1.076l19.256,9.005c1.219,0.567,1.932,1.972,1.608,3.134l0,0
      C703.108,210.521,701.859,211.001,700.654,210.435z"/>
     <path fill="#0A080A" d="M657.14,140.032l-8.163-3.814c-1.205-0.567-1.925-1.967-1.587-3.134l0,0
      c0.338-1.163,1.572-1.648,2.792-1.077l8.162,3.81c1.213,0.572,1.925,1.976,1.594,3.137l0,0
      C659.6,140.118,658.359,140.599,657.14,140.032z"/>
     <path fill="#0A080A" d="M682.302,161.819l-24.942-11.667c-1.213-0.572-1.925-1.976-1.594-3.134l0,0
      c0.33-1.171,1.579-1.643,2.791-1.085l24.943,11.662c1.212,0.567,1.918,1.976,1.587,3.134l0,0
      C684.763,161.895,683.507,162.381,682.302,161.819z"/>
     <path fill="#0A080A" d="M660.482,171.628l-8.163-3.814c-1.197-0.572-1.91-1.966-1.594-3.138l0,0
      c0.339-1.162,1.587-1.642,2.799-1.076l8.155,3.814c1.212,0.567,1.939,1.972,1.609,3.138l0,0
      C662.95,171.714,661.694,172.195,660.482,171.628z"/>
     <path fill="#0A080A" d="M704.849,232.417l-21.791-10.191c-1.213-0.567-1.939-1.971-1.602-3.134l0,0
      c0.33-1.171,1.594-1.652,2.799-1.085l21.797,10.196c1.205,0.572,1.925,1.962,1.602,3.138l0,0
      C707.31,232.502,706.069,232.984,704.849,232.417z"/>
     <path fill="#0A080A" d="M652.533,187.924l-5.246-2.447c-1.212-0.567-1.918-1.967-1.587-3.134l0,0
      c0.33-1.163,1.587-1.648,2.799-1.082l5.238,2.448c1.198,0.572,1.918,1.972,1.594,3.138l0,0
      C655.001,188.015,653.745,188.491,652.533,187.924z"/>
     <path fill="#0A080A" d="M648.764,206.192l-6.502-3.048c-1.219-0.572-1.932-1.967-1.594-3.138l0,0
      c0.331-1.162,1.58-1.643,2.799-1.076l6.501,3.043c1.213,0.567,1.925,1.971,1.587,3.134l0,0
      C651.218,206.268,649.984,206.754,648.764,206.192z"/>
     <path fill="#0A080A" d="M674.073,218.026l-17.154-8.029c-1.22-0.567-1.918-1.966-1.587-3.134l0,0
      c0.323-1.157,1.58-1.642,2.792-1.076l17.147,8.019c1.219,0.576,1.925,1.977,1.602,3.134l0,0
      C676.542,218.107,675.294,218.593,674.073,218.026z"/>
     <path fill="#0A080A" d="M652.077,217.741l-12.328-5.758c-1.219-0.572-1.924-1.986-1.601-3.142l0,0
      c0.33-1.167,1.587-1.648,2.799-1.082l12.321,5.767c1.213,0.572,1.939,1.972,1.609,3.138l0,0
      C654.539,217.822,653.282,218.307,652.077,217.741z"/>
     <path fill="#0A080A" d="M723.554,241.213l-7.92-3.705c-1.219-0.572-1.933-1.971-1.595-3.134l0,0
      c0.323-1.166,1.58-1.652,2.785-1.081l7.935,3.7c1.204,0.567,1.917,1.971,1.587,3.134l0,0
      C726.022,241.294,724.766,241.77,723.554,241.213z"/>
     <path fill="#0A080A" d="M690.854,185.825l-21.805-10.191c-1.205-0.567-1.918-1.967-1.594-3.134l0,0
      c0.33-1.162,1.587-1.648,2.792-1.081l21.805,10.191c1.205,0.572,1.932,1.981,1.594,3.138l0,0
      C693.315,185.91,692.065,186.391,690.854,185.825z"/>
     <path fill="#0A080A" d="M692.83,176.753l-37.983-17.772c-1.219-0.563-1.933-1.972-1.602-3.129l0,0
      c0.338-1.172,1.587-1.658,2.799-1.086l37.983,17.773c1.22,0.572,1.932,1.962,1.602,3.134l0,0
      C695.291,176.838,694.042,177.319,692.83,176.753z"/>
     <path fill="#0A080A" d="M671.605,186.844l-21.797-10.2c-1.213-0.572-1.918-1.967-1.595-3.134l0,0
      c0.331-1.162,1.587-1.647,2.799-1.081l21.798,10.2c1.219,0.562,1.924,1.966,1.587,3.134l0,0
      C674.073,186.925,672.824,187.406,671.605,186.844z"/>
     <path fill="#0A080A" d="M707.384,193.563l-7.927-3.705c-1.213-0.567-1.925-1.972-1.587-3.129l0,0
      c0.331-1.171,1.572-1.653,2.792-1.086l7.927,3.7c1.213,0.572,1.925,1.982,1.587,3.138l0,0
      C709.845,193.648,708.596,194.13,707.384,193.563z"/>
     <path fill="#0A080A" d="M766.511,180.02l-7.913-3.7c-1.22-0.567-1.932-1.972-1.602-3.134l0,0
      c0.338-1.166,1.594-1.647,2.799-1.085l7.927,3.705c1.198,0.572,1.918,1.981,1.587,3.137l0,0
      C768.994,180.106,767.73,180.586,766.511,180.02z"/>
     <path fill="#0A080A" d="M670.981,206.569l-26.206-12.258c-1.22-0.562-1.918-1.966-1.587-3.129l0,0
      c0.33-1.176,1.579-1.657,2.792-1.09l26.206,12.257c1.212,0.567,1.918,1.972,1.594,3.134l0,0
      C673.442,206.654,672.2,207.135,670.981,206.569z"/>
     <path fill="#0A080A" d="M670.76,136.394l-19.263-9c-1.22-0.576-1.925-1.981-1.602-3.134l0,0
      c0.338-1.176,1.594-1.652,2.799-1.09l19.264,9.015c1.212,0.567,1.939,1.962,1.602,3.134l0,0
      C673.222,136.479,671.965,136.965,670.76,136.394z"/>
     <path fill="#0A080A" d="M648.639,226.155l-22.312-10.443c-1.205-0.572-1.925-1.967-1.587-3.138l0,0
      c0.331-1.158,1.58-1.643,2.799-1.077l22.304,10.435c1.213,0.571,1.918,1.971,1.595,3.137l0,0
      C651.1,226.236,649.859,226.717,648.639,226.155z"/>
    </g>
    <g opacity="0.4">
     <path fill="#0A080A" d="M662.025,283.795l-13.07-6.114c-1.205-0.567-1.925-1.972-1.587-3.134l0,0
      c0.323-1.167,1.572-1.653,2.792-1.077l13.063,6.105c1.212,0.567,1.924,1.971,1.594,3.134l0,0
      C664.479,283.876,663.229,284.357,662.025,283.795z"/>
     <path fill="#0A080A" d="M693.138,298.348l-19.263-9.014c-1.213-0.562-1.925-1.967-1.587-3.129l0,0
      c0.331-1.166,1.58-1.653,2.792-1.085l19.264,9.014c1.22,0.562,1.924,1.966,1.594,3.129l0,0
      C695.607,298.434,694.351,298.915,693.138,298.348z"/>
     <path fill="#0A080A" d="M639.243,333.193l-13.063-6.105c-1.204-0.562-1.924-1.972-1.587-3.134l0,0
      c0.323-1.166,1.58-1.648,2.784-1.085l13.062,6.109c1.227,0.572,1.94,1.977,1.602,3.134l0,0
      C641.711,333.278,640.455,333.76,639.243,333.193z"/>
     <path fill="#0A080A" d="M666.984,346.179l-19.256-9.014c-1.22-0.567-1.932-1.972-1.602-3.138l0,0
      c0.338-1.162,1.594-1.652,2.799-1.081l19.263,9.01c1.22,0.567,1.918,1.976,1.594,3.134l0,0
      C669.453,346.26,668.196,346.741,666.984,346.179z"/>
     <path fill="#0A080A" d="M623.483,275.776l-8.162-3.819c-1.205-0.567-1.925-1.971-1.587-3.133l0,0
      c0.316-1.167,1.572-1.648,2.792-1.086l8.155,3.824c1.219,0.567,1.933,1.967,1.594,3.129l0,0
      C625.945,275.861,624.696,276.343,623.483,275.776z"/>
     <path fill="#0A080A" d="M648.639,297.544l-24.942-11.653c-1.205-0.572-1.933-1.977-1.595-3.138l0,0
      c0.331-1.167,1.587-1.653,2.799-1.082l24.935,11.662c1.212,0.567,1.924,1.972,1.594,3.134l0,0
      C651.093,297.63,649.851,298.115,648.639,297.544z"/>
     <path fill="#0A080A" d="M626.833,307.368l-8.177-3.819c-1.212-0.562-1.917-1.967-1.579-3.134l0,0
      c0.316-1.157,1.572-1.647,2.784-1.081l8.163,3.819c1.212,0.562,1.939,1.966,1.601,3.129l0,0
      C629.295,307.454,628.031,307.939,626.833,307.368z"/>
     <path fill="#0A080A" d="M671.187,368.156l-21.791-10.191c-1.219-0.567-1.933-1.981-1.602-3.138l0,0
      c0.338-1.166,1.594-1.647,2.799-1.081l21.805,10.2c1.204,0.562,1.918,1.961,1.58,3.129l0,0
      C673.655,368.237,672.406,368.723,671.187,368.156z"/>
     <path fill="#0A080A" d="M618.877,323.669l-5.238-2.453c-1.219-0.567-1.932-1.966-1.594-3.138l0,0
      c0.331-1.166,1.58-1.642,2.792-1.076l5.246,2.453c1.204,0.557,1.918,1.961,1.572,3.134l0,0
      C621.346,323.754,620.09,324.235,618.877,323.669z"/>
     <path fill="#0A080A" d="M615.101,341.927l-6.502-3.044c-1.212-0.567-1.924-1.971-1.587-3.137l0,0
      c0.33-1.163,1.579-1.643,2.784-1.082l6.516,3.043c1.205,0.567,1.918,1.967,1.58,3.138l0,0
      C617.562,342.013,616.321,342.493,615.101,341.927z"/>
     <path fill="#0A080A" d="M640.425,353.765l-17.162-8.029c-1.22-0.567-1.917-1.962-1.587-3.138l0,0
      c0.323-1.157,1.58-1.642,2.784-1.072l17.155,8.025c1.212,0.567,1.925,1.971,1.602,3.129l0,0
      C642.88,353.846,641.623,354.331,640.425,353.765z"/>
     <path fill="#0A080A" d="M618.422,353.484l-12.342-5.777c-1.205-0.562-1.918-1.966-1.602-3.124l0,0
      c0.338-1.166,1.602-1.652,2.799-1.085l12.336,5.772c1.212,0.562,1.939,1.967,1.602,3.134l0,0
      C620.876,353.565,619.62,354.046,618.422,353.484z"/>
     <path fill="#0A080A" d="M689.899,376.952l-7.927-3.71c-1.22-0.567-1.925-1.967-1.595-3.134l0,0
      c0.331-1.162,1.587-1.642,2.792-1.081l7.927,3.7c1.205,0.572,1.925,1.981,1.602,3.142l0,0
      C692.352,377.033,691.111,377.519,689.899,376.952z"/>
     <path fill="#0A080A" d="M657.191,321.569l-21.798-10.192c-1.212-0.575-1.924-1.976-1.601-3.137l0,0
      c0.33-1.167,1.594-1.653,2.791-1.082l21.813,10.196c1.204,0.562,1.917,1.967,1.594,3.129l0,0
      C659.659,321.654,658.403,322.135,657.191,321.569z"/>
     <path fill="#0A080A" d="M659.174,312.492l-37.998-17.773c-1.212-0.572-1.925-1.971-1.594-3.137l0,0
      c0.338-1.163,1.587-1.643,2.806-1.082l37.983,17.772c1.219,0.567,1.924,1.971,1.601,3.134l0,0
      C661.635,312.573,660.379,313.054,659.174,312.492z"/>
     <path fill="#0A080A" d="M637.942,322.583l-21.797-10.2c-1.213-0.567-1.918-1.967-1.58-3.134l0,0
      c0.316-1.167,1.572-1.653,2.792-1.082l21.797,10.192c1.213,0.572,1.918,1.976,1.595,3.137l0,0
      C640.418,322.669,639.162,323.15,637.942,322.583z"/>
     <path fill="#0A080A" d="M673.728,329.302l-7.934-3.705c-1.205-0.567-1.918-1.966-1.587-3.133l0,0
      c0.338-1.163,1.58-1.648,2.799-1.077l7.913,3.7c1.22,0.567,1.939,1.967,1.608,3.134l0,0
      C676.182,329.388,674.941,329.873,673.728,329.302z"/>
     <path fill="#0A080A" d="M637.31,342.307l-26.191-12.257c-1.219-0.572-1.925-1.972-1.594-3.138l0,0
      c0.33-1.162,1.579-1.642,2.784-1.076l26.213,12.248c1.212,0.572,1.917,1.981,1.602,3.138l0,0
      C639.786,342.388,638.53,342.869,637.31,342.307z"/>
     <path fill="#0A080A" d="M637.105,272.138l-19.27-9.014c-1.22-0.567-1.933-1.967-1.595-3.134l0,0
      c0.331-1.166,1.587-1.648,2.799-1.077l19.256,9.006c1.212,0.567,1.932,1.971,1.609,3.138l0,0
      C639.566,272.219,638.309,272.704,637.105,272.138z"/>
     <path fill="#0A080A" d="M614.984,361.884l-22.32-10.438c-1.205-0.562-1.918-1.966-1.587-3.134l0,0
      c0.323-1.157,1.58-1.642,2.799-1.076l22.304,10.434c1.213,0.567,1.925,1.967,1.602,3.134l0,0
      C617.445,361.965,616.196,362.452,614.984,361.884z"/>
    </g>
    <g>
     <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="576.5303" y1="216.0653" x2="728.6089" y2="216.0653">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_6_)" d="M692.867,167.272c-18.029-10.491-36.763-19.254-55.873-26.135l-37.85-13.634l-12.122,3.829
      c0,0,5.311,2.305,9.742,4.229l-17.97,60.932c0,0-16.935,49.616,41.847,107.899c11.27,0.624,21.137-0.019,29.769-1.557
      c-0.183,0.572-0.308,0.962-0.308,0.962l10.917-3.457c1.014-0.304,2.02-0.614,2.99-0.943l0.227-0.076h-0.014
      c36.565-12.41,44.051-42.273,44.051-42.273l20.336-68.988L692.867,167.272z"/>
     <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="587.0221" y1="160.3566" x2="728.6089" y2="160.3566">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_7_)" d="M636.994,141.137l-37.85-13.634l-12.122,3.829c0,0,5.311,2.305,9.742,4.229l-6.517,22.106
      l67.472,35.544l58.767-1.319l12.123-3.834l-35.742-20.786C674.838,156.781,656.104,148.018,636.994,141.137z"/>
     <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="587.0221" y1="142.4773" x2="667.0354" y2="142.4773">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path fill="url(#SVGID_8_)" d="M654.832,157.452l12.203-3.781c-9.882-4.69-19.895-8.881-30.041-12.533l-37.85-13.634
      l-12.122,3.829c0,0,5.311,2.305,9.742,4.229l-0.382,1.305C619.979,145.247,654.832,157.452,654.832,157.452z"/>
     <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="634.7019" y1="157.1802" x2="676.285" y2="157.1802">
      <stop  offset="0" style="stop-color:#8F9493"/>
      <stop  offset="0.4845" style="stop-color:#C3CCCB"/>
      <stop  offset="1" style="stop-color:#8E9392"/>
     </linearGradient>
     <path display="none" fill="url(#SVGID_9_)" d="M657.426,149.28l-22.724,6.901l19.028,8.899l22.555-6.847
      C670.055,155.056,663.773,152.061,657.426,149.28z"/>
     <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="564.4077" y1="219.8938" x2="716.4862" y2="219.8938">
      <stop  offset="0" style="stop-color:#004D69"/>
      <stop  offset="0.4845" style="stop-color:#096A90"/>
      <stop  offset="1" style="stop-color:#00516E"/>
     </linearGradient>
     <path fill="url(#SVGID_10_)" stroke="#FFFFFF" stroke-miterlimit="10" d="M696.151,260.87l20.336-68.979L680.737,171.1
      c-18.029-10.49-36.771-19.253-55.872-26.135l-37.843-13.633l-20.351,68.98c0,0-16.934,49.63,41.832,107.904
      C683.25,312.388,696.151,260.87,696.151,260.87z"/>
     <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="573.902" y1="221.445" x2="705.7823" y2="221.445">
      <stop  offset="0.0298" style="stop-color:#D6AF3E"/>
      <stop  offset="0.1466" style="stop-color:#D7B03C"/>
      <stop  offset="0.1887" style="stop-color:#D9B335"/>
      <stop  offset="0.2187" style="stop-color:#DEB82A"/>
      <stop  offset="0.2428" style="stop-color:#E4BF19"/>
      <stop  offset="0.2633" style="stop-color:#EDC903"/>
      <stop  offset="0.2658" style="stop-color:#EECA00"/>
      <stop  offset="0.5359" style="stop-color:#B8983E"/>
      <stop  offset="0.8869" style="stop-color:#E5B83B"/>
      <stop  offset="0.9992" style="stop-color:#B48D3D"/>
     </linearGradient>
     <linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="573.402" y1="221.3699" x2="706.3729" y2="221.3699">
      <stop  offset="0.0298" style="stop-color:#D6AF3E"/>
      <stop  offset="0.1466" style="stop-color:#D7B03C"/>
      <stop  offset="0.1887" style="stop-color:#D9B335"/>
      <stop  offset="0.2187" style="stop-color:#DEB82A"/>
      <stop  offset="0.2428" style="stop-color:#E4BF19"/>
      <stop  offset="0.2633" style="stop-color:#EDC903"/>
      <stop  offset="0.2658" style="stop-color:#EECA00"/>
      <stop  offset="0.5359" style="stop-color:#B8983E"/>
      <stop  offset="0.8869" style="stop-color:#E5B83B"/>
      <stop  offset="0.9992" style="stop-color:#B48D3D"/>
     </linearGradient>
     <path fill="url(#SVGID_11_)" stroke="url(#SVGID_12_)" stroke-miterlimit="10" d="M613.242,300.725
      c-26.559-27.325-35.419-52.193-38.144-68.446c-3.049-18.163,0.691-29.845,0.72-29.925l17.772-60.24l27.418,9.882
      c18.485,6.652,36.719,15.181,54.212,25.357l30.563,17.777l-18.874,63.96l-0.066,0.248c-0.029,0.119-3.056,11.296-13.819,21.886
      C659.138,294.881,639.022,301.429,613.242,300.725z"/>
    </g>
    <g>
     <linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="622.3227" y1="173.6688" x2="628.4402" y2="173.6688">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_13_)" d="M622.521,172.329c-0.595,1.477,0.191,3.277,1.771,4.019c1.594,0.738,3.357,0.148,3.952-1.343
      c0.596-1.476-0.213-3.271-1.785-4.019C624.872,170.252,623.109,170.848,622.521,172.329z"/>
     <linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="613.1047" y1="169.3577" x2="619.2191" y2="169.3577">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_14_)" d="M613.308,168.014c-0.61,1.486,0.199,3.277,1.778,4.019c1.587,0.748,3.35,0.143,3.938-1.333
      c0.588-1.48-0.199-3.286-1.778-4.019C615.652,165.938,613.896,166.534,613.308,168.014z"/>
     <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="603.884" y1="165.0452" x2="610.0045" y2="165.0452">
      <stop  offset="0" style="stop-color:#5B1516"/>
      <stop  offset="0.0084" style="stop-color:#611617"/>
      <stop  offset="0.0602" style="stop-color:#831D1C"/>
      <stop  offset="0.1131" style="stop-color:#9E2321"/>
      <stop  offset="0.1669" style="stop-color:#B12724"/>
      <stop  offset="0.2221" style="stop-color:#BC2925"/>
      <stop  offset="0.2809" style="stop-color:#C02A26"/>
      <stop  offset="0.8213" style="stop-color:#A02D2E"/>
      <stop  offset="1" style="stop-color:#C24535"/>
     </linearGradient>
     <path fill="url(#SVGID_15_)" d="M604.081,163.709c-0.595,1.481,0.206,3.281,1.785,4.014c1.58,0.743,3.358,0.138,3.946-1.338
      c0.587-1.476-0.214-3.276-1.786-4.019C606.447,161.624,604.669,162.229,604.081,163.709z"/>
    </g>
   </g>
  </g>
 </g>
  <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle">Apartado 1</text>
</g>
</svg>


text:
Q: How to get all urls from google search (first page only) then get the index of a specified url from that list, using C# Selenium? Hey guys using Selenium in C# with NUnit testing and chrome, how would I get all the the main urls (web urls) in a list from the first page of a google search, then get the index number of a specified URL from that list?

A: I'm not sure exactly how you know what url you want to search, but here it is. I've added a dictionary method just in case you want to store the index and the url for later usage.
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Selenium
{
    public class Tests
    {
        public IWebDriver driver;

        [SetUp]
        public void Setup()
        {
            driver = new ChromeDriver(".");
        }

        [Test]
        public void TestUrlsIndex()
        {
            driver.Navigate().GoToUrl("https://google.com");

            //accept privacy
            driver.FindElement(By.XPath("//div[text()='I agree']")).Click();

            //type something and press Enter
            driver.FindElement(By.Name("q")).SendKeys("Retrieve Index" + Keys.Enter);

            //get all a elements
            var a_webElements = driver.FindElements(By.XPath("//div[@class='g']/div/div/a"));

            //print the index for all
            for (int i = 0; i < a_webElements.Count; i++)
            {
                Console.WriteLine($"The index is {i} for the url {a_webElements[i].GetAttribute("href")}");
            }

            //when you know the url and want to return its index
            var index = ReturnIndexOfAnUrl(a_webElements, "https://stackoverflow.com/questions/41217310/get-index-of-a-row-of-a-pandas-dataframe-as-an-integer");

        }

        //when you want to search the url and return its index
        public int ReturnIndexOfAnUrl(IList<IWebElement> webElements, string searchHref)
        {
            return webElements.ToList().FindIndex(x => x.GetAttribute("href").Equals(searchHref));

        }

        //when you want to store the index and its corresponding url
        public Dictionary<int, string> ReturnIndexAsIndexAndUrlAsValue(IList<IWebElement> webElements)
        {
            var dictionary = new Dictionary<int, string>();

            for (int i = 0; i < webElements.Count; i++)
            {
                dictionary.Add(i, webElements[i].GetAttribute("href"));
            }

            return dictionary;
        }

        [TearDown]
        public void TearDown()
        {
            driver.Close();
        }

    }
}

You should see something like
The index is 0 for the url https://stackoverflow.com/questions/41217310/get-index-of-a-row-of-a-pandas-dataframe-as-an-integer
The index is 1 for the url https://www.geeksforgeeks.org/how-to-get-rows-index-names-in-pandas-dataframe/
The index is 2 for the url https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html
The index is 3 for the url https://thispointer.com/python-find-indexes-of-an-element-in-pandas-dataframe/
The index is 4 for the url https://www.geeksforgeeks.org/how-to-get-rows-index-names-in-pandas-dataframe/
The index is 5 for the url https://www.geeksforgeeks.org/python-list-index/
The index is 6 for the url https://stackoverflow.com/questions/17426521/list-all-indexes-on-elasticsearch-server
The index is 7 for the url https://github.com/MikkelSchubert/paleomix/issues/36
The index is 8 for the url https://www.programiz.com/python-programming/methods/list/index
The index is 9 for the url https://www.sqlshack.com/gathering-sql-server-indexes-statistics-and-usage-information/
The index is 10 for the url https://dba.stackexchange.com/questions/141293/query-to-retrieve-index-details-for-a-particular-column-in-all-tables
The index is 11 for the url https://en.wikipedia.org/wiki/Database_index
The index is 12 for the url http://www.bcsea.bt/indexnumber
The index is 13 for the url https://aip.scitation.org/doi/10.1063/1.4752753


text:
Q: How can I remove a CSS class based on condition Hi I am writing a react code for a button. Here is the code:
    <Button
    block={true}
    className={`sc-pc-action-button ${className}`.trim()}
    disabled={disabled}
    onClick={onClick}
  > Click me
      </Button>

There is a condition in which I dont need this sc-pc-action-button css.
Now this class sc-pc-action-button is hardcoded.
How can I write a CSS which tells me to ignore the contents of sc-pc-action-button and take fresh CSS I am giving.
I need a CSS solution to remove the properties. I don't need JS Solution

A:
<Button
  block={true}
  className={`${someCondition ? "sc-pc-action-button" : ""} ${className}`.trim()}
  disabled={disabled}
  onClick={onClick}
> Click me
</Button>


text:
Q: SQL Search a Numeric Field for non whole numbers I have a DB that has a numeric field and I need to search  all the rows and return only the non whole numbers.
I have tried the query below and it keeps retuning records that have 0.
SELECT
 li.QTY
FROM
  TABLE LI
WHERE
  li.QTY  like '%.%'

A: Why it does not work.  When QTY is a numeric column, when you display it, or implicitly convert to varchar (LIKE does it implicitly), ALL numbers will be cast to the same number of decimal places.
Consider this SQL statement
with TBL(qty) as (select 1.1 union all select 3)
SELECT li.QTY FROM TBL LI WHERE li.QTY like '%.%'

Output
1.1
3.0   << this contains "." even if it does not need to

Cast it to a bigint and it will drop any decimals, then compare it again.
SELECT li.QTY FROM TBL LI
WHERE li.QTY <> CAST(qty as bigint)

If you MUST use LIKE (or just for show..)

SELECT li.QTY, CONVERT(varchar, li.qty)
FROM TBL LI
WHERE li.QTY LIKE '%.%[^0]%'

A: You can use LIKE only with char fields, not with number (integer or float) ones.
If by "whole numbers" you mean 0.0 , 2.0 , -5.0 , etc. and not 12.5 , 0.67 then this can do:
SELECT li.QTY
  FROM TABLE LI
  WHERE li.QTY != ROUND(li.QTY , 0)
;

(for SQL-Server: edited the TRUNC into ROUND)
You could also use the FLOOR or CEILING functions:
SELECT li.QTY
  FROM TABLE LI
  WHERE li.QTY != FLOOR(li.QTY)
;

A: --Most Def...Cast as an int...Save you from validation of anything. Especially for conversions of dates into a whole date since Microsoft does not like a round down date function.

--For example:

--For every 300 hours an employee works they receive 1 whole day of vacation

--partial days of vacation will not be counted

Declare

@SumHours as decimal(38,10),

@VacationValidation as int

Set @SumHours = 3121.30000000000000000000
Set @VacationValidation = 300

Select cast(((@SumHours)/(@VacationValidation)) as int)
Select day(((@SumHours)/(@VacationValidation))) -1

--without casting as an int, I would need to validated the Day function to make sure that I'm not

--offsetting a whole day by one day.

A: CAST function work for me.
SELECT li.QTY FROM TABLE LI WHERE li.QTY != CAST(li.QTY AS  INTEGER)

A: DECLARE @Value AS float
SET @Value = 250.00
CASE WHEN CHARINDEX('.',(CAST(b.Value/@Value as char))) = 0 THEN 'WholeNumber' ELSE 'Fraction' END AS mResult


text:
Q: Google form edit link Collision Resolution So over the past couple of weeks I've been working on trying to create a way of using google forms as a kind of editable pdf.  The idea is to have it be used as a group work order wherein the various people involved fill out the information pertaining to them as they acquire it.  Now I know this isn't exactly what forms are designed to do, but it seems to mostly be working.
The way I have it right now is that the initial user creates the initial response, which triggers a script on the form submission, that sends out an editable link via email to all of the contributors to the form.   Then whenever a contributor has information to add, they merely have to follow the link, make the change, submit the form and another email gets sent off alerting everyone of the edit.
The only problem with the system, however, comes when two users are filling out the edit link at the same time.  At that point the collision resolution (or potentially a lack of collision resolution) for the edit link appears to kick in.  The first user will submit and the form gets updated correctly, but once the second user submits, their changes override the changes of the first user.  Looking at this from a user standpoint this would be highly confusing.  Their change would appear to have been registered correctly, but in reality have been overwritten and discarded.
Now the ideal solution would be that the only changes that are overridden by the second user are those that actually have values in them.  I.e. if user one answers question A, and user two answers question B, and both answer question C, only question C is actually overridden, instead of A and C.
I initially thought that perhaps I could compare the two form responses and find some way of doing the collision detection on my own, but there seems to be no way to edit the actual form responses, to change the data on the edit link to match.  (Changing the spreadsheet values does not actually have any impact on the edit link itself)
So my question really boils down to is there a way to get this collision detection to work the way I am intending it to?  And if there isn't any way to do that, what would be the best way to trigger off a warning email when a collision does happen so that the users would at least know that something went wrong?


text:
Q: In sybase 12.5, can I have some SQL to get the Nth to Mth row? In sybase 12.5 (ASE, not Sql Anywhere),
can I use some (ANSI) SQL to get the Nth to Mth row ?
Otherwise, a pointer to a non-ANSI way will help, I can't find it !

A: One possible solution:
select rownum=identity(10), t.* into #temp from tablename t

select * from #temp where rownum between 5 and 10

drop table #temp

Replace 5 and 10 by the Nth and Mth values.


text:
Q: How do i give a Wordpress editor access to the Site Kit by Google plugin? In WordPress I give some users a certain role (admin, editor etc). These users have by default not access to the Site Kit by Google plugin. Do you know an option how I can turn this on?
Maybe a code in functions.php? and I don't want to add a new plugin like user roles.

A: edit permissions.php  , plugins->google-site-kit->inlucdes->core->permissions->permissions.php
$this->primitive_to_core = array(
            // By default, only allow administrators to authenticate.
             //self::AUTHENTICATE        => 'manage_options',
            self::AUTHENTICATE        => 'edit_others_posts',

            // Allow contributors and up to view their own post's insights.
            self::VIEW_POSTS_INSIGHTS => 'edit_posts',

            // Allow editors and up to view the dashboard and module details.
            self::VIEW_DASHBOARD      => 'edit_others_posts',
            self::VIEW_MODULE_DETAILS => 'edit_others_posts',

            // Allow administrators and up to manage options and set up the plugin.
            //self::MANAGE_OPTIONS      => 'manage_options',
            //self::SETUP               => 'manage_options',
            self::MANAGE_OPTIONS      => 'edit_others_posts',
            self::SETUP               => 'edit_others_posts',

            // Allow to differentiate between authors and contributors.
            self::PUBLISH_POSTS       => 'publish_posts',
        );


text:
Q: Test if Excel has finished its startup / shutdown sequence I'm using PowerShell to automate some excel tasks via COM, via a PowerShell script like so:
$xl = new-object -ComObject Excel.Application
sleep 5
DO THINGS...
$xl.quit()
sleep 5
$null = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl)
[GC]::collect()

My issue is that if I omit the first call to sleep, Excel won't be ready to perform tasks that require add-ins, and the call to $xl.quit() doesn't work, and the process fails to quit, as evidenced by:
PS > Get-Process EXCEL

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    784     104   104008     109380   944     3.21   5996 EXCEL

Likewise, if I omit the second call to sleep, excel doesn't have time to complete shutting down, and eventually this results in a dialog box stating "Microsoft Excel has stopped working..." and the next time Excel starts up, another dialog box states "Microsoft Excel failed to shut down properly, Start in safe mode?"
function XLtest {
    $xl = new-object -ComObject Excel.Application
    $xl.quit()
    $null = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl)
    [GC]::collect()
}

for($i=0;$i -lt 10; $i++){ XLtest } # generates multiple errors

Obviously these are problems that I want to avoid, but the heuristic solution of calling sleep 5 could still fail on ocasion. Is there any way to detect when excel has completed it's start-up sequence and is ready to issue commands (xl.quit() in particular) and when the shut-down sequence is complete (i.e. when it's ok to call [System....Marshal]::ReleaseComObject($xl)?

A: While your exact environment and situation is impossible to reproduce without an add-in like the DO THINGS... one mentioned, there are members of the Excel Application object that should be able to be exploited to gain some sense of the application state.
One that seems a likely candidate is the _Application.CalculationState property. If a full recalculation was forced then a Do While...: DoEvents: Loop was processed, a pseudo-timer could be pausing the powershell script while the Application.CalculationState was not xlDone much the same as an Internet.Explorer object is waited upon until it finishes receiving its web page.
$xl = new-object -ComObject Excel.Application
$xl.Calculate
do while $xl.CalculationState <> xlDone: $xl.DoEvents: Loop
$xl.quit()
... (do more things?)

A recalulation can also be forced with the _Application.CalculateBeforeSave property if you are saving before closing (and subsequently exiting).
Another good candidate is the simpler _Application.Ready property.
$xl = new-object -ComObject Excel.Application
do while not $xl.ready: $xl.DoEvents: Loop
$xl.quit()

See Application Members (Excel) for a full list of potential properties where a 'state' can be determined. More information at Developer's Guide to the Excel 2010 Application Object.


text:
Q: Cannot find KRE package kre-clr-win-x86.1.0.0-beta3, Visual Studio 2015 CTP 6 I installed Visual Studio 2015 CTP 6, I create a ASP.NET MVC 6 project and i receive following error at build:
1>------ Build started: Project: Test, Configuration: Debug Any CPU ------
1>  Cannot find KRE package kre-clr-win-x86.1.0.0-beta3 in the folder: C:\Users\cornel.adavidoaiei\.k\runtimes
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AspNet\Microsoft.Web.AspNet.targets(111,5): error : The ProjectK Runtime package needs to be installed. See output window for more details.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

I am looking in "C:\Users\cornel.adavidoaiei.k\runtimes\kre-clr-win-x86.1.0.0-beta3" and it isn't any bin here but i have bin in "C:\Users\cornel.adavidoaiei.k\runtimes\kre-clr-win-x64.1.0.0-beta3", why doesn't use x64 version which is installed and try to use x86 version of kre which is missing, any idea how could to solve this issue ?


text:
Q: using IRootState type in useSelector I use IRootState type for useSelector in redux-toolkit (typeScript) like this :
    const usersPage = useSelector<IRootState, number>((state) => state.users.page)

I saw this code in this  link  in stackoverflow !
But now my question is from where I can import this type !?
or more ! I have to make this or import this ?

A: You have to define that type yourself, see here in the docs: https://redux-toolkit.js.org/usage/usage-with-typescript#getting-the-state-type


text:
Q: Javascript onClick and mouseOver function I want to use onclick and mouseover in my website but when I tried onclick it won't work.
I want to change the background color of my text on click but it change instantly to its previous color.
Here is my html:
HOME

Here is my css class for a:
.a
    {
        font-size:20px;
        color:#FFF;
        text-align:center;
        text-decoration:blink;
        padding-right:20px;
   }

And below is my script with id a
function myFunction() {
    document.getElementById("a").style.backgoundcolor = "#000";
}

A: JavaScript is case-sensitive, and you've also made a typo. backgoundcolor should be backgroundColor (capital C in Color, and r in background).

A: You have a link on the page, You click it and the page navigates away. The link background color will not be applied on the next page load.
To have a link correspond to the current page you need to add a class to the element so you can style it differently.

A: You can use CSS to handle mouseOver and visited links, which is generally cleaner than using javascript. a:visited lets you change the style of visited links, and a:hover changes the style of links when you hover over them. Here are a few links for reference:
http://www.w3schools.com/cssref/sel_hover.asp
http://www.w3schools.com/cssref/sel_visited.asp

A: The element you've bound your click event to is a link, by default a link will navigate to the URL specified in its href attribute, or in the absence of that, cause a page refresh.
If you want to prevent the default action, thus executing only your function, you should set preventDefault on the event object to true, like this:
function myFunction(event) {
    document.getElementById("a").style.backgoundcolor = "#000";
    event.preventDefault = true;
}

A: Your code is a bit wrong. Typo and function. Try this:
function myFunction(e) {
    document.getElementById("a").style.backgroundcolor = "#000";
    e.preventDefault = true;
    return false;
}

A: First your code is not correct. Also remove the onclick from your html and I suppose you are using jquery because you added the tag jquery so use the code below instead of onclick.
$(document).ready(function(){
    $('#yourLink').on('click', function(e){
        //your code
        document.getElementById("a").style.backgroundcolor = "#000";
        e.preventDefault = true;
        return false;
    });
});

That should work. hope it's help!


text:
Q: how to bind a list of tuples using Spring JDBCTemplate? I have some queries like this:
List listOfIntegers = Arrays.asList(new Integer[] {1, 2, 3});
List objects =
    namedParameterJdbcTemplate.query("select * from bla where id in ( :ids )",
            Collections.singletonMap("ids", listOfIntegers),
            myRowMapper);

This will send this SQL query to the database:
select * from bla where id in ( 1, 2, 3 )

Now I want to send this type of query to the database:
select * from bla where (id,name) in ( (1,'foo'), (2,'bar'), (3,'foobar'))

Do I need to pass a List<List<Object>> to accomplish this? Will it work with Spring JDBCTemplate?

A: I have debugged Spring code and found that it expects tuples to be provided as Object[], so for it to work with a List it should be a List<Object[]>.


text:
Q: How to display Couse & Category list in moodle form? Hi,
I want to display course and category list from database in moodle form, as shown below:
Code:
class addschedule_form extends moodleform {

    function definition () {
        $mform =& $this->_form;
        $mform->addElement  ( 'date_time_selector', 'date-time', get_string('date-time'));
        $mform->addElement('text', 'category', 'Category');
        $mform->setType('category', PARAM_TEXT);
        $mform->addElement('text', 'course', 'Course');
        $mform->setType('course', PARAM_TEXT);

        $this->add_action_buttons(false, 'submit');
    }

}

Any reference or help will be much appreciated.
Regards

A: For the category list
$options = coursecat::make_categories_list();
$mform->addElement('select', 'categoryid', get_string('coursecategory'), $options);
$mform->setDefault('categoryid', $currentcategoryid);
$mform->setType(PARAM_INT);

Courses is tricker. For a list of all courses in the system:
$options = array();
$allcourses = coursecat::get(0)->get_courses(array('recursive' = true);
foreach ($allcourses as $course) {
    $options[$course->id] = $course-fullname;
}
$mform->addElement('select', 'courseid', get_string('course'), $options);
$mform->setDefault('courseid', $currentcourseid);
$mform->setType(PARAM_INT);

For courses for a particular category
 $catcourses = coursecat::get($currentcategoryid)->get_courses();