text:
Q: Struct for depth-curves in sea-maps I'm trying to make a struct in F# for representing depth curves in a sea map. It has to contain a list of coordinates and a float telling what depth is represented (eg. "4.5 meters"). I have made it this way:
type Coord =
    struct
        val X : float
        val Y : float
        new(x,y) = { X = x ; Y = y }
    end

type DepthCurve =
    struct
        val Coords : list<Coord>
        val Depth  : float
        new(list_of_Coords, depth) = { Coords = list_of_Coords ; Depth = depth}
    end

let myCoord1 = new Coord(1.,2.)
let myCoord2 = new Coord(3.,4.)
let myDepthCurve = new DepthCurve([myCoord1;myCoord2] , 5. )

My problem is that this doesn't let me create the Polygon and its Coords in one go, like this:
let myDepthCurve = {coords=[[1.;2.];[3.;4.]] , 5}

There do exist a solution for this:
type Coord  = { X : float; Y : float }
type 'a DepthCurve = {coords: 'a list;}
let myDepthCurve = {coords=[[1.;2.];[3.;4.]]};;

but it doesn't let me have the depth-indicating float in the struct as well, and it doesn't let me restrict types of the list to be only Coords.
How do I combine the best from both worlds?

A: The object types you created are standard .NET-structures with a constructor - They don't have the special F#-record-initialization sytnax ({ ... }).
For your problem, you could just write a little wrapper function:
let curve depth coords = New DepthCurve([for (x, y) in coords -> New Coord(x, y)], depth)

used like this
let testCurve = curve 10. [(1., 2.); (3., 4.); ...]

When declaring your structures in the shortened record syntax, you should do it like this:
type Coord = float * float // Type-alias for a 2D-float-tuple
type DepthCurve = { coords : Coord list; depth : float }

let myCurve = { coords = [(1., 2.); ...], depth = 42. }

There is no reason why you should use a generic list, just specify Coord list (meaning List of Coords). And please note the difference between a list ([1; 2; 3]) and a tuple ((1, 2, 3)). The latter are much more suitable for representing coords.
Please take a look at this article on F# structures and types.

A: The answer depends from the way you construct your program.
For case you activly use functional paradigm (no mutation, high-order functions, pattern matching) i vote for three choices:
(* tuple with type constractor and any getters you need: *)
let makeCoord x y = (x,y)
let makeCurve depth coords = (depth,coords)
let addCurveCoord (depth,coords) coord = (depth, coord::coords)
let getCurveDepth (depth,_) = depth
let getCurveCoords (_,coords) = coords
let getFirstCurveCoord (_,coords) = List.hd coords
//...

(* or types described by Dario *)
(* or tagged unions for case you need specific access to parts of your data *)

for case you prefer OOP you can create simple object hierarchy.
The main advantage of FP is easy modification of your design at any step of program constraction. But of course, it cost to your by explicit state arguments. But may beat them by monadic expressions :)


text:
Q: NVME can't see S.M.A.R.T. in gnome-disk-utility I am using Ubuntu Mate 16.04. I bought an nvme ssd (Intel 600p) and am no longer able to view SMART data through gnome-disk-utility.
I was able to see SMART using my old SATA ssd through this dropdown menu:

With the NVME ssd, the menu option doesn't exist. I can still view SMART data for the NVME ssd using
sudo smartctl --all /dev/nvme

Why can't I also view it in gnome-disk-utility?

A: This is a known issue in the underlying udisks program used by gnome-disks.
There already exist a issue on the gitlab page https://gitlab.gnome.org/GNOME/gnome-disk-utility/issues/50 and upstream on the udisks issue tracker https://github.com/storaged-project/udisks/issues/386

A: First, make sure that you have the latest firmware installed in the Intel 600P. Go to these web sites for the downloads...
https://www.intel.com/content/www/us/en/support/memory-and-storage/000017245.html
https://downloadcenter.intel.com/product/94922/Intel-SSD-600p-Series
In the Disks utility, make sure that you select the SSD in the left pane, then go to the "hamburger" icon and select SMART Data & Tests. That should get you where you want to go.
You might install gsmartcontrol and see if that sees the SSD SMART.
sudo apt-get update
sudo apt-get install gsmartcontrol

A: This worked for me on Ubuntu 16.04 to get more or less the same data
sudo nvme list
sudo nvme smart-log /dev/nvme0

redpajama_set_name: RedPajamaStackExchange


text:
Q: How does one change the certificate and key for https We have a server whose original PKI certificate was issued by a discontinued root CA.  We have a replacement certificate issued from a different root authority chain.  This site was set up some time ago with Strict-Transport-Security established.
The server key is 4096 bits.  The old CA root
private key is 1024 bits (it was issued in 2006).
How does one switch PKI keys and certificates for Strict-Transport-Security enabled sites?  I have searched for information on this but have so far come up empty.

A: HTTP Strict Transport Security also known as HSTS do not limit use with any other valid certificate.
Are you sure you dont mean HTTP Public Key Pinning (HPKP)
Edit: Just for clarification for HSTS the cert have to be trusted to be counted as valid.


text:
Q: Copy an ipaddress into the UIP_ICMP_PAYLOAD I am trying to improve the RPL protocol, and have therefore implemented a new control-message. I am able to send integers, but not ip-addresses. Can anyone help med? I am working in the file rpl-icmp6.c located at contiki/core/net/rpl.
This is my first function, which is receiving the data:
static void
tru_input(void)
{
   int trustValue;
   uip_ipaddr_t *trustAddr;
   unsigned char *buffer;
   buffer = UIP_ICMP_PAYLOAD;

   trustValue = buffer[0];
   memcpy(&trustAddr, buffer[1], 16);

   PRINT6ADDR(trustAddr);

}

And this is the function that is sending the data:
void
tru_output(uip_ipaddr_t *addr, uip_ipaddr_t *trustAddr, int *trustValue)
{
  unsigned char *buffer;
  buffer = UIP_ICMP_PAYLOAD;
  buffer[0] = &trustValue;
  memcpy(buffer[1], &trustAddr, 16);
  uip_icmp6_send(addr, ICMP6_RPL, RPL_CODE_TRU, 1);
}

I receive an java.lang.ArrayIndexOutOfBoundsException: -1. Can anybody help me?
EDIT:
This is my new code which works:
static void
tru_input(void)
{
  int trustValue;
  uip_ipaddr_t trustAddr;
  unsigned char *buffer;

  buffer = UIP_ICMP_PAYLOAD;

  trustValue = buffer[0];
  memcpy(&trustAddr, buffer + 1, 16);

  PRINT6ADDR(trustAddr);
  PRINTF("\n");

 }
 /*---------------------------------------------------------------------------*/
void
tru_output(uip_ipaddr_t *addr, uip_ipaddr_t *trustAddr, int trustValue)
{
  /*Array OF byte: Find out how to enter all the bytes into the PAYLOAD. */
  unsigned char *buffer;
  buffer = UIP_ICMP_PAYLOAD;
  buffer[0] = trustValue;

  memcpy(buffer + 1, trustAddr, 16);
  uip_icmp6_send(addr, ICMP6_RPL, RPL_CODE_TRU, 17);
 }

A: memcpy(&trustAddr, buffer[1], 16);

You are coping the value pointing to buffer[1] (that is a char) to the value that is pointing trustAddr
i think you would like to pass the address of buffer[1]:
memcpy(&trustAddr, buffer + 1, 16);

The same in tru_output (you don't need to pass the ponter of trustAddr to memcpy, because you already declared it as a pointer:
memcpy(buffer+1, trustAddr, 16);

I see that you also need to inizialize trustAddr with 16 byte, becouse you are coping memory to a random memory region, so don't declare trustAddr as a pointer:
uip_ipaddr_t trustAddr;


text:
Q: Java Servlet how to get a specific value from a session attribute OK, I'm kind of inept at explaining my problems, but I'll try to be as detailed, yet concise as possible.
I have 2 servlets;
NewCustomerServlet and
LoginServlet
I have 1 Java bean;
User
The User has a bunch of fields. username, firstName, password, etc...
my index.jsp automatically directs the user to NewCustomerServlet, so the user can create an "account"
Once they finish filling in the fields the User bean is created and saved in the session. Then, the user is able to "login"
The problem I'm having is validating the username from the "user" session with the login.jsp fields using the session.
How do I access the sessions "username" or "password" field. All I can seem to access is the name of the session, which would be "user"?

A: Referencing the JavaDoc for HttpSession,
You will realize that HttpSession stores attributes by key, just like a HashMap, you would place objects in the session (Any serializeable object) like:
String userName = "something";//
session.setAttribute("username", userName);

Then you can get it back out using:
String un=(String)session.getAttribute("username");

It is possible to store more complex objects, like an entire User object, as long as that object implements Serializable:
User someUser = //details left to the OP
session.setAttribute("user", someUser);

Then you can later retrieve the information for that user:
User someUser = (User)session.getAttribute("user");
if(user != null){
    String username = user.getUsername();
}

Also, here is a nice, brief run-through of common session utilization with Servlets and HttpSession: Session Tracking


text:
Q: Binding Dictionary> to multiple TreeViewItem So I've got some data that I want to store in a treeview and I have it working with 2 branches but I'm stuck on getting more than that. I think a dictionary would be best for this cause it'll be easiest to store the IDs in a key when I come to add in the 'sanity checks'
How I want my data to be presented:
--Internet Checks
----- 'Date, message, status'
--------- 'Details'
--Server Checks
----- 'Date, message, status'
--------- 'Details'
--Sanity Checks
----- 'Date, message, status'
--------- 'Details'
--------- 'Error1'
--------- 'Error2'
--------- 'Error3'
--------- 'etc'
--etc

And here's how it looks at the moment
--Internet Checks
----- 'Date, message, status'
--Server Checks
----- 'Date, message, status'
--Sanity Checks
----- 'Date, message, status'
--etc

So here's how I have my xaml at the moment:
<TreeView Name="treeView1" ItemsSource="{Binding Items}">
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate ItemsSource="{Binding Path=Value.SubItems}">
                        <TextBlock Text="{Binding Value.Text}" />
                        <HierarchicalDataTemplate.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Value.Text}"/>
                            </DataTemplate>
                        </HierarchicalDataTemplate.ItemTemplate>
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>

