问:
how do we handle file DOWNLOAD HASH mismatch?
```<code>-- Downloading v3.1.0/protobuf-cpp-3.1.0.tar.gz...
CMake Error at /home/yangbyeonghun/slam/opencv/opencv-3.2.0/cmake/OpenCVUtils.cmake:1043 (file):
  file DOWNLOAD HASH mismatch

    for file: [/home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/.download/bd5e3eed635a8d32e2b99658633815ef/v3.1.0/protobuf-cpp-3.1.0.tar.gz]
      expected hash: [bd5e3eed635a8d32e2b99658633815ef]
        actual hash: [d41d8cd98f00b204e9800998ecf8427e]
             status: [1;"Unsupported protocol"]

Call Stack (most recent call first):
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)

CMake Error at /home/yangbyeonghun/slam/opencv/opencv-3.2.0/cmake/OpenCVUtils.cmake:1047 (message):
  Failed to download v3.1.0/protobuf-cpp-3.1.0.tar.gz.  Status=1;"Unsupported
  protocol"
Call Stack (most recent call first):
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)

-- Configuring incomplete, errors occurred!
See also "/home/yangbyeonghun/slam/opencv/opencv-3.2.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/yangbyeonghun/slam/opencv/opencv-3.2.0/build/CMakeFiles/CMakeError.log".
</code>```

I encountered this error during opencv installation. It's not solved by the various solutions on the Internet. What is the problem and how do we solve it?

I tried changing the Wi-Fi connection and changing it to a hotspot, but the same error appears.

Body:
-- Downloading v3.1.0/protobuf-cpp-3.1.0.tar.gz...
CMake Error at /home/yangbyeonghun/slam/opencv/opencv-3.2.0/cmake/OpenCVUtils.cmake:1043 (file):
  file DOWNLOAD HASH mismatch

    for file: [/home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/.download/bd5e3eed635a8d32e2b99658633815ef/v3.1.0/protobuf-cpp-3.1.0.tar.gz]
      expected hash: [bd5e3eed635a8d32e2b99658633815ef]
        actual hash: [d41d8cd98f00b204e9800998ecf8427e]
             status: [1;"Unsupported protocol"]

Call Stack (most recent call first):
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)

CMake Error at /home/yangbyeonghun/slam/opencv/opencv-3.2.0/cmake/OpenCVUtils.cmake:1047 (message):
  Failed to download v3.1.0/protobuf-cpp-3.1.0.tar.gz.  Status=1;"Unsupported
  protocol"
Call Stack (most recent call first):
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include)
  /home/yangbyeonghun/slam/opencv/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)

-- Configuring incomplete, errors occurred!
See also "/home/yangbyeonghun/slam/opencv/opencv-3.2.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/yangbyeonghun/slam/opencv/opencv-3.2.0/build/CMakeFiles/CMakeError.log".

I encountered this error during opencv installation. It's not solved by the various solutions on the Internet. What is the problem and how do we solve it?

I tried changing the Wi-Fi connection and changing it to a hotspot, but the same error appears.


来源: stackexchange

问:
What is Gitlab Compare API parameter straight meaning for?
In Gitlab Compare API, there is a parameter named straight.

What does this parameter do? Can you give some example?

ContentLicense: CC BY-SA 4.0


问:
Android AnimatorSet an object multiply after that animate top to bottom at a same time from different points
I have an animatorSet code in which random object move from bottom to top in a click.

I want that
(1) In a click at a same time one random object multiply and all animate from different points
(2) Object animate from Top to Bottom

Please help me to achieve my goal in this code.

My code is  below:

```<code>public class FlowerAnim extends AppCompatActivity{
    Button btn;
    private PointF startPoint;
    private PointF endPoint;
    private Drawable[] drawables;
    private Interpolator[] interpolators;
    private FrameLayout rootView;
    int width;
    int height;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim_flower);
        WindowManager wm = this.getWindowManager();
        rootView = (FrameLayout) findViewById(R.id.ll);
        width = wm.getDefaultDisplay().getWidth();
        height = wm.getDefaultDisplay().getHeight();
        startPoint = new PointF(width / 2 - 50, height);
        endPoint = new PointF(width / 2 - 50, 0);
        init();

        btn = (Button) findViewById(R.id.btn);

        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                addFlower();
            }
        });

    }

    private void init() {
        drawables = new Drawable[8];
        drawables[0] = getResources().getDrawable(R.mipmap.flower);
        drawables[1] = getResources().getDrawable(R.mipmap.flower_1);
        drawables[2] = getResources().getDrawable(R.mipmap.flower_2);
        drawables[3] = getResources().getDrawable(R.mipmap.flower_3);
        drawables[4] = getResources().getDrawable(R.mipmap.flower_4);
        drawables[5] = getResources().getDrawable(R.mipmap.flower_5);
        drawables[6] = getResources().getDrawable(R.mipmap.heart_1);
        drawables[7] = getResources().getDrawable(R.mipmap.heart_2);

        interpolators = new Interpolator[4];
        interpolators[0] = new AccelerateDecelerateInterpolator();
        interpolators[1] = new AccelerateInterpolator();
        interpolators[2] = new DecelerateInterpolator();
        interpolators[3] = new LinearInterpolator();
    }

    private void addFlower() {
        ImageView flower = new ImageView(this);
        flower.setLayoutParams(new ViewGroup.LayoutParams(100, 100));
        flower.setBackground(drawables[new Random().nextInt(drawables.length)]);
        flower.setX(startPoint.x);
        flower.setY(startPoint.y);
        rootView.addView(flower);
        startAnin(flower);
    }

    private void startAnin(final ImageView flower) {
        final AnimatorSet animatorSet = new AnimatorSet();

        ObjectAnimator scaleAnimX = ObjectAnimator.ofFloat(flower, "scaleX", 0.4f, 1.0f);
        ObjectAnimator scaleAnimY = ObjectAnimator.ofFloat(flower, "scaleY", 0.4f, 1.0f);
        scaleAnimX.setDuration(1800);
        scaleAnimY.setDuration(1800);

        final ValueAnimator animator = ValueAnimator.ofObject(new MyTypeEvaluator(getPoint(0), getPoint(1)), startPoint, endPoint);
        animator.setDuration(4000);
        animator.setInterpolator(new AccelerateDecelerateInterpolator());
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                PointF pointF = (PointF) animation.getAnimatedValue();
                flower.setX(pointF.x);
                flower.setY(pointF.y);
            }
        });

        animatorSet.play(animator);
        animatorSet.play(scaleAnimX).with(scaleAnimY);
        animatorSet.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                rootView.removeView(flower);

            }
        });
        animatorSet.start();
    }

    private PointF getPoint(int i) {
        PointF pointF = new PointF();
        pointF.x = new Random().nextFloat() * width;
        if (i == 0) {
            pointF.y = new Random().nextFloat() * 0.5f * height;
        } else {
            pointF.y = (new Random().nextFloat() * 0.5f * height) + 0.5f * height;
        }
        return pointF;
    }

    class MyTypeEvaluator implements TypeEvaluator<PointF> {

        private PointF pointF1, pointF2;

        public MyTypeEvaluator(PointF pointF1, PointF pointF2) {
            this.pointF1 = pointF1;
            this.pointF2 = pointF2;
        }

        @Override
        public PointF evaluate(float fraction, PointF startValue, PointF endValue) {
            float timeLeft = 1.0f - fraction;
            PointF pointF = new PointF();
            pointF.x = timeLeft * timeLeft * timeLeft * (startValue.x)
                    + 3 * timeLeft * timeLeft * fraction * (pointF1.x)
                    + 3 * timeLeft * fraction * fraction * (pointF2.x)
                    + fraction * fraction * fraction * (endValue.x);

            pointF.y = timeLeft * timeLeft * timeLeft * (startValue.y)
                    + 3 * timeLeft * timeLeft * fraction * (pointF1.y)
                    + 3 * timeLeft * fraction * fraction * (pointF2.y)
                    + fraction * fraction * fraction * (endValue.y);
            return pointF;

        }
    }

}
</code>```

I tried the Handler Runnable and use the same one object in drawables array but multiply result was not come as I want.
So please help me

Body:
I have an animatorSet code in which random object move from bottom to top in a click.

I want that
(1) In a click at a same time one random object multiply and all animate from different points
(2) Object animate from Top to Bottom

Please help me to achieve my goal in this code.

My code is  below:

public class FlowerAnim extends AppCompatActivity{
    Button btn;
    private PointF startPoint;
    private PointF endPoint;
    private Drawable[] drawables;
    private Interpolator[] interpolators;
    private FrameLayout rootView;
    int width;
    int height;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim_flower);
        WindowManager wm = this.getWindowManager();
        rootView = (FrameLayout) findViewById(R.id.ll);
        width = wm.getDefaultDisplay().getWidth();
        height = wm.getDefaultDisplay().getHeight();
        startPoint = new PointF(width / 2 - 50, height);
        endPoint = new PointF(width / 2 - 50, 0);
        init();

        btn = (Button) findViewById(R.id.btn);

        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                addFlower();
            }
        });

    }

    private void init() {
        drawables = new Drawable[8];
        drawables[0] = getResources().getDrawable(R.mipmap.flower);
        drawables[1] = getResources().getDrawable(R.mipmap.flower_1);
        drawables[2] = getResources().getDrawable(R.mipmap.flower_2);
        drawables[3] = getResources().getDrawable(R.mipmap.flower_3);
        drawables[4] = getResources().getDrawable(R.mipmap.flower_4);
        drawables[5] = getResources().getDrawable(R.mipmap.flower_5);
        drawables[6] = getResources().getDrawable(R.mipmap.heart_1);
        drawables[7] = getResources().getDrawable(R.mipmap.heart_2);

        interpolators = new Interpolator[4];
        interpolators[0] = new AccelerateDecelerateInterpolator();
        interpolators[1] = new AccelerateInterpolator();
        interpolators[2] = new DecelerateInterpolator();
        interpolators[3] = new LinearInterpolator();
    }

    private void addFlower() {
        ImageView flower = new ImageView(this);
        flower.setLayoutParams(new ViewGroup.LayoutParams(100, 100));
        flower.setBackground(drawables[new Random().nextInt(drawables.length)]);
        flower.setX(startPoint.x);
        flower.setY(startPoint.y);
        rootView.addView(flower);
        startAnin(flower);
    }

    private void startAnin(final ImageView flower) {
        final AnimatorSet animatorSet = new AnimatorSet();

        ObjectAnimator scaleAnimX = ObjectAnimator.ofFloat(flower, "scaleX", 0.4f, 1.0f);
        ObjectAnimator scaleAnimY = ObjectAnimator.ofFloat(flower, "scaleY", 0.4f, 1.0f);
        scaleAnimX.setDuration(1800);
        scaleAnimY.setDuration(1800);

        final ValueAnimator animator = ValueAnimator.ofObject(new MyTypeEvaluator(getPoint(0), getPoint(1)), startPoint, endPoint);
        animator.setDuration(4000);
        animator.setInterpolator(new AccelerateDecelerateInterpolator());
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                PointF pointF = (PointF) animation.getAnimatedValue();
                flower.setX(pointF.x);
                flower.setY(pointF.y);
            }
        });

        animatorSet.play(animator);
        animatorSet.play(scaleAnimX).with(scaleAnimY);
        animatorSet.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                rootView.removeView(flower);

            }
        });
        animatorSet.start();
    }

    private PointF getPoint(int i) {
        PointF pointF = new PointF();
        pointF.x = new Random().nextFloat() * width;
        if (i == 0) {
            pointF.y = new Random().nextFloat() * 0.5f * height;
        } else {
            pointF.y = (new Random().nextFloat() * 0.5f * height) + 0.5f * height;
        }
        return pointF;
    }

    class MyTypeEvaluator implements TypeEvaluator<PointF> {

        private PointF pointF1, pointF2;

        public MyTypeEvaluator(PointF pointF1, PointF pointF2) {
            this.pointF1 = pointF1;
            this.pointF2 = pointF2;
        }

        @Override
        public PointF evaluate(float fraction, PointF startValue, PointF endValue) {
            float timeLeft = 1.0f - fraction;
            PointF pointF = new PointF();
            pointF.x = timeLeft * timeLeft * timeLeft * (startValue.x)
                    + 3 * timeLeft * timeLeft * fraction * (pointF1.x)
                    + 3 * timeLeft * fraction * fraction * (pointF2.x)
                    + fraction * fraction * fraction * (endValue.x);

            pointF.y = timeLeft * timeLeft * timeLeft * (startValue.y)
                    + 3 * timeLeft * timeLeft * fraction * (pointF1.y)
                    + 3 * timeLeft * fraction * fraction * (pointF2.y)
                    + fraction * fraction * fraction * (endValue.y);
            return pointF;

        }
    }

}

