问:
How to add the different pixels to a new empty bitmap and how to set the different pixels to any chosen color?
When using DiffSetPixel it's adding the different pixels to the new bitmap diffBM when i'm using the second method DiffLockBits it's adding the different pixels to the existing bitmap.

what i want to do is in the first method the DiffSetPixel to be able to add the different pixels to existing bitmap any existing bitmap and not only to the diffBM and in the DiffLockBits i want to add it also to the diffBM.

and in both methods i want to be able to change the different pixels colors for example to red or green or any color and not only grayscale.

DiffSetPixel method

```<code>public static Bitmap DiffSetPixel(Bitmap src1, Bitmap src2, int x1, int y1, int x2, int y2, int width, int height)
        {
            Bitmap diffBM = new Bitmap(width, height, PixelFormat.Format24bppRgb);

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    //Get Both Colours at the pixel point
                    Color col1 = src1.GetPixel(x1 + x, y1 + y);
                    Color col2 = src2.GetPixel(x2 + x, y2 + y);

                    // Get the difference RGB
                    int r = 0, g = 0, b = 0;
                    r = Math.Abs(col1.R - col2.R);
                    g = Math.Abs(col1.G - col2.G);
                    b = Math.Abs(col1.B - col2.B);

                    // Invert the difference average
                    int dif = 255 - ((r + g + b) / 3);

                    // Create new grayscale RGB colour
                    Color newcol = Color.FromArgb(dif,dif,dif);

                    diffBM.SetPixel(x, y, newcol);

                }
            }

            return diffBM;
        }
</code>```

DiffLockBits method

```<code>public static Bitmap DiffLockBits(Bitmap bmp1 , Bitmap bmp2)
        {
            Bitmap diffBM = new Bitmap(bmp1.Width, bmp1.Height, PixelFormat.Format24bppRgb);

            //Lock bitmap's bits to system memory
            Rectangle rect = new Rectangle(0, 0, bmp1.Width, bmp1.Height);
            BitmapData bmpData = bmp1.LockBits(rect, ImageLockMode.ReadWrite, bmp1.PixelFormat);

            Rectangle rect1 = new Rectangle(0, 0, bmp2.Width, bmp2.Height);
            BitmapData bmpData1 = bmp2.LockBits(rect1, ImageLockMode.ReadWrite, bmp2.PixelFormat);

            //Scan for the first line
            IntPtr ptr = bmpData.Scan0;
            IntPtr ptr1 = bmpData1.Scan0;

            //Declare an array in which your RGB values will be stored
            int bytes = Math.Abs(bmpData.Stride) * bmp1.Height;
            byte[] rgbValues = new byte[bytes];

            int bytes1 = Math.Abs(bmpData1.Stride) * bmp2.Height;
            byte[] rgbValues1 = new byte[bytes1];

            //Copy RGB values in that array
            Marshal.Copy(ptr, rgbValues, 0, bytes);

            Marshal.Copy(ptr1, rgbValues1, 0, bytes1);

            for (int i = 0; i < rgbValues.Length; i += 3)
            {
                if (rgbValues[i] != rgbValues1[i])
                {
                    //Set RGB values in a Array where all RGB values are stored
                    byte gray = (byte)(rgbValues[i] * .21 + rgbValues[i + 1] * .71 + rgbValues[i + 2] * .071);
                    rgbValues[i] = rgbValues[i + 1] = rgbValues[i + 2] = gray;
                }
            }

            //Copy changed RGB values back to bitmap
            Marshal.Copy(rgbValues, 0, ptr, bytes);

            //Unlock the bits
            bmp1.UnlockBits(bmpData);

            bmp2.UnlockBits(bmpData1);

            return bmp1;
        }
</code>```

Body:
When using DiffSetPixel it's adding the different pixels to the new bitmap diffBM when i'm using the second method DiffLockBits it's adding the different pixels to the existing bitmap.

what i want to do is in the first method the DiffSetPixel to be able to add the different pixels to existing bitmap any existing bitmap and not only to the diffBM and in the DiffLockBits i want to add it also to the diffBM.

and in both methods i want to be able to change the different pixels colors for example to red or green or any color and not only grayscale.

DiffSetPixel method

public static Bitmap DiffSetPixel(Bitmap src1, Bitmap src2, int x1, int y1, int x2, int y2, int width, int height)
        {
            Bitmap diffBM = new Bitmap(width, height, PixelFormat.Format24bppRgb);

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    //Get Both Colours at the pixel point
                    Color col1 = src1.GetPixel(x1 + x, y1 + y);
                    Color col2 = src2.GetPixel(x2 + x, y2 + y);

                    // Get the difference RGB
                    int r = 0, g = 0, b = 0;
                    r = Math.Abs(col1.R - col2.R);
                    g = Math.Abs(col1.G - col2.G);
                    b = Math.Abs(col1.B - col2.B);

                    // Invert the difference average
                    int dif = 255 - ((r + g + b) / 3);

                    // Create new grayscale RGB colour
                    Color newcol = Color.FromArgb(dif,dif,dif);

                    diffBM.SetPixel(x, y, newcol);

                }
            }

            return diffBM;
        }

DiffLockBits method

public static Bitmap DiffLockBits(Bitmap bmp1 , Bitmap bmp2)
        {
            Bitmap diffBM = new Bitmap(bmp1.Width, bmp1.Height, PixelFormat.Format24bppRgb);

            //Lock bitmap's bits to system memory
            Rectangle rect = new Rectangle(0, 0, bmp1.Width, bmp1.Height);
            BitmapData bmpData = bmp1.LockBits(rect, ImageLockMode.ReadWrite, bmp1.PixelFormat);

            Rectangle rect1 = new Rectangle(0, 0, bmp2.Width, bmp2.Height);
            BitmapData bmpData1 = bmp2.LockBits(rect1, ImageLockMode.ReadWrite, bmp2.PixelFormat);

            //Scan for the first line
            IntPtr ptr = bmpData.Scan0;
            IntPtr ptr1 = bmpData1.Scan0;

            //Declare an array in which your RGB values will be stored
            int bytes = Math.Abs(bmpData.Stride) * bmp1.Height;
            byte[] rgbValues = new byte[bytes];

            int bytes1 = Math.Abs(bmpData1.Stride) * bmp2.Height;
            byte[] rgbValues1 = new byte[bytes1];

            //Copy RGB values in that array
            Marshal.Copy(ptr, rgbValues, 0, bytes);

            Marshal.Copy(ptr1, rgbValues1, 0, bytes1);

            for (int i = 0; i < rgbValues.Length; i += 3)
            {
                if (rgbValues[i] != rgbValues1[i])
                {
                    //Set RGB values in a Array where all RGB values are stored
                    byte gray = (byte)(rgbValues[i] * .21 + rgbValues[i + 1] * .71 + rgbValues[i + 2] * .071);
                    rgbValues[i] = rgbValues[i + 1] = rgbValues[i + 2] = gray;
                }
            }

            //Copy changed RGB values back to bitmap
            Marshal.Copy(rgbValues, 0, ptr, bytes);

            //Unlock the bits
            bmp1.UnlockBits(bmpData);

            bmp2.UnlockBits(bmpData1);

            return bmp1;
        }


来源: stackexchange

问:
2's complement of 2 bit numbers
I was learning logic system Design and came across 2's complement. So I had a doubt what is the 2's complement of 00 or any other 2 bit numbers. I couldn't find any answers on the internet.</p>

ContentLicense: CC BY-SA 4.0

Title: 2's complement of 2 bit numbers


问:
How to GetActiveObject of AdobeReader Acrobat or CAcroApp using Interop?
```<code>_acroApp = (CAcroApp)Marshal.GetActiveObject("Acrobat.Application");
Debug.WriteLine("Output : " + _acroApp + " , Thread Id : " +
                Thread.CurrentThread.ManagedThreadId);

// Problem Exception That I Got
Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

</code>```
```<code>_acroApp = (CAcroApp)Marshal.GetActiveObject("AcroExch.App");
Debug.WriteLine("Output : " + _acroApp + " , Thread Id : " +
                Thread.CurrentThread.ManagedThreadId);

</code>```

Still I get problem.
I need to get GetActiveObject  of Acrobat from process table Or ROT Table?

Body:
_acroApp = (CAcroApp)Marshal.GetActiveObject("Acrobat.Application");
Debug.WriteLine("Output : " + _acroApp + " , Thread Id : " +
                Thread.CurrentThread.ManagedThreadId);

// Problem Exception That I Got
Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

_acroApp = (CAcroApp)Marshal.GetActiveObject("AcroExch.App");
Debug.WriteLine("Output : " + _acroApp + " , Thread Id : " +
                Thread.CurrentThread.ManagedThreadId);

Still I get problem.
I need to get GetActiveObject  of Acrobat from process table Or ROT Table?


问:
Error while writing container response in Jersey 2.x Application
I'm getting compilation error in code for writing container response in my jersey application.
I have posted the code below, is anyone can help me ?
Im using Jersey 2.37
Thanks

```<code>ContainerResponseWriter filter(ContainerRequest request, ContainerResponseWriter response){
response.setContainerResponseWritter(new Adaptor(response.getContainerResponseWritter()));
</code>```

}

error:incompatable types:ContainerResponse cannot be converted to ContainerResponseWriter

Body:
I'm getting compilation error in code for writing container response in my jersey application.
I have posted the code below, is anyone can help me ?
Im using Jersey 2.37
Thanks

ContainerResponseWriter filter(ContainerRequest request, ContainerResponseWriter response){
response.setContainerResponseWritter(new Adaptor(response.getContainerResponseWritter()));

}

error:incompatable types:ContainerResponse cannot be converted to ContainerResponseWriter


问:
Javascript (function (){})() closure
Can any one explain why this happens?