Here is my MenuItem class:
public class MenuItem
    {
        public MenuItem()
        {
            this.SubItems = new Dictionary<int, MenuItem>();
        }

        public Dictionary<int, MenuItem> SubItems { get; set; }

        public string Text { get; set; }
    }

And here is how I'm currently filling in the dictionary:
public Dictionary<int, MenuItem> Fill(string name, Dictionary<int, MenuItem> root, List<HealthCheckHourModel> list)
        {
            root.Add(nextNum, new MenuItem { Text = name + " Checks"});
            foreach (HealthCheckHourModel hchm in list)
            {
                if (hchm.Message.Contains(name))
                {
                    root[nextNum].SubItems.Add(hchm.ID, new MenuItem { Text = hchm.StartTime + " " + hchm.Message });
                    root[nextNum].SubItems[hchm.ID].SubItems.Add(-111, new MenuItem { Text = hchm.Details });
                }
            }
            nextNum--;
            return root;
        }

A: There are two possibilities:

*

*Delete ItemTemplate for HierarchicalDataTemplate.
<TreeView Name="treeView1" ItemsSource="{Binding Items}">
    <TreeView.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding Path=Value.SubItems}">
            <TextBlock Text="{Binding Value.Text}" />
            <!--<HierarchicalDataTemplate.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Value.Text}"/>
                </DataTemplate>
            </HierarchicalDataTemplate.ItemTemplate>-->
        </HierarchicalDataTemplate>
    </TreeView.ItemTemplate>
</TreeView>

*Leave ItemTemplate for HierarchicalDataTemplate, but replace DataTemplate with HierarchicalDataTemplate
<TreeView Name="treeView1" ItemsSource="{Binding Items}">
    <TreeView.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding Path=Value.SubItems}">
            <TextBlock Text="{Binding Value.Text}" />
            <HierarchicalDataTemplate.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Value.SubItems}">
                    <TextBlock Text="{Binding Value.Text}" />
                </HierarchicalDataTemplate>
            </HierarchicalDataTemplate.ItemTemplate>
        </HierarchicalDataTemplate>
    </TreeView.ItemTemplate>
</TreeView>


text:
Q: Merging multiple graphs in Python to one graph Hi im trying to combine 4 graphs together to over lap each other and i am not sure how it is done, the 4 graphs are the plotMultiDays(MergedDataJuly) to plotMultiDays(MergedDataDec)
any help would be great.
Heres the code:
MergedDataJuly=MergedData[MergedData.expiration == Date(2016,7,16)]
MergedDataAugust=MergedData[MergedData.expiration == Date(2016,8,20)]
MergedDataSep=MergedData[MergedData.expiration == Date(2016,9,17)]
MergedDataDec=MergedData[MergedData.expiration == Date(2016,12,17)]

plotMultiDays(MergedDataJuly,AgainstMarket='Yes')
plotMultiDays(MergedDataAugust,AgainstMarket='Yes')
plotMultiDays(MergedDataSep,AgainstMarket='Yes')
plotMultiDays(MergedDataDec,AgainstMarket='Yes')

plotMultiDays(MergedDataJuly)
plotMultiDays(MergedDataAugust)
plotMultiDays(MergedDataSep)
plotMultiDays(MergedDataDec)


text:
Q: Is it possible to write common graphics code to render visualizations on different platforms (Windows 7 and above/Android/IOS/ Windows mobile)? We have a custom built data visualization control to draw charts. It was developed using win GDI APIs and the application is built using C++ COM/ATL.
Now we have a requirement to port this module to C# .NET (for maintainability).
The requirement is that the ported .NET control should work in Windows 7 and above (preferably Vista also). The straight forward approach is to start porting the code and replace the C win GDI APIs with .NET GDI+ APIs.
However one additional requirement is to investigate the possibility of reusing the newly written C# .NET code and deploy the same as apps in IOS/Android/Windows mobile (cross platform). I have come across Xamarin, but it looks like I cannot reuse the C# .NET code containing win GDI+ APIs directly.
Q1) Is it possible to reuse the ported GDI+ C# .NET code for developing mobile apps (may be using Xamarin)
Q2) If the answer for above is No, and we chose to start developing the control from scratch(in contrast to porting), What are the alternative approaches? i.e. what rendering libraries can we use?
Suggestions regarding existing visualization libraries which can be used in Xamarin, so that the developed app will work on all platforms are also welcome. The catch is the library needs to provide flexibility for us to add custom interactions to the visualizations.
Thanks!


text:
Q: Scala Map Function I need some help to solve this issue I've faced using scala map function.
I've loaded a text file delimited by tab.
The Values are like following:
RDD: org.apache.spark.rdd.RDD[String]
Array[String]=Array(200110 1220 THEFT, 200112 2020 BATTERY, 200101 1010 DAMAGE, ....)
What I'd like to do is to get the a RDD like (1220 THEFT, 2020 BATTERY, 1010 DAMAGE, ....)
I've tried the following, but it's just throwing errors.
val crimeData = sc.textFile("/user/user_dir/crime_data")
val crimeTest = crimeData.map(crime => {
val b = crime.split(",")
val c = b(0).split(" ")
((c(1),c(2)))
})

When I run this code all I get back is an ArrayOutOfBoundsExeception: 1
I know it's throwing this error cos It can't access position 1, but I don't know how to get the results the way I want.
Some Help Please!

A: I don't think the following code is needed.val b = Crime.split(",") In crimeData,  each piece of data processed is "200110 1220 THEFT", so we don't need to use comma to split.
val crimeTest = crimeData.filter(_.split(" ").length == 3)
      .map(crime => {
      val c = crime.split(" ")
      (c(1), c(2))
    })

Hope it helps you.

A: I could make the code works doing like this
val crimeTest = crimeData.map(rec => {
val b = rec.split(" ")
val c = b(0).split("\t")
((c(1), c(2)))

})

So my final results were like that:
(7866, THEFT)
(6525, BATTERY)
(4714, NARCOTICS)
....


text:
Q: PhantomJS: respect viewport meta Is there a way to make PhantomJS respect the viewport meta tag? If not, is there any way to write a selenium test for a browser that respects the said tag? I'd like to do some automated testing for mobile browsers.
Details:
I find that PhantomJS does not respect viewport meta tag. I am using PhantomJS with selenium. To set PhantomJS's viewport size, I use driver.manage.window.setSize( new Dimension( 320, 800 ) ). My meta tag looks like: <meta name="viewport" content="width=800"> I would assume that if a browser respects the meta tag, it would render my website at 800px, as is true for mobile browsers I tested this with. However, PhantomJS doesn't do this. So is there a way to force this?


text:
Q: Cygwin - error loading shared library: arm-elf-gcc.exe from GNUARM I have installed Embedded Robot Coder, a set of tools for developing embedded ARM applications, e. g. for Lego NXT brick, using MATLAB on Windows. It contains Cygwin, GNUARM utilities and so on. When I try compile my application, generating C code works fine, but while building, an error occurs:
Compiling /cygdrive/C/MATLAB/2013/ecrobotnxt/environment/nxtOSEK/toppers_osek/kernel/alarm.c to alarm.o
C:/cygwin64/GNUARM/bin/arm-elf-gcc.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
I opened Cygwin Terminal (but Cugwin utilities also works on Windows CMD), and run ldd on arm-elf-gcc.exe. Output is following:
$  ldd ./arm-elf-gcc.exe
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7fff9c3e0000)
        ??? => ??? (0x778e0000)
        wow64.dll => /cygdrive/c/WINDOWS/System32/wow64.dll (0x77800000)
        wow64win.dll => /cygdrive/c/WINDOWS/System32/wow64win.dll (0x77860000)
What does ??? mean? I also used cygcheck command. On Windows CMD output is following:
C:\cygwin64\GNUARM\bin>cygcheck arm-elf-gcc.exe
Found: arm-elf-gcc.exe
arm-elf-gcc.exe
...but on Cygwin Terminal cygcheck returned an error:
cygcheck.exe arm-elf-gcc.exe
cygcheck: could not find 'arm-elf-gcc.exe'
While I was installing Cygwin I skipped many things just to save time and space, but I checked all necessary packages for ECR toolbox.
NOTE: That question is related to specific Matlab and Lego toolbox, but I ask it here because it uses Linux/Cygwin common mechanisms.

A: I found workaround. I have installed 32-bit, instead of 64, version of Cygwin, and everything works. The problem possibly was connected to GNUARM compiler which "feels good" with 32-bit architecture. As @matzeri pointed, problematic libraries used 32-bit Windows dependencies.


text:
Q: How to get/set value from custom collection in this case in Magento In my custom module controller i have a situation to create function with posted attributes
$params = $this->getRequest()->getParams();
$details = Mage::getModel('custom/custom')->load($params['id']);

$params array will looks like this
Array
(
    [product_id] => 3
    [id] => 82
    [value] => 20
)

$params['value'] is one of my column name in the below array
$details array will looks like this
Array
(
    [id] => 82
    [18] => 1
    [18_price] => 100.000
    [19] => 4
    [19_price] => 200.000
    [20] => 5
    [20_price] => 100.000
    [21] => 8
    [21_price] => 200.000
    [22] => 0
    [22_price] => 0.000
    .
    .
    .
    .
    [product_id] => 3
)

If i use $details->get20() i will get the value of $details['20'] from the above array, i.e, 5,
Every time i can't use this standard function like $details->get20(),$details->get21(),$details->get22() because i am going to have 20 to 30 columns like this, so i want to create this function using $params['value'] and this is not only for get method again i have to set the value in same place after few lines of my logic.
for this i tried the following ways
$details->get.''.$params['value']();
$details->get.$params['value']();

But no use it is giving Fatal error: Call to undefined function 20()
How can i achieve this in my case ?

A: You must set a variable as the function name before trying to call it:
$function = 'get' . $params['value'];

$details->$function();

Or you can do it like:
$details->{'get' . $params['value']}();


text:
Q: signtool - the specified PFX password is not correct from new machine I'm new to code signing and I'm trying to create as secure a process for signing our code as possible.  I created a .pfx file by exporting my certificate from IE and created a password for it.  I'm able to sign code using the pfx file with the following command:
signtool.exe sign /f mypfx.pfx /p mypass myexetosign.exe