I tried the Handler Runnable and use the same one object in drawables array but multiply result was not come as I want.
So please help me


问:
Double Quote & String Escape Hell in R
Can someone shine some light on this issue I'm having? I'm trying to issue a system command from inside R. I've whittled it down to the simplest possible example:

What I want the terminal to see is

```<code>$ my_cmd --options "my options"
</code>```

So I try this:

```<code>my_cmd <- paste0(
  "my_cmd ",
  "--options \"my options\" "
)

system(my_cmd)
</code>```

No matter what I do, the command always comes out with the escape character included!? It's driving me slightly nuts. What am I doing wrong?

```<code>$ my_cmd --options \"my options\"
</code>```

Title: Double Quote & String Escape Hell in R

Body:
Can someone shine some light on this issue I'm having? I'm trying to issue a system command from inside R. I've whittled it down to the simplest possible example:

What I want the terminal to see is

$ my_cmd --options "my options"

So I try this:

my_cmd <- paste0(
  "my_cmd ",
  "--options \"my options\" "
)

system(my_cmd)

No matter what I do, the command always comes out with the escape character included!? It's driving me slightly nuts. What am I doing wrong?

$ my_cmd --options \"my options\"


问:
How to distribute a jar program without requiring clients to download JDK?
Can there be some converters or packer that would make my program run on windows? Maybe downloading JRE in the background or smt like this, so clients are not required to go to their site and download it manually

I tried some programs like j2e and some online converters, but they aren't precise (my program appears differently)


问:
Extract tables from all pdf files in a folder?
I am using tabulizer library to extract tables from pdf in R.

It works fine for one file using

```<code>extract_tables("test.pdf");
</code>```

It print all the tables in a pdf. (Different Table can have different no of columns)

But when i have multiple files in folder and use for loop , then it print only one table.

```<code>templist <- list.files(pattern = "pdf$")
my_pdfs = {}
for (i in 1:length(templist)){my_pdfs[i] <- extract_tables(templist[i])}
</code>```

// Above mypdfs array took only 1st table data in object.

How can i get all tables thru for loop?

Thanks.

Body:
I am using tabulizer library to extract tables from pdf in R.

It works fine for one file using

extract_tables("test.pdf");

It print all the tables in a pdf. (Different Table can have different no of columns)

But when i have multiple files in folder and use for loop , then it print only one table.

templist <- list.files(pattern = "pdf$")
my_pdfs = {}
for (i in 1:length(templist)){my_pdfs[i] <- extract_tables(templist[i])}

// Above mypdfs array took only 1st table data in object.

How can i get all tables thru for loop?

Thanks.


问:
Can Byte Buddy generalize usage of the @Super annotation so that it could be used to intercept any function?
My subclass has a property which is an instance of its parent class. I wanted to intercept most of the functions in this subclass using interceptors, so that way it would call the same function on the parent class with the args passed. However, I have two issues: I don't know how to access the property, and call the function by unpacking the args at the same time.

I'm trying to create a subclass for a class in Minecraft that I'm already injecting into using Mixins, which does the thing I said above. The only problem is that that class has over 100 functions, and I'm not sure which ones I need to override in order to get the functionality I need.  I was curious if Byte Buddy was suitable for this task, or if I need to consider a different solution entirely.


问:
create a different table record on an aasm event
I have a simple aasm model like the one below. When calling post.fill!(data), it needs to create a new record on a different table with the data value. This works in the below code by calling generate_new_log_record on before_enter.

```<code>class Post < ApplicationRecord
 belongs_to :parent_model
 include AASM
  aasm column: :status do
    state :posted, initial: true
    state :filled, before_enter: Proc.new { |data| generate_new_log_record(data) }

    event :fill do
      transitions from: [:posted], to: :filled
    end

  end

  def generate_new_log_record(data)
# how to make this inside the event transaction????
    parent_model.log_records.create(start_date: expected_start_time, end_date: expected_end_time, data: data)
  end

end
</code>```

The issue is that even when for some reason generate_new_log_record is failed to create a new record, the state is still changing to filled. How can we make sure it happens inside a single DB transaction so that when the generate_new_log_record fails it undo every change that happened?

Thank you

Body:
I have a simple aasm model like the one below. When calling post.fill!(data), it needs to create a new record on a different table with the data value. This works in the below code by calling generate_new_log_record on before_enter.

class Post < ApplicationRecord
 belongs_to :parent_model
 include AASM
  aasm column: :status do
    state :posted, initial: true
    state :filled, before_enter: Proc.new { |data| generate_new_log_record(data) }

    event :fill do
      transitions from: [:posted], to: :filled
    end

  end

  def generate_new_log_record(data)
# how to make this inside the event transaction????
    parent_model.log_records.create(start_date: expected_start_time, end_date: expected_end_time, data: data)
  end

end

The issue is that even when for some reason generate_new_log_record is failed to create a new record, the state is still changing to filled. How can we make sure it happens inside a single DB transaction so that when the generate_new_log_record fails it undo every change that happened?

Thank you


问:
Match few fields of pojo with mongo db documents
Background

I am trying to fetch data from mongo by matching custom class with few fields.

Mongo Collection:

```<code>"_id":{
   "sNo":"1001",
   "name": "Sameer",
   "city": "Pune",
   "state": "Maharashtra"
}
</code>```

Pojo to match above details

```<code>@Document
class Id {
   private String sNo;
   private String name;
   private String city;
   private String state;
   // getter & setters
}
</code>```

Java code to fetch data from mongo where I want to fetch data based on sNo, name & city and want to skip state for matching:

```<code>ArrayList<Id> ids = new ArrayList<Id>();
...// code to populate Ids
MatchOperation match = Aggregation.match(Criteria.where("_id").in(ids));
Aggregation agg = Aggregation.newAggregation(match);
AggregationResults<Document> result = mongoTemplate.aggregate(agg, detailsCollection,
Document.class);
</code>```

Problem:

I didn't find any way to skip few of the fields while match.

for now I am getting all data from collection.

Please help to suggest, how this can be achieved?

Body:
Background

I am trying to fetch data from mongo by matching custom class with few fields.

Mongo Collection:

"_id":{
   "sNo":"1001",
   "name": "Sameer",
   "city": "Pune",
   "state": "Maharashtra"
}

Pojo to match above details

@Document
class Id {
   private String sNo;
   private String name;
   private String city;
   private String state;
   // getter & setters
}

Java code to fetch data from mongo where I want to fetch data based on sNo, name & city and want to skip state for matching:

ArrayList<Id> ids = new ArrayList<Id>();
...// code to populate Ids
MatchOperation match = Aggregation.match(Criteria.where("_id").in(ids));
Aggregation agg = Aggregation.newAggregation(match);
AggregationResults<Document> result = mongoTemplate.aggregate(agg, detailsCollection,
Document.class);

Problem:

I didn't find any way to skip few of the fields while match.

for now I am getting all data from collection.

Please help to suggest, how this can be achieved?


问:
Fail to transform jar to match attributes
I ran into this error when i tried to build a flutter project after add Square_reader_plugin_sdk pluggin

`Execution failed for task ':square_reader_sdk:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':square_reader_sdk:debugCompileClasspath'.
Failed to transform moshi-1.13.0.jar (com.squareup.moshi:moshi:1.13.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for JetifyTransform: /home/starburst/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar.
> Failed to transform '/home/starburst/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 60. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
Failed to transform bcprov-jdk15on-1.70.jar (org.bouncycastle:bcprov-jdk15on:1.70) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
> Execution failed for JetifyTransform: /home/starburst/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.70/4636a0d01f74acaf28082fb62b317f1080118371/bcprov-jdk15on-1.70.jar.
> Failed to transform '/home/starburst/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.70/4636a0d01f74acaf28082fb62b317f1080118371/bcprov-jdk15on-1.70.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
`

My gradle.properties has enable androidx and jettifier
org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true

i tries other solution from other thread but nothing seems to work


问:
What is the most efficient way to add a 1TB pyspark dataframe to a snowflake table?
I currently have a 1TB dataset loaded into a pyspark dataframe on databricks. I have a connection string to snowflake and can read/write data to snowflake tables. The issue I keep running into is the time it takes to load data into the tables, in order to load this 1TB data into snowflake it would take 5 days! The way I am currently adding data from my pyspark dataframe to snowflake is like so:

```<code>df.write.format("snowflake") \
    .option("sfurl", "...") \
    .option("sfuser", "...") \
    ...
    .mode("overwrite") \
    .save()
</code>```