```<code>// Example 1
(function () {
    var a = b = 5;
})();

console.log(b); // Output 5
</code>```

var a = b = 5 and var b = 5 is totally different?

Title: Javascript (function (){})() closure

Body:
Can any one explain why this happens?

// Example 1
(function () {
    var a = b = 5;
})();

console.log(b); // Output 5

var a = b = 5 and var b = 5 is totally different?


问:
Unity Physics2D.OverlapBox is always returning true
I am trying to do ground detection for a 2d platformer, but my physics check is always returning true. I am reusing code that I have used a many times before:

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    [Header("MOVEMENT")]
    public float speed;
    float inputX;

    [Header("JUMPING")]
    public float jumpForce;
    public Transform feet;
    public Vector2 checkSize;
    public bool isGrounded;
    public LayerMask layers;

    public int extraJumps = 1;
    int jumpTracker;

    private Rigidbody2D rb;

    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        inputX = Input.GetAxisRaw("Horizontal");

        isGrounded = Physics2D.OverlapBox(feet.position, checkSize, 0f, layers);
        if(Input.GetKeyDown(KeyCode.Space))
        {
            if (isGrounded)
            {
                rb.velocity = new Vector2(rb.velocity.x, jumpForce);
                jumpTracker = extraJumps;
            }
            else
            {
                if(jumpTracker > 0)
                {
                    rb.velocity = new Vector2(rb.velocity.x, jumpForce);
                    jumpTracker--;
                }
            }
        }
    }

    private void FixedUpdate()
    {
        rb.velocity = new Vector2(inputX * speed, rb.velocity.y);
    }

    private void OnDrawGizmos()
    {
        Gizmos.DrawWireCube(feet.position, checkSize);
    }
}

</code>```

In the scene there is a Tilemap with a composite collider tagged as ground that the player is colliding with.

I have tried everything I can think of and still have no idea what is causing this issue. Any help would be greatly appreciated.

Body:
I am trying to do ground detection for a 2d platformer, but my physics check is always returning true. I am reusing code that I have used a many times before:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    [Header("MOVEMENT")]
    public float speed;
    float inputX;

    [Header("JUMPING")]
    public float jumpForce;
    public Transform feet;
    public Vector2 checkSize;
    public bool isGrounded;
    public LayerMask layers;

    public int extraJumps = 1;
    int jumpTracker;

    private Rigidbody2D rb;

    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        inputX = Input.GetAxisRaw("Horizontal");

        isGrounded = Physics2D.OverlapBox(feet.position, checkSize, 0f, layers);
        if(Input.GetKeyDown(KeyCode.Space))
        {
            if (isGrounded)
            {
                rb.velocity = new Vector2(rb.velocity.x, jumpForce);
                jumpTracker = extraJumps;
            }
            else
            {
                if(jumpTracker > 0)
                {
                    rb.velocity = new Vector2(rb.velocity.x, jumpForce);
                    jumpTracker--;
                }
            }
        }
    }

    private void FixedUpdate()
    {
        rb.velocity = new Vector2(inputX * speed, rb.velocity.y);
    }

    private void OnDrawGizmos()
    {
        Gizmos.DrawWireCube(feet.position, checkSize);
    }
}

In the scene there is a Tilemap with a composite collider tagged as ground that the player is colliding with.

I have tried everything I can think of and still have no idea what is causing this issue. Any help would be greatly appreciated.


问:
AxiosError: Request failed with status code 415
Why do i get this kind of error when trying to send a post request using axios
Here is the code:

```<code>const params = ({
    "username": username,
    "password": password,
    "firstname": fname,
    "middlename": mname,
    "lastname": lname,
    "address": address,
    "contactnumber": parseInt(contact)
});

function newUser() {
    axios.post("http://localhost:8080/citizen/postCitizen", params,{
        "headers": {
            "content-type": "application/json"
        },
        })
        .then((response)=>{
            console.log(response.data)
        })
        .catch((error)=>{
            console.log(error)
        })
    console.log(params)
}
</code>```

Here is the error in the console:

Body:
Why do i get this kind of error when trying to send a post request using axios
Here is the code:

const params = ({
    "username": username,
    "password": password,
    "firstname": fname,
    "middlename": mname,
    "lastname": lname,
    "address": address,
    "contactnumber": parseInt(contact)
});

function newUser() {
    axios.post("http://localhost:8080/citizen/postCitizen", params,{
        "headers": {
            "content-type": "application/json"
        },
        })
        .then((response)=>{
            console.log(response.data)
        })
        .catch((error)=>{
            console.log(error)
        })
    console.log(params)
}

Here is the error in the console:


问:
How to get rid of empty space when trying to insert a view flush to navigation bar, while simultaneously assigning navigation view a background color
To my knowledge, the only way to assign a navigation bar a background color that is separate from the rest of the screen, you set the background color to whatever object you have flush with the navigation view. (In this case, its a divider with the background set to red)

My intention is to then place a view flush to the divider in an attempt to create some sort of "subtitle view". The problem is, as you can see, there is a space between my Stack and my Divider... I'm not sure what is causing this space and I am not sure how to get rid of it.

My first thought was, perhaps there is some safe area being adhered to... That said, I tried ignoring that, but that didn't work.

```<code>    struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                Divider()
                    .background(.red)
                    .navigationTitle("Main Title")
                // There is a space here
                ZStack {
                    Rectangle().frame(height: 35)
                    Text("Subtitle View")
                        .foregroundColor(.white)
                }.edgesIgnoringSafeArea([.top, .bottom])
                Spacer()
            }.background(.blue)
        }
    }
}
</code>```

Body:
To my knowledge, the only way to assign a navigation bar a background color that is separate from the rest of the screen, you set the background color to whatever object you have flush with the navigation view. (In this case, its a divider with the background set to red)

My intention is to then place a view flush to the divider in an attempt to create some sort of "subtitle view". The problem is, as you can see, there is a space between my Stack and my Divider... I'm not sure what is causing this space and I am not sure how to get rid of it.

My first thought was, perhaps there is some safe area being adhered to... That said, I tried ignoring that, but that didn't work.

    struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                Divider()
                    .background(.red)
                    .navigationTitle("Main Title")
                // There is a space here
                ZStack {
                    Rectangle().frame(height: 35)
                    Text("Subtitle View")
                        .foregroundColor(.white)
                }.edgesIgnoringSafeArea([.top, .bottom])
                Spacer()
            }.background(.blue)
        }
    }
}


问:
About Android File permission
I want to read This directory's file data（file of about 80MB）

```<code>/storage/emulated/0/Download/Record_test.mp4
</code>```

But when using File.length() Function, It returns "0", I can't understand it. Because of I have declared the relevant permission.

```<code><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</code>```

Title: About Android File permission

Body:
I want to read This directory's file data（file of about 80MB）

/storage/emulated/0/Download/Record_test.mp4

But when using File.length() Function, It returns "0", I can't understand it. Because of I have declared the relevant permission.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


问:
displaying domain's NS in Vue client project
I have created an input and button in my project. the user is supposed to enter domain name and get its NS by clicking on button through a node JS function that returns nameserver.

getNs.js file in @/plugins/

```<code>export function getNs(domain) {
  const dns = require('node:dns');
  const dnsPromises = dns.promises;
  const options = {
   family: 6,
   hints: dns.ADDRCONFIG | dns.V4MAPPED,
 };

 options.all = true;
  dnsPromises.resolveNs(domain, options).then((result) => {
  console.log('addresses: %j', result);
  return result
 });
}
</code>```

declaring function in component script:

importing the plugin:

```<code>import {getIp} from "~/services/displayIp";
</code>```

in methods:

```<code>goToSecondStep() {
  getIp()
}
</code>```

the event is happening on the button:

```<code>@click="goToSecondStep"
</code>```

the error i get:
This dependency was not found:                                                                                friendly-errors 09:54:39
friendly-errors 09:54:39

node:dns in ./services/displayIp.js                                                                                friendly-errors 09:54:39
friendly-errors 09:54:39
To install it, you can run: npm install --save node:dns

i get the same error even though i run npm install --save node:dns command.

how can i use node js function or plugins in vuejs temeplates.

Body:
I have created an input and button in my project. the user is supposed to enter domain name and get its NS by clicking on button through a node JS function that returns nameserver.

getNs.js file in @/plugins/

export function getNs(domain) {
  const dns = require('node:dns');
  const dnsPromises = dns.promises;
  const options = {
   family: 6,
   hints: dns.ADDRCONFIG | dns.V4MAPPED,
 };

 options.all = true;
  dnsPromises.resolveNs(domain, options).then((result) => {
  console.log('addresses: %j', result);
  return result
 });
}

declaring function in component script:

importing the plugin:

import {getIp} from "~/services/displayIp";

in methods:

goToSecondStep() {
  getIp()
}

the event is happening on the button:

@click="goToSecondStep"

the error i get:
This dependency was not found:                                                                                friendly-errors 09:54:39
friendly-errors 09:54:39

node:dns in ./services/displayIp.js                                                                                friendly-errors 09:54:39
friendly-errors 09:54:39
To install it, you can run: npm install --save node:dns

i get the same error even though i run npm install --save node:dns command.

how can i use node js function or plugins in vuejs temeplates.


问:
The results of GA4 queries in Biguery are not same on the same GA platform displayed
After tracking on Firebase and integrate it with Google Analytics 4. And then storage data to Bigquery.
But I can not query data of GA4 table to the results same as GA4 platform.
GA4 display:
GA4 platform

Bigquery results:
Query GA4 schema

I need to query data of GA4 table to the results same as GA4 platform. How? Please help me

https://developers.google.com/analytics/bigquery/basic-queries
https://www.ga4bigquery.com/user-dimensions-metrics-ga4/


问:
Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
```<code>
  Failed startup of context o.e.j.w.WebAppContext@2b474e19{/application,file:///private/var/folders/m6/1hhw77gs0cb4b843wsk_1pn00000gr/T/jetty-0_0_0_0-8081-application-5_2_6_war-application-any-2769690816992481852/webapp/,UNAVAILABLE}{./webapps/application-5.2.6.war}
    javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-494bace6==org.glassfish.jersey.servlet.ServletContainer@18497314{jsp=null,order=1,inst=true,async=true,src=EMBEDDED:null,STARTED}
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:650)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:415)
    at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731)
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
    at org.eclipse.jetty.server.Server.start(Server.java:423)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
    at org.eclipse.jetty.server.Server.doStart(Server.java:387)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
    at one.card.jetty.Jetty.startService(Jetty.java:61)
    at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:137)
    at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:276)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.jpos.q2.QFactory.startQBean(QFactory.java:176)
    at org.jpos.q2.Q2.start(Q2.java:633)
    at org.jpos.q2.Q2.deploy(Q2.java:418)
    at org.jpos.q2.Q2.run(Q2.java:267)
    at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at java.lang.Class.cast(Class.java:3397)
    at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
    at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
    at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
    at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:69)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:282)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:335)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:370)
    at javax.servlet.GenericServlet.init(GenericServlet.java:203)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632)
    ... 44 common frames omitted

</code>```

Failed to start the application error. current version of Jersey is 2.31. I have tried updating jersey version also, but still facing issue. I am not able to progress, and not sure what needs to be done to remove this error. I have verified the war file and its available there.

Body:
  Failed startup of context o.e.j.w.WebAppContext@2b474e19{/application,file:///private/var/folders/m6/1hhw77gs0cb4b843wsk_1pn00000gr/T/jetty-0_0_0_0-8081-application-5_2_6_war-application-any-2769690816992481852/webapp/,UNAVAILABLE}{./webapps/application-5.2.6.war}
    javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-494bace6==org.glassfish.jersey.servlet.ServletContainer@18497314{jsp=null,order=1,inst=true,async=true,src=EMBEDDED:null,STARTED}
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:650)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:415)
    at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731)
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
    at org.eclipse.jetty.server.Server.start(Server.java:423)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
    at org.eclipse.jetty.server.Server.doStart(Server.java:387)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
    at one.card.jetty.Jetty.startService(Jetty.java:61)
    at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:137)
    at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:276)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.jpos.q2.QFactory.startQBean(QFactory.java:176)
    at org.jpos.q2.Q2.start(Q2.java:633)
    at org.jpos.q2.Q2.deploy(Q2.java:418)
    at org.jpos.q2.Q2.run(Q2.java:267)
    at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at java.lang.Class.cast(Class.java:3397)
    at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
    at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
    at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
    at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:69)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:282)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:335)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:370)
    at javax.servlet.GenericServlet.init(GenericServlet.java:203)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632)
    ... 44 common frames omitted

Failed to start the application error. current version of Jersey is 2.31. I have tried updating jersey version also, but still facing issue. I am not able to progress, and not sure what needs to be done to remove this error. I have verified the war file and its available there.


问:
What is the difference between slicing the rows and fetching the column, versus fetching the column and slicing the rows?
What is the difference between the following approaches to get the rows from a column of df, a pandas DataFrame :

df['col_name'][x:y]

vs.

df.loc[x:y,'col_name']


问:
Can Cranelift or LLVM IRs be used to develop a simple OS from scratch?
I am curious if I can develop my own programming language to output Cranelift or LLVM IRs, then use it to make a simple OS from scratch?

Specifically, do the instruction sets of Cranelift/LLVM IRs contain OS-level IO instructions?

Thank you.


问:
Problems with texture when I import .glb file. My whole scene looks over illuminated but there are no lights?
Total noob here and I cant seem to get through this here. I have tested the glb file in several other viewers and it looks normal. In the three.js editor it also looks perfect. When I actually import it on my site it gets this weird color, there are also no lights on my scene so even more confusing!! You can somewhat see the HDRI I put w/  (from react-three/drei) [On Three.js Editor]in Browser on Site

```<code>
import {Canvas} from "@react-three/fiber"
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import { useEffect, useState, Suspense } from "react";
import {useLoader} from "@react-three/fiber"
import {GLTFLoader} from "three/examples/jsm/loaders/GLTFLoader"
import { useThree } from "@react-three/fiber";
import logo from "./jellyBallLogo.png"
import Model from "./Model";
import { Environment } from "@react-three/drei";
import { TextureLoader } from "three/src/loaders/TextureLoader";

function App() {
  const [env, setEnv] = useState(null)
  useEffect(()=>{
    setEnv(<Environment files={"./rainForest.hdr"} />)
  }, [])

  return (
    <Suspense fallback={<div>Heyo</div>}>
      <Canvas>
          {env}
          <Model/>
      </Canvas>
      <img src={logo}/>
    </Suspense>

  );
}

`export default App;

import { useLoader } from "@react-three/fiber"
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"
import {useGLTF} from "@react-three/drei"
import { useEffect, useRef, useState} from "react"

export default function Model(){
    const [scene, setScene] = useState(null)

    let result =useLoader(GLTFLoader, "./moreOrbeezDoubled.glb")
    useEffect(()=>{
        console.log("rendered")
    })

    return <primitive object={result.scene}/>

}`

</code>```

I Set the Used the helper from Drei and set up a cubemap on environment with my HDRI.

Body:
Total noob here and I cant seem to get through this here. I have tested the glb file in several other viewers and it looks normal. In the three.js editor it also looks perfect. When I actually import it on my site it gets this weird color, there are also no lights on my scene so even more confusing!! You can somewhat see the HDRI I put w/  (from react-three/drei) [On Three.js Editor]in Browser on Site

import {Canvas} from "@react-three/fiber"
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import { useEffect, useState, Suspense } from "react";
import {useLoader} from "@react-three/fiber"
import {GLTFLoader} from "three/examples/jsm/loaders/GLTFLoader"
import { useThree } from "@react-three/fiber";
import logo from "./jellyBallLogo.png"
import Model from "./Model";
import { Environment } from "@react-three/drei";
import { TextureLoader } from "three/src/loaders/TextureLoader";

function App() {
  const [env, setEnv] = useState(null)
  useEffect(()=>{
    setEnv(<Environment files={"./rainForest.hdr"} />)
  }, [])

  return (
    <Suspense fallback={
Heyo
}>
      <Canvas>
          {env}
          <Model/>
      </Canvas>

    </Suspense>

  );
}

`export default App;

import { useLoader } from "@react-three/fiber"
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"
import {useGLTF} from "@react-three/drei"
import { useEffect, useRef, useState} from "react"

export default function Model(){
    const [scene, setScene] = useState(null)

    let result =useLoader(GLTFLoader, "./moreOrbeezDoubled.glb")
    useEffect(()=>{
        console.log("rendered")
    })

    return <primitive object={result.scene}/>

}`

I Set the Used the helper from Drei and set up a cubemap on environment with my HDRI.


问:
how to access a element which is creating using createElement() out side a function in javascript
```<code>const addTaskBtn = document.getElementById("add-task-btn")
const taskFieldEl = document.getElementById("addTask")
const ul = document.getElementById("task-list")
const para = document.getElementById("demo")

addTaskBtn.addEventListener("click", function () {
    // listItem = `
    // <li>
    // <input type="text">
    // </li>`
    // taskListEl.innerHTML = listItem

    //creating new elements when click on addTaskBtn
    let list = document.createElement("li")
    let span = document.createElement("span")
    let inputEl = document.createElement("input")
    let deleteBtn = document.createElement("button")
    let deleteBtnText = document.createTextNode("delete")
    deleteBtn.className = "myDelBtn"

    //adding text of taskfieldel to the inputEl
    inputEl.value = taskFieldEl.value
    taskFieldEl.value = ""

    //append all element to each other and lastly in the ul
    deleteBtn.appendChild(deleteBtnText)
    span.appendChild(inputEl)
    span.appendChild(deleteBtn)
    list.appendChild(span)
    ul.appendChild(list)
})
</code>```
```<code>document.querySelector(".myDelBtn").addEventListener("click", function () {
    console.log("hello")
    document.getElementById("demo").innerHTML = "hello i am working"
})
</code>```

i want to acces deleteBtn element which i created using createElement() dynamically out side the function i wrote this to access the element through className also i tried using id but its not working...

please help me in this

Body:
const addTaskBtn = document.getElementById("add-task-btn")
const taskFieldEl = document.getElementById("addTask")
const ul = document.getElementById("task-list")
const para = document.getElementById("demo")

addTaskBtn.addEventListener("click", function () {
    // listItem = `
    //

    // <input type="text">
    //
`
    // taskListEl.innerHTML = listItem

    //creating new elements when click on addTaskBtn
    let list = document.createElement("li")
    let span = document.createElement("span")
    let inputEl = document.createElement("input")
    let deleteBtn = document.createElement("button")
    let deleteBtnText = document.createTextNode("delete")
    deleteBtn.className = "myDelBtn"

    //adding text of taskfieldel to the inputEl
    inputEl.value = taskFieldEl.value
    taskFieldEl.value = ""

    //append all element to each other and lastly in the ul
    deleteBtn.appendChild(deleteBtnText)
    span.appendChild(inputEl)
    span.appendChild(deleteBtn)
    list.appendChild(span)
    ul.appendChild(list)
})

document.querySelector(".myDelBtn").addEventListener("click", function () {
    console.log("hello")
    document.getElementById("demo").innerHTML = "hello i am working"
})

i want to acces deleteBtn element which i created using createElement() dynamically out side the function i wrote this to access the element through className also i tried using id but its not working...

please help me in this


问:
Insert to hive tables with a lot of files
I'm new with Hive tables.
I have two Hive tables,
I figured out that inserting files to hive table with a lot of files takes longer than inserting to hive table with less files.
I'm trying to understand what the reason and I have no idea.</p>


问:
How can I bind a ppt textbox value to an excel cell?
Just like we do it in excel, reference value of another cell in current cell.

How can I do this in powerpoint shape/textbox by using office-js or legacy office interop.

I can create powerpoint slide from a template if type "=A1" in textbox and replace it by data from excel and generate a new slide, but I do not know how to link it to worksheet and update it when the origin cell changes.


问:
Is there any purpose of using loc or iloc when filtering the dataframe?
Taking into account the following:

```<code>df[df.B == 9]
</code>```

vs

```<code>df.loc[df.B == 9]
</code>```

I understand that 1st is syntactic sugar for the 2nd.

Generally we use loc or iloc when we need to work with label or index respectively.

However, as shown in the above examples when we are filtering the dataframe, there doesn't seen to be a use case of choosing between loc vs iloc. Is that correct?

Body:
Taking into account the following:

df[df.B == 9]

vs

df.loc[df.B == 9]

I understand that 1st is syntactic sugar for the 2nd.

Generally we use loc or iloc when we need to work with label or index respectively.

However, as shown in the above examples when we are filtering the dataframe, there doesn't seen to be a use case of choosing between loc vs iloc. Is that correct?


问:
Compare large excel sheets
I have two excel files with one column but a large number of different cells in each file - between 5,000-10,000. I want to run a comparison between the two files to show me duplicates, and I can't seem to find how to do that efficiantly.

Any ideas?

Title: Compare large excel sheets


问:
C#: Http Get behavior varies in different LAN
I started an HTTP server in a local area network from C# as:

```<code>HttpListener listener = new HttpListener();
listener.Prefixes.Add(url);
listener.Start();
</code>```

In another thread, it sends response as:

```<code>HttpListenerContext context = listener.GetContext();
context.Response.StatusCode = 200;
using (StreamWriter writer = new StreamWriter(context.Response.OutputStream)) {
    writer.WriteLine(responseJson);
}
</code>```

And in my client code, Http request is sent and processed as:

```<code>HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string result = await response.Content.ReadAsStringAsync();
</code>```

This server-client application works well in one LAN. But after I copied the application to another machine in another LAN, the last line of client code (await response result) got error " The input was not in a correct format". I really have no idea what it is about. I visited the server url from web browser, the correct response could be retrieved. So this is more likely to be a client-side issue, I guess.

Any help is appreciate.

Body:
I started an HTTP server in a local area network from C# as:

HttpListener listener = new HttpListener();
listener.Prefixes.Add(url);
listener.Start();

In another thread, it sends response as:

HttpListenerContext context = listener.GetContext();
context.Response.StatusCode = 200;
using (StreamWriter writer = new StreamWriter(context.Response.OutputStream)) {
    writer.WriteLine(responseJson);
}

And in my client code, Http request is sent and processed as:

HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string result = await response.Content.ReadAsStringAsync();

This server-client application works well in one LAN. But after I copied the application to another machine in another LAN, the last line of client code (await response result) got error " The input was not in a correct format". I really have no idea what it is about. I visited the server url from web browser, the correct response could be retrieved. So this is more likely to be a client-side issue, I guess.

Any help is appreciate.


问:
Flutter Rotate Painter from TopRight
I had an SVG in Adobe Illustrator that I converted to CustomPaint class using [FlutterShapeMaker][1]

I want to rotate it from the TopRight point as a fixed axis but the axis it's rotating doesn't change fixed.

Title: Flutter Rotate Painter from TopRight


问:
Database persistence in ECS Fargate
We are running a MongoDB container in ECS Fargate. The ECS services starts up fine and database is accessible.

But how do I make it persistent as we all know that container storage is ephemeral? I have tried to mount efs file system following AWS documentation. The service gets created and the task runs fine but I am unable to access the database anymore. As in, I am unable to even login.

As far as EFS goes, I have tried both versions - unencrypted as well as encrypted.

My Task definition for MongoDB is as follows: (have removed the part where username and password parameters are passed)

```<code>{
    "taskDefinitionArn": "arn:aws:ecs:us-east-2:1234567890:task-definition/mongo_efs_test_1215:2",
    "containerDefinitions": [
        {
            "name": "mongo_efs_container_1215",
            "image": "public.ecr.aws/docker/library/mongo:latest",
            "cpu": 0,
            "portMappings": [
                {
                    "containerPort": 27017,
                    "hostPort": 27017,
                    "protocol": "tcp"
                }
            ],
            "essential": true,
            "entryPoint": [],
            "command": [],
            "environment": [],
            "mountPoints": [
                {
                    "sourceVolume": "efs-disk",
                    "containerPath": "/data/db"
                }
            ],
            "volumesFrom": [],
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-group": "/ecs/mongo_efs_test_1215",
                    "awslogs-region": "us-east-2",
                    "awslogs-stream-prefix": "ecs"
                }
            }
        }
    ],
    "family": "mongo_efs_test_1215",
    "taskRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole",
    "executionRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole",
    "networkMode": "awsvpc",
    "revision": 2,
    "volumes": [
        {
            "name": "efs-disk",
            "efsVolumeConfiguration": {
                "fileSystemId": "fs-dvveweo837af981fa",
                "rootDirectory": "/",
                "transitEncryption": "DISABLED",
                "authorizationConfig": {
                    "iam": "DISABLED"
                }
            }
        }
    ],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "ecs.capability.efsAuth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "ecs.capability.efs"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
        },
        {
            "name": "ecs.capability.task-eni"
        }
    ],
    "placementConstraints": [],
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "256",
    "memory": "512",
    "runtimePlatform": {
        "operatingSystemFamily": "LINUX"
    },
    "registeredAt": "2022-12-15T12:06:34.477Z",
    "registeredBy": "arn:aws:iam::1234567890:root",
    "tags": []
}
</code>```

Can someone please guide me? I am struggling with this for a really long time. Any help is really appreciated.

Thank you.

Title: Database persistence in ECS Fargate

Body:
We are running a MongoDB container in ECS Fargate. The ECS services starts up fine and database is accessible.

But how do I make it persistent as we all know that container storage is ephemeral? I have tried to mount efs file system following AWS documentation. The service gets created and the task runs fine but I am unable to access the database anymore. As in, I am unable to even login.

As far as EFS goes, I have tried both versions - unencrypted as well as encrypted.

My Task definition for MongoDB is as follows: (have removed the part where username and password parameters are passed)

{
    "taskDefinitionArn": "arn:aws:ecs:us-east-2:1234567890:task-definition/mongo_efs_test_1215:2",
    "containerDefinitions": [
        {
            "name": "mongo_efs_container_1215",
            "image": "public.ecr.aws/docker/library/mongo:latest",
            "cpu": 0,
            "portMappings": [
                {
                    "containerPort": 27017,
                    "hostPort": 27017,
                    "protocol": "tcp"
                }
            ],
            "essential": true,
            "entryPoint": [],
            "command": [],
            "environment": [],
            "mountPoints": [
                {
                    "sourceVolume": "efs-disk",
                    "containerPath": "/data/db"
                }
            ],
            "volumesFrom": [],
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-group": "/ecs/mongo_efs_test_1215",
                    "awslogs-region": "us-east-2",
                    "awslogs-stream-prefix": "ecs"
                }
            }
        }
    ],
    "family": "mongo_efs_test_1215",
    "taskRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole",
    "executionRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole",
    "networkMode": "awsvpc",
    "revision": 2,
    "volumes": [
        {
            "name": "efs-disk",
            "efsVolumeConfiguration": {
                "fileSystemId": "fs-dvveweo837af981fa",
                "rootDirectory": "/",
                "transitEncryption": "DISABLED",
                "authorizationConfig": {
                    "iam": "DISABLED"
                }
            }
        }
    ],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "ecs.capability.efsAuth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "ecs.capability.efs"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
        },
        {
            "name": "ecs.capability.task-eni"
        }
    ],
    "placementConstraints": [],
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "256",
    "memory": "512",
    "runtimePlatform": {
        "operatingSystemFamily": "LINUX"
    },
    "registeredAt": "2022-12-15T12:06:34.477Z",
    "registeredBy": "arn:aws:iam::1234567890:root",
    "tags": []
}

Can someone please guide me? I am struggling with this for a really long time. Any help is really appreciated.

Thank you.


问:
Google Sheet chart cuts off while embedding iframe in wordpress
I have some Line graphs created in Google Spreadsheets. While embedding the graph in WordPress pages, the graphs cut off on the mobile. But on the Desktop, the full chart is displayed.

I am very new to this and have not been able to get any solution. Any thoughts/ideas/solutions will be really appreciated.


问:
how to for loop data from localStorage nuxtjs
this my code previously

{{ item.name }}

```
<pre class="lang-js prettyprint-override"><code>export default {
  layout: 'main',
  async asyncData({ $axios }) {
    const data = await $axios.$get('XXXXXXXXXXXXXXXXXXXXX');
    return { data };
  }
}
</code>```

this can work but when i change the page and turnback to this page

axios send request again i need one time request and save data response to cache (localStorage)

now i try this code

export default {
  layout: 'main',
  mounted() {
    this.starter()
  },
  methods: {
    starter() {
      let room = JSON.parse(localStorage.getItem('game_room'))
      if (!room) {
        fetch('XXXXXXXXXXXXXXXXXXXXX')
          .then(res => res.json())
          .then(json => {
            localStorage.setItem('game_room', JSON.stringify(json))
            let room = JSON.parse(localStorage.getItem('game_room'));
            console.log('Response ', room.data[0].title)
          });
      } else {
        console.log('Caching ', room.data[0].title)
      }
    }
  }
}
```

