Converted model from keras h5 to pytorch – fully connected later mismatch

I have converted two models (vgg16 and resnet50) from Keras with TensorFlow backend (from as model.save file) into PyTorch using mmdnn. This was done with the following:

mmconvert -sf keras -iw vgg.h5 -df pytorch -om keras_to_torch.pt

A = imp.load_source('MainModel','/weights/keras_to_torch.py')
model = torch.load('/weights/keras_to_torch.pt')

Predicting on the same data set gave me a different set of results so I investigated further.

I can see that the weights for all the convolutional layers are the same (after transposing), however the weights of the fully connected layers at the end are not.

Is there a reason this should be? As i understand they should be equivalent

bitcoind – LevelDB checksum mismatch. How to start reindex from corrupted .ldb again?

I faced the problem twice in 2020 and the reindexing takes 2-3 weeks without stopping. I got the same error on another hard drive when it reindexed about 50% and got an error in the last .ldb file. Now I can copy the entire blockchain to a healthy hard drive, but I don’t want to re-index the entire blockchain again.

How do I start reindexing from the specified .ldb and continue reindexing? Can I delete the last corrupted .ldb and repair LevelDB from third party utilities? Is there the way to edit somehow CURRENT and MANIFEST manually to repair chainstate?

Translate c++ function into python: sha256 hash mismatch

This is not related to bitcoin but it uses most of the bitcoin codebase. I would like to translate some c++ code into python but struggle really hard to get the hashes right.

This is the function I try go get. Hash is doing a double sha256

uint256 CalcKernelHash(const uint256& stakeModifier, int64_t height, int64_t coinstakeTime, const uint256& masternodeID, const Consensus::Params& params) {
        // Calculate hash
        CDataStream ss(SER_GETHASH, 0);
        ss << stakeModifier << coinstakeTime << GetMnCollateralAmount(int(height)) << masternodeID;
        std::cout << "n--------------------------------n";
        std::cout << "DEBUG(" << coinstakeTime << ") collateral: " << GetMnCollateralAmount(int(height)) << "n";
        std::cout << "DEBUG(" << coinstakeTime << ") ss: " << stakeModifier.ToString() << coinstakeTime << GetMnCollateralAmount(int(height)) << masternodeID.ToString() << "n";
        std::cout << "DEBUG(" << coinstakeTime << ") HASH: " << Hash(ss.begin(), ss.end()).ToString() << "n";
        return Hash(ss.begin(), ss.end());
    }

And here it is called

const auto hashProofOfStake = UintToArith256(CalcKernelHash(stakeModifier, height, coinstakeTime, masternodeID, params));
    
std::cout << "DEBUG(" << coinstakeTime << ") coinstakeTime: " << coinstakeTime << "n";
std::cout << "DEBUG(" << coinstakeTime << ") nbits: " << nBits << "n";
std::cout << "DEBUG(" << coinstakeTime << ") hashProofOfStake: " << hashProofOfStake.ToString() << "n";
std::cout << "DEBUG(" << coinstakeTime << ") stakeModifier: " << stakeModifier.ToString() << "n";
std::cout << "DEBUG(" << coinstakeTime << ") masternodeId: " << masternodeID.ToString() << "n";

I have added some debug statement to check the output and have a reference

--------------------------------
DEBUG(1622528110) collateral: 2000000000000
DEBUG(1622528110) ss: f541f372005beeb8952f964ea638527341c3b3a6eebb0c0309e4f092bd6c1b0e16225281102000000000000e2cfe3f576da4999ea2268224f34efdd3b0d567841d561b41b3ab67976c977d1
DEBUG(1622528110) HASH: e4b0d1b01a99d00e44d41eeb37c81d19940bf71270994fff53ea5caa1c79f663
DEBUG(1622528110) coinstakeTime: 1622528110
DEBUG(1622528110) nbits: 419654358
DEBUG(1622528110) hashProofOfStake: e4b0d1b01a99d00e44d41eeb37c81d19940bf71270994fff53ea5caa1c79f663
DEBUG(1622528110) stakeModifier: f541f372005beeb8952f964ea638527341c3b3a6eebb0c0309e4f092bd6c1b0e
DEBUG(1622528110) masternodeId: e2cfe3f576da4999ea2268224f34efdd3b0d567841d561b41b3ab67976c977d1

This is my trial in python

def rotate(x):
    s2 = bytearray.fromhex(x)
    s2.reverse()
    return binascii.hexlify(s2).decode()

def padhexa(s):
    return s(2:).zfill(16)