What is the most time effective way to perform a save to snowflake from a pyspark dataframe?

Body:
I currently have a 1TB dataset loaded into a pyspark dataframe on databricks. I have a connection string to snowflake and can read/write data to snowflake tables. The issue I keep running into is the time it takes to load data into the tables, in order to load this 1TB data into snowflake it would take 5 days! The way I am currently adding data from my pyspark dataframe to snowflake is like so:

df.write.format("snowflake") \
    .option("sfurl", "...") \
    .option("sfuser", "...") \
    ...
    .mode("overwrite") \
    .save()

What is the most time effective way to perform a save to snowflake from a pyspark dataframe?


问:
Invoking a putty session on hitting submit button from UI
I had a Angular and NodeJS GUI and I have created a form in angular, I was trying to invoke a putty session on hitting the submit button of form. I Checked for some resources on this but was not able to find any. Do anyone know how can I get this done?

I looked for resources but was not able to getting anything useful.


问:
NHibernate 3 QueryOver one to many
I have this nhibernate query

```<code>        var session = SessionFactory.GetCurrentSession();

        var users = session.QueryOver<User>()
            .Where(u => u.Enabled)
            .WhereRestrictionOn(u=>u.Orders).IsNull
            .Inner.JoinQueryOver<Foo>(a => a.Foos).Where(c => c.Enabled)
            .Inner.JoinQueryOver<Bar>(m => m.Bars).Where(m => m.Enabled)
            .TransformUsing(new DistinctRootEntityResultTransformer())
            .List();
</code>```

WhereRestrictionOn Orders doesn't work

but I am trying to ensure these users have zero orders but have Foos and Bars

Can anyone help with a way to do it in NHibernate?

Update:

Here is how I changed this so far - seems to work

```<code>        var session = SessionFactory.GetCurrentSession();
        User rawUser = null;

        var existing = QueryOver.Of<Order>().Where(x => x.UserID == rawUser.UserID).Select(x=>x.User);

        var users = session.QueryOver<User>(() => rawUser)
            .Where(u => u.Enabled)
            .WithSubquery.WhereNotExists(existing)
            .Inner.JoinQueryOver<Foo>(a => a.Foos).Where(c => c.Enabled)
            .Inner.JoinQueryOver<Bar>(m => m.Bars).Where(m => m.Enabled)
            .TransformUsing(new DistinctRootEntityResultTransformer())
            .List();
</code>```

ContentLicense: CC BY-SA 3.0

Title: NHibernate 3 QueryOver one to many

Body:
I have this nhibernate query

        var session = SessionFactory.GetCurrentSession();

        var users = session.QueryOver<User>()
            .Where(u => u.Enabled)
            .WhereRestrictionOn(u=>u.Orders).IsNull
            .Inner.JoinQueryOver<Foo>(a => a.Foos).Where(c => c.Enabled)
            .Inner.JoinQueryOver<Bar>(m => m.Bars).Where(m => m.Enabled)
            .TransformUsing(new DistinctRootEntityResultTransformer())
            .List();

WhereRestrictionOn Orders doesn't work

but I am trying to ensure these users have zero orders but have Foos and Bars

Can anyone help with a way to do it in NHibernate?

Update:

Here is how I changed this so far - seems to work

        var session = SessionFactory.GetCurrentSession();
        User rawUser = null;

        var existing = QueryOver.Of<Order>().Where(x => x.UserID == rawUser.UserID).Select(x=>x.User);

        var users = session.QueryOver<User>(() => rawUser)
            .Where(u => u.Enabled)
            .WithSubquery.WhereNotExists(existing)
            .Inner.JoinQueryOver<Foo>(a => a.Foos).Where(c => c.Enabled)
            .Inner.JoinQueryOver<Bar>(m => m.Bars).Where(m => m.Enabled)
            .TransformUsing(new DistinctRootEntityResultTransformer())
            .List();


问:
Why does inline asm LEA on a class member variable compile to a constant zero in Visual Studio?
When I compile a C++ program that uses assembly (using Visual Studio 2022), some of the assembly code appears to be adjusted or at least optimized away (but I have optimizations disabled).

Does anyone know what's going on and how I can make it not do this?

The purpose behind this code (at least the non-summarized version) is to create a wrapper class for another class defined in a DLL that I do not have the source for. Essentially, I am calling the constructor of the DLL class which requires ECX to be an address in the stack that points to 0 (an empty pointer).

SampleClass.h

```<code>class SampleClass
{
public:
    SampleClass();

private:
    uintptr_t value1;
};
</code>```

SampleClass.cpp

```<code>SampleClass::SampleClass() :
    value1(0)
{
    __asm {
        // When I compile this converts to LEA ECX, 0...
        // I want it to hold the value for the address of value1.
        LEA ECX, DWORD PTR SS : [value1]
    }
}
</code>```

If I adjust the function to this, it doesn't remove/change the code... but crashes at the end of the function saying that the stack data around value2 is corrupt.

```<code>SampleClass::SampleClass() :
    value1(0)
{
    uintptr_t value2;

    __asm {
        LEA ECX, DWORD PTR SS : [value2]
    }

    value1 = value2;
    // Crashes here...
}
</code>```

Body:
When I compile a C++ program that uses assembly (using Visual Studio 2022), some of the assembly code appears to be adjusted or at least optimized away (but I have optimizations disabled).

Does anyone know what's going on and how I can make it not do this?

The purpose behind this code (at least the non-summarized version) is to create a wrapper class for another class defined in a DLL that I do not have the source for. Essentially, I am calling the constructor of the DLL class which requires ECX to be an address in the stack that points to 0 (an empty pointer).

SampleClass.h

class SampleClass
{
public:
    SampleClass();

private:
    uintptr_t value1;
};

SampleClass.cpp

SampleClass::SampleClass() :
    value1(0)
{
    __asm {
        // When I compile this converts to LEA ECX, 0...
        // I want it to hold the value for the address of value1.
        LEA ECX, DWORD PTR SS : [value1]
    }
}

If I adjust the function to this, it doesn't remove/change the code... but crashes at the end of the function saying that the stack data around value2 is corrupt.

SampleClass::SampleClass() :
    value1(0)
{
    uintptr_t value2;

    __asm {
        LEA ECX, DWORD PTR SS : [value2]
    }

    value1 = value2;
    // Crashes here...
}


问:
calculate an average on a calculated measure in DirectQuery
I'm using Power BI, in directQuery mode for all my tables (other than my date table).
I can't change that.

To simplify, I have a fact table that has an id, a date field and a sales figure (not even using the sales for this question.. just the fact that there is a sale on this date).
The date field relates to my date dimension as you'd expect.

I have created a measure, which is a rolling 2 year count of sales (not sum, just count).

```<code>Rolling_year_sales_count = CALCULATE(
    DISTINCTCOUNT( fact[sale_id]),
    DATESINPERIOD(
        dim_date[yyyy_mm_dd],
        LASTDATE(dim_date[yyyy_mm_dd]),
        -2,
        Year
    ))
</code>```

this looks good when I put it on a simple table - its properly counting the rolling year counts.

Now, I want to create a rolling 2 year AVERAGE count.

