DrRoo
DrRoo
2021/01/25 03:27
  • safari
  • macos

mac 安装软件后无法打开Safari、AppStore、安全与隐私、iTunes  报错Library not loaded: /usr/lib/libstdc++.6.dylib 但是安装的软件能用

求解决办法

0个回复
qq_19267071
qq_19267071
2021/01/25 02:27
  • python
  • 腾讯云
{"errorCode":-1,"errorMessage":"user code exception caught","stackTrace":"Traceback (most recent call last):\n  File \"/var/user/index.py\", line 281, in main\n    taskPool()\n  File \"/var/user/index.py\", line 259, in taskPool\n    check() # 每天对api做一次检查\n  File \"/var/user/index.py\", line 247, in check\n    respones = requests.get(url)\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/api.py\", line 75, in get\n    return request('get', url, params=params, **kwargs)\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/api.py\", line 60, in request\n    return session.request(method=method, url=url, **kwargs)\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/sessions.py\", line 519, in request\n    prep = self.prepare_request(req)\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/sessions.py\", line 462, in prepare_request\n    hooks=merge_hooks(request.hooks, self.hooks),\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/models.py\", line 313, in prepare\n    self.prepare_url(url, params)\n  File \"/var/lang/python3/lib/python3.6/site-packages/requests/models.py\", line 387, in prepare_url\n    raise MissingSchema(error)\nrequests.exceptions.MissingSchema: Invalid URL '?do=check': No schema supplied. Perhaps you meant http://?do=check?","statusCode":430}

 

0个回复
qinglouchangke
qinglouchangke
2021/01/25 01:52
  • java
package LSQ;

class SuperClass{

	  int x;

	  SuperClass(){

	    x = 3;

	    System.out.println("in SuperClass:x=" + x);

	  }

	  void doSomething(){

	    System.out.println("in SuperClass.doSomething()");

	  }

	}

	class SubClass extends SuperClass{

	  int x;

	  SubClass(){

	    super();

	    x = 5;

	    System.out.println("in SubClass:x=" + x);

	  }

	  void doSomething(){

	    super.doSomething();

	    System.out.println("in SubClass.doSomething()");

	    System.out.println("super.x=" + super.x + " sub.x=" + x);

	  }

	}

	public class Star2{

	  public static void main(String[] args){

	    SubClass subC = new SubClass();

	    subC.doSomething();

	  }

	}

 

0个回复
ARYAD
ARYAD
2021/01/25 01:28
  • python

服务器:

python -m visdom.server -p 8091

ssh -L 18091:127.0.0.1:8097 name@xxx.xx.xxx.xx

本地:

python -m visdom.server 

http://localhost:8097/

得到的是蓝屏界面

刷新后左下角出现

服务器端一直保持这个转台不再输出了

还有很奇怪的一点,就是我在本地上使用http://localhost:8091/也是蓝屏

0个回复
weixin_54883377
白天不懂夜的黑。,
2021/01/25 01:24
  • spring

这个代码是支持多坐标点击,怎么修改为只点一个坐标就可以!! document.onmousedown=function(ev){ var oEvent=ev||event; var cDiv=document.createElement('div'); var x = (oEvent.clientX+document.documentElement.scrollLeft + document.body.scrollLeft); var y = (oEvent.clientY+document.documentElement.scrollTop + document.body.scrollTop); cDiv.style="border-radius:50%;margin-left:-13px;margin-top:-13px;background:#f00;border:3px solid #ff0;position:absolute;width:20px;height:20px;z-index:100;"; cDiv.style.left=x+'px'; cDiv.style.top=y+'px'; document.body.appendChild(cDiv); var wrap = document.createElement("div"); wrap.style="width:100%;height:100%;border:1px solid red;background:#ff0;position:fixed;left:0;top:0;opacity:0.2;z-index:100;"; document.body.appendChild(wrap); var t_d = setTimeout(function(){ cDiv.parentNode.removeChild(cDiv); wrap.parentNode.removeChild(wrap); var cc = document.elementFromPoint(oEvent.clientX,oEvent.clientY); var t_cc = setInterval(function(){ cc.click(); },666); },1000);};

0个回复
qq_53805031
纳豆烧鸡
2021/01/25 00:46
  • c++

 

0个回复
WONGCHARLIE
WONGCHARLIE
2021/01/25 00:44
  • java
  • eclipse

我有三个case, 我想加while在选择3个不同的case里面。 应该是在switch里面加,还是直接到private static里面加?我试了都不太行

switch (choice) {

 case 0: printLLT(size); break;

    }

3个回复
weixin_45909852
豚キムチ
2021/01/25 00:41
  • html5
  • django

视图文件: 

def new_topic(request):
    if request.method != 'POST':
        form = TopicForm()
        print("not post")
    else:
        form = TopicForm(request.POST)
        print("post")
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('http://www.baidu.com')
        else:
            print(form.errors.as_data()) # here you print errors to terminal

    context = {'form': form}
    return render(request, 'learning_logs/new_topic.html', context)

模板:

{% extends "learning_logs/base.html"%}

{%block content%}
<p>Add a new topic:</p>

<from action="{% url 'learning_logs:index'%}" method='post'>
    {% csrf_token %}
    {{form.as_p}}
    <input type="submit" value="Submit" />

</from>

{%endblock content%}

浏览器按下按钮后没有获取到任何的包,请问如何解决

0个回复
Meenue
Meenue
2021/01/25 00:34
  • python
  • 中文分词

 

0个回复
chuxiqianye2020
Lhuang-attic
2021/01/25 00:27
  • linux
  • centos

我把华为nova2plus root后装了centos7,但是宝塔却不支持32位系统

 

0个回复
Paola20
人艰不摧
2021/01/25 00:12
  • html5

如何获取 美团生鲜个人CPS  H5 url 哪位大佬知道

0个回复
Over_second
高轨低速大周期大机大势大能量
2021/01/24 23:32
  • 多彩生活
  • 问答团队
  • c语言
  • c++

#include<stdio.h>
#include<math.h>
int main()
{
    int i,n,j,count=0;
    scanf("%d",&n);
     for(i=n-1;i>1;i--)

 {
        for(j=i;j>=(int)sqrt(i*1.0);j--)
       {

       if(i%j==0) break;
       else
        if(j<(int)sqrt(i*1.0))
        count++;
    printf("%d\t",i);
    if(count%5==0) printf("\n");
        }

 }
    return 0;


}

0个回复
lezilisy
lezilisy
2021/01/24 23:27
  • apache
  • android
  • java

本人小白,刚学习蓝牙开发。我已经实现了蓝牙配对,对配对的设备进行连接,已经关闭了扫描而且利用了子线程进行连接,但还是不行。我用手机配对上了电脑,想把手机当做一个服务端就接收数据,但是bluetoothSocket.connect()没有用,请各位大佬看一下问题在哪。

我的活动

public class ThirdActivity extends AppCompatActivity {
    private BluetoothAdapter bluetoothAdapter;
    private BluetoothDevice bluetoothDevice;
 @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_third);
        ButterKnife.bind(this);
        //之前已经配对上了,获取到地址后接下来要对设备进行连接
        Intent intent=getIntent();
        String address = intent.getStringExtra("address");
        bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
        bluetoothDevice=bluetoothAdapter.getRemoteDevice(address);
        textView5.setText("正在与"+bluetoothDevice.getName()+"进行连接。。。");
        //按照一些例子写的连接子线程
        ConnectThread connectThread = new ConnectThread(bluetoothDevice);
        connectThread.start();
        //按照一些例子写的接收服务子线程,但是也失败了
//        AcceptThread acceptThread=new AcceptThread(bluetoothAdapter);
//        acceptThread.start();
}

按照网上的例子写的连接子线程

