小编hak*_*iko的帖子

Pinterest API:身份验证不起作用:401(未经授权)

我想让你的JavaScript API工作.我按照js api文档中的基本设置进行操作.

但是我的401未经授权.我找不到任何解决方法如何解决这个问题.

我添加了'header('Access-Control-Allow-Origin:*'); '到我的PHP代码,但它不起作用.

有什么建议吗?

感谢您的身份验证.获取您的信息... pinteresturl/v1/me /:1 GET pinteresturl/v1/401(未经授权)(索引):1 XMLHttpRequest无法加载https://api.pinterest.com/v1/me/.请求的资源上不存在"Access-Control-Allow-Origin"标头.起源' http://www.svenfraeys.com '; 因此不允许访问.响应具有HTTP状态代码401. sdk.js:1由于网络级别的故障,请求未完成.

javascript api pinterest

6
推荐指数
0
解决办法
957
查看次数

从URL上传Summernote图像

我在我的网站上使用summernote html文本编辑器.当用户将图像URL添加到图像URL区域然后按"插入图像"按钮时,我想将图像下载到我的服务器.

目前,summernote仅获取src属性的图像源.我想将图像存储在我自己的Amazon S3 Bucket或VPS上.

关于summernote图片上传的文档很多,但是所有这些文档都是从pc上传而不是从URL上传的.

我该如何覆盖此功能? 在此输入图像描述


图像对话框 在此输入图像描述

javascript php ajax image-uploading summernote

6
推荐指数
1
解决办法
3333
查看次数

只关注一次 - Jquery

朋友们,我有一个textarea,我想使用animate()css()使用此元素.

css()功能正常,但问题是focus()功能.页面加载后一切都很好,

当我专注于textarea时,它的高度增加50px但是当我模糊然后再次聚焦到textarea然后高度再次增加50px.

我不想使用blur()功能.

我的问题是关于使用focus()功能.我想focus() 每页加载一次.

<script>
              $(document).ready(function(){
                  $("#sharePost").focus(function(){
                  $(this).animate({height:"+=50px"});
                  $(this).css("background-color","#ffccdd");
                  });
                  $("#sharePost").blur(function(){
                  //$(this).animate({height:"-=50px"});
                  });
              });
</script>
Run Code Online (Sandbox Code Playgroud)

jquery focus lost-focus

5
推荐指数
1
解决办法
6750
查看次数

我应该在 onPause() 或 onResume() 时使用 reportActivityStop 还是 reportActivityStart

我正在使用 Google Analytics Tracker,数据正确地进入我的分析帐户。但我有一个问题。当我的应用程序转到onPause()onResume()

目前我正在使用这个

@Override
protected void onStart() {
    super.onStart();
    GoogleAnalytics.getInstance(this).reportActivityStart(this);
}

@Override
protected void onStop() {
    super.onStop();
    GoogleAnalytics.getInstance(this).reportActivityStop(this);
}
Run Code Online (Sandbox Code Playgroud)

有必要像下面这样吗?

@Override
protected void onPause() {
    super.onPause();
    GoogleAnalytics.getInstance(this).reportActivityStop(this);
}

@Override
protected void onResume() {
    super.onResume();
    GoogleAnalytics.getInstance(this).reportActivityStart(this);
}
Run Code Online (Sandbox Code Playgroud)

Android Activity 生命周期

android google-analytics

5
推荐指数
1
解决办法
688
查看次数

如何在 React Native 中将图像添加到导航抽屉的标题?

我正在尝试将公司徽标添加到 Drawer Navigator 的标题中,但它仅显示屏幕的标题。这是我的代码:

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, ScrollView, Dimensions, Image} from 'react-native';
import { createDrawerNavigator, createAppContainer, DrawerItems, SafeAreaView } from 'react-navigation';
import HomeScreen from './screens/HomeScreen';
import SettingsScreen from './screens/SettingsScreen';