So the result should show 2 for 1925, 5 for 1926, 8 for 1927... (Add the 2 previous year's rolling counts, and divide by 2)
I tried just including this measure in a new measure that uses SUMMARIZE - but because I am using DirectQuery, I cannot refer to calculated measures in my SUMMARIZE.. Same goes for CALCULATE.

So how can I calculate this average, knowing that I'm in directQuery mode?
Thanks!

Body:
I'm using Power BI, in directQuery mode for all my tables (other than my date table).
I can't change that.

To simplify, I have a fact table that has an id, a date field and a sales figure (not even using the sales for this question.. just the fact that there is a sale on this date).
The date field relates to my date dimension as you'd expect.

I have created a measure, which is a rolling 2 year count of sales (not sum, just count).

Rolling_year_sales_count = CALCULATE(
    DISTINCTCOUNT( fact[sale_id]),
    DATESINPERIOD(
        dim_date[yyyy_mm_dd],
        LASTDATE(dim_date[yyyy_mm_dd]),
        -2,
        Year
    ))

this looks good when I put it on a simple table - its properly counting the rolling year counts.

Now, I want to create a rolling 2 year AVERAGE count.

So the result should show 2 for 1925, 5 for 1926, 8 for 1927... (Add the 2 previous year's rolling counts, and divide by 2)
I tried just including this measure in a new measure that uses SUMMARIZE - but because I am using DirectQuery, I cannot refer to calculated measures in my SUMMARIZE.. Same goes for CALCULATE.

So how can I calculate this average, knowing that I'm in directQuery mode?
Thanks!


问:
Is there a way move data from a Delta Table in S3 to Redshift using Copy Command?
I've Delta Tables that are created in a S3 Bucket, need to load this data as-is into Redshift tables.
The delta table has Symlink Format Manifest generated and some delta tables might have partitions.
Is there a way to move this data into Redshift?

I've tried to run the Copy Command on the Delta Table giving the path till the Table Name.

```<code>COPY <schema>.<table>
FROM 's3://<bucket-name>/<delta_table_name>/'
IAM_ROLE '<iam_role>'
FORMAT AS PARQUET
</code>```

Tried to run the Copy Command using the path to the Symlink Format Manifest directory in S3. Neither worked.

```<code>COPY <schema>.<table>
FROM 's3://<bucket-name>/<delta_table_name>/_symlink_format_manifest/PARTITION1=VALUE1/PARTITION2=VALUE2/manifest'
IAM_ROLE '<iam_role>'
FORMAT AS PARQUET
</code>```

Body:
I've Delta Tables that are created in a S3 Bucket, need to load this data as-is into Redshift tables.
The delta table has Symlink Format Manifest generated and some delta tables might have partitions.
Is there a way to move this data into Redshift?

I've tried to run the Copy Command on the Delta Table giving the path till the Table Name.

COPY <schema>.

FROM 's3://<bucket-name>/<delta_table_name>/'
IAM_ROLE '<iam_role>'
FORMAT AS PARQUET

Tried to run the Copy Command using the path to the Symlink Format Manifest directory in S3. Neither worked.

COPY <schema>.

FROM 's3://<bucket-name>/<delta_table_name>/_symlink_format_manifest/PARTITION1=VALUE1/PARTITION2=VALUE2/manifest'
IAM_ROLE '<iam_role>'
FORMAT AS PARQUET


问:
unable to change current working diectory in pycharm
I am unable to change directory in Pycharm.

My code is

```<code>import os

os.getcwd()
os.chdir("//Users//apple//Desktop//Employedata")
os.getcwd()
os.getcwd()
</code>```

and the result on the console is:-

```<code> /Users/apple/PycharmProjects/pythonProject4/venv/bin/python /Users/apple/PycharmProjects/pythonProject4/main.py

  Process finished with exit code 0
</code>```

I want to change the directory to:-

```<code>  "//Users//apple//Desktop//Employedata"
</code>```

My path is correct as it is  showing no error
Then, why am I not able to change the directory ?

Body:
I am unable to change directory in Pycharm.

My code is

import os

os.getcwd()
os.chdir("//Users//apple//Desktop//Employedata")
os.getcwd()
os.getcwd()

and the result on the console is:-

 /Users/apple/PycharmProjects/pythonProject4/venv/bin/python /Users/apple/PycharmProjects/pythonProject4/main.py

  Process finished with exit code 0

I want to change the directory to:-

  "//Users//apple//Desktop//Employedata"

My path is correct as it is  showing no error
Then, why am I not able to change the directory ?


问:
R httr modify_url path is stripping v1 in the url with path parameter
I am in the process of building a wrapper package for a web-based API.

```<code>library(httr)

path <- "datapoint/timeseries"
query <- list(onData = "Variable")

devsite_api <- function(path, query = NULL) {
  url <- httr::modify_url("https://api.devsite.com/v1/", path = path, query = query)
  return(url)
}

devsite_api(path = path, query = query)
</code>```

The result of this is

```<code>"https://api.devsite.com/datapoint/timeseries?onData=Variable"
</code>```

I'd like for the result to be

```<code>"https://api.devsite.com/v1/datapoint/timeseries?onData=Variable"
</code>```

When I looked into the modify_url it function it seems to turn the url into a URL object which identifies hostnames, paths, etc.  How can I make this function work without introducing something like:

```<code>devsite_api <- function(path, query = NULL) {
  path_changed <- paste("v1", path, sep = "/")
  url <- httr::modify_url("https://api.devsite.com", path = path_changed, query = query)
  return(url)
}
</code>```

Thanks.

Body:
I am in the process of building a wrapper package for a web-based API.

library(httr)

path <- "datapoint/timeseries"
query <- list(onData = "Variable")

devsite_api <- function(path, query = NULL) {
  url <- httr::modify_url("https://api.devsite.com/v1/", path = path, query = query)
  return(url)
}

devsite_api(path = path, query = query)

The result of this is

"https://api.devsite.com/datapoint/timeseries?onData=Variable"

I'd like for the result to be

"https://api.devsite.com/v1/datapoint/timeseries?onData=Variable"

When I looked into the modify_url it function it seems to turn the url into a URL object which identifies hostnames, paths, etc.  How can I make this function work without introducing something like:

devsite_api <- function(path, query = NULL) {
  path_changed <- paste("v1", path, sep = "/")
  url <- httr::modify_url("https://api.devsite.com", path = path_changed, query = query)
  return(url)
}

Thanks.


问:
How to delete all the data generated by the docker version of taosBenchmark?
How to delete all the data generated by the docker version of taosBenchmark?
Uninstalling will keep the data, and deleting the library will directly delete the corresponding data, i want to make sure if this is right.</p>


问:
Should I use only native profile if I want to use local config files in spring boot?
I'm setting local development environment to test using spring boot ver 2.7.1, and I want to use local file hierarchy as config server.

So, I use spring.cloud.config.server.native.searchLocations: ~~~.

I want to boot this project using profile named something other except 'native' (application-native.yml). But it is failed to load the server.

My Question:

When I want to use local files as config files, is it only possible to use 'native' profile?

I tried :

spring:
  profiles:
     active: local
  cloud:
     config:
       server:
         native:
           searchLocations:
                     ~~~~
```

still failed.

Body:
I'm setting local development environment to test using spring boot ver 2.7.1, and I want to use local file hierarchy as config server.

So, I use spring.cloud.config.server.native.searchLocations: ~~~.

I want to boot this project using profile named something other except 'native' (application-native.yml). But it is failed to load the server.

My Question:

When I want to use local files as config files, is it only possible to use 'native' profile?

I tried :

spring:
  profiles:
     active: local
  cloud:
     config:
       server:
         native:
           searchLocations:
                     ~~~~

still failed.


问:
DeepSHAP beeswarm plot only shows blue dots and does not have a color gradient to show feature values
I tried running an example on SHAP Deep Explainer from this link using this Titanic dataset. This is the code from the example:

```<code># import package
import shap
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras import optimizers
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
import os
# load data
os.chdir('/titanic/')
train_data = pd.read_csv('./train.csv', index_col=0)
test_data = pd.read_csv('./test.csv', index_col=0)
train_data.head()

def data_preprocessing(df):
    df = df.drop(columns=['Name', 'Ticket', 'Cabin'])

    # fill na
    df[['Age']] = df[['Age']].fillna(value=df[['Age']].mean())
    df[['Embarked']] = df[['Embarked']].fillna(value=df['Embarked'].value_counts().idxmax())
    df[['Fare']] = df[['Fare']].fillna(value=df[['Fare']].mean())

    # categorical features into numeric
    df['Sex'] = df['Sex'].map( {'female': 1, 'male': 0} ).astype(int)

    # one-hot encoding
    embarked_one_hot = pd.get_dummies(df['Embarked'], prefix='Embarked')
    df = df.drop('Embarked', axis=1)
    df = df.join(embarked_one_hot)

    return df

# train data processing
train_data = data_preprocessing(train_data)
train_data.isnull().sum()
# create data for training
x_train = train_data.drop(['Survived'], axis=1).values
# Check test data
test_data.isnull().sum()
# scale
scale = StandardScaler()
x_train = scale.fit_transform(x_train)
# prepare y_train
y_train = train_data['Survived'].values
test_data = data_preprocessing(test_data)
x_test = test_data.values.astype(float)
# scaling
x_test = scale.transform(x_test)
# Check test data
test_data.isnull().sum()

# build mlp
model = Sequential()
model.add(Dense(32, input_dim=x_train.shape[1], activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(8, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(2, activation='softmax'))
# compile model
model.compile(loss='sparse_categorical_crossentropy', optimizer = 'adam', metrics = ['accuracy'])
# fit model
model.fit(x_train, y_train, epochs=10, batch_size=64)

# compute SHAP values
explainer = shap.DeepExplainer(model, x_train)
shap_values = explainer.shap_values(x_test)

shap.summary_plot(shap_values[0], plot_type = 'bar', feature_names = test_data.columns)

shap.initjs()
shap.force_plot(explainer.expected_value[0].numpy(), shap_values[0][0], features = test_data.columns)

shap.decision_plot(explainer.expected_value[0].numpy(), shap_values[0][0], features = test_data.iloc[0,:], feature_names = test_data.columns.tolist())

shap.plots._waterfall.waterfall_legacy(explainer.expected_value[0].numpy(), shap_values[0][0], feature_names = test_data.columns)
</code>```

There is no code for generating a beeswarm plot in the example, but I used

```<code>shap.summary_plot(shap_values[0], feature_names = test_data.columns)
</code>```

and got a beeswarm plot. From my understanding, the color of the dots displays the original value of each feature, falling along a gradient of blue to red. However, the plot I got only has blue dots and doesn't have a gradient ruler on the side.

Here is the plot I got:

And here is what I expected (photo from https://shap.readthedocs.io/en/latest/example_notebooks/api_examples/plots/beeswarm.html):

Any suggestions on what could have caused this and what I can do to get the colors would be greatly appreciated. Thank you!

Body:
I tried running an example on SHAP Deep Explainer from this link using this Titanic dataset. This is the code from the example:

# import package
import shap
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras import optimizers
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
import os
# load data
os.chdir('/titanic/')
train_data = pd.read_csv('./train.csv', index_col=0)
test_data = pd.read_csv('./test.csv', index_col=0)
train_data.head()

def data_preprocessing(df):
    df = df.drop(columns=['Name', 'Ticket', 'Cabin'])

    # fill na
    df[['Age']] = df[['Age']].fillna(value=df[['Age']].mean())
    df[['Embarked']] = df[['Embarked']].fillna(value=df['Embarked'].value_counts().idxmax())
    df[['Fare']] = df[['Fare']].fillna(value=df[['Fare']].mean())

    # categorical features into numeric
    df['Sex'] = df['Sex'].map( {'female': 1, 'male': 0} ).astype(int)

    # one-hot encoding
    embarked_one_hot = pd.get_dummies(df['Embarked'], prefix='Embarked')
    df = df.drop('Embarked', axis=1)
    df = df.join(embarked_one_hot)

    return df

# train data processing
train_data = data_preprocessing(train_data)
train_data.isnull().sum()
# create data for training
x_train = train_data.drop(['Survived'], axis=1).values
# Check test data
test_data.isnull().sum()
# scale
scale = StandardScaler()
x_train = scale.fit_transform(x_train)
# prepare y_train
y_train = train_data['Survived'].values
test_data = data_preprocessing(test_data)
x_test = test_data.values.astype(float)
# scaling
x_test = scale.transform(x_test)
# Check test data
test_data.isnull().sum()

# build mlp
model = Sequential()
model.add(Dense(32, input_dim=x_train.shape[1], activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(8, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(2, activation='softmax'))
# compile model
model.compile(loss='sparse_categorical_crossentropy', optimizer = 'adam', metrics = ['accuracy'])
# fit model
model.fit(x_train, y_train, epochs=10, batch_size=64)

# compute SHAP values
explainer = shap.DeepExplainer(model, x_train)
shap_values = explainer.shap_values(x_test)

shap.summary_plot(shap_values[0], plot_type = 'bar', feature_names = test_data.columns)

shap.initjs()
shap.force_plot(explainer.expected_value[0].numpy(), shap_values[0][0], features = test_data.columns)

shap.decision_plot(explainer.expected_value[0].numpy(), shap_values[0][0], features = test_data.iloc[0,:], feature_names = test_data.columns.tolist())

shap.plots._waterfall.waterfall_legacy(explainer.expected_value[0].numpy(), shap_values[0][0], feature_names = test_data.columns)

There is no code for generating a beeswarm plot in the example, but I used

shap.summary_plot(shap_values[0], feature_names = test_data.columns)

and got a beeswarm plot. From my understanding, the color of the dots displays the original value of each feature, falling along a gradient of blue to red. However, the plot I got only has blue dots and doesn't have a gradient ruler on the side.

Here is the plot I got:

And here is what I expected (photo from https://shap.readthedocs.io/en/latest/example_notebooks/api_examples/plots/beeswarm.html):

Any suggestions on what could have caused this and what I can do to get the colors would be greatly appreciated. Thank you!


问:
Why PHP script fails to capture icmp packets by raw socket?
My PHP script uses raw socket to capture icmp packets, but actually it falis. the script is as follows:

```<code><?php
$protocal = getprotobyname("icmp");
$socket   = socket_create(AF_INET,SOCK_RAW,$protocal) or die("Cannot create socket");

while(true){
   $read   = array($socket);  $write  = NULL;  $except = NULL;
   $select = socket_select($read, $write, $except, $timeout=1, 300*1000);

   if ($select === false){
       echo "socket_select error";
       continue;
   }
   elseif($select === 0){
       echo "SocketSelect time out";
       continue;
   }
   socket_recvfrom($socket, $recv, 65535, 0, $host, $port);
   print($recv);
   sleep(1);
}
?>
</code>```

when I run the script on a host AAA with the ip of  192.168.1.72 on an Ethernet LAN ,and  I use "ping 192.168.1.72 -t" cmd on another host BBB , the ping cmd can get echo from host AAA, and  it is expected that the above running script on host AAA  can capture the icmp request packet from BBB and print some message, however  actually the script just print 'SocketSelect time out' repeatly .

can someone help to work out what is wrong with the php script ?

Body:
My PHP script uses raw socket to capture icmp packets, but actually it falis. the script is as follows:

<?php
$protocal = getprotobyname("icmp");
$socket   = socket_create(AF_INET,SOCK_RAW,$protocal) or die("Cannot create socket");

while(true){
   $read   = array($socket);  $write  = NULL;  $except = NULL;
   $select = socket_select($read, $write, $except, $timeout=1, 300*1000);

   if ($select === false){
       echo "socket_select error";
       continue;
   }
   elseif($select === 0){
       echo "SocketSelect time out";
       continue;
   }
   socket_recvfrom($socket, $recv, 65535, 0, $host, $port);
   print($recv);
   sleep(1);
}
?>

when I run the script on a host AAA with the ip of  192.168.1.72 on an Ethernet LAN ,and  I use "ping 192.168.1.72 -t" cmd on another host BBB , the ping cmd can get echo from host AAA, and  it is expected that the above running script on host AAA  can capture the icmp request packet from BBB and print some message, however  actually the script just print 'SocketSelect time out' repeatly .

can someone help to work out what is wrong with the php script ?


问:
Font style in DataRow ASP.NET Core
I was trying to change the font size on specific row cell depends on what length the string is by using DataRow, using DataGridView I get an error, same with the DataGrid. How can I manipulate the cell in every row using DataRow?

```<code>DataTable dt = new DataTable();

using (SqlDataAdapter da = new SqlDataAdapter("Command Here"))
{
    da.Fill(dt);

    foreach (DataRow asd in dt.Rows)
    {
         if (asd[4].ToString().Length >= 45)
         {
             asd[4] = "test";
         }
    }
}
</code>```

I know using = is setting a new value for that column cell, but I was trying to manipulate its style.

Title: Font style in DataRow ASP.NET Core

Body:
I was trying to change the font size on specific row cell depends on what length the string is by using DataRow, using DataGridView I get an error, same with the DataGrid. How can I manipulate the cell in every row using DataRow?

DataTable dt = new DataTable();

using (SqlDataAdapter da = new SqlDataAdapter("Command Here"))
{
    da.Fill(dt);

    foreach (DataRow asd in dt.Rows)
    {
         if (asd[4].ToString().Length >= 45)
         {
             asd[4] = "test";
         }
    }
}

I know using = is setting a new value for that column cell, but I was trying to manipulate its style.


问:
Need an alternative for JCR lockmanager
We were using the JCR Lockmanager. But while using we got an exception that it has been deprecated. Issue -> https://issues.apache.org/jira/browse/OAK-6421?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
What can be a suitable alternative to JCR lockmanager ?</p>

Title: Need an alternative for JCR lockmanager


问:
How can i substitute perfomance.navigtion.type in js?
I need to change deprecated perfomance.navigtion.type to a new PerformanceNavigationTimng, but i need to save functionality when perfomance.navigtion.type gives "2" in new one.


问:
Getting "We're sorry but Login doesn't work properly without JavaScript enabled. Please enable it to continue" using rvest
Hope you are fine. I am trying to web scrape a site and I am getting this error as a response, despite the fact I am logged in to the site.

I am trying in R Studio, using httr the following code:

```<code>library(httr)
temp.url.info<-GET("https://abc.defg.io/tab")
html.text<-html_nodes(content(temp.url.info),"body")
</code>```

"We're sorry but Login doesn't work properly without JavaScript enabled. Please enable it to continue."

Using this httr VERB I get the tab in my default browser.

```<code>BROWSE("https://abc.defg.io/tab")
</code>```

I enabled Javascript and removed the add blocker in Chrome. Also using a Mac. Just as described here
How to solve noscript - doesn't work properly without JavaScript enabled when serving a Vue App

Any idea?

Body:
Hope you are fine. I am trying to web scrape a site and I am getting this error as a response, despite the fact I am logged in to the site.

I am trying in R Studio, using httr the following code:

library(httr)
temp.url.info<-GET("https://abc.defg.io/tab")
html.text<-html_nodes(content(temp.url.info),"body")

"We're sorry but Login doesn't work properly without JavaScript enabled. Please enable it to continue."

Using this httr VERB I get the tab in my default browser.

BROWSE("https://abc.defg.io/tab")

I enabled Javascript and removed the add blocker in Chrome. Also using a Mac. Just as described here
How to solve noscript - doesn't work properly without JavaScript enabled when serving a Vue App

Any idea?


问:
change host name in URL in to the react application
I send the following data as a string from the backend to the frontend. I want to identify the img tag and replace it host name in src attribute.

localhost should be changed to hellosrilanka in img tag src attribute in react application. how to do it ?

"
\r\n
A deductible is a fixed amount of money you must pay before insurance will start to pay a portion of\r\n        covered medical expenses. And your health plan's out-of-pocket (OOP) limit represents your "worst case"\r\n        financial exposure in a given plan year.\r\n
\r\n
\r\n        \r\n
\r\n
"


问:
While running the command chef-client -zr "recipe[twst-cookbook-test-recipe]" following warninng
While running the command chef-client -zr "recipe[twst-cookbook-test-recipe]" following warning shows?

```<code>WARN: No config file found or specified on command line. Using command line options instead.
Chef Infra Client, version 17.10.0
Patents: https://www.chef.io/patents
Infra Phase starting
Resolving cookbooks for run list: ["test-cookbook::test-recipe"]
Synchronizing cookbooks:
  - test-cookbook (0.1.0)
Installing cookbook gem dependencies:
Compiling cookbooks...
Loading Chef InSpec profile files:
Loading Chef InSpec input files:
Loading Chef InSpec waiver files:
Converging 0 resources

Running handlers:
Running handlers complete
Infra Phase complete, 0/0 resources updated in 02 seconds?
</code>```

I want to create file using test-recipe code but it gives this warning I am new learner of chef what should I do.

Body:
While running the command chef-client -zr "recipe[twst-cookbook-test-recipe]" following warning shows?

WARN: No config file found or specified on command line. Using command line options instead.
Chef Infra Client, version 17.10.0
Patents: https://www.chef.io/patents
Infra Phase starting
Resolving cookbooks for run list: ["test-cookbook::test-recipe"]
Synchronizing cookbooks:
  - test-cookbook (0.1.0)
Installing cookbook gem dependencies:
Compiling cookbooks...
Loading Chef InSpec profile files:
Loading Chef InSpec input files:
Loading Chef InSpec waiver files:
Converging 0 resources

Running handlers:
Running handlers complete
Infra Phase complete, 0/0 resources updated in 02 seconds?

I want to create file using test-recipe code but it gives this warning I am new learner of chef what should I do.


问:
Failed to resolve entry for package "data-generator-retail"
I have cloned this (https://github.com/marmelab/react-admin) project and tried to run it. I run command of yarn install. Still it generates this below mentioned error.
Failed to resolve entry for package "data-generator-retail". The package may have incorrect main/module/exports specified in its package.json.

I explicitly run "yarn add data-generator-retail" but still it remained same.


问:
Need help converting three.js snippet to React Three Fiber
I'm trying to follow a tutorial on three.js, but coding it in React three fiber. Am stuck with the following snippet, to create a block, with line and edge geometries. Can anyone help, I basically need to convert it to R3F?

```<code>three.js:
function Block(x, y, z){
    this.x = x;
    this.y = y;
    this.z = z;

    this.display = function(){
        var blockBox = new THREE.BoxBufferGeometry(5, 5, 5); // w, h, d
        var blockMesh = new THREE.MeshBasicMaterial({color : 0x00ff00});
        var block = new THREE.Mesh(blockBox, blockMesh);
        scene.add(block);
        block.position.x = this.x;
        block.position.y = this.y - 10;
        block.position.z = this.z;

        var edges = new THREE.EdgesGeometry(blockBox);
        var line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({color : 0x000000}));
        scene.add(line);
        line.position.x = this.x;
        line.position.y = this.y - 10;
        line.position.z = this.z;
    }
}

</code>```

What I have in React three fiber so far:

```<code>const Block = ({ x, y, z }) => {
    return (
        <mesh visible={true} position={[x, y, z]} scale={[1, 1, 1]}>
            <boxGeometry />
            <meshBasicMaterial wireframe color={"green"} />

            <lineSegments >
                <edgesGeometry />

            </lineSegments>
        </mesh>
    );
}
</code>```

Basically need help converting the snippet to R3F

Body:
I'm trying to follow a tutorial on three.js, but coding it in React three fiber. Am stuck with the following snippet, to create a block, with line and edge geometries. Can anyone help, I basically need to convert it to R3F?

three.js:
function Block(x, y, z){
    this.x = x;
    this.y = y;
    this.z = z;

    this.display = function(){
        var blockBox = new THREE.BoxBufferGeometry(5, 5, 5); // w, h, d
        var blockMesh = new THREE.MeshBasicMaterial({color : 0x00ff00});
        var block = new THREE.Mesh(blockBox, blockMesh);
        scene.add(block);
        block.position.x = this.x;
        block.position.y = this.y - 10;
        block.position.z = this.z;

        var edges = new THREE.EdgesGeometry(blockBox);
        var line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({color : 0x000000}));
        scene.add(line);
        line.position.x = this.x;
        line.position.y = this.y - 10;
        line.position.z = this.z;
    }
}

What I have in React three fiber so far:

const Block = ({ x, y, z }) => {
    return (
        <mesh visible={true} position={[x, y, z]} scale={[1, 1, 1]}>
            <boxGeometry />
            <meshBasicMaterial wireframe color={"green"} />

            <lineSegments >
                <edgesGeometry />

            </lineSegments>
        </mesh>
    );
}

Basically need help converting the snippet to R3F


问:
Should I use a wordpress hook to replace a file?
I'm having a little trouble deciding how I should be implementing hooks in wordpress.

I'm currently using a child theme and in the single.php file of the parent theme there is a function <?php con_get_sharebox(); ?> that gets the contents of a file sharebox.php.

Now the sharebox.php file is the file I'd like to edit but I don't know how to do this using hooks.

I tried simply adding a different sharebox.php to my child theme but because its not part of the standard theme files I don't think it gets loaded.

Any ideas on what I can do?


问:
Hide Spinner element when loading api done typescript
How to hide the spinner when the API load? how to use the *ngIf for this type of problem?

                        <mat-progress-spinner mode="indeterminate">

                            {{weather.current.humidity}}

                    </mat-progress-spinner>

```


问:
fetch in local json file not working on build time but only works in development mode
I'm working on a vanilla javascript project bundled with vitejs everything works fine in development mode however when i run build and preview it with live server, fetching on local json data is not working.

here's the code I'm working on

loadData.js

```<code>const initData = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
  },
  mode: "cors",
  cache: "default",
};
const requestData = new Request("./api/portfolioData.json", initData);

export const loadData = async function fetchData() {
  const response = await fetch(requestData);

  const data = await response.json();
  if (!response.ok) {
    return new Error("Not found", response.status);
  }
  return data;
};

</code>```

UI project.js

```<code>import { loadData } from "../../services/data/loadData";
function Project() {
  loadData()
    .then((data) => {
      let placeholder = document.querySelector(".project-list");
      let out ="";
      for (let item of data) {
        out += `<div class="flip-card" tabindex=${item.id}>
    <div class="flip-card-inner">
      <div class="flip-card-front">
        <img src=${item.image} alt="" />
        <h3>${item.title}</h3>
      </div>
      <div class="flip-card-back">
        <h3>
          Tech use <i class="fa-sharp fa-solid fa-layer-group"></i>
          <br />
          <span>${item.techStack}</span>
        </h3>
        <p>
          <span>Description:</span>
          ${item.description}
        </p>
        <span class="demo"
          ><a href=${item.demo} target="_blank"
            >demo<i class="fa-solid fa-globe"></i
          ></a>
          <a
            href=${item.repo}
            target="_blank"
            >repo<i class="fa-brands fa-github"></i
          ></a>
        </span>
      </div>
    </div>
    </div>`;
      }
      placeholder.innerHTML = out;
    })
    .catch((err) => {
      console.log(err);
    });
}

export default Project;
</code>```

I tried to google for solution but there's no luck that works on my case.

i tried to add full path but i'm getting a cors error.
const requestData = new Request("https://localhost:5173/api/portfolioData.json", initData);

Body:
I'm working on a vanilla javascript project bundled with vitejs everything works fine in development mode however when i run build and preview it with live server, fetching on local json data is not working.

here's the code I'm working on

loadData.js

const initData = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
  },
  mode: "cors",
  cache: "default",
};
const requestData = new Request("./api/portfolioData.json", initData);

export const loadData = async function fetchData() {
  const response = await fetch(requestData);

  const data = await response.json();
  if (!response.ok) {
    return new Error("Not found", response.status);
  }
  return data;
};

UI project.js

import { loadData } from "../../services/data/loadData";
function Project() {
  loadData()
    .then((data) => {
      let placeholder = document.querySelector(".project-list");
      let out ="";
      for (let item of data) {
        out += `

${item.title}

          Tech use

          ${item.techStack}

          Description:
          ${item.description}

        demo
          repo

`;
      }
      placeholder.innerHTML = out;
    })
    .catch((err) => {
      console.log(err);
    });
}

export default Project;

I tried to google for solution but there's no luck that works on my case.

i tried to add full path but i'm getting a cors error.
const requestData = new Request("https://localhost:5173/api/portfolioData.json", initData);


问:
How can i create multipe tabs in ace editor?
Am trying to create multiple tabs for ace editor but whenever i click on the tab and type something and then click to the "Click me" button  and go to the next tab, the previous tabs become blurred and even if i call the focus() method on there editors, nothing they remain in the blured
This is my code in index.html

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/css/bootstrap.min.css">

  <title></title>

    <button onclick="foo()" class= "btn btn-success"> click Me</button>

            <button class="nav-link active border-0" num="1" id="1-tab" onclick="checkBack(this)" data-bs-toggle="tab" data-bs-target="#you1" type="button" role="tab" aria-controls="you1" aria-selected="true">Tab1</button>

```
<p>and here is my code in index.js</p>
<pre class="lang-js prettyprint-override"><code>let attrB = [
    'class:nav-item border',
    'role:presentation'
]

let count = 1
let tab1 = document.querySelector("#myTab")
let tabContent = document.querySelector(".tab-content")
let editors = [ace.edit("you1")]

class CreateTabs {
    constructor(id) {
        var firstTb = document.querySelector('#myTab li:last-child button')

        this.id = id + 1
        this.elmNode = document.createElement('li')
        this.insertAttr(attrB, this.elmNode)
        tab1.appendChild(this.elmNode)
        this.addTabContent()
        this.addInnerKid()
        count = this.id
        var tab = new bootstrap.Tab(firstTb)
        console.log(tab);
        tab.show()
    }
    addTabContent() {
        tabContent.innerHTML += `
        <div class="tab-pane position-fixed bottom-0 start-0 ms-0 mt-1" style=" top:80px;right: 0px;" id="you${this.id}" role="tabpanel" aria-labelledby="${this.id}-tab"></div>
        `
    }
    addInnerKid() {
        this.addTabContent()
        this.elmNode.innerHTML = `
        <button class="nav-link border-0" num="${this.id}" onclick="checkBack(this)" id="${this.id}-tab" data-bs-toggle="tab" data-bs-target="#you${this.id}" type="button" role="tab" aria-controls="you${this.id}" aria-selected="false">Tab${this.id}</button>
        `
    }
    insertAttr(attrBts, elm) {
        for (let i of attrBts) {
            let attrbt = i.split(':')
            elm.setAttribute(attrbt[0], attrbt[1])
        }
    }
}

function checkBack(x) {
    let attrb = x.getAttribute("aria-controls")
    let contents = document.getElementById(attrb)
    let ed;
    if (contents.innerHTML === "") {
        ed = ace.edit(contents)
        editors.push(ed)
        console.log(ed)
    } else {
        let tabCount = "editor" + x.getAttribute('num')
        for (let i = 0; i < editors.length; i++) {
            if (editors[i].id === tabCount) {
                ed = editors[i]
                ed.focus()
            } else {
                editors[i].blur()
            }

        }
    }
}

function foo() {
    new CreateTabs(count)
}
</code>```

I have also observed some abnormality that happens when i create multiple tabs before clicking in any of them. The tab contents will all be editable but the problem comes again when i try to create another tab which in this case makes others blurred permanently

Body:
Am trying to create multiple tabs for ace editor but whenever i click on the tab and type something and then click to the "Click me" button  and go to the next tab, the previous tabs become blurred and even if i call the focus() method on there editors, nothing they remain in the blured
This is my code in index.html

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/css/bootstrap.min.css">

  <title></title>

    <button onclick="foo()" class= "btn btn-success"> click Me</button>

            <button class="nav-link active border-0" num="1" id="1-tab" onclick="checkBack(this)" data-bs-toggle="tab" data-bs-target="#you1" type="button" role="tab" aria-controls="you1" aria-selected="true">Tab1</button>

and here is my code in index.js

let attrB = [
    'class:nav-item border',
    'role:presentation'
]

let count = 1
let tab1 = document.querySelector("#myTab")
let tabContent = document.querySelector(".tab-content")
let editors = [ace.edit("you1")]

class CreateTabs {
    constructor(id) {
        var firstTb = document.querySelector('#myTab li:last-child button')

        this.id = id + 1
        this.elmNode = document.createElement('li')
        this.insertAttr(attrB, this.elmNode)
        tab1.appendChild(this.elmNode)
        this.addTabContent()
        this.addInnerKid()
        count = this.id
        var tab = new bootstrap.Tab(firstTb)
        console.log(tab);
        tab.show()
    }
    addTabContent() {
        tabContent.innerHTML += `

        `
    }
    addInnerKid() {
        this.addTabContent()
        this.elmNode.innerHTML = `
        <button class="nav-link border-0" num="${this.id}" onclick="checkBack(this)" id="${this.id}-tab" data-bs-toggle="tab" data-bs-target="#you${this.id}" type="button" role="tab" aria-controls="you${this.id}" aria-selected="false">Tab${this.id}</button>
        `
    }
    insertAttr(attrBts, elm) {
        for (let i of attrBts) {
            let attrbt = i.split(':')
            elm.setAttribute(attrbt[0], attrbt[1])
        }
    }
}

function checkBack(x) {
    let attrb = x.getAttribute("aria-controls")
    let contents = document.getElementById(attrb)
    let ed;
    if (contents.innerHTML === "") {
        ed = ace.edit(contents)
        editors.push(ed)
        console.log(ed)
    } else {
        let tabCount = "editor" + x.getAttribute('num')
        for (let i = 0; i < editors.length; i++) {
            if (editors[i].id === tabCount) {
                ed = editors[i]
                ed.focus()
            } else {
                editors[i].blur()
            }

        }
    }
}

function foo() {
    new CreateTabs(count)
}

I have also observed some abnormality that happens when i create multiple tabs before clicking in any of them. The tab contents will all be editable but the problem comes again when i try to create another tab which in this case makes others blurred permanently


问:
Generating annotated text description of structs with size/offset of fields for a given architecture during compilation?
Basically, I would like to obtain the information about packing of structs on a given architecture during the compilation process, formatted as a text file with the struct description (code stripped of original comments), with added comments containing the size and offset of a given field.

Let me give an example - consider the following trivial code, test_struct.c:

#include <stdint.h>
#include <stdio.h>

struct MyStruct {
  uint8_t first;    // this is the first field
  uint16_t second;  // second field
  uint32_t third;   // third field is also important
  uint64_t fourth;  // do not forget fourth field
};
typedef struct MyStruct MyStruct_t;

MyStruct_t my_object = {
  .first  = 10,
  .second = 20,
  .third  = 30,
  .fourth = 40,
};

int main(void) {
  printf("Start: %d\n", my_object.first);
  while ( 1 ) {
    ;
  }
}
```
<p>I can compile this for PC (say Linux) with:</p>
<pre class="lang-none prettyprint-override"><code>gcc -Wall -g -o test_struct.exe test_struct.c
</code>```

... and I can compile for ARM with:

arm-none-eabi-gcc --specs=nosys.specs -Wall -g -o test_struct.elf test_struct.c
```
<p>Now, for outputting the struct info, I've found Extract detailed symbol information (struct members) from elf file compiled with ARM-GCC :</p>
<blockquote>
<p>is pahole what you need? it can dump variable structure with size and offset.</p>
</blockquote>
<p>... and indeed, on Linux I can do:</p>
<pre class="lang-none prettyprint-override"><code>$ pahole -C MyStruct test_struct.exe
struct MyStruct {
    uint8_t                    first;                /*     0     1 */

    /* XXX 1 byte hole, try to pack */

    uint16_t                   second;               /*     2     2 */
    uint32_t                   third;                /*     4     4 */
    uint64_t                   fourth;               /*     8     8 */

    /* size: 16, cachelines: 1, members: 4 */
    /* sum members: 15, holes: 1, sum holes: 1 */
    /* last cacheline: 16 bytes */
};
</code>```

... and that is the output that I want - compilable text description of the struct, with the original comments stripped, and comments with size and offset of fields added.

However, that "try to pack" worries me - I would like a description of the struct exactly as-is in code; and ultimately, I'd like to compare the default packing of the struct between architectures (in this example, Linux and ARM).

So, I was thinking - since it is generally "the same compiler" (GCC) being used in both cases, would it be possible to instruct the compiler (maybe through a custom script?) to generate such descriptions for selected structs in code? Such that it would be the "same" gcc command in a Cmake/Makefile that executes, regardless of which architecture the code is being built for - and it generates the information for that architecture?

If not, I guess I'd be forced to extract this information in a post-build step; in that case, is pahole my only option, or are there other tools that can generate this kind of information? pahole on Linux seems able to parse the ARM .elf file (pahole -C MyStruct test_struct.exe) - but is does that give accurate architecture-specific information? How do I ensure that I get a description of a struct as-is in memory for a given architecture build, without any attempts for packing by such tools?

( and in either of these cases, are there options to control the text formatting? For instance, I'd rather get an output like this, compared to the above pahole example:

struct MyStruct {
    uint8_t  first;  // 0 1
    uint16_t second; // 2 2
    uint32_t third;  // 4 4
    uint64_t fourth; // 8 8
};
```

)

Body:
Basically, I would like to obtain the information about packing of structs on a given architecture during the compilation process, formatted as a text file with the struct description (code stripped of original comments), with added comments containing the size and offset of a given field.

Let me give an example - consider the following trivial code, test_struct.c:

#include <stdint.h>
#include <stdio.h>

struct MyStruct {
  uint8_t first;    // this is the first field
  uint16_t second;  // second field
  uint32_t third;   // third field is also important
  uint64_t fourth;  // do not forget fourth field
};
typedef struct MyStruct MyStruct_t;

MyStruct_t my_object = {
  .first  = 10,
  .second = 20,
  .third  = 30,
  .fourth = 40,
};

int main(void) {
  printf("Start: %d\n", my_object.first);
  while ( 1 ) {
    ;
  }
}

I can compile this for PC (say Linux) with:

gcc -Wall -g -o test_struct.exe test_struct.c

... and I can compile for ARM with:

arm-none-eabi-gcc --specs=nosys.specs -Wall -g -o test_struct.elf test_struct.c

Now, for outputting the struct info, I've found Extract detailed symbol information (struct members) from elf file compiled with ARM-GCC :

is pahole what you need? it can dump variable structure with size and offset.

... and indeed, on Linux I can do:

$ pahole -C MyStruct test_struct.exe
struct MyStruct {
    uint8_t                    first;                /*     0     1 */

    /* XXX 1 byte hole, try to pack */

    uint16_t                   second;               /*     2     2 */
    uint32_t                   third;                /*     4     4 */
    uint64_t                   fourth;               /*     8     8 */

    /* size: 16, cachelines: 1, members: 4 */
    /* sum members: 15, holes: 1, sum holes: 1 */
    /* last cacheline: 16 bytes */
};

... and that is the output that I want - compilable text description of the struct, with the original comments stripped, and comments with size and offset of fields added.

However, that "try to pack" worries me - I would like a description of the struct exactly as-is in code; and ultimately, I'd like to compare the default packing of the struct between architectures (in this example, Linux and ARM).

So, I was thinking - since it is generally "the same compiler" (GCC) being used in both cases, would it be possible to instruct the compiler (maybe through a custom script?) to generate such descriptions for selected structs in code? Such that it would be the "same" gcc command in a Cmake/Makefile that executes, regardless of which architecture the code is being built for - and it generates the information for that architecture?

If not, I guess I'd be forced to extract this information in a post-build step; in that case, is pahole my only option, or are there other tools that can generate this kind of information? pahole on Linux seems able to parse the ARM .elf file (pahole -C MyStruct test_struct.exe) - but is does that give accurate architecture-specific information? How do I ensure that I get a description of a struct as-is in memory for a given architecture build, without any attempts for packing by such tools?

( and in either of these cases, are there options to control the text formatting? For instance, I'd rather get an output like this, compared to the above pahole example:

struct MyStruct {
    uint8_t  first;  // 0 1
    uint16_t second; // 2 2
    uint32_t third;  // 4 4
    uint64_t fourth; // 8 8
};

)


问:
How get id and save in another document before leave in Firebase Flutter?
I'm trying to make a reference between two documents.

I have this:

```<code>collectionReferenceRel.add({
    'idRoom': id,
    'room': rel,
    'rel': room,
    'id': '',
  }).then(
    (idRel) {
      idRel1 = idRel.id;
    },
  );
  collectionReferenceRel.add({
    'idRoom': id,
    'room': room,
    'rel': rel,
    'id': '',
  }).then((value2) {
    idNode2 = value2.id;
  }).whenComplete(() async {
    await collectionReferenceRel.doc(idRel1).update({
      'id': idRel2,
    });
    await collectionReferenceRel.doc(idRel2).update({
      'id': idRel1,
    });
  }).catchError((error) {
    CustomFullScreenDialog.cancelDialog();
    CustomSnackBar.showSnackBar(
        context: Get.context,
        title: 'Error',
        message: 'Something went wrong',
        backgroundColor: Colors.green);
  });
</code>```

That works if I save just one (two documents) But if I try to save more then one doesn't works, some documents doesn't get correct Id.

I'm using a dropdown to select my registers, when user push button to save I have this:

```<code>for(var i in _listRelSelected) {
   saveUpdateRel(roomName!, docId!, i.room, i.id);}
</code>```

Somebody can tell me what is wrong?

Thanks

Body:
I'm trying to make a reference between two documents.

I have this:

collectionReferenceRel.add({
    'idRoom': id,
    'room': rel,
    'rel': room,
    'id': '',
  }).then(
    (idRel) {
      idRel1 = idRel.id;
    },
  );
  collectionReferenceRel.add({
    'idRoom': id,
    'room': room,
    'rel': rel,
    'id': '',
  }).then((value2) {
    idNode2 = value2.id;
  }).whenComplete(() async {
    await collectionReferenceRel.doc(idRel1).update({
      'id': idRel2,
    });
    await collectionReferenceRel.doc(idRel2).update({
      'id': idRel1,
    });
  }).catchError((error) {
    CustomFullScreenDialog.cancelDialog();
    CustomSnackBar.showSnackBar(
        context: Get.context,
        title: 'Error',
        message: 'Something went wrong',
        backgroundColor: Colors.green);
  });

That works if I save just one (two documents) But if I try to save more then one doesn't works, some documents doesn't get correct Id.

I'm using a dropdown to select my registers, when user push button to save I have this:

for(var i in _listRelSelected) {
   saveUpdateRel(roomName!, docId!, i.room, i.id);}

Somebody can tell me what is wrong?

Thanks


问:
A qt window and and the title of the main window is aligned to the left , i want to center it and apply different stylesheet attributes to it
I have developed a qt main window with different panels (image is for reference) , but the main window title is aligned to the left , i searched about this and found out that it is dependent on the underlying os , and one solution to this is frameless window .  I have tried that but my menu seems to disappear. i am attaching my main window code and image of the main window.

i tried creating a frameless window using self.setWindowFlags(Qt.FramelessWindowHint) added css code and did self.setstylesheet(css code); but it makes everything disappear, only the window comes.

this is my main window code.

from Alert_panel.dock_tab_widget import AlertDockwid
from cam_config.cam_player import CamPlayer
from PyQt5.QtGui import QPalette,QLinearGradient,QColor,QBrush
from common.menu import MainWindowMenu
from common import constant
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap, QIcon, QImage, QPalette
from PyQt5.QtCore import QThread, pyqtSignal, Qt, QEvent, QObject, QUrl
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from dock_widget import DockWidget
from login_page.login import LoginForm

class MainWindow(QMainWindow):

    def __init__(self) -> None:

        super(MainWindow, self).__init__()
        self.v_layout = QHBoxLayout()
        self.camplayer = CamPlayer(self)
        self.dock_wid = DockWidget('Camera Configuration Panel', self)
        self.dock_wid_2 = DockWidget('Suspect Profile Panel', self)
        self.dock_wid.hide()
        self.dock_wid_2.hide()
        self.face_detection_table = AlertDockwid()

        self.central_wid = QStackedWidget()
        self.setCentralWidget(self.central_wid)
        self.setChildItems()
        self.setWindowTitle("SUSPECT LOOKOUT ALERT SYSTEM")

        self.setWindowFlags(Qt.FramelessWindowHint)

        css ='''
                 text-align: center;
        '''
        self.setStyleSheet(css)
        # self.setStyleSheet('QMainWindow::title{color:blue; text-align:center;size:20pt}')
        # self.setWindowIcon(QtGui.QIcon(constant.project_path+'\\LOC_code\\login_page\\icons\\logo.png'))
        # self.setStyleSheet('QMainWindow::icon{size:500}')

    def setChildItems(self):
        self.login_wid = LoginForm(self)
        self.setCentralWidget(self.login_wid)

    def set_cam_widget(self):
        self.addDockWidget(Qt.BottomDockWidgetArea, self.face_detection_table)
        print("control inside set_cam_widget")
        self.face_detection_table.setAllowedAreas(Qt.BottomDockWidgetArea)
        self.menubar_obj = MainWindowMenu(self)
        self.setMenuBar(self.menubar_obj)
        self.setCentralWidget(self.camplayer)
        self.dock_wid.show()
        self.dock_wid_2.show()

def main():

    app = QApplication(sys.argv)
    ex = MainWindow()
    p = QPalette()
    gradient = QLinearGradient(0, 0, 0, 400)
    gradient.setColorAt(0.0, QColor(75,75,75))
    gradient.setColorAt(2.0, QColor(128,128, 0))
    p.setBrush(QPalette.Window, QBrush(gradient))
    ex.setPalette(p)
    ex.show()

    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
```


问:
Pytube: v12.1.2 HTTP Error 410 - How to properly install?
I've tried multiple attempts at getting this fixed including uninstalling and reinstalling pytube. I've tried to use the fix that I see in other threads from 1+ year ago. I've done different combinations of the following:

```<code>pip uninstall pytube
pip install git+https://github.com/Zeecka/pytube@fix_1060
pip install --upgrade pytube
pip install pytube
</code>```

Installing fresh and upgrading gets me to pytube version 12.1.2. I'm working in python3.7.6

To reproduce the error:

```<code>from pytube import YouTube
url = 'https://www.youtube.com/watch?v=5XlTkGEO564'
yt_obj = YouTube(url)
</code>```

Body:
I've tried multiple attempts at getting this fixed including uninstalling and reinstalling pytube. I've tried to use the fix that I see in other threads from 1+ year ago. I've done different combinations of the following:

pip uninstall pytube
pip install git+https://github.com/Zeecka/pytube@fix_1060
pip install --upgrade pytube
pip install pytube

Installing fresh and upgrading gets me to pytube version 12.1.2. I'm working in python3.7.6

To reproduce the error:

from pytube import YouTube
url = 'https://www.youtube.com/watch?v=5XlTkGEO564'
yt_obj = YouTube(url)


问:
Sonarqube not able to find database connection
hi i have a springboot application in which i have written some junit test code i am using postgresql as db.when i do jenkins build i get following error in jenkins build

```<code>
Caused by:
            org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.BatchDataSourceScriptDatabaseInitializer]: Factory method 'batchDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
                at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
                at app//org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
                ... 107 more

                Caused by:
                java.lang.IllegalStateException: Unable to detect database type
                    at org.springframework.util.Assert.state(Assert.java:76)

</code>```

i have following line in sonar.gradle

project.tasks[“sonarqube”].dependsOn “jacocoTestReport”

Body:
hi i have a springboot application in which i have written some junit test code i am using postgresql as db.when i do jenkins build i get following error in jenkins build

Caused by:
            org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.BatchDataSourceScriptDatabaseInitializer]: Factory method 'batchDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type
                at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
                at app//org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
                ... 107 more

                Caused by:
                java.lang.IllegalStateException: Unable to detect database type
                    at org.springframework.util.Assert.state(Assert.java:76)

i have following line in sonar.gradle

project.tasks[“sonarqube”].dependsOn “jacocoTestReport”


问:
How to make 1 gateway serve 2 tenants? or can we have 2 gateways on the same computer?
I am planning for datasets for multiple Power BI tenants that use the same SQL datasource located on-prem.

How to make 1 gateway serve 2 tenants? or can we have 2 gateways on the same computer?


问:
What is the Alternative of productItem.dataAndroid for IOS in Flutter in app Purchase?
As we use productItem.dataAndroid in the inAppPurchase to get the data in Flutter. I am not getting the right alternative for IOS Flutter with the Same Package.

I am expecting to use final String originalTransactionIdentifierIOS; for IOS but I am sure. Please Let me know about this.


问:
Why Does CodeIgniter 3 give me these error?
A PHP Error was encountered
Severity: 8192

Message: Creation of dynamic property CI_URI::$config is deprecated

Filename: core/URI.php

Line Number: 102

Backtrace:

File: D:\Workspace\htdocs\codeigniter\property\index.php
Line: 315
Function: require_once

How To solve This CodeIgniter 3 Framework? Please huehuehue

i dunno how to fix these error and what line of code what am i gonna fix im waiting for your answers ! Developers And Engineers

Im new to codeigniter 3 Thanks for answering my concerns i aprecciated:)