This works fine, so I copied signtool.exe, the pfx file, and a different executable to sign to a USB flash drive.  I took the USB flash drive to a second computer and tried the same command again, but this time I get SignTool Error: The specified PFX password is not correct.  I'm certain the password is correct.  Is there an extra step I'm missing to move this to another machine?  My ultimate goal is to do the code signing in an offline static environment.

A: What I've encountered is that during the export, the encryption of the pfx is SHA256 or 3DES-SHA1.
If importing on a different machine, make sure the same SDK is used, so the same encryption can be used to decrypt.
The error explains this, if you try to decrypt with the wrong encryption, garbage comes out, which could be the result of a wrong password as well
Related stackoverflow question:
Why I get "The specified PFX password is not correct" when trying to sign application with signtool?


text:
Q: Wrong service URL in swagger-ui using JAX-RS and swagger-core I need to use openapi 3 wit swagger ui to document a jaxrs jersey service, using swagger-core v3.
I prefer use the full code approach without use config files. I'm going to use Wildfly to deploy service.
Here the code to generate openapi.json at following address: http://localhost:12079/suma-auth-ms/rest/openapi.json
@ApplicationPath("/rest")
public class AuthRestConfig extends Application {

  public AuthRestConfig(@Context ServletConfig servletConfig) {
    super();

    System.out.println();
    OpenAPI oas = new OpenAPI();
    Info info = new Info()
        .title("Suma Automaton OpenAPI")
        .description("This is a sample server Petstore server.  You can find out more about Swagger "
            + "at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, "
            + "you can use the api key `special-key` to test the authorization filters.")
        .termsOfService("http://swagger.io/terms/")
        .contact(new Contact()
            .email("emasil@email.com"));

    oas.info(info);
    SwaggerConfiguration oasConfig = new SwaggerConfiguration()
        .openAPI(oas)
        .prettyPrint(true)
        .resourcePackages(Stream.of("io.swagger.sample.resource").collect(Collectors.toSet()));

    try {
      new JaxrsOpenApiContextBuilder<>()
          .servletConfig(servletConfig)
          .application(this)
          .openApiConfiguration(oasConfig)
          .buildContext(true);
    } catch (OpenApiConfigurationException e) {
      throw new RuntimeException(e.getMessage(), e);
    }

  }
}

and here you can see openapi.json file at mentioned address:
{
    "openapi": "3.0.1",
    "paths": {
        "/rest/authentication/authenticateUser": {
            "post": {
                "operationId": "authenticateUser",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Credentials"
                            }
                        }
                    }
                },
                "responses": {
                    "default": {
                        "description": "default response",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Credentials": {
                "type": "object",
                "properties": {
                    "username": {
                        "type": "string"
                    },
                    "password": {
                        "type": "string"
                    }
                }
            }
        }
    }
}

As you can see in this file there's no references to suma-auth-ms, service response correctly at http://localhost:12079/suma-auth-ms/rest/authentication/authenticateUser
When I'm going to take a look to the swagger ui, andr try to execute some tests, I've this result:

Error shown is due to lack of suma-auth-ms in the address used by curl to call the service. Address should be http://localhost:12079/suma-auth-ms/rest/authentication/authenticateUser and not http://localhost:12079/rest/authentication/authenticateUser
Is there a way to fix?

A: You need to use io.swagger.v3.oas.models.servers.Server and add it into your oas object.
oas.info(info);
String url = "/suma-auth-ms/"
List<Server> servers = new ArrayList<Server>();
Server server = new Server();
server.setUrl(url);
servers.add(server);
oas.setServers(servers)

After making this change you should see servers listed in your openapi.json and you will be able to hit request with suma-auth-ms added


