小编pps*_*ith的帖子

有没有办法告诉Chrome Web调试器在页面坐标中显示当前鼠标位置?

我经常使用Chrome网络调试器调试我的javascript代码.在元素选项卡中,将鼠标悬停在元素上会显示工具提示,其中包含一些信息,包括该元素的宽度和高度.

有时,我需要查看当前鼠标位置的页面坐标.但似乎调试器没有显示这种信息.

那么,有没有办法添加它?像扩展或可能有其他选择?

编辑

使用接受的答案,我可以添加以下书签,并具有我想要的正确:

javascript:document.onmousemove = function(e){var x = e.pageX;var y = e.pageY;e.target.title = "X is "+x+" and Y is "+y;};
Run Code Online (Sandbox Code Playgroud)

html javascript debugging google-chrome

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

找不到类路径上的clojure/math/numeric_tower__init.class或clojure/math/numeric_tower.clj

在新的lein安装上,当我启动repl via lein repl并进入repl时:

(use 'clojure.math.numeric-tower)

它抛出一个错误:

FileNotFoundException Could not locate clojure/math/numeric_tower__init.class or clojure/math/numeric_tower.clj on classpath.

我是Clojure的新手,所以我真的不知道如何解决这个问题.

Lein版本:Leiningen 2.7.1(lein -v)

Clojure版本:1.8.0((clojure-version))

clojure leiningen

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

C++ 11中的简单向量初始化会返回奇怪的错误

编译这段代码:

#include <vector>

long long sumOfMedians(int seed, int mul, int add, int N, int K)
{
  std::vector<int> nos{N+2,0};
  for(int i=0; i<N; i++)
    {
      if(i == 0)
    nos[i] = seed;
      else
    nos[i] = (nos[i-1]*mul + add)%65536;
    }
}

int main()
{
  sumOfMedians(3,1,1,10,3);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

导致错误

*** Error in `./a.out': free(): invalid next size (fast): 0x00000000006e8010 ***
[2]    31743 abort (core dumped)  ./a.out
Run Code Online (Sandbox Code Playgroud)

稍微改变矢量初始化线(前面代码中的第5行)到(新代码中的第5,6行)

#include <vector>

long long sumOfMedians(int seed, int mul, int add, int N, int K)
{
  std::vector<int> nos; …
Run Code Online (Sandbox Code Playgroud)

c++ g++ vector c++11

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

python manage.py <commandname>在django 1.8中不起作用

from django.core.management.base import BaseCommand

def Command(BaseCommand):
    def handle(self, *args, **options):
        self.stdout.write( "lol" )
Run Code Online (Sandbox Code Playgroud)

所以我尝试在Django 1.8中创建一个自定义命令.它位于appname/management/commands/commandname.py目录中.但是,尝试使用以下命令运行命令:

python manage.py commandname
Run Code Online (Sandbox Code Playgroud)

产生了这个错误:

TypeError: Command() takes exactly 1 argument (0 given)
Run Code Online (Sandbox Code Playgroud)

我确保所有目录都包含__ init__.py文件,并且应用程序已添加到项目中.在线上似乎没有太多信息.请帮忙.

python django django-1.8

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