问:
SharePoint List Power BI - generating a pbix file
When you have a Sharepoint List, and you go to "Integrate" -> "Power BI" -> "Visualize the list", is there a way to get the PBIX from the Power BI report that is automatically generated?

I've tried googling and have read the documentation below, but I can't seem to find any details regarding this. Is anyone aware how to do this?

https://learn.microsoft.com/en-us/power-bi/create-reports/service-quick-create-sharepoint-list


问:
Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/author]
Getting Error Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/author] in my React Code that Implement LinkedIn API "Share on LinkedIn" to Share Content on LinkedIn. Below is the React Code for Component LinkedIn. Below are Some More Details of My Package.json

"name": "jsqwerty",
"version": "0.1.0",
"private": true,
"dependencies": {
"@aws-amplify/ui-react": "^4.2.0",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@react-three/drei": "^9.47.1",
"@react-three/fiber": "^8.9.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/three": "^0.146.0",
"aws-amplify": "^5.0.5",
"bootstrap": "^5.2.2",
"canvasjs-react-charts": "^1.0.5",
"jquery": "^3.6.1",
"npx": "^10.2.2",
"openai": "^3.1.0",
"popper.js": "^1.16.1",
"react": "^18.2.0",
"react-bootstrap": "^2.6.0",
"react-dom": "^18.2.0",
"react-linkedin-login-oauth2": "^2.0.1",
"react-linkedin-sdk": "^1.0.12",
"react-scripts": "3.4.1",
"react-scroll-to-top": "^3.0.0",
"three": "^0.147.0",
"web-vitals": "^2.1.0"
},

