我经常使用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) 在新的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))
编译这段代码:
#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) 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文件,并且应用程序已添加到项目中.在线上似乎没有太多信息.请帮忙.