public class ConnectThread extends Thread{
    private  BluetoothSocket bluetoothSocket;
    private  BluetoothDevice bluetoothDevice;
    //这条是蓝牙串口通用的UUID
    private final UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
    public ConnectThread(BluetoothDevice device) {
        this.bluetoothDevice=device;
        try{
        //图省事就直接获取了            this.bluetoothSocket=bluetoothDevice.createInsecureRfcommSocketToServiceRecord(uuid);
            Log.e("connectthread", "获取socket");
        }catch (IOException e){
            e.printStackTrace();
            bluetoothSocket=null;
        }
    }
    @Override
    public void run(){
        //连接不成功,就一直循环
        while(bluetoothSocket!=null) {
            try {
                bluetoothSocket.connect();
                Log.e("connectthread", "连接成功");
            } catch (IOException e) {
                e.printStackTrace();
                Log.e("connectthread", "连接失败");
            }

            if(bluetoothSocket.isConnected()){
                try {
                    bluetoothSocket.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                break;
            }
        }
    }
    
    public void cancel() {
        try {
            bluetoothSocket.close();
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }

按照网上的例子写的接收连接线程——用了也失败了

public class AcceptThread extends Thread{
    private  BluetoothServerSocket bluetoothServerSocket;
    private BluetoothSocket bluetoothSocket=null;
    //这条是蓝牙串口通用的UUID
    private final UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
    public AcceptThread(BluetoothAdapter bluetoothAdapter) {
        bluetoothServerSocket=null;
        try {
            this.bluetoothServerSocket=bluetoothAdapter.listenUsingRfcommWithServiceRecord("accept",uuid);
            Log.e("accept", "获取服务socket");
        }catch (IOException e){
            e.printStackTrace();
            Log.e("accept", "未获取服务socket");
        }
    }
    @Override
    public void run() {
        while (bluetoothServerSocket!=null) {
            try {
                bluetoothSocket = bluetoothServerSocket.accept();
                Log.e("accept","服务已连接" );
            } catch (IOException e) {
                e.printStackTrace();
                Log.e("accept", "服务未连接");
            }
            if (bluetoothSocket!= null) {
                try {
                    bluetoothServerSocket.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                break;
            }
        }
    }
    public void cancel() throws IOException {
        bluetoothServerSocket.close();
    }
}

我的logcat

说实话我对线程的理解以及socket的理解就不是很明白,如果有语法什么的低级错误也欢迎指出来,能够解决我的问题最好了

0个回复
AILXX_EXJ
AILXX_EXJ
2021/01/24 23:15
  • c++

0个回复
always_be_yours
always_be_yours
2021/01/24 23:09
  • c语言

排序的次数不是应为数组长度减一吗,但设i<4时最后一个数不参与排序,i<5就可以了,为什么?求解,感谢

0个回复
abcyoui
abcyoui
2021/01/24 23:07
  • vue.js

element ui 封装的组件,在外部使用时可以直接用这个组件名作为class进行样式修改,这个是怎么实现的

0个回复
hhhhhjhw
hhhhhjhw
2021/01/24 23:05
  • python
  • 开发语言

 

1个回复
LYriC246124
LYriC246124
2021/01/24 23:00
  • python

求大佬解答,为什么会这样呢?

全用的是tab缩进

括号,引号也全是英文的,绝无中文的可能

跪求大佬解答

0个回复
MIAOtMIAO
MIAOtMIAO
2021/01/24 22:41
  • 云计算
  • python
  • c语言
  • jar
  • 开发语言

有没有大佬可以教教我,感谢了,有两个问卷,一个是填完性格的题之后有对应的分数,根据分数得出性格类型,然后做睡眠的问卷,我们需要得到不同性格的人对应的睡眠情况,例如:测出我是【红色性格】的人,然后填写睡眠问卷,得出我是【睡眠质量很好】的人。我需要后台能够看到红色性格对应不同睡眠情况的总体分布。

0个回复
weixin_47130646
weixin_47130646
2021/01/24 22:31
  • c++
#include <iostream>
#include <mutex>
#include <string>
#include <thread>

using namespace std;

std::mutex mu;
void share_print(string msg, int id)
{
	mu.lock();
	cout << msg << " " << id << endl;
	mu.unlock();
}

void func_1()
{
	for (int i = 0; i > -100; i--)
		share_print("From func_1", i);
}

int main()
{
	thread t1(func_1);
	for (int i = 0; i < 100; i++)
		share_print("From main", i);
	t1.join();
}

代码如上,得到的结果如下,按照我的理解,主线程和t1线程分别调用cout函数,但是因为加了mutex锁,这个不应该是主线程和t1线程轮流输出吗,为什么会没有规律呢?谢谢了!!

0个回复