```<code>
function LinkedIn() {
  const clientId = "77gozlwvmxoqds";
  const clientSecret = "5XbgSHgStwPrd2Pb";
  const oauth2_access_token = "xxxxxxxxxxxxxxxxxx";

  // Set up the request headers
  const headers = {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${oauth2_access_token}`,
    "LinkedIn-Version": "202212",
    "X-Restli-Protocol-Version": "2.0.0",
    "x-li-format": "json",
    "x-li-src": "msdk"
  };

  // Set up the request body
  const data = {
    "author": "urn:li:organization:91716387",
    "commentary": "Sample text Post",
    "visibility": "PUBLIC",
    "distribution": {
      "feedDistribution": "MAIN_FEED",
      "targetEntities": [],
      "thirdPartyDistributionChannels": []
    },
    "lifecycleState": "PUBLISHED",
    "isReshareDisabledByAuthor": false
  };

  // Set up a state variable to track the response
  const [response, setResponse] = useState(null);
  let count = 1;
  // Function to make the request and set the response
  const sharePost = () => {
    if (count < 2) {
      fetch("https://api.linkedin.com/rest/posts", {
        method: "POST",
        body: JSON.stringify(data),
        headers: headers
      })
        .then(res => res.json())
        .then(res => setResponse(res));
      console.log(count);
    } else {
      console.log("problem h boss");
    }
    count = count + 1;
  };

  // Use setTimeout to share the post after a delay of 10 seconds
  useEffect(() => {
    setTimeout(async () => {
      await sharePost();
    }, 10000);

  }, []);

  return (
    <div>
      {response ? <p>{response.message}</p> : null}
    </div>
  );
}