now this response data save to localStorage but i dont know how to use data to v-for like the my code previously

Body:
this my code previously

{{ item.name }}

export default {
  layout: 'main',
  async asyncData({ $axios }) {
    const data = await $axios.$get('XXXXXXXXXXXXXXXXXXXXX');
    return { data };
  }
}

this can work but when i change the page and turnback to this page

axios send request again i need one time request and save data response to cache (localStorage)

now i try this code

export default {
  layout: 'main',
  mounted() {
    this.starter()
  },
  methods: {
    starter() {
      let room = JSON.parse(localStorage.getItem('game_room'))
      if (!room) {
        fetch('XXXXXXXXXXXXXXXXXXXXX')
          .then(res => res.json())
          .then(json => {
            localStorage.setItem('game_room', JSON.stringify(json))
            let room = JSON.parse(localStorage.getItem('game_room'));
            console.log('Response ', room.data[0].title)
          });
      } else {
        console.log('Caching ', room.data[0].title)
      }
    }
  }
}

now this response data save to localStorage but i dont know how to use data to v-for like the my code previously


问:
add path to file zshrc
How can I add the path address of Flutter and Android in the zshrc file? (on Mac)
To run the application (android or flutter) on the phone

I added both addresses manually, but it always understands only one of them

Title: add path to file zshrc


问:
how to detect a long jump pit by keeping four markers in the corner of the pit and then calculate the dimensions of the pit
markers are placed in the 4 corners of the pit. by detecting the markers and by giving the known height, focal length of the camera how to find the boundary length and breadth from the camera

detect 4 markers have been done. BUT to find the dimensions


问:
How to organize routes involving multiple collections / resources?
Supposed that my MongoDB database has 2 collectoins:

```<code>users
posts
</code>```

For any query just involving one of the collections, they will be handled in the routes

```<code>api/users/do_stuff
api/posts/do_stuff
</code>```

What is the standard way to organize queries that will involve both collections? Either updating both collections or requiring data from both collections in order to generate a response for the client? What routes should these queries fall under?

Body:
Supposed that my MongoDB database has 2 collectoins:

users
posts

For any query just involving one of the collections, they will be handled in the routes

api/users/do_stuff
api/posts/do_stuff

What is the standard way to organize queries that will involve both collections? Either updating both collections or requiring data from both collections in order to generate a response for the client? What routes should these queries fall under?


问:
Tensorflow-Text in Miniconda
I am trying to install tensorflow-text through miniconda in Spyder. I have managed to install other modules in Spyder such as tensorflow itself, pandas, scikit-learn, etc. However, using the same command as all the other installations (with the specific package name replaced by tensorflow-text)

```<code>conda install spyder-kernels tensorflow-text -y
</code>```

I continue to get the same error whenever I try to install tensorflow-text:

```<code>PackagesNotFoundError: The following packages are not available from current channels:
  - tensorflow-text
</code>```

followed by a suggestion to search for the package on anaconda.org. As such, I searched for the tensorflow-text package on the anaconda site and found one, albeit for linux, by rocketce. Attempting to run the commands listed under the tensorflow-text installation instructions on that webpage also yielded the same error.

At first, I tried to install tensorflow-text through pip and was able to successfully run the command

```<code>pip install -U tensorflow-text==2.10.0
</code>```

which seemed to install tensorflow-text. But I could not figure out how to access it or if it was correctly installed. Specifically, I am looking to use tensorflow-text in the Spyder IDE. I was able to get tensorflow working in the IDE, but not the specific tensorflow-text.

I am using a Windows 10 system; I could not find anything on the anaconda site for Windows 10. I am rather inexperienced (if you could not already tell from the nature and description of the problem), so patience and clear explanations are appreciated. Thanks in advance!

Title: Tensorflow-Text in Miniconda

Body:
I am trying to install tensorflow-text through miniconda in Spyder. I have managed to install other modules in Spyder such as tensorflow itself, pandas, scikit-learn, etc. However, using the same command as all the other installations (with the specific package name replaced by tensorflow-text)

conda install spyder-kernels tensorflow-text -y

I continue to get the same error whenever I try to install tensorflow-text:

PackagesNotFoundError: The following packages are not available from current channels:
  - tensorflow-text

followed by a suggestion to search for the package on anaconda.org. As such, I searched for the tensorflow-text package on the anaconda site and found one, albeit for linux, by rocketce. Attempting to run the commands listed under the tensorflow-text installation instructions on that webpage also yielded the same error.

At first, I tried to install tensorflow-text through pip and was able to successfully run the command

pip install -U tensorflow-text==2.10.0

which seemed to install tensorflow-text. But I could not figure out how to access it or if it was correctly installed. Specifically, I am looking to use tensorflow-text in the Spyder IDE. I was able to get tensorflow working in the IDE, but not the specific tensorflow-text.

I am using a Windows 10 system; I could not find anything on the anaconda site for Windows 10. I am rather inexperienced (if you could not already tell from the nature and description of the problem), so patience and clear explanations are appreciated. Thanks in advance!


问:
Creating a char rectangle in phyton using for loop
My code

def draw_rectangle(height,width,char):
    for h in range(height):
        for w in range(width):
            print("char", end="")
        print()
```

But it doesn't work.

Body:
My code

def draw_rectangle(height,width,char):
    for h in range(height):
        for w in range(width):
            print("char", end="")
        print()

But it doesn't work.


问:
how to refresh list of data changed by component
Description - I'm pulling a list of Material data from firestore and displaying it as a table. I've added a modal to add a Material to the database.

Problem - The refresh method I'm passing to the modal, refreshList() isn't refreshing the list of Materials on the Materials page. I'm quite certain the refresh method works—it's the same one I use to pull all Materials from firestore. what did I do wrong?

Here's the AddMaterialModal.

```<code>import { FC, useContext, useState } from "react";
import { ProjectContext } from "../../context/ProjectContext";
import MaterialService from "../../services/materialService";
import { Material } from "../../services/orgTypes";
import { randomString } from "../../utils/utils";
import AddEditTextModal from "./AddEditTextModal";
interface AddMaterialsModalProps {
  editting?: boolean;
  setOpenModal: (bool: boolean) => void;
  selectedMaterial?: Material;
  refreshList?: () => void;
}