text:
Q: Cannot find logs for CodeDeployAgent Deployment fails at BeforeInstall event.
Error cod :UnknownError
Script name
Message : CodeDeploy agent was not able to receive the lifecycle event. Check the CodeDeploy agent logs on your host and make sure the agent is running and can connect to the CodeDeploy server.
As checked the codedeploy agent is running fine :The AWS CodeDeploy agent is running as PID ####
And there is no log found inside deployment-instructions. Please help resolve this.
EDITED:
No log inside /opt/codedeploy-agent/deployment-root/ or /opt/codedeploy-agent/deployment-root/deployment-group-ID/deployment-ID/
Log seen by running the command: cat /var/log/aws/codedeploy-agent/codedeploy-agent.log
LOGS: 2022-10-13 08:49:03 INFO  [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm.
2022-10-13 08:49:48 INFO  [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.500434 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")
2022-10-13 08:49:49 INFO  [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm.
2022-10-13 08:50:34 INFO  [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.061623 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")
2022-10-13 08:50:35 INFO  [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm.
2022-10-13 08:51:20 INFO  [codedeploy-agent(13597)]: [Aws::CodeDeployCommand::Client 200 45.042359 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:ap-south-1:009462874628:instance/i-05d7da2a813a32ab0")
2022-10-13 08:51:21 INFO  [codedeploy-agent(13597)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.0-2218_rpm.

A: Did you check the AWS docs on CodeDeploy log data, and the related thread here on SO? They provide the exact paths (different whether you're using Windows or Linux as deployment targets), where you should find the root cause for the failed deployment.


text:
Q: Details about Kelman's equivalent form of Barnette's conjecture Barnette's conjecture states that every cubic planar bipartite 3-connected graph admits Hamiltonian cycles.
Kelman claims that this conjecture is equivalent to a stronger one, which imposes some restrictions on the Hamiltonian cycles.
The statement of this equivalence lies in his paper, "Constructions of cubic bipartite 3-connected graphs without Hamiltonian cycles", AMS Translations, Series 2 158, pp. 127–140.
It is Theorem 17 in this paper.
Unfortunately, Kelmans does not even give a sketch of the proof. I have read in detail the paper, but was not able to reconstruct the proof.
So I would like to know if :
1) these details are written somewhere.
2) is it true that if a Barnette graph is Hamiltonian, then Kelman's conditions can be imposed on that very graph (without any more assumption).
Thank you.


text:
Q: a better way to view the field name and values in Angular.JS In my form I have got fields which are setup like below:

    Email

        <input type="email" ng-model="user.email" name="lead[email]">

     First name

        <input type="text" ng-model="user.name" name="lead[name]">

and so on. When user fills all the fields then I need to generate a confirmation view, in this case it is simply a separate tab in the same page.
This is how I am showing the fields which have been filled.

     Name:
     {{user.name}}

    Email:
    {{user.email}}

I think there should be a better way to collect the all and run a loop to show all the field name and their field value.
Thank you for your help in advance.

A: You can list all object properties with values using ngRepeat like this:

        {{key}}:
        {{value}}

Demo: http://plnkr.co/edit/XiA63e74xpm9aVNUdXCM?p=preview
Also note, that I used .field-name {text-transform: capitalize;} in CSS to capitalize key name for better readability so that email appears as Email.


text:
Q: Prove $\tan (\alpha)+ \tan(\alpha + 60°) + \tan(\alpha + 120°) = 3\tan(3\alpha)$

Question: Prove $\tan (\alpha)$ $+$ $\tan(\alpha + 60°)$ $+$ $\tan(\alpha + 120°) = 3\tan(3\alpha)$

What I have attempted (working from the lhs) :
$$ \tan (\alpha) + \tan(\alpha + 60°) + \tan(\alpha + 120°) $$
$$ \tan (\alpha) + \frac{\tan(\alpha) + \tan(60°)}{1-\tan(\alpha)\tan(60°)} + \frac{\tan(\alpha) + \tan(120°)}{1-\tan(\alpha)\tan(120°)} $$
$ tan (60°) = \sqrt{3}$ and $tan(120°) =-\sqrt{3}$ so
$$ \tan (\alpha) + \frac{\tan(\alpha) +\sqrt{3}}{1-\sqrt{3}\tan(\alpha)} + \frac{\tan(\alpha) - \sqrt{3}}{1+\sqrt{3}\tan(\alpha)} $$
$$ \tan (\alpha) + \frac{(\tan(\alpha) +\sqrt{3})(1+\sqrt{3}\tan(\alpha) )+(\tan(\alpha) - \sqrt{3})(1-\sqrt{3}\tan(\alpha))}{(1+\sqrt{3}\tan(\alpha))(1-\sqrt{3}\tan(\alpha))}  $$
$$ \tan (\alpha) + \frac{2\tan(\alpha) + 6\tan(\alpha)}{1-3\tan^2(\alpha)} $$
$$ \frac {\tan (\alpha)(1-3\tan^2(\alpha)) + 8\tan(\alpha) }{1-3\tan^2(\alpha)}$$
$$ \frac {9\tan(\alpha) - 3\tan^3(\alpha)}{1-3\tan^2(\alpha)} $$
Now I am stuck..

A: Hint: $$\tan(3a) = \frac{3 \tan a-\tan^3 a}{1-3\tan^2 a}$$
So, take 3 common from your last result:
$$\frac{9 \tan a-3\tan^3 a}{1-3\tan^2 a} = 3\tan (3a)$$


text:
Q: In GCC, what are "tree optimizations" vs "RTL optimizations"? When I file a bug against GCC about a missed optimization, I am always at a loss whether I should file it under "rtl-optimizations" or "tree-optimizations". I looked at the components page on the GCC bugzilla, and it isn't really explained there.
So, what are these two kinds of optimizations, or rather what distinguishes between them?

A: Partial answer:
The distinction has to do with different internal representations of (semi-compiled) programs within the GCC compiler. This is actually a rather complex issue, but for the purposes of this question:

*

*There's a abstact-syntax-tree-based representation called GIMPLE. Some optimization passes are made on this representation; see this list. These are known as Tree Optimizations or Tree-SSA Optimizations.

*A later and "lower-level" representation is in the Register Transfer Language (or RTL). Other optimization passes are made on this representation, later in the process than the tree optimizations; here's a list of these. These are call RTL optimizations.

That being said, I haven't given an easy rule-of-thumb for distinguishing which optimizations belong where.

For a lot more information, you might want to read the GCC internals guide, where I've found the lists of optimization passes.


text:
Q: Date conversion: add UTCOffset to existing timezone I have date which is in the format of(example) Date = 2023-01-09T23:51:44.595Z
and I have utcOffset String utcOffset = "UTC +6"
I want output as 2023-01-10T05:51:44.595Z in Date format.
How to achieve this??
I should add UTC offset to existing date.
Tried this:
public static void main(String[] args) throws ParseException {
        String rawDate = "2023-01-09T23:51:44.595Z";
        String utcOffset = "UTC +6";

        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ROOT);
        Date date = (Date) formatter.parse(rawDate);
        SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ROOT);
        String v = formatter1.format(date);
        System.out.println("Original raw date::::::::::"+v);

        System.out.println("utcOffset::::::::::"+utcOffset);

        Date triggerTime = date;
        String onlyHoursAndMin = StringUtils.strip(utcOffset, "UTC ");

        String[] split = onlyHoursAndMin.split(":");
        int hours = Integer.parseInt("0");
        int minutes = Integer.parseInt("0");
        if (split.length == 2) {
            hours = Integer.parseInt(split[0]);
            minutes = Integer.parseInt(split[1]);
        } else if (split.length == 1) {
            hours = Integer.parseInt(split[0]);
            minutes = Integer.parseInt("0");
        }

        TimeZone timeZone = TimeZone.getTimeZone("UTC");
        Calendar calendar = Calendar.getInstance(timeZone);
        calendar.setTime(triggerTime);
        calendar.add(Calendar.HOUR_OF_DAY, hours);
        calendar.add(Calendar.MINUTE, minutes);
        Date s = calendar.getTime();

        SimpleDateFormat utcFormatter1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ROOT);
        String newDate = utcFormatter1.format(s);
        System.out.println("Date in string format::::::::::::::"+newDate);

        SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ROOT);
        SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ROOT);
        Date aaa = format1.parse(newDate);
        String bbb = format2.format(aaa);
        System.out.println(":::::::::::::"+aaa);
        System.out.println("Date in correct format::::::::::::::"+format2.format(aaa));

    }

but finale Date format is Tue Jan 10 05:51:44 IST 2023 which is not expected.
and when build I am getting below error as well:
Forbidden method invocation: java.util.Calendar#getInstance(java.util.TimeZone) [Uses default locale or time zone]

A: I would suggest to move away from the legacy API (java.util.Date, java.util.Calendar, etc.), it is cumbersome and error prone. Since java 8 the modern date-time API, java.time, is available. With it the task would be quite trivial.
String date = "2023-01-09T23:51:44.595Z";
OffsetDateTime oldDateTime = OffsetDateTime.parse(date);
System.out.println("old - " + oldDateTime);
ZoneOffset offset = ZoneOffset.ofHours(6);
OffsetDateTime newDateTime = oldDateTime.withOffsetSameInstant(offset);
System.out.println("new - " + newDateTime);

Prints time - 2023-01-10T05:51:44.595+06:00.
Note that it ends with +06:00, not Z. Z at the end of a date-time string means Zulu, which indicates that the time is in UTC - What is the Z ending on date strings like 2014-01-01T00:00:00.588Z. Since resulting time is UTC + 6 hours, a date sting 2023-01-10T05:51:44.595Z would be incorrect.

A: java.time
The java.util date-time API and their corresponding parsing/formatting type, SimpleDateFormat are outdated and error-prone. In March 2014, the modern Date-Time API was released as part of the Java 8 standard library which supplanted the legacy date-time API and since then it is strongly recommended to switch to java.time, the modern date-time API.
Solution using java.time

*

*java.time API is based on ISO 8601 and therefore you do not need a DateTimeFormatter to parse a date-time string which is already in ISO 8601 format e.g. your date-time string, 2023-01-09T23:51:44.595Z which can be directly parsed into an OffsetDateTime.

*Your offset string is not in the ISO 8601 standard format. The standard format is +/-HH:mm:ss or Z which refers to +00:00 offset. In most cases, you will see +/-HH:mm e.g. +06:00. You can choose any basic string manipulation technique to get the hours and minutes from your string and create a ZoneOffset instance using them. I have used one which I have found easy to do.

The rest of the code is straightforward.
Demo:
import java.time.OffsetDateTime;
import java.time.ZoneOffset;

class Main {
    public static void main(String[] args) {
        String strDateTime = "2023-01-09T23:51:44.595Z";
        String utcOffset = "UTC +6";
        int offsetHour = Integer.parseInt(utcOffset.replaceAll("[^0-9+-]", ""));
        ZoneOffset zoneOffset = ZoneOffset.ofHours(offsetHour);
        OffsetDateTime odtGiven = OffsetDateTime.parse(strDateTime);
        OffsetDateTime odtDesired = odtGiven.withOffsetSameLocal(zoneOffset)
                                        .withOffsetSameInstant(zoneOffset.UTC);
        System.out.println(odtDesired);
    }
}

Output:
2023-01-09T17:51:44.595Z

Note that 2023-01-10T05:51:44.595Z does not make sense without am/pm marker as you mean 05:51:44.595 pm. You can use a DateTimeFormatter to format the above output in your desired way.
ONLINE DEMO
Learn more about the modern Date-Time API from Trail: Date Time.

I liked the alternative way suggested by Ole V.V. to parse the offset string. Given below is the solution based on his suggestion:
class Main {
    public static void main(String[] args) {
        String strDateTime = "2023-01-09T23:51:44.595Z";
        String utcOffset = "UTC +6";
        DateTimeFormatter offsetFormatter = new DateTimeFormatterBuilder()
                                            .appendLiteral("UTC ")
                                            .appendOffset("+H:mm", "+0")
                                            .toFormatter(Locale.ROOT);
        ZoneOffset zoneOffset = offsetFormatter.parse(utcOffset, ZoneOffset::from);
        // Rest of the lines are the same as the above code
    }
}

ONLINE DEMO


text:
Q: How to fix GoNative Android application not loading Laravel / Vue JS? Debug shows Syntax errors I have a web app built in Laravel 5.5 and VueJS 2.7.12. We are using Laravel Mix to mix most of our assets, so we are using Webpack 3.12.0
We used GoNative to build the mobile native apps. Our IOS app is working but our android build is not loading. I am debugging the build and this is what I see:
Syntax error [ in app.js  Jquery , $ are undefined.
And a few other errors I'm assuming in my footer

I can't really see my sources in the console to see where the syntax error is, but I still want to ask if anyone has experienced incompatibility issues. Yesterday, I tried to upgrade my babel to latest, and installed babel-presets-vue but don't see much of an improvement.
I'm not using babel loader which I will try using now.
I'm using extracting jquery in my webpack.mix.js which looks like this
const { mix } = require('laravel-mix');

/*
|--------------------------------------------------------------------      ------
| Mix Asset Management */

if (mix.inProduction()) {
 mix.version();
}
mix.copyDirectory([

'resources/assets/vendor/ampleadmin/plugins/bower_components/ckeditor'],
'public/js/ckeditor'
);

mix.copy(['resources/assets/vendor/ampleadmin/plugins/bower_components/jquery/dist/jquery.min.js','resources/assets/vendor/ampleadmin/js/custom.min.js,'resources/assets/vendor/ampleadmin/js/dashboard1.js','resources/assets/vendor/ampleadmin/plugins/bower_components/raphael/raphael-min.js',    'resources/assets/vendor/ampleadmin/plugins/bower_components/morrisjs/morris.min.js','resources/assets/vendor/ampleadmin/js/cbpFWTabs.js'], 'public/js');

mix.js('resources/assets/js/app.js', 'public/js')
.extract(['vue', 'jquery', 'axios',  'moment', 'laravel-echo', 'pusher-js']).version();

mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery'],
moment: 'moment',
DataTable : 'datatables.net-bs'

});

mix.sourceMaps();

// mix.options();

mix.options({
// extractVueStyles: false,
processCssUrls: false
// postCss: [require('autoprefixer')],
 });
mix.webpackConfig({
resolve: {
    alias: {
        'vue$': 'vue/dist/vue.min.js',
        'jquery-ui': 'jquery-ui-dist/jquery-ui.js',
    }
}
});

And this is my list of dependencies in package.json
 {
 "private": true,
 "scripts": {
 "dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
 },
 "babel": {
 "plugins": [
  "jsx-event-modifiers",
  "transform-vue-jsx"
],
"ignore": [],
"presets": [
  [
    "env",
    {
      "targets": {
        "node": "current"
      }
    }
  ],
  "vue"
 ]
 },
  "devDependencies": {
  "@ckeditor/ckeditor5-build-classic": "^10.1.0",
  "axios": "^0.17",
  "babel-preset-env": "^1.7.0",
  "babel-preset-vue": "^2.0.2",
  "bootstrap": "^3.3.7",
  "bootstrap-sass": "^3.3.7",
  "chartist": "^0.9.7",
  "cross-env": "^5.2.0",
  "datatables.net": "^1.10.19",
  "datatables.net-bs": "^1.10.19",
  "file-loader": "^1.1.11",
  "imports-loader": "^0.8.0",
  "jquery": "^3.3.1",
  "jquery-migrate": "3.0.0",
  "jquery-noconflict": "^1.0.0",
  "jquery-ui": "^1.12.1",
  "jquery-ui-dist": "^1.12.1",
  "laravel-mix": "^1.7.2",
  "less": "^3.8.0",
  "less-loader": "^4.1.0",
  "lodash": "^4.17.10",
  "moment-timezone": "^0.5.21",
  "quill": "^1.3.6",
  "raphael": "^2.2.7",
  "sass-loader": "^5.0.1",
  "style-loader": "^0.17.0",
  "toastr": "^2.1.4",
  "vue": "^2.5.17",
  "vue-loader": "^12.2.2",
  "vue-resource": "^1.5.1",
  "vuex": "^3.0.1",
  "webpack-cli": "^2.1.5"
  },
  "dependencies": {
    "api-ai-javascript": "^2.0.0-beta.14",
    "apiai": "^4.0.3",
    "babel": "^6.23.0",
    "bootstrap": "^3.3.7",
    "bootstrap-loader": "^2.2.0",
    "bootstrap-select": "^1.13.1",
    "browser-sync": "^2.24.6",
    "buble": "^0.15.2",
   "buble-loader": "^0.4.1",
   "daterangepicker": "^3.0.3",
   "express": "^4.15.3",
   "file-loader": "^1.1.11",
   "fs": "0.0.1-security",
   "fullcalendar": "^3.9.0",
  "fullcalendar-scheduler": "^1.9.4",
  "gulp-sass": "^3.1.0",
  "icheck": "^1.0.2",
  "image-picker": "^0.3.1",
  "install": "^0.10.4",
  "ioredis": "^2.5.0",
  "jquery-slimscroll": "^1.3.8",
  "jquery-ui-touch-punch": "^0.2.3",
  "laravel-echo": "^1.4.0",
  "moment": "^2.22.2",
  "morris.js": "^0.5.0",
  "node-sass": "^4.9.2",
  "npm": "^5.10.0",
  "pusher-js": "^4.2.1",
  "select2": "^4.0.6-rc.1",
  "socket.io": "^1.7.4",
  "timepicker": "^1.11.12",
  "vue-bootstrap-toggle": "^1.1.4",
  "vue-chat-scroll": "^1.3.3",
  "vue-js-modal": "^1.3.16",
  "vue-router": "^3.0.1",
  "vue-select": "^2.4.0",
  "vue-template-compiler": "^2.5.17",
  "webpack": "^3.12.0"
}

}
I can't see all my sources loaded in webview dev tools but not the source code.


text:
Q: TypeScript adding node to exsisting XML I have a XML that structure looks like this
<?xml version="1.0" encoding="UTF-8"?>
<parent>
   <kid>
   </kid>
</parent>

I wanna simply add few nodes inside parent node that it will become something like this
<?xml version="1.0" encoding="UTF-8"?>
<parent>
   <kid>
   </kid>
    <data>
        <data_kid_1>{ JSON OBJECT }</data_kid_1>
        <data_kid_2>false</data_kid_2>
    </data>
</parent>

I have tried to use XmlJs.xml2js() convert my XML to JavaScript and then add it in that way:
        let jScriptXml['parent']['data'] = {
            'data_kid_1': { JSON OBJECT } ,
            'data_kid_2': false
        };

followed by converting it back to XML using XmlJs.js2xml() but conversion do not convert signs like & or < to entity references and that cause errors in my app
Anyone have an idea how to add that nodes without breaking XML?

A: Not the most beautiful code in the world, but it does deliver, I think:
kids = `<?xml version="1.0" encoding="UTF-8"?>
<parent>
   <kid>
   </kid>
</parent>`

xpath = require('xpath')
 , dom = require('xmldom').DOMParser;
XMLSerializer = require('xmldom').XMLSerializer;
serializer = new XMLSerializer();
family = new dom().parseFromString(kids);

destination = xpath.select('//kid', family, true);
data = family.createElement("data");
data.appendChild(family.createTextNode("\r\n\t    "));//I added a few new lines, etc., just for presentation, but they're not strictly necessary
kid1 = family.createElement("data_kid_1");
kid1.appendChild(family.createTextNode("{ JSON OBJECT }"));
kid2 = family.createElement("data_kid_2");
kid2.appendChild(family.createTextNode("false"));
data.appendChild(kid1);
data.appendChild(family.createTextNode("\r\n\t    "));
data.appendChild(kid2);
data.appendChild(family.createTextNode("\r\n\t"));

destination.parentNode.insertBefore(data, destination.nextSibling);//drop .nextSibling to actually insert before
destination.parentNode.insertBefore(family.createTextNode("\r\n\t"), destination.nextSibling);
console.info(serializer.serializeToString(family))

Output:
<?xml version="1.0" encoding="UTF-8"?>
<parent>
   <kid>
   </kid>
    <data>
        <data_kid_1>{ JSON OBJECT }</data_kid_1>
        <data_kid_2>false</data_kid_2>
    </data>
</parent>


text:
Q: Empty cells when element exist I have a table which contains multiple rows and 5 columns with some data in it:

   ...stuff...

       .... stuff....

       Reference / PO box

      .... stuff....

      .... stuff....

        .... stuff....

          .... stuff....

     .... start of new
 ....

Inside the second cell of any table row there's always a link present with a title. What i try to do is find a specific title and if that title is present then empty all table cells from that specific row**. The problem is that I can find the correct title but I can't empty the correct cells. Further I try to give the  a black background if the name exist.
My JQUERY so far:
          $("#gui-wrapper .gui-table td a").filter(function(){
            return $(this).text() == 'Reference / PO box';
          }).css("background-color", "#1699f0");

This code finds the correct text/td but what do I have to do next to empty all cells but this one with the text in it and then give the  a black background??
I can't work with id's or whatever since this is all created automatically.
Anybody? Thx.

A: To empty all the cells from that row (including the cell with the specific  element):
$("#gui-wrapper .gui-table td a").filter(function(){
    return $(this).text() == 'Reference / PO box';
}).closest('tr').find('td').empty();

$(".gui-table td a").filter(function(){
    return $(this).text() == 'Reference / PO box';
}).closest('tr').find('td').empty();

       .... stuff....

       Reference / PO box

      .... stuff....

      .... stuff....

        .... stuff....

          .... stuff....

       .... stuff....

       a different title indeed

      .... stuff....

      .... stuff....

        .... stuff....

          .... stuff....

To empty all the cells except the cell containing the given  element:
$("#gui-wrapper .gui-table td a").filter(function(){
    return $(this).text() == 'Reference / PO box';
}).closest('td').siblings().empty();

$(".gui-table td a").filter(function(){
    return $(this).text() == 'Reference / PO box';
}).closest('td').siblings().empty();

       .... stuff....

       Reference / PO box

      .... stuff....

      .... stuff....

        .... stuff....

          .... stuff....

       .... stuff....

       a different title indeed

      .... stuff....

      .... stuff....

        .... stuff....

          .... stuff....

References:

*

*closest().

*empty().

*find().

A: You can do like this,
$("#gui-wrapper .gui-table td a:contains('Reference / PO box')").closest("td").next() empty();


text:
Q: Selenium WebDriver Error: invalid session id I use Selenium WebDriver and Chrome to do feature testing in my app. I have already successfully setup multiple rails app with rspec, capybara and selenium, but I can't get why this one does not work.
Here's the problem: When I run the feature tests for the first time, it works according to plan. However, if I run it a second time, selenium crashes with the following message:

Selenium::WebDriver::Error::NoSuchDriverError:
              invalid session id
                (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)

I might add that feature tests work perfectly in other apps, so this is not a Chrome/chromedriver compatibility issue.
I have been working on this for days now and I cannot figure out what's happening
Here's my config:

*

*selenium-webdriver (3.141.0)

*capybara (2.7.1)

*Chrome 74 and chromedriver 74.0.3729.6

support/capyabara.rb
Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.new(app, browser: :chrome)
end

Capybara.register_driver :headless_chrome do |app|
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
    chromeOptions: { args: %w(headless disable-gpu) }
  )

  Capybara::Selenium::Driver.new app,
    browser: :chrome,
    desired_capabilities: capabilities
end

Capybara.javascript_driver = :headless_chrome
Capybara.default_max_wait_time = 15

rails_helper.rb
# frozen_string_literal: true

# This file is copied to spec/ when you run 'rails generate rspec:install'
require File.expand_path("../../config/environment", __FILE__)

require "spec_helper"
require "rspec/rails"
require 'capybara/rails'
require 'capybara/rspec'
require 'selenium-webdriver'
# https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-(and-RSpec)
require "devise"

Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = false

  config.include Devise::TestHelpers, type: :controller

  config.infer_spec_type_from_file_location!

  # Only retry when Selenium raises Net::ReadTimeout
  config.exceptions_to_retry = [Net::ReadTimeout]
end

support/database_cleander.rb
RSpec.configure do |config|
  config.before(:suite) do
    DatabaseCleaner.clean_with :truncation

    # Seed database
    load "#{Rails.root}/db/seeds.rb"
  end

  config.before(:each) do
    DatabaseCleaner.strategy = :transaction
  end

  config.before(:each, type: :feature) do
    driver_shares_db_connection_with_specs = Capybara.current_driver == :rack_test

    if !driver_shares_db_connection_with_specs
      DatabaseCleaner.strategy = :truncation
    end
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.append_after(:each) do
    DatabaseCleaner.clean
  end
end

Stacktrace:
# ./spec/features/test_spec.rb:8:in `block (2 levels) in <top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `new'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `create_response'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:62:in `call'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/bridge.rb:166:in `execute'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/oss/bridge.rb:584:in `execute'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/oss/bridge.rb:299:in `delete_all_cookies'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/common/options.rb:81:in `delete_all_cookies'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara/selenium/driver.rb:102:in `reset!'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara/session.rb:109:in `reset!'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `block in reset_sessions!'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `reverse_each'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara.rb:331:in `reset_sessions!'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/capybara-2.7.1/lib/capybara/rspec.rb:21:in `block (2 levels) in <top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:357:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:507:in `block in run_owned_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:506:in `each'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:506:in `run_owned_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:593:in `block in run_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:592:in `each'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:592:in `run_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:463:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:507:in `run_after_example'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:273:in `block in run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:500:in `block in with_around_and_singleton_context_hooks'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:457:in `block in with_around_example_hooks'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:464:in `block in run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:604:in `block in run_around_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:342:in `call'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-rails-3.6.0/lib/rspec/rails/adapters.rb:127:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:375:in `execute_with'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:606:in `block (2 levels) in run_around_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:342:in `call'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:123:in `block in run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `loop'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-retry-0.6.1/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:447:in `instance_exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:375:in `execute_with'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:606:in `block (2 levels) in run_around_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:342:in `call'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:607:in `run_around_example_hooks_for'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb:464:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:457:in `with_around_example_hooks'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:500:in `with_around_and_singleton_context_hooks'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb:251:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb:627:in `block in run_examples'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb:623:in `map'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb:623:in `run_examples'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb:589:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:118:in `block (3 levels) in run_specs'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:118:in `map'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:118:in `block (2 levels) in run_specs'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1894:in `with_suite_hooks'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:113:in `block in run_specs'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/reporter.rb:79:in `report'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:112:in `run_specs'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:87:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:71:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:45:in `invoke'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/exe/rspec:4:in `<top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/bin/rspec:22:in `load'
# /Users/vincentrolea/.rbenv/versions/2.3.7/bin/rspec:22:in `<top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
# /Users/vincentrolea/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
# /Users/vincentrolea/.rbenv/versions/2.3.7/bin/bundle:22:in `load'

EDIT
Chromedriver reuse the same session id over and over again over the tests. This is why the first time, the tests pass but if I start again, chromedriver will use the exact same session id which is what I think cause the problem. I logged Selenium's actions, and it does send DELETE so I don't understand.
2019-05-10 08:24:53 INFO Selenium -> POST session
2019-05-10 08:24:53 INFO Selenium    >>> http://127.0.0.1:9517/session | {"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":false,"nativeEvents":false,"rotatable":false},"capabilities":{"firstMatch":[{"browserName":"chrome"}]}}
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":0,"value":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29})","userDataDir":"/var/folders/_x/xj6qbw1n30z7pr18t52y1yjh0000gn/T/.com.google.Chrome.IyCrBu"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:64888"},"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Mac OS X","proxy":{},"rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"takesHeapSnapshot":true,"takesScreenshot":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unexpectedAlertBehaviour":"ignore","version":"74.0.3729.131","webStorageEnabled":true}}
2019-05-10 08:24:53 INFO Selenium Detected OSS dialect.
2019-05-10 08:24:53 INFO Selenium -> POST session/b8a41525be337e1a029cf574285d2031/url
2019-05-10 08:24:53 INFO Selenium    >>> http://127.0.0.1:9517/session/b8a41525be337e1a029cf574285d2031/url | {"url":"http://127.0.0.1:50711/"}
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)"}}
2019-05-10 08:24:53 INFO Selenium -> DELETE session/b8a41525be337e1a029cf574285d2031/cookie
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":0,"value":null}
2019-05-10 08:24:53 INFO Selenium -> POST session/b8a41525be337e1a029cf574285d2031/url
2019-05-10 08:24:53 INFO Selenium    >>> http://127.0.0.1:9517/session/b8a41525be337e1a029cf574285d2031/url | {"url":"about:blank"}
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":0,"value":null}
2019-05-10 08:24:53 INFO Selenium -> POST session/b8a41525be337e1a029cf574285d2031/elements
2019-05-10 08:24:53 INFO Selenium    >>> http://127.0.0.1:9517/session/b8a41525be337e1a029cf574285d2031/elements | {"using":"xpath","value":"/html/body/*"}
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":0,"value":[]}
  User log in (FAILED - 1)

