问题列表 - 第40488页

如何使用RSqlite将CSV导入sqlite?

作为问题,我发现我可以.import在sqlite shell中使用,但似乎它不适用于R环境,有什么建议吗?

sqlite import r

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

聚集索引必须是唯一的吗?

如果聚簇索引不是唯一的,会发生什么?是否会导致性能不佳,因为插入的行会流向某些类型的"溢出"页面?

它是"独特的",如果是这样的话怎么样?使它独一无二的最佳方法是什么?

我问,因为我目前正在使用聚集索引来划分逻辑部分中的表,但性能是如此,最近我得到使我的聚簇索引唯一的建议.我想就此发表第二个意见.

谢谢!

sql t-sql database clustered-index sql-server-2008

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

preparedStatement是否避免SQL注入?

我已阅读并尝试将易受攻击的SQL查询注入我的应用程序.这不够安全.我只是使用Statement Connection进行数据库验证和其他插入操作.

preparedStatements安全吗?而且这个陈述也会有问题吗?

java sql-injection jdbc prepared-statement

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

低通FIR滤波器 - 没有延迟

我正在使用FIR滤波器对音频进行过采样.这是一个简单的典型窗口sinc,即sinc函数被截断和窗口化.像往常一样,它需要过去和'未来'的样本才能工作.实际上,这意味着音频输出被延迟.sinc功能是理想的低通滤波器.我的问题是什么是等价的,除非没有'未来'样本.我想这个功能与砖墙IIR滤波器的脉冲响应相同.它将具有完美的砖墙切割,但不会有完美的相位响应.

signal-processing filter sampling

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

Emacs服务器文件路径

我正在使用Aquamacs并使用M- 启动emacs服务器x server-start.我emacsclient连接得很好.但是,当我启动另一个ssh会话(在同一台PC上)时,它找不到我的socket-name/server文件.它不在~/.emacs.d/server/server我期望的地方.

如何找出emacs服务器当前使用的server-file-socket-name?

这是我的工作配置:

.emacs

(setq server-socket-dir "~/.emacs.d/server")
(server-start)
Run Code Online (Sandbox Code Playgroud)

em.sh

location="/`whoami`@`hostname`:$(readlink -f $1)"
ssh <YOU@LOCAL-WORKSTATION> emacsclient -n -s '~/.emacs.d/server/server' $location
Run Code Online (Sandbox Code Playgroud)

emacs aquamacs emacsclient

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

asp CDO.Message.1错误'80040213'传输无法连接到服务器./check.asp,第25行

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/check.asp, line 25
Run Code Online (Sandbox Code Playgroud)

请帮忙解决这个问题

检查此代码

<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
dim to_field, message
to_field = Request.Form("to_field")
message = Request.Form("message")
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "admin@example.com" ' the address you want …
Run Code Online (Sandbox Code Playgroud)

asp-classic

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

将空值添加到数组

我有这个方法:

public function search($searchKey=null, $summary=null, $title=null, $authors=null, $paginationPage=0) { 
    ... 
}
Run Code Online (Sandbox Code Playgroud)

我正试图用这个检索所有参数:

$Class = new Search();

// Get parameters
$ReflectionMethod = new \ReflectionMethod($Class, "search");
try {
    foreach($ReflectionMethod->getParameters() AS $Parameter) {
        if(array_key_exists($Parameter->name, $this->params)) {
            $parameters[$Parameter->name] = $this->params[$Parameter->name];
    } elseif($Parameter->isDefaultValueAvailable()) {
        $paramaters[$Parameter->name] = $Parameter->getDefaultValue();
    } else {
            ...
    }
} catch(\Exception $e) {
        ...
}
    // Call function
return call_user_func_array(array($Class, "search"), $parameters);
Run Code Online (Sandbox Code Playgroud)

$this->params有这样的内容:

array
  'paginationPage' => int 2
  'id' => int 30
  'searchKey' => string 'test' (length=4)
Run Code Online (Sandbox Code Playgroud)

因为$ summary,$ title和$ …

php arrays reflection null

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

Github的Github语法高亮风格方案?

我喜欢github中用于R脚本的语法高亮样式方案,我想把它带到我的gedit编辑器.我在哪里可以得到它?

r syntax-highlighting github gedit

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

R作为通用编程语言

之前我喜欢Python,因为Python有丰富的内置类型,如集合,dicts,列表,元组.这些结构有助于编写简短的脚本来处理数据.

另一方面,R就像Matlab一样,并且有标量,向量,数据帧,数组和列表作为其数据类型.但是它缺少set,dicts,tuples等.我知道列表类型很强大,很多操作都可以被认为是列表处理.但是使用R作为通用语言的想法仍然模糊不清.

(以下只是一个例子.并不意味着我专注于文本处理/挖掘.)

例如,我需要为一组新闻文章(例如文件夹及其子文件夹中的200,000篇文章)进行TF-IDF计数.

读完文件后,我需要进行word-to-ID映射和其他计数任务.这些任务涉及字符串操作和需要容器,如set或map.

我知道我可以使用另一种语言来进行这些处理并将数据加载到R.但是也许(对于小事情)将所有预处理放入单个R脚本中会更好.

所以我的问题是R在语言层面的这种丰富的数据结构中有足够的能力吗?或者如果没有,任何软件包都为R语言提供了良好的扩展?

python wiki language-features r

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

如何在QWidget中实现mouseEnter和mouseLeave事件?

如何在QWidget中实现mouseEnter和mouseLeave事件?

如果mouseEnter到QWidget然后我需要将Background颜色设置为Gray,如果mouseLeave从QWidget那么我需要设置背景颜色是白色

我试过了

void enterEvent(QEvent *);
void leaveEvent(QEvent *);
Run Code Online (Sandbox Code Playgroud)

在enter&leave事件的内部我使用bool varibale设置true&false.我正在调用QPainter事件更新();

代码如下:

void Test::enterEvent(QEvent *)
{
   _mouseMove=true;
    update();

}

void Test::leaveEvent(QEvent *)
{
   _mouseMove=false;
    update();

}

void Test::paintEvent(QPaintEvent *)
{
    QPainter painter;
    painter.begin(&m_targetImage);
    painter.setRenderHint(QPainter::Antialiasing);

        if(_mouseMove){
            painter.fillRect(QRect(0,0,width(),height()),Qt::white);}
        else{
            painter.fillRect(QRect(0,0,width(),height()),Qt::gray);}

    painter.end();

    QPainter p;
    p.begin(this);
    p.drawImage(0, 0, m_targetImage);
    p.end();
}
Run Code Online (Sandbox Code Playgroud)

我在QWidget中移动鼠标时出现以下错误

QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::end: Painter not active, aborted
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.如果任何人有示例代码请提供给我....

qt

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