const AddMaterialModal: FC<AddMaterialsModalProps> = ({
  editting,
  setOpenModal,
  selectedMaterial,
  refreshList,
}) => {
  const idTemp = randomString(20);
  const projectContext = useContext(ProjectContext);
  const [newMaterial] = useState<Material>({
    material: "material",
    actualquantity: "actualquantity",
    size: "size",
    id: idTemp,
    description: "description",
    type: "type",
    unit: "unit",
    quantity: "quantity",
  });
  const materialService = new MaterialService(
    projectContext.selectedProject.id
  );
  const createNewMaterial = () => {
    materialService.updateCreateGlobalMaterial(newMaterial);
    if (refreshList != undefined) {
      refreshList();
      setOpenModal(false);
    }
  };
  return (
    <div>
      <div className="flex flex-col gap- 2 w-full h-fit ">
        {//input some material data here.}
      </div>
      <div className="flex justify-center align-center">
        <button
          onClick={createNewMaterial}
          className=" w-fit px-6  py-2.5 mt-6 bg-flowius-blue text-white font-medium text-lg leading-tight uppercase rounded shadow-md hover:bg-blue-400 hover:shadow-lg focus:bg-cyan-400 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-500 active:shadow-lg
            transition duration-150 ease-in-out"
        >
          {editting ? "UPDATE" : "ADD +"}
        </button>
      </div>
    </div>
  );
};

export default AddMaterialModal;
</code>```

And here's the main Materials page.

```<code>import { FC, useCallback, useContext, useEffect, useState } from "react";
import DataTable from "react-data-table-component";
import { ProjectContext } from "../context/ProjectContext";
import { Material } from "../services/orgTypes";
import Loader from "../components/Loader";
import MaterialIcon from "../components/MaterialIcon";
import { toast } from "react-toastify";
import MaterialService from "../services/materialService";
import Modal from "../components/modal/Modal";
import AddMaterialModal from "../components/modal/AddMaterialModal";

interface Selected {
  allSelected: boolean;
  selectedCount: number;
  selectedRows: Material[];
}

export const formatDate = (date: Date) => {
  const month = date.toLocaleString("en-us", { month: "long" });
  const year = date.getFullYear();
  const day = date.getDate();
  return `${day} ${month} ${year}`;
};

const Materials: FC = () => {
  const [materials, setMaterials] = useState<Material[]>([]);
  const [loading, setLoading] = useState(true);
  const [selected, setSelected] = useState<Selected>();
  const projectContext = useContext(ProjectContext);
  const { id } = projectContext.selectedProject;
  const materialService = new MaterialService(id);

  const pullMaterials = useCallback(async () => {
    if (!id) return;
    const materials = await materialService.getProjectMaterials();
    setMaterials(materials);
    setLoading(false);
  }, [id]);
  const [openAddMaterialModal, setOpenAddMaterialModal] = useState(false);

  useEffect(() => {
    pullMaterials();
  }, [pullMaterials]);
  const columns = [
    {
      name: "Material",
      selector: (row: Material) => row.material,
      sortable: true,
    },
    {
      name: "Description",
      selector: (row: Material) => row.description,
      sortable: true,
    },
    {
      name: "Size",
      selector: (row: Material) => row.size,
      sortable: true,
    },
    {
      name: "Unit",
      selector: (row: Material) => row.unit,
      sortable: true,
    },
    {
      name: "Actual Quantity",
      selector: (row: Material) => row.actualquantity,
      sortable: true,
    },
  ];
  const deleteSelected = async () => {
    if (!selected) return;
    const { selectedRows } = selected;
    materialService.deleteGlobalMaterial(selectedRows);
    toast.success(`${selectedRows.length} Items deleted`);
    pullMaterials();
    setSelected(undefined);
  };

  return (
    <div className="m-2 w-full">
      <div className="flex text-flowius-blue text-xl flex-row justify-between my-1">
        <button
          className="bg-flowius-blue text-base text-white p-2 rounded-md"
          onClick={() => {
            setOpenAddMaterialModal(true);
          }}
        >
          Add Material
        </button>
      </div>
      {(selected?.selectedCount ?? 0) > 0 && (
        <MaterialIcon
          className="cursor-pointer "
          onClick={deleteSelected}
          icon="delete"
        />
      )}
      {loading ? (
        <Loader />
      ) : (
        <DataTable
          selectableRows={true}
          paginationRowsPerPageOptions={[50, 100, 150]}
          paginationPerPage={50}
          onSelectedRowsChange={setSelected}
          pagination={true}
          columns={columns}
          data={materials}
          defaultSortAsc={true}
          defaultSortFieldId="Material"
        />
      )}
      {setOpenAddMaterialModal && (
        <Modal
          open={openAddMaterialModal}
          close={() => {
            setOpenAddMaterialModal(false);
          }}
          title={"Add Material"}
          className={""}
        >
          <AddMaterialModal
            editting={false}
            setOpenModal={setOpenAddMaterialModal}
            refreshList={pullMaterials}
          />
        </Modal>
      )}
    </div>
  );
};

export default Materials;

</code>```

Body:
Description - I'm pulling a list of Material data from firestore and displaying it as a table. I've added a modal to add a Material to the database.

Problem - The refresh method I'm passing to the modal, refreshList() isn't refreshing the list of Materials on the Materials page. I'm quite certain the refresh method works—it's the same one I use to pull all Materials from firestore. what did I do wrong?

Here's the AddMaterialModal.

import { FC, useContext, useState } from "react";
import { ProjectContext } from "../../context/ProjectContext";
import MaterialService from "../../services/materialService";
import { Material } from "../../services/orgTypes";
import { randomString } from "../../utils/utils";
import AddEditTextModal from "./AddEditTextModal";
interface AddMaterialsModalProps {
  editting?: boolean;
  setOpenModal: (bool: boolean) => void;
  selectedMaterial?: Material;
  refreshList?: () => void;
}

const AddMaterialModal: FC<AddMaterialsModalProps> = ({
  editting,
  setOpenModal,
  selectedMaterial,
  refreshList,
}) => {
  const idTemp = randomString(20);
  const projectContext = useContext(ProjectContext);
  const [newMaterial] = useState<Material>({
    material: "material",
    actualquantity: "actualquantity",
    size: "size",
    id: idTemp,
    description: "description",
    type: "type",
    unit: "unit",
    quantity: "quantity",
  });
  const materialService = new MaterialService(
    projectContext.selectedProject.id
  );
  const createNewMaterial = () => {
    materialService.updateCreateGlobalMaterial(newMaterial);
    if (refreshList != undefined) {
      refreshList();
      setOpenModal(false);
    }
  };
  return (

        {//input some material data here.}

        <button
          onClick={createNewMaterial}
          className=" w-fit px-6  py-2.5 mt-6 bg-flowius-blue text-white font-medium text-lg leading-tight uppercase rounded shadow-md hover:bg-blue-400 hover:shadow-lg focus:bg-cyan-400 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-500 active:shadow-lg
            transition duration-150 ease-in-out"
        >
          {editting ? "UPDATE" : "ADD +"}
        </button>

  );
};

export default AddMaterialModal;

And here's the main Materials page.

import { FC, useCallback, useContext, useEffect, useState } from "react";
import DataTable from "react-data-table-component";
import { ProjectContext } from "../context/ProjectContext";
import { Material } from "../services/orgTypes";
import Loader from "../components/Loader";
import MaterialIcon from "../components/MaterialIcon";
import { toast } from "react-toastify";
import MaterialService from "../services/materialService";
import Modal from "../components/modal/Modal";
import AddMaterialModal from "../components/modal/AddMaterialModal";

interface Selected {
  allSelected: boolean;
  selectedCount: number;
  selectedRows: Material[];
}

export const formatDate = (date: Date) => {
  const month = date.toLocaleString("en-us", { month: "long" });
  const year = date.getFullYear();
  const day = date.getDate();
  return `${day} ${month} ${year}`;
};

const Materials: FC = () => {
  const [materials, setMaterials] = useState<Material[]>([]);
  const [loading, setLoading] = useState(true);
  const [selected, setSelected] = useState<Selected>();
  const projectContext = useContext(ProjectContext);
  const { id } = projectContext.selectedProject;
  const materialService = new MaterialService(id);

  const pullMaterials = useCallback(async () => {
    if (!id) return;
    const materials = await materialService.getProjectMaterials();
    setMaterials(materials);
    setLoading(false);
  }, [id]);
  const [openAddMaterialModal, setOpenAddMaterialModal] = useState(false);

  useEffect(() => {
    pullMaterials();
  }, [pullMaterials]);
  const columns = [
    {
      name: "Material",
      selector: (row: Material) => row.material,
      sortable: true,
    },
    {
      name: "Description",
      selector: (row: Material) => row.description,
      sortable: true,
    },
    {
      name: "Size",
      selector: (row: Material) => row.size,
      sortable: true,
    },
    {
      name: "Unit",
      selector: (row: Material) => row.unit,
      sortable: true,
    },
    {
      name: "Actual Quantity",
      selector: (row: Material) => row.actualquantity,
      sortable: true,
    },
  ];
  const deleteSelected = async () => {
    if (!selected) return;
    const { selectedRows } = selected;
    materialService.deleteGlobalMaterial(selectedRows);
    toast.success(`${selectedRows.length} Items deleted`);
    pullMaterials();
    setSelected(undefined);
  };

  return (

        <button
          className="bg-flowius-blue text-base text-white p-2 rounded-md"
          onClick={() => {
            setOpenAddMaterialModal(true);
          }}
        >
          Add Material
        </button>

      {(selected?.selectedCount ?? 0) > 0 && (
        <MaterialIcon
          className="cursor-pointer "
          onClick={deleteSelected}
          icon="delete"
        />
      )}
      {loading ? (
        <Loader />
      ) : (
        <DataTable
          selectableRows={true}
          paginationRowsPerPageOptions={[50, 100, 150]}
          paginationPerPage={50}
          onSelectedRowsChange={setSelected}
          pagination={true}
          columns={columns}
          data={materials}
          defaultSortAsc={true}
          defaultSortFieldId="Material"
        />
      )}
      {setOpenAddMaterialModal && (
        <Modal
          open={openAddMaterialModal}
          close={() => {
            setOpenAddMaterialModal(false);
          }}
          title={"Add Material"}
          className={""}
        >
          <AddMaterialModal
            editting={false}
            setOpenModal={setOpenAddMaterialModal}
            refreshList={pullMaterials}
          />
        </Modal>
      )}

  );
};

export default Materials;


问:
Is it possible to change links color in text document in VSCode?
When editing a plain text file that contains hyperlinks, the links color is the same as the rest of the text. Is it possible to change the links color? I would like the links to be highlighted in the text similar to how it was in the Atom editor. I tried to change token color customizations but it seems that text files do not have a grammar associated with them.</p>


问:
Failed to set name for thread: mediapipe/18 - python mediapipe aws lambda problem
I'm using mediapipe 0.8.9 with python 3.9 on an AWS Lambda function, the application tracks the users pupils in a given image.

The application is deployed to lambda as a docker image.

When attempting to run the application cloudwatch presents me with the below errors:

```<code>WARNING: Logging before InitGoogleLogging() is written to STDERR
E20221210 13:54:25.484192 18 threadpool_pthread_impl.cc:94] Error : Operation not permitted
Failed to set name for thread: mediapipe/18
E20221210 13:54:25.484094 17 threadpool_pthread_impl.cc:94] Error : Operation not permitted
Failed to set name for thread: mediapipe/17
</code>```

Here is the Dockerfile below:

```<code>FROM public.ecr.aws/lambda/python:3.9

COPY app.py ${LAMBDA_TASK_ROOT}

COPY requirements.txt .
RUN /var/lang/bin/python3.9 -m pip install --upgrade pip
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"