Failures:

  1) Test Feature User log in
     Failure/Error: visit root_path

     Selenium::WebDriver::Error::NoSuchDriverError:
       invalid session id
         (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)
     # ./spec/features/test_spec.rb:8:in `block (2 levels) in <top (required)>'

Finished in 4.85 seconds (files took 11.27 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/features/test_spec.rb:4 # Test Feature User log in

2019-05-10 08:24:53 INFO Selenium -> DELETE session/b8a41525be337e1a029cf574285d2031
2019-05-10 08:24:53 INFO Selenium <- {"sessionId":"b8a41525be337e1a029cf574285d2031","status":0,"value":null}

A: I found what went wrong.
We are using a library to cache api response during test after they are made for the first time.
The problem is, the driver sends a request to get a session id. This is why the first time the tests were passing. The library cached the response from the driver which had the same session id everytime, hence the error from chrome.
If you're using such libraries (VCR, ephemeral_response) and get similar error this is something you might want to investigate

A: The first thing I notice is that you're using a 3 year old version of Capybara with new versions of selenium-webdriver, Chrome, and chromedriver. Since selenium-webdriver doesn't follow SemVer expecting those to work correctly together is a stretch. You probably want to upgrade Capybara.
Often this error is caused by resource issues with Chrome. Since you appear to be running on MacOS that's not as likely as if you were running this in containers. However it wouldn't hurt to try adding the disable-dev-shm-usage chrome option, and/or setting the window size smaller to see if the error goes away. You could also just try a reboot.
Beyond that a couple of other potentials are

*

*You have an after block registered that has already closed the session - comment out the after block and see if the issue goes away

*A bug in chromedriver 74 (of which a few have been reported - https://bugs.chromium.org/p/chromedriver/issues/detail?id=2885, etc) - try rolling back to chrome and chromedriver 73 to see if the issue goes away

A: I had this error today and what worked for me was to downgrade the chromedriver version from latest to the version of chrome I have installed on my machine.


text:
Q: How to convert column dataframe in pandas into time I need to make a plot but I got this error:
 TypeError: float() argument must be a string or a number, not 'datetime.time'

I then tried to to convert the column belonging to the x axis into time, but I get the following error:
 TypeError: <class 'datetime.time'> is not convertible to datetime

This is my code and below my dataframe. Any help is welcome
#import
import pandas as pd
import matplotlib.pyplot as plt
import datetime
import matplotlib.dates as mdates

df1 = pd.read_excel(r'results.xlsx', 'growth')
df1_sub = df1.groupby(["Sampling", ], as_index=False).agg({'NPQ':['mean', 'std']})
df1_sub.columns = ['Sampling','NPQ','std']

# here I try to make the conversion
df1_sub['Sampling'] = pd.to_datetime(df1_sub['Sampling'])

#plotting

ax1.errorbar('Sampling', 'NPQ', yerr='std', data=df1_sub)
plt.show()

My dataframe in excel looks like this:
 x              y
 14:00:00 AM    15
 15:00:00 AM    345
 16:00:00 AM    25


text:
Q: Not all assets in private folder of Meteor project are auto-deployed to ".meteor\local\build\programs\server\assets\app" I am using a private folder in my Meteor project to store/use static (private) assets (e.g., .json and .js files) which can be loaded using Assets.getText(assetFileName). These are normally deployed on meteor startup from "projectdir\private" to "projectdir.meteor\local\build\programs\server\assets\app".
However, of the three .js files that I have in my private directory, only two are deployed; one of them remains absent. I am trying to use that file in the exact same way (part of a loop that finds and processes all files in a directory), but Meteor simply doesn't deploy the file to the aforementioned directory, as a result of which I am met with a file-does-not-exist error for "platform_b.js".
"platform_a.js" and "platform_c.js" can be found (i.e., are deployed) and all three of them are present in the private folder, but (auto-)deployment fails for "platform_b.js". Deleting the deployment directory and/or rerunning does not seem to solve the issue. Any thoughts? Many thanks in advance.

A: I have the same problem. You can load the private file in your code like this to force loading the assets.
Assets.getBinary('path/to/file')


text:
Q: Custom Permission added to Running User in testmethod has no effect Let's say there's a Custom Permission OrderBulkCancel that grants the running user the ability to cancel more than one order in a transaction.  The Custom Permission is evaluated at runtime with:
if (FeatureManagement.checkPermission('OrderBulkCancel')) {..}

When the testmethod runs, if the running user has the permission, the test passes; if the running user does not have the permission, the test fails. That is, org settings influence the test execution.
But of course, it is bad practice to rely on org settings for testmethods, you should mock the permission and assign to the running user.
What is the easiest way to do this?

A: As many other answers have stated such as this one, custom permissions are mocked by

*

*first mocking a Permission Set,

*then assigning the custom permission to that permission set

*then assigning the permission set to the user

But the key is that this permission set assignment to the running user has no effect unless your code under test is executed within a System.runAs(..) {}. If the running user had the permission set assigned as part of org data it would apply, but if assigned to the very same user in the testmethod, it does not apply unless a System.runAs() scopes the execution of the code under test.
This is an easy trap to fall into as a lot of testmethods are written without mocking a user and/or using System.runAs. It is easy to get sloppy and assume you can assign permission sets to the default running user (you) and assume they'll stick just like mocking other sobject data.
Does not work
insert new PermissionSetAssignment(AssigneeId=UserInfo.getUserId(),
                                   PermissionSetId=mockedPermissionSetId);
Test.startTest();
myCodeUnderTest.doStuff();
Test.stopTest();
// assertions - fail because FeatureManagement.checkPermission returns false

Works
insert new PermissionSetAssignment(AssigneeId=UserInfo.getUserId(),
                                   PermissionSetId=mockedPermissionSetId);
Test.startTest();
System.runAs(new User(Id = UserInfo.getUserId()) {
  myCodeUnderTest.doStuff();
}
Test.stopTest();
// assertions pass because FeatureManagement.checkPermission returns true


text:
Q: How to Implement MVC3 Model URL Validation? I've successfully implemented client side validation to require input in my textbox.  However, I want to evaluate the contents of the textbox to see if it is a well formed URL.  Here's what I have thus far:
Index.cshtml:

@model Ticket911.Models.ValidationModel
@{
ViewBag.Title = "Home Page";
}

@ViewBag.Message

@using (Ajax.BeginForm("Form", new AjaxOptions() { UpdateTargetId = "FormContainer" , OnSuccess = "$.validator.unobtrusive.parse('form');" }))

{

    Error Message: @Html.ValidationMessageFor(m => m.URL)

@Html.LabelFor(m =>m.URL):
@Html.EditorFor(m => m.URL)

<input type="submit" value="Submit" />

ValidationModel:
 public class ValidURLAttribute : ValidationAttribute
{
    public override bool IsValid(object value)
    {
        return (value != null);
    }
}

public class ValidationModel
{
    [Required]
    public string URL {get; set;}
}

How do I ensure that the model URL validation occurs?  When the Submit button is clicked, what must be done to navigate to the URL entered into the textbox?
Thanks much:)

A: You can do it wtih DataAnnotations
public class ValidationModel
{
  [Required]
  [RegularExpression(@"^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$", ErrorMessage = "URL format is wrong")]
  public string URL {get; set;}
}

And in your HTTPPost Action method, You can call the ModelState.IsValid property which will check the Validations for you.
[HttpPost]
public ActionResult Save(ValidationModel model)
{
  if(ModelState.IsValid)
  {
   //Save or whatever
  }
  return View(model);

}

A: good way is to implement your attribute for next use in mvc projects. like this:
public class UrlAttribute : RegularExpressionAttribute
{
    public UrlAttribute() : base(@"^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$")
    {}
}

so on the model:
[Url(ErrorMessage = "URL format is wrong!")]
public string BlogAddress { get; set; }


text:
Q: How to validate on some persistence actions, but not others I've got a requirement that states a user can 'save' a foo with no validation at all, but if they 'submit' then the object must be validated.  I've got this all built and working on the front-end with Parsley.js, but want to add back-end validation.
What is the typical approach to doing this with Spring/Boot?  I understand the basic JPA validation, but I don't know how to apply it conditionally.
I want to also mention I tried to do this with 2 subclasses of Foo, but I'm unable to manage switching types, either because it's not possible in Java, or because I don't understand how you can instantiate a new version of the object and expect it to .equals() the old version for Hibernate persistence.
Thanks for any insight.

A: *

*Use JSR 303 Validation Groups. This gives you conditional validation.

*Use Spring's @Validated in your handler methods. This lets you apply different validations in your Controllers

*Follow my example here: http://blog.databasepatterns.com/2014/06/draft-entities-hibernate-validator.html

A: JPA has no possibility for conditional validations.
Why? Because many validations are just database constraints that are not validated by JPA, but unconditionally by the database.
For example a
@NotNull
private Integer value;

will create a column with a NOT NULL constraint.
Or a
@Size(max = 100)
private String value;

will create a column of VARCHAR(100)
As you might understand it is not possible to save a value into such a column that breaks the size constraint and has more than 100 characters.
And indeed - it is not possible to switch the type of an object in Java.
You can cast for example a Entity1 to Entity2, but that is only the variable for the compiler. The object itself is an Entity1 - no matter what you try. But you can copy all values from an instance of Entity1 to a new instance of Entity2:
Entity1 entity1 = ...
Entity2 entity2 = new Entity2();
entity2.setProperty(entity1.getProperty());
...
entityManager.persist(entity2);
entityManager.delete(entity1);

If you don't like to copy all the properties by hand, you could use BeanUtils.copyProperties from Apache BeanUtils.


text:
Q: Fuse Console not starting I have done a clean install fuse on karaf at
C:\esb\redhatfusekaraf\fuse-karaf-7.8.0.fuse-780038-redhat-00001

FUSE_HOME environment variable is set to this directory.
I have OpenJDK installed at
C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.282.8-hotspot

PATH and JAVA_HOME are set properly and tested.
When I run fuse.bat from the above install here is what I get.
Microsoft Windows [Version 10.0.18363.1440]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\MO Tec>%FUSE_HOME%
'C:\esb\redhatfusekaraf\fuse-karaf-7.8.0.fuse-780038-redhat-00001' is not recognized as an internal or external command,
operable program or batch file.

C:\esb\redhatfusekaraf\fuse-karaf-7.8.0.fuse-780038-redhat-00001\bin>fuse
karaf.bat: Ignoring predefined value for KARAF_HOME
Red Hat Fuse starting up. Press Enter to open the shell now...
100% [========================================================================]
Karaf started in 2s. Bundle stats: 12 active, 13 total

No Fuse Shell.  Anything else I can look at?

A: The problem was caused by a missing ">" in the maven settings.xml  I discovered it trying to run an "mvn clean install" when maven crashed.
I fixed the missing ">" and not only did that command run and build success but the Fuse Console now appears.


text:
Q: How to make a filter from bots? Discord.js I can't make a filter.
The bot shows 6 members of the server , with the bot.
How can I make the bot not be included in this number
const guild = client.guilds.cache.get("74721732.........");
setInterval(function () {
   var memberCount = guild.members.filter(member => !member.user.bot).size;
   var memberCountChannel = client.channels.cache.get("81358139.........");
  memberCountChannel.setName(`Members: ${memberCount}`);
}, 1000);

A: Your filter's callback function is correct, it removes every bot from the collection.
The problem is that guild.members returns a manager, not a collection. It means it won't have a filter() method. You should use guild.members.cache as it returns a collection of guild members and collections do have a .filter() method:
const guild = client.guilds.cache.get('74721732.........');
setInterval(function () {
  const memberCount = guild.members.cache.filter((member) => !member.user.bot).size;
  const memberCountChannel = client.channels.cache.get('81358139.........');
  memberCountChannel.setName(`Members: ${memberCount}`);
}, 1000);


text:
Q: Where can I find the F# runtime for Silverlight 4 I have been playing around with Silverlight & F# and tried to make a Silverlight 4 application in VS2010 Professional.
When I try and compile my application I get the following error message...
Error 12   F# runtime for Silverlight version v4.0 is not installed. Please go to http://go.microsoft.com/fwlink/?LinkId=177463 to download and install matching..
For the life of me I cannot find the runtime on this page or a place to download it. Does anyone know of the actual URL

A: You can try making one for Silverlight 3, then referencing that from the Silverlight 4 Project.
I know it will let you do that in Visual Studio, Edit: Confirmed to work for a basic function (shown below). However library support will likely be bad (or spotty) due to conflicting versions, but as a stand alone library it should do ok.
module Module1
    let testfunction value =
        value + 1

A: It's not available yet.
"F# Runtime for Silverlight 4" will be included with the RTM release of the "Silverlight 4 Tools for Visual Studio 2010".  I'm not sure exactly when that comes out; sometime in the next month I think maybe.
(In the meantime, you can use Silverlight 3.)

A: I come along 2 years later and try to do this same thing, but see that the provided link still won't setup the F# runtime for me.  I came across this post, Installing F# for Silverlight 4 runtime in VS2010 with SP1, which solved the issue for me.
Relevant detail from the page:

*

*Download the Microsoft Silverlight 4 Tools for Visual Studio 2010

*Don't execute the installer (these tools are already installed by the VS2010 SP1 – but not all of them – see Description of Visual
  Studio 2010 Service Pack 1 and Microsoft Silverlight 4 Tools for
  Visual Studio 2010 and compare the differences)

*Extract the files from the installer and look for the file FSharpRuntimeSL4.msi

*Install the FSharpRuntimeSL4.msi
To validate the installation you can check if the C:\Program Files
  (x86)\Microsoft F#\Silverlight\Libraries\Client\v4.0 folder was
  created or see the you have the Microsoft F# Runtime for Silverlight 4
  version 2.0.0.0 on the list of programs installed.


text:
Q: Transfer data from a TextBox to another TextBox on another page in ASP.NET I'm new in ASP.NET and I have to make a project in ASP.NET Web Application in Visual Studio and database in Microsoft SQL Server for finishing my studies at university.
I tried to transfer data from a TextBox to another TextBox, but in another page and this error appears everytime.
I tried using method with Application[] and Session[], but it doesn't work.
Here is my error:

"System.NullReferenceException: 'Object reference not set to an instance of an object.'"

The code in the first page is :
SqlConnection conn = new SqlConnection("Data Source=LARI-LUCAS;Initial
    Catalog = Licenta_BD; Integrated Security = True");
SqlCommand cmd;

try
{
    cmd = new SqlCommand("insert into Date_studenti_UPT (universitate,facultate,sectie,nume,prenume,gen,an,media,marca,numar) values(@universitate,@facultate,@sectie,@nume,@prenume,@gen,@an,@media,@marca,@numar) ", conn);
    cmd.Parameters.AddWithValue("@universitate", txtUniv.Text);
    cmd.Parameters.AddWithValue("@facultate", txtFac.Text.Trim());
    cmd.Parameters.AddWithValue("@sectie", txtSectie.Text.Trim());
    cmd.Parameters.AddWithValue("@nume", txtNume.Text.Trim());
    cmd.Parameters.AddWithValue("@prenume", txtPrenume.Text.Trim());
    cmd.Parameters.AddWithValue("@gen", txtGen.Text.Trim());
    cmd.Parameters.AddWithValue("@an", txtAn.Text.Trim());
    cmd.Parameters.AddWithValue("@media", txtMedie.Text.Trim());
    cmd.Parameters.AddWithValue("@marca", txtMarca.Text.Trim());
    cmd.Parameters.AddWithValue("@numar", txtNr.Text.Trim());

    int rowsAffected = cmd.ExecuteNonQuery();
    Session["Nume"] = txtNume.Text;
    Session["Prenume"] = txtPrenume.Text;
    Session["Gen"] = txtGen.Text;
    Session["An"] = txtAn.Text;
    Session["Media"] = txtMedie.Text;
    Session["Universitate"] = txtUniv.Text;

    if (rowsAffected == 1)
    {
        conn.Open();
        string url = "Profil.aspx";
        Response.Redirect(url);
    }
    else
        Label12.Text = "Eroare actualizare date utilizator!";
    }
    catch (Exception ex)
    {
        //log error
        Label12.Text = "Eroare la deschidere baza date " + ex.Message;
    }
    finally
    {
        conn.Close();
    }

And for the page 2 is:
protected void Page_Load(object sender, EventArgs e)
{
    txtA.Text = Session["An"].ToString();
    txtG.Text = Session["Gen"].ToString();
    txtM.Text = Session["Media"].ToString();
    txtN.Text = Session["Nume"].ToString();
    txtP.Text = Session["Prenume"].ToString();
    txtUn.Text = Session["Universitate"].ToString();
}

A: I'd use Server.Transfer to redirect to the second page, that way you can call your textbox from page 1 easily.


text:
Q: Lubridate - how to properly parse decimal minutes using parse_date_time Let's say that you have a vector of times in minutes stored as decimal numbers. For this example, I am going to pick 2.5, which means 2 minutes and 30 seconds.
I want to parse this using lubridate's parse_date_time function. However, the output I see is wrong. After running this line:
parse_date_time(2.5, "M:S")

I am getting the following output:
"0000-01-01 00:02:05 UTC"

Instead of expected
"0000-01-01 00:02:30 UTC"

Somehow lubridate doesn't recognize that my .5 doesn't mean 5 seconds, but 30 seconds since two and a half minutes are 2 minutes and 30 seconds and not 2 minutes and 5 seconds.
What is the proper format of the parse_date_time I should use to get the expected output?

A: Here's a base R option :
val <- 2.5
as.POSIXct(val*60, origin = '0000-01-01', tz = 'UTC')
#[1] "0000-01-01 00:02:30 UTC"

A: if you want to use lubridate you can do something like this
library(lubridate)
time <- 2.5
as.period(as.duration(days(x=1))*(time/24))
#[1] "2H 30M 0S"
as.period(as.duration(days(x=1))*(time/1440))
#[1] "2M 30S"


text:
Q: Synchronyze SVN Repository with anonymous user I need to synchronize a svn repository, I know I can do this with svnsync, but the problem is that I need to do the commits to the slave repository with another user, so the svn info on master repository it is not included into the slave but being able to retrieve slave repository changes with svn log/diff.
Is there a way to do this or I have to create a shell script to achive this?
If having to do it with a shell script my idea is the following:
0) create a daily cronjob
1) make a diff of files between master and slave
2) svn add / del of the the different files in the slave
3) rsync master to slave
4) commit all files

