有没有人知道JavaScript的微积分库?我做了一些谷歌搜索并没有想出任何东西.我申请了WolframAlpha API,但除非他们选择给我一笔赠款,否则这是昂贵的.
理想情况下,我可以将2d点数组输入函数,然后返回导数点的图形(数组).
如果这样的库不存在,我将创建一个共享.
我们一直遇到模板错误偶尔潜入我们的生产站点的问题,所以如果有一个工具来捕获这些,我很乐意将它添加到我们的部署过程中.
有时,在我的脚本中间,我的webdriver实例将会死!
从那以后,我无法调用它的任何方法.
一些例子:
>>> spsel.driver.current_url
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 414, in current_url
return self.execute(Command.GET_CURRENT_URL)['value']
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 151, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/remote_connection.py", line 280, in execute
return self._request(url, method=command_info[0], data=data)
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/remote_connection.py", line 321, in _request
response = opener.open(request)
File "/usr/lib/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result …
Run Code Online (Sandbox Code Playgroud) 我一直在用 Electron (Chrome) 和 React 实现一个聊天客户端。我们的首要任务是速度。因此,我们应该使用虚拟化列表组件(也称为“缓冲渲染”或“窗口渲染”)。我们已经探索了 react-virtualized、react-window 和 react-infinite 等。
所有这些组件的一个共同点是,如果支持可变高度的列表元素,则需要提前知道高度。现在,有些聊天很长,有些很短,这对我们来说是一个挑战。(由于 EXIF 数据和 ffprobe,图像和视频很容易)。
因此,我们面临着测量高度的挑战,同时也竭力追求卓越的性能。一种明显的技术是将元素放在浏览器容器中,离开视口,执行测量,然后呈现列表。但这在性能要求方面伤害了我们。像 react-virtualized/CellMeasurer(不再由原作者维护)和 react-window 之类的软件使我们采用了这种技术,内置于库中,但性能有点慢且不可靠。一个可能更高效的类似想法是使用后台电子浏览器窗口来进行渲染和测量,但我的直觉是这不会更快。
我认为必须有一些解决的方法可以根据自动换行、最大宽度和字体规则提前确定字符串高度。
我目前的想法是使用像string-pixel-width这样的库,以便在我们通过 API 获取文本数据后立即计算行高。基本上,该库使用这段代码来生成字符宽度 [*] 的映射。然后,一旦我们知道每个文本的宽度,当它最大化计算出的最大行宽时,我们将每行分开,最后通过行数推断列表元素的高度。由于断字,它需要一点点算法摆弄,但有库可以帮助解决这个问题 - css-line-break似乎很有希望。
[*] 我们将不得不稍微修改它以考虑所有 Unicode 字符范围,但这是微不足道的。
我还没有完全探索的一些选项包括 python weasyprint 项目和 facebook-yoga 项目。我愿意接受你的想法!
weasyprint electron react-virtualized react-infinite react-window
我正在进行更改并将新文件添加到使用Parse Cloud Code托管的Node.js应用程序内的public /目录中.但是,当我进行"解析部署"时,Parse似乎没有跟踪这些更改.如果我对主Node.js应用程序进行更改,Parse会跟踪这些更改.
遗憾的是,公共/文件未列在我的信息中心内"Cloud Code"标签的"文件"标签内,因此我无法看到它们是否正在更新.
但是,如果我尝试像curl http://my-app.parseapp.com/js/file.js
我看到旧版本的东西.如果我这样做,curl http://my-app.parseapp.com/js/newFile.js
我没有看到我添加的新文件.
我想在关闭窗口后立即使用AJAX GET或POST向我的服务器发送ping.是window.onbeforeunload
个好主意?
webhook正在给我发一个POST,我想对它做一些调试.目前我正在循环阵列上,然后发送邮件()对自己,而不是印刷(因为我怎么会看看有什么打印页面?),但我打赌有一个更有效的方法.
有什么建议?
有没有人有使用Selenium自动测试使用Facebook Connect进行用户登录的webapp的经验?您推荐的任何提示或方法?
It's quite often the case that my selenium script will be running, and then all of a sudden it will crash with an error:
<class 'selenium.common.exceptions.NoSuchElementException'>
Message: u'Unable to locate element: {"method":"id","selector":"the_element_id"}'
<traceback object at 0x1017a9638>
Run Code Online (Sandbox Code Playgroud)
And if I run in interactive mode (python -i myseltest.py), if I simply do something like:
driver.switch_to_window(driver.window_handles[0])
Run Code Online (Sandbox Code Playgroud)
And then run the specific find_element_by_id()
again, it will succeed.
有什么办法可以自动尝试driver.switch_to_window()
invocation if an exception occurs?
在我的单元格的可重用视图内,我有一个UIView.
然后,我在控制器中有这个方法
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
// .. set value for CGFloat backgroundHeight
[cell addSubview:cell.backgroundView];
CGRect f = cell.backgroundView.frame;
f.size.height = backgroundHeight;
cell.backgroundView.frame = f;
}
Run Code Online (Sandbox Code Playgroud)
但是UIView的高度保持与Layout Rectangle中指定的相同.
我接下来应该尝试什么?
selenium ×3
javascript ×2
python ×2
selenium-rc ×2
ajax ×1
calculus ×1
electron ×1
exception ×1
facebook ×1
freemarker ×1
ios ×1
java ×1
lint ×1
math ×1
php ×1
post ×1
react-window ×1
subview ×1
uiview ×1
urllib2 ×1
weasyprint ×1
webdriver ×1
webhooks ×1