CMD [ "app.handler" ]
</code>```

Here is my requirements.txt:

```<code>requests==2.25.1
opencv-contrib-python-headless==4.6.0.66
Pillow==8.0
mediapipe==0.8.9
protobuf==3.19.0
</code>```

I have been stuck on this issue for some time, I am pretty sure a solution is referenced in this thread:

https://github.com/google/mediapipe/issues/1599

It references to make use of this script, unfortunately I cant quite understand how to do this because the twitter thread detailing how to utilise it has been deleted.

https://github.com/mitchellharper12/lambda-pthread-nameshim

If anyone can help me or point me in the right direction it would be the best christmas present a developer could ever ask for!
Thank you for taking the time to ready my question, I appreciate it immensely.

Body:
I'm using mediapipe 0.8.9 with python 3.9 on an AWS Lambda function, the application tracks the users pupils in a given image.

The application is deployed to lambda as a docker image.

When attempting to run the application cloudwatch presents me with the below errors:

WARNING: Logging before InitGoogleLogging() is written to STDERR
E20221210 13:54:25.484192 18 threadpool_pthread_impl.cc:94] Error : Operation not permitted
Failed to set name for thread: mediapipe/18
E20221210 13:54:25.484094 17 threadpool_pthread_impl.cc:94] Error : Operation not permitted
Failed to set name for thread: mediapipe/17

Here is the Dockerfile below:

FROM public.ecr.aws/lambda/python:3.9

COPY app.py ${LAMBDA_TASK_ROOT}

COPY requirements.txt .
RUN /var/lang/bin/python3.9 -m pip install --upgrade pip
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"

CMD [ "app.handler" ]

Here is my requirements.txt:

requests==2.25.1
opencv-contrib-python-headless==4.6.0.66
Pillow==8.0
mediapipe==0.8.9
protobuf==3.19.0

I have been stuck on this issue for some time, I am pretty sure a solution is referenced in this thread:

https://github.com/google/mediapipe/issues/1599

It references to make use of this script, unfortunately I cant quite understand how to do this because the twitter thread detailing how to utilise it has been deleted.

https://github.com/mitchellharper12/lambda-pthread-nameshim

If anyone can help me or point me in the right direction it would be the best christmas present a developer could ever ask for!
Thank you for taking the time to ready my question, I appreciate it immensely.


问:
How to clean messy CSV files with regex commands in Rails?
I'm dealing with messy CSV files, and really hope some regexes (or other viable substitutions) will help. Thousands of files per day, thousands of lines per file, hundreds of columns. For the most part the CSVs are very well formatted - all fields are contained within "quotes" and are comma-delimited. However, what's inside the fields sometimes causes trouble.

For simplicity, here's a brief demonstration of the issues I'm running into.

Example data:

```<code>"option1","option2","product","description","reference","price","currency","foo","bar","address1","address2","city","state","postal","country","option3","option4","option5"
"","","apples","multi-color ""macintosh"" apples","PO#1-3503", 24.00"" x 12.00"" x 12.00"","12.50","USD","","","1234 Main Street ""","","Genericsberg","VA","10324","USA","","",""
</code>```

Issues:

""" appearing some place or other ... see address1

"" appearing inside of fields ... see description, reference

" appearing inside of fields ... see reference - the purchase order # and product dimensions are part of the same field (don't let the ", fool you)

What I'm pretty sure I want:

when "" appears inside of a non-empty field, remove it

when ", appears inside of a field, remove the " but keep the comma

when """ appears at the beginning / end of a field, change it to "

when "" appears at the beginning / end of a non-empty field, change it to "

What I really want is for these messy CSVs to import properly, with the data arriving in the correct fields.

Background:

Our tech stack involves Ruby on Rails, currently using SmarterCSV to import CSV files from an S3 bucket.

What we've tried:

text.gsub(/(?<!^|,)"(?!,|$)/, '')

This has served us well for various issues up to this point, but not so well on the above.

text.gsub('"""', '"')

This seems to accomplish # 3 well enough - haven't deployed it to production as I'd like to get past these other issues as well.

Body:
I'm dealing with messy CSV files, and really hope some regexes (or other viable substitutions) will help. Thousands of files per day, thousands of lines per file, hundreds of columns. For the most part the CSVs are very well formatted - all fields are contained within "quotes" and are comma-delimited. However, what's inside the fields sometimes causes trouble.

For simplicity, here's a brief demonstration of the issues I'm running into.

Example data:

"option1","option2","product","description","reference","price","currency","foo","bar","address1","address2","city","state","postal","country","option3","option4","option5"
"","","apples","multi-color ""macintosh"" apples","PO#1-3503", 24.00"" x 12.00"" x 12.00"","12.50","USD","","","1234 Main Street ""","","Genericsberg","VA","10324","USA","","",""

Issues:

""" appearing some place or other ... see address1

"" appearing inside of fields ... see description, reference

" appearing inside of fields ... see reference - the purchase order # and product dimensions are part of the same field (don't let the ", fool you)

What I'm pretty sure I want:

when "" appears inside of a non-empty field, remove it

when ", appears inside of a field, remove the " but keep the comma

when """ appears at the beginning / end of a field, change it to "

when "" appears at the beginning / end of a non-empty field, change it to "

What I really want is for these messy CSVs to import properly, with the data arriving in the correct fields.

Background:

Our tech stack involves Ruby on Rails, currently using SmarterCSV to import CSV files from an S3 bucket.

What we've tried:

text.gsub(/(?<!^|,)"(?!,|$)/, '')

This has served us well for various issues up to this point, but not so well on the above.

text.gsub('"""', '"')

This seems to accomplish # 3 well enough - haven't deployed it to production as I'd like to get past these other issues as well.


问:
Why youtube tv such smooth animation?
I'm making a widget for the tihzen platform and webos.

For scrolling cards and content, I use the transform3d css and transition: transform 0.3s.

But when scrolling, I see how the animation twitches, there is no smoothness. Like fps 18-24.

I also tested with empty dice, the only thing I changed in the code was body.style.transform3d(0, 200px, 9)

But still there is no smoothness in the animation.

Does anyone know how YouTube achieved such a result? Why is his scrolling so smooth? Is it possible to look at the code?

Title: Why youtube tv such smooth animation?


问:
I am building a calculator, the user enters something similar to this: 3+2*7/4 and the code calculate it.However i have a big problem with the indexes
```<code>import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Model {

    private ArrayList<String> num = new ArrayList<>();
    private ArrayList<String> op = new ArrayList<>();
    private ArrayList<String> num1 = new ArrayList<>();
    private ArrayList<String> op1 = new ArrayList<>();
    private Scanner sc = new Scanner(System.in);

    private ArrayList<String> ope = new ArrayList<>();
    private ArrayList<Double> nume = new ArrayList<>();

    public Model()
    {

    }

    public void split()
    {
        String exp= sc.next();
        String num[]= exp.split("[/+/*/-]");
        String op[]= exp.split("[0123456789]");

        for(String x : num)
        {
            this.num.add(x);
            this.num1.add(x);
        }

        for(int i =1; i<op.length; i++)
        {
            this.op.add(op[i]);
            this.op1.add(op[i]);

        }

    }
    public void precedence_work()
    {
        for(int i=0; i <op.size();i++)
        {
            String num = "";
            if(this.op.get(i).equals("*")||this.op.get(i).equals("/"))
            {
                extra_split(i);
                num = calculate_split();

                this.op1.remove(i);
                this.num1.set(i, num);
                this.num1.remove(i+1);
                System.out.println(i + " loop debug");
            }

        }
        for(int i=0; i <3;i++)
        {

            extra_split(i);
            String num = calculate_split();

            this.op1.remove(i);
            this.num1.set(i, num);
            this.num1.remove(i+1);
        }

        System.out.println(num);
    }

    private void extra_split(int index)
    {

        ope.add(this.op.get(index));
        nume.add(Double.parseDouble(num.get(index))); //specifying the needed high precedence expression to be worked on
        nume.add(Double.parseDouble(num.get(index+1)));//by putting them ina specific arraylist to make stuff easier to work with

    }
    private String calculate_split()
    {
        double num = 0;
        if(ope.get(0).equals("*")  )
        {
             num = nume.get(0)*nume.get(1);
             System.out.println(num);
        }
        else if(ope.get(0).equals("/")  )
        {
             num = (nume.get(0))/(nume.get(1));
        }
        else if(ope.get(0).equals("+")  )
        {
             num = nume.get(0)+nume.get(1);
        }
        else if(ope.get(0).equals("-")  )
        {
             num = nume.get(0)-nume.get(1);
        }
        else
            System.out.println("Error!");
        System.out.println("Nume before, debug:" + nume);
        System.out.println("Ope before, debug:" + ope);
        this.ope.remove(0);
        this.nume.remove(nume.get(0));//because whenever i put index 0 or index 1, it is giving error but somehow this works
        this.nume.remove(nume.get(0));
        System.out.println("Nume after, debug:" + nume);
        System.out.println("Ope after, debug:" + ope);
        return Double.toString(num);

    }

}
</code>```

I tried playing a lot around indexes, making the arraylist having the values but opposite then I use the index in a decrementing manner but it still did not work, and I did other ways but they did not make any sense but I was just hoping they work.

Explanation of the code: the algorithm i am trying to do is the following

User enters: 1+32-35
Split the operators and numbers and put them in different arraylist
num arraylist [1, 3, 2, 3 , 5]
operator arraylist[+, *, -, *]

look at the op and num arraylist , you will realize that if "*" is index  1 in op arraylist then the number supposedly to be before it is index 1 in the num arraylist and the number after it is index 1 +1 = 2

so 32 but to make the code easier to calculate, i put that two specific numbers with the following operator in a different arraylist nume and ope, so when i am working on this nummber the nume is [3,2] ope[] however after finishing from calculating this, the  arraylist is reset in order for the next expression to be worked on`