A: Vendor branching?
Just mount "master" as external into "slave" and merge


text:
Q: Embedded parameter substitution This is what parameter substitution would be one by one (transforming a picture file name into a date) :
var="2020-12-30 11-30-55CX.mov"
p1=${var:0:11}
pt=${var:11:8}
p2=${pt//-/:}
dt="${p1} ${p2}"

I want to do this in one shot, something like this so exiftool can take it:
dt="${var:0:11} ${${var:11:8}//-/:}"

A: You can't nest expansion operators like that. But you can just work with smaller substrings to get the result you want.
dt="${var:0:11} ${var:11:2}:${var:14:2}:${17:2}"

A: Thanks Barmar for your answer.
I just want to clarify that in the end, as I needed the date-time to be used for the ExifTool, I did not need to do any prior Linux variable substitution as ExifTool had a way to specify whatever date-time format is used in the file name to extract it by using the -d option. So this is what I ended up doing. Note that I didn't even have to remove the ending CX.mov character for ExifTool to get the date-time right:
exiftool -d '%Y-%m-%d $H-%M-%S' \
    '-DateTimeOriginal<${FileName}' \
    '-CreateDate<${FileName}' \
    '-MediaCreateDate<${FileName}' "${file}"


text:
Q: Python crashes when using a static class I'm making my first steps in Python and have come to a point where I need a logging module. The reasons I didn't opt for a rotating file handler are:

*

*I wanted a new folder to be created each time the code is run, hosting the new log files.

*Using conventional filenames (myName_X.log, and not the default myName.log.X).

*Limit log files by number of lines, and not file size (as done by the rotating file handler).

I've written such a module, using Python's built in logging module, but i have two problems:

*

*The new folder and file are created, and the logging data is printed into the file. However, when main() is run for the second time (see code below), the newly created file is locked, and cannot be deleted from the file explorer unless I close the IDE or release the lock through Process Explorer.

*The IPython interpreter freezes the second time I run main(). If I try the pdb module, it freezes as well.

I'm using WinPython 3.3.5 (with Spyder 2.3.0beta). I spent hours trying to find a solution to this problem. I don't know if it is a problem in my code or rather a bug with Spyder.
General coding remarks are always welcome.
main_example.py:
import myLogging

def main():

    try:
        myLoggerInstance = myLogging.MyLogger()

        # Do stuff...

        # logging example
        for i in range(0, 3):
            msg = 'Jose Halapeno on a stick {0}'.format(i)
            myLoggerInstance.WriteLog('DEBUG', msg)
        print('end of prints...')

    finally:
        myLoggerInstance._closeFileHandler()
        print('closed file handle...')

if __name__ == "__main__":
    main()

myLogging.py:
import logging
import time
import os

class MyLogger:
    _linesCounter = 0
    _nNumOfLinesPerFile = 100000
    _fileCounter = 0
    _dirnameBase = os.path.dirname(os.path.abspath(__file__))
    _dirname = ''
    _filenameBase = 'logfile_{0}.log'
    _logger = logging.getLogger('innerGnnLogger')
    _severityDict = {'CRITICAL' : logging.CRITICAL, 'ERROR': logging.ERROR, 'WARNING':
    logging.WARNING, 'INFO': logging.INFO, 'DEBUG': logging.DEBUG}

    @staticmethod
    def __init__():
        # remove file handle
        MyLogger._closeFileHandler()

        # create folder for session
        MyLogger._dirname = MyLogger._dirnameBase + time.strftime("\\logs_%Y_%m_%d-
        %H_%M_%S\\")
        MyLogger._dirname = MyLogger._dirname.replace('\\\\', '/')
        if not os.path.exists(MyLogger._dirname):
            os.makedirs(MyLogger._dirname)

        # set logger
        MyLogger._logger.setLevel(logging.DEBUG)

        # create console handler and set level to debug
        MyLogger._hConsole = logging.StreamHandler()
        MyLogger._hFile = logging.FileHandler(MyLogger._dirname + \
            MyLogger._filenameBase.format(MyLogger._fileCounter))
        MyLogger._hConsole.setLevel(logging.WARNING)
        MyLogger._hFile.setLevel(logging.DEBUG)

        # create formatter
        MyLogger._formatter = logging.Formatter('%(asctime)s %(filename)s, %(funcName)s, %(lineno)s, %(levelname)s: %(message)s')

        # add formatter to handlers
        MyLogger._hConsole.setFormatter(MyLogger._formatter)
        MyLogger._hFile.setFormatter(MyLogger._formatter)

        # add handlers to logger
        MyLogger._logger.addHandler(MyLogger._hConsole)
        MyLogger._logger.addHandler(MyLogger._hFile)

    @staticmethod
    def _StartNewFileHandler():

        MyLogger._closeFileHandler()

        # create new file handler
        ++MyLogger._fileCounter
        MyLogger._hFile = logging.FileHandler(MyLogger._dirname + \
            MyLogger._filenameBase.format(MyLogger._fileCounter))
        MyLogger._hFile.setLevel(logging.DEBUG)
        MyLogger._hFile.setFormatter(MyLogger._formatter)
        MyLogger._logger.addHandler(MyLogger._hFile)

    @staticmethod
    def WriteLog(severity, message):
        if (len(MyLogger._logger.handlers) < 2):
            MyLogger._StartNewFileHandler()
        MyLogger._linesCounter += 1
        MyLogger._logger.log(MyLogger._severityDict[severity], message)
        if (MyLogger._linesCounter >= MyLogger._nNumOfLinesPerFile):
            MyLogger._logger.info('Last line in file')
            MyLogger._StartNewFileHandler()
            MyLogger._linesCounter = 0

    @staticmethod
    def _closeFileHandler():
        if (len(MyLogger._logger.handlers) > 1):
            MyLogger._logger.info('Last line in file')
            MyLogger._logger.handlers[1].stream.close()
            MyLogger._logger.removeHandler(MyLogger._logger.handlers[1])


text:
Q: SQL Correlation error using OVER & PARTITION in SELECT statement I am getting the following error when I am trying to execute my SQL SELECT statement

Could not execute statement.
Correllation name 'contact' not found
SQLCODE=-142, ODBC 3 State"42S02"
Line 1, Column 1

My code is as follows
Select forename, surname, email, quotedate
From ( SELECT  *, ROW_NUMBER() OVER (PARTITION BY tblQuote.contno ORDER BY quoteno DESC) AS rn
FROM dba.quotehdr as tblQuote left join dba.contact as tblContact on tblQuote.contno = tblContact.contno)q
where rn = 1 and quotedate <=today()-720 and emailbounced = 0 and email is not null and dba.contact.statusflag = 'A'
order by quotedate desc

This error only happended when I added in
dba.contact.statusflag = 'A'

I have tried this as
tblContact.statusflag = 'A'

and I get the same error!
Any suggestions?

A: (What about q.statusflag = 'A'  , as it seems you are using q as an Alias.)  This original answer is not correct, amended to:
@Shannon Severance is correct in his comment.  You are trying to use the Where clause on the outer query - which does not contain any fields from the contact table. Let me tidy your query to help you see your subquery (q) - as:
Select
  forename
  ,surname
  ,email
  , quotedate
From
  (
    SELECT
      *
      , ROW_NUMBER() OVER (PARTITION BY tblQuote.contno ORDER BY  quoteno DESC) AS rn
    FROM dba.quotehdr as tblQuote
    left join dba.contact as tblContact on tblQuote.contno = tblContact.contno
  ) q
left join dba.contact as tblContact on q.contno = tblContact.contno
where rn = 1
  and quotedate <=today()-720
  and emailbounced = 0
  and email is not null
  and tblContact.statusflag = 'A' -- Now sourced from last left join

order by quotedate desc

You will need another LEFT JOIN on the dba.contact table to be able to access this field (ADDED NOW as an example).
Also, depending on your database engine - if your field is duplicated in both tables, the SELECT * in a subquery may eject those fields, or rename them, or throw an error.  Run your inner subquery by itself and see what it produces, or use explicit field name instead of *
(I still really think your * in the subquery is causing the error and also the confusion.  Remove it and replace with table.field names - this will help you understand what is going wrong ...Otherwise your query logic is pretty fine, and adding the extra left join that I suggest is overkill)


text:
Q: LEN() formula in Flow Builder not working as expected My formula as seen in the screenshot is not working.
Essentially I'm trying to accomplish "If the length of characters input into this field is greater than 255"

A: The validate input is actually the opposite of a typical validation rule. In this screen, your formula is about denoting whether the input is valid (true) or not (false).

NOTE
The formula expression must return a Boolean value (true or false).

If the formula expression evaluates to true, the input is valid.

If the formula expression evaluates to false, the error message is displayed to the user.

You should look to be doing the inverse of what you're doing in the formula
LEN({!Project_Description}) <= 255


text:
Q: Running c# on HPUX I was wondering if it was possible to run/convert/compile/recompile a small c# program, tasked with invoking a webservice and passing it the usual xml file with, for unix. The unix version if HP ux 11.23(released in 2003).
Wherever I looked for it the only reasonable answer was "mono". However while searching I also came across this: http://www.mono-project.com/Mono:HPUX

Currently only the Mono Interpreter (mint) will work on HPUX. At this time, Mono's JIT does not work with HPUX.

Only thing keeping me screaming I guess is my ignorance on the matter. What would this change for me or keep me from compiling and running my little program?
btw the references I use are:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Serialization;
using System.Net;

Is there any way I can get myself out of this with a "few" bruises, as opposed to completely trashed and with every bone broken?

A: You can still use mono, however you are not able to use the JIT engine. This means that optimizations that run at the interpretation layer don't get run.
Mono has two modes of running JIT and interpreter runtime. The interpreter runtime is created on platforms before the JIT platform since its much much less complicated for the mono team, normally they move away from the interpreter runtime and switch to the JIT runtime, and as soon as that happens the interpreter runtime is no longer supported.
Also consider what you are doing, whilst you think it may be nice and simple, its actually quite a complex task, just looking at your using statements you are not only asking a program to interact with your network card (load drivers, create sockets, do host-name lookups, but are looking to work with anonymised advanced language features of c# 3.0. Theres a lot of backend work that needs to go on for this too work).
I'm sure the Mono team will support hpux eventually, you can get a list of the current supported platforms here

A:
a small c# program, tasked with invoking a webservice and passing it the usual xml file with, for unix

Honestly? Write a simple script in a scripting language supported by your server. It'll save you the loss of quite some blood, sweat and tears.
That is of course, if you've tried it and it doesn't work. If it does: just use Mono.