export default LinkedIn;```
```

Body:
Getting Error Field Value validation failed in REQUEST_BODY: Data Processing Exception while processing fields [/author] in my React Code that Implement LinkedIn API "Share on LinkedIn" to Share Content on LinkedIn. Below is the React Code for Component LinkedIn. Below are Some More Details of My Package.json

"name": "jsqwerty",
"version": "0.1.0",
"private": true,
"dependencies": {
"@aws-amplify/ui-react": "^4.2.0",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@react-three/drei": "^9.47.1",
"@react-three/fiber": "^8.9.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/three": "^0.146.0",
"aws-amplify": "^5.0.5",
"bootstrap": "^5.2.2",
"canvasjs-react-charts": "^1.0.5",
"jquery": "^3.6.1",
"npx": "^10.2.2",
"openai": "^3.1.0",
"popper.js": "^1.16.1",
"react": "^18.2.0",
"react-bootstrap": "^2.6.0",
"react-dom": "^18.2.0",
"react-linkedin-login-oauth2": "^2.0.1",
"react-linkedin-sdk": "^1.0.12",
"react-scripts": "3.4.1",
"react-scroll-to-top": "^3.0.0",
"three": "^0.147.0",
"web-vitals": "^2.1.0"
},

function LinkedIn() {
  const clientId = "77gozlwvmxoqds";
  const clientSecret = "5XbgSHgStwPrd2Pb";
  const oauth2_access_token = "xxxxxxxxxxxxxxxxxx";

  // Set up the request headers
  const headers = {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${oauth2_access_token}`,
    "LinkedIn-Version": "202212",
    "X-Restli-Protocol-Version": "2.0.0",
    "x-li-format": "json",
    "x-li-src": "msdk"
  };

  // Set up the request body
  const data = {
    "author": "urn:li:organization:91716387",
    "commentary": "Sample text Post",
    "visibility": "PUBLIC",
    "distribution": {
      "feedDistribution": "MAIN_FEED",
      "targetEntities": [],
      "thirdPartyDistributionChannels": []
    },
    "lifecycleState": "PUBLISHED",
    "isReshareDisabledByAuthor": false
  };

  // Set up a state variable to track the response
  const [response, setResponse] = useState(null);
  let count = 1;
  // Function to make the request and set the response
  const sharePost = () => {
    if (count < 2) {
      fetch("https://api.linkedin.com/rest/posts", {
        method: "POST",
        body: JSON.stringify(data),
        headers: headers
      })
        .then(res => res.json())
        .then(res => setResponse(res));
      console.log(count);
    } else {
      console.log("problem h boss");
    }
    count = count + 1;
  };

  // Use setTimeout to share the post after a delay of 10 seconds
  useEffect(() => {
    setTimeout(async () => {
      await sharePost();
    }, 10000);

  }, []);

  return (

      {response ?
{response.message}
 : null}

  );
}

export default LinkedIn;```


问:
Differed values in unix
I have string like this

```<code>A=00000 1 001055 37 002001 279
B=00000 1 001045 65 004060 23
</code>```

How to compare and print differed values?

I am expecting output as
Differed

```<code> values = 001055 37 002001 279
          001045 65 004060 23
</code>```

Title: Differed values in unix

Body:
I have string like this

A=00000 1 001055 37 002001 279
B=00000 1 001045 65 004060 23

How to compare and print differed values?

I am expecting output as
Differed

 values = 001055 37 002001 279
          001045 65 004060 23


问:
Google Sheets don't display results if results are greater than today
I have this "current" table in Google Sheets.

https://docs.google.com/spreadsheets/d/1IhYdBDJznee57bZQvuI4QgNBX5wpTdufht0JRhnwpE4/edit#gid=0

If the months are greater then today in column A or Row 2,

I would like to not display or applying conditional formatting to get results like in "Expected".

How I can do this in Google Sheets?

Conditional formatting rules