小编nst*_*tus的帖子

golang中的布尔值没有XOR运算符吗?

golang中的布尔值没有XOR运算符吗?

我试图做类似的事情,b1^b2但它说没有为布尔人定义.

go

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

如何为大型二进制数据配置MySQL 5.6 LONGBLOB

在我提出一个问题之前:我正在使用MySQL 5.5数据库的MySQL Workbench 6.1从一台机器到另一台机器上的5.6进行数据导出/导入.这两台机器都是ubuntu,其中一台是32位而另一台是64位.

我转储数据没有问题,但当我尝试加载它时,我得到:

ERROR 1118(42000)在第1807行:行大小太大(> 8126).将某些列更改为TEXT或BLOB或使用ROW_FORMAT = DYNAMIC或ROW_FORMAT = COMPRESSED可能会有所帮助.在当前行格式中,760字节的BLOB前缀以内联方式存储.

这是表创建:

CREATE TABLE `file_content` (
  `fileid` bigint(20) NOT NULL,
  `content` LONGBLOB NOT NULL,
  PRIMARY KEY (`fileid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Run Code Online (Sandbox Code Playgroud)

我有以下相关的my.cnf设置...

max_allowed_pa​​cket = 1G
innodb_file_per_table = 1
innodb_file_format = Barracuda

我花了很多谷歌搜索时间试图找出问题所在.顺便说一句,如果我删除主键(这里没问题,但另一个表有外键的表抱怨.

幸运的是,我有ssh访问框,所以我可以看到实际的mysqldb.log.为什么我发现真的很有意思......

2014-08-12 20:42:12 25246 [错误] InnoDB:总blob数据长度(14179167)大于重做日志文件大小(3072)的10%.请增加innodb_log_file_size.

因此,将重做日志文件大小增加到10x LONGBLOB大小修复了我的问题.但这是否意味着要插入1G LONGBLOB(因为数据包大小而实际最大值),我将需要一个10G innodb_log_file_size.

任何人都可以解释"重做日志大小错误"如何变成"行大小太大(> 8126)"错误.

顺便说一下,我无法控制这个数据库的结构,所以没有"你为什么要在数据库中存储大的blob".

TIA

mysql sql innodb row

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

禁用通知的振动

我正在使用通知编写应用程序.Google开发人员指南鼓励开发人员提供设置来自定义通知(禁用振动,设置通知声音......),因此如果用户设置通知,我会尝试禁用通知振动.

NotificationCompat.Builder用来创建通知,如下所示:

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(Application.getContext())
            .setDefaults(Notification.DEFAULT_ALL)
            .setPriority(Notification.PRIORITY_MAX)
            .setSmallIcon(R.drawable.ic_launcher)
            .setLargeIcon(largeIconBitmap)
            .setAutoCancel(true)
            .setContentIntent(resultPendingIntent)
            .setContentTitle(title)
            .setContentText(content);
Run Code Online (Sandbox Code Playgroud)

我尝试了不同的方法来禁用通知:

notificationBuilder.setVibrate(null);

notificationBuilder.setVibrate(new long[]{0l, 0l});

notificationBuilder.setDefaults(Notification.DEFAULT_ALL | ~Notification.DEFAULT_VIBRATE);

notificationBuilder.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND);`
Run Code Online (Sandbox Code Playgroud)

我还尝试在结果对象上构建通知并更改值:

Notification notification = notificationBuilder.build();
notification.vibrate = null;
Run Code Online (Sandbox Code Playgroud)

但是当通知出现时,手机仍会振动.

如何禁用通知振动?

notifications android vibration android-vibration

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

CakePHP找到MAX

表格和虚拟数据:

CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `user_id` int(11) unsigned NOT NULL,
  `node_id` int(11) unsigned NOT NULL,
  `reciever_id` int(11) unsigned NOT NULL,
  `created` datetime default NULL,
  `modified` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;


INSERT INTO `messages` (`id`, `user_id`, `node_id`, `reciever_id`, `created`, `modified`) VALUES
(1, 1, 1, 15, '2011-12-07 00:00:00', '2011-12-07 02:00:00'),
(2, 15, 1, 1, '2011-12-07 02:00:00', '2011-12-07 02:00:00'),
(3, 15, 2, 1, '2011-12-07 11:00:00', '2011-12-07 11:00:00'), …
Run Code Online (Sandbox Code Playgroud)

php mysql cakephp max cakephp-1.3

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

在Mercurial子存储库中使用特定的(git)分支

我有一个商业项目,我想在其中使用jQuery-File-Upload。我在.hgsub文件中添加了以下内容,以便为此插件创建子仓库:

public/assets/common/js/filedrop = [git]git://github.com/blueimp/jQuery-File-Upload.git
Run Code Online (Sandbox Code Playgroud)

我的问题是我需要jquery-ui在项目中的此git repo 的分支中使用。

有什么方法可以指定一个git repo的分支名称来提取为hg subrepo吗?

git mercurial branch subrepos mercurial-subrepos

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

startActionMode,appcompat出错

SherlockActionBar在我的应用程序中使用,但在我开始使用appcompat之后.并得到错误

" startActionMode(ActionMode.Callback)Activity类型中的方法不适用于参数(PageFragment.ActionModeCallback)"

在原始

   mActionMode = getActivity().startActionMode(new ActionModeCallback());
Run Code Online (Sandbox Code Playgroud)

请帮助我,我做错了什么?

android android-appcompat android-actionbar contextual-action-bar android-actionbaractivity

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

Piwik在Android应用程序中跟踪

我想使用Piwik为我的Android应用程序进行数据分析.

在Piwik的文档中,他们建议使用GitHub.

我得到了Piwik API并下载了以下文件:

https://github.com/piwik/piwik-java-tracking

我不知道该怎么用.

使用Piwik工作进行数据分析需要哪些步骤?

接下来我该怎么办?

api android matomo

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

未捕获的TypeError:无法读取null的属性'style' - JS错误

我从我的控制台收到一个javascript错误:

未捕获的TypeError:无法读取null的属性'style'

有谁知道什么是错的?

代码(JS):

<script>
    function select()
    {
        document.getElementById('#iframetest').style.display='block';
    }

</script>
Run Code Online (Sandbox Code Playgroud)

代码(HTML):

<iframe src="localhost/createaclass" id="iframetest"></iframe>

<div class="b" onclick="select()">
Run Code Online (Sandbox Code Playgroud)

javascript null jquery styles document

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