标签: native

本机PHP函数中的异常

PHP中的大多数函数返回true/false:

var_dump (is_int ("1")); // false
Run Code Online (Sandbox Code Playgroud)

我可以配置PHP来返回异常而不是布尔值吗?

try {is_int ("1")} catch (Exception $e) {exit ($e->getMessage ());}
Run Code Online (Sandbox Code Playgroud)

谢谢.

php native exception function

0
推荐指数
1
解决办法
469
查看次数

node-gyp:在所有子目录中运行 binding.gyp

我正在开发一个大型node.js项目,其中还包括几个本机库。
为了在 JavaScript 中使用这些库,我使用node-gyp.node将它们编译为节点插件 ( ) 。

我想从根目录运行一次node-gypbinding.gyp以递归地编译所有可用的文件(在所有子目录中)。

有什么办法可以做到这一点吗?

recursion native compilation node.js node-gyp

0
推荐指数
1
解决办法
2941
查看次数

为什么 'msg * alarm' 会在一段时间后消失?

我有一个小的 powershell 脚本,它允许我快速为自己设置警报。它基本上只是等待指定的分钟数然后调用

味精 * 警报!

这很有效 - 弹出一个消息框。唯一的问题是它会在一段时间后消失 - 所以如果我不在办公桌前,我会错过消息框。

根据此处找到的文档,这是我未指定时间值时的行为。

/time: seconds :指定您发送的消息在用户屏幕上显示的时间。一旦达到时间限制,消息就会消失。如果未设置时间限制,则该消息将保留在用户的屏幕上,直到用户看到该消息并单击“确定”。

然而事实并非如此,它确实消失了。现在,我必须指定一个任意高的数字才能保留。

    msg * /time:999999 alarm!
Run Code Online (Sandbox Code Playgroud)

windows parameters executable native default-parameters

0
推荐指数
1
解决办法
1557
查看次数

在 Java 9 中还可以使用 sun.misc.Unsafe 吗?

在 Java 8 之前,可以sun.misc.Unsafe通过如下方法获取单例实例:

public static Unsafe getUnsafe() {
    try {
        Field f = Unsafe.class.getDeclaredField("theUnsafe");
        f.setAccessible(true);
        return (Unsafe) f.get(null);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
Run Code Online (Sandbox Code Playgroud)

尽管强烈建议不要使用Unsafe,但许多供应商和图书馆在内部使用它。

现在,有了 Java 9 和 Jigsaw,我认为Unsafe处理方式也发生了变化。我读了一些带有相反信息的帖子。有人说它已完全隐藏,甚至无法检索,有人说必须启用 VM 标志,而另一些人则写道它现在应该得到正式支持。

那么:是否仍然可以sun.misc.Unsafe在 Java 9 中使用?如果可以,如何使用?

java reflection unsafe native java-9

0
推荐指数
1
解决办法
2135
查看次数

使用 react native 将错误显示为 firebase 身份验证的警报

我在我的本机应用程序中使用此功能,但它使我的应用程序崩溃,尽管它在我的模拟器上显示错误作为控制台,我应该如何使用警报向用户显示任何错误而不是使应用程序崩溃?

  signup =(email,password) =>{
try{
    firebase.auth().createUserWithEmailAndPassword(email,password)

    .then(() => this.props.navigation.navigate('home')) } 
    catch(error){
        alert("not valid"`enter code here`)
    }

   }
Run Code Online (Sandbox Code Playgroud)

native reactjs

0
推荐指数
1
解决办法
5580
查看次数

DEVELOPER_ERROR 错误代码 10 - Firebase google login in react native

我正在尝试在我的本机应用程序中实现 Firebase Google 身份验证。但得到 DEVELOPER_ERROR。错误代码 10。

它工作一次,然后当我在一周后尝试再次运行它时,我遇到了同样的错误。

到目前为止我尝试过的。1. 检查 Web Client ID 是否正确。2. Debug Keystore 也正确检查了将近20 次。3. 删除 Firebase 项目并创建一个新项目。

  componentDidMount = async () => {
      // Google Configure
      await GoogleSignin.configure({
          webClientId: 'xxxxxxxxxxxxxx.apps.googleusercontent.com',
          offlineAccess: true
      })

    }
Run Code Online (Sandbox Code Playgroud)
    firebaseSignIn  =  async () => {
      try {
      const data =  await GoogleSignin.signIn();

      // create a new firebase credential with the token
      const credential = firebase.auth.GoogleAuthProvider.credential(data.idToken, data.accessToken)
      // login with credential
      const currentUser = await firebase.auth().signInWithCredential(credential);

      //Update Data in Firebase
      this.props.updateAuth(this.state.first_install, this.state.first_open)

      } …
Run Code Online (Sandbox Code Playgroud)

android native firebase reactjs react-native

0
推荐指数
3
解决办法
5503
查看次数

从 flatlist 获取索引 react native

所以我基本上是在寻找错误和我做错了什么,我得到了每个键不同的数据,我试图获取activeRow的数据,由于某种原因我没有定义,这是怎么回事在?谢谢!尝试记录“this.props.index”后我变得未定义我已经调用了构造函数(道具)和超级(道具),所以我不知道为什么我要记录我的道具它说未定义而不是给我索引或项目...

有我的渲染!

render() {
  const swipeSettings = {
    autoClose: true,
    buttonWidth: 130,
    onClose: (secId, rowId, direction) => {
      if (this.state.activeRowKey != null) {
        this.setState({ activeRowKey: null })
      }
    },
    onOpen: (secId, rowId, direction) => {
      this.setState({ activeRowKey: this.props.index })
      console.log(this.state.activeRowKey)
    },
    right: [
      {
        onPress: () => {

        },
        text: 'Verify', type: 'default', backgroundColor: 'lime', color: 'black', component: (
          <View
            style={{
              flex: 1,
              alignItems: 'center',
              justifyContent: 'center',
              flexDirection: 'column',
            }}
          >
            <Ionicons name="md-checkmark" size={40} />
          </View>
        )
      }
    ],
    left: …
Run Code Online (Sandbox Code Playgroud)

native reactjs react-native react-native-flatlist

0
推荐指数
1
解决办法
4832
查看次数

原生 Javascript 滚动到底部,div 上有平滑的动画和动态添加的内容

我正在制作一个聊天应用程序,我想要归档的是当加载动态消息时,页面以平滑的动画向下滚动到 div 的底部。

<ul id="messages">
                <li>
                    <p>Not logged in on Epic | Log in here: https://epic.clow.nl/login</p>
                </li>
            </ul>
Run Code Online (Sandbox Code Playgroud)

html javascript animation scroll native

0
推荐指数
1
解决办法
3925
查看次数

有没有办法在Springboot中进行提前编译?

我读过有关提前编译的内容,并且有一个Java框架Micronaut可以做到这一点。

我只是想知道是否可以在Spring Boot中做到这一点。

java spring native spring-boot graalvm-native-image

0
推荐指数
1
解决办法
1267
查看次数

VirtualizedList 永远不应该嵌套在普通 ScrollView 中

当我打开 DropDown 并且无法选择或滚动 DrowDown 对话框时,我收到错误VirtualizedLists 不应该嵌套在普通 ScrollViews 中,我大约知道问题是什么,有人可以告诉我原因或向我展示解决方案吗?

<ScrollView>
  {formSchema.map((field, index) => {
    const { name, label, type } = field;
    if (type === 'select') {
      return (
        <View style={styles.sropsownWrapper} key={index}>
          <Dropdown
          />
        </View>
      );
    }
    if (type === 'input') {
      return (
        <View style={styles.wrapper}>
          <Input
            name={name}
            label={label}
          />
        </View>
      );
    }
  })}
  <View
    style={{
      ...styles.controls,
      backgroundColor: '#242424',
    }}>
    <View style={styles.wrapper}>
      <Button onPress={() => ()} />
    </View>
    <View style={styles.wrapper}>
      <Button  text="Go" />
    </View>
  </View>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

javascript native reactjs react-native

0
推荐指数
1
解决办法
2480
查看次数