def CalcKernelHash(stakeModifier, coinstakeTime, masternodeId):
    stakeModifier = binascii.unhexlify(stakeModifier)
    coinstakeTime = binascii.unhexlify("%x" % coinstakeTime)
    collateral = binascii.unhexlify("0%x" % 2000000000000)
    masternodeId = binascii.unhexlify(masternodeId)
    
    bin_s = stakeModifier(::-1) + coinstakeTime(::-1) + collateral(::-1) + masternodeId(::1)
    return rotate(hashlib.sha256(hashlib.sha256(bin_s).digest()).hexdigest())

When I execute with the parameter from the debug output I get

CalcKernelHash('f541f372005beeb8952f964ea638527341c3b3a6eebb0c0309e4f092bd6c1b0e', 1622528110, 'e2cfe3f576da4999ea2268224f34efdd3b0d567841d561b41b3ab67976c977d1')

'f01ba34ac7a897a1e37d61bac3a8ea6f0126c2ae883a2d75dab1f407d40aad0b'

Where I should get hashProofOfStake e4b0d1b01a99d00e44d41eeb37c81d19940bf71270994fff53ea5caa1c79f663

EDIT:

bin_s returns b'x0ex1blxbdx92xf0xe4tx03x0cxbbxeexa6xb3xc3AsR8xa6Nx96/x95xb8xee(x00rxf3Axf5nxd0xb5`x00 Jxa9xd1x01xe2xcfxe3xf5vxdaIx99xea"h"O4xefxdd;rVxAxd5axb4x1b:xb6yvxc9wxd1'

java – JavaFx Event argument type mismatch when changing scenes

I’ve created a simple login form for an application I’m working on. When submitting the form and loading the next scene, everything works as expected except the following error being shown in the console:

Exception in thread “JavaFX Application Thread” java.lang.IllegalArgumentException: argument type mismatch

I’ve tried everything I can think of to get rid of this including solutions that worked for similar questions here(changing ActionEvent to Event), but nothing seems to work. I’d appreciate any help you guys may be able to give.


Here’s my LoginController:

package controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Stage;
import model.User;

import java.io.IOException;
import java.net.URL;
import java.time.ZoneId;
import java.util.ResourceBundle;

public class LoginController implements Initializable {

    Stage stage;
    Parent scene;

    @FXML
    private Label loginLbl, userIDLbl, passwordLbl, errorLbl, zoneLbl, zoneIDlbl;

    @FXML
    private PasswordField passwordField;

    @FXML
    private TextField userIDField;

    @FXML
    private Button submitBtn;

    @FXML
    private void onSubmit(ActionEvent event) throws IOException {
        String username = userIDField.getText();
        String password = passwordField.getText();

        if (User.authenticate(username, password)) {
            showAppointments(event);
        } else {
            userIDField.setText("");
            passwordField.setText("");
            errorLbl.setText("Error logging in. Check credentials and try again.");
            userIDField.requestFocus();
        }
    }

    private void showAppointments(ActionEvent event) throws IOException {
        stage = (Stage)((Button)event.getSource()).getScene().getWindow();
        scene = FXMLLoader.load(getClass().getResource("/view/appointments.fxml"));
        stage.setScene(new Scene(scene));
        stage.setTitle("Appointments");
        stage.centerOnScreen();
        stage.show();
    }

    @FXML
    void clearError(KeyEvent event) {
        errorLbl.setText("");
    }

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        errorLbl.setText("");
        zoneLbl.setText(ZoneId.systemDefault().getId());
    }
}

Here’s the login.fxml:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="300.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.LoginController">
   <children>
      <VBox alignment="TOP_CENTER" prefHeight="400.0" prefWidth="400.0">
         <children>
            <Label fx:id="loginLbl" alignment="CENTER" text="Log In">
               <font>
                  <Font name="System Bold" size="36.0" />
               </font>
               <VBox.margin>
                  <Insets bottom="30.0" />
               </VBox.margin>
            </Label>
            <GridPane vgap="10.0">
              <columnConstraints>
                <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="196.0" minWidth="10.0" prefWidth="134.0" />
                <ColumnConstraints hgrow="SOMETIMES" maxWidth="275.0" minWidth="10.0" prefWidth="266.0" />
              </columnConstraints>
              <rowConstraints>
                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
              </rowConstraints>
               <children>
                  <Label fx:id="userIDLbl" text="User ID">
                     <padding>
                        <Insets right="10.0" />
                     </padding>
                  </Label>
                  <Label fx:id="passwordLbl" text="Password" GridPane.rowIndex="1">
                     <padding>
                        <Insets right="10.0" />
                     </padding>
                  </Label>
                  <TextField fx:id="userIDField" onKeyPressed="#clearError" GridPane.columnIndex="1">
                     <GridPane.margin>
                        <Insets right="25.0" />
                     </GridPane.margin>
                  </TextField>
                  <PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="1">
                     <GridPane.margin>
                        <Insets right="25.0" />
                     </GridPane.margin>
                  </PasswordField>
               </children>
            </GridPane>
            <HBox alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="200.0">
               <children>
                  <Button fx:id="submitBtn" alignment="CENTER_RIGHT" contentDisplay="CENTER" mnemonicParsing="false" onAction="#onSubmit" text="Submit" />
               </children>
               <VBox.margin>
                  <Insets right="25.0" />
               </VBox.margin>
            </HBox>
            <Label fx:id="errorLbl" text="Label" textFill="#cd1c1c" />
            <HBox alignment="BOTTOM_LEFT" prefHeight="40.0" prefWidth="200.0">
               <children>
                  <Label fx:id="zoneIDLbl" text="Zone ID: " />
                  <Label fx:id="zoneLbl" text="Label" />
               </children>
               <VBox.margin>
                  <Insets left="10.0" />
               </VBox.margin>
            </HBox>
         </children>
         <padding>
            <Insets top="25.0" />
         </padding>
      </VBox>
   </children>