class App extends Component {
  render() {
    return (
      <AppNavigator />
    );
  }
}

const AppNavigator = createDrawerNavigator({
  Home: {screen: HomeScreen},
  Settings: {screen: SettingsScreen},
},
{
  CustomDrawerContentComponent: props => (
    <SafeAreaView style={styles.container}>
        <View style={{height: 150, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center'}}>
          <Image source={require('./assets/typeme.png')} style={{height: …
Run Code Online (Sandbox Code Playgroud)

javascript react-native react-native-android

4
推荐指数
1
解决办法
7774
查看次数

有没有办法使用PHP关闭pc

我有一个想法,我在localhost上运行一个php本地网页

我想使用GUI为3个按钮:关闭,睡眠重新启动

PHP允许我进行这些操作吗?是否已准备好在PHP中编写类,方法?

php browser windows

3
推荐指数
1
解决办法
1万
查看次数

用逗号和新行一起爆炸

我有一个基本的文本区域。当用户输入一些文本时,我用逗号“,”分解单词。现在我也想用新行分隔单词。我该怎么做。

这是我的代码部分,用逗号分解单词。

if(isset($_POST["btn"])){
    $words     = $_POST["inp_text"];
    $words_arr = explode(",",$words);

    foreach($words_arr as $word){
        echo $word."<br>";
    }
}
Run Code Online (Sandbox Code Playgroud)

如何向此代码部分添加新行功能。我想,我应该从$word循环中生成一个字符串而不是循环之后我应该再次用新行分解这个字符串。

有更好的主意吗?

为了更好地理解,我添加了一些示例。

输入:

apple, melon, a, b, c
Run Code Online (Sandbox Code Playgroud)

输出:

apple melon a b c
Run Code Online (Sandbox Code Playgroud)

输入(带新行)

x,y,z,a
b
c
Run Code Online (Sandbox Code Playgroud)

输出:

x y z a b c
Run Code Online (Sandbox Code Playgroud)

php arrays string explode

2
推荐指数
1
解决办法
2830
查看次数

什么是最好的query_cache_size/Ram比率

嗨,我想更改我的/etc/my.cnf文件(mysql的配置文件).

以下值应该在我的查询中获得更好的性能.

query_cache_type = 1
query_cache_limit = 1M
query_cache_size = 16M
Run Code Online (Sandbox Code Playgroud)

cache_size/RAM有最佳比例吗?我的ubuntu机器上有8GB的内存.

mysql ubuntu performance ram caching

2
推荐指数
2
解决办法
8900
查看次数

未处理的拒绝错误:EISDIR:目录上的非法操作

尝试安装react-devtools时在Mac上出现此错误

Hakk-MBP:HelloWorld hakkikonu$ sudo npm install -g react-devtools
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/hakkikonu/.npm/_cacache/index-v5/ad/f6'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/hakkikonu/.npm/_cacache/index-v5/da/f2'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hakkikonu/.npm/_logs/2019-02-05T14_33_58_146Z-debug.log
Run Code Online (Sandbox Code Playgroud)

npm版本是:6.7.0

是什么原因?

npm npm-install

2
推荐指数
1
解决办法
2793
查看次数

java.io FileOutPutStream - 字符之间有空格.为什么?

我想用这段代码写一些东西但是在我运行之后,字符之间有空格.但在代码中我不给字符串空间.

import java.io.*;

public class WriteText{

public static void main(String[] args) {

FileOutputStream fos; 
DataOutputStream dos;

try {

  File file= new File("C:\\JavaWorks\\gui\\bin\\hakki\\out.txt");
  fos = new FileOutputStream(file);
  dos=new DataOutputStream(fos);

  dos.writeChars("Hello World!");
} 

catch (IOException e) {
  e.printStackTrace();
}

 }

 }
Run Code Online (Sandbox Code Playgroud)

输出是(在文本文件中): H e l l o W o r l d !

java string java-io

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