Body:
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Model {

    private ArrayList<String> num = new ArrayList<>();
    private ArrayList<String> op = new ArrayList<>();
    private ArrayList<String> num1 = new ArrayList<>();
    private ArrayList<String> op1 = new ArrayList<>();
    private Scanner sc = new Scanner(System.in);

    private ArrayList<String> ope = new ArrayList<>();
    private ArrayList<Double> nume = new ArrayList<>();

    public Model()
    {

    }

    public void split()
    {
        String exp= sc.next();
        String num[]= exp.split("[/+/*/-]");
        String op[]= exp.split("[0123456789]");

        for(String x : num)
        {
            this.num.add(x);
            this.num1.add(x);
        }

        for(int i =1; i<op.length; i++)
        {
            this.op.add(op[i]);
            this.op1.add(op[i]);

        }

    }
    public void precedence_work()
    {
        for(int i=0; i <op.size();i++)
        {
            String num = "";
            if(this.op.get(i).equals("*")||this.op.get(i).equals("/"))
            {
                extra_split(i);
                num = calculate_split();

                this.op1.remove(i);
                this.num1.set(i, num);
                this.num1.remove(i+1);
                System.out.println(i + " loop debug");
            }

        }
        for(int i=0; i <3;i++)
        {

            extra_split(i);
            String num = calculate_split();

            this.op1.remove(i);
            this.num1.set(i, num);
            this.num1.remove(i+1);
        }

        System.out.println(num);
    }

    private void extra_split(int index)
    {

        ope.add(this.op.get(index));
        nume.add(Double.parseDouble(num.get(index))); //specifying the needed high precedence expression to be worked on
        nume.add(Double.parseDouble(num.get(index+1)));//by putting them ina specific arraylist to make stuff easier to work with

    }
    private String calculate_split()
    {
        double num = 0;
        if(ope.get(0).equals("*")  )
        {
             num = nume.get(0)*nume.get(1);
             System.out.println(num);
        }
        else if(ope.get(0).equals("/")  )
        {
             num = (nume.get(0))/(nume.get(1));
        }
        else if(ope.get(0).equals("+")  )
        {
             num = nume.get(0)+nume.get(1);
        }
        else if(ope.get(0).equals("-")  )
        {
             num = nume.get(0)-nume.get(1);
        }
        else
            System.out.println("Error!");
        System.out.println("Nume before, debug:" + nume);
        System.out.println("Ope before, debug:" + ope);
        this.ope.remove(0);
        this.nume.remove(nume.get(0));//because whenever i put index 0 or index 1, it is giving error but somehow this works
        this.nume.remove(nume.get(0));
        System.out.println("Nume after, debug:" + nume);
        System.out.println("Ope after, debug:" + ope);
        return Double.toString(num);

    }

}

I tried playing a lot around indexes, making the arraylist having the values but opposite then I use the index in a decrementing manner but it still did not work, and I did other ways but they did not make any sense but I was just hoping they work.

Explanation of the code: the algorithm i am trying to do is the following

User enters: 1+32-35
Split the operators and numbers and put them in different arraylist
num arraylist [1, 3, 2, 3 , 5]
operator arraylist[+, *, -, *]

look at the op and num arraylist , you will realize that if "*" is index  1 in op arraylist then the number supposedly to be before it is index 1 in the num arraylist and the number after it is index 1 +1 = 2

so 32 but to make the code easier to calculate, i put that two specific numbers with the following operator in a different arraylist nume and ope, so when i am working on this nummber the nume is [3,2] ope[] however after finishing from calculating this, the  arraylist is reset in order for the next expression to be worked on`


问:
What is the cause of the Sphinx warning "Block quote ends without a blank line; unexpected unindent" in a one line docstring
When I build my Sphinx HTML documentation, I get a warning.

checkdmarc.py:docstring of checkdmarc.BIMIRecordInWrongLocation:1: WARNING: Block quote ends without a blank line; unexpected unindent.

BIMIRecordInWrongLocation is a simple Exception class with a one line docstring.

class BIMIRecordInWrongLocation(BIMIError):
    """Raised when a BIMI record is found at the root of a domain"""
```

Oddly, the warning persisted even after I replaced the docstring with pass.

For context, here is the full code, and the Sphinx build log.

Body:
When I build my Sphinx HTML documentation, I get a warning.

checkdmarc.py:docstring of checkdmarc.BIMIRecordInWrongLocation:1: WARNING: Block quote ends without a blank line; unexpected unindent.

BIMIRecordInWrongLocation is a simple Exception class with a one line docstring.

class BIMIRecordInWrongLocation(BIMIError):
    """Raised when a BIMI record is found at the root of a domain"""

Oddly, the warning persisted even after I replaced the docstring with pass.

For context, here is the full code, and the Sphinx build log.


问:
changing a variable in SCSS not working in angular
```<code>// this variable is default or dark
$mode: default;
.dark-mode {
   $mode: dark !important;
}
.light-mode {
   $mode: default !important;
}
</code>```

when I change the $mode to default or dark, it's working but when I use class .dark-mode or .light-mode not work

my code is below not working but when I change the $mode in Scss manual working
where is my problem ?

```<code><div class="dark-mode">
   <router-outlet></router-outlet>
</div>
</code>```

Body:
// this variable is default or dark
$mode: default;
.dark-mode {
   $mode: dark !important;
}
.light-mode {
   $mode: default !important;
}

when I change the $mode to default or dark, it's working but when I use class .dark-mode or .light-mode not work

my code is below not working but when I change the $mode in Scss manual working
where is my problem ?

   <router-outlet></router-outlet>


问:
Possible to create a problem set for Solidity?

This question is for all those that are decently familiar with the Solidity programming language (used for creating smart contracts on Ethereum & other blockchains).

I was wondering whether it was possible to create a problem set for Solidity, specifically. From what I've observed, the only "equivalent" that exists out there are exercises that ask someone to identify a vulnerability / weakness in a smart contract or to create code capable of exploiting a given contract.

However, I'm looking for something that more closely resembles the problems classically created for other programming languages like, "Write a python/C++ program to check whether the given number is even or not" (won't bother providing answer for brevity's sake). I'm also wondering whether creating a functional equivalent for solidity is even practical (or possible).

I'm not knowledgeable enough about the field of programming to know if there are any other languages that are used in the same way Solidity is. What I mean is that solidity isn't like other programming languages that are constructed for general purposes. For example, that example programming problem I gave could not be retrofitted to ask, "Write a solidity program to check whether the given number is even or not" (if you disagree, however, please correct me on this, because that would profoundly change the trajectory of my current research).

I stated this assumption to help provide context for why I'm making this request in the first place.

I tried scouring the internet for "solidity problem sets" and each time I thought I found a potential solution, I only came across exercises that require you to find a vulnerability / exploit or CTF-based challenges, which essentially address the same issue. Frankly, I haven't even seen another conversation online where someone is either looking for or making this same request. If I'm wrong on that, please feel free to correct me.


问:
System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception
Due to the below error i am blocked on the work.

```<code>System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnectionFactory' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlPerformanceCounters' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.Common.ADP' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Data.Common.ADP..cctor()
--- End of inner exception stack trace ---
</code>```

I have dereferenced the System.Data.SqlClient in the entire project but still getting this exception.
I have added the reference for Microsoft.Data.SqlClient i even upgraded this to the latest version.[version="5.0.1" targetFramework="net472"]

I have verifying the connection string by using the VS Community DataBase TestConnection it is working fine.
We are getting this error while trying to establish connection through c# code.
.NetFramework: net472
VSCommunity editor with C# as the scripting language and Windows 11 as the OS.

Body:
Due to the below error i am blocked on the work.

System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnectionFactory' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlPerformanceCounters' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Microsoft.Data.Common.ADP' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Data.Common.ADP..cctor()
--- End of inner exception stack trace ---

I have dereferenced the System.Data.SqlClient in the entire project but still getting this exception.
I have added the reference for Microsoft.Data.SqlClient i even upgraded this to the latest version.[version="5.0.1" targetFramework="net472"]

I have verifying the connection string by using the VS Community DataBase TestConnection it is working fine.
We are getting this error while trying to establish connection through c# code.
.NetFramework: net472
VSCommunity editor with C# as the scripting language and Windows 11 as the OS.


问:
Is Collections.sort() faster than Arrays.sort() in java?
i was solving a codeforces problem this one
my first solution which uses a array got accepted while the contest was running but it got TLE on 7th testcases the first code.
i tried to do the same with Arraylist which got accepted second code

below is the comparable code which is a function

```<code>static void solve(){
        int n=sc.nextInt();
        long arr[]=new long[n-1]   //ArrayList<Long> list=new ArrayList<>();
        long a=sc.nextLong();
        for(int i=0;i<n-1;i++){
            arr[i]=list.add(sc.nextLong());
        }
        Array.sort(arr)            //Collections.sort(arrlist);
        for(int i=0;i<n-1;i++){
            long b=arr[i];         //list.get(i);
            if(b>a){
                if((b-a)%2==1){
                    a+=((b-a)+1)/2;
                }else{
                    a+=(b-a)/2;
                }
            }
        }
        System.out.println(a);

    }
</code>```

Body:
i was solving a codeforces problem this one
my first solution which uses a array got accepted while the contest was running but it got TLE on 7th testcases the first code.
i tried to do the same with Arraylist which got accepted second code

below is the comparable code which is a function

static void solve(){
        int n=sc.nextInt();
        long arr[]=new long[n-1]   //ArrayList<Long> list=new ArrayList<>();
        long a=sc.nextLong();
        for(int i=0;i<n-1;i++){
            arr[i]=list.add(sc.nextLong());
        }
        Array.sort(arr)            //Collections.sort(arrlist);
        for(int i=0;i<n-1;i++){
            long b=arr[i];         //list.get(i);
            if(b>a){
                if((b-a)%2==1){
                    a+=((b-a)+1)/2;
                }else{
                    a+=(b-a)/2;
                }
            }
        }
        System.out.println(a);

    }


问:
Getting an error while trying to access the database POST Erorr 404 Angular

I GOT AN ERORR in Sigin() and Signup() I got my token but there is no red line and my API work too. I don't what's the problem

```<code>onLogin(){

if (this.loginForm.valid){
console.log(this.loginForm.value);
this.auth.login(this.loginForm.value)
.subscribe({
  next:(res)=>{
    console.log(res.message);
    this.loginForm.reset();
    this.auth.storeToken(res.token);
    this.router.navigate(['home'])
  },
  error: (err)=>{

    console.log(err);
  },

});

}

</code>```

Body:
I GOT AN ERORR in Sigin() and Signup() I got my token but there is no red line and my API work too. I don't what's the problem

onLogin(){

if (this.loginForm.valid){
console.log(this.loginForm.value);
this.auth.login(this.loginForm.value)
.subscribe({
  next:(res)=>{
    console.log(res.message);
    this.loginForm.reset();
    this.auth.storeToken(res.token);
    this.router.navigate(['home'])
  },
  error: (err)=>{

    console.log(err);
  },

});

}