</AnchorPane>

And here’s the exception:

Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
    at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.controls/javafx.scene.control.Tab$1.invalidated(Tab.java:215)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.controls/javafx.scene.control.Tab.setSelected(Tab.java:189)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:741)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:754)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.findNearestAvailableTab(TabPane.java:810)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.lambda$new$0(TabPane.java:710)
    at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
    at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
    at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
    at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
    at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
    at javafx.base/javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:162)
    at java.base/java.util.AbstractList.add(AbstractList.java:111)
    at javafx.fxml/javafx.fxml.FXMLLoader$Element.add(FXMLLoader.java:177)
    at javafx.fxml/javafx.fxml.FXMLLoader$PropertyElement.add(FXMLLoader.java:1417)
    at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:798)
    at javafx.fxml/javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2924)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2639)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3323)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3280)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3249)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3222)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3199)
    at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3192)
    at controller.LoginController.showAppointments(LoginController.java:56)
    at controller.LoginController.onSubmit(LoginController.java:45)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
    at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8889)
    at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
    at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
    at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
    at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
    at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
    at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)

Any ideas what may be causing this?

python – How to get Pandas df.merge() mismatch column name

Given the following data:

data_df = pd.DataFrame({
    "Reference": ("A", "A", "A", "B", "C", "C", "D", "E"),
    "Value1": ("U", "U", "U--","V", "W", "W--", "X", "Y"),
    "Value2": ("u", "u--", "u","v", "w", "w", "x", "y")
    }, index=(1, 2, 3, 4, 5, 6, 7, 8))
truth_df = pd.DataFrame({
    "Reference": ("A", "B", "C", "D", "E"),
    "Value1": ("U", "V", "W", "X", "Y"),
    "Value2": ("u", "v", "w", "x", "y")
    }, index=(1, 4, 5, 7, 8))

data_df

Reference Value1 Value2
1 A U u
2 A U u–
3 A U– u
4 B V v
5 C W w
6 C W– w
7 D X x
8 E Y y

truth_df

Reference Value1 Value2
1 A U u
4 B V v
5 C W w
7 D X x
8 E Y y

The code below merges both and flags the rows where the values don’t match from truth_df

df_out = data_df.merge(truth_df, on=('Reference', 'Value1','Value2'), how='left', indicator=True).rename(columns={"_merge":"Issues"})
df_out("Issues") = np.where(df_out("Issues") == "left_only", "Flag", "")
df_out

Yields the following dataframe

df_out

Reference Value1 Value2 Issues
0 A U u
1 A U u– Flag
2 A U– u Flag
3 B V v
4 C W w
5 C W– w Flag
6 D X x
7 E Y y

I would like to know if there is a way to identify which columns are in conflict, so instead of displaying Flag I’ll display the column name like Value1 and Value2 respectively.

formulas – I am getting input mismatch exception error continuously?

formulas – I am getting input mismatch exception error continuously? – Web Applications Stack Exchange

c++ – Unable to connect remotely to a windbg server, possibly because of a dll version mismatch?

My goal is to control a running instance of WinDbg from another C++ program. I saw that the API DebugConnectWide can let you connect remotely to a debug client, so I tried using it and I made sure to start a server from the running windbg client by entering this command:

.server npipe:pipe=testname.

I am able to open a 2nd instance of windbg and connect to the first instance remotely by entering the following on the command line arguments:

-remote npipe:Pipe=sup,Server=DESKTOP-JT5S9BR.

However when I try to connect programmatically from my C++ console application, I get the following error from the HRESULT: The server is currently disabled.

#include <dbgeng.h>
#include <iostream>

int main()
{
    HRESULT hr;
    IDebugClient7* debugger = nullptr;

    hr = DebugConnectWide(L"npipe:Pipe=testname,Server=DESKTOP-NAME", IID_PPV_ARGS(&debugger));

    std::getchar();
}

I read in the doc that it’s important for all of the instances of windbg to have the same version if they want to connect remotely. So it’s possible that my problem is related to that. I saw that there are many versions of dbgeng.dll and dbgeng.lib on my computer, so how can I make sure that my C++ app is running the same version of dbgeng?

Consul proxy sidecar, peer certificate mismatch

I’m trying to connect two services web and db(mysql) use the tutorial in Secure Service Communication with Consul Service Mesh and Envoy | Consul – HashiCorp Learn as model.

When I try to connect from web into db got this lines on web proxy:

2021-04-07T20:56:29.207Z (ERROR) proxy.upstream: failed to dial: error="peer certificate mismatch got spiffe://b350502d-bd86-a715-6595-9260183bb7c2.consul/ns/default/dc/dc1/svc/web, want spiffe:///ns/default/dc/dc1/svc/db"

and this line on db proxy:

2021-04-07T20:56:36.991Z (ERROR) proxy.inbound: connection failed: error=EOF

I use this line to run the proxy on web:

consul connect proxy -sidecar-for web

And this line for db:

consul connect proxy -sidecar-for db_service

Thanks in advance
Nomar

spring boot – Kotlin Springboot Type mismatch

I have the following interface:

package com.z.springkotlinz.resource

import com.kotlinhf.springkotlinhf.dto.AddPersonRequest
import com.kotlinhf.springkotlinhf.dto.PersonResponse
import com.kotlinhf.springkotlinhf.dto.UpdatePersonRequest
import org.springframework.http.ResponseEntity

interface PersonResource {
    fun findById(id:Long): ResponseEntity<PersonResponse?>
    fun findAll(): ResponseEntity<List<PersonResponse>>
    fun save(addPersonRequest: AddPersonRequest): ResponseEntity<PersonResponse>
    fun update(updatePersonRequest: UpdatePersonRequest): ResponseEntity<PersonResponse>
    fun deleteById(id:Long): ResponseEntity<Unit>
}

And this is the class that implements it:

package com.kotlinhf.springkotlinhf.resource

import com.kotlinhf.springkotlinhf.dto.AddPersonRequest
import com.kotlinhf.springkotlinhf.dto.PersonResponse
import com.kotlinhf.springkotlinhf.dto.UpdatePersonRequest
import com.kotlinhf.springkotlinhf.service.IPersonManagementService
import com.kotlinhf.springkotlinhf.resource.PersonResourceImpl.Companion.BASE_PERSON_URL
import com.z.springkotlinz.resource.PersonResource
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.*
import java.net.URI

@RestController
@RequestMapping(value = (BASE_PERSON_URL))
class PersonResourceImpl(private val personManagementService: IPersonManagementService) : PersonResource {

    @GetMapping("/{id}")
    override fun findById(@PathVariable id: Long): ResponseEntity<PersonResponse?> {
        val personResponse: PersonResponse? = this.personManagementService.findById(id)
        return ResponseEntity.status(HttpStatus.OK).body(personResponse)
    }

    @GetMapping
    override fun findAll(): ResponseEntity<List<PersonResponse>> = ResponseEntity.ok(this.personManagementService.findAll())

    @PostMapping
    override fun save(@RequestBody addPersonRequest: AddPersonRequest): ResponseEntity<PersonResponse> {
        val personResponse = this.personManagementService.save(addPersonRequest)
        return ResponseEntity
            .created(URI.create(BASE_PERSON_URL.plus("/${personResponse.id}")))
            .body(personResponse)
    }

    @PutMapping
    override fun update(@RequestBody updatePersonRequest: UpdatePersonRequest): ResponseEntity<PersonResponse> {
        return ResponseEntity.ok(this.personManagementService.update(updatePersonRequest))
    }

    @DeleteMapping("/{id}")
    override fun deleteById(@PathVariable id: Long): ResponseEntity<Unit> {
        this.personManagementService.deleteById(id)
        return ResponseEntity.noContent().build();
    }

    companion object {
        const val BASE_PERSON_URL: String = "/api/v1/person"
    }
}

And I get the following error in line37: (update method)

Type mismatch.
Required:PersonResponse!
Found:Unit

Can someone explain what do I do wrong and how can I fix it?

I’m trying to build a REST API with Kotlin and Spring-Boot, I use JAVA8

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies